@superwise.ai/superwise-chatbot-package 1.0.10 → 1.0.12
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 -1
- package/dist/react-chatbot.es.js +667 -614
- package/dist/react-chatbot.umd.js +11 -11
- package/package.json +1 -1
package/dist/react-chatbot.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var ye = { exports: {} },
|
|
1
|
+
import qe, { memo as Ie, useState as L, useRef as $, useEffect as M, useMemo as fe, useCallback as G } from "react";
|
|
2
|
+
var ye = { exports: {} }, ne = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var ye = { exports: {} }, ee = {};
|
|
|
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
|
|
17
|
-
function a(i,
|
|
12
|
+
var _e;
|
|
13
|
+
function ze() {
|
|
14
|
+
if (_e) return ne;
|
|
15
|
+
_e = 1;
|
|
16
|
+
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
17
|
+
function a(i, s, d) {
|
|
18
18
|
var g = null;
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
19
|
+
if (d !== void 0 && (g = "" + d), s.key !== void 0 && (g = "" + s.key), "key" in s) {
|
|
20
|
+
d = {};
|
|
21
|
+
for (var m in s)
|
|
22
|
+
m !== "key" && (d[m] = s[m]);
|
|
23
|
+
} else d = s;
|
|
24
|
+
return s = d.ref, {
|
|
25
|
+
$$typeof: e,
|
|
26
26
|
type: i,
|
|
27
27
|
key: g,
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
28
|
+
ref: s !== void 0 ? s : null,
|
|
29
|
+
props: d
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return ne.Fragment = r, ne.jsx = a, ne.jsxs = a, ne;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var se = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,167 +41,167 @@ var te = {};
|
|
|
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
|
|
48
|
-
if (
|
|
49
|
-
if (typeof
|
|
50
|
-
return
|
|
51
|
-
if (typeof
|
|
52
|
-
switch (
|
|
53
|
-
case
|
|
44
|
+
var Re;
|
|
45
|
+
function Ge() {
|
|
46
|
+
return Re || (Re = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
+
function e(n) {
|
|
48
|
+
if (n == null) return null;
|
|
49
|
+
if (typeof n == "function")
|
|
50
|
+
return n.$$typeof === de ? null : n.displayName || n.name || null;
|
|
51
|
+
if (typeof n == "string") return n;
|
|
52
|
+
switch (n) {
|
|
53
|
+
case _:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case R:
|
|
56
|
-
return "Profiler";
|
|
57
55
|
case S:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case R:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case le:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case T:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case ue:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
|
-
if (typeof
|
|
67
|
-
switch (typeof
|
|
66
|
+
if (typeof n == "object")
|
|
67
|
+
switch (typeof n.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
|
+
), n.$$typeof) {
|
|
70
|
+
case y:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
73
|
-
return
|
|
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;
|
|
72
|
+
case ee:
|
|
73
|
+
return n.displayName || "Context";
|
|
79
74
|
case ae:
|
|
80
|
-
return
|
|
81
|
-
case
|
|
82
|
-
|
|
75
|
+
return (n._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case ie:
|
|
77
|
+
var h = n.render;
|
|
78
|
+
return n = n.displayName, n || (n = h.displayName || h.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
|
|
79
|
+
case ce:
|
|
80
|
+
return h = n.displayName || null, h !== null ? h : e(n.type) || "Memo";
|
|
81
|
+
case Y:
|
|
82
|
+
h = n._payload, n = n._init;
|
|
83
83
|
try {
|
|
84
|
-
return
|
|
84
|
+
return e(n(h));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
function r(
|
|
91
|
-
return "" +
|
|
90
|
+
function r(n) {
|
|
91
|
+
return "" + n;
|
|
92
92
|
}
|
|
93
|
-
function a(
|
|
93
|
+
function a(n) {
|
|
94
94
|
try {
|
|
95
|
-
r(
|
|
96
|
-
var
|
|
95
|
+
r(n);
|
|
96
|
+
var h = !1;
|
|
97
97
|
} catch {
|
|
98
|
-
|
|
98
|
+
h = !0;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var b =
|
|
100
|
+
if (h) {
|
|
101
|
+
h = console;
|
|
102
|
+
var b = h.error, E = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
103
103
|
return b.call(
|
|
104
|
-
|
|
104
|
+
h,
|
|
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
|
-
), r(
|
|
107
|
+
), r(n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function i(
|
|
111
|
-
if (
|
|
112
|
-
if (typeof
|
|
110
|
+
function i(n) {
|
|
111
|
+
if (n === _) return "<>";
|
|
112
|
+
if (typeof n == "object" && n !== null && n.$$typeof === Y)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
115
|
+
var h = e(n);
|
|
116
|
+
return h ? "<" + h + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var
|
|
123
|
-
return
|
|
121
|
+
function s() {
|
|
122
|
+
var n = J.A;
|
|
123
|
+
return n === null ? null : n.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function d() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function g(
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
128
|
+
function g(n) {
|
|
129
|
+
if (I.call(n, "key")) {
|
|
130
|
+
var h = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
131
|
+
if (h && h.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return n.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function m(n, h) {
|
|
136
136
|
function b() {
|
|
137
|
-
|
|
137
|
+
me || (me = !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
|
+
h
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
b.isReactWarning = !0, Object.defineProperty(
|
|
142
|
+
b.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
143
143
|
get: b,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
return
|
|
147
|
+
function u() {
|
|
148
|
+
var n = e(this.type);
|
|
149
|
+
return te[n] || (te[n] = !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
|
+
)), n = this.props.ref, n !== void 0 ? n : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return
|
|
156
|
-
$$typeof:
|
|
157
|
-
type:
|
|
158
|
-
key:
|
|
153
|
+
function C(n, h, b, E, q, K) {
|
|
154
|
+
var k = b.ref;
|
|
155
|
+
return n = {
|
|
156
|
+
$$typeof: f,
|
|
157
|
+
type: n,
|
|
158
|
+
key: h,
|
|
159
159
|
props: b,
|
|
160
160
|
_owner: E
|
|
161
|
-
}, (
|
|
161
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(n, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
|
-
get:
|
|
164
|
-
}) : Object.defineProperty(
|
|
163
|
+
get: u
|
|
164
|
+
}) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
writable: !0,
|
|
168
168
|
value: 0
|
|
169
|
-
}), Object.defineProperty(
|
|
169
|
+
}), Object.defineProperty(n, "_debugInfo", {
|
|
170
170
|
configurable: !1,
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
writable: !0,
|
|
173
173
|
value: null
|
|
174
|
-
}), Object.defineProperty(
|
|
174
|
+
}), Object.defineProperty(n, "_debugStack", {
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
179
|
-
}), Object.defineProperty(
|
|
178
|
+
value: q
|
|
179
|
+
}), Object.defineProperty(n, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.freeze && (Object.freeze(
|
|
183
|
+
value: K
|
|
184
|
+
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
186
|
+
function l(n, h, b, E, q, K) {
|
|
187
|
+
var k = h.children;
|
|
188
|
+
if (k !== void 0)
|
|
189
189
|
if (E)
|
|
190
|
-
if (
|
|
191
|
-
for (E = 0; E <
|
|
192
|
-
j(
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
190
|
+
if (V(k)) {
|
|
191
|
+
for (E = 0; E < k.length; E++)
|
|
192
|
+
j(k[E]);
|
|
193
|
+
Object.freeze && Object.freeze(k);
|
|
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 j(
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
198
|
+
else j(k);
|
|
199
|
+
if (I.call(h, "key")) {
|
|
200
|
+
k = e(n);
|
|
201
|
+
var O = Object.keys(h).filter(function(D) {
|
|
202
|
+
return D !== "key";
|
|
203
203
|
});
|
|
204
|
-
E = 0 <
|
|
204
|
+
E = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", re[k + E] || (O = 0 < O.length ? "{" + O.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,125 +209,157 @@ 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
|
+
k,
|
|
213
|
+
O,
|
|
214
|
+
k
|
|
215
|
+
), re[k + E] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
217
|
+
if (k = null, b !== void 0 && (a(b), k = "" + b), g(h) && (a(h.key), k = "" + h.key), "key" in h) {
|
|
218
218
|
b = {};
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else b =
|
|
222
|
-
return
|
|
219
|
+
for (var U in h)
|
|
220
|
+
U !== "key" && (b[U] = h[U]);
|
|
221
|
+
} else b = h;
|
|
222
|
+
return k && m(
|
|
223
223
|
b,
|
|
224
|
-
typeof
|
|
225
|
-
),
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
typeof n == "function" ? n.displayName || n.name || "Unknown" : n
|
|
225
|
+
), C(
|
|
226
|
+
n,
|
|
227
|
+
k,
|
|
228
228
|
b,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
s(),
|
|
230
|
+
q,
|
|
231
|
+
K
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function j(
|
|
235
|
-
|
|
234
|
+
function j(n) {
|
|
235
|
+
p(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === Y && (n._payload.status === "fulfilled" ? p(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof
|
|
237
|
+
function p(n) {
|
|
238
|
+
return typeof n == "object" && n !== null && n.$$typeof === f;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var c = qe, f = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), ae = Symbol.for("react.consumer"), ee = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), le = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), ce = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), ue = Symbol.for("react.activity"), de = Symbol.for("react.client.reference"), J = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = Object.prototype.hasOwnProperty, V = Array.isArray, X = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
244
|
-
react_stack_bottom_frame: function(
|
|
245
|
-
return
|
|
243
|
+
c = {
|
|
244
|
+
react_stack_bottom_frame: function(n) {
|
|
245
|
+
return n();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var E = 1e4 >
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
248
|
+
var me, te = {}, B = c.react_stack_bottom_frame.bind(
|
|
249
|
+
c,
|
|
250
|
+
d
|
|
251
|
+
)(), N = X(i(d)), re = {};
|
|
252
|
+
se.Fragment = _, se.jsx = function(n, h, b) {
|
|
253
|
+
var E = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return l(
|
|
255
|
+
n,
|
|
256
|
+
h,
|
|
257
257
|
b,
|
|
258
258
|
!1,
|
|
259
|
-
E ? Error("react-stack-top-frame") :
|
|
260
|
-
E ?
|
|
259
|
+
E ? Error("react-stack-top-frame") : B,
|
|
260
|
+
E ? X(i(n)) : N
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var E = 1e4 >
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
|
|
262
|
+
}, se.jsxs = function(n, h, b) {
|
|
263
|
+
var E = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return l(
|
|
265
|
+
n,
|
|
266
|
+
h,
|
|
267
267
|
b,
|
|
268
268
|
!0,
|
|
269
|
-
E ? Error("react-stack-top-frame") :
|
|
270
|
-
E ?
|
|
269
|
+
E ? Error("react-stack-top-frame") : B,
|
|
270
|
+
E ? X(i(n)) : N
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
|
-
}()),
|
|
273
|
+
}()), se;
|
|
274
274
|
}
|
|
275
|
-
process.env.NODE_ENV === "production" ? ye.exports =
|
|
276
|
-
var
|
|
277
|
-
const
|
|
275
|
+
process.env.NODE_ENV === "production" ? ye.exports = ze() : ye.exports = Ge();
|
|
276
|
+
var t = ye.exports;
|
|
277
|
+
const Ye = [
|
|
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
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
], oe = "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.", Je = "https://sage-api-ttyw-stage.superwise.ai/api/v1/", Xe = "hi";
|
|
284
|
+
function Pe(e = "") {
|
|
285
|
+
return typeof e == "string" && e.trim().length > 0 ? e.trim() : Je;
|
|
286
|
+
}
|
|
287
|
+
function $e(e = "") {
|
|
288
|
+
const r = Pe(e);
|
|
289
|
+
return r.replace(/\/+$/, "").endsWith("/chat") ? r : r.replace(/\/+$/, "") + "/chat";
|
|
290
|
+
}
|
|
291
|
+
function Ke(e) {
|
|
292
|
+
if (typeof e != "string" || e.length === 0) return e;
|
|
293
|
+
let r = e;
|
|
294
|
+
for (const a of Ye)
|
|
288
295
|
for (; ; ) {
|
|
289
296
|
const i = r.indexOf(a);
|
|
290
297
|
if (i === -1) break;
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
let
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
|
|
298
|
-
else if (
|
|
299
|
-
g =
|
|
298
|
+
const s = r.indexOf("{", i);
|
|
299
|
+
if (s === -1) break;
|
|
300
|
+
let d = 0, g = -1;
|
|
301
|
+
for (let C = s; C < r.length; C++) {
|
|
302
|
+
const l = r[C];
|
|
303
|
+
if (l === "{")
|
|
304
|
+
d++;
|
|
305
|
+
else if (l === "}" && (d--, d === 0)) {
|
|
306
|
+
g = C;
|
|
300
307
|
break;
|
|
301
308
|
}
|
|
302
309
|
}
|
|
303
310
|
if (g === -1) break;
|
|
304
|
-
const
|
|
305
|
-
r =
|
|
311
|
+
const m = r.slice(0, i).trim(), u = r.slice(g + 1).trim();
|
|
312
|
+
r = m + (u.length > 0 ? " " + u : "");
|
|
306
313
|
}
|
|
307
314
|
return r.includes("Parameters:") && (r = r.split("Parameters:")[0].trim()), r;
|
|
308
315
|
}
|
|
309
|
-
function
|
|
310
|
-
if (typeof
|
|
311
|
-
const r =
|
|
312
|
-
return r.startsWith("Message: ") ? r.slice(9).trim() : r.startsWith("Message : ") ? r.slice(11).trim() :
|
|
316
|
+
function Qe(e) {
|
|
317
|
+
if (typeof e != "string" || e.length === 0) return e;
|
|
318
|
+
const r = e.trim();
|
|
319
|
+
return r.startsWith("Message: ") ? r.slice(9).trim() : r.startsWith("Message : ") ? r.slice(11).trim() : e;
|
|
320
|
+
}
|
|
321
|
+
async function e2(e = "", r = "", a = "") {
|
|
322
|
+
const i = $e(a), s = {
|
|
323
|
+
user_input: Xe,
|
|
324
|
+
chat_history: [],
|
|
325
|
+
mql_df: [],
|
|
326
|
+
agent_id: e,
|
|
327
|
+
discovery_agent_id: r,
|
|
328
|
+
utm_source: "Web",
|
|
329
|
+
utm_medium: "chatbot",
|
|
330
|
+
metadata: { warmup: !0 }
|
|
331
|
+
};
|
|
332
|
+
try {
|
|
333
|
+
const d = await fetch(i, {
|
|
334
|
+
method: "POST",
|
|
335
|
+
headers: {
|
|
336
|
+
"Content-Type": "application/json",
|
|
337
|
+
Accept: "application/json"
|
|
338
|
+
},
|
|
339
|
+
body: JSON.stringify(s)
|
|
340
|
+
});
|
|
341
|
+
return d.ok ? !0 : (console.warn("Warmup request returned non-OK status:", d.status), !1);
|
|
342
|
+
} catch (d) {
|
|
343
|
+
return console.warn("Warmup request failed:", d), !1;
|
|
344
|
+
}
|
|
313
345
|
}
|
|
314
|
-
async function
|
|
315
|
-
var
|
|
316
|
-
const
|
|
317
|
-
role:
|
|
318
|
-
message:
|
|
346
|
+
async function t2(e, r = [], a = [], i = "", s = "", d = "", g = null) {
|
|
347
|
+
var l, j, p;
|
|
348
|
+
const m = $e(d), u = Array.isArray(r) ? r.map((c) => ({
|
|
349
|
+
role: c.role,
|
|
350
|
+
message: c.content != null ? c.content : ""
|
|
319
351
|
})) : [], C = {
|
|
320
|
-
user_input:
|
|
321
|
-
chat_history:
|
|
352
|
+
user_input: e,
|
|
353
|
+
chat_history: u,
|
|
322
354
|
mql_df: Array.isArray(a) ? a : [],
|
|
323
355
|
agent_id: i,
|
|
324
|
-
discovery_agent_id:
|
|
356
|
+
discovery_agent_id: s,
|
|
325
357
|
utm_source: "Web",
|
|
326
358
|
utm_medium: "chatbot"
|
|
327
359
|
};
|
|
328
360
|
console.log("Sending payload:", C);
|
|
329
361
|
try {
|
|
330
|
-
const
|
|
362
|
+
const c = await fetch(m, {
|
|
331
363
|
method: "POST",
|
|
332
364
|
headers: {
|
|
333
365
|
"Content-Type": "application/json",
|
|
@@ -336,271 +368,278 @@ async function ze(t, r = [], a = [], i = "", n = "", m = "", g = null) {
|
|
|
336
368
|
body: JSON.stringify(C),
|
|
337
369
|
signal: g ?? void 0
|
|
338
370
|
});
|
|
339
|
-
if (console.log("Response status:",
|
|
340
|
-
const
|
|
341
|
-
return console.error("API Error Response:",
|
|
371
|
+
if (console.log("Response status:", c.status), console.log("Response headers:", c.headers), !c.ok) {
|
|
372
|
+
const S = await c.text();
|
|
373
|
+
return console.error("API Error Response:", S), { reply: oe, mqlDf: [], isError: !0, status: c.status };
|
|
342
374
|
}
|
|
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
|
|
375
|
+
const f = await c.json();
|
|
376
|
+
console.log("API Response Data:", f);
|
|
377
|
+
let y = "⚠️ No reply from server.", _ = [], R = !1;
|
|
378
|
+
return f.chat_response ? y = f.chat_response : f.success && ((l = f.data) != null && l.chat_response) ? y = f.data.chat_response : f.message && (y = f.message), f.mql_df ? _ = f.mql_df : (j = f.data) != null && j.mql_df && (_ = f.data.mql_df), (f.chat_history_limit_exceeded === !0 || ((p = f.data) == null ? void 0 : p.chat_history_limit_exceeded) === !0) && (R = !0), y = Ke(y), y = Qe(y), { reply: y, mqlDf: _, chatHistoryLimitExceeded: R };
|
|
379
|
+
} catch (c) {
|
|
380
|
+
if (console.error("API call failed:", c), c.name === "AbortError")
|
|
381
|
+
throw c;
|
|
382
|
+
return c.name === "TypeError" && c.message.includes("fetch") ? { reply: oe, mqlDf: [], isError: !0 } : { reply: oe, mqlDf: [], isError: !0 };
|
|
351
383
|
}
|
|
352
384
|
}
|
|
353
|
-
async function
|
|
354
|
-
const g = (
|
|
385
|
+
async function r2(e, r = null, a = [], i = "") {
|
|
386
|
+
const g = Pe(i).replace(/\/+$/, "").replace(/\/chat\/?$/, "").replace(/\/+$/, "") + "/pdf", m = Array.isArray(e) && e.length > 0 ? e[0] : r || {
|
|
355
387
|
name: "User",
|
|
356
388
|
email: "user@example.com",
|
|
357
389
|
summary: "Chat conversation summary"
|
|
358
|
-
},
|
|
359
|
-
role:
|
|
360
|
-
message:
|
|
361
|
-
})) : [],
|
|
362
|
-
lead_row:
|
|
363
|
-
chat_history:
|
|
390
|
+
}, u = Array.isArray(a) ? a.map((l) => ({
|
|
391
|
+
role: l.role,
|
|
392
|
+
message: l.content != null ? l.content : ""
|
|
393
|
+
})) : [], C = {
|
|
394
|
+
lead_row: m,
|
|
395
|
+
chat_history: u
|
|
364
396
|
};
|
|
365
|
-
console.log("Downloading PDF with payload:",
|
|
397
|
+
console.log("Downloading PDF with payload:", C);
|
|
366
398
|
try {
|
|
367
|
-
const
|
|
399
|
+
const l = await fetch(g, {
|
|
368
400
|
method: "POST",
|
|
369
401
|
headers: {
|
|
370
402
|
"Content-Type": "application/json",
|
|
371
403
|
Accept: "application/pdf"
|
|
372
404
|
},
|
|
373
|
-
body: JSON.stringify(
|
|
405
|
+
body: JSON.stringify(C)
|
|
374
406
|
});
|
|
375
|
-
if (console.log("PDF Response status:",
|
|
376
|
-
const
|
|
377
|
-
throw console.error("PDF API Error Response:",
|
|
407
|
+
if (console.log("PDF Response status:", l.status), !l.ok) {
|
|
408
|
+
const f = await l.text();
|
|
409
|
+
throw console.error("PDF API Error Response:", f), new Error(`PDF API Error ${l.status}: ${f}`);
|
|
378
410
|
}
|
|
379
|
-
const j = await
|
|
380
|
-
return
|
|
381
|
-
} catch (
|
|
382
|
-
throw console.error("PDF download failed:",
|
|
411
|
+
const j = await l.blob(), p = window.URL.createObjectURL(j), c = document.createElement("a");
|
|
412
|
+
return c.href = p, c.download = `chatbot-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.pdf`, document.body.appendChild(c), c.click(), document.body.removeChild(c), window.URL.revokeObjectURL(p), !0;
|
|
413
|
+
} catch (l) {
|
|
414
|
+
throw console.error("PDF download failed:", l), l;
|
|
383
415
|
}
|
|
384
416
|
}
|
|
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
|
|
417
|
+
const n2 = "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", Me = "superwise-chatbot-package-css", s2 = "chatbot-plugin.css";
|
|
418
|
+
function o2() {
|
|
387
419
|
if (typeof document > "u") return "";
|
|
388
|
-
const
|
|
389
|
-
if (!(
|
|
420
|
+
const e = document.querySelector('script[src*="chatbot-plugin"]');
|
|
421
|
+
if (!(e != null && e.src)) return "";
|
|
390
422
|
try {
|
|
391
|
-
const r = new URL(
|
|
392
|
-
return r.pathname = a +
|
|
423
|
+
const r = new URL(e.src), a = r.pathname.replace(/\/[^/]*$/, "/");
|
|
424
|
+
return r.pathname = a + s2, r.search = "", r.hash = "", r.toString();
|
|
393
425
|
} catch {
|
|
394
426
|
return "";
|
|
395
427
|
}
|
|
396
428
|
}
|
|
397
|
-
function
|
|
398
|
-
if (typeof document > "u" || document.getElementById(
|
|
399
|
-
const
|
|
400
|
-
if (!
|
|
429
|
+
function a2() {
|
|
430
|
+
if (typeof document > "u" || document.getElementById(Me)) return;
|
|
431
|
+
const e = o2();
|
|
432
|
+
if (!e) return;
|
|
401
433
|
const r = document.createElement("link");
|
|
402
|
-
r.id =
|
|
434
|
+
r.id = Me, r.rel = "stylesheet", r.href = e, document.head.appendChild(r);
|
|
403
435
|
}
|
|
404
|
-
function
|
|
405
|
-
if (!
|
|
406
|
-
const r =
|
|
436
|
+
function xe(e) {
|
|
437
|
+
if (!e || typeof e != "string") return "";
|
|
438
|
+
const r = String(e).trim().replace(/^['"]+|['"]+$/g, "").trim().toLowerCase();
|
|
407
439
|
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
440
|
}
|
|
409
|
-
const
|
|
410
|
-
{ re: /^(#000000|#000)$/, class: "
|
|
411
|
-
{ re:
|
|
412
|
-
{ re: /^#
|
|
413
|
-
{ re: /^#
|
|
441
|
+
const i2 = [
|
|
442
|
+
{ re: /^(#000000|#000)$/, class: "default" },
|
|
443
|
+
{ re: /^(#ff0000|#f00)$/i, class: "red-bright" },
|
|
444
|
+
{ re: /^#2563eb$/i, class: "blue" },
|
|
445
|
+
{ re: /^#dc2626$/i, class: "red" },
|
|
446
|
+
{ re: /^#16a34a$/i, class: "green" }
|
|
414
447
|
];
|
|
415
|
-
function
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
448
|
+
function Te(e) {
|
|
449
|
+
const r = xe(e) || "#000";
|
|
450
|
+
for (const { re: a, class: i } of i2)
|
|
451
|
+
if (a.test(r)) return i;
|
|
452
|
+
return "default";
|
|
453
|
+
}
|
|
454
|
+
function l2(e) {
|
|
455
|
+
return "sw-ttyw-primary-" + Te(e);
|
|
456
|
+
}
|
|
457
|
+
function c2(e, r) {
|
|
458
|
+
const i = xe(e) || xe(r) || "#000";
|
|
459
|
+
return "sw-ttyw-minimized-" + Te(i);
|
|
421
460
|
}
|
|
422
|
-
let
|
|
423
|
-
function
|
|
424
|
-
const a =
|
|
425
|
-
a.current || (a.current = `clip0_avatar_${++
|
|
461
|
+
let u2 = 0;
|
|
462
|
+
function Ve({ width: e = 20, height: r = 20 }) {
|
|
463
|
+
const a = $(null);
|
|
464
|
+
a.current || (a.current = `clip0_avatar_${++u2}`);
|
|
426
465
|
const i = a.current;
|
|
427
|
-
return /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
466
|
+
return /* @__PURE__ */ t.jsxs("svg", { width: e, height: r, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
467
|
+
/* @__PURE__ */ t.jsxs("g", { clipPath: `url(#${i})`, children: [
|
|
468
|
+
/* @__PURE__ */ t.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" }),
|
|
469
|
+
/* @__PURE__ */ t.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" }),
|
|
470
|
+
/* @__PURE__ */ t.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" })
|
|
432
471
|
] }),
|
|
433
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("clipPath", { id: i, children: /* @__PURE__ */ t.jsx("rect", { width: "154.17", height: "173.268", fill: "white" }) }) })
|
|
434
473
|
] });
|
|
435
474
|
}
|
|
436
|
-
function
|
|
437
|
-
const a =
|
|
438
|
-
return /* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
475
|
+
function d2({ width: e, height: r = 20 }) {
|
|
476
|
+
const a = e ?? 4.6875 * r;
|
|
477
|
+
return /* @__PURE__ */ t.jsxs("svg", { width: a, height: r, viewBox: "0 0 75 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
478
|
+
/* @__PURE__ */ t.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" }),
|
|
479
|
+
/* @__PURE__ */ t.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" }),
|
|
480
|
+
/* @__PURE__ */ t.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" }),
|
|
481
|
+
/* @__PURE__ */ t.jsx("path", { d: "M18.3783 5.31638C18.4805 5.20553 18.6013 5.12239 18.7407 5.06696C18.8801 5.01153 19.0473 4.98382 19.2331 4.98382C19.419 4.98382 19.6698 5.02077 19.8557 5.10391C20.0415 5.18706 20.1902 5.30715 20.3109 5.45495C20.376 5.53809 20.441 5.63047 20.4875 5.74133C20.5432 5.85218 20.5804 5.96303 20.599 6.08313L21.9741 5.65819C21.8719 5.29791 21.7325 4.99306 21.556 4.7344C21.3795 4.47574 21.1657 4.25403 20.9149 4.07851C20.6919 3.92147 20.441 3.81061 20.153 3.73671C19.8742 3.6628 19.5676 3.62585 19.2517 3.62585C18.9358 3.62585 18.4712 3.68128 18.1461 3.80137C17.8301 3.92147 17.5514 4.09698 17.3284 4.32793C17.0961 4.54964 16.9289 4.81754 16.8174 5.13163C16.7059 5.44571 16.6501 5.80599 16.6501 6.20322C16.6501 6.60045 16.7152 7.01615 16.8545 7.321C16.9939 7.62585 17.1983 7.88451 17.4771 8.09699C17.7558 8.30946 18.1182 8.50345 18.5735 8.6605L19.3632 8.94687C19.6513 9.05772 19.8835 9.16858 20.0415 9.28867C20.1994 9.39953 20.3109 9.52886 20.376 9.66742C20.441 9.80599 20.4689 9.98151 20.4689 10.194C20.4689 10.4065 20.4503 10.5543 20.4039 10.6928C20.3667 10.8314 20.2924 10.9515 20.2087 11.0623C20.1158 11.1824 19.995 11.2656 19.8464 11.321C19.707 11.3764 19.5398 11.4041 19.3539 11.4041C19.1681 11.4041 18.9172 11.3672 18.7407 11.2841C18.5549 11.2009 18.4062 11.0808 18.2854 10.933C18.2111 10.8499 18.1461 10.7575 18.0996 10.6374C18.0438 10.5265 18.016 10.4065 17.9881 10.2864L16.5944 10.6744C16.6873 11.0346 16.8267 11.3487 17.0032 11.6259C17.189 11.903 17.4027 12.1247 17.6629 12.3095C17.8952 12.4573 18.1461 12.5681 18.4248 12.6513C18.7035 12.7344 19.0101 12.7714 19.3261 12.7714C19.642 12.7714 20.1158 12.7067 20.4317 12.5958C20.7569 12.4757 21.0357 12.3002 21.268 12.06C21.4817 11.8291 21.6489 11.552 21.7697 11.2286C21.8905 10.9053 21.9462 10.5358 21.9462 10.1108C21.9462 9.6859 21.8812 9.28867 21.7418 8.98382C21.6024 8.67897 21.398 8.42031 21.11 8.20784C20.822 7.99537 20.4503 7.80137 19.9765 7.62585L19.196 7.33948C18.9079 7.22862 18.685 7.11777 18.5363 7.00691C18.3783 6.88682 18.2761 6.76673 18.2204 6.62816C18.1646 6.4896 18.1368 6.33255 18.1368 6.14779C18.1368 5.96304 18.1553 5.80599 18.2018 5.66742C18.239 5.52885 18.304 5.418 18.3783 5.31638Z", fill: "white" }),
|
|
482
|
+
/* @__PURE__ */ t.jsx("path", { d: "M26.7684 10.1478C26.7684 10.4249 26.7313 10.6651 26.657 10.8499C26.5826 11.0346 26.4618 11.1732 26.2853 11.2748C26.1088 11.3764 25.8765 11.4226 25.5884 11.4226C25.3004 11.4226 25.0588 11.3764 24.8823 11.2748C24.7058 11.1732 24.585 11.0346 24.5106 10.8499C24.4363 10.6651 24.3991 10.4342 24.3991 10.1478V3.72748H22.9404V10.1016C22.9404 10.6282 23.0333 11.0901 23.2191 11.4873C23.405 11.8845 23.693 12.1986 24.0832 12.4296C24.4735 12.6605 24.9845 12.7714 25.5977 12.7714C26.211 12.7714 26.7034 12.6605 27.1029 12.4296C27.5025 12.1986 27.7905 11.8845 27.967 11.4781C28.1436 11.0716 28.2365 10.6189 28.2365 10.1016V3.72748H26.7777V10.1478H26.7684Z", fill: "white" }),
|
|
483
|
+
/* @__PURE__ */ t.jsx("path", { d: "M33.1888 4.04157C32.8171 3.8291 32.3433 3.72748 31.7765 3.72748H29.37V12.6513H30.8288V9.5381H31.7579C32.334 9.5381 32.8078 9.43648 33.1795 9.23325C33.5511 9.03002 33.8299 8.71593 34.0157 8.29099C34.2015 7.86605 34.2945 7.31177 34.2945 6.63741C34.2945 5.96304 34.2015 5.41801 34.0157 4.99307C33.8299 4.56813 33.5511 4.25404 33.1795 4.04157H33.1888ZM32.7056 7.57043C32.622 7.79214 32.5012 7.94919 32.3433 8.0508C32.1853 8.15242 31.9809 8.19861 31.7207 8.19861H30.8195V5.09469H31.7207C31.9809 5.09469 32.1853 5.14088 32.3433 5.24249C32.5012 5.34411 32.622 5.50115 32.7056 5.72286C32.7893 5.94457 32.8264 6.24942 32.8264 6.63741C32.8264 7.0254 32.7893 7.34873 32.7056 7.57043Z", fill: "white" }),
|
|
484
|
+
/* @__PURE__ */ t.jsx("path", { d: "M35.1214 12.6605H39.5255V11.3025H36.5801V8.78981H39.0331V7.44108H36.5801V5.09466H39.5255V3.73669H35.1214V12.6605Z", fill: "white" }),
|
|
485
|
+
/* @__PURE__ */ t.jsx("path", { d: "M44.3199 8.92842C44.6822 8.72519 44.9703 8.42034 45.1747 8.01387C45.3791 7.6074 45.4813 7.09932 45.4813 6.48962C45.4813 5.87992 45.3884 5.32565 45.2026 4.92842C45.0167 4.52195 44.738 4.22634 44.3849 4.03235C44.0226 3.83835 43.5766 3.74597 43.047 3.74597H40.4454V12.6698H41.9041V9.24251H42.9169L44.0411 12.6698H45.6207L44.3013 8.94689C44.3013 8.94689 44.3199 8.9469 44.3292 8.93766L44.3199 8.92842ZM41.8948 5.0947H42.9819C43.1956 5.0947 43.3722 5.13165 43.5301 5.21479C43.6788 5.29793 43.7996 5.4365 43.8832 5.63974C43.9668 5.83373 44.004 6.12011 44.004 6.48038C44.004 6.84066 43.9668 7.13627 43.8832 7.3395C43.7996 7.54274 43.6881 7.68131 43.5394 7.76445C43.3907 7.84759 43.2142 7.88454 43.0005 7.88454H41.9041V5.10394L41.8948 5.0947Z", fill: "white" }),
|
|
486
|
+
/* @__PURE__ */ t.jsx("path", { d: "M52.4219 10.4988L51.1583 3.73669H49.7553L48.501 10.4619L47.2095 3.73669H45.6485L47.7019 12.6605H49.2164L50.4615 6.68358L51.6972 12.6605H53.2117L55.2558 3.73669H53.7134L52.4219 10.4988Z", fill: "white" }),
|
|
487
|
+
/* @__PURE__ */ t.jsx("path", { d: "M57.3928 3.73669H55.9341V12.6605H57.3928V3.73669Z", fill: "white" }),
|
|
488
|
+
/* @__PURE__ */ t.jsx("path", { d: "M60.1988 5.31638C60.301 5.20553 60.4218 5.12239 60.5612 5.06696C60.7006 5.01153 60.8678 4.98382 61.0536 4.98382C61.2395 4.98382 61.4903 5.02077 61.6762 5.10391C61.862 5.18706 62.0107 5.30715 62.1314 5.45495C62.1965 5.53809 62.2615 5.63047 62.308 5.74133C62.3637 5.85218 62.4009 5.96303 62.4195 6.08313L63.7946 5.65819C63.6924 5.29791 63.553 4.99306 63.3765 4.7344C63.1999 4.47574 62.9862 4.25403 62.7354 4.07851C62.5124 3.92147 62.2615 3.81061 61.9735 3.73671C61.6947 3.6628 61.3881 3.62585 61.0722 3.62585C60.7563 3.62585 60.2917 3.68128 59.9665 3.80137C59.6506 3.92147 59.3719 4.09698 59.1489 4.32793C58.9166 4.54964 58.7494 4.81754 58.6379 5.13163C58.5264 5.44571 58.4706 5.80599 58.4706 6.20322C58.4706 6.60045 58.5357 7.01615 58.675 7.321C58.8144 7.62585 59.0188 7.88451 59.2976 8.09699C59.5763 8.30946 59.9387 8.50345 60.394 8.6605L61.1837 8.94687C61.4718 9.05772 61.704 9.16858 61.862 9.28867C62.0199 9.39953 62.1314 9.52886 62.1965 9.66742C62.2615 9.80599 62.2894 9.98151 62.2894 10.194C62.2894 10.4065 62.2708 10.5543 62.2244 10.6928C62.1872 10.8314 62.1129 10.9515 62.0292 11.0623C61.9363 11.1824 61.8155 11.2656 61.6669 11.321C61.5275 11.3764 61.3603 11.4041 61.1744 11.4041C60.9886 11.4041 60.7377 11.3672 60.5612 11.2841C60.3754 11.2009 60.2267 11.0808 60.1059 10.933C60.0316 10.8499 59.9665 10.7575 59.9201 10.6374C59.8643 10.5265 59.8272 10.4065 59.8086 10.2864L58.4149 10.6744C58.5078 11.0346 58.6472 11.3487 58.8237 11.6259C59.0095 11.903 59.2232 12.1247 59.4834 12.3095C59.7157 12.4573 59.9665 12.5681 60.2453 12.6513C60.524 12.7344 60.8306 12.7714 61.1466 12.7714C61.4625 12.7714 61.9363 12.7067 62.2522 12.5958C62.5774 12.4757 62.8562 12.3002 63.0885 12.06C63.3022 11.8291 63.4694 11.552 63.5902 11.2286C63.711 10.9053 63.7667 10.5358 63.7667 10.1108C63.7667 9.6859 63.7017 9.28867 63.5623 8.98382C63.4229 8.67897 63.2185 8.42031 62.9305 8.20784C62.6425 7.99537 62.2708 7.80137 61.797 7.62585L61.0165 7.33948C60.7284 7.22862 60.5054 7.11777 60.3568 7.00691C60.1988 6.88682 60.0966 6.76673 60.0409 6.62816C59.9851 6.4896 59.9573 6.33255 59.9573 6.14779C59.9573 5.96304 59.9758 5.80599 60.0223 5.66742C60.0595 5.52885 60.1245 5.418 60.1988 5.31638Z", fill: "white" }),
|
|
489
|
+
/* @__PURE__ */ t.jsx("path", { d: "M69.23 5.09466V3.73669H64.8167V12.6605H69.23V11.3025H66.2754V8.78981H68.7283V7.44108H66.2754V5.09466H69.23Z", fill: "white" }),
|
|
490
|
+
/* @__PURE__ */ t.jsx("path", { d: "M71.0883 4.09701V3.71826H72.7515V4.09701H72.1197V5.95383H71.7201V4.09701H71.0883Z", fill: "white" }),
|
|
491
|
+
/* @__PURE__ */ t.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" })
|
|
453
492
|
] });
|
|
454
493
|
}
|
|
455
|
-
function
|
|
456
|
-
return String(
|
|
494
|
+
function be(e) {
|
|
495
|
+
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
457
496
|
}
|
|
458
|
-
function we(
|
|
459
|
-
return !
|
|
497
|
+
function we(e) {
|
|
498
|
+
return !e.trim() || /^\s*([*\-]|\d+\.)\s+/.test(e) ? !1 : /^\s{2,}/.test(e) && /[=(){}\[\],:]/.test(e) || /["'][^"']*["']\s*[:=]/.test(e) && e.length > 10 ? !0 : /\[text\]|\[\/text\]|\]\[text\]/i.test(e) || /\?|!/.test(e) || e.includes("—") || e.includes("–") || /^\s*(Would|Can|May|Could|Should|I |You |We |Let's|Please|Sure|Yes|No)\b/i.test(e) || /\b(your|you|we|me)\b/i.test(e) || /^\s*[A-Z][^.(]*[.?]\s*$/.test(e) || /^\s*#/.test(e) || /^\s*[-*]\s+[A-Z]/.test(e) && !/\.\w+\s*\(|=/.test(e) || /^\s*\d+\.\s+[A-Z][^.(]*$/.test(e) ? !1 : !!(/^\s*[)\]}]\s*$/.test(e) || /^\s*\.{3}\s*$/.test(e) || /^\s*(GET|POST|PUT|PATCH|DELETE|HEAD)\s+\S+/i.test(e) || /^\s*(Authorization|Content-Type|Accept)\s*:/i.test(e) || /^\s*\{\s*$/.test(e) || /^\s*[\w.]+\s*=/.test(e) || /\.\w+\s*\(|\b(print|range|open|str|int|list|dict)\s*\(/.test(e) || /^\s*(def|class|import|from|return|if|else|elif|for|while|try|except|with|async)\b/.test(e) || /^\s{2,}/.test(e) && /[=(){}\[\],:]/.test(e) || /[,(]\s*$|:\s*$/.test(e) || /["'][^"']*["']\s*[:=]/.test(e) && e.length > 10 || /\b\w+\s*\([^)]*\)\s*$/.test(e) && /[=.]\w+\s*\(|import|from\s+\w+/.test(e));
|
|
460
499
|
}
|
|
461
|
-
function
|
|
462
|
-
const r = [], a =
|
|
500
|
+
function h2(e) {
|
|
501
|
+
const r = [], a = e.split(`
|
|
463
502
|
`), i = [];
|
|
464
|
-
let
|
|
465
|
-
for (;
|
|
466
|
-
const
|
|
467
|
-
if (!we(
|
|
468
|
-
i.push(
|
|
503
|
+
let s = 0;
|
|
504
|
+
for (; s < a.length; ) {
|
|
505
|
+
const d = a[s];
|
|
506
|
+
if (!we(d)) {
|
|
507
|
+
i.push(d), s++;
|
|
469
508
|
continue;
|
|
470
509
|
}
|
|
471
510
|
const g = [];
|
|
472
|
-
for (;
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
g.push(a[
|
|
511
|
+
for (; s < a.length; ) {
|
|
512
|
+
const m = we(a[s]), u = a[s].trim() === "", C = s + 1 < a.length && we(a[s + 1]);
|
|
513
|
+
if (m || u && g.length > 0 && C)
|
|
514
|
+
g.push(a[s]), s++;
|
|
476
515
|
else break;
|
|
477
516
|
}
|
|
478
517
|
if (g.length >= 2) {
|
|
479
|
-
const
|
|
480
|
-
`).trim(),
|
|
481
|
-
r.push({ placeholder: `\0CODE_RAW_${
|
|
518
|
+
const m = r.length, u = g.join(`
|
|
519
|
+
`).trim(), C = be(u);
|
|
520
|
+
r.push({ placeholder: `\0CODE_RAW_${m}\0`, html: `<pre class="sw-ttyw-code-block"><code>${C}</code></pre>` }), i.push(`\0CODE_RAW_${m}\0`);
|
|
482
521
|
} else g.length === 1 && i.push(g[0]);
|
|
483
522
|
}
|
|
484
523
|
return { html: i.join(`
|
|
485
524
|
`), codeBlocks: r };
|
|
486
525
|
}
|
|
487
|
-
function
|
|
488
|
-
return !
|
|
526
|
+
function We(e) {
|
|
527
|
+
return !e || !String(e).trim() ? "" : String(e).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>");
|
|
489
528
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
529
|
+
const Ae = /^\s*([*\-]|\d+\.)\s+(.*)$/;
|
|
530
|
+
function p2(e) {
|
|
492
531
|
const r = [];
|
|
493
|
-
for (const
|
|
494
|
-
const
|
|
495
|
-
if (!
|
|
496
|
-
const
|
|
497
|
-
r.push({ indent:
|
|
532
|
+
for (const u of e) {
|
|
533
|
+
const C = u.match(Ae);
|
|
534
|
+
if (!C) continue;
|
|
535
|
+
const l = u.match(/^(\s*)/)[1].length, j = C[1], p = C[2], c = /^\d+\.$/.test(j);
|
|
536
|
+
r.push({ indent: l, content: p, ordered: c });
|
|
498
537
|
}
|
|
499
538
|
if (r.length === 0) return "";
|
|
500
|
-
const a = 2, i = [],
|
|
501
|
-
let
|
|
502
|
-
for (let
|
|
503
|
-
const { indent:
|
|
539
|
+
const a = 2, i = [], s = [];
|
|
540
|
+
let d = !1, g = !1, m = !1;
|
|
541
|
+
for (let u = 0; u < r.length; u++) {
|
|
542
|
+
const { indent: C, content: l, ordered: j } = r[u], p = Math.floor(C / a), c = We(l);
|
|
504
543
|
if (j)
|
|
505
|
-
g && (
|
|
544
|
+
g && (m && i.push("</li>"), i.push("</ul></li>"), s.pop(), g = !1, m = !1), m && s.length > 0 && s[s.length - 1].type === "ol" && i.push("</li>"), (s.length === 0 || s[s.length - 1].type !== "ol") && (i.push("<ol>"), s.push({ type: "ol", indentLevel: p })), i.push("<li>", c), m = !0, d = !0;
|
|
506
545
|
else {
|
|
507
|
-
if (
|
|
508
|
-
i.push("<ul>"),
|
|
509
|
-
else if (g ||
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
for (;
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
i.push("<ul>"),
|
|
546
|
+
if (d && p <= (s.length > 0 ? s[s.length - 1].indentLevel : 0))
|
|
547
|
+
i.push("<ul>"), s.push({ type: "ul", indentLevel: p }), g = !0, m = !1;
|
|
548
|
+
else if (g || s.length > 0 && s[s.length - 1].type === "ul") {
|
|
549
|
+
m && i.push("</li>"), m = !0;
|
|
550
|
+
const f = s.length > 0 ? s[s.length - 1].indentLevel : -1;
|
|
551
|
+
for (; p > f && s.length > 0 && s[s.length - 1].type === "ul"; ) {
|
|
552
|
+
const y = s[s.length - 1];
|
|
553
|
+
if (p <= y.indentLevel) break;
|
|
554
|
+
i.push("<ul>"), s.push({ type: "ul", indentLevel: p });
|
|
516
555
|
}
|
|
517
556
|
} else
|
|
518
|
-
|
|
519
|
-
i.push("<li>",
|
|
557
|
+
s.length > 0 && i.push("</li>"), (s.length === 0 || s[s.length - 1].type !== "ul") && (i.push("<ul>"), s.push({ type: "ul", indentLevel: p })), m = !0;
|
|
558
|
+
i.push("<li>", c), d = !1;
|
|
520
559
|
}
|
|
521
560
|
}
|
|
522
|
-
for (
|
|
523
|
-
|
|
561
|
+
for (m && i.push("</li>"); s.length > 0; )
|
|
562
|
+
s.pop().type === "ul" ? (i.push("</ul>"), s.length > 0 && s[s.length - 1].type === "ol" && i.push("</li>")) : i.push("</ol>");
|
|
524
563
|
return i.join("");
|
|
525
564
|
}
|
|
526
|
-
function
|
|
527
|
-
if (!
|
|
528
|
-
let r = String(
|
|
565
|
+
function Ne(e) {
|
|
566
|
+
if (!e) return "";
|
|
567
|
+
let r = String(e);
|
|
529
568
|
const a = [];
|
|
530
|
-
r = r.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g, (
|
|
531
|
-
const
|
|
532
|
-
return a.push(`<pre class="sw-ttyw-code-block"><code class="${
|
|
533
|
-
}), r = r.replace(/\[code\]([\s\S]*?)\[\/code\]/gi, (
|
|
534
|
-
const
|
|
535
|
-
return a.push(`<pre class="sw-ttyw-code-block"><code>${
|
|
569
|
+
r = r.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g, (p, c, f) => {
|
|
570
|
+
const y = a.length, _ = be(f.trim());
|
|
571
|
+
return a.push(`<pre class="sw-ttyw-code-block"><code class="${c ? `language-${c}` : ""}">${_}</code></pre>`), `\0CODE_FENCED_${y}\0`;
|
|
572
|
+
}), r = r.replace(/\[code\]([\s\S]*?)\[\/code\]/gi, (p, c) => {
|
|
573
|
+
const f = a.length, y = be(c.trim());
|
|
574
|
+
return a.push(`<pre class="sw-ttyw-code-block"><code>${y}</code></pre>`), `\0CODE_FENCED_${f}\0`;
|
|
536
575
|
});
|
|
537
|
-
const { html: i, codeBlocks:
|
|
576
|
+
const { html: i, codeBlocks: s } = h2(r);
|
|
538
577
|
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
|
|
578
|
+
const d = r.split(`
|
|
540
579
|
`), g = [];
|
|
541
|
-
let
|
|
542
|
-
function c() {
|
|
543
|
-
l.length && (g.push({ type: "list", lines: l }), l = []);
|
|
544
|
-
}
|
|
580
|
+
let m = [], u = [];
|
|
545
581
|
function C() {
|
|
546
|
-
|
|
582
|
+
m.length && (g.push({ type: "list", lines: m }), m = []);
|
|
583
|
+
}
|
|
584
|
+
function l() {
|
|
585
|
+
u.length && (g.push({ type: "content", lines: u }), u = []);
|
|
547
586
|
}
|
|
548
|
-
for (let
|
|
549
|
-
const
|
|
550
|
-
|
|
587
|
+
for (let p = 0; p < d.length; p++) {
|
|
588
|
+
const c = d[p];
|
|
589
|
+
Ae.test(c) ? (l(), m.push(c)) : (C(), u.push(c));
|
|
551
590
|
}
|
|
552
|
-
return
|
|
553
|
-
`))).join(""), a.forEach((
|
|
554
|
-
r = r.replace(`\0CODE_FENCED_${
|
|
555
|
-
}),
|
|
556
|
-
r = r.replace(
|
|
591
|
+
return C(), l(), r = g.map((p) => p.type === "list" ? p2(p.lines) : We(p.lines.join(`
|
|
592
|
+
`))).join(""), a.forEach((p, c) => {
|
|
593
|
+
r = r.replace(`\0CODE_FENCED_${c}\0`, p);
|
|
594
|
+
}), s.forEach(({ placeholder: p, html: c }) => {
|
|
595
|
+
r = r.replace(p, c);
|
|
557
596
|
}), r = r.replace(/(<br\s*\/?>)\s*$/i, ""), r;
|
|
558
597
|
}
|
|
559
|
-
const
|
|
560
|
-
const [
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}, [i]),
|
|
598
|
+
const f2 = 30, m2 = 300, C2 = Ie(function({ text: r, speed: a = 20, onComplete: i }) {
|
|
599
|
+
const [s, d] = L(""), [g, m] = L(!1), u = $(i);
|
|
600
|
+
M(() => {
|
|
601
|
+
u.current = i;
|
|
602
|
+
}, [i]), M(() => {
|
|
564
603
|
if (!r) return;
|
|
565
|
-
|
|
566
|
-
const
|
|
567
|
-
let
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
},
|
|
571
|
-
typeof document < "u" &&
|
|
604
|
+
d(""), m(!1);
|
|
605
|
+
const l = r.trim().split(/\s+/), j = Math.min(f2, l.length), p = l.slice(0, j).join(" "), c = Math.min(p.length, m2, r.length);
|
|
606
|
+
let f = 0, y = null, _ = !1;
|
|
607
|
+
const R = () => {
|
|
608
|
+
_ || (_ = !0, y && clearInterval(y), y = null, d(r), m(!0), u.current && u.current());
|
|
609
|
+
}, S = () => {
|
|
610
|
+
typeof document < "u" && R();
|
|
572
611
|
};
|
|
573
|
-
return typeof document < "u" && document.addEventListener("visibilitychange",
|
|
574
|
-
|
|
612
|
+
return typeof document < "u" && document.addEventListener("visibilitychange", S), y = setInterval(() => {
|
|
613
|
+
f < c ? (d(r.slice(0, f + 1)), f++) : R();
|
|
575
614
|
}, a), () => {
|
|
576
|
-
|
|
615
|
+
y && clearInterval(y), typeof document < "u" && document.removeEventListener("visibilitychange", S);
|
|
577
616
|
};
|
|
578
617
|
}, [r, a]);
|
|
579
|
-
const
|
|
618
|
+
const C = (l) => l.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, `
|
|
580
619
|
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1");
|
|
581
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ t.jsx(
|
|
582
621
|
"div",
|
|
583
622
|
{
|
|
584
623
|
className: "sw-ttyw-markdown-pre-wrap",
|
|
585
624
|
dangerouslySetInnerHTML: {
|
|
586
|
-
__html: g ?
|
|
625
|
+
__html: g ? Ne(s) : C(s) + '<span class="typing-cursor">|</span>'
|
|
587
626
|
}
|
|
588
627
|
}
|
|
589
628
|
);
|
|
590
|
-
}),
|
|
591
|
-
const
|
|
592
|
-
return /* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
] }) : /* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
629
|
+
}), g2 = Ie(function({ msg: r, isTyping: a = !1, onTypingComplete: i }) {
|
|
630
|
+
const s = r.from === "human" ? "sw-ttyw-message self" : "sw-ttyw-message other";
|
|
631
|
+
return /* @__PURE__ */ t.jsxs("div", { className: s, children: [
|
|
632
|
+
/* @__PURE__ */ t.jsx("div", { className: "message-avatar", children: r.from === "human" ? /* @__PURE__ */ t.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
633
|
+
/* @__PURE__ */ t.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" }),
|
|
634
|
+
/* @__PURE__ */ t.jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
635
|
+
] }) : /* @__PURE__ */ t.jsx(Ve, { width: 20, height: 20 }) }),
|
|
636
|
+
/* @__PURE__ */ t.jsx("div", { className: "message-content sw-ttyw-markdown", children: r.from === "ai" && a ? /* @__PURE__ */ t.jsx(C2, { text: r.text, speed: 20, onComplete: i }) : r.from === "ai" ? /* @__PURE__ */ t.jsx(
|
|
598
637
|
"div",
|
|
599
638
|
{
|
|
600
639
|
className: "sw-ttyw-markdown-pre-wrap",
|
|
601
|
-
dangerouslySetInnerHTML: { __html:
|
|
640
|
+
dangerouslySetInnerHTML: { __html: Ne(r.text) }
|
|
602
641
|
}
|
|
603
|
-
) : /* @__PURE__ */
|
|
642
|
+
) : /* @__PURE__ */ t.jsx(
|
|
604
643
|
"div",
|
|
605
644
|
{
|
|
606
645
|
className: "sw-ttyw-markdown-pre-wrap",
|
|
@@ -611,51 +650,51 @@ const a2 = 30, i2 = 300, l2 = Me(function({ text: r, speed: a = 20, onComplete:
|
|
|
611
650
|
}
|
|
612
651
|
) })
|
|
613
652
|
] });
|
|
614
|
-
}),
|
|
653
|
+
}), w2 = (e = "") => {
|
|
615
654
|
const r = (/* @__PURE__ */ new Date()).getHours();
|
|
616
655
|
let a = [];
|
|
617
|
-
return r >= 5 && r < 12 ?
|
|
618
|
-
`🌅 Good morning ${
|
|
619
|
-
`☀️ Morning ${
|
|
620
|
-
`🌞 Good morning ${
|
|
621
|
-
`👋 Rise and shine ${
|
|
622
|
-
`👋 Morning ${
|
|
656
|
+
return r >= 5 && r < 12 ? e ? a = [
|
|
657
|
+
`🌅 Good morning ${e}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,
|
|
658
|
+
`☀️ Morning ${e}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,
|
|
659
|
+
`🌞 Good morning ${e}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,
|
|
660
|
+
`👋 Rise and shine ${e}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,
|
|
661
|
+
`👋 Morning ${e}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`
|
|
623
662
|
] : a = [
|
|
624
663
|
"🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?",
|
|
625
664
|
"☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?",
|
|
626
665
|
"🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?",
|
|
627
666
|
"👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.",
|
|
628
667
|
"👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"
|
|
629
|
-
] : r >= 12 && r < 17 ?
|
|
630
|
-
`🌞 Good afternoon ${
|
|
631
|
-
`☀️ Afternoon ${
|
|
632
|
-
`👋 Good afternoon ${
|
|
633
|
-
`🌅 Hey there ${
|
|
634
|
-
`🌅 Afternoon ${
|
|
668
|
+
] : r >= 12 && r < 17 ? e ? a = [
|
|
669
|
+
`🌞 Good afternoon ${e}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,
|
|
670
|
+
`☀️ Afternoon ${e}! I'm an expert on SUPERWISE. How may I help you today?`,
|
|
671
|
+
`👋 Good afternoon ${e}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,
|
|
672
|
+
`🌅 Hey there ${e}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,
|
|
673
|
+
`🌅 Afternoon ${e}! I'm an expert on SUPERWISE. How can I support your exploration today?`
|
|
635
674
|
] : a = [
|
|
636
675
|
"🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?",
|
|
637
676
|
"☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?",
|
|
638
677
|
"👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?",
|
|
639
678
|
"🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.",
|
|
640
679
|
"🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"
|
|
641
|
-
] : r >= 17 && r < 21 ?
|
|
642
|
-
`🌆 Good evening ${
|
|
643
|
-
`🌅 Evening ${
|
|
644
|
-
`👋 Good evening ${
|
|
645
|
-
`🌇 Hey there ${
|
|
646
|
-
`🌇 Evening ${
|
|
680
|
+
] : r >= 17 && r < 21 ? e ? a = [
|
|
681
|
+
`🌆 Good evening ${e}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,
|
|
682
|
+
`🌅 Evening ${e}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,
|
|
683
|
+
`👋 Good evening ${e}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,
|
|
684
|
+
`🌇 Hey there ${e}! SUPERWISE expert here. Want to dive into the platform together?`,
|
|
685
|
+
`🌇 Evening ${e}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`
|
|
647
686
|
] : a = [
|
|
648
687
|
"🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?",
|
|
649
688
|
"🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?",
|
|
650
689
|
"👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?",
|
|
651
690
|
"🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?",
|
|
652
691
|
"🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"
|
|
653
|
-
] :
|
|
654
|
-
`🌙 Good evening ${
|
|
655
|
-
`⭐ Evening ${
|
|
656
|
-
`👋 Good evening ${
|
|
657
|
-
`🌃 Hey there ${
|
|
658
|
-
`🌃 Evening ${
|
|
692
|
+
] : e ? a = [
|
|
693
|
+
`🌙 Good evening ${e}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,
|
|
694
|
+
`⭐ Evening ${e}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,
|
|
695
|
+
`👋 Good evening ${e}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,
|
|
696
|
+
`🌃 Hey there ${e}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,
|
|
697
|
+
`🌃 Evening ${e}! SUPERWISE expert here. How can I help simplify or explain things for you today?`
|
|
659
698
|
] : a = [
|
|
660
699
|
"🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.",
|
|
661
700
|
"⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?",
|
|
@@ -664,11 +703,11 @@ const a2 = 30, i2 = 300, l2 = Me(function({ text: r, speed: a = 20, onComplete:
|
|
|
664
703
|
"🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"
|
|
665
704
|
], a[Math.floor(Math.random() * a.length)];
|
|
666
705
|
};
|
|
667
|
-
function
|
|
668
|
-
|
|
669
|
-
|
|
706
|
+
function x2({ title: e = "", agentId: r = "", discoveryAgentId: a = "", primaryColor: i = "", minimizedButtonColor: s = "", apiUrl: d = "" }) {
|
|
707
|
+
M(() => {
|
|
708
|
+
a2();
|
|
670
709
|
}, []);
|
|
671
|
-
const g =
|
|
710
|
+
const g = fe(() => l2(i), [i]), m = fe(() => c2(s, i), [s, i]), [u, C] = L(() => {
|
|
672
711
|
try {
|
|
673
712
|
if (typeof window < "u" && window.localStorage) {
|
|
674
713
|
const o = window.localStorage.getItem("chatbot-messages");
|
|
@@ -677,7 +716,7 @@ function h2({ title: t = "", agentId: r = "", discoveryAgentId: a = "", primaryC
|
|
|
677
716
|
} catch {
|
|
678
717
|
}
|
|
679
718
|
return [];
|
|
680
|
-
}), [
|
|
719
|
+
}), [l, j] = L(() => {
|
|
681
720
|
try {
|
|
682
721
|
if (typeof window < "u" && window.localStorage) {
|
|
683
722
|
const o = window.localStorage.getItem("chatbot-mql_df");
|
|
@@ -686,331 +725,345 @@ function h2({ title: t = "", agentId: r = "", discoveryAgentId: a = "", primaryC
|
|
|
686
725
|
} catch {
|
|
687
726
|
}
|
|
688
727
|
return [];
|
|
689
|
-
}), [
|
|
690
|
-
if (!
|
|
691
|
-
const o =
|
|
728
|
+
}), [p, c] = L(""), [f, y] = L(!1), [_, R] = L(!1), [S, ae] = L(!0), [ee, ie] = L(!1), [le, T] = L(/* @__PURE__ */ new Set()), [ce, Y] = L(!1), [ue, de] = L(!1), [J, I] = L(!1), [V, X] = L(!1), [me, te] = L(""), [B, N] = L(""), re = 12e4, n = "https://superwise.ai/contact/", h = (o) => typeof o == "string" && o.includes("unable to respond at the moment") && o.includes("Contact Sales"), b = $(null), E = $(null), q = fe(() => {
|
|
729
|
+
if (!l || l.length === 0) return "";
|
|
730
|
+
const o = l.find((w) => w.name && w.email);
|
|
692
731
|
return o ? `${o.name} (${o.email})` : "";
|
|
693
|
-
}, [
|
|
694
|
-
|
|
695
|
-
}, []),
|
|
696
|
-
|
|
697
|
-
}, [
|
|
698
|
-
|
|
699
|
-
|
|
732
|
+
}, [l]), K = $(null), k = $(null), [O, U] = L(!0), D = $(!0), ke = $(u), P = G(() => {
|
|
733
|
+
b.current && (clearTimeout(b.current), b.current = null);
|
|
734
|
+
}, []), Ee = G((o) => {
|
|
735
|
+
P(), b.current = setTimeout(o, re);
|
|
736
|
+
}, [re, P]);
|
|
737
|
+
M(() => {
|
|
738
|
+
if (typeof window > "u" || !window.sessionStorage || !r && !a) return;
|
|
739
|
+
const o = `chatbot-warmup:${d || "default"}:${r}:${a}`;
|
|
740
|
+
try {
|
|
741
|
+
if (window.sessionStorage.getItem(o) === "1") return;
|
|
742
|
+
e2(r, a, d).then((w) => {
|
|
743
|
+
w && window.sessionStorage.setItem(o, "1");
|
|
744
|
+
}).catch(() => {
|
|
745
|
+
});
|
|
746
|
+
} catch {
|
|
747
|
+
}
|
|
748
|
+
}, [r, a, d]);
|
|
749
|
+
const Ce = fe(() => u.map((o) => ({ role: o.from, content: o.text })), [u]), he = (o) => {
|
|
750
|
+
N(o), setTimeout(() => {
|
|
751
|
+
N("");
|
|
700
752
|
}, 4e3);
|
|
701
|
-
},
|
|
702
|
-
const
|
|
703
|
-
return
|
|
704
|
-
}, F =
|
|
705
|
-
var
|
|
706
|
-
const
|
|
707
|
-
|
|
753
|
+
}, Oe = (o) => {
|
|
754
|
+
const w = o.length, v = o.trim();
|
|
755
|
+
return te(""), N(""), !v || w === 0 ? (he("Please enter a message before sending."), !1) : new RegExp(/(<([^>]+)>)/gi).test(v) ? (he("Please avoid using HTML tags or scripts in your message."), !1) : v.length < 2 ? (he("Please enter a meaningful question (at least 2 characters)."), !1) : v.length > 1e3 ? (he("Message is too long. Please keep it under 1000 characters."), !1) : (te(""), N(""), !0);
|
|
756
|
+
}, F = G((o = "auto") => {
|
|
757
|
+
var v;
|
|
758
|
+
const w = k.current;
|
|
759
|
+
w && (w.scrollTop = w.scrollHeight), (v = K.current) == null || v.scrollIntoView({ behavior: o }), D.current = !0, U(!0);
|
|
708
760
|
}, []);
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}, [
|
|
712
|
-
const o =
|
|
761
|
+
M(() => {
|
|
762
|
+
D.current && requestAnimationFrame(() => F("auto"));
|
|
763
|
+
}, [u, B, J, V, le, f, F]), M(() => {
|
|
764
|
+
const o = k.current;
|
|
713
765
|
if (!o || typeof ResizeObserver > "u") return;
|
|
714
|
-
const
|
|
715
|
-
|
|
766
|
+
const w = new ResizeObserver(() => {
|
|
767
|
+
D.current && F("auto");
|
|
716
768
|
});
|
|
717
|
-
return
|
|
769
|
+
return w.observe(o), () => w.disconnect();
|
|
718
770
|
}, [F]);
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
const o =
|
|
722
|
-
if (
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
|
|
771
|
+
const ge = $(null), ve = $(S);
|
|
772
|
+
M(() => {
|
|
773
|
+
const o = ve.current;
|
|
774
|
+
if (ve.current = S, o && !S) {
|
|
775
|
+
const w = ge.current;
|
|
776
|
+
w != null ? (ge.current = null, requestAnimationFrame(() => {
|
|
777
|
+
const v = k.current;
|
|
778
|
+
if (v) {
|
|
779
|
+
const H = v.scrollHeight - v.clientHeight;
|
|
780
|
+
v.scrollTop = Math.min(w, Math.max(0, H));
|
|
781
|
+
const pe = v.scrollHeight - v.scrollTop - v.clientHeight <= 40;
|
|
782
|
+
D.current = pe, U(pe);
|
|
731
783
|
}
|
|
732
784
|
})) : requestAnimationFrame(() => F("auto"));
|
|
733
785
|
}
|
|
734
786
|
}, [S, F]);
|
|
735
|
-
const
|
|
736
|
-
const o =
|
|
787
|
+
const Ue = G(() => {
|
|
788
|
+
const o = k.current;
|
|
737
789
|
if (!o) return;
|
|
738
|
-
const
|
|
739
|
-
|
|
790
|
+
const H = o.scrollHeight - o.scrollTop - o.clientHeight <= 40;
|
|
791
|
+
D.current !== H && (D.current = H, U(H));
|
|
740
792
|
}, []);
|
|
741
|
-
|
|
793
|
+
M(() => {
|
|
742
794
|
try {
|
|
743
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(
|
|
795
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(u));
|
|
744
796
|
} catch {
|
|
745
797
|
}
|
|
746
|
-
}, [
|
|
798
|
+
}, [u]), M(() => {
|
|
747
799
|
try {
|
|
748
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(
|
|
800
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(l));
|
|
749
801
|
} catch {
|
|
750
802
|
}
|
|
751
|
-
}, [
|
|
752
|
-
|
|
753
|
-
}, [
|
|
754
|
-
if (
|
|
755
|
-
const
|
|
756
|
-
|
|
803
|
+
}, [l]), M(() => {
|
|
804
|
+
ke.current = u;
|
|
805
|
+
}, [u]), M(() => {
|
|
806
|
+
if (u.length === 0 && !ce) {
|
|
807
|
+
const w = { from: "ai", text: w2(q) };
|
|
808
|
+
C([w]), Y(!0), T(/* @__PURE__ */ new Set([0]));
|
|
757
809
|
}
|
|
758
|
-
}, [
|
|
759
|
-
const
|
|
760
|
-
var
|
|
761
|
-
if (
|
|
762
|
-
const o =
|
|
763
|
-
if (!o || !
|
|
810
|
+
}, [u.length, ce, q]), M(() => () => P(), [P]);
|
|
811
|
+
const Se = G(async () => {
|
|
812
|
+
var He;
|
|
813
|
+
if (f || V) return;
|
|
814
|
+
const o = p.trim();
|
|
815
|
+
if (!o || !Oe(p))
|
|
764
816
|
return;
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
let
|
|
771
|
-
if (
|
|
772
|
-
const x =
|
|
773
|
-
x && x.text && x.text.trim() !== "" && (
|
|
817
|
+
I(!1), P(), (He = E.current) == null || He.abort();
|
|
818
|
+
const w = new AbortController();
|
|
819
|
+
E.current = w;
|
|
820
|
+
const v = w.signal, H = { from: "human", text: o }, W = ke.current, pe = [...W, H];
|
|
821
|
+
C(pe), c(""), y(!0);
|
|
822
|
+
let je = o;
|
|
823
|
+
if (l && l.length > 0 && !ue) {
|
|
824
|
+
const x = W.filter((z) => z.from === "ai").pop();
|
|
825
|
+
x && x.text && x.text.trim() !== "" && (je = o + "." + x.text, de(!0));
|
|
774
826
|
}
|
|
775
|
-
const
|
|
776
|
-
|
|
827
|
+
const Ze = [...Ce, { role: "human", content: o }];
|
|
828
|
+
Ee(() => {
|
|
777
829
|
var x;
|
|
778
|
-
|
|
830
|
+
I(!0), (x = E.current) == null || x.abort(), y(!1);
|
|
779
831
|
});
|
|
780
832
|
try {
|
|
781
|
-
const x = await
|
|
782
|
-
if (
|
|
833
|
+
const x = await t2(je, Ze, l, r, a, d, v);
|
|
834
|
+
if (P(), typeof x == "string") {
|
|
783
835
|
const z = { from: "ai", text: x };
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
return
|
|
787
|
-
}), (x.startsWith("⚠️") || x.startsWith("❌") ||
|
|
836
|
+
C((Z) => {
|
|
837
|
+
const A = [...Z, z];
|
|
838
|
+
return T((Q) => /* @__PURE__ */ new Set([...Q, A.length - 1])), A;
|
|
839
|
+
}), (x.startsWith("⚠️") || x.startsWith("❌") || h(x)) && I(!0);
|
|
788
840
|
} else {
|
|
789
841
|
if (x != null && x.isError) {
|
|
790
|
-
|
|
791
|
-
const Z = x.reply ||
|
|
792
|
-
|
|
793
|
-
const
|
|
794
|
-
return
|
|
842
|
+
I(!0);
|
|
843
|
+
const Z = x.reply || oe;
|
|
844
|
+
C((A) => {
|
|
845
|
+
const Q = [...A, { from: "ai", text: Z }];
|
|
846
|
+
return T((Be) => /* @__PURE__ */ new Set([...Be, Q.length - 1])), Q;
|
|
795
847
|
});
|
|
796
848
|
return;
|
|
797
849
|
}
|
|
798
850
|
const z = { from: "ai", text: x.reply };
|
|
799
|
-
|
|
800
|
-
const
|
|
801
|
-
return
|
|
802
|
-
}), x.mqlDf && Array.isArray(x.mqlDf) &&
|
|
851
|
+
C((Z) => {
|
|
852
|
+
const A = [...Z, z];
|
|
853
|
+
return T((Q) => /* @__PURE__ */ new Set([...Q, A.length - 1])), A;
|
|
854
|
+
}), x.mqlDf && Array.isArray(x.mqlDf) && j(x.mqlDf), x.reply && (x.reply.startsWith("⚠️") || x.reply.startsWith("❌") || h(x.reply)) && I(!0), x.chatHistoryLimitExceeded && X(!0);
|
|
803
855
|
}
|
|
804
856
|
} catch (x) {
|
|
805
|
-
if (
|
|
857
|
+
if (P(), x.name === "AbortError")
|
|
806
858
|
return;
|
|
807
|
-
|
|
859
|
+
I(!0), C((z) => {
|
|
808
860
|
const Z = [
|
|
809
861
|
...z,
|
|
810
862
|
{
|
|
811
863
|
from: "ai",
|
|
812
|
-
text:
|
|
864
|
+
text: oe
|
|
813
865
|
}
|
|
814
866
|
];
|
|
815
|
-
return
|
|
867
|
+
return T((A) => /* @__PURE__ */ new Set([...A, Z.length - 1])), Z;
|
|
816
868
|
});
|
|
817
869
|
} finally {
|
|
818
|
-
|
|
870
|
+
y(!1);
|
|
819
871
|
}
|
|
820
|
-
}, [
|
|
872
|
+
}, [p, r, a, l, ue, Ce, V, P, Ee]), De = G(() => {
|
|
821
873
|
var o;
|
|
822
|
-
|
|
874
|
+
P(), (o = E.current) == null || o.abort(), I(!1), X(!1), C([]), T(/* @__PURE__ */ new Set()), Y(!1), de(!1);
|
|
823
875
|
try {
|
|
824
876
|
typeof window < "u" && window.localStorage && window.localStorage.removeItem("chatbot-messages");
|
|
825
877
|
} catch {
|
|
826
878
|
}
|
|
827
|
-
|
|
828
|
-
}, [
|
|
829
|
-
var o,
|
|
830
|
-
if (!
|
|
879
|
+
R(!1);
|
|
880
|
+
}, [P]), Le = G(async () => {
|
|
881
|
+
var o, w, v;
|
|
882
|
+
if (!l || l.length === 0) {
|
|
831
883
|
console.warn("No mql_df data available for PDF download");
|
|
832
884
|
return;
|
|
833
885
|
}
|
|
834
886
|
try {
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
name: ((o =
|
|
838
|
-
email: ((
|
|
839
|
-
summary: `Chat conversation with ${
|
|
887
|
+
y(!0), console.log("mql_df data for lead extraction:", l);
|
|
888
|
+
const H = {
|
|
889
|
+
name: ((o = l.find((W) => W.name)) == null ? void 0 : o.name) || "Chat User",
|
|
890
|
+
email: ((w = l.find((W) => W.email)) == null ? void 0 : w.email) || "user@example.com",
|
|
891
|
+
summary: `Chat conversation with ${u.length} messages. User asked: "${((v = u.find((W) => W.from === "human")) == null ? void 0 : v.text) || "No user messages"}"`
|
|
840
892
|
};
|
|
841
|
-
console.log("Extracted lead row:",
|
|
842
|
-
} catch (
|
|
843
|
-
console.error("Failed to download PDF:",
|
|
893
|
+
console.log("Extracted lead row:", H), await r2(l, H, Ce, d), console.log("PDF downloaded successfully");
|
|
894
|
+
} catch (H) {
|
|
895
|
+
console.error("Failed to download PDF:", H);
|
|
844
896
|
} finally {
|
|
845
|
-
|
|
897
|
+
y(!1);
|
|
846
898
|
}
|
|
847
|
-
}, [
|
|
899
|
+
}, [l, u]), Fe = [
|
|
848
900
|
"sw-ttyw-chatbot",
|
|
849
901
|
g,
|
|
850
|
-
|
|
902
|
+
m,
|
|
903
|
+
S ? "sw-ttyw-container-minimized" : ee ? "sw-ttyw-container-expanded" : "sw-ttyw-container"
|
|
851
904
|
].filter(Boolean).join(" ");
|
|
852
|
-
return /* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
|
|
853
906
|
"div",
|
|
854
907
|
{
|
|
855
|
-
className:
|
|
856
|
-
onClick: S ? () =>
|
|
908
|
+
className: Fe,
|
|
909
|
+
onClick: S ? () => ae(!1) : void 0,
|
|
857
910
|
children: [
|
|
858
|
-
S ? /* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
] }) }) : /* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
911
|
+
S ? /* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-minimized-content", children: /* @__PURE__ */ t.jsxs("svg", { className: "sw-ttyw-chat-icon", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
912
|
+
/* @__PURE__ */ t.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" }),
|
|
913
|
+
/* @__PURE__ */ t.jsx("path", { d: "M8 9H16", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
914
|
+
/* @__PURE__ */ t.jsx("path", { d: "M8 13H12", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
915
|
+
] }) }) : /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-header", children: [
|
|
916
|
+
/* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-name", children: e }),
|
|
917
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-header-actions", children: [
|
|
918
|
+
/* @__PURE__ */ t.jsx(
|
|
866
919
|
"button",
|
|
867
920
|
{
|
|
868
921
|
type: "button",
|
|
869
|
-
onClick: () =>
|
|
922
|
+
onClick: () => ie((o) => !o),
|
|
870
923
|
className: "sw-ttyw-header-button",
|
|
871
|
-
title:
|
|
872
|
-
children:
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
-
] }) : /* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
924
|
+
title: ee ? "Shrink chat" : "Expand chat",
|
|
925
|
+
children: ee ? /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
926
|
+
/* @__PURE__ */ t.jsx("path", { d: "M9 4V9H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
927
|
+
/* @__PURE__ */ t.jsx("path", { d: "M15 4V9H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
928
|
+
/* @__PURE__ */ t.jsx("path", { d: "M9 20V15H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
929
|
+
/* @__PURE__ */ t.jsx("path", { d: "M15 20V15H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
930
|
+
] }) : /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
931
|
+
/* @__PURE__ */ t.jsx("path", { d: "M4 9V4H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
932
|
+
/* @__PURE__ */ t.jsx("path", { d: "M20 9V4H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
933
|
+
/* @__PURE__ */ t.jsx("path", { d: "M4 15V20H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
934
|
+
/* @__PURE__ */ t.jsx("path", { d: "M20 15V20H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
882
935
|
] })
|
|
883
936
|
}
|
|
884
937
|
),
|
|
885
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ t.jsx(
|
|
886
939
|
"button",
|
|
887
940
|
{
|
|
888
941
|
type: "button",
|
|
889
942
|
onClick: () => {
|
|
890
943
|
if (!S) {
|
|
891
|
-
const o =
|
|
892
|
-
o && (
|
|
944
|
+
const o = k.current;
|
|
945
|
+
o && (ge.current = o.scrollTop), ie(!1);
|
|
893
946
|
}
|
|
894
|
-
|
|
947
|
+
ae(!S);
|
|
895
948
|
},
|
|
896
949
|
className: "sw-ttyw-header-button",
|
|
897
950
|
title: S ? "Maximize chat" : "Minimize chat",
|
|
898
|
-
children: /* @__PURE__ */
|
|
951
|
+
children: /* @__PURE__ */ t.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t.jsx("path", { d: "M6 9H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
899
952
|
}
|
|
900
953
|
),
|
|
901
|
-
|
|
954
|
+
l && l.length > 0 && /* @__PURE__ */ t.jsx(
|
|
902
955
|
"button",
|
|
903
956
|
{
|
|
904
957
|
type: "button",
|
|
905
|
-
onClick:
|
|
958
|
+
onClick: Le,
|
|
906
959
|
className: "sw-ttyw-header-button",
|
|
907
960
|
title: "Download PDF Report",
|
|
908
|
-
disabled:
|
|
909
|
-
children: /* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
961
|
+
disabled: f,
|
|
962
|
+
children: /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
963
|
+
/* @__PURE__ */ t.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" }),
|
|
964
|
+
/* @__PURE__ */ t.jsx("path", { d: "M7 10L12 15L17 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
965
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 15V3", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
913
966
|
] })
|
|
914
967
|
}
|
|
915
968
|
),
|
|
916
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ t.jsx(
|
|
917
970
|
"button",
|
|
918
971
|
{
|
|
919
972
|
type: "button",
|
|
920
|
-
onClick: () =>
|
|
973
|
+
onClick: () => R(!0),
|
|
921
974
|
className: "sw-ttyw-header-button",
|
|
922
975
|
title: "Clear chat",
|
|
923
|
-
children: /* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
976
|
+
children: /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
977
|
+
/* @__PURE__ */ t.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
978
|
+
/* @__PURE__ */ t.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" }),
|
|
979
|
+
/* @__PURE__ */ t.jsx("path", { d: "M10 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
980
|
+
/* @__PURE__ */ t.jsx("path", { d: "M14 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
928
981
|
] })
|
|
929
982
|
}
|
|
930
983
|
)
|
|
931
984
|
] })
|
|
932
985
|
] }),
|
|
933
|
-
!S && /* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
986
|
+
!S && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-section sw-ttyw-chat-section-flex", children: [
|
|
987
|
+
/* @__PURE__ */ t.jsxs(
|
|
935
988
|
"div",
|
|
936
989
|
{
|
|
937
990
|
className: "sw-ttyw-messages sw-ttyw-chat-section",
|
|
938
|
-
ref:
|
|
939
|
-
onScroll:
|
|
991
|
+
ref: k,
|
|
992
|
+
onScroll: Ue,
|
|
940
993
|
children: [
|
|
941
|
-
|
|
994
|
+
u.length === 0 && !f && /* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-empty-state", children: /* @__PURE__ */ t.jsx(
|
|
942
995
|
"img",
|
|
943
996
|
{
|
|
944
|
-
src:
|
|
997
|
+
src: n2,
|
|
945
998
|
alt: "Superwise Logo",
|
|
946
999
|
onError: (o) => {
|
|
947
1000
|
console.log("Logo failed to load, using fallback"), o.target.classList.add("sw-ttyw-logo-hidden");
|
|
948
1001
|
}
|
|
949
1002
|
}
|
|
950
1003
|
) }),
|
|
951
|
-
|
|
952
|
-
|
|
1004
|
+
u.map((o, w) => /* @__PURE__ */ t.jsx(
|
|
1005
|
+
g2,
|
|
953
1006
|
{
|
|
954
1007
|
msg: o,
|
|
955
|
-
isTyping:
|
|
1008
|
+
isTyping: le.has(w),
|
|
956
1009
|
onTypingComplete: () => {
|
|
957
|
-
|
|
958
|
-
const
|
|
959
|
-
return
|
|
1010
|
+
T((v) => {
|
|
1011
|
+
const H = new Set(v);
|
|
1012
|
+
return H.delete(w), H;
|
|
960
1013
|
}), requestAnimationFrame(() => F("auto"));
|
|
961
1014
|
}
|
|
962
1015
|
},
|
|
963
|
-
|
|
1016
|
+
w
|
|
964
1017
|
)),
|
|
965
|
-
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
1018
|
+
B && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-validation-message", children: [
|
|
1019
|
+
/* @__PURE__ */ t.jsx("span", { className: "error-icon", children: "⚠️" }),
|
|
1020
|
+
/* @__PURE__ */ t.jsx("span", { children: B })
|
|
968
1021
|
] }),
|
|
969
|
-
|
|
1022
|
+
J && /* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-contact-cta", children: /* @__PURE__ */ t.jsxs(
|
|
970
1023
|
"a",
|
|
971
1024
|
{
|
|
972
|
-
href:
|
|
1025
|
+
href: n,
|
|
973
1026
|
target: "_blank",
|
|
974
1027
|
rel: "noopener noreferrer",
|
|
975
1028
|
className: "sw-ttyw-cta-button",
|
|
976
1029
|
children: [
|
|
977
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ t.jsx("span", { className: "sw-ttyw-cta-icon", "aria-hidden": !0, children: "✉" }),
|
|
978
1031
|
"Contact Sales"
|
|
979
1032
|
]
|
|
980
1033
|
}
|
|
981
1034
|
) }),
|
|
982
|
-
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
1035
|
+
V && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-limit-exceeded", children: [
|
|
1036
|
+
/* @__PURE__ */ t.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." }),
|
|
1037
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-limit-action-buttons", children: [
|
|
1038
|
+
/* @__PURE__ */ t.jsxs(
|
|
986
1039
|
"button",
|
|
987
1040
|
{
|
|
988
1041
|
type: "button",
|
|
989
1042
|
className: "sw-ttyw-limit-download-pdf",
|
|
990
|
-
onClick:
|
|
991
|
-
disabled:
|
|
1043
|
+
onClick: Le,
|
|
1044
|
+
disabled: f,
|
|
992
1045
|
children: [
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1047
|
+
/* @__PURE__ */ t.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" }),
|
|
1048
|
+
/* @__PURE__ */ t.jsx("path", { d: "M7 10L12 15L17 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1049
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 15V3", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
997
1050
|
] }),
|
|
998
1051
|
"Download Chat"
|
|
999
1052
|
]
|
|
1000
1053
|
}
|
|
1001
1054
|
),
|
|
1002
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ t.jsxs(
|
|
1003
1056
|
"button",
|
|
1004
1057
|
{
|
|
1005
1058
|
type: "button",
|
|
1006
1059
|
className: "sw-ttyw-limit-clear-history",
|
|
1007
|
-
onClick: () =>
|
|
1060
|
+
onClick: () => R(!0),
|
|
1008
1061
|
children: [
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1063
|
+
/* @__PURE__ */ t.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1064
|
+
/* @__PURE__ */ t.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" }),
|
|
1065
|
+
/* @__PURE__ */ t.jsx("path", { d: "M10 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1066
|
+
/* @__PURE__ */ t.jsx("path", { d: "M14 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1014
1067
|
] }),
|
|
1015
1068
|
"Clear History"
|
|
1016
1069
|
]
|
|
@@ -1018,104 +1071,104 @@ function h2({ title: t = "", agentId: r = "", discoveryAgentId: a = "", primaryC
|
|
|
1018
1071
|
)
|
|
1019
1072
|
] })
|
|
1020
1073
|
] }),
|
|
1021
|
-
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1074
|
+
f && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-message other message-loading", children: [
|
|
1075
|
+
/* @__PURE__ */ t.jsx("div", { className: "message-avatar", children: /* @__PURE__ */ t.jsx(Ve, { width: 20, height: 20 }) }),
|
|
1076
|
+
/* @__PURE__ */ t.jsxs("div", { className: "message-content", children: [
|
|
1077
|
+
/* @__PURE__ */ t.jsx("div", { className: "typing typing-1" }),
|
|
1078
|
+
/* @__PURE__ */ t.jsx("div", { className: "typing typing-2" }),
|
|
1079
|
+
/* @__PURE__ */ t.jsx("div", { className: "typing typing-3" })
|
|
1027
1080
|
] })
|
|
1028
1081
|
] }),
|
|
1029
|
-
!
|
|
1082
|
+
!O && /* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-jump-latest", children: /* @__PURE__ */ t.jsx(
|
|
1030
1083
|
"button",
|
|
1031
1084
|
{
|
|
1032
1085
|
type: "button",
|
|
1033
1086
|
className: "sw-ttyw-jump-button",
|
|
1034
1087
|
onClick: () => {
|
|
1035
|
-
F("smooth"),
|
|
1088
|
+
F("smooth"), U(!0);
|
|
1036
1089
|
},
|
|
1037
1090
|
children: "Jump to latest"
|
|
1038
1091
|
}
|
|
1039
1092
|
) }),
|
|
1040
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ t.jsx("div", { ref: K })
|
|
1041
1094
|
]
|
|
1042
1095
|
}
|
|
1043
1096
|
),
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-input-section", children: [
|
|
1098
|
+
/* @__PURE__ */ t.jsx(
|
|
1046
1099
|
"textarea",
|
|
1047
1100
|
{
|
|
1048
1101
|
className: "sw-ttyw-input",
|
|
1049
|
-
placeholder:
|
|
1050
|
-
value:
|
|
1102
|
+
placeholder: V ? "Chat limit reached." : "Please ask question here",
|
|
1103
|
+
value: p,
|
|
1051
1104
|
onChange: (o) => {
|
|
1052
|
-
|
|
1105
|
+
c(o.target.value), B && N("");
|
|
1053
1106
|
},
|
|
1054
1107
|
maxLength: 1e3,
|
|
1055
|
-
disabled:
|
|
1056
|
-
onKeyDown: (o) => o.key === "Enter" && !o.shiftKey && (o.preventDefault(),
|
|
1108
|
+
disabled: f || V,
|
|
1109
|
+
onKeyDown: (o) => o.key === "Enter" && !o.shiftKey && (o.preventDefault(), Se())
|
|
1057
1110
|
}
|
|
1058
1111
|
),
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-input-content sw-ttyw-input-footer", children: [
|
|
1113
|
+
/* @__PURE__ */ t.jsxs("small", { id: "sw-ttyw-chat-textbox-status", className: "sw-ttyw-character-count", children: [
|
|
1114
|
+
/* @__PURE__ */ t.jsx("span", { children: p.length }),
|
|
1062
1115
|
"/1000"
|
|
1063
1116
|
] }),
|
|
1064
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ t.jsx(
|
|
1065
1118
|
"button",
|
|
1066
1119
|
{
|
|
1067
1120
|
type: "button",
|
|
1068
1121
|
id: "sw-ttyw-chat-send-message",
|
|
1069
1122
|
className: "sw-ttyw-send-button",
|
|
1070
|
-
onClick:
|
|
1123
|
+
onClick: Se,
|
|
1071
1124
|
"aria-label": "Send message",
|
|
1072
|
-
disabled:
|
|
1073
|
-
children: /* @__PURE__ */
|
|
1074
|
-
/* @__PURE__ */
|
|
1075
|
-
/* @__PURE__ */
|
|
1125
|
+
disabled: f || V,
|
|
1126
|
+
children: /* @__PURE__ */ t.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: [
|
|
1127
|
+
/* @__PURE__ */ t.jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1128
|
+
/* @__PURE__ */ t.jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
|
|
1076
1129
|
] })
|
|
1077
1130
|
}
|
|
1078
1131
|
)
|
|
1079
1132
|
] })
|
|
1080
1133
|
] })
|
|
1081
1134
|
] }),
|
|
1082
|
-
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
1135
|
+
_ && /* @__PURE__ */ t.jsxs("div", { className: "swttyw-modal swttyw-modal-clear-history swttyw-modal-overlay", children: [
|
|
1136
|
+
/* @__PURE__ */ t.jsx("div", { className: "swtty-modal-header" }),
|
|
1137
|
+
/* @__PURE__ */ t.jsxs("div", { className: "swtty-modal-body", children: [
|
|
1138
|
+
/* @__PURE__ */ t.jsx("div", { className: "swtty-content", children: "Are you sure you want to delete the chat history?" }),
|
|
1139
|
+
/* @__PURE__ */ t.jsxs("div", { className: "swtty-action swtty-modal-actions", children: [
|
|
1140
|
+
/* @__PURE__ */ t.jsx(
|
|
1088
1141
|
"input",
|
|
1089
1142
|
{
|
|
1090
1143
|
type: "button",
|
|
1091
1144
|
className: "swttyw-btn swttyw-btn-primary swttyw-btn-modal-yes",
|
|
1092
1145
|
id: "swttyw-btn-clear-history-yes",
|
|
1093
|
-
onClick:
|
|
1146
|
+
onClick: De,
|
|
1094
1147
|
value: "Yes"
|
|
1095
1148
|
}
|
|
1096
1149
|
),
|
|
1097
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ t.jsx(
|
|
1098
1151
|
"input",
|
|
1099
1152
|
{
|
|
1100
1153
|
type: "button",
|
|
1101
1154
|
className: "swttyw-btn swttyw-btn-primary-inverse swttyw-btn-modal-no",
|
|
1102
1155
|
id: "swttyw-btn-clear-history-no",
|
|
1103
|
-
onClick: () =>
|
|
1156
|
+
onClick: () => R(!1),
|
|
1104
1157
|
value: "No"
|
|
1105
1158
|
}
|
|
1106
1159
|
)
|
|
1107
1160
|
] })
|
|
1108
1161
|
] }),
|
|
1109
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ t.jsx("div", { className: "swtty-modal-footer" })
|
|
1110
1163
|
] }),
|
|
1111
|
-
!S && /* @__PURE__ */
|
|
1164
|
+
!S && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-footer", children: [
|
|
1112
1165
|
"Powered by ",
|
|
1113
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ t.jsx("a", { href: "https://superwise.ai/", className: "ml-1", target: "_new", rel: "noopener noreferrer", "aria-label": "SUPERWISE®", children: /* @__PURE__ */ t.jsx(d2, { height: 20 }) })
|
|
1114
1167
|
] })
|
|
1115
1168
|
]
|
|
1116
1169
|
}
|
|
1117
1170
|
) });
|
|
1118
1171
|
}
|
|
1119
1172
|
export {
|
|
1120
|
-
|
|
1173
|
+
x2 as Chatbot
|
|
1121
1174
|
};
|