@ronak27/superwise-chatbot-package 1.0.12 → 1.0.13
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/chatbot-plugin.css +1 -0
- package/dist/react-chatbot.es.js +666 -1426
- package/dist/react-chatbot.umd.js +11 -492
- package/package.json +1 -1
- package/dist/superwise-chatbot-package.css +0 -1
package/dist/react-chatbot.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import De, { memo as Me, useState as H, useRef as A, useEffect as P, useMemo as ge, useCallback as Y } from "react";
|
|
2
|
+
var ye = { exports: {} }, ee = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var xe = { exports: {} }, se = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var t = Symbol.for("react.transitional.element"),
|
|
17
|
-
function i
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return
|
|
12
|
+
var je;
|
|
13
|
+
function Fe() {
|
|
14
|
+
if (je) return ee;
|
|
15
|
+
je = 1;
|
|
16
|
+
var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
17
|
+
function a(i, n, m) {
|
|
18
|
+
var g = null;
|
|
19
|
+
if (m !== void 0 && (g = "" + m), n.key !== void 0 && (g = "" + n.key), "key" in n) {
|
|
20
|
+
m = {};
|
|
21
|
+
for (var l in n)
|
|
22
|
+
l !== "key" && (m[l] = n[l]);
|
|
23
|
+
} else m = n;
|
|
24
|
+
return n = m.ref, {
|
|
25
25
|
$$typeof: t,
|
|
26
|
-
type:
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
26
|
+
type: i,
|
|
27
|
+
key: g,
|
|
28
|
+
ref: n !== void 0 ? n : null,
|
|
29
|
+
props: m
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return ee.Fragment = r, ee.jsx = a, ee.jsxs = a, ee;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var te = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,167 +41,167 @@ var ae = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
function t(
|
|
48
|
-
if (
|
|
49
|
-
if (typeof
|
|
50
|
-
return
|
|
51
|
-
if (typeof
|
|
52
|
-
switch (
|
|
53
|
-
case
|
|
44
|
+
var He;
|
|
45
|
+
function Ze() {
|
|
46
|
+
return He || (He = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
+
function t(s) {
|
|
48
|
+
if (s == null) return null;
|
|
49
|
+
if (typeof s == "function")
|
|
50
|
+
return s.$$typeof === le ? null : s.displayName || s.name || null;
|
|
51
|
+
if (typeof s == "string") return s;
|
|
52
|
+
switch (s) {
|
|
53
|
+
case v:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case R:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case S:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case N:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case oe:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case ie:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
|
-
if (typeof
|
|
67
|
-
switch (typeof
|
|
66
|
+
if (typeof s == "object")
|
|
67
|
+
switch (typeof s.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
),
|
|
70
|
-
case
|
|
69
|
+
), s.$$typeof) {
|
|
70
|
+
case w:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
73
|
-
return
|
|
74
|
-
case
|
|
75
|
-
return (
|
|
76
|
-
case
|
|
77
|
-
var
|
|
78
|
-
return
|
|
79
|
-
case
|
|
80
|
-
return
|
|
81
|
-
case
|
|
82
|
-
|
|
72
|
+
case se:
|
|
73
|
+
return s.displayName || "Context";
|
|
74
|
+
case B:
|
|
75
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case ne:
|
|
77
|
+
var d = s.render;
|
|
78
|
+
return s = s.displayName, s || (s = d.displayName || d.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
79
|
+
case ae:
|
|
80
|
+
return d = s.displayName || null, d !== null ? d : t(s.type) || "Memo";
|
|
81
|
+
case J:
|
|
82
|
+
d = s._payload, s = s._init;
|
|
83
83
|
try {
|
|
84
|
-
return t(
|
|
84
|
+
return t(s(d));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return "" +
|
|
90
|
+
function r(s) {
|
|
91
|
+
return "" + s;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function a(s) {
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
var
|
|
95
|
+
r(s);
|
|
96
|
+
var d = !1;
|
|
97
97
|
} catch {
|
|
98
|
-
|
|
98
|
+
d = !0;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
104
|
-
|
|
100
|
+
if (d) {
|
|
101
|
+
d = console;
|
|
102
|
+
var b = d.error, E = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
103
|
+
return b.call(
|
|
104
|
+
d,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
106
|
E
|
|
107
|
-
),
|
|
107
|
+
), r(s);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
if (typeof
|
|
110
|
+
function i(s) {
|
|
111
|
+
if (s === v) return "<>";
|
|
112
|
+
if (typeof s == "object" && s !== null && s.$$typeof === J)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
115
|
+
var d = t(s);
|
|
116
|
+
return d ? "<" + d + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var
|
|
123
|
-
return
|
|
121
|
+
function n() {
|
|
122
|
+
var s = M.A;
|
|
123
|
+
return s === null ? null : s.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function m() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
128
|
+
function g(s) {
|
|
129
|
+
if ($.call(s, "key")) {
|
|
130
|
+
var d = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
131
|
+
if (d && d.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return s.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
135
|
+
function l(s, d) {
|
|
136
|
+
function b() {
|
|
137
|
+
K || (K = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
|
|
139
|
+
d
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
b.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
143
|
+
get: b,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
return
|
|
147
|
+
function p() {
|
|
148
|
+
var s = t(this.type);
|
|
149
|
+
return q[s] || (q[s] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
-
)),
|
|
151
|
+
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return
|
|
156
|
-
$$typeof:
|
|
157
|
-
type:
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
153
|
+
function c(s, d, b, E, G, V) {
|
|
154
|
+
var L = b.ref;
|
|
155
|
+
return s = {
|
|
156
|
+
$$typeof: h,
|
|
157
|
+
type: s,
|
|
158
|
+
key: d,
|
|
159
|
+
props: b,
|
|
160
160
|
_owner: E
|
|
161
|
-
}, (
|
|
161
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(s, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
|
-
get:
|
|
164
|
-
}) : Object.defineProperty(
|
|
163
|
+
get: p
|
|
164
|
+
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
writable: !0,
|
|
168
168
|
value: 0
|
|
169
|
-
}), Object.defineProperty(
|
|
169
|
+
}), Object.defineProperty(s, "_debugInfo", {
|
|
170
170
|
configurable: !1,
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
writable: !0,
|
|
173
173
|
value: null
|
|
174
|
-
}), Object.defineProperty(
|
|
174
|
+
}), Object.defineProperty(s, "_debugStack", {
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
179
|
-
}), Object.defineProperty(
|
|
178
|
+
value: G
|
|
179
|
+
}), Object.defineProperty(s, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.freeze && (Object.freeze(
|
|
183
|
+
value: V
|
|
184
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
186
|
+
function C(s, d, b, E, G, V) {
|
|
187
|
+
var L = d.children;
|
|
188
|
+
if (L !== void 0)
|
|
189
189
|
if (E)
|
|
190
|
-
if (
|
|
191
|
-
for (E = 0; E <
|
|
192
|
-
L
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
190
|
+
if (ce(L)) {
|
|
191
|
+
for (E = 0; E < L.length; E++)
|
|
192
|
+
j(L[E]);
|
|
193
|
+
Object.freeze && Object.freeze(L);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
197
|
);
|
|
198
|
-
else L
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
198
|
+
else j(L);
|
|
199
|
+
if ($.call(d, "key")) {
|
|
200
|
+
L = t(s);
|
|
201
|
+
var I = Object.keys(d).filter(function(he) {
|
|
202
|
+
return he !== "key";
|
|
203
203
|
});
|
|
204
|
-
E = 0 <
|
|
204
|
+
E = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", ue[L + E] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
@@ -209,922 +209,233 @@ React keys must be passed directly to JSX without using spread:
|
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
211
|
E,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
212
|
+
L,
|
|
213
|
+
I,
|
|
214
|
+
L
|
|
215
|
+
), ue[L + E] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
typeof
|
|
225
|
-
),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
217
|
+
if (L = null, b !== void 0 && (a(b), L = "" + b), g(d) && (a(d.key), L = "" + d.key), "key" in d) {
|
|
218
|
+
b = {};
|
|
219
|
+
for (var T in d)
|
|
220
|
+
T !== "key" && (b[T] = d[T]);
|
|
221
|
+
} else b = d;
|
|
222
|
+
return L && l(
|
|
223
|
+
b,
|
|
224
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
225
|
+
), c(
|
|
226
|
+
s,
|
|
227
|
+
L,
|
|
228
|
+
b,
|
|
229
|
+
n(),
|
|
230
|
+
G,
|
|
231
|
+
V
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
234
|
+
function j(s) {
|
|
235
|
+
f(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === J && (s._payload.status === "fulfilled" ? f(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof
|
|
237
|
+
function f(s) {
|
|
238
|
+
return typeof s == "object" && s !== null && s.$$typeof === h;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var u = De, h = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), se = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), ie = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), M = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, ce = Array.isArray, de = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
244
|
-
react_stack_bottom_frame: function(
|
|
245
|
-
return
|
|
243
|
+
u = {
|
|
244
|
+
react_stack_bottom_frame: function(s) {
|
|
245
|
+
return s();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var E = 1e4 >
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
248
|
+
var K, q = {}, D = u.react_stack_bottom_frame.bind(
|
|
249
|
+
u,
|
|
250
|
+
m
|
|
251
|
+
)(), Q = de(i(m)), ue = {};
|
|
252
|
+
te.Fragment = v, te.jsx = function(s, d, b) {
|
|
253
|
+
var E = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return C(
|
|
255
|
+
s,
|
|
256
|
+
d,
|
|
257
|
+
b,
|
|
258
258
|
!1,
|
|
259
|
-
E ? Error("react-stack-top-frame") :
|
|
260
|
-
E ?
|
|
259
|
+
E ? Error("react-stack-top-frame") : D,
|
|
260
|
+
E ? de(i(s)) : Q
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var E = 1e4 >
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
262
|
+
}, te.jsxs = function(s, d, b) {
|
|
263
|
+
var E = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return C(
|
|
265
|
+
s,
|
|
266
|
+
d,
|
|
267
|
+
b,
|
|
268
268
|
!0,
|
|
269
|
-
E ? Error("react-stack-top-frame") :
|
|
270
|
-
E ?
|
|
269
|
+
E ? Error("react-stack-top-frame") : D,
|
|
270
|
+
E ? de(i(s)) : Q
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
|
-
}()),
|
|
273
|
+
}()), te;
|
|
274
274
|
}
|
|
275
|
-
process.env.NODE_ENV === "production" ?
|
|
276
|
-
var e =
|
|
277
|
-
const
|
|
275
|
+
process.env.NODE_ENV === "production" ? ye.exports = Fe() : ye.exports = Ze();
|
|
276
|
+
var e = ye.exports;
|
|
277
|
+
const Be = [
|
|
278
278
|
"Parameters:",
|
|
279
279
|
"additional_parameter_company_name:",
|
|
280
280
|
"additional_parameter_company_size:",
|
|
281
281
|
"additional_parameter_user_role:",
|
|
282
282
|
"additional_parameter_use_case:"
|
|
283
|
-
],
|
|
284
|
-
function
|
|
283
|
+
], re = "Apologize, I’m unable to respond at the moment. Please try asking your question again or click Contact Sales to get in touch with our team.";
|
|
284
|
+
function qe(t) {
|
|
285
285
|
if (typeof t != "string" || t.length === 0) return t;
|
|
286
|
-
let
|
|
287
|
-
for (const
|
|
286
|
+
let r = t;
|
|
287
|
+
for (const a of Be)
|
|
288
288
|
for (; ; ) {
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
let
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
|
|
298
|
-
else if (
|
|
299
|
-
|
|
289
|
+
const i = r.indexOf(a);
|
|
290
|
+
if (i === -1) break;
|
|
291
|
+
const n = r.indexOf("{", i);
|
|
292
|
+
if (n === -1) break;
|
|
293
|
+
let m = 0, g = -1;
|
|
294
|
+
for (let c = n; c < r.length; c++) {
|
|
295
|
+
const C = r[c];
|
|
296
|
+
if (C === "{")
|
|
297
|
+
m++;
|
|
298
|
+
else if (C === "}" && (m--, m === 0)) {
|
|
299
|
+
g = c;
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
|
|
303
|
+
if (g === -1) break;
|
|
304
|
+
const l = r.slice(0, i).trim(), p = r.slice(g + 1).trim();
|
|
305
|
+
r = l + (p.length > 0 ? " " + p : "");
|
|
306
306
|
}
|
|
307
|
-
return
|
|
307
|
+
return r.includes("Parameters:") && (r = r.split("Parameters:")[0].trim()), r;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Ge(t) {
|
|
310
310
|
if (typeof t != "string" || t.length === 0) return t;
|
|
311
|
-
const
|
|
312
|
-
return
|
|
311
|
+
const r = t.trim();
|
|
312
|
+
return r.startsWith("Message: ") ? r.slice(9).trim() : r.startsWith("Message : ") ? r.slice(11).trim() : t;
|
|
313
313
|
}
|
|
314
|
-
async function
|
|
315
|
-
var
|
|
316
|
-
const
|
|
317
|
-
role:
|
|
318
|
-
message:
|
|
319
|
-
})) : [],
|
|
314
|
+
async function ze(t, r = [], a = [], i = "", n = "", m = "", g = null) {
|
|
315
|
+
var j, f, u;
|
|
316
|
+
const l = typeof m == "string" && m.trim().length > 0 ? m.trim() : "https://sage-api-ttyw-stage.superwise.ai/api/v1/", p = l.replace(/\/+$/, "").endsWith("/chat") ? l : l.replace(/\/+$/, "") + "/chat", c = Array.isArray(r) ? r.map((h) => ({
|
|
317
|
+
role: h.role,
|
|
318
|
+
message: h.content != null ? h.content : ""
|
|
319
|
+
})) : [], C = {
|
|
320
320
|
user_input: t,
|
|
321
|
-
chat_history:
|
|
322
|
-
mql_df: Array.isArray(
|
|
323
|
-
agent_id:
|
|
324
|
-
discovery_agent_id:
|
|
321
|
+
chat_history: c,
|
|
322
|
+
mql_df: Array.isArray(a) ? a : [],
|
|
323
|
+
agent_id: i,
|
|
324
|
+
discovery_agent_id: n,
|
|
325
325
|
utm_source: "Web",
|
|
326
326
|
utm_medium: "chatbot"
|
|
327
327
|
};
|
|
328
|
-
console.log("Sending payload:",
|
|
328
|
+
console.log("Sending payload:", C);
|
|
329
329
|
try {
|
|
330
|
-
const
|
|
330
|
+
const h = await fetch(p, {
|
|
331
331
|
method: "POST",
|
|
332
332
|
headers: {
|
|
333
333
|
"Content-Type": "application/json",
|
|
334
334
|
Accept: "application/json"
|
|
335
335
|
},
|
|
336
|
-
body: JSON.stringify(
|
|
337
|
-
signal:
|
|
336
|
+
body: JSON.stringify(C),
|
|
337
|
+
signal: g ?? void 0
|
|
338
338
|
});
|
|
339
|
-
if (console.log("Response status:",
|
|
340
|
-
const
|
|
341
|
-
return console.error("API Error Response:",
|
|
339
|
+
if (console.log("Response status:", h.status), console.log("Response headers:", h.headers), !h.ok) {
|
|
340
|
+
const B = await h.text();
|
|
341
|
+
return console.error("API Error Response:", B), { reply: re, mqlDf: [], isError: !0, status: h.status };
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
console.log("API Response Data:",
|
|
345
|
-
let
|
|
346
|
-
return
|
|
347
|
-
} catch (
|
|
348
|
-
if (console.error("API call failed:",
|
|
349
|
-
throw
|
|
350
|
-
return
|
|
343
|
+
const w = await h.json();
|
|
344
|
+
console.log("API Response Data:", w);
|
|
345
|
+
let v = "⚠️ No reply from server.", S = [], R = !1;
|
|
346
|
+
return w.chat_response ? v = w.chat_response : w.success && ((j = w.data) != null && j.chat_response) ? v = w.data.chat_response : w.message && (v = w.message), w.mql_df ? S = w.mql_df : (f = w.data) != null && f.mql_df && (S = w.data.mql_df), (w.chat_history_limit_exceeded === !0 || ((u = w.data) == null ? void 0 : u.chat_history_limit_exceeded) === !0) && (R = !0), v = qe(v), v = Ge(v), { reply: v, mqlDf: S, chatHistoryLimitExceeded: R };
|
|
347
|
+
} catch (h) {
|
|
348
|
+
if (console.error("API call failed:", h), h.name === "AbortError")
|
|
349
|
+
throw h;
|
|
350
|
+
return h.name === "TypeError" && h.message.includes("fetch") ? { reply: re, mqlDf: [], isError: !0 } : { reply: re, mqlDf: [], isError: !0 };
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
async function
|
|
354
|
-
const
|
|
353
|
+
async function Ye(t, r = null, a = [], i = "") {
|
|
354
|
+
const g = (typeof i == "string" && i.trim().length > 0 ? i.trim() : "https://sage-api-ttyw-stage.superwise.ai/api/v1/").replace(/\/+$/, "").replace(/\/chat\/?$/, "").replace(/\/+$/, "") + "/pdf", l = Array.isArray(t) && t.length > 0 ? t[0] : r || {
|
|
355
355
|
name: "User",
|
|
356
356
|
email: "user@example.com",
|
|
357
357
|
summary: "Chat conversation summary"
|
|
358
|
-
},
|
|
359
|
-
role:
|
|
360
|
-
message:
|
|
361
|
-
})) : [],
|
|
362
|
-
lead_row:
|
|
363
|
-
chat_history:
|
|
358
|
+
}, p = Array.isArray(a) ? a.map((C) => ({
|
|
359
|
+
role: C.role,
|
|
360
|
+
message: C.content != null ? C.content : ""
|
|
361
|
+
})) : [], c = {
|
|
362
|
+
lead_row: l,
|
|
363
|
+
chat_history: p
|
|
364
364
|
};
|
|
365
|
-
console.log("Downloading PDF with payload:",
|
|
365
|
+
console.log("Downloading PDF with payload:", c);
|
|
366
366
|
try {
|
|
367
|
-
const
|
|
367
|
+
const C = await fetch(g, {
|
|
368
368
|
method: "POST",
|
|
369
369
|
headers: {
|
|
370
370
|
"Content-Type": "application/json",
|
|
371
371
|
Accept: "application/pdf"
|
|
372
372
|
},
|
|
373
|
-
body: JSON.stringify(
|
|
373
|
+
body: JSON.stringify(c)
|
|
374
374
|
});
|
|
375
|
-
if (console.log("PDF Response status:",
|
|
376
|
-
const
|
|
377
|
-
throw console.error("PDF API Error Response:",
|
|
375
|
+
if (console.log("PDF Response status:", C.status), !C.ok) {
|
|
376
|
+
const h = await C.text();
|
|
377
|
+
throw console.error("PDF API Error Response:", h), new Error(`PDF API Error ${C.status}: ${h}`);
|
|
378
378
|
}
|
|
379
|
-
const
|
|
380
|
-
return
|
|
381
|
-
} catch (
|
|
382
|
-
throw console.error("PDF download failed:",
|
|
379
|
+
const j = await C.blob(), f = window.URL.createObjectURL(j), u = document.createElement("a");
|
|
380
|
+
return u.href = f, u.download = `chatbot-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.pdf`, document.body.appendChild(u), u.click(), document.body.removeChild(u), window.URL.revokeObjectURL(f), !0;
|
|
381
|
+
} catch (C) {
|
|
382
|
+
throw console.error("PDF download failed:", C), C;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
const y = {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
height: "75vh",
|
|
396
|
-
display: "flex",
|
|
397
|
-
flexDirection: "column",
|
|
398
|
-
borderRadius: "1rem",
|
|
399
|
-
background: "white",
|
|
400
|
-
boxShadow: "0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",
|
|
401
|
-
boxSizing: "border-box"
|
|
402
|
-
},
|
|
403
|
-
containerExpanded: {
|
|
404
|
-
position: "fixed",
|
|
405
|
-
top: "5px",
|
|
406
|
-
left: "10px",
|
|
407
|
-
right: "20px",
|
|
408
|
-
bottom: "20px",
|
|
409
|
-
zIndex: 999999,
|
|
410
|
-
fontFamily: "'Inter', sans-serif",
|
|
411
|
-
display: "flex",
|
|
412
|
-
flexDirection: "column",
|
|
413
|
-
borderRadius: "0",
|
|
414
|
-
background: "white",
|
|
415
|
-
boxShadow: "0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",
|
|
416
|
-
boxSizing: "border-box"
|
|
417
|
-
},
|
|
418
|
-
containerMinimized: {
|
|
419
|
-
position: "fixed",
|
|
420
|
-
bottom: "20px",
|
|
421
|
-
right: "20px",
|
|
422
|
-
zIndex: 999999,
|
|
423
|
-
fontFamily: "'Inter', sans-serif",
|
|
424
|
-
width: "auto",
|
|
425
|
-
minWidth: "auto",
|
|
426
|
-
maxWidth: "none",
|
|
427
|
-
height: "auto",
|
|
428
|
-
display: "flex",
|
|
429
|
-
flexDirection: "row",
|
|
430
|
-
borderRadius: "25px",
|
|
431
|
-
background: "var(--swttyw-minimized-button-color)",
|
|
432
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
433
|
-
boxSizing: "border-box",
|
|
434
|
-
padding: "12px 16px",
|
|
435
|
-
alignItems: "center",
|
|
436
|
-
justifyContent: "center",
|
|
437
|
-
cursor: "pointer"
|
|
438
|
-
},
|
|
439
|
-
header: {
|
|
440
|
-
position: "relative",
|
|
441
|
-
display: "flex",
|
|
442
|
-
alignItems: "center",
|
|
443
|
-
justifyContent: "space-between",
|
|
444
|
-
padding: "10px",
|
|
445
|
-
background: "var(--swttyw-primary-color)",
|
|
446
|
-
color: "#fff",
|
|
447
|
-
borderRadius: "10px 10px 0 0",
|
|
448
|
-
fontFamily: "'Inter', sans-serif",
|
|
449
|
-
flexShrink: 0,
|
|
450
|
-
boxSizing: "border-box"
|
|
451
|
-
},
|
|
452
|
-
name: {
|
|
453
|
-
fontWeight: 500,
|
|
454
|
-
fontSize: "var(--swttyw-header-font-size)",
|
|
455
|
-
color: "#fff",
|
|
456
|
-
flexGrow: 1,
|
|
457
|
-
marginBottom: "0.125rem",
|
|
458
|
-
wordBreak: "break-all"
|
|
459
|
-
},
|
|
460
|
-
headerActions: {
|
|
461
|
-
display: "flex",
|
|
462
|
-
alignItems: "center",
|
|
463
|
-
gap: "8px"
|
|
464
|
-
},
|
|
465
|
-
headerButton: {
|
|
466
|
-
background: "transparent",
|
|
467
|
-
border: "none",
|
|
468
|
-
color: "#fff",
|
|
469
|
-
cursor: "pointer",
|
|
470
|
-
padding: "4px",
|
|
471
|
-
borderRadius: "4px",
|
|
472
|
-
display: "flex",
|
|
473
|
-
alignItems: "center",
|
|
474
|
-
justifyContent: "center",
|
|
475
|
-
width: "24px",
|
|
476
|
-
height: "24px",
|
|
477
|
-
textDecoration: "none",
|
|
478
|
-
transition: "opacity 0.3s ease"
|
|
479
|
-
},
|
|
480
|
-
chatSection: {
|
|
481
|
-
padding: "1rem",
|
|
482
|
-
backgroundColor: "var(--swttyw-background-color)",
|
|
483
|
-
flexGrow: 1,
|
|
484
|
-
overflowY: "auto",
|
|
485
|
-
overflowX: "hidden",
|
|
486
|
-
display: "flex",
|
|
487
|
-
flexDirection: "column",
|
|
488
|
-
boxShadow: "inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05)",
|
|
489
|
-
height: "calc(50vh - 200px)"
|
|
490
|
-
},
|
|
491
|
-
inputSection: {
|
|
492
|
-
boxSizing: "border-box",
|
|
493
|
-
flexBasis: "4rem",
|
|
494
|
-
flexShrink: 0,
|
|
495
|
-
display: "flex",
|
|
496
|
-
alignItems: "center",
|
|
497
|
-
boxShadow: "0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2)",
|
|
498
|
-
margin: "0.50rem"
|
|
499
|
-
},
|
|
500
|
-
textarea: {
|
|
501
|
-
border: "none",
|
|
502
|
-
backgroundImage: "none",
|
|
503
|
-
backgroundColor: "white",
|
|
504
|
-
padding: "0.5rem 1rem",
|
|
505
|
-
marginRight: "1rem",
|
|
506
|
-
borderRadius: "10px",
|
|
507
|
-
flexGrow: 2,
|
|
508
|
-
fontFamily: "'Inter', sans-serif",
|
|
509
|
-
fontWeight: 400,
|
|
510
|
-
letterSpacing: "0.025em",
|
|
511
|
-
resize: "none",
|
|
512
|
-
fontSize: "16px",
|
|
513
|
-
outline: "none"
|
|
514
|
-
},
|
|
515
|
-
inputFooter: {
|
|
516
|
-
display: "flex",
|
|
517
|
-
flexDirection: "column",
|
|
518
|
-
justifyContent: "space-between",
|
|
519
|
-
padding: "5px"
|
|
520
|
-
},
|
|
521
|
-
sendButton: {
|
|
522
|
-
background: "transparent",
|
|
523
|
-
border: "0px",
|
|
524
|
-
cursor: "pointer",
|
|
525
|
-
display: "flex",
|
|
526
|
-
alignItems: "center",
|
|
527
|
-
justifyContent: "center",
|
|
528
|
-
color: "#000000"
|
|
529
|
-
},
|
|
530
|
-
characterCount: {
|
|
531
|
-
fontSize: "12px",
|
|
532
|
-
color: "var(--swttyw-primary-color)",
|
|
533
|
-
textAlign: "center"
|
|
534
|
-
},
|
|
535
|
-
modalOverlay: {
|
|
536
|
-
position: "absolute",
|
|
537
|
-
background: "#ffffffe8",
|
|
538
|
-
height: "calc(100% - 85px)",
|
|
539
|
-
width: "100%",
|
|
540
|
-
top: "48px",
|
|
541
|
-
display: "flex",
|
|
542
|
-
justifyContent: "center",
|
|
543
|
-
alignItems: "center"
|
|
544
|
-
},
|
|
545
|
-
modalBody: {
|
|
546
|
-
textAlign: "center"
|
|
547
|
-
},
|
|
548
|
-
modalActions: {
|
|
549
|
-
display: "flex",
|
|
550
|
-
justifyContent: "center"
|
|
551
|
-
},
|
|
552
|
-
footer: {
|
|
553
|
-
flexShrink: 0,
|
|
554
|
-
display: "flex",
|
|
555
|
-
alignItems: "center",
|
|
556
|
-
justifyContent: "center",
|
|
557
|
-
background: "var(--swttyw-primary-color)",
|
|
558
|
-
borderRadius: "0 0 10px 10px",
|
|
559
|
-
paddingBottom: "6px",
|
|
560
|
-
paddingTop: "6px",
|
|
561
|
-
marginTop: "0px",
|
|
562
|
-
color: "#f8f9fa",
|
|
563
|
-
fontSize: "var(--swttyw-footer-font-size)",
|
|
564
|
-
borderTop: "3px solid var(--swttyw-primary-color)",
|
|
565
|
-
padding: "15px 0px",
|
|
566
|
-
fontFamily: "'Inter', sans-serif"
|
|
567
|
-
},
|
|
568
|
-
message: {
|
|
569
|
-
boxSizing: "border-box",
|
|
570
|
-
padding: "0.5rem 1rem",
|
|
571
|
-
margin: "1rem",
|
|
572
|
-
background: "#FFF",
|
|
573
|
-
borderRadius: "1.125rem 1.125rem 1.125rem 0",
|
|
574
|
-
minHeight: "2.25rem",
|
|
575
|
-
width: "fit-content",
|
|
576
|
-
boxShadow: "0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1)",
|
|
577
|
-
fontSize: "15px",
|
|
578
|
-
wordBreak: "break-word",
|
|
579
|
-
fontFamily: "'Inter', sans-serif",
|
|
580
|
-
display: "table",
|
|
581
|
-
alignItems: "flex-start",
|
|
582
|
-
gap: "8px",
|
|
583
|
-
position: "relative"
|
|
584
|
-
},
|
|
585
|
-
messageSelf: {
|
|
586
|
-
margin: "1rem 1rem 1rem auto",
|
|
587
|
-
borderRadius: "1.125rem 1.125rem 0 1.125rem",
|
|
588
|
-
background: "#000000",
|
|
589
|
-
color: "white",
|
|
590
|
-
position: "relative",
|
|
591
|
-
maxWidth: "80%",
|
|
592
|
-
fontSize: "var(--swttyw-body-font-size)",
|
|
593
|
-
flexDirection: "row-reverse"
|
|
594
|
-
},
|
|
595
|
-
messageOther: {
|
|
596
|
-
position: "relative",
|
|
597
|
-
fontSize: "var(--swttyw-body-font-size)"
|
|
598
|
-
},
|
|
599
|
-
messageAvatar: {
|
|
600
|
-
width: "24px",
|
|
601
|
-
height: "24px",
|
|
602
|
-
borderRadius: "50%",
|
|
603
|
-
flexShrink: 0,
|
|
604
|
-
display: "flex",
|
|
605
|
-
alignItems: "center",
|
|
606
|
-
justifyContent: "center",
|
|
607
|
-
fontSize: "12px",
|
|
608
|
-
fontWeight: "bold",
|
|
609
|
-
position: "absolute",
|
|
610
|
-
top: "5px"
|
|
611
|
-
},
|
|
612
|
-
messageContent: {
|
|
613
|
-
flex: 1,
|
|
614
|
-
marginLeft: "32px",
|
|
615
|
-
marginRight: "8px"
|
|
616
|
-
},
|
|
617
|
-
minimizedContent: {
|
|
618
|
-
display: "flex",
|
|
619
|
-
alignItems: "center",
|
|
620
|
-
gap: "12px",
|
|
621
|
-
color: "white",
|
|
622
|
-
flex: 1
|
|
623
|
-
},
|
|
624
|
-
chatIcon: {
|
|
625
|
-
width: "20px",
|
|
626
|
-
height: "20px",
|
|
627
|
-
flexShrink: 0
|
|
385
|
+
const Je = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='190'%20height='42'%20viewBox='0%200%20190%2042'%20fill='none'%3e%3cpath%20d='M17.2253%2014.2603C17.155%2014.0259%2016.9441%2013.8618%2016.7097%2013.8618H14.6472C14.3894%2013.8618%2014.1785%2014.0259%2014.1316%2014.2603L10.7801%2027.5053C10.7332%2027.6694%2010.7801%2027.8335%2010.8739%2027.9741C10.9676%2028.1148%2011.1317%2028.1851%2011.2957%2028.1851H12.9363C13.1941%2028.1851%2013.4051%2027.9976%2013.4754%2027.7631L14.0613%2025.0673H17.3191L17.905%2027.7631C17.9519%2028.021%2018.1862%2028.1851%2018.444%2028.1851H20.0846C20.2487%2028.1851%2020.4128%2028.1148%2020.5065%2027.9741C20.6003%2027.8335%2020.6471%2027.6694%2020.6003%2027.5053L17.2488%2014.2603H17.2253ZM14.5769%2022.5824L15.655%2017.636L16.7566%2022.5824H14.5769Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M23.8359%2013.8618H22.2656C21.9609%2013.8618%2021.7266%2014.0962%2021.7266%2014.401V27.6459C21.7266%2027.9507%2021.9609%2028.1851%2022.2656%2028.1851H23.8359C24.1406%2028.1851%2024.375%2027.9507%2024.375%2027.6459V14.401C24.375%2014.0962%2024.1406%2013.8618%2023.8359%2013.8618ZM22.2891%2014.0493C22.2422%2014.0493%2022.1953%2014.0493%2022.1484%2014.0728C22.1953%2014.0728%2022.2422%2014.0493%2022.2891%2014.0493Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M36.1401%2029.4041L36.0932%2012.5256C36.0932%2011.3066%2035.4369%2010.1579%2034.3588%209.5484L19.7341%201.15601C18.6794%200.546507%2017.3669%200.546507%2016.2888%201.15601L1.71091%209.61872C0.65624%2010.2282%200%2011.3769%200%2012.5959L0.046874%2029.4744C0.046874%2030.6934%200.703114%2031.8421%201.78122%2032.4516L16.406%2040.844C17.4607%2041.4535%2018.7731%2041.4535%2019.8513%2040.844L34.4291%2032.3813C35.4838%2031.7718%2036.1401%2030.6231%2036.1401%2029.4041ZM11.9998%2031.5608C6.16397%2028.1851%204.17181%2020.7539%207.54676%2014.9167C10.8983%209.07955%2018.3513%207.08694%2024.1871%2010.4626C30.023%2013.8149%2032.0151%2021.2696%2028.6402%2027.1068C25.2887%2032.9439%2017.8357%2034.9365%2011.9998%2031.5608Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M46.3593%2014.19C46.6171%2013.9087%2046.9218%2013.6977%2047.2734%2013.557C47.6249%2013.4164%2048.0468%2013.3461%2048.5155%2013.3461C48.9843%2013.3461%2049.6171%2013.4398%2050.0858%2013.6508C50.5546%2013.8618%2050.9295%2014.1665%2051.2342%2014.5416C51.3983%2014.7526%2051.5623%2014.987%2051.6795%2015.2683C51.8202%2015.5496%2051.9139%2015.8309%2051.9608%2016.1357L55.4295%2015.0574C55.1717%2014.1431%2054.8201%2013.3695%2054.3748%2012.7131C53.9295%2012.0567%2053.3904%2011.4941%2052.7576%2011.0487C52.1952%2010.6502%2051.5623%2010.3689%2050.8358%2010.1813C50.1327%209.99379%2049.3593%209.90002%2048.5624%209.90002C47.7655%209.90002%2046.5937%2010.0407%2045.7734%2010.3454C44.9765%2010.6502%2044.2734%2011.0956%2043.7109%2011.6816C43.125%2012.2443%2042.7031%2012.9241%2042.4219%2013.7211C42.1406%2014.5182%2042%2015.4324%2042%2016.4405C42%2017.4485%2042.1641%2018.5034%2042.5156%2019.277C42.8672%2020.0506%2043.3828%2020.707%2044.0859%2021.2461C44.789%2021.7853%2045.7031%2022.2776%2046.8515%2022.6761L48.8436%2023.4028C49.5702%2023.6842%2050.1561%2023.9655%2050.5546%2024.2702C50.953%2024.5515%2051.2342%2024.8797%2051.3983%2025.2314C51.5623%2025.583%2051.6327%2026.0284%2051.6327%2026.5676C51.6327%2027.1067%2051.5858%2027.4818%2051.4686%2027.8335C51.3749%2028.1851%2051.1874%2028.4899%2050.9764%2028.7712C50.742%2029.0759%2050.4374%2029.2869%2050.0624%2029.4275C49.7108%2029.5682%2049.2889%2029.6385%2048.8202%2029.6385C48.3515%2029.6385%2047.7187%2029.5448%2047.2734%2029.3338C46.8046%2029.1228%2046.4296%2028.818%2046.1249%2028.443C45.9374%2028.232%2045.7734%2027.9976%2045.6562%2027.6928C45.5156%2027.4115%2045.4453%2027.1067%2045.3749%2026.802L41.8594%2027.7866C42.0937%2028.7008%2042.4453%2029.4979%2042.8906%2030.2011C43.3594%2030.9044%2043.8984%2031.467%2044.5546%2031.9359C45.1406%2032.311%2045.7734%2032.5923%2046.4765%2032.8032C47.1796%2033.0142%2047.953%2033.108%2048.7499%2033.108C49.5468%2033.108%2050.742%2032.9439%2051.5389%2032.6626C52.3592%2032.3578%2053.0623%2031.9124%2053.6483%2031.3029C54.1873%2030.7169%2054.6092%2030.0136%2054.9139%2029.1931C55.2185%2028.3726%2055.3592%2027.4349%2055.3592%2026.3566C55.3592%2025.2782%2055.1951%2024.2702%2054.8435%2023.4966C54.492%2022.723%2053.9764%2022.0666%2053.2498%2021.5275C52.5233%2020.9883%2051.5858%2020.496%2050.3905%2020.0506L48.4218%2019.3239C47.6952%2019.0426%2047.1327%2018.7612%2046.7577%2018.4799C46.3593%2018.1752%2046.1015%2017.8704%2045.9609%2017.5188C45.8203%2017.1672%2045.7499%2016.7686%2045.7499%2016.2998C45.7499%2015.8309%2045.7968%2015.4324%2045.914%2015.0808C46.0077%2014.7292%2046.1718%2014.4478%2046.3593%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M67.5233%2026.4504C67.5233%2027.1536%2067.4295%2027.7631%2067.242%2028.232C67.0545%2028.7008%2066.7499%2029.0525%2066.3046%2029.3103C65.8593%2029.5682%2065.2733%2029.6854%2064.5468%2029.6854C63.8202%2029.6854%2063.2109%2029.5682%2062.7656%2029.3103C62.3202%2029.0525%2062.0156%2028.7008%2061.8281%2028.232C61.6406%2027.7631%2061.5468%2027.1771%2061.5468%2026.4504V10.1579H57.8672V26.3332C57.8672%2027.6694%2058.1016%2028.8415%2058.5703%2029.8495C59.039%2030.8575%2059.7656%2031.6546%2060.75%2032.2406C61.7343%2032.8267%2063.0234%2033.108%2064.5702%2033.108C66.1171%2033.108%2067.3592%2032.8267%2068.367%2032.2406C69.3748%2031.6546%2070.1014%2030.8575%2070.5467%2029.8261C70.992%2028.7946%2071.2264%2027.6459%2071.2264%2026.3332V10.1579H67.5467V26.4504H67.5233Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M83.7186%2010.9549C82.7811%2010.4158%2081.5858%2010.1579%2080.1562%2010.1579H74.0859V32.8033H77.7656V24.9032H80.1093C81.5624%2024.9032%2082.7577%2024.6453%2083.6952%2024.1296C84.6327%2023.6138%2085.3358%2022.8168%2085.8045%2021.7385C86.2732%2020.6601%2086.5076%2019.2536%2086.5076%2017.5423C86.5076%2015.831%2086.2732%2014.4479%2085.8045%2013.3695C85.3358%2012.2912%2084.6327%2011.4941%2083.6952%2010.9549H83.7186ZM82.4999%2019.9099C82.2889%2020.4726%2081.9843%2020.8711%2081.5858%2021.1289C81.1874%2021.3868%2080.6718%2021.504%2080.0155%2021.504H77.7421V13.6274H80.0155C80.6718%2013.6274%2081.1874%2013.7446%2081.5858%2014.0025C81.9843%2014.2603%2082.2889%2014.6588%2082.4999%2015.2215C82.7108%2015.7841%2082.8046%2016.5577%2082.8046%2017.5423C82.8046%2018.5268%2082.7108%2019.3473%2082.4999%2019.9099Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M88.5938%2032.8267H99.7029V29.3807H92.2734V23.0043H98.4608V19.5817H92.2734V13.6274H99.7029V10.1813H88.5938V32.8267Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M111.797%2023.356C112.711%2022.8402%20113.437%2022.0666%20113.953%2021.0352C114.469%2020.0037%20114.726%2018.7144%20114.726%2017.1672C114.726%2015.62%20114.492%2014.2134%20114.023%2013.2054C113.555%2012.1739%20112.851%2011.4238%20111.961%2010.9315C111.047%2010.4392%20109.922%2010.2048%20108.586%2010.2048H102.023V32.8501H105.703V24.153H108.258L111.094%2032.8501H115.078L111.75%2023.4028C111.75%2023.4028%20111.797%2023.4028%20111.82%2023.3794L111.797%2023.356ZM105.68%2013.6274H108.422C108.961%2013.6274%20109.406%2013.7211%20109.805%2013.9321C110.18%2014.1431%20110.484%2014.4947%20110.695%2015.0105C110.906%2015.5028%20111%2016.2295%20111%2017.1437C111%2018.058%20110.906%2018.8081%20110.695%2019.3239C110.484%2019.8396%20110.203%2020.1912%20109.828%2020.4022C109.453%2020.6132%20109.008%2020.707%20108.469%2020.707H105.703V13.6508L105.68%2013.6274Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M132.234%2027.3412L129.047%2010.1813H125.508L122.344%2027.2474L119.086%2010.1813H115.148L120.328%2032.8267H124.148L127.289%2017.6595L130.406%2032.8267H134.226L139.382%2010.1813H135.492L132.234%2027.3412Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M144.773%2010.1813H141.094V32.8267H144.773V10.1813Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M151.851%2014.19C152.109%2013.9087%20152.414%2013.6977%20152.766%2013.557C153.117%2013.4164%20153.539%2013.3461%20154.008%2013.3461C154.476%2013.3461%20155.109%2013.4398%20155.578%2013.6508C156.047%2013.8618%20156.422%2014.1665%20156.726%2014.5416C156.89%2014.7526%20157.055%2014.987%20157.172%2015.2683C157.312%2015.5496%20157.406%2015.8309%20157.453%2016.1357L160.922%2015.0574C160.664%2014.1431%20160.312%2013.3695%20159.867%2012.7131C159.422%2012.0567%20158.883%2011.4941%20158.25%2011.0487C157.687%2010.6502%20157.055%2010.3689%20156.328%2010.1813C155.625%209.99379%20154.851%209.90002%20154.055%209.90002C153.258%209.90002%20152.086%2010.0407%20151.266%2010.3454C150.469%2010.6502%20149.766%2011.0956%20149.203%2011.6816C148.617%2012.2443%20148.195%2012.9241%20147.914%2013.7211C147.633%2014.5182%20147.492%2015.4324%20147.492%2016.4405C147.492%2017.4485%20147.656%2018.5034%20148.008%2019.277C148.359%2020.0506%20148.875%2020.707%20149.578%2021.2461C150.281%2021.7853%20151.195%2022.2776%20152.344%2022.6761L154.336%2023.4028C155.062%2023.6842%20155.648%2023.9655%20156.047%2024.2702C156.445%2024.5515%20156.726%2024.8797%20156.89%2025.2314C157.055%2025.583%20157.125%2026.0284%20157.125%2026.5676C157.125%2027.1067%20157.078%2027.4818%20156.961%2027.8335C156.867%2028.1851%20156.68%2028.4899%20156.469%2028.7712C156.234%2029.0759%20155.93%2029.2869%20155.555%2029.4275C155.203%2029.5682%20154.781%2029.6385%20154.312%2029.6385C153.844%2029.6385%20153.211%2029.5448%20152.766%2029.3338C152.297%2029.1228%20151.922%2028.818%20151.617%2028.443C151.43%2028.232%20151.266%2027.9976%20151.148%2027.6928C151.008%2027.4115%20150.914%2027.1067%20150.867%2026.802L147.352%2027.7866C147.586%2028.7008%20147.937%2029.4979%20148.383%2030.2011C148.852%2030.9044%20149.391%2031.467%20150.047%2031.9359C150.633%2032.311%20151.266%2032.5923%20151.969%2032.8032C152.672%2033.0142%20153.445%2033.108%20154.242%2033.108C155.039%2033.108%20156.234%2032.9439%20157.031%2032.6626C157.851%2032.3578%20158.555%2031.9124%20159.14%2031.3029C159.68%2030.7169%20160.101%2030.0136%20160.406%2029.1931C160.711%2028.3726%20160.851%2027.4349%20160.851%2026.3566C160.851%2025.2782%20160.687%2024.2702%20160.336%2023.4966C159.984%2022.723%20159.469%2022.0666%20158.742%2021.5275C158.015%2020.9883%20157.078%2020.496%20155.883%2020.0506L153.914%2019.3239C153.187%2019.0426%20152.625%2018.7612%20152.25%2018.4799C151.852%2018.1752%20151.594%2017.8704%20151.453%2017.5188C151.312%2017.1672%20151.242%2016.7686%20151.242%2016.2998C151.242%2015.8309%20151.289%2015.4324%20151.406%2015.0808C151.5%2014.7292%20151.664%2014.4478%20151.851%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M174.633%2013.6274V10.1813H163.5V32.8267H174.633V29.3807H167.18V23.0043H173.367V19.5817H167.18V13.6274H174.633Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M179.316%2011.0956V10.1345H183.512V11.0956H181.918V15.8075H180.91V11.0956H179.316Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M184.168%2010.1345H185.41L186.676%2013.9321L187.941%2010.1345H189.184V15.8075H188.269V11.8223L187.098%2015.1511H186.254L185.082%2011.9161V15.831H184.168V10.1579V10.1345Z'%20fill='black'%3e%3c/path%3e%3c/svg%3e", _e = "superwise-chatbot-package-css", Xe = "chatbot-plugin.css";
|
|
386
|
+
function Ke() {
|
|
387
|
+
if (typeof document > "u") return "";
|
|
388
|
+
const t = document.querySelector('script[src*="chatbot-plugin"]');
|
|
389
|
+
if (!(t != null && t.src)) return "";
|
|
390
|
+
try {
|
|
391
|
+
const r = new URL(t.src), a = r.pathname.replace(/\/[^/]*$/, "/");
|
|
392
|
+
return r.pathname = a + Xe, r.search = "", r.hash = "", r.toString();
|
|
393
|
+
} catch {
|
|
394
|
+
return "";
|
|
628
395
|
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
.
|
|
662
|
-
background: var(--swttyw-primary-color);\r
|
|
663
|
-
opacity: 0.9;\r
|
|
664
|
-
}\r
|
|
665
|
-
\r
|
|
666
|
-
/* Allow overflow so the wave/bounce animation is not cut off */\r
|
|
667
|
-
.sw-ttyw-chatbot .message-loading {\r
|
|
668
|
-
overflow: visible !important;\r
|
|
669
|
-
}\r
|
|
670
|
-
\r
|
|
671
|
-
/* Loading (typing) bubble: compact so it doesn't get cut at top/bottom */\r
|
|
672
|
-
.sw-ttyw-chatbot .message-loading .message-content {\r
|
|
673
|
-
min-height: 1.5rem !important;\r
|
|
674
|
-
min-width: 4.0rem !important;\r
|
|
675
|
-
display: flex !important;\r
|
|
676
|
-
align-items: center !important;\r
|
|
677
|
-
padding: 0.45rem 0 0.25rem 0.5rem !important;\r
|
|
678
|
-
overflow: visible !important;\r
|
|
679
|
-
} \r
|
|
680
|
-
\r
|
|
681
|
-
.typing {\r
|
|
682
|
-
display: inline-block !important;\r
|
|
683
|
-
width: 0.8rem !important;\r
|
|
684
|
-
height: 0.8rem !important;\r
|
|
685
|
-
min-width: 0.8rem !important;\r
|
|
686
|
-
min-height: 0.8rem !important;\r
|
|
687
|
-
max-width: 0.8rem !important;\r
|
|
688
|
-
max-height: 0.8rem !important;\r
|
|
689
|
-
margin-right: 0.5rem !important;\r
|
|
690
|
-
box-sizing: border-box !important;\r
|
|
691
|
-
background: #ccc !important;\r
|
|
692
|
-
border-radius: 50% !important;\r
|
|
693
|
-
}\r
|
|
694
|
-
\r
|
|
695
|
-
.typing.typing-1 {\r
|
|
696
|
-
-webkit-animation: typingAlt 1.4s infinite !important;\r
|
|
697
|
-
animation: typingAlt 1.4s infinite !important;\r
|
|
698
|
-
}\r
|
|
699
|
-
\r
|
|
700
|
-
.typing.typing-2 {\r
|
|
701
|
-
-webkit-animation: typingAlt 1.4s 0.2s infinite !important;\r
|
|
702
|
-
animation: typingAlt 1.4s 0.2s infinite !important;\r
|
|
703
|
-
}\r
|
|
704
|
-
\r
|
|
705
|
-
.typing.typing-3 {\r
|
|
706
|
-
-webkit-animation: typingAlt 1.4s 0.4s infinite !important;\r
|
|
707
|
-
animation: typingAlt 1.4s 0.4s infinite !important;\r
|
|
708
|
-
}\r
|
|
709
|
-
\r
|
|
710
|
-
.typing-cursor {\r
|
|
711
|
-
animation: blink 1s infinite;\r
|
|
712
|
-
color: var(--swttyw-primary-color);\r
|
|
713
|
-
font-weight: bold;\r
|
|
714
|
-
}\r
|
|
715
|
-
\r
|
|
716
|
-
@keyframes blink {\r
|
|
717
|
-
0%, 50% { opacity: 1; }\r
|
|
718
|
-
51%, 100% { opacity: 0; }\r
|
|
719
|
-
}\r
|
|
720
|
-
\r
|
|
721
|
-
/* Error message styling */\r
|
|
722
|
-
.swttyw-input-error {\r
|
|
723
|
-
background-color: #FEE8E8;\r
|
|
724
|
-
border: 1px solid #FDC2C2;\r
|
|
725
|
-
border-radius: 8px;\r
|
|
726
|
-
padding: 12px 16px;\r
|
|
727
|
-
margin: 8px 0;\r
|
|
728
|
-
display: flex;\r
|
|
729
|
-
align-items: center;\r
|
|
730
|
-
gap: 8px;\r
|
|
731
|
-
color: #E04F4F;\r
|
|
732
|
-
font-size: 14px;\r
|
|
733
|
-
line-height: 1.4;\r
|
|
734
|
-
}\r
|
|
735
|
-
\r
|
|
736
|
-
.swttyw-input-error .error-icon {\r
|
|
737
|
-
color: #F59E0B;\r
|
|
738
|
-
font-size: 16px;\r
|
|
739
|
-
flex-shrink: 0;\r
|
|
740
|
-
}\r
|
|
741
|
-
\r
|
|
742
|
-
/* Validation message in messages area */\r
|
|
743
|
-
.sw-ttyw-validation-message {\r
|
|
744
|
-
background-color: #FEE8E8;\r
|
|
745
|
-
border: 1px solid #FDC2C2;\r
|
|
746
|
-
border-radius: 8px;\r
|
|
747
|
-
padding: 12px 16px;\r
|
|
748
|
-
margin: 8px 16px;\r
|
|
749
|
-
display: flex;\r
|
|
750
|
-
align-items: center;\r
|
|
751
|
-
gap: 8px;\r
|
|
752
|
-
color: #E04F4F;\r
|
|
753
|
-
font-size: 14px;\r
|
|
754
|
-
line-height: 1.4;\r
|
|
755
|
-
animation: slideIn 0.3s ease-out;\r
|
|
756
|
-
}\r
|
|
757
|
-
\r
|
|
758
|
-
.sw-ttyw-validation-message .error-icon {\r
|
|
759
|
-
color: #F59E0B;\r
|
|
760
|
-
font-size: 16px;\r
|
|
761
|
-
flex-shrink: 0;\r
|
|
762
|
-
}\r
|
|
763
|
-
\r
|
|
764
|
-
/* Contact Sales CTA (shown on errors or >90s response delay) */\r
|
|
765
|
-
.sw-ttyw-contact-cta {\r
|
|
766
|
-
margin: 0px auto;\r
|
|
767
|
-
animation: slideIn 0.3s ease-out;\r
|
|
768
|
-
max-width: 320px;\r
|
|
769
|
-
text-align: center;\r
|
|
770
|
-
}\r
|
|
771
|
-
\r
|
|
772
|
-
.sw-ttyw-cta-button {\r
|
|
773
|
-
display: inline-flex;\r
|
|
774
|
-
align-items: center;\r
|
|
775
|
-
gap: 8px;\r
|
|
776
|
-
padding: 10px 16px;\r
|
|
777
|
-
background: var(--swttyw-primary-color, #000);\r
|
|
778
|
-
color: #fff !important;\r
|
|
779
|
-
text-decoration: none;\r
|
|
780
|
-
border-radius: 8px;\r
|
|
781
|
-
font-size: 14px;\r
|
|
782
|
-
font-weight: 500;\r
|
|
783
|
-
transition: opacity 0.2s, transform 0.2s;\r
|
|
784
|
-
}\r
|
|
785
|
-
\r
|
|
786
|
-
.sw-ttyw-cta-button:hover {\r
|
|
787
|
-
opacity: 0.9;\r
|
|
788
|
-
transform: translateY(-1px);\r
|
|
789
|
-
}\r
|
|
790
|
-
\r
|
|
791
|
-
.sw-ttyw-cta-icon {\r
|
|
792
|
-
font-size: 16px;\r
|
|
793
|
-
}\r
|
|
794
|
-
\r
|
|
795
|
-
/* Chat history limit exceeded (reference: chatbot.js swecShowChatLimitExceededMessage) */\r
|
|
796
|
-
.sw-ttyw-limit-exceeded {\r
|
|
797
|
-
margin: 8px 16px;\r
|
|
798
|
-
animation: slideIn 0.3s ease-out;\r
|
|
799
|
-
}\r
|
|
800
|
-
\r
|
|
801
|
-
.sw-ttyw-limit-exceeded-message {\r
|
|
802
|
-
background-color: #FEE8E8;\r
|
|
803
|
-
border: 1px solid #FDC2C2;\r
|
|
804
|
-
border-radius: 8px;\r
|
|
805
|
-
padding: 12px 16px;\r
|
|
806
|
-
margin-bottom: 12px;\r
|
|
807
|
-
color: #E04F4F;\r
|
|
808
|
-
font-size: 14px;\r
|
|
809
|
-
line-height: 1.4;\r
|
|
810
|
-
}\r
|
|
811
|
-
\r
|
|
812
|
-
.sw-ttyw-limit-action-buttons {\r
|
|
813
|
-
display: flex;\r
|
|
814
|
-
flex-wrap: wrap;\r
|
|
815
|
-
gap: 10px;\r
|
|
816
|
-
align-items: center;\r
|
|
817
|
-
justify-content: center;\r
|
|
818
|
-
}\r
|
|
819
|
-
\r
|
|
820
|
-
.sw-ttyw-limit-download-pdf,\r
|
|
821
|
-
.sw-ttyw-limit-clear-history {\r
|
|
822
|
-
display: inline-flex;\r
|
|
823
|
-
align-items: center;\r
|
|
824
|
-
gap: 8px;\r
|
|
825
|
-
padding: 10px 16px;\r
|
|
826
|
-
border-radius: 8px;\r
|
|
827
|
-
font-size: 14px;\r
|
|
828
|
-
font-weight: 500;\r
|
|
829
|
-
cursor: pointer;\r
|
|
830
|
-
transition: opacity 0.2s, transform 0.2s;\r
|
|
831
|
-
border: none;\r
|
|
832
|
-
}\r
|
|
833
|
-
\r
|
|
834
|
-
.sw-ttyw-limit-download-pdf {\r
|
|
835
|
-
background: var(--swttyw-primary-color, #000);\r
|
|
836
|
-
color: #fff;\r
|
|
837
|
-
}\r
|
|
838
|
-
\r
|
|
839
|
-
.sw-ttyw-limit-download-pdf:hover:not(:disabled) {\r
|
|
840
|
-
opacity: 0.9;\r
|
|
841
|
-
transform: translateY(-1px);\r
|
|
842
|
-
}\r
|
|
843
|
-
\r
|
|
844
|
-
.sw-ttyw-limit-download-pdf:disabled {\r
|
|
845
|
-
opacity: 0.6;\r
|
|
846
|
-
cursor: not-allowed;\r
|
|
847
|
-
}\r
|
|
848
|
-
\r
|
|
849
|
-
.sw-ttyw-limit-clear-history {\r
|
|
850
|
-
background: transparent;\r
|
|
851
|
-
color: var(--swttyw-primary-color, #000);\r
|
|
852
|
-
border: 1px solid var(--swttyw-primary-color, #000);\r
|
|
853
|
-
}\r
|
|
854
|
-
\r
|
|
855
|
-
.sw-ttyw-limit-clear-history:hover {\r
|
|
856
|
-
opacity: 0.9;\r
|
|
857
|
-
transform: translateY(-1px);\r
|
|
858
|
-
}\r
|
|
859
|
-
\r
|
|
860
|
-
@keyframes slideIn {\r
|
|
861
|
-
from {\r
|
|
862
|
-
opacity: 0;\r
|
|
863
|
-
transform: translateY(-10px);\r
|
|
864
|
-
}\r
|
|
865
|
-
to {\r
|
|
866
|
-
opacity: 1;\r
|
|
867
|
-
transform: translateY(0);\r
|
|
868
|
-
}\r
|
|
869
|
-
}\r
|
|
870
|
-
\r
|
|
871
|
-
@-webkit-keyframes typingAlt {\r
|
|
872
|
-
0%, 60%, 100% {\r
|
|
873
|
-
transform: translateY(0) scale(1);\r
|
|
874
|
-
opacity: 0.4;\r
|
|
875
|
-
}\r
|
|
876
|
-
30% {\r
|
|
877
|
-
transform: translateY(-10px) scale(1.2);\r
|
|
878
|
-
opacity: 1;\r
|
|
879
|
-
}\r
|
|
880
|
-
}\r
|
|
881
|
-
\r
|
|
882
|
-
@keyframes typingAlt {\r
|
|
883
|
-
0%, 60%, 100% {\r
|
|
884
|
-
transform: translateY(0) scale(1);\r
|
|
885
|
-
opacity: 0.4;\r
|
|
886
|
-
}\r
|
|
887
|
-
30% {\r
|
|
888
|
-
transform: translateY(-10px) scale(1.2);\r
|
|
889
|
-
opacity: 1;\r
|
|
890
|
-
}\r
|
|
891
|
-
}\r
|
|
892
|
-
\r
|
|
893
|
-
/* User messages: background uses primary color */\r
|
|
894
|
-
.sw-ttyw-message.self {\r
|
|
895
|
-
background: var(--swttyw-primary-color) !important;\r
|
|
896
|
-
color: white !important;\r
|
|
897
|
-
margin: 1rem 1rem 1rem auto !important;\r
|
|
898
|
-
border-radius: 1.125rem 1.125rem 0 1.125rem !important;\r
|
|
899
|
-
max-width: 80% !important;\r
|
|
900
|
-
display: table;\r
|
|
901
|
-
}\r
|
|
902
|
-
\r
|
|
903
|
-
/* Avatar positioning and color for user messages */\r
|
|
904
|
-
.sw-ttyw-message.self .message-avatar {\r
|
|
905
|
-
right: -28px !important;\r
|
|
906
|
-
left: auto !important;\r
|
|
907
|
-
color: var(--swttyw-primary-color);\r
|
|
908
|
-
}\r
|
|
909
|
-
.sw-ttyw-message.self .message-avatar svg {\r
|
|
910
|
-
fill: currentColor;\r
|
|
911
|
-
}\r
|
|
912
|
-
\r
|
|
913
|
-
/* Avatar positioning for AI messages */\r
|
|
914
|
-
.sw-ttyw-message.other .message-avatar {\r
|
|
915
|
-
left: -28px !important;\r
|
|
916
|
-
right: auto !important;\r
|
|
917
|
-
display: table;\r
|
|
918
|
-
}\r
|
|
919
|
-
\r
|
|
920
|
-
/* Ensure proper spacing for message content and wrap text */\r
|
|
921
|
-
.sw-ttyw-message .message-content {\r
|
|
922
|
-
margin-left: 0 !important;\r
|
|
923
|
-
margin-right: 0 !important;\r
|
|
924
|
-
padding-left: 0 !important;\r
|
|
925
|
-
padding-right: 0 !important;\r
|
|
926
|
-
min-width: 0;\r
|
|
927
|
-
overflow-wrap: break-word;\r
|
|
928
|
-
word-break: break-word;\r
|
|
929
|
-
overflow-x: hidden;\r
|
|
930
|
-
}\r
|
|
931
|
-
\r
|
|
932
|
-
/* Markdown in AI messages (reference: chatbot.js processMarkdown) */\r
|
|
933
|
-
.sw-ttyw-markdown h1,\r
|
|
934
|
-
.sw-ttyw-markdown h2,\r
|
|
935
|
-
.sw-ttyw-markdown h3 {\r
|
|
936
|
-
margin: 0.5em 0 0.25em;\r
|
|
937
|
-
font-weight: 600;\r
|
|
938
|
-
line-height: 1.3;\r
|
|
939
|
-
}\r
|
|
940
|
-
.sw-ttyw-markdown h1 { font-size: 1.25em; }\r
|
|
941
|
-
.sw-ttyw-markdown h2 { font-size: 1.1em; }\r
|
|
942
|
-
.sw-ttyw-markdown h3 { font-size: 1em; }\r
|
|
943
|
-
.sw-ttyw-markdown h1:first-child,\r
|
|
944
|
-
.sw-ttyw-markdown h2:first-child,\r
|
|
945
|
-
.sw-ttyw-markdown h3:first-child { margin-top: 0; }\r
|
|
946
|
-
\r
|
|
947
|
-
/* Message content: wrap text, no horizontal scroll */\r
|
|
948
|
-
.sw-ttyw-markdown {\r
|
|
949
|
-
overflow-wrap: break-word;\r
|
|
950
|
-
word-break: break-word;\r
|
|
951
|
-
overflow-x: hidden;\r
|
|
952
|
-
}\r
|
|
953
|
-
\r
|
|
954
|
-
/* Reduce space taken by <br> in responses (avoid large gaps after paragraphs) */\r
|
|
955
|
-
.sw-ttyw-markdown br {\r
|
|
956
|
-
display: block;\r
|
|
957
|
-
line-height: 0.5;\r
|
|
958
|
-
margin: 0;\r
|
|
959
|
-
padding: 0;\r
|
|
960
|
-
}\r
|
|
961
|
-
\r
|
|
962
|
-
.sw-ttyw-markdown pre,\r
|
|
963
|
-
.sw-ttyw-markdown pre.sw-ttyw-code-block {\r
|
|
964
|
-
margin: 0.5em 0;\r
|
|
965
|
-
padding: 0.75em 1em;\r
|
|
966
|
-
background: rgba(0, 0, 0, 0.06);\r
|
|
967
|
-
border-radius: 6px;\r
|
|
968
|
-
overflow-x: hidden;\r
|
|
969
|
-
white-space: pre-wrap;\r
|
|
970
|
-
word-break: break-word;\r
|
|
971
|
-
font-size: 0.9em;\r
|
|
972
|
-
line-height: 1.4;\r
|
|
973
|
-
}\r
|
|
974
|
-
.sw-ttyw-markdown code {\r
|
|
975
|
-
padding: 0.15em 0.4em;\r
|
|
976
|
-
background: rgba(0, 0, 0, 0.08);\r
|
|
977
|
-
border-radius: 4px;\r
|
|
978
|
-
font-size: 0.9em;\r
|
|
979
|
-
word-break: break-word;\r
|
|
980
|
-
}\r
|
|
981
|
-
.sw-ttyw-markdown pre code,\r
|
|
982
|
-
.sw-ttyw-markdown pre.sw-ttyw-code-block code {\r
|
|
983
|
-
padding: 0;\r
|
|
984
|
-
background: none;\r
|
|
985
|
-
white-space: pre-wrap;\r
|
|
986
|
-
word-break: break-word;\r
|
|
987
|
-
}\r
|
|
988
|
-
\r
|
|
989
|
-
.sw-ttyw-markdown ol,\r
|
|
990
|
-
.sw-ttyw-markdown ul {\r
|
|
991
|
-
margin: 0.35em 0;\r
|
|
992
|
-
padding-left: 1.25em;\r
|
|
993
|
-
}\r
|
|
994
|
-
.sw-ttyw-markdown ol {\r
|
|
995
|
-
list-style: decimal;\r
|
|
996
|
-
}\r
|
|
997
|
-
.sw-ttyw-markdown ul {\r
|
|
998
|
-
list-style: disc;\r
|
|
999
|
-
}\r
|
|
1000
|
-
.sw-ttyw-markdown ul ul {\r
|
|
1001
|
-
margin: 0.2em 0;\r
|
|
1002
|
-
padding-left: 1.25em;\r
|
|
1003
|
-
list-style: circle;\r
|
|
1004
|
-
}\r
|
|
1005
|
-
.sw-ttyw-markdown ol ul {\r
|
|
1006
|
-
margin: 0.2em 0;\r
|
|
1007
|
-
padding-left: 1.25em;\r
|
|
1008
|
-
list-style: disc;\r
|
|
1009
|
-
}\r
|
|
1010
|
-
.sw-ttyw-markdown li {\r
|
|
1011
|
-
margin: 0.15em 0;\r
|
|
1012
|
-
line-height: 1.4;\r
|
|
1013
|
-
}\r
|
|
1014
|
-
\r
|
|
1015
|
-
.sw-ttyw-markdown a {\r
|
|
1016
|
-
color: var(--swttyw-primary-color, #000);\r
|
|
1017
|
-
text-decoration: underline;\r
|
|
1018
|
-
}\r
|
|
1019
|
-
.sw-ttyw-markdown a:hover {\r
|
|
1020
|
-
opacity: 0.85;\r
|
|
1021
|
-
}\r
|
|
1022
|
-
\r
|
|
1023
|
-
/* API bracket labels e.g. [Agents], [Via the SUPERWISE dashboard] */\r
|
|
1024
|
-
.sw-ttyw-markdown .sw-ttyw-bracket-label {\r
|
|
1025
|
-
font-weight: 600;\r
|
|
1026
|
-
opacity: 0.9;\r
|
|
1027
|
-
}\r
|
|
1028
|
-
\r
|
|
1029
|
-
/* [text]...[/text] section titles e.g. Programmatic creation (SDK — Python example) */\r
|
|
1030
|
-
.sw-ttyw-markdown .sw-ttyw-text-block {\r
|
|
1031
|
-
display: block;\r
|
|
1032
|
-
font-weight: 600;\r
|
|
1033
|
-
font-size: 1.05em;\r
|
|
1034
|
-
margin: 0.75em 0 0.35em;\r
|
|
1035
|
-
line-height: 1.0;\r
|
|
1036
|
-
color: inherit;\r
|
|
1037
|
-
}\r
|
|
1038
|
-
.sw-ttyw-markdown .sw-ttyw-text-block:first-child {\r
|
|
1039
|
-
margin-top: 0;\r
|
|
1040
|
-
}\r
|
|
1041
|
-
\r
|
|
1042
|
-
/* Empty state styling */\r
|
|
1043
|
-
.sw-ttyw-empty-state {\r
|
|
1044
|
-
background-color: var(--swttyw-background-color) !important;\r
|
|
1045
|
-
transition: opacity 0.3s ease-in-out !important;\r
|
|
1046
|
-
}\r
|
|
1047
|
-
\r
|
|
1048
|
-
.sw-ttyw-empty-state:hover {\r
|
|
1049
|
-
opacity: 0.5 !important;\r
|
|
1050
|
-
}\r
|
|
1051
|
-
\r
|
|
1052
|
-
/* Messages area: vertical scroll only, scrollbar uses primary color */\r
|
|
1053
|
-
.sw-ttyw-messages {\r
|
|
1054
|
-
overflow-x: hidden;\r
|
|
1055
|
-
scrollbar-width: thin;\r
|
|
1056
|
-
scrollbar-color: var(--swttyw-primary-color) transparent;\r
|
|
1057
|
-
}\r
|
|
1058
|
-
\r
|
|
1059
|
-
/* Ensure empty state doesn't interfere with scrolling */\r
|
|
1060
|
-
.sw-ttyw-messages:has(.sw-ttyw-empty-state) {\r
|
|
1061
|
-
overflow: hidden !important;\r
|
|
1062
|
-
}\r
|
|
1063
|
-
\r
|
|
1064
|
-
.sw-ttyw-chat-footer img {\r
|
|
1065
|
-
height: 20px !important;\r
|
|
1066
|
-
}\r
|
|
1067
|
-
\r
|
|
1068
|
-
.sw-ttyw-input:disabled {\r
|
|
1069
|
-
opacity: 0.7;\r
|
|
1070
|
-
cursor: not-allowed;\r
|
|
1071
|
-
}\r
|
|
1072
|
-
\r
|
|
1073
|
-
.sw-ttyw-chatbot #sw-ttyw-chat-send-message {\r
|
|
1074
|
-
color: var(--swttyw-primary-color);\r
|
|
1075
|
-
}\r
|
|
1076
|
-
.sw-ttyw-chatbot #sw-ttyw-chat-send-message svg {\r
|
|
1077
|
-
fill: currentColor;\r
|
|
1078
|
-
}\r
|
|
1079
|
-
#sw-ttyw-chat-send-message:disabled {\r
|
|
1080
|
-
opacity: 0.5;\r
|
|
1081
|
-
cursor: not-allowed;\r
|
|
1082
|
-
}\r
|
|
1083
|
-
\r
|
|
1084
|
-
#sw-ttyw-chat-send-message:disabled svg,\r
|
|
1085
|
-
#sw-ttyw-chat-send-message:disabled path {\r
|
|
1086
|
-
cursor: not-allowed;\r
|
|
1087
|
-
}\r
|
|
1088
|
-
\r
|
|
1089
|
-
.sw-ttyw-jump-latest {\r
|
|
1090
|
-
position: sticky;\r
|
|
1091
|
-
bottom: 12px;\r
|
|
1092
|
-
display: flex;\r
|
|
1093
|
-
justify-content: center;\r
|
|
1094
|
-
margin-top: 8px;\r
|
|
1095
|
-
}\r
|
|
1096
|
-
\r
|
|
1097
|
-
.sw-ttyw-jump-button {\r
|
|
1098
|
-
background: var(--swttyw-primary-color, #000);\r
|
|
1099
|
-
border: 1px solid var(--swttyw-primary-color, #000);\r
|
|
1100
|
-
color: #fff;\r
|
|
1101
|
-
border-radius: 20px;\r
|
|
1102
|
-
padding: 6px 12px;\r
|
|
1103
|
-
font-size: 12px;\r
|
|
1104
|
-
cursor: pointer;\r
|
|
1105
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);\r
|
|
1106
|
-
}\r
|
|
1107
|
-
\r
|
|
1108
|
-
.sw-ttyw-jump-button:hover {\r
|
|
1109
|
-
opacity: 0.9;\r
|
|
1110
|
-
}`, Ke = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='190'%20height='42'%20viewBox='0%200%20190%2042'%20fill='none'%3e%3cpath%20d='M17.2253%2014.2603C17.155%2014.0259%2016.9441%2013.8618%2016.7097%2013.8618H14.6472C14.3894%2013.8618%2014.1785%2014.0259%2014.1316%2014.2603L10.7801%2027.5053C10.7332%2027.6694%2010.7801%2027.8335%2010.8739%2027.9741C10.9676%2028.1148%2011.1317%2028.1851%2011.2957%2028.1851H12.9363C13.1941%2028.1851%2013.4051%2027.9976%2013.4754%2027.7631L14.0613%2025.0673H17.3191L17.905%2027.7631C17.9519%2028.021%2018.1862%2028.1851%2018.444%2028.1851H20.0846C20.2487%2028.1851%2020.4128%2028.1148%2020.5065%2027.9741C20.6003%2027.8335%2020.6471%2027.6694%2020.6003%2027.5053L17.2488%2014.2603H17.2253ZM14.5769%2022.5824L15.655%2017.636L16.7566%2022.5824H14.5769Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M23.8359%2013.8618H22.2656C21.9609%2013.8618%2021.7266%2014.0962%2021.7266%2014.401V27.6459C21.7266%2027.9507%2021.9609%2028.1851%2022.2656%2028.1851H23.8359C24.1406%2028.1851%2024.375%2027.9507%2024.375%2027.6459V14.401C24.375%2014.0962%2024.1406%2013.8618%2023.8359%2013.8618ZM22.2891%2014.0493C22.2422%2014.0493%2022.1953%2014.0493%2022.1484%2014.0728C22.1953%2014.0728%2022.2422%2014.0493%2022.2891%2014.0493Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M36.1401%2029.4041L36.0932%2012.5256C36.0932%2011.3066%2035.4369%2010.1579%2034.3588%209.5484L19.7341%201.15601C18.6794%200.546507%2017.3669%200.546507%2016.2888%201.15601L1.71091%209.61872C0.65624%2010.2282%200%2011.3769%200%2012.5959L0.046874%2029.4744C0.046874%2030.6934%200.703114%2031.8421%201.78122%2032.4516L16.406%2040.844C17.4607%2041.4535%2018.7731%2041.4535%2019.8513%2040.844L34.4291%2032.3813C35.4838%2031.7718%2036.1401%2030.6231%2036.1401%2029.4041ZM11.9998%2031.5608C6.16397%2028.1851%204.17181%2020.7539%207.54676%2014.9167C10.8983%209.07955%2018.3513%207.08694%2024.1871%2010.4626C30.023%2013.8149%2032.0151%2021.2696%2028.6402%2027.1068C25.2887%2032.9439%2017.8357%2034.9365%2011.9998%2031.5608Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M46.3593%2014.19C46.6171%2013.9087%2046.9218%2013.6977%2047.2734%2013.557C47.6249%2013.4164%2048.0468%2013.3461%2048.5155%2013.3461C48.9843%2013.3461%2049.6171%2013.4398%2050.0858%2013.6508C50.5546%2013.8618%2050.9295%2014.1665%2051.2342%2014.5416C51.3983%2014.7526%2051.5623%2014.987%2051.6795%2015.2683C51.8202%2015.5496%2051.9139%2015.8309%2051.9608%2016.1357L55.4295%2015.0574C55.1717%2014.1431%2054.8201%2013.3695%2054.3748%2012.7131C53.9295%2012.0567%2053.3904%2011.4941%2052.7576%2011.0487C52.1952%2010.6502%2051.5623%2010.3689%2050.8358%2010.1813C50.1327%209.99379%2049.3593%209.90002%2048.5624%209.90002C47.7655%209.90002%2046.5937%2010.0407%2045.7734%2010.3454C44.9765%2010.6502%2044.2734%2011.0956%2043.7109%2011.6816C43.125%2012.2443%2042.7031%2012.9241%2042.4219%2013.7211C42.1406%2014.5182%2042%2015.4324%2042%2016.4405C42%2017.4485%2042.1641%2018.5034%2042.5156%2019.277C42.8672%2020.0506%2043.3828%2020.707%2044.0859%2021.2461C44.789%2021.7853%2045.7031%2022.2776%2046.8515%2022.6761L48.8436%2023.4028C49.5702%2023.6842%2050.1561%2023.9655%2050.5546%2024.2702C50.953%2024.5515%2051.2342%2024.8797%2051.3983%2025.2314C51.5623%2025.583%2051.6327%2026.0284%2051.6327%2026.5676C51.6327%2027.1067%2051.5858%2027.4818%2051.4686%2027.8335C51.3749%2028.1851%2051.1874%2028.4899%2050.9764%2028.7712C50.742%2029.0759%2050.4374%2029.2869%2050.0624%2029.4275C49.7108%2029.5682%2049.2889%2029.6385%2048.8202%2029.6385C48.3515%2029.6385%2047.7187%2029.5448%2047.2734%2029.3338C46.8046%2029.1228%2046.4296%2028.818%2046.1249%2028.443C45.9374%2028.232%2045.7734%2027.9976%2045.6562%2027.6928C45.5156%2027.4115%2045.4453%2027.1067%2045.3749%2026.802L41.8594%2027.7866C42.0937%2028.7008%2042.4453%2029.4979%2042.8906%2030.2011C43.3594%2030.9044%2043.8984%2031.467%2044.5546%2031.9359C45.1406%2032.311%2045.7734%2032.5923%2046.4765%2032.8032C47.1796%2033.0142%2047.953%2033.108%2048.7499%2033.108C49.5468%2033.108%2050.742%2032.9439%2051.5389%2032.6626C52.3592%2032.3578%2053.0623%2031.9124%2053.6483%2031.3029C54.1873%2030.7169%2054.6092%2030.0136%2054.9139%2029.1931C55.2185%2028.3726%2055.3592%2027.4349%2055.3592%2026.3566C55.3592%2025.2782%2055.1951%2024.2702%2054.8435%2023.4966C54.492%2022.723%2053.9764%2022.0666%2053.2498%2021.5275C52.5233%2020.9883%2051.5858%2020.496%2050.3905%2020.0506L48.4218%2019.3239C47.6952%2019.0426%2047.1327%2018.7612%2046.7577%2018.4799C46.3593%2018.1752%2046.1015%2017.8704%2045.9609%2017.5188C45.8203%2017.1672%2045.7499%2016.7686%2045.7499%2016.2998C45.7499%2015.8309%2045.7968%2015.4324%2045.914%2015.0808C46.0077%2014.7292%2046.1718%2014.4478%2046.3593%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M67.5233%2026.4504C67.5233%2027.1536%2067.4295%2027.7631%2067.242%2028.232C67.0545%2028.7008%2066.7499%2029.0525%2066.3046%2029.3103C65.8593%2029.5682%2065.2733%2029.6854%2064.5468%2029.6854C63.8202%2029.6854%2063.2109%2029.5682%2062.7656%2029.3103C62.3202%2029.0525%2062.0156%2028.7008%2061.8281%2028.232C61.6406%2027.7631%2061.5468%2027.1771%2061.5468%2026.4504V10.1579H57.8672V26.3332C57.8672%2027.6694%2058.1016%2028.8415%2058.5703%2029.8495C59.039%2030.8575%2059.7656%2031.6546%2060.75%2032.2406C61.7343%2032.8267%2063.0234%2033.108%2064.5702%2033.108C66.1171%2033.108%2067.3592%2032.8267%2068.367%2032.2406C69.3748%2031.6546%2070.1014%2030.8575%2070.5467%2029.8261C70.992%2028.7946%2071.2264%2027.6459%2071.2264%2026.3332V10.1579H67.5467V26.4504H67.5233Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M83.7186%2010.9549C82.7811%2010.4158%2081.5858%2010.1579%2080.1562%2010.1579H74.0859V32.8033H77.7656V24.9032H80.1093C81.5624%2024.9032%2082.7577%2024.6453%2083.6952%2024.1296C84.6327%2023.6138%2085.3358%2022.8168%2085.8045%2021.7385C86.2732%2020.6601%2086.5076%2019.2536%2086.5076%2017.5423C86.5076%2015.831%2086.2732%2014.4479%2085.8045%2013.3695C85.3358%2012.2912%2084.6327%2011.4941%2083.6952%2010.9549H83.7186ZM82.4999%2019.9099C82.2889%2020.4726%2081.9843%2020.8711%2081.5858%2021.1289C81.1874%2021.3868%2080.6718%2021.504%2080.0155%2021.504H77.7421V13.6274H80.0155C80.6718%2013.6274%2081.1874%2013.7446%2081.5858%2014.0025C81.9843%2014.2603%2082.2889%2014.6588%2082.4999%2015.2215C82.7108%2015.7841%2082.8046%2016.5577%2082.8046%2017.5423C82.8046%2018.5268%2082.7108%2019.3473%2082.4999%2019.9099Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M88.5938%2032.8267H99.7029V29.3807H92.2734V23.0043H98.4608V19.5817H92.2734V13.6274H99.7029V10.1813H88.5938V32.8267Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M111.797%2023.356C112.711%2022.8402%20113.437%2022.0666%20113.953%2021.0352C114.469%2020.0037%20114.726%2018.7144%20114.726%2017.1672C114.726%2015.62%20114.492%2014.2134%20114.023%2013.2054C113.555%2012.1739%20112.851%2011.4238%20111.961%2010.9315C111.047%2010.4392%20109.922%2010.2048%20108.586%2010.2048H102.023V32.8501H105.703V24.153H108.258L111.094%2032.8501H115.078L111.75%2023.4028C111.75%2023.4028%20111.797%2023.4028%20111.82%2023.3794L111.797%2023.356ZM105.68%2013.6274H108.422C108.961%2013.6274%20109.406%2013.7211%20109.805%2013.9321C110.18%2014.1431%20110.484%2014.4947%20110.695%2015.0105C110.906%2015.5028%20111%2016.2295%20111%2017.1437C111%2018.058%20110.906%2018.8081%20110.695%2019.3239C110.484%2019.8396%20110.203%2020.1912%20109.828%2020.4022C109.453%2020.6132%20109.008%2020.707%20108.469%2020.707H105.703V13.6508L105.68%2013.6274Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M132.234%2027.3412L129.047%2010.1813H125.508L122.344%2027.2474L119.086%2010.1813H115.148L120.328%2032.8267H124.148L127.289%2017.6595L130.406%2032.8267H134.226L139.382%2010.1813H135.492L132.234%2027.3412Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M144.773%2010.1813H141.094V32.8267H144.773V10.1813Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M151.851%2014.19C152.109%2013.9087%20152.414%2013.6977%20152.766%2013.557C153.117%2013.4164%20153.539%2013.3461%20154.008%2013.3461C154.476%2013.3461%20155.109%2013.4398%20155.578%2013.6508C156.047%2013.8618%20156.422%2014.1665%20156.726%2014.5416C156.89%2014.7526%20157.055%2014.987%20157.172%2015.2683C157.312%2015.5496%20157.406%2015.8309%20157.453%2016.1357L160.922%2015.0574C160.664%2014.1431%20160.312%2013.3695%20159.867%2012.7131C159.422%2012.0567%20158.883%2011.4941%20158.25%2011.0487C157.687%2010.6502%20157.055%2010.3689%20156.328%2010.1813C155.625%209.99379%20154.851%209.90002%20154.055%209.90002C153.258%209.90002%20152.086%2010.0407%20151.266%2010.3454C150.469%2010.6502%20149.766%2011.0956%20149.203%2011.6816C148.617%2012.2443%20148.195%2012.9241%20147.914%2013.7211C147.633%2014.5182%20147.492%2015.4324%20147.492%2016.4405C147.492%2017.4485%20147.656%2018.5034%20148.008%2019.277C148.359%2020.0506%20148.875%2020.707%20149.578%2021.2461C150.281%2021.7853%20151.195%2022.2776%20152.344%2022.6761L154.336%2023.4028C155.062%2023.6842%20155.648%2023.9655%20156.047%2024.2702C156.445%2024.5515%20156.726%2024.8797%20156.89%2025.2314C157.055%2025.583%20157.125%2026.0284%20157.125%2026.5676C157.125%2027.1067%20157.078%2027.4818%20156.961%2027.8335C156.867%2028.1851%20156.68%2028.4899%20156.469%2028.7712C156.234%2029.0759%20155.93%2029.2869%20155.555%2029.4275C155.203%2029.5682%20154.781%2029.6385%20154.312%2029.6385C153.844%2029.6385%20153.211%2029.5448%20152.766%2029.3338C152.297%2029.1228%20151.922%2028.818%20151.617%2028.443C151.43%2028.232%20151.266%2027.9976%20151.148%2027.6928C151.008%2027.4115%20150.914%2027.1067%20150.867%2026.802L147.352%2027.7866C147.586%2028.7008%20147.937%2029.4979%20148.383%2030.2011C148.852%2030.9044%20149.391%2031.467%20150.047%2031.9359C150.633%2032.311%20151.266%2032.5923%20151.969%2032.8032C152.672%2033.0142%20153.445%2033.108%20154.242%2033.108C155.039%2033.108%20156.234%2032.9439%20157.031%2032.6626C157.851%2032.3578%20158.555%2031.9124%20159.14%2031.3029C159.68%2030.7169%20160.101%2030.0136%20160.406%2029.1931C160.711%2028.3726%20160.851%2027.4349%20160.851%2026.3566C160.851%2025.2782%20160.687%2024.2702%20160.336%2023.4966C159.984%2022.723%20159.469%2022.0666%20158.742%2021.5275C158.015%2020.9883%20157.078%2020.496%20155.883%2020.0506L153.914%2019.3239C153.187%2019.0426%20152.625%2018.7612%20152.25%2018.4799C151.852%2018.1752%20151.594%2017.8704%20151.453%2017.5188C151.312%2017.1672%20151.242%2016.7686%20151.242%2016.2998C151.242%2015.8309%20151.289%2015.4324%20151.406%2015.0808C151.5%2014.7292%20151.664%2014.4478%20151.851%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M174.633%2013.6274V10.1813H163.5V32.8267H174.633V29.3807H167.18V23.0043H173.367V19.5817H167.18V13.6274H174.633Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M179.316%2011.0956V10.1345H183.512V11.0956H181.918V15.8075H180.91V11.0956H179.316Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M184.168%2010.1345H185.41L186.676%2013.9321L187.941%2010.1345H189.184V15.8075H188.269V11.8223L187.098%2015.1511H186.254L185.082%2011.9161V15.831H184.168V10.1579V10.1345Z'%20fill='black'%3e%3c/path%3e%3c/svg%3e";
|
|
1111
|
-
let Qe = 0;
|
|
1112
|
-
function Ae({ width: t = 20, height: n = 20, style: i }) {
|
|
1113
|
-
const a = $(null);
|
|
1114
|
-
a.current || (a.current = `clip0_avatar_${++Qe}`);
|
|
1115
|
-
const o = a.current;
|
|
1116
|
-
return /* @__PURE__ */ e.jsxs("svg", { width: t, height: n, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: i, "aria-hidden": !0, children: [
|
|
1117
|
-
/* @__PURE__ */ e.jsxs("g", { clipPath: `url(#${o})`, children: [
|
|
396
|
+
}
|
|
397
|
+
function Qe() {
|
|
398
|
+
if (typeof document > "u" || document.getElementById(_e)) return;
|
|
399
|
+
const t = Ke();
|
|
400
|
+
if (!t) return;
|
|
401
|
+
const r = document.createElement("link");
|
|
402
|
+
r.id = _e, r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
403
|
+
}
|
|
404
|
+
function Re(t) {
|
|
405
|
+
if (!t || typeof t != "string") return "";
|
|
406
|
+
const r = t.trim().toLowerCase();
|
|
407
|
+
return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(r) ? r.length === 4 ? "#" + r[1] + r[1] + r[2] + r[2] + r[3] + r[3] : r : "";
|
|
408
|
+
}
|
|
409
|
+
const e2 = [
|
|
410
|
+
{ re: /^(#000000|#000)$/, class: "sw-ttyw-theme-default" },
|
|
411
|
+
{ re: /^#2563eb$/i, class: "sw-ttyw-theme-blue" },
|
|
412
|
+
{ re: /^#dc2626$/i, class: "sw-ttyw-theme-red" },
|
|
413
|
+
{ re: /^#16a34a$/i, class: "sw-ttyw-theme-green" }
|
|
414
|
+
];
|
|
415
|
+
function t2(t, r) {
|
|
416
|
+
const a = Re(t) || "#000";
|
|
417
|
+
Re(r);
|
|
418
|
+
for (const { re: i, class: n } of e2)
|
|
419
|
+
if (i.test(a)) return n;
|
|
420
|
+
return "sw-ttyw-theme-default";
|
|
421
|
+
}
|
|
422
|
+
let r2 = 0;
|
|
423
|
+
function Ie({ width: t = 20, height: r = 20 }) {
|
|
424
|
+
const a = A(null);
|
|
425
|
+
a.current || (a.current = `clip0_avatar_${++r2}`);
|
|
426
|
+
const i = a.current;
|
|
427
|
+
return /* @__PURE__ */ e.jsxs("svg", { width: t, height: r, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
428
|
+
/* @__PURE__ */ e.jsxs("g", { clipPath: `url(#${i})`, children: [
|
|
1118
429
|
/* @__PURE__ */ e.jsx("path", { d: "M73.41 57.8388C73.15 56.8088 72.23 56.0988 71.17 56.0988H62.35C61.29 56.0988 60.37 56.8188 60.11 57.8488L45.8 114.299C45.62 114.999 45.78 115.719 46.22 116.289C46.66 116.859 47.33 117.179 48.05 117.179H55.05C56.13 117.179 57.08 116.419 57.31 115.359L59.83 103.889H73.76L76.29 115.359C76.52 116.409 77.47 117.179 78.55 117.179H85.54C86.26 117.179 86.92 116.849 87.37 116.289C87.81 115.719 87.96 114.999 87.79 114.299L73.44 57.8488L73.41 57.8388ZM62.12 93.3688L66.76 72.2188L71.42 93.3688H62.12Z", fill: "#FF0000" }),
|
|
1119
430
|
/* @__PURE__ */ e.jsx("path", { d: "M101.69 56.0988H95.01C93.73 56.0988 92.7 57.1388 92.7 58.4088V114.859C92.7 116.139 93.74 117.169 95.01 117.169H101.69C102.97 117.169 104 116.129 104 114.859V58.4088C104 57.1288 102.96 56.0988 101.69 56.0988Z", fill: "#FF0000" }),
|
|
1120
431
|
/* @__PURE__ */ e.jsx("path", { d: "M154.17 122.419L153.98 50.4588C153.97 45.2188 151.16 40.3788 146.61 37.7688L84.21 1.94879C79.66 -0.661205 74.07 -0.651206 69.54 1.98879L7.30003 38.1288C2.77003 40.7588 -0.00997311 45.6088 2.68877e-05 50.8488L0.190027 122.809C0.200027 128.049 3.01003 132.889 7.56003 135.499L69.97 171.319C74.52 173.929 80.11 173.919 84.64 171.279L146.87 135.139C151.4 132.509 154.19 127.659 154.17 122.409V122.419ZM51.11 131.639C26.26 117.289 17.74 85.5088 32.09 60.6488C46.44 35.7988 78.22 27.2788 103.08 41.6288C127.93 55.9788 136.45 87.7588 122.1 112.619C107.75 137.469 75.97 145.989 51.11 131.639Z", fill: "#FF0000" })
|
|
1121
432
|
] }),
|
|
1122
|
-
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("clipPath", { id:
|
|
433
|
+
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("clipPath", { id: i, children: /* @__PURE__ */ e.jsx("rect", { width: "154.17", height: "173.268", fill: "white" }) }) })
|
|
1123
434
|
] });
|
|
1124
435
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const a = t ?? 4.6875 *
|
|
1127
|
-
return /* @__PURE__ */ e.jsxs("svg", { width: a, height:
|
|
436
|
+
function s2({ width: t, height: r = 20 }) {
|
|
437
|
+
const a = t ?? 4.6875 * r;
|
|
438
|
+
return /* @__PURE__ */ e.jsxs("svg", { width: a, height: r, viewBox: "0 0 75 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1128
439
|
/* @__PURE__ */ e.jsx("path", { d: "M6.82917 5.34411C6.8013 5.25174 6.71768 5.18707 6.62476 5.18707H5.80712C5.70492 5.18707 5.62129 5.25174 5.60271 5.34411L4.27404 10.5635C4.25546 10.6282 4.27404 10.6928 4.31121 10.7483C4.34838 10.8037 4.41341 10.8314 4.47845 10.8314H5.12885C5.23106 10.8314 5.31468 10.7575 5.34255 10.6651L5.57484 9.60278H6.86634L7.09862 10.6651C7.11721 10.7667 7.21012 10.8314 7.31232 10.8314H7.96272C8.02776 10.8314 8.0928 10.8037 8.12997 10.7483C8.16713 10.6928 8.18571 10.6282 8.16713 10.5635L6.83846 5.34411H6.82917ZM5.77925 8.62356L6.20665 6.67437L6.64335 8.62356H5.77925Z", fill: "white" }),
|
|
1129
440
|
/* @__PURE__ */ e.jsx("path", { d: "M9.44935 5.18707H8.82683C8.70604 5.18707 8.61313 5.27945 8.61313 5.39954V10.6189C8.61313 10.739 8.70604 10.8314 8.82683 10.8314H9.44935C9.57014 10.8314 9.66305 10.739 9.66305 10.6189V5.39954C9.66305 5.27945 9.57014 5.18707 9.44935 5.18707ZM8.83612 5.26097C8.81754 5.26097 8.79896 5.26098 8.78037 5.27021C8.79896 5.27021 8.81754 5.26097 8.83612 5.26097Z", fill: "white" }),
|
|
1130
441
|
/* @__PURE__ */ e.jsx("path", { d: "M14.3273 11.3118L14.3087 4.66051C14.3087 4.18014 14.0486 3.72748 13.6212 3.4873L7.82334 0.180139C7.40523 -0.0600462 6.88491 -0.0600462 6.45751 0.180139L0.678271 3.51501C0.260159 3.7552 0 4.20785 0 4.68822L0.0185826 11.3395C0.0185826 11.8199 0.278741 12.2725 0.706145 12.5127L6.50396 15.8199C6.92208 16.06 7.44239 16.06 7.8698 15.8199L13.649 12.485C14.0671 12.2448 14.3273 11.7921 14.3273 11.3118ZM4.75719 12.1617C2.44363 10.8314 1.65386 7.903 2.99182 5.60277C4.32049 3.30254 7.27515 2.51732 9.5887 3.84758C11.9023 5.16859 12.692 8.10624 11.3541 10.4065C10.0254 12.7067 7.07074 13.4919 4.75719 12.1617Z", fill: "white" }),
|
|
@@ -1141,577 +452,524 @@ function et({ width: t, height: n = 20, style: i }) {
|
|
|
1141
452
|
/* @__PURE__ */ e.jsx("path", { d: "M73.0116 3.71826H73.5041L74.0058 5.2148L74.5075 3.71826H75V5.95383H74.6376V4.38339L74.173 5.69517H73.8386L73.374 4.42034V5.96306H73.0116V3.7275V3.71826Z", fill: "white" })
|
|
1142
453
|
] });
|
|
1143
454
|
}
|
|
1144
|
-
|
|
1145
|
-
function tt() {
|
|
1146
|
-
if (typeof document > "u" || document.getElementById(Me)) return;
|
|
1147
|
-
const t = document.createElement("style");
|
|
1148
|
-
t.id = Me, t.textContent = Xe, document.head.appendChild(t);
|
|
1149
|
-
}
|
|
1150
|
-
tt();
|
|
1151
|
-
function rt(t) {
|
|
1152
|
-
return t === "human" ? { ...y.message, ...y.messageSelf } : { ...y.message, ...y.messageOther };
|
|
1153
|
-
}
|
|
1154
|
-
function Ce(t) {
|
|
455
|
+
function xe(t) {
|
|
1155
456
|
return String(t).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1156
457
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return !t.trim() || /^\s*([*\-]|\d+\.)\s+/.test(t)
|
|
458
|
+
function we(t) {
|
|
459
|
+
return !t.trim() || /^\s*([*\-]|\d+\.)\s+/.test(t) ? !1 : /^\s{2,}/.test(t) && /[=(){}\[\],:]/.test(t) || /["'][^"']*["']\s*[:=]/.test(t) && t.length > 10 ? !0 : /\[text\]|\[\/text\]|\]\[text\]/i.test(t) || /\?|!/.test(t) || t.includes("—") || t.includes("–") || /^\s*(Would|Can|May|Could|Should|I |You |We |Let's|Please|Sure|Yes|No)\b/i.test(t) || /\b(your|you|we|me)\b/i.test(t) || /^\s*[A-Z][^.(]*[.?]\s*$/.test(t) || /^\s*#/.test(t) || /^\s*[-*]\s+[A-Z]/.test(t) && !/\.\w+\s*\(|=/.test(t) || /^\s*\d+\.\s+[A-Z][^.(]*$/.test(t) ? !1 : !!(/^\s*[)\]}]\s*$/.test(t) || /^\s*\.{3}\s*$/.test(t) || /^\s*(GET|POST|PUT|PATCH|DELETE|HEAD)\s+\S+/i.test(t) || /^\s*(Authorization|Content-Type|Accept)\s*:/i.test(t) || /^\s*\{\s*$/.test(t) || /^\s*[\w.]+\s*=/.test(t) || /\.\w+\s*\(|\b(print|range|open|str|int|list|dict)\s*\(/.test(t) || /^\s*(def|class|import|from|return|if|else|elif|for|while|try|except|with|async)\b/.test(t) || /^\s{2,}/.test(t) && /[=(){}\[\],:]/.test(t) || /[,(]\s*$|:\s*$/.test(t) || /["'][^"']*["']\s*[:=]/.test(t) && t.length > 10 || /\b\w+\s*\([^)]*\)\s*$/.test(t) && /[=.]\w+\s*\(|import|from\s+\w+/.test(t));
|
|
1159
460
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const
|
|
1162
|
-
`),
|
|
1163
|
-
let
|
|
1164
|
-
for (;
|
|
1165
|
-
const
|
|
1166
|
-
if (!
|
|
1167
|
-
|
|
461
|
+
function n2(t) {
|
|
462
|
+
const r = [], a = t.split(`
|
|
463
|
+
`), i = [];
|
|
464
|
+
let n = 0;
|
|
465
|
+
for (; n < a.length; ) {
|
|
466
|
+
const m = a[n];
|
|
467
|
+
if (!we(m)) {
|
|
468
|
+
i.push(m), n++;
|
|
1168
469
|
continue;
|
|
1169
470
|
}
|
|
1170
|
-
const
|
|
1171
|
-
for (;
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1174
|
-
|
|
471
|
+
const g = [];
|
|
472
|
+
for (; n < a.length; ) {
|
|
473
|
+
const l = we(a[n]), p = a[n].trim() === "", c = n + 1 < a.length && we(a[n + 1]);
|
|
474
|
+
if (l || p && g.length > 0 && c)
|
|
475
|
+
g.push(a[n]), n++;
|
|
1175
476
|
else break;
|
|
1176
477
|
}
|
|
1177
|
-
if (
|
|
1178
|
-
const
|
|
1179
|
-
`).trim(),
|
|
1180
|
-
|
|
1181
|
-
} else
|
|
478
|
+
if (g.length >= 2) {
|
|
479
|
+
const l = r.length, p = g.join(`
|
|
480
|
+
`).trim(), c = xe(p);
|
|
481
|
+
r.push({ placeholder: `\0CODE_RAW_${l}\0`, html: `<pre class="sw-ttyw-code-block"><code>${c}</code></pre>` }), i.push(`\0CODE_RAW_${l}\0`);
|
|
482
|
+
} else g.length === 1 && i.push(g[0]);
|
|
1182
483
|
}
|
|
1183
|
-
return { html:
|
|
1184
|
-
`), codeBlocks:
|
|
484
|
+
return { html: i.join(`
|
|
485
|
+
`), codeBlocks: r };
|
|
1185
486
|
}
|
|
1186
|
-
function
|
|
487
|
+
function Pe(t) {
|
|
1187
488
|
return !t || !String(t).trim() ? "" : String(t).replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/`([^`]+)`/g, "<code>$1</code>").replace(/\n/g, "<br>");
|
|
1188
489
|
}
|
|
1189
|
-
const
|
|
1190
|
-
function
|
|
1191
|
-
const
|
|
1192
|
-
for (const
|
|
1193
|
-
const
|
|
1194
|
-
if (!
|
|
1195
|
-
const
|
|
1196
|
-
|
|
490
|
+
const $e = /^\s*([*\-]|\d+\.)\s+(.*)$/;
|
|
491
|
+
function o2(t) {
|
|
492
|
+
const r = [];
|
|
493
|
+
for (const p of t) {
|
|
494
|
+
const c = p.match($e);
|
|
495
|
+
if (!c) continue;
|
|
496
|
+
const C = p.match(/^(\s*)/)[1].length, j = c[1], f = c[2], u = /^\d+\.$/.test(j);
|
|
497
|
+
r.push({ indent: C, content: f, ordered: u });
|
|
1197
498
|
}
|
|
1198
|
-
if (
|
|
1199
|
-
const
|
|
1200
|
-
let
|
|
1201
|
-
for (let
|
|
1202
|
-
const { indent:
|
|
1203
|
-
if (
|
|
1204
|
-
|
|
499
|
+
if (r.length === 0) return "";
|
|
500
|
+
const a = 2, i = [], n = [];
|
|
501
|
+
let m = !1, g = !1, l = !1;
|
|
502
|
+
for (let p = 0; p < r.length; p++) {
|
|
503
|
+
const { indent: c, content: C, ordered: j } = r[p], f = Math.floor(c / a), u = Pe(C);
|
|
504
|
+
if (j)
|
|
505
|
+
g && (l && i.push("</li>"), i.push("</ul></li>"), n.pop(), g = !1, l = !1), l && n.length > 0 && n[n.length - 1].type === "ol" && i.push("</li>"), (n.length === 0 || n[n.length - 1].type !== "ol") && (i.push("<ol>"), n.push({ type: "ol", indentLevel: f })), i.push("<li>", u), l = !0, m = !0;
|
|
1205
506
|
else {
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1208
|
-
else if (
|
|
1209
|
-
|
|
1210
|
-
const
|
|
1211
|
-
for (;
|
|
1212
|
-
const
|
|
1213
|
-
if (
|
|
1214
|
-
|
|
507
|
+
if (m && f <= (n.length > 0 ? n[n.length - 1].indentLevel : 0))
|
|
508
|
+
i.push("<ul>"), n.push({ type: "ul", indentLevel: f }), g = !0, l = !1;
|
|
509
|
+
else if (g || n.length > 0 && n[n.length - 1].type === "ul") {
|
|
510
|
+
l && i.push("</li>"), l = !0;
|
|
511
|
+
const h = n.length > 0 ? n[n.length - 1].indentLevel : -1;
|
|
512
|
+
for (; f > h && n.length > 0 && n[n.length - 1].type === "ul"; ) {
|
|
513
|
+
const w = n[n.length - 1];
|
|
514
|
+
if (f <= w.indentLevel) break;
|
|
515
|
+
i.push("<ul>"), n.push({ type: "ul", indentLevel: f });
|
|
1215
516
|
}
|
|
1216
517
|
} else
|
|
1217
|
-
|
|
1218
|
-
|
|
518
|
+
n.length > 0 && i.push("</li>"), (n.length === 0 || n[n.length - 1].type !== "ul") && (i.push("<ul>"), n.push({ type: "ul", indentLevel: f })), l = !0;
|
|
519
|
+
i.push("<li>", u), m = !1;
|
|
1219
520
|
}
|
|
1220
521
|
}
|
|
1221
|
-
for (
|
|
1222
|
-
|
|
1223
|
-
return
|
|
522
|
+
for (l && i.push("</li>"); n.length > 0; )
|
|
523
|
+
n.pop().type === "ul" ? (i.push("</ul>"), n.length > 0 && n[n.length - 1].type === "ol" && i.push("</li>")) : i.push("</ol>");
|
|
524
|
+
return i.join("");
|
|
1224
525
|
}
|
|
1225
|
-
function
|
|
526
|
+
function Ve(t) {
|
|
1226
527
|
if (!t) return "";
|
|
1227
|
-
let
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
const
|
|
1231
|
-
return
|
|
1232
|
-
}),
|
|
1233
|
-
const
|
|
1234
|
-
return
|
|
528
|
+
let r = String(t);
|
|
529
|
+
const a = [];
|
|
530
|
+
r = r.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g, (f, u, h) => {
|
|
531
|
+
const w = a.length, v = xe(h.trim());
|
|
532
|
+
return a.push(`<pre class="sw-ttyw-code-block"><code class="${u ? `language-${u}` : ""}">${v}</code></pre>`), `\0CODE_FENCED_${w}\0`;
|
|
533
|
+
}), r = r.replace(/\[code\]([\s\S]*?)\[\/code\]/gi, (f, u) => {
|
|
534
|
+
const h = a.length, w = xe(u.trim());
|
|
535
|
+
return a.push(`<pre class="sw-ttyw-code-block"><code>${w}</code></pre>`), `\0CODE_FENCED_${h}\0`;
|
|
1235
536
|
});
|
|
1236
|
-
const { html:
|
|
1237
|
-
|
|
1238
|
-
const
|
|
1239
|
-
`),
|
|
1240
|
-
let
|
|
1241
|
-
function
|
|
1242
|
-
|
|
537
|
+
const { html: i, codeBlocks: n } = n2(r);
|
|
538
|
+
r = i, r = r.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\]|\[text\]|\](?=\s*(\n|$)))/gi, '<span class="sw-ttyw-text-block">$1</span>').replace(/\[bold\]([\s\S]*?)(?:\[\/bold\]|\]\[bold\]|\[bold\]|\](?=\s*(\n|$)))/gi, "<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)(?:\[\/italic\]|\]\[italic\]|\[italic\]|\](?=\s*(\n|$)))/gi, "<em>$1</em>").replace(/bold([\s\S]*?)\/bold/gi, "<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi, "<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/(https?:\/\/[^\s<]+)/g, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g, '<span class="sw-ttyw-bracket-label">$1</span>');
|
|
539
|
+
const m = r.split(`
|
|
540
|
+
`), g = [];
|
|
541
|
+
let l = [], p = [];
|
|
542
|
+
function c() {
|
|
543
|
+
l.length && (g.push({ type: "list", lines: l }), l = []);
|
|
1243
544
|
}
|
|
1244
|
-
function
|
|
1245
|
-
|
|
545
|
+
function C() {
|
|
546
|
+
p.length && (g.push({ type: "content", lines: p }), p = []);
|
|
1246
547
|
}
|
|
1247
|
-
for (let
|
|
1248
|
-
const
|
|
1249
|
-
|
|
548
|
+
for (let f = 0; f < m.length; f++) {
|
|
549
|
+
const u = m[f];
|
|
550
|
+
$e.test(u) ? (C(), l.push(u)) : (c(), p.push(u));
|
|
1250
551
|
}
|
|
1251
|
-
return
|
|
1252
|
-
`))).join(""),
|
|
1253
|
-
|
|
1254
|
-
}),
|
|
1255
|
-
|
|
1256
|
-
}),
|
|
552
|
+
return c(), C(), r = g.map((f) => f.type === "list" ? o2(f.lines) : Pe(f.lines.join(`
|
|
553
|
+
`))).join(""), a.forEach((f, u) => {
|
|
554
|
+
r = r.replace(`\0CODE_FENCED_${u}\0`, f);
|
|
555
|
+
}), n.forEach(({ placeholder: f, html: u }) => {
|
|
556
|
+
r = r.replace(f, u);
|
|
557
|
+
}), r = r.replace(/(<br\s*\/?>)\s*$/i, ""), r;
|
|
1257
558
|
}
|
|
1258
|
-
const
|
|
1259
|
-
const [
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}, [
|
|
1263
|
-
if (!
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
let
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1269
|
-
},
|
|
1270
|
-
typeof document < "u" &&
|
|
559
|
+
const a2 = 30, i2 = 300, l2 = Me(function({ text: r, speed: a = 20, onComplete: i }) {
|
|
560
|
+
const [n, m] = H(""), [g, l] = H(!1), p = A(i);
|
|
561
|
+
P(() => {
|
|
562
|
+
p.current = i;
|
|
563
|
+
}, [i]), P(() => {
|
|
564
|
+
if (!r) return;
|
|
565
|
+
m(""), l(!1);
|
|
566
|
+
const C = r.trim().split(/\s+/), j = Math.min(a2, C.length), f = C.slice(0, j).join(" "), u = Math.min(f.length, i2, r.length);
|
|
567
|
+
let h = 0, w = null, v = !1;
|
|
568
|
+
const S = () => {
|
|
569
|
+
v || (v = !0, w && clearInterval(w), w = null, m(r), l(!0), p.current && p.current());
|
|
570
|
+
}, R = () => {
|
|
571
|
+
typeof document < "u" && S();
|
|
1271
572
|
};
|
|
1272
|
-
return typeof document < "u" && document.addEventListener("visibilitychange",
|
|
1273
|
-
|
|
1274
|
-
},
|
|
1275
|
-
|
|
573
|
+
return typeof document < "u" && document.addEventListener("visibilitychange", R), w = setInterval(() => {
|
|
574
|
+
h < u ? (m(r.slice(0, h + 1)), h++) : S();
|
|
575
|
+
}, a), () => {
|
|
576
|
+
w && clearInterval(w), typeof document < "u" && document.removeEventListener("visibilitychange", R);
|
|
1276
577
|
};
|
|
1277
|
-
}, [
|
|
1278
|
-
const
|
|
578
|
+
}, [r, a]);
|
|
579
|
+
const c = (C) => C.replace(/(https?:\/\/[^\s<]+)/g, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[bold\]([\s\S]*?)(?:\[\/bold\]|\]\[bold\]|\[bold\]|\](?=\s*(\n|$)))/gi, "<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)(?:\[\/italic\]|\]\[italic\]|\[italic\]|\](?=\s*(\n|$)))/gi, "<em>$1</em>").replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\]|\[text\]|\](?=\s*(\n|$)))/gi, '<span class="sw-ttyw-text-block">$1</span>').replace(/bold([\s\S]*?)\/bold/gi, "<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi, "<em>$1</em>").replace(/\[([^[\]]+)\]/g, '<span class="sw-ttyw-bracket-label">$1</span>').replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
|
|
1279
580
|
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1");
|
|
1280
581
|
return /* @__PURE__ */ e.jsx(
|
|
1281
582
|
"div",
|
|
1282
583
|
{
|
|
1283
|
-
|
|
1284
|
-
whiteSpace: "pre-wrap",
|
|
1285
|
-
lineHeight: "1.5",
|
|
1286
|
-
wordBreak: "break-word"
|
|
1287
|
-
},
|
|
584
|
+
className: "sw-ttyw-markdown-pre-wrap",
|
|
1288
585
|
dangerouslySetInnerHTML: {
|
|
1289
|
-
__html:
|
|
586
|
+
__html: g ? Ve(n) : c(n) + '<span class="typing-cursor">|</span>'
|
|
1290
587
|
}
|
|
1291
588
|
}
|
|
1292
589
|
);
|
|
1293
|
-
}),
|
|
1294
|
-
const
|
|
1295
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
1296
|
-
/* @__PURE__ */ e.jsx("div", { className: "message-avatar",
|
|
590
|
+
}), c2 = Me(function({ msg: r, isTyping: a = !1, onTypingComplete: i }) {
|
|
591
|
+
const n = r.from === "human" ? "sw-ttyw-message self" : "sw-ttyw-message other";
|
|
592
|
+
return /* @__PURE__ */ e.jsxs("div", { className: n, children: [
|
|
593
|
+
/* @__PURE__ */ e.jsx("div", { className: "message-avatar", children: r.from === "human" ? /* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1297
594
|
/* @__PURE__ */ e.jsx("path", { d: "M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21" }),
|
|
1298
595
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
1299
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
1300
|
-
/* @__PURE__ */ e.jsx("div", { className: "message-content sw-ttyw-markdown",
|
|
596
|
+
] }) : /* @__PURE__ */ e.jsx(Ie, { width: 20, height: 20 }) }),
|
|
597
|
+
/* @__PURE__ */ e.jsx("div", { className: "message-content sw-ttyw-markdown", children: r.from === "ai" && a ? /* @__PURE__ */ e.jsx(l2, { text: r.text, speed: 20, onComplete: i }) : r.from === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1301
598
|
"div",
|
|
1302
599
|
{
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
lineHeight: "1.5",
|
|
1306
|
-
wordBreak: "break-word"
|
|
1307
|
-
},
|
|
1308
|
-
dangerouslySetInnerHTML: { __html: We(n.text) }
|
|
600
|
+
className: "sw-ttyw-markdown-pre-wrap",
|
|
601
|
+
dangerouslySetInnerHTML: { __html: Ve(r.text) }
|
|
1309
602
|
}
|
|
1310
603
|
) : /* @__PURE__ */ e.jsx(
|
|
1311
604
|
"div",
|
|
1312
605
|
{
|
|
1313
|
-
|
|
1314
|
-
whiteSpace: "pre-wrap",
|
|
1315
|
-
lineHeight: "1.5",
|
|
1316
|
-
wordBreak: "break-word"
|
|
1317
|
-
},
|
|
606
|
+
className: "sw-ttyw-markdown-pre-wrap",
|
|
1318
607
|
dangerouslySetInnerHTML: {
|
|
1319
|
-
__html:
|
|
608
|
+
__html: r.text.replace(/\[bold\]([\s\S]*?)(?:\[\/bold\]|\]\[bold\]|\[bold\]|\](?=\s*(\n|$)))/gi, "<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)(?:\[\/italic\]|\]\[italic\]|\[italic\]|\](?=\s*(\n|$)))/gi, "<em>$1</em>").replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\]|\[text\]|\](?=\s*(\n|$)))/gi, '<span class="sw-ttyw-text-block">$1</span>').replace(/bold([\s\S]*?)\/bold/gi, "<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi, "<em>$1</em>").replace(/\[([^[\]]+)\]/g, "<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
|
|
1320
609
|
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1")
|
|
1321
610
|
}
|
|
1322
611
|
}
|
|
1323
612
|
) })
|
|
1324
613
|
] });
|
|
1325
|
-
}),
|
|
1326
|
-
const
|
|
1327
|
-
let
|
|
1328
|
-
return
|
|
614
|
+
}), d2 = (t = "") => {
|
|
615
|
+
const r = (/* @__PURE__ */ new Date()).getHours();
|
|
616
|
+
let a = [];
|
|
617
|
+
return r >= 5 && r < 12 ? t ? a = [
|
|
1329
618
|
`🌅 Good morning ${t}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,
|
|
1330
619
|
`☀️ Morning ${t}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,
|
|
1331
620
|
`🌞 Good morning ${t}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,
|
|
1332
621
|
`👋 Rise and shine ${t}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,
|
|
1333
622
|
`👋 Morning ${t}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`
|
|
1334
|
-
] :
|
|
623
|
+
] : a = [
|
|
1335
624
|
"🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?",
|
|
1336
625
|
"☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?",
|
|
1337
626
|
"🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?",
|
|
1338
627
|
"👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.",
|
|
1339
628
|
"👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"
|
|
1340
|
-
] :
|
|
629
|
+
] : r >= 12 && r < 17 ? t ? a = [
|
|
1341
630
|
`🌞 Good afternoon ${t}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,
|
|
1342
631
|
`☀️ Afternoon ${t}! I'm an expert on SUPERWISE. How may I help you today?`,
|
|
1343
632
|
`👋 Good afternoon ${t}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,
|
|
1344
633
|
`🌅 Hey there ${t}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,
|
|
1345
634
|
`🌅 Afternoon ${t}! I'm an expert on SUPERWISE. How can I support your exploration today?`
|
|
1346
|
-
] :
|
|
635
|
+
] : a = [
|
|
1347
636
|
"🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?",
|
|
1348
637
|
"☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?",
|
|
1349
638
|
"👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?",
|
|
1350
639
|
"🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.",
|
|
1351
640
|
"🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"
|
|
1352
|
-
] :
|
|
641
|
+
] : r >= 17 && r < 21 ? t ? a = [
|
|
1353
642
|
`🌆 Good evening ${t}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,
|
|
1354
643
|
`🌅 Evening ${t}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,
|
|
1355
644
|
`👋 Good evening ${t}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,
|
|
1356
645
|
`🌇 Hey there ${t}! SUPERWISE expert here. Want to dive into the platform together?`,
|
|
1357
646
|
`🌇 Evening ${t}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`
|
|
1358
|
-
] :
|
|
647
|
+
] : a = [
|
|
1359
648
|
"🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?",
|
|
1360
649
|
"🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?",
|
|
1361
650
|
"👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?",
|
|
1362
651
|
"🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?",
|
|
1363
652
|
"🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"
|
|
1364
|
-
] : t ?
|
|
653
|
+
] : t ? a = [
|
|
1365
654
|
`🌙 Good evening ${t}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,
|
|
1366
655
|
`⭐ Evening ${t}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,
|
|
1367
656
|
`👋 Good evening ${t}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,
|
|
1368
657
|
`🌃 Hey there ${t}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,
|
|
1369
658
|
`🌃 Evening ${t}! SUPERWISE expert here. How can I help simplify or explain things for you today?`
|
|
1370
|
-
] :
|
|
659
|
+
] : a = [
|
|
1371
660
|
"🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.",
|
|
1372
661
|
"⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?",
|
|
1373
662
|
"👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?",
|
|
1374
663
|
"🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?",
|
|
1375
664
|
"🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"
|
|
1376
|
-
],
|
|
665
|
+
], a[Math.floor(Math.random() * a.length)];
|
|
1377
666
|
};
|
|
1378
|
-
function
|
|
1379
|
-
|
|
667
|
+
function h2({ title: t = "", agentId: r = "", discoveryAgentId: a = "", primaryColor: i = "", minimizedButtonColor: n = "", apiUrl: m = "" }) {
|
|
668
|
+
P(() => {
|
|
669
|
+
Qe();
|
|
670
|
+
}, []);
|
|
671
|
+
const g = ge(() => t2(i, n), [i, n]), [l, p] = H(() => {
|
|
1380
672
|
try {
|
|
1381
673
|
if (typeof window < "u" && window.localStorage) {
|
|
1382
|
-
const
|
|
1383
|
-
return
|
|
674
|
+
const o = window.localStorage.getItem("chatbot-messages");
|
|
675
|
+
return o ? JSON.parse(o) : [];
|
|
1384
676
|
}
|
|
1385
677
|
} catch {
|
|
1386
678
|
}
|
|
1387
679
|
return [];
|
|
1388
|
-
}), [
|
|
680
|
+
}), [c, C] = H(() => {
|
|
1389
681
|
try {
|
|
1390
682
|
if (typeof window < "u" && window.localStorage) {
|
|
1391
|
-
const
|
|
1392
|
-
return
|
|
683
|
+
const o = window.localStorage.getItem("chatbot-mql_df");
|
|
684
|
+
return o ? JSON.parse(o) : [];
|
|
1393
685
|
}
|
|
1394
686
|
} catch {
|
|
1395
687
|
}
|
|
1396
688
|
return [];
|
|
1397
|
-
}), [
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
if (!l || l.length === 0) return "";
|
|
1409
|
-
const s = l.find((C) => C.name && C.email);
|
|
1410
|
-
return s ? `${s.name} (${s.email})` : "";
|
|
1411
|
-
}, [l]), j = $(null), R = $(null), [oe, K] = H(!0), Q = $(!0), ke = $(c), A = Z(() => {
|
|
1412
|
-
r.current && (clearTimeout(r.current), r.current = null);
|
|
1413
|
-
}, []), ve = Z((s) => {
|
|
1414
|
-
A(), r.current = setTimeout(s, re);
|
|
1415
|
-
}, [re, A]), we = Ie(() => c.map((s) => ({ role: s.from, content: s.text })), [c]), he = (s) => {
|
|
1416
|
-
O(s), setTimeout(() => {
|
|
1417
|
-
O("");
|
|
689
|
+
}), [j, f] = H(""), [u, h] = H(!1), [w, v] = H(!1), [S, R] = H(!0), [B, se] = H(!1), [ne, N] = H(/* @__PURE__ */ new Set()), [oe, ae] = H(!1), [J, ie] = H(!1), [le, M] = H(!1), [$, ce] = H(!1), [de, K] = H(""), [q, D] = H(""), Q = 12e4, ue = "https://superwise.ai/contact/", s = (o) => typeof o == "string" && o.includes("unable to respond at the moment") && o.includes("Contact Sales"), d = A(null), b = A(null), E = ge(() => {
|
|
690
|
+
if (!c || c.length === 0) return "";
|
|
691
|
+
const o = c.find((y) => y.name && y.email);
|
|
692
|
+
return o ? `${o.name} (${o.email})` : "";
|
|
693
|
+
}, [c]), G = A(null), V = A(null), [L, I] = H(!0), T = A(!0), he = A(l), W = Y(() => {
|
|
694
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
695
|
+
}, []), be = Y((o) => {
|
|
696
|
+
W(), d.current = setTimeout(o, Q);
|
|
697
|
+
}, [Q, W]), me = ge(() => l.map((o) => ({ role: o.from, content: o.text })), [l]), pe = (o) => {
|
|
698
|
+
D(o), setTimeout(() => {
|
|
699
|
+
D("");
|
|
1418
700
|
}, 4e3);
|
|
1419
|
-
}, Te = (
|
|
1420
|
-
const
|
|
1421
|
-
return
|
|
1422
|
-
},
|
|
1423
|
-
var
|
|
1424
|
-
const
|
|
1425
|
-
|
|
701
|
+
}, Te = (o) => {
|
|
702
|
+
const y = o.length, k = o.trim();
|
|
703
|
+
return K(""), D(""), !k || y === 0 ? (pe("Please enter a message before sending."), !1) : new RegExp(/(<([^>]+)>)/gi).test(k) ? (pe("Please avoid using HTML tags or scripts in your message."), !1) : k.length < 2 ? (pe("Please enter a meaningful question (at least 2 characters)."), !1) : k.length > 1e3 ? (pe("Message is too long. Please keep it under 1000 characters."), !1) : (K(""), D(""), !0);
|
|
704
|
+
}, F = Y((o = "auto") => {
|
|
705
|
+
var k;
|
|
706
|
+
const y = V.current;
|
|
707
|
+
y && (y.scrollTop = y.scrollHeight), (k = G.current) == null || k.scrollIntoView({ behavior: o }), T.current = !0, I(!0);
|
|
1426
708
|
}, []);
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
}, [
|
|
1430
|
-
const
|
|
1431
|
-
if (!
|
|
1432
|
-
const
|
|
1433
|
-
|
|
709
|
+
P(() => {
|
|
710
|
+
T.current && requestAnimationFrame(() => F("auto"));
|
|
711
|
+
}, [l, q, le, $, ne, u, F]), P(() => {
|
|
712
|
+
const o = V.current;
|
|
713
|
+
if (!o || typeof ResizeObserver > "u") return;
|
|
714
|
+
const y = new ResizeObserver(() => {
|
|
715
|
+
T.current && F("auto");
|
|
1434
716
|
});
|
|
1435
|
-
return
|
|
1436
|
-
}, [
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1443
|
-
const
|
|
1444
|
-
if (
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1447
|
-
const fe =
|
|
1448
|
-
|
|
717
|
+
return y.observe(o), () => y.disconnect();
|
|
718
|
+
}, [F]);
|
|
719
|
+
const Ce = A(null), ke = A(S);
|
|
720
|
+
P(() => {
|
|
721
|
+
const o = ke.current;
|
|
722
|
+
if (ke.current = S, o && !S) {
|
|
723
|
+
const y = Ce.current;
|
|
724
|
+
y != null ? (Ce.current = null, requestAnimationFrame(() => {
|
|
725
|
+
const k = V.current;
|
|
726
|
+
if (k) {
|
|
727
|
+
const _ = k.scrollHeight - k.clientHeight;
|
|
728
|
+
k.scrollTop = Math.min(y, Math.max(0, _));
|
|
729
|
+
const fe = k.scrollHeight - k.scrollTop - k.clientHeight <= 40;
|
|
730
|
+
T.current = fe, I(fe);
|
|
1449
731
|
}
|
|
1450
|
-
})) : requestAnimationFrame(() =>
|
|
732
|
+
})) : requestAnimationFrame(() => F("auto"));
|
|
1451
733
|
}
|
|
1452
|
-
}, [
|
|
1453
|
-
const
|
|
1454
|
-
const
|
|
1455
|
-
if (!
|
|
1456
|
-
const
|
|
1457
|
-
|
|
734
|
+
}, [S, F]);
|
|
735
|
+
const We = Y(() => {
|
|
736
|
+
const o = V.current;
|
|
737
|
+
if (!o) return;
|
|
738
|
+
const _ = o.scrollHeight - o.scrollTop - o.clientHeight <= 40;
|
|
739
|
+
T.current !== _ && (T.current = _, I(_));
|
|
1458
740
|
}, []);
|
|
1459
|
-
|
|
741
|
+
P(() => {
|
|
1460
742
|
try {
|
|
1461
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(
|
|
743
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(l));
|
|
1462
744
|
} catch {
|
|
1463
745
|
}
|
|
1464
|
-
}, [
|
|
746
|
+
}, [l]), P(() => {
|
|
1465
747
|
try {
|
|
1466
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(
|
|
748
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(c));
|
|
1467
749
|
} catch {
|
|
1468
750
|
}
|
|
1469
|
-
}, [
|
|
1470
|
-
|
|
1471
|
-
}, [
|
|
1472
|
-
if (
|
|
1473
|
-
const
|
|
1474
|
-
|
|
751
|
+
}, [c]), P(() => {
|
|
752
|
+
he.current = l;
|
|
753
|
+
}, [l]), P(() => {
|
|
754
|
+
if (l.length === 0 && !oe) {
|
|
755
|
+
const y = { from: "ai", text: d2(E) };
|
|
756
|
+
p([y]), ae(!0), N(/* @__PURE__ */ new Set([0]));
|
|
1475
757
|
}
|
|
1476
|
-
}, [
|
|
1477
|
-
const
|
|
1478
|
-
var
|
|
1479
|
-
if (
|
|
1480
|
-
const
|
|
1481
|
-
if (!
|
|
758
|
+
}, [l.length, oe, E]), P(() => () => W(), [W]);
|
|
759
|
+
const ve = Y(async () => {
|
|
760
|
+
var Le;
|
|
761
|
+
if (u || $) return;
|
|
762
|
+
const o = j.trim();
|
|
763
|
+
if (!o || !Te(j))
|
|
1482
764
|
return;
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
-
let
|
|
1489
|
-
if (
|
|
1490
|
-
const
|
|
1491
|
-
|
|
765
|
+
M(!1), W(), (Le = b.current) == null || Le.abort();
|
|
766
|
+
const y = new AbortController();
|
|
767
|
+
b.current = y;
|
|
768
|
+
const k = y.signal, _ = { from: "human", text: o }, O = he.current, fe = [...O, _];
|
|
769
|
+
p(fe), f(""), h(!0);
|
|
770
|
+
let Se = o;
|
|
771
|
+
if (c && c.length > 0 && !J) {
|
|
772
|
+
const x = O.filter((z) => z.from === "ai").pop();
|
|
773
|
+
x && x.text && x.text.trim() !== "" && (Se = o + "." + x.text, ie(!0));
|
|
1492
774
|
}
|
|
1493
|
-
const Oe = [...
|
|
1494
|
-
|
|
1495
|
-
var
|
|
1496
|
-
|
|
775
|
+
const Oe = [...me, { role: "human", content: o }];
|
|
776
|
+
be(() => {
|
|
777
|
+
var x;
|
|
778
|
+
M(!0), (x = b.current) == null || x.abort(), h(!1);
|
|
1497
779
|
});
|
|
1498
780
|
try {
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
const
|
|
1504
|
-
return
|
|
1505
|
-
}), (
|
|
781
|
+
const x = await ze(Se, Oe, c, r, a, m, k);
|
|
782
|
+
if (W(), typeof x == "string") {
|
|
783
|
+
const z = { from: "ai", text: x };
|
|
784
|
+
p((Z) => {
|
|
785
|
+
const U = [...Z, z];
|
|
786
|
+
return N((X) => /* @__PURE__ */ new Set([...X, U.length - 1])), U;
|
|
787
|
+
}), (x.startsWith("⚠️") || x.startsWith("❌") || s(x)) && M(!0);
|
|
1506
788
|
} else {
|
|
1507
|
-
if (
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
789
|
+
if (x != null && x.isError) {
|
|
790
|
+
M(!0);
|
|
791
|
+
const Z = x.reply || re;
|
|
792
|
+
p((U) => {
|
|
793
|
+
const X = [...U, { from: "ai", text: Z }];
|
|
794
|
+
return N((Ue) => /* @__PURE__ */ new Set([...Ue, X.length - 1])), X;
|
|
1513
795
|
});
|
|
1514
796
|
return;
|
|
1515
797
|
}
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
const
|
|
1519
|
-
return
|
|
1520
|
-
}),
|
|
798
|
+
const z = { from: "ai", text: x.reply };
|
|
799
|
+
p((Z) => {
|
|
800
|
+
const U = [...Z, z];
|
|
801
|
+
return N((X) => /* @__PURE__ */ new Set([...X, U.length - 1])), U;
|
|
802
|
+
}), x.mqlDf && Array.isArray(x.mqlDf) && C(x.mqlDf), x.reply && (x.reply.startsWith("⚠️") || x.reply.startsWith("❌") || s(x.reply)) && M(!0), x.chatHistoryLimitExceeded && ce(!0);
|
|
1521
803
|
}
|
|
1522
|
-
} catch (
|
|
1523
|
-
if (
|
|
804
|
+
} catch (x) {
|
|
805
|
+
if (W(), x.name === "AbortError")
|
|
1524
806
|
return;
|
|
1525
|
-
|
|
1526
|
-
const
|
|
1527
|
-
...
|
|
807
|
+
M(!0), p((z) => {
|
|
808
|
+
const Z = [
|
|
809
|
+
...z,
|
|
1528
810
|
{
|
|
1529
811
|
from: "ai",
|
|
1530
|
-
text:
|
|
812
|
+
text: re
|
|
1531
813
|
}
|
|
1532
814
|
];
|
|
1533
|
-
return
|
|
815
|
+
return N((U) => /* @__PURE__ */ new Set([...U, Z.length - 1])), Z;
|
|
1534
816
|
});
|
|
1535
817
|
} finally {
|
|
1536
818
|
h(!1);
|
|
1537
819
|
}
|
|
1538
|
-
}, [
|
|
1539
|
-
var
|
|
1540
|
-
|
|
820
|
+
}, [j, r, a, c, J, me, $, W, be]), Ae = Y(() => {
|
|
821
|
+
var o;
|
|
822
|
+
W(), (o = b.current) == null || o.abort(), M(!1), ce(!1), p([]), N(/* @__PURE__ */ new Set()), ae(!1), ie(!1);
|
|
1541
823
|
try {
|
|
1542
824
|
typeof window < "u" && window.localStorage && window.localStorage.removeItem("chatbot-messages");
|
|
1543
825
|
} catch {
|
|
1544
826
|
}
|
|
1545
|
-
|
|
1546
|
-
}, [
|
|
1547
|
-
var
|
|
1548
|
-
if (!
|
|
827
|
+
v(!1);
|
|
828
|
+
}, [W]), Ee = Y(async () => {
|
|
829
|
+
var o, y, k;
|
|
830
|
+
if (!c || c.length === 0) {
|
|
1549
831
|
console.warn("No mql_df data available for PDF download");
|
|
1550
832
|
return;
|
|
1551
833
|
}
|
|
1552
834
|
try {
|
|
1553
|
-
h(!0), console.log("mql_df data for lead extraction:",
|
|
1554
|
-
const
|
|
1555
|
-
name: ((
|
|
1556
|
-
email: ((
|
|
1557
|
-
summary: `Chat conversation with ${
|
|
835
|
+
h(!0), console.log("mql_df data for lead extraction:", c);
|
|
836
|
+
const _ = {
|
|
837
|
+
name: ((o = c.find((O) => O.name)) == null ? void 0 : o.name) || "Chat User",
|
|
838
|
+
email: ((y = c.find((O) => O.email)) == null ? void 0 : y.email) || "user@example.com",
|
|
839
|
+
summary: `Chat conversation with ${l.length} messages. User asked: "${((k = l.find((O) => O.from === "human")) == null ? void 0 : k.text) || "No user messages"}"`
|
|
1558
840
|
};
|
|
1559
|
-
console.log("Extracted lead row:",
|
|
1560
|
-
} catch (
|
|
1561
|
-
console.error("Failed to download PDF:",
|
|
841
|
+
console.log("Extracted lead row:", _), await Ye(c, _, me, m), console.log("PDF downloaded successfully");
|
|
842
|
+
} catch (_) {
|
|
843
|
+
console.error("Failed to download PDF:", _);
|
|
1562
844
|
} finally {
|
|
1563
845
|
h(!1);
|
|
1564
846
|
}
|
|
1565
|
-
}, [
|
|
847
|
+
}, [c, l]), Ne = [
|
|
848
|
+
"sw-ttyw-chatbot",
|
|
849
|
+
g,
|
|
850
|
+
S ? "sw-ttyw-container-minimized" : B ? "sw-ttyw-container-expanded" : "sw-ttyw-container"
|
|
851
|
+
].filter(Boolean).join(" ");
|
|
1566
852
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
1567
853
|
"div",
|
|
1568
854
|
{
|
|
1569
|
-
className:
|
|
1570
|
-
|
|
1571
|
-
...x ? y.containerMinimized : _ ? y.containerExpanded : y.container,
|
|
1572
|
-
"--swttyw-primary-color": E,
|
|
1573
|
-
"--swttyw-minimized-button-color": J,
|
|
1574
|
-
"--swttyw-avatar-image": "url('')",
|
|
1575
|
-
"--swttyw-user-avatar-image": "url('')",
|
|
1576
|
-
"--swttyw-background-color": "#F7F7F7",
|
|
1577
|
-
"--swttyw-header-font-size": "16px",
|
|
1578
|
-
"--swttyw-body-font-size": "15px",
|
|
1579
|
-
"--swttyw-footer-font-size": "16px",
|
|
1580
|
-
"--swttyw-user-background-image": "url('')"
|
|
1581
|
-
},
|
|
1582
|
-
onClick: x ? () => M(!1) : void 0,
|
|
855
|
+
className: Ne,
|
|
856
|
+
onClick: S ? () => R(!1) : void 0,
|
|
1583
857
|
children: [
|
|
1584
|
-
|
|
1585
|
-
/*
|
|
1586
|
-
/* @__PURE__ */ e.jsx("
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
"
|
|
1598
|
-
{
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
"button",
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
)
|
|
1658
|
-
] })
|
|
858
|
+
S ? /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-minimized-content", children: /* @__PURE__ */ e.jsxs("svg", { className: "sw-ttyw-chat-icon", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
859
|
+
/* @__PURE__ */ e.jsx("path", { d: "M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
860
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 9H16", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
861
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 13H12", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
862
|
+
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-header", children: [
|
|
863
|
+
/* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-name", children: t }),
|
|
864
|
+
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-header-actions", children: [
|
|
865
|
+
/* @__PURE__ */ e.jsx(
|
|
866
|
+
"button",
|
|
867
|
+
{
|
|
868
|
+
type: "button",
|
|
869
|
+
onClick: () => se((o) => !o),
|
|
870
|
+
className: "sw-ttyw-header-button",
|
|
871
|
+
title: B ? "Shrink chat" : "Expand chat",
|
|
872
|
+
children: B ? /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
873
|
+
/* @__PURE__ */ e.jsx("path", { d: "M9 4V9H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
874
|
+
/* @__PURE__ */ e.jsx("path", { d: "M15 4V9H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
875
|
+
/* @__PURE__ */ e.jsx("path", { d: "M9 20V15H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
876
|
+
/* @__PURE__ */ e.jsx("path", { d: "M15 20V15H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
877
|
+
] }) : /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
878
|
+
/* @__PURE__ */ e.jsx("path", { d: "M4 9V4H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
879
|
+
/* @__PURE__ */ e.jsx("path", { d: "M20 9V4H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
880
|
+
/* @__PURE__ */ e.jsx("path", { d: "M4 15V20H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
881
|
+
/* @__PURE__ */ e.jsx("path", { d: "M20 15V20H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
882
|
+
] })
|
|
883
|
+
}
|
|
884
|
+
),
|
|
885
|
+
/* @__PURE__ */ e.jsx(
|
|
886
|
+
"button",
|
|
887
|
+
{
|
|
888
|
+
type: "button",
|
|
889
|
+
onClick: () => {
|
|
890
|
+
if (!S) {
|
|
891
|
+
const o = V.current;
|
|
892
|
+
o && (Ce.current = o.scrollTop), se(!1);
|
|
893
|
+
}
|
|
894
|
+
R(!S);
|
|
895
|
+
},
|
|
896
|
+
className: "sw-ttyw-header-button",
|
|
897
|
+
title: S ? "Maximize chat" : "Minimize chat",
|
|
898
|
+
children: /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { d: "M6 9H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
899
|
+
}
|
|
900
|
+
),
|
|
901
|
+
c && c.length > 0 && /* @__PURE__ */ e.jsx(
|
|
902
|
+
"button",
|
|
903
|
+
{
|
|
904
|
+
type: "button",
|
|
905
|
+
onClick: Ee,
|
|
906
|
+
className: "sw-ttyw-header-button",
|
|
907
|
+
title: "Download PDF Report",
|
|
908
|
+
disabled: u,
|
|
909
|
+
children: /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
910
|
+
/* @__PURE__ */ e.jsx("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
911
|
+
/* @__PURE__ */ e.jsx("path", { d: "M7 10L12 15L17 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
912
|
+
/* @__PURE__ */ e.jsx("path", { d: "M12 15V3", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
913
|
+
] })
|
|
914
|
+
}
|
|
915
|
+
),
|
|
916
|
+
/* @__PURE__ */ e.jsx(
|
|
917
|
+
"button",
|
|
918
|
+
{
|
|
919
|
+
type: "button",
|
|
920
|
+
onClick: () => v(!0),
|
|
921
|
+
className: "sw-ttyw-header-button",
|
|
922
|
+
title: "Clear chat",
|
|
923
|
+
children: /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
924
|
+
/* @__PURE__ */ e.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
925
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
926
|
+
/* @__PURE__ */ e.jsx("path", { d: "M10 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
927
|
+
/* @__PURE__ */ e.jsx("path", { d: "M14 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
928
|
+
] })
|
|
929
|
+
}
|
|
930
|
+
)
|
|
1659
931
|
] })
|
|
1660
|
-
),
|
|
1661
|
-
!
|
|
932
|
+
] }),
|
|
933
|
+
!S && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-section sw-ttyw-chat-section-flex", children: [
|
|
1662
934
|
/* @__PURE__ */ e.jsxs(
|
|
1663
935
|
"div",
|
|
1664
936
|
{
|
|
1665
|
-
className: "sw-ttyw-messages",
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
onScroll: Fe,
|
|
937
|
+
className: "sw-ttyw-messages sw-ttyw-chat-section",
|
|
938
|
+
ref: V,
|
|
939
|
+
onScroll: We,
|
|
1669
940
|
children: [
|
|
1670
|
-
|
|
1671
|
-
display: "flex",
|
|
1672
|
-
flexDirection: "column",
|
|
1673
|
-
alignItems: "center",
|
|
1674
|
-
justifyContent: "center",
|
|
1675
|
-
height: "100%",
|
|
1676
|
-
position: "relative"
|
|
1677
|
-
}, children: /* @__PURE__ */ e.jsx(
|
|
941
|
+
l.length === 0 && !u && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-empty-state", children: /* @__PURE__ */ e.jsx(
|
|
1678
942
|
"img",
|
|
1679
943
|
{
|
|
1680
|
-
src:
|
|
944
|
+
src: Je,
|
|
1681
945
|
alt: "Superwise Logo",
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
height: "200px",
|
|
1685
|
-
opacity: 0.8,
|
|
1686
|
-
objectFit: "contain"
|
|
1687
|
-
},
|
|
1688
|
-
onError: (s) => {
|
|
1689
|
-
console.log("Logo failed to load, using fallback"), s.target.style.display = "none";
|
|
946
|
+
onError: (o) => {
|
|
947
|
+
console.log("Logo failed to load, using fallback"), o.target.classList.add("sw-ttyw-logo-hidden");
|
|
1690
948
|
}
|
|
1691
949
|
}
|
|
1692
950
|
) }),
|
|
1693
|
-
|
|
1694
|
-
|
|
951
|
+
l.map((o, y) => /* @__PURE__ */ e.jsx(
|
|
952
|
+
c2,
|
|
1695
953
|
{
|
|
1696
|
-
msg:
|
|
1697
|
-
isTyping:
|
|
954
|
+
msg: o,
|
|
955
|
+
isTyping: ne.has(y),
|
|
1698
956
|
onTypingComplete: () => {
|
|
1699
|
-
|
|
1700
|
-
const
|
|
1701
|
-
return
|
|
1702
|
-
}), requestAnimationFrame(() =>
|
|
957
|
+
N((k) => {
|
|
958
|
+
const _ = new Set(k);
|
|
959
|
+
return _.delete(y), _;
|
|
960
|
+
}), requestAnimationFrame(() => F("auto"));
|
|
1703
961
|
}
|
|
1704
962
|
},
|
|
1705
|
-
|
|
963
|
+
y
|
|
1706
964
|
)),
|
|
1707
|
-
|
|
965
|
+
q && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-validation-message", children: [
|
|
1708
966
|
/* @__PURE__ */ e.jsx("span", { className: "error-icon", children: "⚠️" }),
|
|
1709
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
967
|
+
/* @__PURE__ */ e.jsx("span", { children: q })
|
|
1710
968
|
] }),
|
|
1711
|
-
|
|
969
|
+
le && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-contact-cta", children: /* @__PURE__ */ e.jsxs(
|
|
1712
970
|
"a",
|
|
1713
971
|
{
|
|
1714
|
-
href:
|
|
972
|
+
href: ue,
|
|
1715
973
|
target: "_blank",
|
|
1716
974
|
rel: "noopener noreferrer",
|
|
1717
975
|
className: "sw-ttyw-cta-button",
|
|
@@ -1721,7 +979,7 @@ function pt({ title: t = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1721
979
|
]
|
|
1722
980
|
}
|
|
1723
981
|
) }),
|
|
1724
|
-
|
|
982
|
+
$ && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-limit-exceeded", children: [
|
|
1725
983
|
/* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-limit-exceeded-message", children: "Chat history limit reached. Please download your conversation as PDF and clear chat history to continue." }),
|
|
1726
984
|
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-limit-action-buttons", children: [
|
|
1727
985
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -1729,8 +987,8 @@ function pt({ title: t = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1729
987
|
{
|
|
1730
988
|
type: "button",
|
|
1731
989
|
className: "sw-ttyw-limit-download-pdf",
|
|
1732
|
-
onClick:
|
|
1733
|
-
disabled:
|
|
990
|
+
onClick: Ee,
|
|
991
|
+
disabled: u,
|
|
1734
992
|
children: [
|
|
1735
993
|
/* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1736
994
|
/* @__PURE__ */ e.jsx("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -1746,7 +1004,7 @@ function pt({ title: t = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1746
1004
|
{
|
|
1747
1005
|
type: "button",
|
|
1748
1006
|
className: "sw-ttyw-limit-clear-history",
|
|
1749
|
-
onClick: () =>
|
|
1007
|
+
onClick: () => v(!0),
|
|
1750
1008
|
children: [
|
|
1751
1009
|
/* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1752
1010
|
/* @__PURE__ */ e.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -1760,58 +1018,58 @@ function pt({ title: t = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1760
1018
|
)
|
|
1761
1019
|
] })
|
|
1762
1020
|
] }),
|
|
1763
|
-
|
|
1764
|
-
/* @__PURE__ */ e.jsx("div", { className: "message-avatar",
|
|
1765
|
-
/* @__PURE__ */ e.jsxs("div", { className: "message-content",
|
|
1021
|
+
u && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-message other message-loading", children: [
|
|
1022
|
+
/* @__PURE__ */ e.jsx("div", { className: "message-avatar", children: /* @__PURE__ */ e.jsx(Ie, { width: 20, height: 20 }) }),
|
|
1023
|
+
/* @__PURE__ */ e.jsxs("div", { className: "message-content", children: [
|
|
1766
1024
|
/* @__PURE__ */ e.jsx("div", { className: "typing typing-1" }),
|
|
1767
1025
|
/* @__PURE__ */ e.jsx("div", { className: "typing typing-2" }),
|
|
1768
1026
|
/* @__PURE__ */ e.jsx("div", { className: "typing typing-3" })
|
|
1769
1027
|
] })
|
|
1770
1028
|
] }),
|
|
1771
|
-
!
|
|
1029
|
+
!L && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-jump-latest", children: /* @__PURE__ */ e.jsx(
|
|
1772
1030
|
"button",
|
|
1773
1031
|
{
|
|
1774
1032
|
type: "button",
|
|
1775
1033
|
className: "sw-ttyw-jump-button",
|
|
1776
1034
|
onClick: () => {
|
|
1777
|
-
|
|
1035
|
+
F("smooth"), I(!0);
|
|
1778
1036
|
},
|
|
1779
1037
|
children: "Jump to latest"
|
|
1780
1038
|
}
|
|
1781
1039
|
) }),
|
|
1782
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
1040
|
+
/* @__PURE__ */ e.jsx("div", { ref: G })
|
|
1783
1041
|
]
|
|
1784
1042
|
}
|
|
1785
1043
|
),
|
|
1786
|
-
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-section",
|
|
1044
|
+
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-section", children: [
|
|
1787
1045
|
/* @__PURE__ */ e.jsx(
|
|
1788
1046
|
"textarea",
|
|
1789
1047
|
{
|
|
1790
1048
|
className: "sw-ttyw-input",
|
|
1791
|
-
placeholder:
|
|
1792
|
-
value:
|
|
1793
|
-
onChange: (
|
|
1794
|
-
|
|
1049
|
+
placeholder: $ ? "Chat limit reached." : "Please ask question here",
|
|
1050
|
+
value: j,
|
|
1051
|
+
onChange: (o) => {
|
|
1052
|
+
f(o.target.value), q && D("");
|
|
1795
1053
|
},
|
|
1796
1054
|
maxLength: 1e3,
|
|
1797
|
-
disabled:
|
|
1798
|
-
|
|
1799
|
-
onKeyDown: (s) => s.key === "Enter" && !s.shiftKey && (s.preventDefault(), Ee())
|
|
1055
|
+
disabled: u || $,
|
|
1056
|
+
onKeyDown: (o) => o.key === "Enter" && !o.shiftKey && (o.preventDefault(), ve())
|
|
1800
1057
|
}
|
|
1801
1058
|
),
|
|
1802
|
-
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-content",
|
|
1803
|
-
/* @__PURE__ */ e.jsxs("small", { id: "sw-ttyw-chat-textbox-status",
|
|
1804
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1059
|
+
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-content sw-ttyw-input-footer", children: [
|
|
1060
|
+
/* @__PURE__ */ e.jsxs("small", { id: "sw-ttyw-chat-textbox-status", className: "sw-ttyw-character-count", children: [
|
|
1061
|
+
/* @__PURE__ */ e.jsx("span", { children: j.length }),
|
|
1805
1062
|
"/1000"
|
|
1806
1063
|
] }),
|
|
1807
1064
|
/* @__PURE__ */ e.jsx(
|
|
1808
1065
|
"button",
|
|
1809
1066
|
{
|
|
1067
|
+
type: "button",
|
|
1810
1068
|
id: "sw-ttyw-chat-send-message",
|
|
1811
|
-
|
|
1069
|
+
className: "sw-ttyw-send-button",
|
|
1070
|
+
onClick: ve,
|
|
1812
1071
|
"aria-label": "Send message",
|
|
1813
|
-
disabled:
|
|
1814
|
-
style: { ...y.sendButton, color: E },
|
|
1072
|
+
disabled: u || $,
|
|
1815
1073
|
children: /* @__PURE__ */ e.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "currentColor", className: "cwv replaced-svg", children: [
|
|
1816
1074
|
/* @__PURE__ */ e.jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1817
1075
|
/* @__PURE__ */ e.jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
|
|
@@ -1821,61 +1079,43 @@ function pt({ title: t = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1821
1079
|
] })
|
|
1822
1080
|
] })
|
|
1823
1081
|
] }),
|
|
1824
|
-
w && /* @__PURE__ */ e.jsxs("div", { className: "swttyw-modal swttyw-modal-clear-history",
|
|
1082
|
+
w && /* @__PURE__ */ e.jsxs("div", { className: "swttyw-modal swttyw-modal-clear-history swttyw-modal-overlay", children: [
|
|
1825
1083
|
/* @__PURE__ */ e.jsx("div", { className: "swtty-modal-header" }),
|
|
1826
|
-
/* @__PURE__ */ e.jsxs("div", { className: "swtty-modal-body",
|
|
1084
|
+
/* @__PURE__ */ e.jsxs("div", { className: "swtty-modal-body", children: [
|
|
1827
1085
|
/* @__PURE__ */ e.jsx("div", { className: "swtty-content", children: "Are you sure you want to delete the chat history?" }),
|
|
1828
|
-
/* @__PURE__ */ e.jsxs("div", { className: "swtty-action",
|
|
1086
|
+
/* @__PURE__ */ e.jsxs("div", { className: "swtty-action swtty-modal-actions", children: [
|
|
1829
1087
|
/* @__PURE__ */ e.jsx(
|
|
1830
1088
|
"input",
|
|
1831
1089
|
{
|
|
1832
1090
|
type: "button",
|
|
1833
|
-
className: "swttyw-btn swttyw-btn-primary",
|
|
1091
|
+
className: "swttyw-btn swttyw-btn-primary swttyw-btn-modal-yes",
|
|
1834
1092
|
id: "swttyw-btn-clear-history-yes",
|
|
1835
|
-
onClick:
|
|
1836
|
-
value: "Yes"
|
|
1837
|
-
style: {
|
|
1838
|
-
background: "var(--swttyw-primary-color)",
|
|
1839
|
-
color: "white",
|
|
1840
|
-
border: "none",
|
|
1841
|
-
padding: "10px 20px",
|
|
1842
|
-
cursor: "pointer",
|
|
1843
|
-
borderRadius: "8px",
|
|
1844
|
-
margin: "10px 5px"
|
|
1845
|
-
}
|
|
1093
|
+
onClick: Ae,
|
|
1094
|
+
value: "Yes"
|
|
1846
1095
|
}
|
|
1847
1096
|
),
|
|
1848
1097
|
/* @__PURE__ */ e.jsx(
|
|
1849
1098
|
"input",
|
|
1850
1099
|
{
|
|
1851
1100
|
type: "button",
|
|
1852
|
-
className: "swttyw-btn swttyw-btn-primary-inverse",
|
|
1101
|
+
className: "swttyw-btn swttyw-btn-primary-inverse swttyw-btn-modal-no",
|
|
1853
1102
|
id: "swttyw-btn-clear-history-no",
|
|
1854
|
-
onClick: () =>
|
|
1855
|
-
value: "No"
|
|
1856
|
-
style: {
|
|
1857
|
-
background: "transparent",
|
|
1858
|
-
color: "var(--swttyw-primary-color)",
|
|
1859
|
-
border: "1px solid var(--swttyw-primary-color)",
|
|
1860
|
-
padding: "10px 20px",
|
|
1861
|
-
cursor: "pointer",
|
|
1862
|
-
borderRadius: "8px",
|
|
1863
|
-
margin: "10px 5px"
|
|
1864
|
-
}
|
|
1103
|
+
onClick: () => v(!1),
|
|
1104
|
+
value: "No"
|
|
1865
1105
|
}
|
|
1866
1106
|
)
|
|
1867
1107
|
] })
|
|
1868
1108
|
] }),
|
|
1869
1109
|
/* @__PURE__ */ e.jsx("div", { className: "swtty-modal-footer" })
|
|
1870
1110
|
] }),
|
|
1871
|
-
!
|
|
1111
|
+
!S && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-footer", children: [
|
|
1872
1112
|
"Powered by ",
|
|
1873
|
-
/* @__PURE__ */ e.jsx("a", { href: "https://superwise.ai/", className: "ml-1", target: "_new", rel: "noopener noreferrer",
|
|
1113
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://superwise.ai/", className: "ml-1", target: "_new", rel: "noopener noreferrer", "aria-label": "SUPERWISE®", children: /* @__PURE__ */ e.jsx(s2, { height: 20 }) })
|
|
1874
1114
|
] })
|
|
1875
1115
|
]
|
|
1876
1116
|
}
|
|
1877
1117
|
) });
|
|
1878
1118
|
}
|
|
1879
1119
|
export {
|
|
1880
|
-
|
|
1120
|
+
h2 as Chatbot
|
|
1881
1121
|
};
|