react-aichatbot-widget 1.2.0 → 1.3.1
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/LICENSE +20 -20
- package/README.md +71 -71
- package/dist/index.cjs +7 -16
- package/dist/index.js +518 -490
- package/package.json +41 -41
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { X as
|
|
1
|
+
import { jsxs as O, jsx as y, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useRef as Ct, useEffect as Ke } from "react";
|
|
3
|
+
import { X as Xe, MessageCircle as Ye, Send as Ge, Bot as Pe } from "lucide-react";
|
|
4
4
|
import { v4 as Tt } from "uuid";
|
|
5
5
|
const Ot = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
6
6
|
const o = r.position === "left", l = {
|
|
@@ -26,18 +26,18 @@ const Ot = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
26
26
|
transform: "scale(1.10)",
|
|
27
27
|
boxShadow: "0 25px 35px -5px rgba(0,0,0,0.2)"
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ O(
|
|
30
30
|
"button",
|
|
31
31
|
{
|
|
32
32
|
onClick: e,
|
|
33
33
|
style: l,
|
|
34
34
|
onMouseEnter: (c) => Object.assign(c.currentTarget.style, p),
|
|
35
|
-
onMouseLeave: (c) => Object.keys(p).forEach((
|
|
35
|
+
onMouseLeave: (c) => Object.keys(p).forEach((d) => c.currentTarget.style[d] = l[d] || ""),
|
|
36
36
|
onFocus: (c) => Object.assign(c.currentTarget.style, p),
|
|
37
|
-
onBlur: (c) => Object.keys(p).forEach((
|
|
37
|
+
onBlur: (c) => Object.keys(p).forEach((d) => c.currentTarget.style[d] = l[d] || ""),
|
|
38
38
|
children: [
|
|
39
|
-
t ? /* @__PURE__ */
|
|
40
|
-
!t && /* @__PURE__ */
|
|
39
|
+
t ? /* @__PURE__ */ y(Xe, { size: 30, strokeWidth: 2.5 }) : /* @__PURE__ */ y(Ye, { size: 30, strokeWidth: 2.5 }),
|
|
40
|
+
!t && /* @__PURE__ */ y("span", { style: {
|
|
41
41
|
position: "absolute",
|
|
42
42
|
top: "-4px",
|
|
43
43
|
right: "-4px",
|
|
@@ -49,7 +49,7 @@ const Ot = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
49
49
|
border: "4px solid white",
|
|
50
50
|
animation: "pulse 2s infinite"
|
|
51
51
|
} }),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ y("style", { jsx: !0, children: `
|
|
53
53
|
@keyframes pulse {
|
|
54
54
|
0% {
|
|
55
55
|
box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
|
|
@@ -66,10 +66,10 @@ const Ot = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}, At = ({ onSendMessage: e, isLoading: t, theme: n }) => {
|
|
69
|
-
const [r, o] =
|
|
69
|
+
const [r, o] = L(""), s = () => {
|
|
70
70
|
!r.trim() || t || (e(r.trim()), o(""));
|
|
71
|
-
}, i = (
|
|
72
|
-
|
|
71
|
+
}, i = (d) => {
|
|
72
|
+
d.key === "Enter" && !d.shiftKey && (d.preventDefault(), s());
|
|
73
73
|
}, l = {
|
|
74
74
|
padding: "16px",
|
|
75
75
|
borderTop: "1px solid rgba(255, 255, 255, 0.2)",
|
|
@@ -109,50 +109,52 @@ const Ot = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
109
109
|
transition: "all 0.2s ease",
|
|
110
110
|
minWidth: "48px"
|
|
111
111
|
};
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ y("div", { style: l, children: /* @__PURE__ */ O("div", { style: p, children: [
|
|
113
|
+
/* @__PURE__ */ y(
|
|
114
114
|
"input",
|
|
115
115
|
{
|
|
116
116
|
type: "text",
|
|
117
117
|
placeholder: "Type a message...",
|
|
118
118
|
value: r,
|
|
119
|
-
onChange: (
|
|
119
|
+
onChange: (d) => o(d.target.value),
|
|
120
120
|
onKeyDown: i,
|
|
121
121
|
disabled: t,
|
|
122
122
|
style: u,
|
|
123
|
-
onFocus: (
|
|
124
|
-
|
|
123
|
+
onFocus: (d) => {
|
|
124
|
+
d.target.style.boxShadow = "0 0 0 3px rgba(100, 150, 255, 0.3)", d.target.style.borderColor = "#60a5fa";
|
|
125
125
|
},
|
|
126
|
-
onBlur: (
|
|
127
|
-
|
|
126
|
+
onBlur: (d) => {
|
|
127
|
+
d.target.style.boxShadow = "none", d.target.style.borderColor = n.fontColor;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ y(
|
|
132
132
|
"button",
|
|
133
133
|
{
|
|
134
134
|
onClick: s,
|
|
135
135
|
disabled: t || !r.trim(),
|
|
136
136
|
style: c,
|
|
137
137
|
"aria-label": "Send message",
|
|
138
|
-
onMouseEnter: (
|
|
139
|
-
!t && r.trim() && (
|
|
138
|
+
onMouseEnter: (d) => {
|
|
139
|
+
!t && r.trim() && (d.currentTarget.style.transform = "translateY(-2px)", d.currentTarget.style.boxShadow = "0 8px 16px rgba(0,0,0,0.15)");
|
|
140
140
|
},
|
|
141
|
-
onMouseLeave: (
|
|
142
|
-
|
|
141
|
+
onMouseLeave: (d) => {
|
|
142
|
+
d.currentTarget.style.transform = "translateY(0)", d.currentTarget.style.boxShadow = "none";
|
|
143
143
|
},
|
|
144
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ y(Ge, { size: 18 })
|
|
145
145
|
}
|
|
146
146
|
)
|
|
147
147
|
] }) });
|
|
148
|
-
}, kt = ({ messages: e, isLoading: t, theme: n }) => {
|
|
149
|
-
const
|
|
150
|
-
|
|
148
|
+
}, kt = ({ messages: e, isLoading: t, theme: n, botResponseTime: r }) => {
|
|
149
|
+
const o = Ct(null);
|
|
150
|
+
console.log("Messages in MessageBox:", e);
|
|
151
|
+
const s = () => {
|
|
152
|
+
o.current?.scrollIntoView({ behavior: "smooth" });
|
|
151
153
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
Ke(() => {
|
|
155
|
+
s();
|
|
154
156
|
}, [e, t]);
|
|
155
|
-
const
|
|
157
|
+
const i = {
|
|
156
158
|
flex: 1,
|
|
157
159
|
overflowY: "auto",
|
|
158
160
|
padding: "20px",
|
|
@@ -162,86 +164,106 @@ const Ot = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
162
164
|
display: "flex",
|
|
163
165
|
flexDirection: "column",
|
|
164
166
|
gap: "16px"
|
|
165
|
-
},
|
|
167
|
+
}, l = (d) => ({
|
|
166
168
|
display: "flex",
|
|
167
|
-
justifyContent:
|
|
169
|
+
justifyContent: d === "user" ? "flex-end" : "flex-start",
|
|
168
170
|
width: "100%"
|
|
169
|
-
}),
|
|
171
|
+
}), p = {
|
|
172
|
+
display: "flex",
|
|
173
|
+
flexDirection: "column",
|
|
174
|
+
maxWidth: "80%"
|
|
175
|
+
}, u = (d) => ({
|
|
170
176
|
padding: "12px 16px",
|
|
171
177
|
borderRadius: "16px",
|
|
172
178
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
173
179
|
border: "1px solid #e4e4e7",
|
|
174
|
-
maxWidth: "80%",
|
|
175
180
|
fontSize: "14px",
|
|
176
181
|
lineHeight: "1.5",
|
|
177
|
-
background:
|
|
182
|
+
background: d === "user" ? n.primaryColor : n.backgroundColor,
|
|
178
183
|
color: n.fontColor,
|
|
179
184
|
wordWrap: "break-word"
|
|
180
|
-
}),
|
|
181
|
-
...
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
}), c = {
|
|
186
|
+
...u("bot"),
|
|
187
|
+
animation: "fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",
|
|
188
|
+
animationDelay: "0s, 0.3s"
|
|
184
189
|
};
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
e.map((
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
return /* @__PURE__ */ O("div", { style: i, children: [
|
|
191
|
+
e.map((d, g) => /* @__PURE__ */ y("div", { style: l(d.type), children: /* @__PURE__ */ O("div", { style: p, children: [
|
|
192
|
+
d.type === "bot" && r && /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-start", marginLeft: "4px", marginBottom: "2px" }, children: [
|
|
193
|
+
/* @__PURE__ */ y(Pe, { size: 14, color: n.fontColor }),
|
|
194
|
+
/* @__PURE__ */ y(
|
|
195
|
+
"span",
|
|
196
|
+
{
|
|
197
|
+
style: {
|
|
198
|
+
fontSize: "10px",
|
|
199
|
+
opacity: 0.55,
|
|
200
|
+
color: n.fontColor
|
|
201
|
+
},
|
|
202
|
+
children: r
|
|
196
203
|
}
|
|
204
|
+
)
|
|
205
|
+
] }),
|
|
206
|
+
d.type === "user" && /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-end", marginRight: "4px", marginBottom: "2px" }, children: /* @__PURE__ */ y(
|
|
207
|
+
"span",
|
|
208
|
+
{
|
|
209
|
+
style: {
|
|
210
|
+
fontSize: "10px",
|
|
211
|
+
opacity: 0.55,
|
|
212
|
+
color: n.fontColor
|
|
213
|
+
},
|
|
214
|
+
children: "You"
|
|
197
215
|
}
|
|
198
|
-
|
|
216
|
+
) }),
|
|
217
|
+
/* @__PURE__ */ y("div", { style: u(d.type), children: d.text })
|
|
218
|
+
] }) }, g)),
|
|
219
|
+
t && /* @__PURE__ */ y("div", { style: l("bot"), children: /* @__PURE__ */ y("div", { style: c, children: /* @__PURE__ */ y(Pe, { size: 24 }) }) }),
|
|
220
|
+
/* @__PURE__ */ y("div", { ref: o })
|
|
199
221
|
] });
|
|
200
222
|
};
|
|
201
|
-
function
|
|
223
|
+
function Qe(e, t) {
|
|
202
224
|
return function() {
|
|
203
225
|
return e.apply(t, arguments);
|
|
204
226
|
};
|
|
205
227
|
}
|
|
206
|
-
const { toString: Ft } = Object.prototype, { getPrototypeOf: Re } = Object, { iterator: ce, toStringTag:
|
|
228
|
+
const { toString: Ft } = Object.prototype, { getPrototypeOf: Re } = Object, { iterator: ce, toStringTag: Ze } = Symbol, ue = /* @__PURE__ */ ((e) => (t) => {
|
|
207
229
|
const n = Ft.call(t);
|
|
208
230
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
209
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
210
|
-
function
|
|
211
|
-
return e !== null && !
|
|
231
|
+
})(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => ue(t) === e), de = (e) => (t) => typeof t === e, { isArray: K } = Array, V = de("undefined");
|
|
232
|
+
function Q(e) {
|
|
233
|
+
return e !== null && !V(e) && e.constructor !== null && !V(e.constructor) && U(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
212
234
|
}
|
|
213
|
-
const
|
|
235
|
+
const et = B("ArrayBuffer");
|
|
214
236
|
function Nt(e) {
|
|
215
237
|
let t;
|
|
216
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
238
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && et(e.buffer), t;
|
|
217
239
|
}
|
|
218
|
-
const Pt = de("string"),
|
|
240
|
+
const Pt = de("string"), U = de("function"), tt = de("number"), Z = (e) => e !== null && typeof e == "object", Ut = (e) => e === !0 || e === !1, se = (e) => {
|
|
219
241
|
if (ue(e) !== "object")
|
|
220
242
|
return !1;
|
|
221
243
|
const t = Re(e);
|
|
222
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
244
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ze in e) && !(ce in e);
|
|
223
245
|
}, _t = (e) => {
|
|
224
|
-
if (!
|
|
246
|
+
if (!Z(e) || Q(e))
|
|
225
247
|
return !1;
|
|
226
248
|
try {
|
|
227
249
|
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
228
250
|
} catch {
|
|
229
251
|
return !1;
|
|
230
252
|
}
|
|
231
|
-
}, Lt =
|
|
253
|
+
}, Lt = B("Date"), Bt = B("File"), Dt = B("Blob"), jt = B("FileList"), It = (e) => Z(e) && U(e.pipe), vt = (e) => {
|
|
232
254
|
let t;
|
|
233
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
234
|
-
t === "object" &&
|
|
235
|
-
},
|
|
236
|
-
function
|
|
255
|
+
return e && (typeof FormData == "function" && e instanceof FormData || U(e.append) && ((t = ue(e)) === "formdata" || // detect form-data instance
|
|
256
|
+
t === "object" && U(e.toString) && e.toString() === "[object FormData]"));
|
|
257
|
+
}, zt = B("URLSearchParams"), [Ht, Mt, qt, $t] = ["ReadableStream", "Request", "Response", "Headers"].map(B), Wt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
258
|
+
function ee(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
237
259
|
if (e === null || typeof e > "u")
|
|
238
260
|
return;
|
|
239
261
|
let r, o;
|
|
240
|
-
if (typeof e != "object" && (e = [e]),
|
|
262
|
+
if (typeof e != "object" && (e = [e]), K(e))
|
|
241
263
|
for (r = 0, o = e.length; r < o; r++)
|
|
242
264
|
t.call(null, e[r], r, e);
|
|
243
265
|
else {
|
|
244
|
-
if (
|
|
266
|
+
if (Q(e))
|
|
245
267
|
return;
|
|
246
268
|
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
|
|
247
269
|
let l;
|
|
@@ -249,8 +271,8 @@ function Z(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
249
271
|
l = s[r], t.call(null, e[l], l, e);
|
|
250
272
|
}
|
|
251
273
|
}
|
|
252
|
-
function
|
|
253
|
-
if (
|
|
274
|
+
function nt(e, t) {
|
|
275
|
+
if (Q(e))
|
|
254
276
|
return null;
|
|
255
277
|
t = t.toLowerCase();
|
|
256
278
|
const n = Object.keys(e);
|
|
@@ -260,18 +282,18 @@ function tt(e, t) {
|
|
|
260
282
|
return o;
|
|
261
283
|
return null;
|
|
262
284
|
}
|
|
263
|
-
const
|
|
285
|
+
const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, rt = (e) => !V(e) && e !== M;
|
|
264
286
|
function ge() {
|
|
265
|
-
const { caseless: e, skipUndefined: t } =
|
|
266
|
-
const i = e &&
|
|
267
|
-
se(n[i]) && se(o) ? n[i] = ge(n[i], o) : se(o) ? n[i] = ge({}, o) :
|
|
287
|
+
const { caseless: e, skipUndefined: t } = rt(this) && this || {}, n = {}, r = (o, s) => {
|
|
288
|
+
const i = e && nt(n, s) || s;
|
|
289
|
+
se(n[i]) && se(o) ? n[i] = ge(n[i], o) : se(o) ? n[i] = ge({}, o) : K(o) ? n[i] = o.slice() : (!t || !V(o)) && (n[i] = o);
|
|
268
290
|
};
|
|
269
291
|
for (let o = 0, s = arguments.length; o < s; o++)
|
|
270
|
-
arguments[o] &&
|
|
292
|
+
arguments[o] && ee(arguments[o], r);
|
|
271
293
|
return n;
|
|
272
294
|
}
|
|
273
|
-
const Jt = (e, t, n, { allOwnKeys: r } = {}) => (
|
|
274
|
-
n &&
|
|
295
|
+
const Jt = (e, t, n, { allOwnKeys: r } = {}) => (ee(t, (o, s) => {
|
|
296
|
+
n && U(o) ? e[s] = Qe(o, n) : e[s] = o;
|
|
275
297
|
}, { allOwnKeys: r }), e), Vt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Kt = (e, t, n, r) => {
|
|
276
298
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
277
299
|
value: t.prototype
|
|
@@ -286,15 +308,15 @@ const Jt = (e, t, n, { allOwnKeys: r } = {}) => (Z(t, (o, s) => {
|
|
|
286
308
|
e = n !== !1 && Re(e);
|
|
287
309
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
288
310
|
return t;
|
|
289
|
-
},
|
|
311
|
+
}, Yt = (e, t, n) => {
|
|
290
312
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
291
313
|
const r = e.indexOf(t, n);
|
|
292
314
|
return r !== -1 && r === n;
|
|
293
|
-
},
|
|
315
|
+
}, Gt = (e) => {
|
|
294
316
|
if (!e) return null;
|
|
295
|
-
if (
|
|
317
|
+
if (K(e)) return e;
|
|
296
318
|
let t = e.length;
|
|
297
|
-
if (!
|
|
319
|
+
if (!tt(t)) return null;
|
|
298
320
|
const n = new Array(t);
|
|
299
321
|
for (; t-- > 0; )
|
|
300
322
|
n[t] = e[t];
|
|
@@ -312,23 +334,23 @@ const Jt = (e, t, n, { allOwnKeys: r } = {}) => (Z(t, (o, s) => {
|
|
|
312
334
|
for (; (n = e.exec(t)) !== null; )
|
|
313
335
|
r.push(n);
|
|
314
336
|
return r;
|
|
315
|
-
}, tn =
|
|
337
|
+
}, tn = B("HTMLFormElement"), nn = (e) => e.toLowerCase().replace(
|
|
316
338
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
317
339
|
function(n, r, o) {
|
|
318
340
|
return r.toUpperCase() + o;
|
|
319
341
|
}
|
|
320
|
-
),
|
|
342
|
+
), Ue = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rn = B("RegExp"), ot = (e, t) => {
|
|
321
343
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
322
|
-
|
|
344
|
+
ee(n, (o, s) => {
|
|
323
345
|
let i;
|
|
324
346
|
(i = t(o, s, e)) !== !1 && (r[s] = i || o);
|
|
325
347
|
}), Object.defineProperties(e, r);
|
|
326
348
|
}, on = (e) => {
|
|
327
|
-
|
|
328
|
-
if (
|
|
349
|
+
ot(e, (t, n) => {
|
|
350
|
+
if (U(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
329
351
|
return !1;
|
|
330
352
|
const r = e[n];
|
|
331
|
-
if (
|
|
353
|
+
if (U(r)) {
|
|
332
354
|
if (t.enumerable = !1, "writable" in t) {
|
|
333
355
|
t.writable = !1;
|
|
334
356
|
return;
|
|
@@ -344,65 +366,65 @@ const Jt = (e, t, n, { allOwnKeys: r } = {}) => (Z(t, (o, s) => {
|
|
|
344
366
|
n[s] = !0;
|
|
345
367
|
});
|
|
346
368
|
};
|
|
347
|
-
return
|
|
369
|
+
return K(e) ? r(e) : r(String(e).split(t)), n;
|
|
348
370
|
}, an = () => {
|
|
349
371
|
}, ln = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
350
372
|
function cn(e) {
|
|
351
|
-
return !!(e &&
|
|
373
|
+
return !!(e && U(e.append) && e[Ze] === "FormData" && e[ce]);
|
|
352
374
|
}
|
|
353
375
|
const un = (e) => {
|
|
354
376
|
const t = new Array(10), n = (r, o) => {
|
|
355
|
-
if (
|
|
377
|
+
if (Z(r)) {
|
|
356
378
|
if (t.indexOf(r) >= 0)
|
|
357
379
|
return;
|
|
358
|
-
if (
|
|
380
|
+
if (Q(r))
|
|
359
381
|
return r;
|
|
360
382
|
if (!("toJSON" in r)) {
|
|
361
383
|
t[o] = r;
|
|
362
|
-
const s =
|
|
363
|
-
return
|
|
384
|
+
const s = K(r) ? [] : {};
|
|
385
|
+
return ee(r, (i, l) => {
|
|
364
386
|
const p = n(i, o + 1);
|
|
365
|
-
!
|
|
387
|
+
!V(p) && (s[l] = p);
|
|
366
388
|
}), t[o] = void 0, s;
|
|
367
389
|
}
|
|
368
390
|
}
|
|
369
391
|
return r;
|
|
370
392
|
};
|
|
371
393
|
return n(e, 0);
|
|
372
|
-
}, dn =
|
|
373
|
-
o ===
|
|
394
|
+
}, dn = B("AsyncFunction"), fn = (e) => e && (Z(e) || U(e)) && U(e.then) && U(e.catch), st = ((e, t) => e ? setImmediate : t ? ((n, r) => (M.addEventListener("message", ({ source: o, data: s }) => {
|
|
395
|
+
o === M && s === n && r.length && r.shift()();
|
|
374
396
|
}, !1), (o) => {
|
|
375
|
-
r.push(o),
|
|
397
|
+
r.push(o), M.postMessage(n, "*");
|
|
376
398
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
377
399
|
typeof setImmediate == "function",
|
|
378
|
-
|
|
379
|
-
), pn = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
380
|
-
isArray:
|
|
381
|
-
isArrayBuffer:
|
|
382
|
-
isBuffer:
|
|
400
|
+
U(M.postMessage)
|
|
401
|
+
), pn = typeof queueMicrotask < "u" ? queueMicrotask.bind(M) : typeof process < "u" && process.nextTick || st, hn = (e) => e != null && U(e[ce]), a = {
|
|
402
|
+
isArray: K,
|
|
403
|
+
isArrayBuffer: et,
|
|
404
|
+
isBuffer: Q,
|
|
383
405
|
isFormData: vt,
|
|
384
406
|
isArrayBufferView: Nt,
|
|
385
407
|
isString: Pt,
|
|
386
|
-
isNumber:
|
|
408
|
+
isNumber: tt,
|
|
387
409
|
isBoolean: Ut,
|
|
388
|
-
isObject:
|
|
410
|
+
isObject: Z,
|
|
389
411
|
isPlainObject: se,
|
|
390
412
|
isEmptyObject: _t,
|
|
391
|
-
isReadableStream:
|
|
413
|
+
isReadableStream: Ht,
|
|
392
414
|
isRequest: Mt,
|
|
393
|
-
isResponse:
|
|
415
|
+
isResponse: qt,
|
|
394
416
|
isHeaders: $t,
|
|
395
|
-
isUndefined:
|
|
417
|
+
isUndefined: V,
|
|
396
418
|
isDate: Lt,
|
|
397
419
|
isFile: Bt,
|
|
398
420
|
isBlob: Dt,
|
|
399
421
|
isRegExp: rn,
|
|
400
|
-
isFunction:
|
|
422
|
+
isFunction: U,
|
|
401
423
|
isStream: It,
|
|
402
|
-
isURLSearchParams:
|
|
424
|
+
isURLSearchParams: zt,
|
|
403
425
|
isTypedArray: Qt,
|
|
404
426
|
isFileList: jt,
|
|
405
|
-
forEach:
|
|
427
|
+
forEach: ee,
|
|
406
428
|
merge: ge,
|
|
407
429
|
extend: Jt,
|
|
408
430
|
trim: Wt,
|
|
@@ -410,36 +432,36 @@ const un = (e) => {
|
|
|
410
432
|
inherits: Kt,
|
|
411
433
|
toFlatObject: Xt,
|
|
412
434
|
kindOf: ue,
|
|
413
|
-
kindOfTest:
|
|
414
|
-
endsWith:
|
|
415
|
-
toArray:
|
|
435
|
+
kindOfTest: B,
|
|
436
|
+
endsWith: Yt,
|
|
437
|
+
toArray: Gt,
|
|
416
438
|
forEachEntry: Zt,
|
|
417
439
|
matchAll: en,
|
|
418
440
|
isHTMLForm: tn,
|
|
419
|
-
hasOwnProperty:
|
|
420
|
-
hasOwnProp:
|
|
441
|
+
hasOwnProperty: Ue,
|
|
442
|
+
hasOwnProp: Ue,
|
|
421
443
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
422
|
-
reduceDescriptors:
|
|
444
|
+
reduceDescriptors: ot,
|
|
423
445
|
freezeMethods: on,
|
|
424
446
|
toObjectSet: sn,
|
|
425
447
|
toCamelCase: nn,
|
|
426
448
|
noop: an,
|
|
427
449
|
toFiniteNumber: ln,
|
|
428
|
-
findKey:
|
|
429
|
-
global:
|
|
430
|
-
isContextDefined:
|
|
450
|
+
findKey: nt,
|
|
451
|
+
global: M,
|
|
452
|
+
isContextDefined: rt,
|
|
431
453
|
isSpecCompliantForm: cn,
|
|
432
454
|
toJSONObject: un,
|
|
433
455
|
isAsyncFn: dn,
|
|
434
456
|
isThenable: fn,
|
|
435
|
-
setImmediate:
|
|
457
|
+
setImmediate: st,
|
|
436
458
|
asap: pn,
|
|
437
459
|
isIterable: hn
|
|
438
460
|
};
|
|
439
|
-
function
|
|
461
|
+
function b(e, t, n, r, o) {
|
|
440
462
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
441
463
|
}
|
|
442
|
-
a.inherits(
|
|
464
|
+
a.inherits(b, Error, {
|
|
443
465
|
toJSON: function() {
|
|
444
466
|
return {
|
|
445
467
|
// Standard
|
|
@@ -460,7 +482,7 @@ a.inherits(y, Error, {
|
|
|
460
482
|
};
|
|
461
483
|
}
|
|
462
484
|
});
|
|
463
|
-
const
|
|
485
|
+
const it = b.prototype, at = {};
|
|
464
486
|
[
|
|
465
487
|
"ERR_BAD_OPTION_VALUE",
|
|
466
488
|
"ERR_BAD_OPTION",
|
|
@@ -476,28 +498,28 @@ const st = y.prototype, it = {};
|
|
|
476
498
|
"ERR_INVALID_URL"
|
|
477
499
|
// eslint-disable-next-line func-names
|
|
478
500
|
].forEach((e) => {
|
|
479
|
-
|
|
501
|
+
at[e] = { value: e };
|
|
480
502
|
});
|
|
481
|
-
Object.defineProperties(
|
|
482
|
-
Object.defineProperty(
|
|
483
|
-
|
|
484
|
-
const i = Object.create(
|
|
503
|
+
Object.defineProperties(b, at);
|
|
504
|
+
Object.defineProperty(it, "isAxiosError", { value: !0 });
|
|
505
|
+
b.from = (e, t, n, r, o, s) => {
|
|
506
|
+
const i = Object.create(it);
|
|
485
507
|
a.toFlatObject(e, i, function(c) {
|
|
486
508
|
return c !== Error.prototype;
|
|
487
509
|
}, (u) => u !== "isAxiosError");
|
|
488
510
|
const l = e && e.message ? e.message : "Error", p = t == null && e ? e.code : t;
|
|
489
|
-
return
|
|
511
|
+
return b.call(i, l, p, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
|
|
490
512
|
};
|
|
491
513
|
const mn = null;
|
|
492
514
|
function xe(e) {
|
|
493
515
|
return a.isPlainObject(e) || a.isArray(e);
|
|
494
516
|
}
|
|
495
|
-
function
|
|
517
|
+
function lt(e) {
|
|
496
518
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
497
519
|
}
|
|
498
|
-
function
|
|
520
|
+
function _e(e, t, n) {
|
|
499
521
|
return e ? e.concat(t).map(function(o, s) {
|
|
500
|
-
return o =
|
|
522
|
+
return o = lt(o), !n && s ? "[" + o + "]" : o;
|
|
501
523
|
}).join(n ? "." : "") : t;
|
|
502
524
|
}
|
|
503
525
|
function yn(e) {
|
|
@@ -519,42 +541,42 @@ function fe(e, t, n) {
|
|
|
519
541
|
const r = n.metaTokens, o = n.visitor || c, s = n.dots, i = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
520
542
|
if (!a.isFunction(o))
|
|
521
543
|
throw new TypeError("visitor must be a function");
|
|
522
|
-
function u(
|
|
523
|
-
if (
|
|
524
|
-
if (a.isDate(
|
|
525
|
-
return
|
|
526
|
-
if (a.isBoolean(
|
|
527
|
-
return
|
|
528
|
-
if (!p && a.isBlob(
|
|
529
|
-
throw new
|
|
530
|
-
return a.isArrayBuffer(
|
|
531
|
-
}
|
|
532
|
-
function c(
|
|
533
|
-
let w =
|
|
534
|
-
if (
|
|
544
|
+
function u(f) {
|
|
545
|
+
if (f === null) return "";
|
|
546
|
+
if (a.isDate(f))
|
|
547
|
+
return f.toISOString();
|
|
548
|
+
if (a.isBoolean(f))
|
|
549
|
+
return f.toString();
|
|
550
|
+
if (!p && a.isBlob(f))
|
|
551
|
+
throw new b("Blob is not supported. Use a Buffer instead.");
|
|
552
|
+
return a.isArrayBuffer(f) || a.isTypedArray(f) ? p && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
553
|
+
}
|
|
554
|
+
function c(f, m, h) {
|
|
555
|
+
let w = f;
|
|
556
|
+
if (f && !h && typeof f == "object") {
|
|
535
557
|
if (a.endsWith(m, "{}"))
|
|
536
|
-
m = r ? m : m.slice(0, -2),
|
|
537
|
-
else if (a.isArray(
|
|
538
|
-
return m =
|
|
558
|
+
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
559
|
+
else if (a.isArray(f) && yn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (w = a.toArray(f)))
|
|
560
|
+
return m = lt(m), w.forEach(function(S, x) {
|
|
539
561
|
!(a.isUndefined(S) || S === null) && t.append(
|
|
540
562
|
// eslint-disable-next-line no-nested-ternary
|
|
541
|
-
i === !0 ?
|
|
563
|
+
i === !0 ? _e([m], x, s) : i === null ? m : m + "[]",
|
|
542
564
|
u(S)
|
|
543
565
|
);
|
|
544
566
|
}), !1;
|
|
545
567
|
}
|
|
546
|
-
return xe(
|
|
568
|
+
return xe(f) ? !0 : (t.append(_e(h, m, s), u(f)), !1);
|
|
547
569
|
}
|
|
548
|
-
const
|
|
570
|
+
const d = [], g = Object.assign(bn, {
|
|
549
571
|
defaultVisitor: c,
|
|
550
572
|
convertValue: u,
|
|
551
573
|
isVisitable: xe
|
|
552
574
|
});
|
|
553
|
-
function E(
|
|
554
|
-
if (!a.isUndefined(
|
|
555
|
-
if (
|
|
575
|
+
function E(f, m) {
|
|
576
|
+
if (!a.isUndefined(f)) {
|
|
577
|
+
if (d.indexOf(f) !== -1)
|
|
556
578
|
throw Error("Circular reference detected in " + m.join("."));
|
|
557
|
-
|
|
579
|
+
d.push(f), a.forEach(f, function(w, C) {
|
|
558
580
|
(!(a.isUndefined(w) || w === null) && o.call(
|
|
559
581
|
t,
|
|
560
582
|
w,
|
|
@@ -562,14 +584,14 @@ function fe(e, t, n) {
|
|
|
562
584
|
m,
|
|
563
585
|
g
|
|
564
586
|
)) === !0 && E(w, m ? m.concat(C) : [C]);
|
|
565
|
-
}),
|
|
587
|
+
}), d.pop();
|
|
566
588
|
}
|
|
567
589
|
}
|
|
568
590
|
if (!a.isObject(e))
|
|
569
591
|
throw new TypeError("data must be an object");
|
|
570
592
|
return E(e), t;
|
|
571
593
|
}
|
|
572
|
-
function
|
|
594
|
+
function Le(e) {
|
|
573
595
|
const t = {
|
|
574
596
|
"!": "%21",
|
|
575
597
|
"'": "%27",
|
|
@@ -586,14 +608,14 @@ function _e(e) {
|
|
|
586
608
|
function Ce(e, t) {
|
|
587
609
|
this._pairs = [], e && fe(e, this, t);
|
|
588
610
|
}
|
|
589
|
-
const
|
|
590
|
-
|
|
611
|
+
const ct = Ce.prototype;
|
|
612
|
+
ct.append = function(t, n) {
|
|
591
613
|
this._pairs.push([t, n]);
|
|
592
614
|
};
|
|
593
|
-
|
|
615
|
+
ct.toString = function(t) {
|
|
594
616
|
const n = t ? function(r) {
|
|
595
|
-
return t.call(this, r,
|
|
596
|
-
} :
|
|
617
|
+
return t.call(this, r, Le);
|
|
618
|
+
} : Le;
|
|
597
619
|
return this._pairs.map(function(o) {
|
|
598
620
|
return n(o[0]) + "=" + n(o[1]);
|
|
599
621
|
}, "").join("&");
|
|
@@ -601,7 +623,7 @@ lt.toString = function(t) {
|
|
|
601
623
|
function gn(e) {
|
|
602
624
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
603
625
|
}
|
|
604
|
-
function
|
|
626
|
+
function ut(e, t, n) {
|
|
605
627
|
if (!t)
|
|
606
628
|
return e;
|
|
607
629
|
const r = n && n.encode || gn;
|
|
@@ -616,7 +638,7 @@ function ct(e, t, n) {
|
|
|
616
638
|
}
|
|
617
639
|
return e;
|
|
618
640
|
}
|
|
619
|
-
class
|
|
641
|
+
class Be {
|
|
620
642
|
constructor() {
|
|
621
643
|
this.handlers = [];
|
|
622
644
|
}
|
|
@@ -670,7 +692,7 @@ class Le {
|
|
|
670
692
|
});
|
|
671
693
|
}
|
|
672
694
|
}
|
|
673
|
-
const
|
|
695
|
+
const dt = {
|
|
674
696
|
silentJSONParsing: !0,
|
|
675
697
|
forcedJSONParsing: !0,
|
|
676
698
|
clarifyTimeoutError: !1
|
|
@@ -690,14 +712,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Tn
|
|
|
690
712
|
hasStandardBrowserWebWorkerEnv: Cn,
|
|
691
713
|
navigator: we,
|
|
692
714
|
origin: Tn
|
|
693
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
715
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
694
716
|
...On,
|
|
695
717
|
...En
|
|
696
718
|
};
|
|
697
719
|
function An(e, t) {
|
|
698
|
-
return fe(e, new
|
|
720
|
+
return fe(e, new N.classes.URLSearchParams(), {
|
|
699
721
|
visitor: function(n, r, o, s) {
|
|
700
|
-
return
|
|
722
|
+
return N.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
701
723
|
},
|
|
702
724
|
...t
|
|
703
725
|
});
|
|
@@ -714,7 +736,7 @@ function Fn(e) {
|
|
|
714
736
|
s = n[r], t[s] = e[s];
|
|
715
737
|
return t;
|
|
716
738
|
}
|
|
717
|
-
function
|
|
739
|
+
function ft(e) {
|
|
718
740
|
function t(n, r, o, s) {
|
|
719
741
|
let i = n[s++];
|
|
720
742
|
if (i === "__proto__") return !0;
|
|
@@ -739,13 +761,13 @@ function Nn(e, t, n) {
|
|
|
739
761
|
}
|
|
740
762
|
return (n || JSON.stringify)(e);
|
|
741
763
|
}
|
|
742
|
-
const
|
|
743
|
-
transitional:
|
|
764
|
+
const te = {
|
|
765
|
+
transitional: dt,
|
|
744
766
|
adapter: ["xhr", "http", "fetch"],
|
|
745
767
|
transformRequest: [function(t, n) {
|
|
746
768
|
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = a.isObject(t);
|
|
747
769
|
if (s && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
748
|
-
return o ? JSON.stringify(
|
|
770
|
+
return o ? JSON.stringify(ft(t)) : t;
|
|
749
771
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
|
|
750
772
|
return t;
|
|
751
773
|
if (a.isArrayBufferView(t))
|
|
@@ -768,7 +790,7 @@ const ee = {
|
|
|
768
790
|
return s || o ? (n.setContentType("application/json", !1), Nn(t)) : t;
|
|
769
791
|
}],
|
|
770
792
|
transformResponse: [function(t) {
|
|
771
|
-
const n = this.transitional ||
|
|
793
|
+
const n = this.transitional || te.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
|
|
772
794
|
if (a.isResponse(t) || a.isReadableStream(t))
|
|
773
795
|
return t;
|
|
774
796
|
if (t && a.isString(t) && (r && !this.responseType || o)) {
|
|
@@ -777,7 +799,7 @@ const ee = {
|
|
|
777
799
|
return JSON.parse(t, this.parseReviver);
|
|
778
800
|
} catch (l) {
|
|
779
801
|
if (i)
|
|
780
|
-
throw l.name === "SyntaxError" ?
|
|
802
|
+
throw l.name === "SyntaxError" ? b.from(l, b.ERR_BAD_RESPONSE, this, null, this.response) : l;
|
|
781
803
|
}
|
|
782
804
|
}
|
|
783
805
|
return t;
|
|
@@ -792,8 +814,8 @@ const ee = {
|
|
|
792
814
|
maxContentLength: -1,
|
|
793
815
|
maxBodyLength: -1,
|
|
794
816
|
env: {
|
|
795
|
-
FormData:
|
|
796
|
-
Blob:
|
|
817
|
+
FormData: N.classes.FormData,
|
|
818
|
+
Blob: N.classes.Blob
|
|
797
819
|
},
|
|
798
820
|
validateStatus: function(t) {
|
|
799
821
|
return t >= 200 && t < 300;
|
|
@@ -806,7 +828,7 @@ const ee = {
|
|
|
806
828
|
}
|
|
807
829
|
};
|
|
808
830
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
809
|
-
|
|
831
|
+
te.headers[e] = {};
|
|
810
832
|
});
|
|
811
833
|
const Pn = a.toObjectSet([
|
|
812
834
|
"age",
|
|
@@ -833,7 +855,7 @@ const Pn = a.toObjectSet([
|
|
|
833
855
|
`).forEach(function(i) {
|
|
834
856
|
o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || t[n] && Pn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
835
857
|
}), t;
|
|
836
|
-
},
|
|
858
|
+
}, De = Symbol("internals");
|
|
837
859
|
function G(e) {
|
|
838
860
|
return e && String(e).trim().toLowerCase();
|
|
839
861
|
}
|
|
@@ -872,7 +894,7 @@ function Dn(e, t) {
|
|
|
872
894
|
});
|
|
873
895
|
});
|
|
874
896
|
}
|
|
875
|
-
let
|
|
897
|
+
let _ = class {
|
|
876
898
|
constructor(t) {
|
|
877
899
|
t && this.set(t);
|
|
878
900
|
}
|
|
@@ -882,8 +904,8 @@ let U = class {
|
|
|
882
904
|
const c = G(p);
|
|
883
905
|
if (!c)
|
|
884
906
|
throw new Error("header name must be a non-empty string");
|
|
885
|
-
const
|
|
886
|
-
(!
|
|
907
|
+
const d = a.findKey(o, c);
|
|
908
|
+
(!d || o[d] === void 0 || u === !0 || u === void 0 && o[d] !== !1) && (o[d || p] = ie(l));
|
|
887
909
|
}
|
|
888
910
|
const i = (l, p) => a.forEach(l, (u, c) => s(u, c, p));
|
|
889
911
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -988,7 +1010,7 @@ let U = class {
|
|
|
988
1010
|
return n.forEach((o) => r.set(o)), r;
|
|
989
1011
|
}
|
|
990
1012
|
static accessor(t) {
|
|
991
|
-
const r = (this[
|
|
1013
|
+
const r = (this[De] = this[De] = {
|
|
992
1014
|
accessors: {}
|
|
993
1015
|
}).accessors, o = this.prototype;
|
|
994
1016
|
function s(i) {
|
|
@@ -998,8 +1020,8 @@ let U = class {
|
|
|
998
1020
|
return a.isArray(t) ? t.forEach(s) : s(t), this;
|
|
999
1021
|
}
|
|
1000
1022
|
};
|
|
1001
|
-
|
|
1002
|
-
a.reduceDescriptors(
|
|
1023
|
+
_.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1024
|
+
a.reduceDescriptors(_.prototype, ({ value: e }, t) => {
|
|
1003
1025
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1004
1026
|
return {
|
|
1005
1027
|
get: () => e,
|
|
@@ -1008,28 +1030,28 @@ a.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
|
1008
1030
|
}
|
|
1009
1031
|
};
|
|
1010
1032
|
});
|
|
1011
|
-
a.freezeMethods(
|
|
1033
|
+
a.freezeMethods(_);
|
|
1012
1034
|
function ye(e, t) {
|
|
1013
|
-
const n = this ||
|
|
1035
|
+
const n = this || te, r = t || n, o = _.from(r.headers);
|
|
1014
1036
|
let s = r.data;
|
|
1015
1037
|
return a.forEach(e, function(l) {
|
|
1016
1038
|
s = l.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
1017
1039
|
}), o.normalize(), s;
|
|
1018
1040
|
}
|
|
1019
|
-
function
|
|
1041
|
+
function pt(e) {
|
|
1020
1042
|
return !!(e && e.__CANCEL__);
|
|
1021
1043
|
}
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1044
|
+
function X(e, t, n) {
|
|
1045
|
+
b.call(this, e ?? "canceled", b.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1024
1046
|
}
|
|
1025
|
-
a.inherits(
|
|
1047
|
+
a.inherits(X, b, {
|
|
1026
1048
|
__CANCEL__: !0
|
|
1027
1049
|
});
|
|
1028
|
-
function
|
|
1050
|
+
function ht(e, t, n) {
|
|
1029
1051
|
const r = n.config.validateStatus;
|
|
1030
|
-
!n.status || !r || r(n.status) ? e(n) : t(new
|
|
1052
|
+
!n.status || !r || r(n.status) ? e(n) : t(new b(
|
|
1031
1053
|
"Request failed with status code " + n.status,
|
|
1032
|
-
[
|
|
1054
|
+
[b.ERR_BAD_REQUEST, b.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
1033
1055
|
n.config,
|
|
1034
1056
|
n.request,
|
|
1035
1057
|
n
|
|
@@ -1046,9 +1068,9 @@ function In(e, t) {
|
|
|
1046
1068
|
return t = t !== void 0 ? t : 1e3, function(p) {
|
|
1047
1069
|
const u = Date.now(), c = r[s];
|
|
1048
1070
|
i || (i = u), n[o] = p, r[o] = u;
|
|
1049
|
-
let
|
|
1050
|
-
for (;
|
|
1051
|
-
g += n[
|
|
1071
|
+
let d = s, g = 0;
|
|
1072
|
+
for (; d !== o; )
|
|
1073
|
+
g += n[d++], d = d % e;
|
|
1052
1074
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), u - i < t)
|
|
1053
1075
|
return;
|
|
1054
1076
|
const E = c && u - c;
|
|
@@ -1061,10 +1083,10 @@ function vn(e, t) {
|
|
|
1061
1083
|
n = c, o = null, s && (clearTimeout(s), s = null), e(...u);
|
|
1062
1084
|
};
|
|
1063
1085
|
return [(...u) => {
|
|
1064
|
-
const c = Date.now(),
|
|
1065
|
-
|
|
1086
|
+
const c = Date.now(), d = c - n;
|
|
1087
|
+
d >= r ? i(u, c) : (o = u, s || (s = setTimeout(() => {
|
|
1066
1088
|
s = null, i(o);
|
|
1067
|
-
}, r -
|
|
1089
|
+
}, r - d)));
|
|
1068
1090
|
}, () => o && i(o)];
|
|
1069
1091
|
}
|
|
1070
1092
|
const le = (e, t, n = 3) => {
|
|
@@ -1073,7 +1095,7 @@ const le = (e, t, n = 3) => {
|
|
|
1073
1095
|
return vn((s) => {
|
|
1074
1096
|
const i = s.loaded, l = s.lengthComputable ? s.total : void 0, p = i - r, u = o(p), c = i <= l;
|
|
1075
1097
|
r = i;
|
|
1076
|
-
const
|
|
1098
|
+
const d = {
|
|
1077
1099
|
loaded: i,
|
|
1078
1100
|
total: l,
|
|
1079
1101
|
progress: l ? i / l : void 0,
|
|
@@ -1084,19 +1106,19 @@ const le = (e, t, n = 3) => {
|
|
|
1084
1106
|
lengthComputable: l != null,
|
|
1085
1107
|
[t ? "download" : "upload"]: !0
|
|
1086
1108
|
};
|
|
1087
|
-
e(
|
|
1109
|
+
e(d);
|
|
1088
1110
|
}, n);
|
|
1089
|
-
},
|
|
1111
|
+
}, je = (e, t) => {
|
|
1090
1112
|
const n = e != null;
|
|
1091
1113
|
return [(r) => t[0]({
|
|
1092
1114
|
lengthComputable: n,
|
|
1093
1115
|
total: e,
|
|
1094
1116
|
loaded: r
|
|
1095
1117
|
}), t[1]];
|
|
1096
|
-
},
|
|
1097
|
-
new URL(
|
|
1098
|
-
|
|
1099
|
-
) : () => !0,
|
|
1118
|
+
}, Ie = (e) => (...t) => a.asap(() => e(...t)), zn = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, N.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1119
|
+
new URL(N.origin),
|
|
1120
|
+
N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
|
|
1121
|
+
) : () => !0, Hn = N.hasStandardBrowserEnv ? (
|
|
1100
1122
|
// Standard browser envs support document.cookie
|
|
1101
1123
|
{
|
|
1102
1124
|
write(e, t, n, r, o, s, i) {
|
|
@@ -1128,25 +1150,25 @@ const le = (e, t, n = 3) => {
|
|
|
1128
1150
|
function Mn(e) {
|
|
1129
1151
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1130
1152
|
}
|
|
1131
|
-
function
|
|
1153
|
+
function qn(e, t) {
|
|
1132
1154
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1133
1155
|
}
|
|
1134
|
-
function
|
|
1156
|
+
function mt(e, t, n) {
|
|
1135
1157
|
let r = !Mn(t);
|
|
1136
|
-
return e && (r || n == !1) ?
|
|
1158
|
+
return e && (r || n == !1) ? qn(e, t) : t;
|
|
1137
1159
|
}
|
|
1138
|
-
const
|
|
1139
|
-
function
|
|
1160
|
+
const ve = (e) => e instanceof _ ? { ...e } : e;
|
|
1161
|
+
function $(e, t) {
|
|
1140
1162
|
t = t || {};
|
|
1141
1163
|
const n = {};
|
|
1142
|
-
function r(u, c,
|
|
1164
|
+
function r(u, c, d, g) {
|
|
1143
1165
|
return a.isPlainObject(u) && a.isPlainObject(c) ? a.merge.call({ caseless: g }, u, c) : a.isPlainObject(c) ? a.merge({}, c) : a.isArray(c) ? c.slice() : c;
|
|
1144
1166
|
}
|
|
1145
|
-
function o(u, c,
|
|
1167
|
+
function o(u, c, d, g) {
|
|
1146
1168
|
if (a.isUndefined(c)) {
|
|
1147
1169
|
if (!a.isUndefined(u))
|
|
1148
|
-
return r(void 0, u,
|
|
1149
|
-
} else return r(u, c,
|
|
1170
|
+
return r(void 0, u, d, g);
|
|
1171
|
+
} else return r(u, c, d, g);
|
|
1150
1172
|
}
|
|
1151
1173
|
function s(u, c) {
|
|
1152
1174
|
if (!a.isUndefined(c))
|
|
@@ -1158,10 +1180,10 @@ function z(e, t) {
|
|
|
1158
1180
|
return r(void 0, u);
|
|
1159
1181
|
} else return r(void 0, c);
|
|
1160
1182
|
}
|
|
1161
|
-
function l(u, c,
|
|
1162
|
-
if (
|
|
1183
|
+
function l(u, c, d) {
|
|
1184
|
+
if (d in t)
|
|
1163
1185
|
return r(u, c);
|
|
1164
|
-
if (
|
|
1186
|
+
if (d in e)
|
|
1165
1187
|
return r(void 0, u);
|
|
1166
1188
|
}
|
|
1167
1189
|
const p = {
|
|
@@ -1193,49 +1215,49 @@ function z(e, t) {
|
|
|
1193
1215
|
socketPath: i,
|
|
1194
1216
|
responseEncoding: i,
|
|
1195
1217
|
validateStatus: l,
|
|
1196
|
-
headers: (u, c,
|
|
1218
|
+
headers: (u, c, d) => o(ve(u), ve(c), d, !0)
|
|
1197
1219
|
};
|
|
1198
1220
|
return a.forEach(Object.keys({ ...e, ...t }), function(c) {
|
|
1199
|
-
const
|
|
1200
|
-
a.isUndefined(g) &&
|
|
1221
|
+
const d = p[c] || o, g = d(e[c], t[c], c);
|
|
1222
|
+
a.isUndefined(g) && d !== l || (n[c] = g);
|
|
1201
1223
|
}), n;
|
|
1202
1224
|
}
|
|
1203
|
-
const
|
|
1204
|
-
const t =
|
|
1225
|
+
const yt = (e) => {
|
|
1226
|
+
const t = $({}, e);
|
|
1205
1227
|
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: l } = t;
|
|
1206
|
-
if (t.headers = i =
|
|
1228
|
+
if (t.headers = i = _.from(i), t.url = ut(mt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && i.set(
|
|
1207
1229
|
"Authorization",
|
|
1208
1230
|
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1209
1231
|
), a.isFormData(n)) {
|
|
1210
|
-
if (
|
|
1232
|
+
if (N.hasStandardBrowserEnv || N.hasStandardBrowserWebWorkerEnv)
|
|
1211
1233
|
i.setContentType(void 0);
|
|
1212
1234
|
else if (a.isFunction(n.getHeaders)) {
|
|
1213
1235
|
const p = n.getHeaders(), u = ["content-type", "content-length"];
|
|
1214
|
-
Object.entries(p).forEach(([c,
|
|
1215
|
-
u.includes(c.toLowerCase()) && i.set(c,
|
|
1236
|
+
Object.entries(p).forEach(([c, d]) => {
|
|
1237
|
+
u.includes(c.toLowerCase()) && i.set(c, d);
|
|
1216
1238
|
});
|
|
1217
1239
|
}
|
|
1218
1240
|
}
|
|
1219
|
-
if (
|
|
1220
|
-
const p = o && s &&
|
|
1241
|
+
if (N.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && zn(t.url))) {
|
|
1242
|
+
const p = o && s && Hn.read(s);
|
|
1221
1243
|
p && i.set(o, p);
|
|
1222
1244
|
}
|
|
1223
1245
|
return t;
|
|
1224
1246
|
}, $n = typeof XMLHttpRequest < "u", Wn = $n && function(e) {
|
|
1225
1247
|
return new Promise(function(n, r) {
|
|
1226
|
-
const o =
|
|
1248
|
+
const o = yt(e);
|
|
1227
1249
|
let s = o.data;
|
|
1228
|
-
const i =
|
|
1229
|
-
let { responseType: l, onUploadProgress: p, onDownloadProgress: u } = o, c,
|
|
1250
|
+
const i = _.from(o.headers).normalize();
|
|
1251
|
+
let { responseType: l, onUploadProgress: p, onDownloadProgress: u } = o, c, d, g, E, f;
|
|
1230
1252
|
function m() {
|
|
1231
|
-
E && E(),
|
|
1253
|
+
E && E(), f && f(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
|
|
1232
1254
|
}
|
|
1233
1255
|
let h = new XMLHttpRequest();
|
|
1234
1256
|
h.open(o.method.toUpperCase(), o.url, !0), h.timeout = o.timeout;
|
|
1235
1257
|
function w() {
|
|
1236
1258
|
if (!h)
|
|
1237
1259
|
return;
|
|
1238
|
-
const S =
|
|
1260
|
+
const S = _.from(
|
|
1239
1261
|
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1240
1262
|
), T = {
|
|
1241
1263
|
data: !l || l === "text" || l === "json" ? h.responseText : h.response,
|
|
@@ -1245,36 +1267,36 @@ const mt = (e) => {
|
|
|
1245
1267
|
config: e,
|
|
1246
1268
|
request: h
|
|
1247
1269
|
};
|
|
1248
|
-
|
|
1249
|
-
n(
|
|
1250
|
-
}, function(
|
|
1251
|
-
r(
|
|
1270
|
+
ht(function(A) {
|
|
1271
|
+
n(A), m();
|
|
1272
|
+
}, function(A) {
|
|
1273
|
+
r(A), m();
|
|
1252
1274
|
}, T), h = null;
|
|
1253
1275
|
}
|
|
1254
1276
|
"onloadend" in h ? h.onloadend = w : h.onreadystatechange = function() {
|
|
1255
1277
|
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
1256
1278
|
}, h.onabort = function() {
|
|
1257
|
-
h && (r(new
|
|
1279
|
+
h && (r(new b("Request aborted", b.ECONNABORTED, e, h)), h = null);
|
|
1258
1280
|
}, h.onerror = function(x) {
|
|
1259
|
-
const T = x && x.message ? x.message : "Network Error",
|
|
1260
|
-
|
|
1281
|
+
const T = x && x.message ? x.message : "Network Error", k = new b(T, b.ERR_NETWORK, e, h);
|
|
1282
|
+
k.event = x || null, r(k), h = null;
|
|
1261
1283
|
}, h.ontimeout = function() {
|
|
1262
1284
|
let x = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1263
|
-
const T = o.transitional ||
|
|
1264
|
-
o.timeoutErrorMessage && (x = o.timeoutErrorMessage), r(new
|
|
1285
|
+
const T = o.transitional || dt;
|
|
1286
|
+
o.timeoutErrorMessage && (x = o.timeoutErrorMessage), r(new b(
|
|
1265
1287
|
x,
|
|
1266
|
-
T.clarifyTimeoutError ?
|
|
1288
|
+
T.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
|
|
1267
1289
|
e,
|
|
1268
1290
|
h
|
|
1269
1291
|
)), h = null;
|
|
1270
1292
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(x, T) {
|
|
1271
1293
|
h.setRequestHeader(T, x);
|
|
1272
|
-
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType), u && ([g,
|
|
1273
|
-
h && (r(!S || S.type ? new
|
|
1294
|
+
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType), u && ([g, f] = le(u, !0), h.addEventListener("progress", g)), p && h.upload && ([d, E] = le(p), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", E)), (o.cancelToken || o.signal) && (c = (S) => {
|
|
1295
|
+
h && (r(!S || S.type ? new X(null, e, h) : S), h.abort(), h = null);
|
|
1274
1296
|
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
|
|
1275
1297
|
const C = jn(o.url);
|
|
1276
|
-
if (C &&
|
|
1277
|
-
r(new
|
|
1298
|
+
if (C && N.protocols.indexOf(C) === -1) {
|
|
1299
|
+
r(new b("Unsupported protocol " + C + ":", b.ERR_BAD_REQUEST, e));
|
|
1278
1300
|
return;
|
|
1279
1301
|
}
|
|
1280
1302
|
h.send(s || null);
|
|
@@ -1287,11 +1309,11 @@ const mt = (e) => {
|
|
|
1287
1309
|
if (!o) {
|
|
1288
1310
|
o = !0, l();
|
|
1289
1311
|
const c = u instanceof Error ? u : this.reason;
|
|
1290
|
-
r.abort(c instanceof
|
|
1312
|
+
r.abort(c instanceof b ? c : new X(c instanceof Error ? c.message : c));
|
|
1291
1313
|
}
|
|
1292
1314
|
};
|
|
1293
1315
|
let i = t && setTimeout(() => {
|
|
1294
|
-
i = null, s(new
|
|
1316
|
+
i = null, s(new b(`timeout ${t} of ms exceeded`, b.ETIMEDOUT));
|
|
1295
1317
|
}, t);
|
|
1296
1318
|
const l = () => {
|
|
1297
1319
|
e && (i && clearTimeout(i), i = null, e.forEach((u) => {
|
|
@@ -1330,7 +1352,7 @@ const mt = (e) => {
|
|
|
1330
1352
|
} finally {
|
|
1331
1353
|
await t.cancel();
|
|
1332
1354
|
}
|
|
1333
|
-
},
|
|
1355
|
+
}, ze = (e, t, n, r) => {
|
|
1334
1356
|
const o = Kn(e, t);
|
|
1335
1357
|
let s = 0, i, l = (p) => {
|
|
1336
1358
|
i || (i = !0, r && r(p));
|
|
@@ -1343,9 +1365,9 @@ const mt = (e) => {
|
|
|
1343
1365
|
l(), p.close();
|
|
1344
1366
|
return;
|
|
1345
1367
|
}
|
|
1346
|
-
let
|
|
1368
|
+
let d = c.byteLength;
|
|
1347
1369
|
if (n) {
|
|
1348
|
-
let g = s +=
|
|
1370
|
+
let g = s += d;
|
|
1349
1371
|
n(g);
|
|
1350
1372
|
}
|
|
1351
1373
|
p.enqueue(new Uint8Array(c));
|
|
@@ -1359,65 +1381,65 @@ const mt = (e) => {
|
|
|
1359
1381
|
}, {
|
|
1360
1382
|
highWaterMark: 2
|
|
1361
1383
|
});
|
|
1362
|
-
}, He = 64 * 1024, { isFunction: oe } = a,
|
|
1384
|
+
}, He = 64 * 1024, { isFunction: oe } = a, Yn = (({ Request: e, Response: t }) => ({
|
|
1363
1385
|
Request: e,
|
|
1364
1386
|
Response: t
|
|
1365
1387
|
}))(a.global), {
|
|
1366
|
-
ReadableStream:
|
|
1367
|
-
TextEncoder:
|
|
1368
|
-
} = a.global,
|
|
1388
|
+
ReadableStream: Me,
|
|
1389
|
+
TextEncoder: qe
|
|
1390
|
+
} = a.global, $e = (e, ...t) => {
|
|
1369
1391
|
try {
|
|
1370
1392
|
return !!e(...t);
|
|
1371
1393
|
} catch {
|
|
1372
1394
|
return !1;
|
|
1373
1395
|
}
|
|
1374
|
-
},
|
|
1396
|
+
}, Gn = (e) => {
|
|
1375
1397
|
e = a.merge.call({
|
|
1376
1398
|
skipUndefined: !0
|
|
1377
|
-
},
|
|
1399
|
+
}, Yn, e);
|
|
1378
1400
|
const { fetch: t, Request: n, Response: r } = e, o = t ? oe(t) : typeof fetch == "function", s = oe(n), i = oe(r);
|
|
1379
1401
|
if (!o)
|
|
1380
1402
|
return !1;
|
|
1381
|
-
const l = o && oe(
|
|
1382
|
-
let
|
|
1383
|
-
const m = new n(
|
|
1384
|
-
body: new
|
|
1403
|
+
const l = o && oe(Me), p = o && (typeof qe == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new qe()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = s && l && $e(() => {
|
|
1404
|
+
let f = !1;
|
|
1405
|
+
const m = new n(N.origin, {
|
|
1406
|
+
body: new Me(),
|
|
1385
1407
|
method: "POST",
|
|
1386
1408
|
get duplex() {
|
|
1387
|
-
return
|
|
1409
|
+
return f = !0, "half";
|
|
1388
1410
|
}
|
|
1389
1411
|
}).headers.has("Content-Type");
|
|
1390
|
-
return
|
|
1391
|
-
}), c = i && l &&
|
|
1392
|
-
stream: c && ((
|
|
1412
|
+
return f && !m;
|
|
1413
|
+
}), c = i && l && $e(() => a.isReadableStream(new r("").body)), d = {
|
|
1414
|
+
stream: c && ((f) => f.body)
|
|
1393
1415
|
};
|
|
1394
|
-
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1395
|
-
!f
|
|
1396
|
-
let w = m && m[
|
|
1416
|
+
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1417
|
+
!d[f] && (d[f] = (m, h) => {
|
|
1418
|
+
let w = m && m[f];
|
|
1397
1419
|
if (w)
|
|
1398
1420
|
return w.call(m);
|
|
1399
|
-
throw new
|
|
1421
|
+
throw new b(`Response type '${f}' is not supported`, b.ERR_NOT_SUPPORT, h);
|
|
1400
1422
|
});
|
|
1401
1423
|
});
|
|
1402
|
-
const g = async (
|
|
1403
|
-
if (
|
|
1424
|
+
const g = async (f) => {
|
|
1425
|
+
if (f == null)
|
|
1404
1426
|
return 0;
|
|
1405
|
-
if (a.isBlob(
|
|
1406
|
-
return
|
|
1407
|
-
if (a.isSpecCompliantForm(
|
|
1408
|
-
return (await new n(
|
|
1427
|
+
if (a.isBlob(f))
|
|
1428
|
+
return f.size;
|
|
1429
|
+
if (a.isSpecCompliantForm(f))
|
|
1430
|
+
return (await new n(N.origin, {
|
|
1409
1431
|
method: "POST",
|
|
1410
|
-
body:
|
|
1432
|
+
body: f
|
|
1411
1433
|
}).arrayBuffer()).byteLength;
|
|
1412
|
-
if (a.isArrayBufferView(
|
|
1413
|
-
return
|
|
1414
|
-
if (a.isURLSearchParams(
|
|
1415
|
-
return (await p(
|
|
1416
|
-
}, E = async (
|
|
1417
|
-
const h = a.toFiniteNumber(
|
|
1434
|
+
if (a.isArrayBufferView(f) || a.isArrayBuffer(f))
|
|
1435
|
+
return f.byteLength;
|
|
1436
|
+
if (a.isURLSearchParams(f) && (f = f + ""), a.isString(f))
|
|
1437
|
+
return (await p(f)).byteLength;
|
|
1438
|
+
}, E = async (f, m) => {
|
|
1439
|
+
const h = a.toFiniteNumber(f.getContentLength());
|
|
1418
1440
|
return h ?? g(m);
|
|
1419
1441
|
};
|
|
1420
|
-
return async (
|
|
1442
|
+
return async (f) => {
|
|
1421
1443
|
let {
|
|
1422
1444
|
url: m,
|
|
1423
1445
|
method: h,
|
|
@@ -1426,84 +1448,84 @@ const mt = (e) => {
|
|
|
1426
1448
|
cancelToken: S,
|
|
1427
1449
|
timeout: x,
|
|
1428
1450
|
onDownloadProgress: T,
|
|
1429
|
-
onUploadProgress:
|
|
1430
|
-
responseType:
|
|
1431
|
-
headers:
|
|
1432
|
-
withCredentials:
|
|
1433
|
-
fetchOptions:
|
|
1434
|
-
} =
|
|
1435
|
-
|
|
1436
|
-
let
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1451
|
+
onUploadProgress: k,
|
|
1452
|
+
responseType: A,
|
|
1453
|
+
headers: Y,
|
|
1454
|
+
withCredentials: W = "same-origin",
|
|
1455
|
+
fetchOptions: ne
|
|
1456
|
+
} = yt(f), F = t || fetch;
|
|
1457
|
+
A = A ? (A + "").toLowerCase() : "text";
|
|
1458
|
+
let P = Jn([C, S && S.toAbortSignal()], x), I = null;
|
|
1459
|
+
const v = P && P.unsubscribe && (() => {
|
|
1460
|
+
P.unsubscribe();
|
|
1439
1461
|
});
|
|
1440
1462
|
let Ae;
|
|
1441
1463
|
try {
|
|
1442
|
-
if (
|
|
1443
|
-
let
|
|
1464
|
+
if (k && u && h !== "get" && h !== "head" && (Ae = await E(Y, w)) !== 0) {
|
|
1465
|
+
let H = new n(m, {
|
|
1444
1466
|
method: "POST",
|
|
1445
1467
|
body: w,
|
|
1446
1468
|
duplex: "half"
|
|
1447
|
-
}),
|
|
1448
|
-
if (a.isFormData(w) && (
|
|
1449
|
-
const [he, re] =
|
|
1469
|
+
}), J;
|
|
1470
|
+
if (a.isFormData(w) && (J = H.headers.get("content-type")) && Y.setContentType(J), H.body) {
|
|
1471
|
+
const [he, re] = je(
|
|
1450
1472
|
Ae,
|
|
1451
|
-
le(
|
|
1473
|
+
le(Ie(k))
|
|
1452
1474
|
);
|
|
1453
|
-
w =
|
|
1475
|
+
w = ze(H.body, He, he, re);
|
|
1454
1476
|
}
|
|
1455
1477
|
}
|
|
1456
|
-
a.isString(
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
signal:
|
|
1478
|
+
a.isString(W) || (W = W ? "include" : "omit");
|
|
1479
|
+
const D = s && "credentials" in n.prototype, ke = {
|
|
1480
|
+
...ne,
|
|
1481
|
+
signal: P,
|
|
1460
1482
|
method: h.toUpperCase(),
|
|
1461
|
-
headers:
|
|
1483
|
+
headers: Y.normalize().toJSON(),
|
|
1462
1484
|
body: w,
|
|
1463
1485
|
duplex: "half",
|
|
1464
|
-
credentials:
|
|
1486
|
+
credentials: D ? W : void 0
|
|
1465
1487
|
};
|
|
1466
|
-
|
|
1467
|
-
let
|
|
1468
|
-
const Fe = c && (
|
|
1469
|
-
if (c && (T || Fe &&
|
|
1470
|
-
const
|
|
1488
|
+
I = s && new n(m, ke);
|
|
1489
|
+
let z = await (s ? F(I, ne) : F(m, ke));
|
|
1490
|
+
const Fe = c && (A === "stream" || A === "response");
|
|
1491
|
+
if (c && (T || Fe && v)) {
|
|
1492
|
+
const H = {};
|
|
1471
1493
|
["status", "statusText", "headers"].forEach((Ne) => {
|
|
1472
|
-
|
|
1494
|
+
H[Ne] = z[Ne];
|
|
1473
1495
|
});
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1476
|
-
le(
|
|
1496
|
+
const J = a.toFiniteNumber(z.headers.get("content-length")), [he, re] = T && je(
|
|
1497
|
+
J,
|
|
1498
|
+
le(Ie(T), !0)
|
|
1477
1499
|
) || [];
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
re && re(),
|
|
1500
|
+
z = new r(
|
|
1501
|
+
ze(z.body, He, he, () => {
|
|
1502
|
+
re && re(), v && v();
|
|
1481
1503
|
}),
|
|
1482
|
-
|
|
1504
|
+
H
|
|
1483
1505
|
);
|
|
1484
1506
|
}
|
|
1485
|
-
|
|
1486
|
-
let
|
|
1487
|
-
return !Fe &&
|
|
1488
|
-
|
|
1489
|
-
data:
|
|
1490
|
-
headers:
|
|
1491
|
-
status:
|
|
1492
|
-
statusText:
|
|
1493
|
-
config:
|
|
1494
|
-
request:
|
|
1507
|
+
A = A || "text";
|
|
1508
|
+
let Rt = await d[a.findKey(d, A) || "text"](z, f);
|
|
1509
|
+
return !Fe && v && v(), await new Promise((H, J) => {
|
|
1510
|
+
ht(H, J, {
|
|
1511
|
+
data: Rt,
|
|
1512
|
+
headers: _.from(z.headers),
|
|
1513
|
+
status: z.status,
|
|
1514
|
+
statusText: z.statusText,
|
|
1515
|
+
config: f,
|
|
1516
|
+
request: I
|
|
1495
1517
|
});
|
|
1496
1518
|
});
|
|
1497
|
-
} catch (
|
|
1498
|
-
throw
|
|
1499
|
-
new
|
|
1519
|
+
} catch (D) {
|
|
1520
|
+
throw v && v(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
|
|
1521
|
+
new b("Network Error", b.ERR_NETWORK, f, I),
|
|
1500
1522
|
{
|
|
1501
|
-
cause:
|
|
1523
|
+
cause: D.cause || D
|
|
1502
1524
|
}
|
|
1503
|
-
) :
|
|
1525
|
+
) : b.from(D, D && D.code, f, I);
|
|
1504
1526
|
}
|
|
1505
1527
|
};
|
|
1506
|
-
}, Qn = /* @__PURE__ */ new Map(),
|
|
1528
|
+
}, Qn = /* @__PURE__ */ new Map(), bt = (e) => {
|
|
1507
1529
|
let t = e && e.env || {};
|
|
1508
1530
|
const { fetch: n, Request: r, Response: o } = t, s = [
|
|
1509
1531
|
r,
|
|
@@ -1512,15 +1534,15 @@ const mt = (e) => {
|
|
|
1512
1534
|
];
|
|
1513
1535
|
let i = s.length, l = i, p, u, c = Qn;
|
|
1514
1536
|
for (; l--; )
|
|
1515
|
-
p = s[l], u = c.get(p), u === void 0 && c.set(p, u = l ? /* @__PURE__ */ new Map() :
|
|
1537
|
+
p = s[l], u = c.get(p), u === void 0 && c.set(p, u = l ? /* @__PURE__ */ new Map() : Gn(t)), c = u;
|
|
1516
1538
|
return u;
|
|
1517
1539
|
};
|
|
1518
|
-
|
|
1540
|
+
bt();
|
|
1519
1541
|
const Oe = {
|
|
1520
1542
|
http: mn,
|
|
1521
1543
|
xhr: Wn,
|
|
1522
1544
|
fetch: {
|
|
1523
|
-
get:
|
|
1545
|
+
get: bt
|
|
1524
1546
|
}
|
|
1525
1547
|
};
|
|
1526
1548
|
a.forEach(Oe, (e, t) => {
|
|
@@ -1532,7 +1554,7 @@ a.forEach(Oe, (e, t) => {
|
|
|
1532
1554
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1533
1555
|
}
|
|
1534
1556
|
});
|
|
1535
|
-
const
|
|
1557
|
+
const We = (e) => `- ${e}`, Zn = (e) => a.isFunction(e) || e === null || e === !1;
|
|
1536
1558
|
function er(e, t) {
|
|
1537
1559
|
e = a.isArray(e) ? e : [e];
|
|
1538
1560
|
const { length: n } = e;
|
|
@@ -1542,7 +1564,7 @@ function er(e, t) {
|
|
|
1542
1564
|
r = e[i];
|
|
1543
1565
|
let l;
|
|
1544
1566
|
if (o = r, !Zn(r) && (o = Oe[(l = String(r)).toLowerCase()], o === void 0))
|
|
1545
|
-
throw new
|
|
1567
|
+
throw new b(`Unknown adapter '${l}'`);
|
|
1546
1568
|
if (o && (a.isFunction(o) || (o = o.get(t))))
|
|
1547
1569
|
break;
|
|
1548
1570
|
s[l || "#" + i] = o;
|
|
@@ -1552,16 +1574,16 @@ function er(e, t) {
|
|
|
1552
1574
|
([p, u]) => `adapter ${p} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1553
1575
|
);
|
|
1554
1576
|
let l = n ? i.length > 1 ? `since :
|
|
1555
|
-
` + i.map(
|
|
1556
|
-
`) : " " +
|
|
1557
|
-
throw new
|
|
1577
|
+
` + i.map(We).join(`
|
|
1578
|
+
`) : " " + We(i[0]) : "as no adapter specified";
|
|
1579
|
+
throw new b(
|
|
1558
1580
|
"There is no suitable adapter to dispatch the request " + l,
|
|
1559
1581
|
"ERR_NOT_SUPPORT"
|
|
1560
1582
|
);
|
|
1561
1583
|
}
|
|
1562
1584
|
return o;
|
|
1563
1585
|
}
|
|
1564
|
-
const
|
|
1586
|
+
const gt = {
|
|
1565
1587
|
/**
|
|
1566
1588
|
* Resolve an adapter from a list of adapter names or functions.
|
|
1567
1589
|
* @type {Function}
|
|
@@ -1575,44 +1597,44 @@ const bt = {
|
|
|
1575
1597
|
};
|
|
1576
1598
|
function be(e) {
|
|
1577
1599
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1578
|
-
throw new
|
|
1600
|
+
throw new X(null, e);
|
|
1579
1601
|
}
|
|
1580
|
-
function
|
|
1581
|
-
return be(e), e.headers =
|
|
1602
|
+
function Je(e) {
|
|
1603
|
+
return be(e), e.headers = _.from(e.headers), e.data = ye.call(
|
|
1582
1604
|
e,
|
|
1583
1605
|
e.transformRequest
|
|
1584
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1606
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || te.adapter, e)(e).then(function(r) {
|
|
1585
1607
|
return be(e), r.data = ye.call(
|
|
1586
1608
|
e,
|
|
1587
1609
|
e.transformResponse,
|
|
1588
1610
|
r
|
|
1589
|
-
), r.headers =
|
|
1611
|
+
), r.headers = _.from(r.headers), r;
|
|
1590
1612
|
}, function(r) {
|
|
1591
|
-
return
|
|
1613
|
+
return pt(r) || (be(e), r && r.response && (r.response.data = ye.call(
|
|
1592
1614
|
e,
|
|
1593
1615
|
e.transformResponse,
|
|
1594
1616
|
r.response
|
|
1595
|
-
), r.response.headers =
|
|
1617
|
+
), r.response.headers = _.from(r.response.headers))), Promise.reject(r);
|
|
1596
1618
|
});
|
|
1597
1619
|
}
|
|
1598
|
-
const
|
|
1620
|
+
const xt = "1.13.2", pe = {};
|
|
1599
1621
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1600
1622
|
pe[e] = function(r) {
|
|
1601
1623
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1602
1624
|
};
|
|
1603
1625
|
});
|
|
1604
|
-
const
|
|
1626
|
+
const Ve = {};
|
|
1605
1627
|
pe.transitional = function(t, n, r) {
|
|
1606
1628
|
function o(s, i) {
|
|
1607
|
-
return "[Axios v" +
|
|
1629
|
+
return "[Axios v" + xt + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
|
|
1608
1630
|
}
|
|
1609
1631
|
return (s, i, l) => {
|
|
1610
1632
|
if (t === !1)
|
|
1611
|
-
throw new
|
|
1633
|
+
throw new b(
|
|
1612
1634
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
1613
|
-
|
|
1635
|
+
b.ERR_DEPRECATED
|
|
1614
1636
|
);
|
|
1615
|
-
return n && !
|
|
1637
|
+
return n && !Ve[i] && (Ve[i] = !0, console.warn(
|
|
1616
1638
|
o(
|
|
1617
1639
|
i,
|
|
1618
1640
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1625,7 +1647,7 @@ pe.spelling = function(t) {
|
|
|
1625
1647
|
};
|
|
1626
1648
|
function tr(e, t, n) {
|
|
1627
1649
|
if (typeof e != "object")
|
|
1628
|
-
throw new
|
|
1650
|
+
throw new b("options must be an object", b.ERR_BAD_OPTION_VALUE);
|
|
1629
1651
|
const r = Object.keys(e);
|
|
1630
1652
|
let o = r.length;
|
|
1631
1653
|
for (; o-- > 0; ) {
|
|
@@ -1633,22 +1655,22 @@ function tr(e, t, n) {
|
|
|
1633
1655
|
if (i) {
|
|
1634
1656
|
const l = e[s], p = l === void 0 || i(l, s, e);
|
|
1635
1657
|
if (p !== !0)
|
|
1636
|
-
throw new
|
|
1658
|
+
throw new b("option " + s + " must be " + p, b.ERR_BAD_OPTION_VALUE);
|
|
1637
1659
|
continue;
|
|
1638
1660
|
}
|
|
1639
1661
|
if (n !== !0)
|
|
1640
|
-
throw new
|
|
1662
|
+
throw new b("Unknown option " + s, b.ERR_BAD_OPTION);
|
|
1641
1663
|
}
|
|
1642
1664
|
}
|
|
1643
1665
|
const ae = {
|
|
1644
1666
|
assertOptions: tr,
|
|
1645
1667
|
validators: pe
|
|
1646
|
-
},
|
|
1647
|
-
let
|
|
1668
|
+
}, j = ae.validators;
|
|
1669
|
+
let q = class {
|
|
1648
1670
|
constructor(t) {
|
|
1649
1671
|
this.defaults = t || {}, this.interceptors = {
|
|
1650
|
-
request: new
|
|
1651
|
-
response: new
|
|
1672
|
+
request: new Be(),
|
|
1673
|
+
response: new Be()
|
|
1652
1674
|
};
|
|
1653
1675
|
}
|
|
1654
1676
|
/**
|
|
@@ -1677,20 +1699,20 @@ let M = class {
|
|
|
1677
1699
|
}
|
|
1678
1700
|
}
|
|
1679
1701
|
_request(t, n) {
|
|
1680
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1702
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = $(this.defaults, n);
|
|
1681
1703
|
const { transitional: r, paramsSerializer: o, headers: s } = n;
|
|
1682
1704
|
r !== void 0 && ae.assertOptions(r, {
|
|
1683
|
-
silentJSONParsing:
|
|
1684
|
-
forcedJSONParsing:
|
|
1685
|
-
clarifyTimeoutError:
|
|
1705
|
+
silentJSONParsing: j.transitional(j.boolean),
|
|
1706
|
+
forcedJSONParsing: j.transitional(j.boolean),
|
|
1707
|
+
clarifyTimeoutError: j.transitional(j.boolean)
|
|
1686
1708
|
}, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
|
|
1687
1709
|
serialize: o
|
|
1688
1710
|
} : ae.assertOptions(o, {
|
|
1689
|
-
encode:
|
|
1690
|
-
serialize:
|
|
1711
|
+
encode: j.function,
|
|
1712
|
+
serialize: j.function
|
|
1691
1713
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ae.assertOptions(n, {
|
|
1692
|
-
baseUrl:
|
|
1693
|
-
withXsrfToken:
|
|
1714
|
+
baseUrl: j.spelling("baseURL"),
|
|
1715
|
+
withXsrfToken: j.spelling("withXSRFToken")
|
|
1694
1716
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1695
1717
|
let i = s && a.merge(
|
|
1696
1718
|
s.common,
|
|
@@ -1698,10 +1720,10 @@ let M = class {
|
|
|
1698
1720
|
);
|
|
1699
1721
|
s && a.forEach(
|
|
1700
1722
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1701
|
-
(
|
|
1702
|
-
delete s[
|
|
1723
|
+
(f) => {
|
|
1724
|
+
delete s[f];
|
|
1703
1725
|
}
|
|
1704
|
-
), n.headers =
|
|
1726
|
+
), n.headers = _.concat(i, s);
|
|
1705
1727
|
const l = [];
|
|
1706
1728
|
let p = !0;
|
|
1707
1729
|
this.interceptors.request.forEach(function(m) {
|
|
@@ -1711,42 +1733,42 @@ let M = class {
|
|
|
1711
1733
|
this.interceptors.response.forEach(function(m) {
|
|
1712
1734
|
u.push(m.fulfilled, m.rejected);
|
|
1713
1735
|
});
|
|
1714
|
-
let c,
|
|
1736
|
+
let c, d = 0, g;
|
|
1715
1737
|
if (!p) {
|
|
1716
|
-
const
|
|
1717
|
-
for (
|
|
1718
|
-
c = c.then(d
|
|
1738
|
+
const f = [Je.bind(this), void 0];
|
|
1739
|
+
for (f.unshift(...l), f.push(...u), g = f.length, c = Promise.resolve(n); d < g; )
|
|
1740
|
+
c = c.then(f[d++], f[d++]);
|
|
1719
1741
|
return c;
|
|
1720
1742
|
}
|
|
1721
1743
|
g = l.length;
|
|
1722
1744
|
let E = n;
|
|
1723
|
-
for (;
|
|
1724
|
-
const
|
|
1745
|
+
for (; d < g; ) {
|
|
1746
|
+
const f = l[d++], m = l[d++];
|
|
1725
1747
|
try {
|
|
1726
|
-
E =
|
|
1748
|
+
E = f(E);
|
|
1727
1749
|
} catch (h) {
|
|
1728
1750
|
m.call(this, h);
|
|
1729
1751
|
break;
|
|
1730
1752
|
}
|
|
1731
1753
|
}
|
|
1732
1754
|
try {
|
|
1733
|
-
c =
|
|
1734
|
-
} catch (
|
|
1735
|
-
return Promise.reject(
|
|
1755
|
+
c = Je.call(this, E);
|
|
1756
|
+
} catch (f) {
|
|
1757
|
+
return Promise.reject(f);
|
|
1736
1758
|
}
|
|
1737
|
-
for (
|
|
1738
|
-
c = c.then(u[
|
|
1759
|
+
for (d = 0, g = u.length; d < g; )
|
|
1760
|
+
c = c.then(u[d++], u[d++]);
|
|
1739
1761
|
return c;
|
|
1740
1762
|
}
|
|
1741
1763
|
getUri(t) {
|
|
1742
|
-
t =
|
|
1743
|
-
const n =
|
|
1744
|
-
return
|
|
1764
|
+
t = $(this.defaults, t);
|
|
1765
|
+
const n = mt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1766
|
+
return ut(n, t.params, t.paramsSerializer);
|
|
1745
1767
|
}
|
|
1746
1768
|
};
|
|
1747
1769
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1748
|
-
|
|
1749
|
-
return this.request(
|
|
1770
|
+
q.prototype[t] = function(n, r) {
|
|
1771
|
+
return this.request($(r || {}, {
|
|
1750
1772
|
method: t,
|
|
1751
1773
|
url: n,
|
|
1752
1774
|
data: (r || {}).data
|
|
@@ -1756,7 +1778,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1756
1778
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1757
1779
|
function n(r) {
|
|
1758
1780
|
return function(s, i, l) {
|
|
1759
|
-
return this.request(
|
|
1781
|
+
return this.request($(l || {}, {
|
|
1760
1782
|
method: t,
|
|
1761
1783
|
headers: r ? {
|
|
1762
1784
|
"Content-Type": "multipart/form-data"
|
|
@@ -1766,9 +1788,9 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1766
1788
|
}));
|
|
1767
1789
|
};
|
|
1768
1790
|
}
|
|
1769
|
-
|
|
1791
|
+
q.prototype[t] = n(), q.prototype[t + "Form"] = n(!0);
|
|
1770
1792
|
});
|
|
1771
|
-
let nr = class
|
|
1793
|
+
let nr = class wt {
|
|
1772
1794
|
constructor(t) {
|
|
1773
1795
|
if (typeof t != "function")
|
|
1774
1796
|
throw new TypeError("executor must be a function.");
|
|
@@ -1792,7 +1814,7 @@ let nr = class xt {
|
|
|
1792
1814
|
r.unsubscribe(s);
|
|
1793
1815
|
}, i;
|
|
1794
1816
|
}, t(function(s, i, l) {
|
|
1795
|
-
r.reason || (r.reason = new
|
|
1817
|
+
r.reason || (r.reason = new X(s, i, l), n(r.reason));
|
|
1796
1818
|
});
|
|
1797
1819
|
}
|
|
1798
1820
|
/**
|
|
@@ -1834,7 +1856,7 @@ let nr = class xt {
|
|
|
1834
1856
|
static source() {
|
|
1835
1857
|
let t;
|
|
1836
1858
|
return {
|
|
1837
|
-
token: new
|
|
1859
|
+
token: new wt(function(o) {
|
|
1838
1860
|
t = o;
|
|
1839
1861
|
}),
|
|
1840
1862
|
cancel: t
|
|
@@ -1923,30 +1945,30 @@ const Se = {
|
|
|
1923
1945
|
Object.entries(Se).forEach(([e, t]) => {
|
|
1924
1946
|
Se[t] = e;
|
|
1925
1947
|
});
|
|
1926
|
-
function
|
|
1927
|
-
const t = new
|
|
1928
|
-
return a.extend(n,
|
|
1929
|
-
return
|
|
1948
|
+
function St(e) {
|
|
1949
|
+
const t = new q(e), n = Qe(q.prototype.request, t);
|
|
1950
|
+
return a.extend(n, q.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
1951
|
+
return St($(e, o));
|
|
1930
1952
|
}, n;
|
|
1931
1953
|
}
|
|
1932
|
-
const R =
|
|
1933
|
-
R.Axios =
|
|
1934
|
-
R.CanceledError =
|
|
1954
|
+
const R = St(te);
|
|
1955
|
+
R.Axios = q;
|
|
1956
|
+
R.CanceledError = X;
|
|
1935
1957
|
R.CancelToken = nr;
|
|
1936
|
-
R.isCancel =
|
|
1937
|
-
R.VERSION =
|
|
1958
|
+
R.isCancel = pt;
|
|
1959
|
+
R.VERSION = xt;
|
|
1938
1960
|
R.toFormData = fe;
|
|
1939
|
-
R.AxiosError =
|
|
1961
|
+
R.AxiosError = b;
|
|
1940
1962
|
R.Cancel = R.CanceledError;
|
|
1941
1963
|
R.all = function(t) {
|
|
1942
1964
|
return Promise.all(t);
|
|
1943
1965
|
};
|
|
1944
1966
|
R.spread = rr;
|
|
1945
1967
|
R.isAxiosError = or;
|
|
1946
|
-
R.mergeConfig =
|
|
1947
|
-
R.AxiosHeaders =
|
|
1948
|
-
R.formToJSON = (e) =>
|
|
1949
|
-
R.getAdapter =
|
|
1968
|
+
R.mergeConfig = $;
|
|
1969
|
+
R.AxiosHeaders = _;
|
|
1970
|
+
R.formToJSON = (e) => ft(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1971
|
+
R.getAdapter = gt.getAdapter;
|
|
1950
1972
|
R.HttpStatusCode = Se;
|
|
1951
1973
|
R.default = R;
|
|
1952
1974
|
const {
|
|
@@ -1966,7 +1988,7 @@ const {
|
|
|
1966
1988
|
formToJSON: Or,
|
|
1967
1989
|
getAdapter: Ar,
|
|
1968
1990
|
mergeConfig: kr
|
|
1969
|
-
} = R,
|
|
1991
|
+
} = R, Et = async (e, t, n, r) => {
|
|
1970
1992
|
const o = {
|
|
1971
1993
|
chatInput: e,
|
|
1972
1994
|
sessionId: t,
|
|
@@ -1975,7 +1997,7 @@ const {
|
|
|
1975
1997
|
}
|
|
1976
1998
|
};
|
|
1977
1999
|
try {
|
|
1978
|
-
|
|
2000
|
+
const s = await R.post(
|
|
1979
2001
|
r,
|
|
1980
2002
|
o,
|
|
1981
2003
|
{
|
|
@@ -1983,30 +2005,33 @@ const {
|
|
|
1983
2005
|
"Content-Type": "application/json"
|
|
1984
2006
|
}
|
|
1985
2007
|
}
|
|
1986
|
-
)
|
|
2008
|
+
), i = s.data.response;
|
|
2009
|
+
return console.log("API response:", s), i;
|
|
1987
2010
|
} catch (s) {
|
|
1988
2011
|
throw console.error("Error communicating with chat API:", s), s;
|
|
1989
2012
|
}
|
|
1990
2013
|
}, sr = ({ handleMessageFromForm: e, theme: t, chatBotData: n }) => {
|
|
1991
|
-
const [r, o] =
|
|
2014
|
+
const [r, o] = L(""), [s, i] = L(""), [l, p] = L(""), [u, c] = L(!1), d = async (x) => {
|
|
1992
2015
|
if (x.preventDefault(), c(!0), p(""), !r.trim() || !s.trim()) {
|
|
1993
2016
|
p("Name and email are required"), c(!1);
|
|
1994
2017
|
return;
|
|
1995
2018
|
}
|
|
1996
2019
|
const T = `Hi, I am ${r} and my email is ${s}`;
|
|
1997
2020
|
try {
|
|
1998
|
-
const
|
|
2021
|
+
const k = await Et(
|
|
1999
2022
|
T,
|
|
2000
2023
|
n.sessionId,
|
|
2001
2024
|
n.pineconeNamespace,
|
|
2002
2025
|
n.url
|
|
2003
|
-
)
|
|
2026
|
+
);
|
|
2027
|
+
console.log("metaData from user form:", k);
|
|
2028
|
+
const A = k.output;
|
|
2004
2029
|
e([
|
|
2005
2030
|
{ type: "user", text: T },
|
|
2006
|
-
{ type: "bot", text:
|
|
2031
|
+
{ type: "bot", text: A }
|
|
2007
2032
|
]);
|
|
2008
|
-
} catch (
|
|
2009
|
-
console.log("error sending user details",
|
|
2033
|
+
} catch (k) {
|
|
2034
|
+
console.log("error sending user details", k), p("Failed to submit. Please try again.");
|
|
2010
2035
|
} finally {
|
|
2011
2036
|
c(!1);
|
|
2012
2037
|
}
|
|
@@ -2020,7 +2045,7 @@ const {
|
|
|
2020
2045
|
display: "flex",
|
|
2021
2046
|
flexDirection: "column",
|
|
2022
2047
|
gap: "24px"
|
|
2023
|
-
},
|
|
2048
|
+
}, f = {
|
|
2024
2049
|
fontSize: "14px",
|
|
2025
2050
|
fontWeight: "500",
|
|
2026
2051
|
color: t.fontColor,
|
|
@@ -2061,8 +2086,8 @@ const {
|
|
|
2061
2086
|
marginTop: "80px",
|
|
2062
2087
|
transition: "all 0.2s ease"
|
|
2063
2088
|
};
|
|
2064
|
-
return /* @__PURE__ */
|
|
2065
|
-
l && /* @__PURE__ */
|
|
2089
|
+
return /* @__PURE__ */ y("div", { style: g, children: /* @__PURE__ */ O("form", { onSubmit: d, style: E, children: [
|
|
2090
|
+
l && /* @__PURE__ */ y("div", { style: {
|
|
2066
2091
|
backgroundColor: "#fee2e2",
|
|
2067
2092
|
color: "#713f12",
|
|
2068
2093
|
padding: "8px 12px",
|
|
@@ -2071,11 +2096,11 @@ const {
|
|
|
2071
2096
|
textAlign: "center",
|
|
2072
2097
|
fontWeight: "500"
|
|
2073
2098
|
}, role: "alert", children: l }),
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2078
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ y("p", { style: f, children: n.welcomeText }),
|
|
2100
|
+
/* @__PURE__ */ O("div", { style: m, children: [
|
|
2101
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2102
|
+
/* @__PURE__ */ y("label", { style: h, children: "Full Name" }),
|
|
2103
|
+
/* @__PURE__ */ y(
|
|
2079
2104
|
"input",
|
|
2080
2105
|
{
|
|
2081
2106
|
type: "text",
|
|
@@ -2089,9 +2114,9 @@ const {
|
|
|
2089
2114
|
}
|
|
2090
2115
|
)
|
|
2091
2116
|
] }),
|
|
2092
|
-
/* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2117
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2118
|
+
/* @__PURE__ */ y("label", { style: h, children: "Email Address" }),
|
|
2119
|
+
/* @__PURE__ */ y(
|
|
2095
2120
|
"input",
|
|
2096
2121
|
{
|
|
2097
2122
|
type: "email",
|
|
@@ -2106,7 +2131,7 @@ const {
|
|
|
2106
2131
|
)
|
|
2107
2132
|
] })
|
|
2108
2133
|
] }),
|
|
2109
|
-
/* @__PURE__ */
|
|
2134
|
+
/* @__PURE__ */ y(
|
|
2110
2135
|
"button",
|
|
2111
2136
|
{
|
|
2112
2137
|
type: "submit",
|
|
@@ -2118,15 +2143,15 @@ const {
|
|
|
2118
2143
|
onMouseLeave: (x) => {
|
|
2119
2144
|
x.currentTarget.style.transform = "translateY(0)", x.currentTarget.style.boxShadow = "none";
|
|
2120
2145
|
},
|
|
2121
|
-
children: u ? "Submitting..." : /* @__PURE__ */
|
|
2122
|
-
/* @__PURE__ */
|
|
2146
|
+
children: u ? "Submitting..." : /* @__PURE__ */ O(Ee, { children: [
|
|
2147
|
+
/* @__PURE__ */ y(Ge, { size: 18 }),
|
|
2123
2148
|
"Submit"
|
|
2124
2149
|
] })
|
|
2125
2150
|
}
|
|
2126
2151
|
)
|
|
2127
2152
|
] }) });
|
|
2128
2153
|
}, ir = ({ onClose: e, theme: t, chatBotData: n }) => {
|
|
2129
|
-
const [r, o] =
|
|
2154
|
+
const [r, o] = L([]), [s, i] = L(!1), [l, p] = L(!1), [u, c] = L(null), g = {
|
|
2130
2155
|
position: "fixed",
|
|
2131
2156
|
bottom: "112px",
|
|
2132
2157
|
// 28 + 84 (button height)
|
|
@@ -2145,7 +2170,7 @@ const {
|
|
|
2145
2170
|
flexDirection: "column",
|
|
2146
2171
|
overflow: "hidden",
|
|
2147
2172
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
2148
|
-
},
|
|
2173
|
+
}, E = {
|
|
2149
2174
|
padding: "16px 20px",
|
|
2150
2175
|
background: `linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,
|
|
2151
2176
|
color: t.fontColor,
|
|
@@ -2154,9 +2179,9 @@ const {
|
|
|
2154
2179
|
alignItems: "center",
|
|
2155
2180
|
justifyContent: "space-between",
|
|
2156
2181
|
boxShadow: "0 4px 6px -1px rgba(0,0,0,0.1)"
|
|
2157
|
-
},
|
|
2182
|
+
}, f = {
|
|
2158
2183
|
position: "relative"
|
|
2159
|
-
},
|
|
2184
|
+
}, m = {
|
|
2160
2185
|
width: "44px",
|
|
2161
2186
|
height: "44px",
|
|
2162
2187
|
borderRadius: "50%",
|
|
@@ -2164,7 +2189,7 @@ const {
|
|
|
2164
2189
|
display: "flex",
|
|
2165
2190
|
alignItems: "center",
|
|
2166
2191
|
justifyContent: "center"
|
|
2167
|
-
},
|
|
2192
|
+
}, h = {
|
|
2168
2193
|
position: "absolute",
|
|
2169
2194
|
bottom: 0,
|
|
2170
2195
|
right: 0,
|
|
@@ -2173,96 +2198,99 @@ const {
|
|
|
2173
2198
|
backgroundColor: "#34d399",
|
|
2174
2199
|
borderRadius: "50%",
|
|
2175
2200
|
border: "3px solid white"
|
|
2176
|
-
},
|
|
2201
|
+
}, w = {
|
|
2177
2202
|
fontSize: "18px",
|
|
2178
2203
|
fontWeight: "600",
|
|
2179
2204
|
margin: 0,
|
|
2180
2205
|
lineHeight: "1.2"
|
|
2181
|
-
},
|
|
2206
|
+
}, C = {
|
|
2182
2207
|
fontSize: "12px",
|
|
2183
2208
|
opacity: 0.9,
|
|
2184
2209
|
margin: 0,
|
|
2185
2210
|
lineHeight: "1.3"
|
|
2186
|
-
},
|
|
2211
|
+
}, S = {
|
|
2187
2212
|
padding: "8px",
|
|
2188
2213
|
borderRadius: "50%",
|
|
2189
2214
|
background: "transparent",
|
|
2190
2215
|
border: "none",
|
|
2191
2216
|
cursor: "pointer",
|
|
2192
2217
|
transition: "background 0.2s"
|
|
2193
|
-
},
|
|
2218
|
+
}, x = {
|
|
2194
2219
|
padding: "12px 20px",
|
|
2195
2220
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
2196
2221
|
background: t.backgroundColor,
|
|
2197
2222
|
textAlign: "center"
|
|
2198
|
-
},
|
|
2223
|
+
}, T = {
|
|
2199
2224
|
fontSize: "11px",
|
|
2200
2225
|
color: t.fontColor,
|
|
2201
2226
|
letterSpacing: "0.5px"
|
|
2202
|
-
},
|
|
2227
|
+
}, k = {
|
|
2203
2228
|
fontWeight: "600"
|
|
2204
|
-
},
|
|
2205
|
-
|
|
2206
|
-
},
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2229
|
+
}, A = (F, P) => {
|
|
2230
|
+
F.currentTarget.style.background = P ? "rgba(255,255,255,0.2)" : "transparent";
|
|
2231
|
+
}, Y = (F) => F ? new Date(F).toLocaleTimeString("en-AU", {
|
|
2232
|
+
hour: "2-digit",
|
|
2233
|
+
minute: "2-digit"
|
|
2234
|
+
}) : "", W = (F) => {
|
|
2235
|
+
o(F), p(!0);
|
|
2236
|
+
}, ne = async (F) => {
|
|
2237
|
+
i(!0), o((P) => [...P, { type: "user", text: F }]);
|
|
2210
2238
|
try {
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2239
|
+
const P = await Et(
|
|
2240
|
+
F,
|
|
2213
2241
|
n.sessionId,
|
|
2214
2242
|
n.pineconeNamespace,
|
|
2215
2243
|
n.url
|
|
2216
|
-
)
|
|
2217
|
-
o((
|
|
2218
|
-
} catch (
|
|
2219
|
-
console.error("Chat error:",
|
|
2220
|
-
|
|
2244
|
+
), I = P.output;
|
|
2245
|
+
c(Y(P.response_timestamp)), o((v) => [...v, { type: "bot", text: I }]);
|
|
2246
|
+
} catch (P) {
|
|
2247
|
+
console.error("Chat error:", P), o((I) => [
|
|
2248
|
+
...I,
|
|
2221
2249
|
{ type: "bot", text: "Sorry, something went wrong." }
|
|
2222
2250
|
]);
|
|
2223
2251
|
} finally {
|
|
2224
2252
|
i(!1);
|
|
2225
2253
|
}
|
|
2226
2254
|
};
|
|
2227
|
-
return /* @__PURE__ */
|
|
2228
|
-
/* @__PURE__ */
|
|
2229
|
-
/* @__PURE__ */
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2255
|
+
return /* @__PURE__ */ O("div", { style: g, children: [
|
|
2256
|
+
/* @__PURE__ */ O("div", { style: E, children: [
|
|
2257
|
+
/* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
2258
|
+
/* @__PURE__ */ O("div", { style: f, children: [
|
|
2259
|
+
/* @__PURE__ */ y("div", { style: m, children: /* @__PURE__ */ y(Ye, { size: 22 }) }),
|
|
2260
|
+
/* @__PURE__ */ y("span", { style: h })
|
|
2233
2261
|
] }),
|
|
2234
|
-
/* @__PURE__ */
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2262
|
+
/* @__PURE__ */ O("div", { children: [
|
|
2263
|
+
/* @__PURE__ */ y("h3", { style: w, children: n.name }),
|
|
2264
|
+
/* @__PURE__ */ y("p", { style: C, children: n.subTitle })
|
|
2237
2265
|
] })
|
|
2238
2266
|
] }),
|
|
2239
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ y(
|
|
2240
2268
|
"button",
|
|
2241
2269
|
{
|
|
2242
2270
|
onClick: e,
|
|
2243
2271
|
"aria-label": "Close chat",
|
|
2244
|
-
style:
|
|
2245
|
-
onMouseEnter: (
|
|
2246
|
-
onMouseLeave: (
|
|
2247
|
-
children: /* @__PURE__ */
|
|
2272
|
+
style: S,
|
|
2273
|
+
onMouseEnter: (F) => A(F, !0),
|
|
2274
|
+
onMouseLeave: (F) => A(F, !1),
|
|
2275
|
+
children: /* @__PURE__ */ y(Xe, { size: 20 })
|
|
2248
2276
|
}
|
|
2249
2277
|
)
|
|
2250
2278
|
] }),
|
|
2251
|
-
l ? /* @__PURE__ */
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2254
|
-
] }) : /* @__PURE__ */
|
|
2279
|
+
l ? /* @__PURE__ */ O(Ee, { children: [
|
|
2280
|
+
/* @__PURE__ */ y(kt, { messages: r, isLoading: s, theme: t, botResponseTime: u }),
|
|
2281
|
+
/* @__PURE__ */ y(At, { onSendMessage: ne, isLoading: s, theme: t })
|
|
2282
|
+
] }) : /* @__PURE__ */ y(
|
|
2255
2283
|
sr,
|
|
2256
2284
|
{
|
|
2257
|
-
handleMessageFromForm:
|
|
2285
|
+
handleMessageFromForm: W,
|
|
2258
2286
|
theme: t,
|
|
2259
2287
|
chatBotData: n
|
|
2260
2288
|
}
|
|
2261
2289
|
),
|
|
2262
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ y("div", { style: x, children: /* @__PURE__ */ O("p", { style: T, children: [
|
|
2263
2291
|
"powered by",
|
|
2264
2292
|
" ",
|
|
2265
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ y("span", { style: k, children: "clone67.com" })
|
|
2266
2294
|
] }) })
|
|
2267
2295
|
] });
|
|
2268
2296
|
}, Fr = ({
|
|
@@ -2278,11 +2306,11 @@ const {
|
|
|
2278
2306
|
subTitle: u = "Typically replies instantly",
|
|
2279
2307
|
welcomeText: c = "Hi! How can I help you today?"
|
|
2280
2308
|
}) => {
|
|
2281
|
-
const [
|
|
2282
|
-
|
|
2283
|
-
|
|
2309
|
+
const [d, g] = L(!1), [E, f] = L("");
|
|
2310
|
+
Ke(() => {
|
|
2311
|
+
f(Tt());
|
|
2284
2312
|
}, []);
|
|
2285
|
-
const m = () => g((
|
|
2313
|
+
const m = () => g((k) => !k), h = {
|
|
2286
2314
|
primaryColor: n,
|
|
2287
2315
|
secondaryColor: r,
|
|
2288
2316
|
backgroundColor: o,
|
|
@@ -2312,8 +2340,8 @@ const {
|
|
|
2312
2340
|
zIndex: 1e4,
|
|
2313
2341
|
pointerEvents: "auto"
|
|
2314
2342
|
};
|
|
2315
|
-
return /* @__PURE__ */
|
|
2316
|
-
|
|
2343
|
+
return /* @__PURE__ */ O(Ee, { children: [
|
|
2344
|
+
d && /* @__PURE__ */ y("div", { style: x, children: /* @__PURE__ */ y(
|
|
2317
2345
|
ir,
|
|
2318
2346
|
{
|
|
2319
2347
|
onClose: m,
|
|
@@ -2321,11 +2349,11 @@ const {
|
|
|
2321
2349
|
chatBotData: w
|
|
2322
2350
|
}
|
|
2323
2351
|
) }),
|
|
2324
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ y("div", { style: T, children: /* @__PURE__ */ y(
|
|
2325
2353
|
Ot,
|
|
2326
2354
|
{
|
|
2327
2355
|
onClick: m,
|
|
2328
|
-
isOpen:
|
|
2356
|
+
isOpen: d,
|
|
2329
2357
|
theme: h,
|
|
2330
2358
|
chatBotData: w
|
|
2331
2359
|
}
|