virtual-human-cf 1.2.0 → 1.4.0

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as H, ref as g, watch as C, onMounted as E, onUnmounted as _, openBlock as A, createBlock as B, Transition as W, withCtx as $, createElementBlock as R, normalizeStyle as F, normalizeClass as N, createElementVNode as U, createCommentVNode as T, renderSlot as q } from "vue";
2
- const M = ["src", "muted"], z = /* @__PURE__ */ H({
1
+ import { defineComponent as Ze, ref as Q, watch as ne, onMounted as Ye, onUnmounted as et, openBlock as Fe, createBlock as At, Transition as Tt, withCtx as Ct, createElementBlock as Pt, normalizeStyle as xt, normalizeClass as _t, createElementVNode as ve, createCommentVNode as Nt, renderSlot as Ut } from "vue";
2
+ const kt = ["src", "muted"], Ft = /* @__PURE__ */ Ze({
3
3
  __name: "VirtualHumanPersona",
4
4
  props: {
5
5
  // 视频源URL
@@ -49,88 +49,1982 @@ const M = ["src", "muted"], z = /* @__PURE__ */ H({
49
49
  }
50
50
  },
51
51
  emits: ["update:isPlaying", "ended", "update:visible"],
52
- setup(r, { emit: b }) {
53
- const e = r, n = b, a = g(null), h = g(null), t = g(null), d = g(!1), f = () => {
54
- if (t.value && t.value.close(), !(!e.wsUrl || !e.screenClientId))
52
+ setup(e, { emit: t }) {
53
+ const n = e, r = t, s = Q(null), i = Q(null), o = Q(null), a = Q(!1), d = () => {
54
+ if (o.value && o.value.close(), !(!n.wsUrl || !n.screenClientId))
55
55
  try {
56
- const i = new URL(e.wsUrl);
57
- i.searchParams.append("sessionId", e.screenClientId + "-persona"), t.value = new WebSocket(i.toString()), t.value.onopen = () => {
58
- d.value = !0, console.log(`[VirtualHumanPersona] Connected to ${e.wsUrl} for session ${e.screenClientId}-persona`);
59
- }, t.value.onmessage = (u) => {
56
+ const g = new URL(n.wsUrl);
57
+ g.searchParams.append("sessionId", n.screenClientId + "-persona"), o.value = new WebSocket(g.toString()), o.value.onopen = () => {
58
+ a.value = !0, console.log(`[VirtualHumanPersona] Connected to ${n.wsUrl} for session ${n.screenClientId}-persona`);
59
+ }, o.value.onmessage = (c) => {
60
60
  try {
61
- const c = JSON.parse(u.data);
62
- m(c);
63
- } catch (c) {
64
- console.error("[VirtualHumanPersona] Failed to parse message:", u.data, c);
61
+ const p = JSON.parse(c.data);
62
+ f(p);
63
+ } catch (p) {
64
+ console.error("[VirtualHumanPersona] Failed to parse message:", c.data, p);
65
65
  }
66
- }, t.value.onerror = (u) => {
67
- console.error("[VirtualHumanPersona] WebSocket error:", u);
68
- }, t.value.onclose = () => {
69
- d.value = !1, console.log("[VirtualHumanPersona] WebSocket disconnected");
66
+ }, o.value.onerror = (c) => {
67
+ console.error("[VirtualHumanPersona] WebSocket error:", c);
68
+ }, o.value.onclose = () => {
69
+ a.value = !1, console.log("[VirtualHumanPersona] WebSocket disconnected");
70
70
  };
71
- } catch (i) {
72
- console.error("[VirtualHumanPersona] Failed to initialize WebSocket:", i);
71
+ } catch (g) {
72
+ console.error("[VirtualHumanPersona] Failed to initialize WebSocket:", g);
73
73
  }
74
- }, m = (i) => {
75
- const { type: u, action: c } = i;
76
- u === "control" && (c === "play" || c === "resume" ? (n("update:isPlaying", !0), n("update:visible", !0)) : c === "pause" ? (n("update:isPlaying", !1), n("update:visible", !0)) : c === "stop" && (n("update:isPlaying", !1), n("update:visible", !1), a.value && (a.value.currentTime = 0)));
74
+ }, f = (g) => {
75
+ const { type: c, action: p } = g;
76
+ c === "control" && (p === "play" || p === "resume" ? (r("update:isPlaying", !0), r("update:visible", !0)) : p === "pause" ? (s.value && s.value.pause(), r("update:isPlaying", !1), r("update:visible", !0)) : p === "stop" && (r("update:isPlaying", !1), r("update:visible", !1), s.value && (s.value.currentTime = 0)));
77
77
  };
78
- C(() => e.screenClientId, () => {
79
- e.screenClientId && e.wsUrl && f();
80
- }), C(() => e.wsUrl, () => {
81
- e.screenClientId && e.wsUrl && f();
82
- }), C(() => e.isPlaying, (i) => {
83
- a.value && (i ? a.value.play().catch((u) => console.error("Video play failed:", u)) : a.value.pause());
78
+ ne(() => n.screenClientId, () => {
79
+ n.screenClientId && n.wsUrl && d();
80
+ }), ne(() => n.wsUrl, () => {
81
+ n.screenClientId && n.wsUrl && d();
82
+ }), ne(() => n.isPlaying, (g) => {
83
+ s.value && (g ? s.value.play().catch((c) => console.error("Video play failed:", c)) : s.value.pause());
84
84
  });
85
- const v = () => {
86
- e.isPlaying || n("update:isPlaying", !0);
87
- }, S = () => {
88
- e.isPlaying && n("update:isPlaying", !1);
89
- }, k = () => {
90
- n("update:isPlaying", !1), n("ended");
85
+ const u = () => {
86
+ n.isPlaying || r("update:isPlaying", !0);
87
+ }, m = () => {
88
+ n.isPlaying && r("update:isPlaying", !1);
89
+ }, w = () => {
90
+ r("update:isPlaying", !1), r("ended");
91
91
  };
92
- return E(() => {
93
- e.isPlaying && a.value && a.value.play().catch((i) => console.error("Video play failed:", i)), e.screenClientId && e.wsUrl && f();
94
- }), _(() => {
95
- t.value && t.value.close();
96
- }), (i, u) => (A(), B(W, { name: "fade" }, {
97
- default: $(() => [
98
- r.visible ? (A(), R("div", {
92
+ return Ye(() => {
93
+ n.isPlaying && s.value && s.value.play().catch((g) => console.error("Video play failed:", g)), n.screenClientId && n.wsUrl && d();
94
+ }), et(() => {
95
+ o.value && o.value.close();
96
+ }), (g, c) => (Fe(), At(Tt, { name: "fade" }, {
97
+ default: Ct(() => [
98
+ e.visible ? (Fe(), Pt("div", {
99
99
  key: 0,
100
- class: N(["virtual-human-container", { "is-dark": r.isDark }]),
101
- style: F(r.styles)
100
+ class: _t(["virtual-human-container", { "is-dark": e.isDark }]),
101
+ style: xt(e.styles)
102
102
  }, [
103
- U("div", {
103
+ ve("div", {
104
104
  class: "video-wrapper",
105
105
  ref_key: "wrapperRef",
106
- ref: h
106
+ ref: i
107
107
  }, [
108
- U("video", {
108
+ ve("video", {
109
109
  ref_key: "videoRef",
110
- ref: a,
111
- src: r.videoSrc,
110
+ ref: s,
111
+ src: e.videoSrc,
112
112
  class: "persona-video",
113
- muted: r.muted,
113
+ muted: e.muted,
114
114
  playsinline: "",
115
115
  loop: "",
116
116
  autoPlay: "",
117
117
  disablePictureInPicture: "",
118
- onPlay: v,
119
- onPause: S,
120
- onEnded: k
121
- }, null, 40, M)
118
+ onPlay: u,
119
+ onPause: m,
120
+ onEnded: w
121
+ }, null, 40, kt)
122
122
  ], 512)
123
- ], 6)) : T("", !0)
123
+ ], 6)) : Nt("", !0)
124
124
  ]),
125
125
  _: 1
126
126
  }));
127
127
  }
128
- }), D = (r, b) => {
129
- const e = r.__vccOpts || r;
130
- for (const [n, a] of b)
131
- e[n] = a;
128
+ }), vt = (e, t) => {
129
+ const n = e.__vccOpts || e;
130
+ for (const [r, s] of t)
131
+ n[r] = s;
132
+ return n;
133
+ }, Bt = /* @__PURE__ */ vt(Ft, [["__scopeId", "data-v-02ec3645"]]);
134
+ function tt(e, t) {
135
+ return function() {
136
+ return e.apply(t, arguments);
137
+ };
138
+ }
139
+ const { toString: It } = Object.prototype, { getPrototypeOf: xe } = Object, { iterator: he, toStringTag: nt } = Symbol, me = /* @__PURE__ */ ((e) => (t) => {
140
+ const n = It.call(t);
141
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
142
+ })(/* @__PURE__ */ Object.create(null)), I = (e) => (e = e.toLowerCase(), (t) => me(t) === e), ye = (e) => (t) => typeof t === e, { isArray: Y } = Array, Z = ye("undefined");
143
+ function re(e) {
144
+ return e !== null && !Z(e) && e.constructor !== null && !Z(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
145
+ }
146
+ const rt = I("ArrayBuffer");
147
+ function Lt(e) {
148
+ let t;
149
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && rt(e.buffer), t;
150
+ }
151
+ const Dt = ye("string"), N = ye("function"), st = ye("number"), se = (e) => e !== null && typeof e == "object", jt = (e) => e === !0 || e === !1, ue = (e) => {
152
+ if (me(e) !== "object")
153
+ return !1;
154
+ const t = xe(e);
155
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(nt in e) && !(he in e);
156
+ }, Ht = (e) => {
157
+ if (!se(e) || re(e))
158
+ return !1;
159
+ try {
160
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
161
+ } catch {
162
+ return !1;
163
+ }
164
+ }, qt = I("Date"), Mt = I("File"), $t = (e) => !!(e && typeof e.uri < "u"), Vt = (e) => e && typeof e.getParts < "u", zt = I("Blob"), Wt = I("FileList"), Jt = (e) => se(e) && N(e.pipe);
165
+ function Kt() {
166
+ return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
167
+ }
168
+ const Be = Kt(), Ie = typeof Be.FormData < "u" ? Be.FormData : void 0, Xt = (e) => {
169
+ let t;
170
+ return e && (Ie && e instanceof Ie || N(e.append) && ((t = me(e)) === "formdata" || // detect form-data instance
171
+ t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
172
+ }, Gt = I("URLSearchParams"), [Qt, Zt, Yt, en] = [
173
+ "ReadableStream",
174
+ "Request",
175
+ "Response",
176
+ "Headers"
177
+ ].map(I), tn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
178
+ function oe(e, t, { allOwnKeys: n = !1 } = {}) {
179
+ if (e === null || typeof e > "u")
180
+ return;
181
+ let r, s;
182
+ if (typeof e != "object" && (e = [e]), Y(e))
183
+ for (r = 0, s = e.length; r < s; r++)
184
+ t.call(null, e[r], r, e);
185
+ else {
186
+ if (re(e))
187
+ return;
188
+ const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
189
+ let a;
190
+ for (r = 0; r < o; r++)
191
+ a = i[r], t.call(null, e[a], a, e);
192
+ }
193
+ }
194
+ function ot(e, t) {
195
+ if (re(e))
196
+ return null;
197
+ t = t.toLowerCase();
198
+ const n = Object.keys(e);
199
+ let r = n.length, s;
200
+ for (; r-- > 0; )
201
+ if (s = n[r], t === s.toLowerCase())
202
+ return s;
203
+ return null;
204
+ }
205
+ const W = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, it = (e) => !Z(e) && e !== W;
206
+ function Ae() {
207
+ const { caseless: e, skipUndefined: t } = it(this) && this || {}, n = {}, r = (s, i) => {
208
+ if (i === "__proto__" || i === "constructor" || i === "prototype")
209
+ return;
210
+ const o = e && ot(n, i) || i;
211
+ ue(n[o]) && ue(s) ? n[o] = Ae(n[o], s) : ue(s) ? n[o] = Ae({}, s) : Y(s) ? n[o] = s.slice() : (!t || !Z(s)) && (n[o] = s);
212
+ };
213
+ for (let s = 0, i = arguments.length; s < i; s++)
214
+ arguments[s] && oe(arguments[s], r);
215
+ return n;
216
+ }
217
+ const nn = (e, t, n, { allOwnKeys: r } = {}) => (oe(
218
+ t,
219
+ (s, i) => {
220
+ n && N(s) ? Object.defineProperty(e, i, {
221
+ value: tt(s, n),
222
+ writable: !0,
223
+ enumerable: !0,
224
+ configurable: !0
225
+ }) : Object.defineProperty(e, i, {
226
+ value: s,
227
+ writable: !0,
228
+ enumerable: !0,
229
+ configurable: !0
230
+ });
231
+ },
232
+ { allOwnKeys: r }
233
+ ), e), rn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), sn = (e, t, n, r) => {
234
+ e.prototype = Object.create(t.prototype, r), Object.defineProperty(e.prototype, "constructor", {
235
+ value: e,
236
+ writable: !0,
237
+ enumerable: !1,
238
+ configurable: !0
239
+ }), Object.defineProperty(e, "super", {
240
+ value: t.prototype
241
+ }), n && Object.assign(e.prototype, n);
242
+ }, on = (e, t, n, r) => {
243
+ let s, i, o;
244
+ const a = {};
245
+ if (t = t || {}, e == null) return t;
246
+ do {
247
+ for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
248
+ o = s[i], (!r || r(o, e, t)) && !a[o] && (t[o] = e[o], a[o] = !0);
249
+ e = n !== !1 && xe(e);
250
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
251
+ return t;
252
+ }, an = (e, t, n) => {
253
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
254
+ const r = e.indexOf(t, n);
255
+ return r !== -1 && r === n;
256
+ }, ln = (e) => {
257
+ if (!e) return null;
258
+ if (Y(e)) return e;
259
+ let t = e.length;
260
+ if (!st(t)) return null;
261
+ const n = new Array(t);
262
+ for (; t-- > 0; )
263
+ n[t] = e[t];
264
+ return n;
265
+ }, cn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && xe(Uint8Array)), un = (e, t) => {
266
+ const r = (e && e[he]).call(e);
267
+ let s;
268
+ for (; (s = r.next()) && !s.done; ) {
269
+ const i = s.value;
270
+ t.call(e, i[0], i[1]);
271
+ }
272
+ }, fn = (e, t) => {
273
+ let n;
274
+ const r = [];
275
+ for (; (n = e.exec(t)) !== null; )
276
+ r.push(n);
277
+ return r;
278
+ }, dn = I("HTMLFormElement"), pn = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
279
+ return r.toUpperCase() + s;
280
+ }), Le = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), hn = I("RegExp"), at = (e, t) => {
281
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
282
+ oe(n, (s, i) => {
283
+ let o;
284
+ (o = t(s, i, e)) !== !1 && (r[i] = o || s);
285
+ }), Object.defineProperties(e, r);
286
+ }, mn = (e) => {
287
+ at(e, (t, n) => {
288
+ if (N(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
289
+ return !1;
290
+ const r = e[n];
291
+ if (N(r)) {
292
+ if (t.enumerable = !1, "writable" in t) {
293
+ t.writable = !1;
294
+ return;
295
+ }
296
+ t.set || (t.set = () => {
297
+ throw Error("Can not rewrite read-only method '" + n + "'");
298
+ });
299
+ }
300
+ });
301
+ }, yn = (e, t) => {
302
+ const n = {}, r = (s) => {
303
+ s.forEach((i) => {
304
+ n[i] = !0;
305
+ });
306
+ };
307
+ return Y(e) ? r(e) : r(String(e).split(t)), n;
308
+ }, bn = () => {
309
+ }, wn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
310
+ function gn(e) {
311
+ return !!(e && N(e.append) && e[nt] === "FormData" && e[he]);
312
+ }
313
+ const En = (e) => {
314
+ const t = new Array(10), n = (r, s) => {
315
+ if (se(r)) {
316
+ if (t.indexOf(r) >= 0)
317
+ return;
318
+ if (re(r))
319
+ return r;
320
+ if (!("toJSON" in r)) {
321
+ t[s] = r;
322
+ const i = Y(r) ? [] : {};
323
+ return oe(r, (o, a) => {
324
+ const d = n(o, s + 1);
325
+ !Z(d) && (i[a] = d);
326
+ }), t[s] = void 0, i;
327
+ }
328
+ }
329
+ return r;
330
+ };
331
+ return n(e, 0);
332
+ }, Rn = I("AsyncFunction"), Sn = (e) => e && (se(e) || N(e)) && N(e.then) && N(e.catch), lt = ((e, t) => e ? setImmediate : t ? ((n, r) => (W.addEventListener(
333
+ "message",
334
+ ({ source: s, data: i }) => {
335
+ s === W && i === n && r.length && r.shift()();
336
+ },
337
+ !1
338
+ ), (s) => {
339
+ r.push(s), W.postMessage(n, "*");
340
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", N(W.postMessage)), On = typeof queueMicrotask < "u" ? queueMicrotask.bind(W) : typeof process < "u" && process.nextTick || lt, An = (e) => e != null && N(e[he]), l = {
341
+ isArray: Y,
342
+ isArrayBuffer: rt,
343
+ isBuffer: re,
344
+ isFormData: Xt,
345
+ isArrayBufferView: Lt,
346
+ isString: Dt,
347
+ isNumber: st,
348
+ isBoolean: jt,
349
+ isObject: se,
350
+ isPlainObject: ue,
351
+ isEmptyObject: Ht,
352
+ isReadableStream: Qt,
353
+ isRequest: Zt,
354
+ isResponse: Yt,
355
+ isHeaders: en,
356
+ isUndefined: Z,
357
+ isDate: qt,
358
+ isFile: Mt,
359
+ isReactNativeBlob: $t,
360
+ isReactNative: Vt,
361
+ isBlob: zt,
362
+ isRegExp: hn,
363
+ isFunction: N,
364
+ isStream: Jt,
365
+ isURLSearchParams: Gt,
366
+ isTypedArray: cn,
367
+ isFileList: Wt,
368
+ forEach: oe,
369
+ merge: Ae,
370
+ extend: nn,
371
+ trim: tn,
372
+ stripBOM: rn,
373
+ inherits: sn,
374
+ toFlatObject: on,
375
+ kindOf: me,
376
+ kindOfTest: I,
377
+ endsWith: an,
378
+ toArray: ln,
379
+ forEachEntry: un,
380
+ matchAll: fn,
381
+ isHTMLForm: dn,
382
+ hasOwnProperty: Le,
383
+ hasOwnProp: Le,
384
+ // an alias to avoid ESLint no-prototype-builtins detection
385
+ reduceDescriptors: at,
386
+ freezeMethods: mn,
387
+ toObjectSet: yn,
388
+ toCamelCase: pn,
389
+ noop: bn,
390
+ toFiniteNumber: wn,
391
+ findKey: ot,
392
+ global: W,
393
+ isContextDefined: it,
394
+ isSpecCompliantForm: gn,
395
+ toJSONObject: En,
396
+ isAsyncFn: Rn,
397
+ isThenable: Sn,
398
+ setImmediate: lt,
399
+ asap: On,
400
+ isIterable: An
401
+ };
402
+ let y = class ct extends Error {
403
+ static from(t, n, r, s, i, o) {
404
+ const a = new ct(t.message, n || t.code, r, s, i);
405
+ return a.cause = t, a.name = t.name, t.status != null && a.status == null && (a.status = t.status), o && Object.assign(a, o), a;
406
+ }
407
+ /**
408
+ * Create an Error with the specified message, config, error code, request and response.
409
+ *
410
+ * @param {string} message The error message.
411
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
412
+ * @param {Object} [config] The config.
413
+ * @param {Object} [request] The request.
414
+ * @param {Object} [response] The response.
415
+ *
416
+ * @returns {Error} The created error.
417
+ */
418
+ constructor(t, n, r, s, i) {
419
+ super(t), Object.defineProperty(this, "message", {
420
+ value: t,
421
+ enumerable: !0,
422
+ writable: !0,
423
+ configurable: !0
424
+ }), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), s && (this.request = s), i && (this.response = i, this.status = i.status);
425
+ }
426
+ toJSON() {
427
+ return {
428
+ // Standard
429
+ message: this.message,
430
+ name: this.name,
431
+ // Microsoft
432
+ description: this.description,
433
+ number: this.number,
434
+ // Mozilla
435
+ fileName: this.fileName,
436
+ lineNumber: this.lineNumber,
437
+ columnNumber: this.columnNumber,
438
+ stack: this.stack,
439
+ // Axios
440
+ config: l.toJSONObject(this.config),
441
+ code: this.code,
442
+ status: this.status
443
+ };
444
+ }
445
+ };
446
+ y.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
447
+ y.ERR_BAD_OPTION = "ERR_BAD_OPTION";
448
+ y.ECONNABORTED = "ECONNABORTED";
449
+ y.ETIMEDOUT = "ETIMEDOUT";
450
+ y.ERR_NETWORK = "ERR_NETWORK";
451
+ y.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
452
+ y.ERR_DEPRECATED = "ERR_DEPRECATED";
453
+ y.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
454
+ y.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
455
+ y.ERR_CANCELED = "ERR_CANCELED";
456
+ y.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
457
+ y.ERR_INVALID_URL = "ERR_INVALID_URL";
458
+ const Tn = null;
459
+ function Te(e) {
460
+ return l.isPlainObject(e) || l.isArray(e);
461
+ }
462
+ function ut(e) {
463
+ return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
464
+ }
465
+ function ge(e, t, n) {
466
+ return e ? e.concat(t).map(function(s, i) {
467
+ return s = ut(s), !n && i ? "[" + s + "]" : s;
468
+ }).join(n ? "." : "") : t;
469
+ }
470
+ function Cn(e) {
471
+ return l.isArray(e) && !e.some(Te);
472
+ }
473
+ const Pn = l.toFlatObject(l, {}, null, function(t) {
474
+ return /^is[A-Z]/.test(t);
475
+ });
476
+ function be(e, t, n) {
477
+ if (!l.isObject(e))
478
+ throw new TypeError("target must be an object");
479
+ t = t || new FormData(), n = l.toFlatObject(
480
+ n,
481
+ {
482
+ metaTokens: !0,
483
+ dots: !1,
484
+ indexes: !1
485
+ },
486
+ !1,
487
+ function(p, h) {
488
+ return !l.isUndefined(h[p]);
489
+ }
490
+ );
491
+ const r = n.metaTokens, s = n.visitor || u, i = n.dots, o = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
492
+ if (!l.isFunction(s))
493
+ throw new TypeError("visitor must be a function");
494
+ function f(c) {
495
+ if (c === null) return "";
496
+ if (l.isDate(c))
497
+ return c.toISOString();
498
+ if (l.isBoolean(c))
499
+ return c.toString();
500
+ if (!d && l.isBlob(c))
501
+ throw new y("Blob is not supported. Use a Buffer instead.");
502
+ return l.isArrayBuffer(c) || l.isTypedArray(c) ? d && typeof Blob == "function" ? new Blob([c]) : Buffer.from(c) : c;
503
+ }
504
+ function u(c, p, h) {
505
+ let S = c;
506
+ if (l.isReactNative(t) && l.isReactNativeBlob(c))
507
+ return t.append(ge(h, p, i), f(c)), !1;
508
+ if (c && !h && typeof c == "object") {
509
+ if (l.endsWith(p, "{}"))
510
+ p = r ? p : p.slice(0, -2), c = JSON.stringify(c);
511
+ else if (l.isArray(c) && Cn(c) || (l.isFileList(c) || l.endsWith(p, "[]")) && (S = l.toArray(c)))
512
+ return p = ut(p), S.forEach(function(O, T) {
513
+ !(l.isUndefined(O) || O === null) && t.append(
514
+ // eslint-disable-next-line no-nested-ternary
515
+ o === !0 ? ge([p], T, i) : o === null ? p : p + "[]",
516
+ f(O)
517
+ );
518
+ }), !1;
519
+ }
520
+ return Te(c) ? !0 : (t.append(ge(h, p, i), f(c)), !1);
521
+ }
522
+ const m = [], w = Object.assign(Pn, {
523
+ defaultVisitor: u,
524
+ convertValue: f,
525
+ isVisitable: Te
526
+ });
527
+ function g(c, p) {
528
+ if (!l.isUndefined(c)) {
529
+ if (m.indexOf(c) !== -1)
530
+ throw Error("Circular reference detected in " + p.join("."));
531
+ m.push(c), l.forEach(c, function(S, k) {
532
+ (!(l.isUndefined(S) || S === null) && s.call(t, S, l.isString(k) ? k.trim() : k, p, w)) === !0 && g(S, p ? p.concat(k) : [k]);
533
+ }), m.pop();
534
+ }
535
+ }
536
+ if (!l.isObject(e))
537
+ throw new TypeError("data must be an object");
538
+ return g(e), t;
539
+ }
540
+ function De(e) {
541
+ const t = {
542
+ "!": "%21",
543
+ "'": "%27",
544
+ "(": "%28",
545
+ ")": "%29",
546
+ "~": "%7E",
547
+ "%20": "+",
548
+ "%00": "\0"
549
+ };
550
+ return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
551
+ return t[r];
552
+ });
553
+ }
554
+ function _e(e, t) {
555
+ this._pairs = [], e && be(e, this, t);
556
+ }
557
+ const ft = _e.prototype;
558
+ ft.append = function(t, n) {
559
+ this._pairs.push([t, n]);
560
+ };
561
+ ft.toString = function(t) {
562
+ const n = t ? function(r) {
563
+ return t.call(this, r, De);
564
+ } : De;
565
+ return this._pairs.map(function(s) {
566
+ return n(s[0]) + "=" + n(s[1]);
567
+ }, "").join("&");
568
+ };
569
+ function xn(e) {
570
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
571
+ }
572
+ function dt(e, t, n) {
573
+ if (!t)
574
+ return e;
575
+ const r = n && n.encode || xn, s = l.isFunction(n) ? {
576
+ serialize: n
577
+ } : n, i = s && s.serialize;
578
+ let o;
579
+ if (i ? o = i(t, s) : o = l.isURLSearchParams(t) ? t.toString() : new _e(t, s).toString(r), o) {
580
+ const a = e.indexOf("#");
581
+ a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
582
+ }
132
583
  return e;
133
- }, O = /* @__PURE__ */ D(z, [["__scopeId", "data-v-bf23f155"]]), J = /* @__PURE__ */ H({
584
+ }
585
+ class je {
586
+ constructor() {
587
+ this.handlers = [];
588
+ }
589
+ /**
590
+ * Add a new interceptor to the stack
591
+ *
592
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
593
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
594
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
595
+ *
596
+ * @return {Number} An ID used to remove interceptor later
597
+ */
598
+ use(t, n, r) {
599
+ return this.handlers.push({
600
+ fulfilled: t,
601
+ rejected: n,
602
+ synchronous: r ? r.synchronous : !1,
603
+ runWhen: r ? r.runWhen : null
604
+ }), this.handlers.length - 1;
605
+ }
606
+ /**
607
+ * Remove an interceptor from the stack
608
+ *
609
+ * @param {Number} id The ID that was returned by `use`
610
+ *
611
+ * @returns {void}
612
+ */
613
+ eject(t) {
614
+ this.handlers[t] && (this.handlers[t] = null);
615
+ }
616
+ /**
617
+ * Clear all interceptors from the stack
618
+ *
619
+ * @returns {void}
620
+ */
621
+ clear() {
622
+ this.handlers && (this.handlers = []);
623
+ }
624
+ /**
625
+ * Iterate over all the registered interceptors
626
+ *
627
+ * This method is particularly useful for skipping over any
628
+ * interceptors that may have become `null` calling `eject`.
629
+ *
630
+ * @param {Function} fn The function to call for each interceptor
631
+ *
632
+ * @returns {void}
633
+ */
634
+ forEach(t) {
635
+ l.forEach(this.handlers, function(r) {
636
+ r !== null && t(r);
637
+ });
638
+ }
639
+ }
640
+ const Ne = {
641
+ silentJSONParsing: !0,
642
+ forcedJSONParsing: !0,
643
+ clarifyTimeoutError: !1,
644
+ legacyInterceptorReqResOrdering: !0
645
+ }, _n = typeof URLSearchParams < "u" ? URLSearchParams : _e, Nn = typeof FormData < "u" ? FormData : null, Un = typeof Blob < "u" ? Blob : null, kn = {
646
+ isBrowser: !0,
647
+ classes: {
648
+ URLSearchParams: _n,
649
+ FormData: Nn,
650
+ Blob: Un
651
+ },
652
+ protocols: ["http", "https", "file", "blob", "url", "data"]
653
+ }, Ue = typeof window < "u" && typeof document < "u", Ce = typeof navigator == "object" && navigator || void 0, Fn = Ue && (!Ce || ["ReactNative", "NativeScript", "NS"].indexOf(Ce.product) < 0), vn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
654
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Bn = Ue && window.location.href || "http://localhost", In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
655
+ __proto__: null,
656
+ hasBrowserEnv: Ue,
657
+ hasStandardBrowserEnv: Fn,
658
+ hasStandardBrowserWebWorkerEnv: vn,
659
+ navigator: Ce,
660
+ origin: Bn
661
+ }, Symbol.toStringTag, { value: "Module" })), x = {
662
+ ...In,
663
+ ...kn
664
+ };
665
+ function Ln(e, t) {
666
+ return be(e, new x.classes.URLSearchParams(), {
667
+ visitor: function(n, r, s, i) {
668
+ return x.isNode && l.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
669
+ },
670
+ ...t
671
+ });
672
+ }
673
+ function Dn(e) {
674
+ return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
675
+ }
676
+ function jn(e) {
677
+ const t = {}, n = Object.keys(e);
678
+ let r;
679
+ const s = n.length;
680
+ let i;
681
+ for (r = 0; r < s; r++)
682
+ i = n[r], t[i] = e[i];
683
+ return t;
684
+ }
685
+ function pt(e) {
686
+ function t(n, r, s, i) {
687
+ let o = n[i++];
688
+ if (o === "__proto__") return !0;
689
+ const a = Number.isFinite(+o), d = i >= n.length;
690
+ return o = !o && l.isArray(s) ? s.length : o, d ? (l.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !a) : ((!s[o] || !l.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && l.isArray(s[o]) && (s[o] = jn(s[o])), !a);
691
+ }
692
+ if (l.isFormData(e) && l.isFunction(e.entries)) {
693
+ const n = {};
694
+ return l.forEachEntry(e, (r, s) => {
695
+ t(Dn(r), s, n, 0);
696
+ }), n;
697
+ }
698
+ return null;
699
+ }
700
+ function Hn(e, t, n) {
701
+ if (l.isString(e))
702
+ try {
703
+ return (t || JSON.parse)(e), l.trim(e);
704
+ } catch (r) {
705
+ if (r.name !== "SyntaxError")
706
+ throw r;
707
+ }
708
+ return (n || JSON.stringify)(e);
709
+ }
710
+ const ie = {
711
+ transitional: Ne,
712
+ adapter: ["xhr", "http", "fetch"],
713
+ transformRequest: [
714
+ function(t, n) {
715
+ const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = l.isObject(t);
716
+ if (i && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
717
+ return s ? JSON.stringify(pt(t)) : t;
718
+ if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
719
+ return t;
720
+ if (l.isArrayBufferView(t))
721
+ return t.buffer;
722
+ if (l.isURLSearchParams(t))
723
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
724
+ let a;
725
+ if (i) {
726
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
727
+ return Ln(t, this.formSerializer).toString();
728
+ if ((a = l.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
729
+ const d = this.env && this.env.FormData;
730
+ return be(
731
+ a ? { "files[]": t } : t,
732
+ d && new d(),
733
+ this.formSerializer
734
+ );
735
+ }
736
+ }
737
+ return i || s ? (n.setContentType("application/json", !1), Hn(t)) : t;
738
+ }
739
+ ],
740
+ transformResponse: [
741
+ function(t) {
742
+ const n = this.transitional || ie.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
743
+ if (l.isResponse(t) || l.isReadableStream(t))
744
+ return t;
745
+ if (t && l.isString(t) && (r && !this.responseType || s)) {
746
+ const o = !(n && n.silentJSONParsing) && s;
747
+ try {
748
+ return JSON.parse(t, this.parseReviver);
749
+ } catch (a) {
750
+ if (o)
751
+ throw a.name === "SyntaxError" ? y.from(a, y.ERR_BAD_RESPONSE, this, null, this.response) : a;
752
+ }
753
+ }
754
+ return t;
755
+ }
756
+ ],
757
+ /**
758
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
759
+ * timeout is not created.
760
+ */
761
+ timeout: 0,
762
+ xsrfCookieName: "XSRF-TOKEN",
763
+ xsrfHeaderName: "X-XSRF-TOKEN",
764
+ maxContentLength: -1,
765
+ maxBodyLength: -1,
766
+ env: {
767
+ FormData: x.classes.FormData,
768
+ Blob: x.classes.Blob
769
+ },
770
+ validateStatus: function(t) {
771
+ return t >= 200 && t < 300;
772
+ },
773
+ headers: {
774
+ common: {
775
+ Accept: "application/json, text/plain, */*",
776
+ "Content-Type": void 0
777
+ }
778
+ }
779
+ };
780
+ l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
781
+ ie.headers[e] = {};
782
+ });
783
+ const qn = l.toObjectSet([
784
+ "age",
785
+ "authorization",
786
+ "content-length",
787
+ "content-type",
788
+ "etag",
789
+ "expires",
790
+ "from",
791
+ "host",
792
+ "if-modified-since",
793
+ "if-unmodified-since",
794
+ "last-modified",
795
+ "location",
796
+ "max-forwards",
797
+ "proxy-authorization",
798
+ "referer",
799
+ "retry-after",
800
+ "user-agent"
801
+ ]), Mn = (e) => {
802
+ const t = {};
803
+ let n, r, s;
804
+ return e && e.split(`
805
+ `).forEach(function(o) {
806
+ s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && qn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
807
+ }), t;
808
+ }, He = Symbol("internals");
809
+ function te(e) {
810
+ return e && String(e).trim().toLowerCase();
811
+ }
812
+ function fe(e) {
813
+ return e === !1 || e == null ? e : l.isArray(e) ? e.map(fe) : String(e).replace(/[\r\n]+$/, "");
814
+ }
815
+ function $n(e) {
816
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
817
+ let r;
818
+ for (; r = n.exec(e); )
819
+ t[r[1]] = r[2];
820
+ return t;
821
+ }
822
+ const Vn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
823
+ function Ee(e, t, n, r, s) {
824
+ if (l.isFunction(r))
825
+ return r.call(this, t, n);
826
+ if (s && (t = n), !!l.isString(t)) {
827
+ if (l.isString(r))
828
+ return t.indexOf(r) !== -1;
829
+ if (l.isRegExp(r))
830
+ return r.test(t);
831
+ }
832
+ }
833
+ function zn(e) {
834
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
835
+ }
836
+ function Wn(e, t) {
837
+ const n = l.toCamelCase(" " + t);
838
+ ["get", "set", "has"].forEach((r) => {
839
+ Object.defineProperty(e, r + n, {
840
+ value: function(s, i, o) {
841
+ return this[r].call(this, t, s, i, o);
842
+ },
843
+ configurable: !0
844
+ });
845
+ });
846
+ }
847
+ let U = class {
848
+ constructor(t) {
849
+ t && this.set(t);
850
+ }
851
+ set(t, n, r) {
852
+ const s = this;
853
+ function i(a, d, f) {
854
+ const u = te(d);
855
+ if (!u)
856
+ throw new Error("header name must be a non-empty string");
857
+ const m = l.findKey(s, u);
858
+ (!m || s[m] === void 0 || f === !0 || f === void 0 && s[m] !== !1) && (s[m || d] = fe(a));
859
+ }
860
+ const o = (a, d) => l.forEach(a, (f, u) => i(f, u, d));
861
+ if (l.isPlainObject(t) || t instanceof this.constructor)
862
+ o(t, n);
863
+ else if (l.isString(t) && (t = t.trim()) && !Vn(t))
864
+ o(Mn(t), n);
865
+ else if (l.isObject(t) && l.isIterable(t)) {
866
+ let a = {}, d, f;
867
+ for (const u of t) {
868
+ if (!l.isArray(u))
869
+ throw TypeError("Object iterator must return a key-value pair");
870
+ a[f = u[0]] = (d = a[f]) ? l.isArray(d) ? [...d, u[1]] : [d, u[1]] : u[1];
871
+ }
872
+ o(a, n);
873
+ } else
874
+ t != null && i(n, t, r);
875
+ return this;
876
+ }
877
+ get(t, n) {
878
+ if (t = te(t), t) {
879
+ const r = l.findKey(this, t);
880
+ if (r) {
881
+ const s = this[r];
882
+ if (!n)
883
+ return s;
884
+ if (n === !0)
885
+ return $n(s);
886
+ if (l.isFunction(n))
887
+ return n.call(this, s, r);
888
+ if (l.isRegExp(n))
889
+ return n.exec(s);
890
+ throw new TypeError("parser must be boolean|regexp|function");
891
+ }
892
+ }
893
+ }
894
+ has(t, n) {
895
+ if (t = te(t), t) {
896
+ const r = l.findKey(this, t);
897
+ return !!(r && this[r] !== void 0 && (!n || Ee(this, this[r], r, n)));
898
+ }
899
+ return !1;
900
+ }
901
+ delete(t, n) {
902
+ const r = this;
903
+ let s = !1;
904
+ function i(o) {
905
+ if (o = te(o), o) {
906
+ const a = l.findKey(r, o);
907
+ a && (!n || Ee(r, r[a], a, n)) && (delete r[a], s = !0);
908
+ }
909
+ }
910
+ return l.isArray(t) ? t.forEach(i) : i(t), s;
911
+ }
912
+ clear(t) {
913
+ const n = Object.keys(this);
914
+ let r = n.length, s = !1;
915
+ for (; r--; ) {
916
+ const i = n[r];
917
+ (!t || Ee(this, this[i], i, t, !0)) && (delete this[i], s = !0);
918
+ }
919
+ return s;
920
+ }
921
+ normalize(t) {
922
+ const n = this, r = {};
923
+ return l.forEach(this, (s, i) => {
924
+ const o = l.findKey(r, i);
925
+ if (o) {
926
+ n[o] = fe(s), delete n[i];
927
+ return;
928
+ }
929
+ const a = t ? zn(i) : String(i).trim();
930
+ a !== i && delete n[i], n[a] = fe(s), r[a] = !0;
931
+ }), this;
932
+ }
933
+ concat(...t) {
934
+ return this.constructor.concat(this, ...t);
935
+ }
936
+ toJSON(t) {
937
+ const n = /* @__PURE__ */ Object.create(null);
938
+ return l.forEach(this, (r, s) => {
939
+ r != null && r !== !1 && (n[s] = t && l.isArray(r) ? r.join(", ") : r);
940
+ }), n;
941
+ }
942
+ [Symbol.iterator]() {
943
+ return Object.entries(this.toJSON())[Symbol.iterator]();
944
+ }
945
+ toString() {
946
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
947
+ `);
948
+ }
949
+ getSetCookie() {
950
+ return this.get("set-cookie") || [];
951
+ }
952
+ get [Symbol.toStringTag]() {
953
+ return "AxiosHeaders";
954
+ }
955
+ static from(t) {
956
+ return t instanceof this ? t : new this(t);
957
+ }
958
+ static concat(t, ...n) {
959
+ const r = new this(t);
960
+ return n.forEach((s) => r.set(s)), r;
961
+ }
962
+ static accessor(t) {
963
+ const r = (this[He] = this[He] = {
964
+ accessors: {}
965
+ }).accessors, s = this.prototype;
966
+ function i(o) {
967
+ const a = te(o);
968
+ r[a] || (Wn(s, o), r[a] = !0);
969
+ }
970
+ return l.isArray(t) ? t.forEach(i) : i(t), this;
971
+ }
972
+ };
973
+ U.accessor([
974
+ "Content-Type",
975
+ "Content-Length",
976
+ "Accept",
977
+ "Accept-Encoding",
978
+ "User-Agent",
979
+ "Authorization"
980
+ ]);
981
+ l.reduceDescriptors(U.prototype, ({ value: e }, t) => {
982
+ let n = t[0].toUpperCase() + t.slice(1);
983
+ return {
984
+ get: () => e,
985
+ set(r) {
986
+ this[n] = r;
987
+ }
988
+ };
989
+ });
990
+ l.freezeMethods(U);
991
+ function Re(e, t) {
992
+ const n = this || ie, r = t || n, s = U.from(r.headers);
993
+ let i = r.data;
994
+ return l.forEach(e, function(a) {
995
+ i = a.call(n, i, s.normalize(), t ? t.status : void 0);
996
+ }), s.normalize(), i;
997
+ }
998
+ function ht(e) {
999
+ return !!(e && e.__CANCEL__);
1000
+ }
1001
+ let ae = class extends y {
1002
+ /**
1003
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1004
+ *
1005
+ * @param {string=} message The message.
1006
+ * @param {Object=} config The config.
1007
+ * @param {Object=} request The request.
1008
+ *
1009
+ * @returns {CanceledError} The created error.
1010
+ */
1011
+ constructor(t, n, r) {
1012
+ super(t ?? "canceled", y.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
1013
+ }
1014
+ };
1015
+ function mt(e, t, n) {
1016
+ const r = n.config.validateStatus;
1017
+ !n.status || !r || r(n.status) ? e(n) : t(
1018
+ new y(
1019
+ "Request failed with status code " + n.status,
1020
+ [y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1021
+ n.config,
1022
+ n.request,
1023
+ n
1024
+ )
1025
+ );
1026
+ }
1027
+ function Jn(e) {
1028
+ const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1029
+ return t && t[1] || "";
1030
+ }
1031
+ function Kn(e, t) {
1032
+ e = e || 10;
1033
+ const n = new Array(e), r = new Array(e);
1034
+ let s = 0, i = 0, o;
1035
+ return t = t !== void 0 ? t : 1e3, function(d) {
1036
+ const f = Date.now(), u = r[i];
1037
+ o || (o = f), n[s] = d, r[s] = f;
1038
+ let m = i, w = 0;
1039
+ for (; m !== s; )
1040
+ w += n[m++], m = m % e;
1041
+ if (s = (s + 1) % e, s === i && (i = (i + 1) % e), f - o < t)
1042
+ return;
1043
+ const g = u && f - u;
1044
+ return g ? Math.round(w * 1e3 / g) : void 0;
1045
+ };
1046
+ }
1047
+ function Xn(e, t) {
1048
+ let n = 0, r = 1e3 / t, s, i;
1049
+ const o = (f, u = Date.now()) => {
1050
+ n = u, s = null, i && (clearTimeout(i), i = null), e(...f);
1051
+ };
1052
+ return [(...f) => {
1053
+ const u = Date.now(), m = u - n;
1054
+ m >= r ? o(f, u) : (s = f, i || (i = setTimeout(() => {
1055
+ i = null, o(s);
1056
+ }, r - m)));
1057
+ }, () => s && o(s)];
1058
+ }
1059
+ const pe = (e, t, n = 3) => {
1060
+ let r = 0;
1061
+ const s = Kn(50, 250);
1062
+ return Xn((i) => {
1063
+ const o = i.loaded, a = i.lengthComputable ? i.total : void 0, d = o - r, f = s(d), u = o <= a;
1064
+ r = o;
1065
+ const m = {
1066
+ loaded: o,
1067
+ total: a,
1068
+ progress: a ? o / a : void 0,
1069
+ bytes: d,
1070
+ rate: f || void 0,
1071
+ estimated: f && a && u ? (a - o) / f : void 0,
1072
+ event: i,
1073
+ lengthComputable: a != null,
1074
+ [t ? "download" : "upload"]: !0
1075
+ };
1076
+ e(m);
1077
+ }, n);
1078
+ }, qe = (e, t) => {
1079
+ const n = e != null;
1080
+ return [
1081
+ (r) => t[0]({
1082
+ lengthComputable: n,
1083
+ total: e,
1084
+ loaded: r
1085
+ }),
1086
+ t[1]
1087
+ ];
1088
+ }, Me = (e) => (...t) => l.asap(() => e(...t)), Gn = x.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, x.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1089
+ new URL(x.origin),
1090
+ x.navigator && /(msie|trident)/i.test(x.navigator.userAgent)
1091
+ ) : () => !0, Qn = x.hasStandardBrowserEnv ? (
1092
+ // Standard browser envs support document.cookie
1093
+ {
1094
+ write(e, t, n, r, s, i, o) {
1095
+ if (typeof document > "u") return;
1096
+ const a = [`${e}=${encodeURIComponent(t)}`];
1097
+ l.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`), l.isString(r) && a.push(`path=${r}`), l.isString(s) && a.push(`domain=${s}`), i === !0 && a.push("secure"), l.isString(o) && a.push(`SameSite=${o}`), document.cookie = a.join("; ");
1098
+ },
1099
+ read(e) {
1100
+ if (typeof document > "u") return null;
1101
+ const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
1102
+ return t ? decodeURIComponent(t[1]) : null;
1103
+ },
1104
+ remove(e) {
1105
+ this.write(e, "", Date.now() - 864e5, "/");
1106
+ }
1107
+ }
1108
+ ) : (
1109
+ // Non-standard browser env (web workers, react-native) lack needed support.
1110
+ {
1111
+ write() {
1112
+ },
1113
+ read() {
1114
+ return null;
1115
+ },
1116
+ remove() {
1117
+ }
1118
+ }
1119
+ );
1120
+ function Zn(e) {
1121
+ return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1122
+ }
1123
+ function Yn(e, t) {
1124
+ return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1125
+ }
1126
+ function yt(e, t, n) {
1127
+ let r = !Zn(t);
1128
+ return e && (r || n == !1) ? Yn(e, t) : t;
1129
+ }
1130
+ const $e = (e) => e instanceof U ? { ...e } : e;
1131
+ function K(e, t) {
1132
+ t = t || {};
1133
+ const n = {};
1134
+ function r(f, u, m, w) {
1135
+ return l.isPlainObject(f) && l.isPlainObject(u) ? l.merge.call({ caseless: w }, f, u) : l.isPlainObject(u) ? l.merge({}, u) : l.isArray(u) ? u.slice() : u;
1136
+ }
1137
+ function s(f, u, m, w) {
1138
+ if (l.isUndefined(u)) {
1139
+ if (!l.isUndefined(f))
1140
+ return r(void 0, f, m, w);
1141
+ } else return r(f, u, m, w);
1142
+ }
1143
+ function i(f, u) {
1144
+ if (!l.isUndefined(u))
1145
+ return r(void 0, u);
1146
+ }
1147
+ function o(f, u) {
1148
+ if (l.isUndefined(u)) {
1149
+ if (!l.isUndefined(f))
1150
+ return r(void 0, f);
1151
+ } else return r(void 0, u);
1152
+ }
1153
+ function a(f, u, m) {
1154
+ if (m in t)
1155
+ return r(f, u);
1156
+ if (m in e)
1157
+ return r(void 0, f);
1158
+ }
1159
+ const d = {
1160
+ url: i,
1161
+ method: i,
1162
+ data: i,
1163
+ baseURL: o,
1164
+ transformRequest: o,
1165
+ transformResponse: o,
1166
+ paramsSerializer: o,
1167
+ timeout: o,
1168
+ timeoutMessage: o,
1169
+ withCredentials: o,
1170
+ withXSRFToken: o,
1171
+ adapter: o,
1172
+ responseType: o,
1173
+ xsrfCookieName: o,
1174
+ xsrfHeaderName: o,
1175
+ onUploadProgress: o,
1176
+ onDownloadProgress: o,
1177
+ decompress: o,
1178
+ maxContentLength: o,
1179
+ maxBodyLength: o,
1180
+ beforeRedirect: o,
1181
+ transport: o,
1182
+ httpAgent: o,
1183
+ httpsAgent: o,
1184
+ cancelToken: o,
1185
+ socketPath: o,
1186
+ responseEncoding: o,
1187
+ validateStatus: a,
1188
+ headers: (f, u, m) => s($e(f), $e(u), m, !0)
1189
+ };
1190
+ return l.forEach(Object.keys({ ...e, ...t }), function(u) {
1191
+ if (u === "__proto__" || u === "constructor" || u === "prototype") return;
1192
+ const m = l.hasOwnProp(d, u) ? d[u] : s, w = m(e[u], t[u], u);
1193
+ l.isUndefined(w) && m !== a || (n[u] = w);
1194
+ }), n;
1195
+ }
1196
+ const bt = (e) => {
1197
+ const t = K({}, e);
1198
+ let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: a } = t;
1199
+ if (t.headers = o = U.from(o), t.url = dt(
1200
+ yt(t.baseURL, t.url, t.allowAbsoluteUrls),
1201
+ e.params,
1202
+ e.paramsSerializer
1203
+ ), a && o.set(
1204
+ "Authorization",
1205
+ "Basic " + btoa(
1206
+ (a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : "")
1207
+ )
1208
+ ), l.isFormData(n)) {
1209
+ if (x.hasStandardBrowserEnv || x.hasStandardBrowserWebWorkerEnv)
1210
+ o.setContentType(void 0);
1211
+ else if (l.isFunction(n.getHeaders)) {
1212
+ const d = n.getHeaders(), f = ["content-type", "content-length"];
1213
+ Object.entries(d).forEach(([u, m]) => {
1214
+ f.includes(u.toLowerCase()) && o.set(u, m);
1215
+ });
1216
+ }
1217
+ }
1218
+ if (x.hasStandardBrowserEnv && (r && l.isFunction(r) && (r = r(t)), r || r !== !1 && Gn(t.url))) {
1219
+ const d = s && i && Qn.read(i);
1220
+ d && o.set(s, d);
1221
+ }
1222
+ return t;
1223
+ }, er = typeof XMLHttpRequest < "u", tr = er && function(e) {
1224
+ return new Promise(function(n, r) {
1225
+ const s = bt(e);
1226
+ let i = s.data;
1227
+ const o = U.from(s.headers).normalize();
1228
+ let { responseType: a, onUploadProgress: d, onDownloadProgress: f } = s, u, m, w, g, c;
1229
+ function p() {
1230
+ g && g(), c && c(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
1231
+ }
1232
+ let h = new XMLHttpRequest();
1233
+ h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1234
+ function S() {
1235
+ if (!h)
1236
+ return;
1237
+ const O = U.from(
1238
+ "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1239
+ ), _ = {
1240
+ data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1241
+ status: h.status,
1242
+ statusText: h.statusText,
1243
+ headers: O,
1244
+ config: e,
1245
+ request: h
1246
+ };
1247
+ mt(
1248
+ function(C) {
1249
+ n(C), p();
1250
+ },
1251
+ function(C) {
1252
+ r(C), p();
1253
+ },
1254
+ _
1255
+ ), h = null;
1256
+ }
1257
+ "onloadend" in h ? h.onloadend = S : h.onreadystatechange = function() {
1258
+ !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(S);
1259
+ }, h.onabort = function() {
1260
+ h && (r(new y("Request aborted", y.ECONNABORTED, e, h)), h = null);
1261
+ }, h.onerror = function(T) {
1262
+ const _ = T && T.message ? T.message : "Network Error", L = new y(_, y.ERR_NETWORK, e, h);
1263
+ L.event = T || null, r(L), h = null;
1264
+ }, h.ontimeout = function() {
1265
+ let T = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1266
+ const _ = s.transitional || Ne;
1267
+ s.timeoutErrorMessage && (T = s.timeoutErrorMessage), r(
1268
+ new y(
1269
+ T,
1270
+ _.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
1271
+ e,
1272
+ h
1273
+ )
1274
+ ), h = null;
1275
+ }, i === void 0 && o.setContentType(null), "setRequestHeader" in h && l.forEach(o.toJSON(), function(T, _) {
1276
+ h.setRequestHeader(_, T);
1277
+ }), l.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), f && ([w, c] = pe(f, !0), h.addEventListener("progress", w)), d && h.upload && ([m, g] = pe(d), h.upload.addEventListener("progress", m), h.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (u = (O) => {
1278
+ h && (r(!O || O.type ? new ae(null, e, h) : O), h.abort(), h = null);
1279
+ }, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
1280
+ const k = Jn(s.url);
1281
+ if (k && x.protocols.indexOf(k) === -1) {
1282
+ r(
1283
+ new y(
1284
+ "Unsupported protocol " + k + ":",
1285
+ y.ERR_BAD_REQUEST,
1286
+ e
1287
+ )
1288
+ );
1289
+ return;
1290
+ }
1291
+ h.send(i || null);
1292
+ });
1293
+ }, nr = (e, t) => {
1294
+ const { length: n } = e = e ? e.filter(Boolean) : [];
1295
+ if (t || n) {
1296
+ let r = new AbortController(), s;
1297
+ const i = function(f) {
1298
+ if (!s) {
1299
+ s = !0, a();
1300
+ const u = f instanceof Error ? f : this.reason;
1301
+ r.abort(
1302
+ u instanceof y ? u : new ae(u instanceof Error ? u.message : u)
1303
+ );
1304
+ }
1305
+ };
1306
+ let o = t && setTimeout(() => {
1307
+ o = null, i(new y(`timeout of ${t}ms exceeded`, y.ETIMEDOUT));
1308
+ }, t);
1309
+ const a = () => {
1310
+ e && (o && clearTimeout(o), o = null, e.forEach((f) => {
1311
+ f.unsubscribe ? f.unsubscribe(i) : f.removeEventListener("abort", i);
1312
+ }), e = null);
1313
+ };
1314
+ e.forEach((f) => f.addEventListener("abort", i));
1315
+ const { signal: d } = r;
1316
+ return d.unsubscribe = () => l.asap(a), d;
1317
+ }
1318
+ }, rr = function* (e, t) {
1319
+ let n = e.byteLength;
1320
+ if (n < t) {
1321
+ yield e;
1322
+ return;
1323
+ }
1324
+ let r = 0, s;
1325
+ for (; r < n; )
1326
+ s = r + t, yield e.slice(r, s), r = s;
1327
+ }, sr = async function* (e, t) {
1328
+ for await (const n of or(e))
1329
+ yield* rr(n, t);
1330
+ }, or = async function* (e) {
1331
+ if (e[Symbol.asyncIterator]) {
1332
+ yield* e;
1333
+ return;
1334
+ }
1335
+ const t = e.getReader();
1336
+ try {
1337
+ for (; ; ) {
1338
+ const { done: n, value: r } = await t.read();
1339
+ if (n)
1340
+ break;
1341
+ yield r;
1342
+ }
1343
+ } finally {
1344
+ await t.cancel();
1345
+ }
1346
+ }, Ve = (e, t, n, r) => {
1347
+ const s = sr(e, t);
1348
+ let i = 0, o, a = (d) => {
1349
+ o || (o = !0, r && r(d));
1350
+ };
1351
+ return new ReadableStream(
1352
+ {
1353
+ async pull(d) {
1354
+ try {
1355
+ const { done: f, value: u } = await s.next();
1356
+ if (f) {
1357
+ a(), d.close();
1358
+ return;
1359
+ }
1360
+ let m = u.byteLength;
1361
+ if (n) {
1362
+ let w = i += m;
1363
+ n(w);
1364
+ }
1365
+ d.enqueue(new Uint8Array(u));
1366
+ } catch (f) {
1367
+ throw a(f), f;
1368
+ }
1369
+ },
1370
+ cancel(d) {
1371
+ return a(d), s.return();
1372
+ }
1373
+ },
1374
+ {
1375
+ highWaterMark: 2
1376
+ }
1377
+ );
1378
+ }, ze = 64 * 1024, { isFunction: ce } = l, ir = (({ Request: e, Response: t }) => ({
1379
+ Request: e,
1380
+ Response: t
1381
+ }))(l.global), { ReadableStream: We, TextEncoder: Je } = l.global, Ke = (e, ...t) => {
1382
+ try {
1383
+ return !!e(...t);
1384
+ } catch {
1385
+ return !1;
1386
+ }
1387
+ }, ar = (e) => {
1388
+ e = l.merge.call(
1389
+ {
1390
+ skipUndefined: !0
1391
+ },
1392
+ ir,
1393
+ e
1394
+ );
1395
+ const { fetch: t, Request: n, Response: r } = e, s = t ? ce(t) : typeof fetch == "function", i = ce(n), o = ce(r);
1396
+ if (!s)
1397
+ return !1;
1398
+ const a = s && ce(We), d = s && (typeof Je == "function" ? /* @__PURE__ */ ((c) => (p) => c.encode(p))(new Je()) : async (c) => new Uint8Array(await new n(c).arrayBuffer())), f = i && a && Ke(() => {
1399
+ let c = !1;
1400
+ const p = new We(), h = new n(x.origin, {
1401
+ body: p,
1402
+ method: "POST",
1403
+ get duplex() {
1404
+ return c = !0, "half";
1405
+ }
1406
+ }).headers.has("Content-Type");
1407
+ return p.cancel(), c && !h;
1408
+ }), u = o && a && Ke(() => l.isReadableStream(new r("").body)), m = {
1409
+ stream: u && ((c) => c.body)
1410
+ };
1411
+ s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((c) => {
1412
+ !m[c] && (m[c] = (p, h) => {
1413
+ let S = p && p[c];
1414
+ if (S)
1415
+ return S.call(p);
1416
+ throw new y(
1417
+ `Response type '${c}' is not supported`,
1418
+ y.ERR_NOT_SUPPORT,
1419
+ h
1420
+ );
1421
+ });
1422
+ });
1423
+ const w = async (c) => {
1424
+ if (c == null)
1425
+ return 0;
1426
+ if (l.isBlob(c))
1427
+ return c.size;
1428
+ if (l.isSpecCompliantForm(c))
1429
+ return (await new n(x.origin, {
1430
+ method: "POST",
1431
+ body: c
1432
+ }).arrayBuffer()).byteLength;
1433
+ if (l.isArrayBufferView(c) || l.isArrayBuffer(c))
1434
+ return c.byteLength;
1435
+ if (l.isURLSearchParams(c) && (c = c + ""), l.isString(c))
1436
+ return (await d(c)).byteLength;
1437
+ }, g = async (c, p) => {
1438
+ const h = l.toFiniteNumber(c.getContentLength());
1439
+ return h ?? w(p);
1440
+ };
1441
+ return async (c) => {
1442
+ let {
1443
+ url: p,
1444
+ method: h,
1445
+ data: S,
1446
+ signal: k,
1447
+ cancelToken: O,
1448
+ timeout: T,
1449
+ onDownloadProgress: _,
1450
+ onUploadProgress: L,
1451
+ responseType: C,
1452
+ headers: z,
1453
+ withCredentials: X = "same-origin",
1454
+ fetchOptions: ee
1455
+ } = bt(c), le = t || fetch;
1456
+ C = C ? (C + "").toLowerCase() : "text";
1457
+ let G = nr(
1458
+ [k, O && O.toAbortSignal()],
1459
+ T
1460
+ ), H = null;
1461
+ const q = G && G.unsubscribe && (() => {
1462
+ G.unsubscribe();
1463
+ });
1464
+ let b;
1465
+ try {
1466
+ if (L && f && h !== "get" && h !== "head" && (b = await g(z, S)) !== 0) {
1467
+ let F = new n(p, {
1468
+ method: "POST",
1469
+ body: S,
1470
+ duplex: "half"
1471
+ }), j;
1472
+ if (l.isFormData(S) && (j = F.headers.get("content-type")) && z.setContentType(j), F.body) {
1473
+ const [$, V] = qe(
1474
+ b,
1475
+ pe(Me(L))
1476
+ );
1477
+ S = Ve(F.body, ze, $, V);
1478
+ }
1479
+ }
1480
+ l.isString(X) || (X = X ? "include" : "omit");
1481
+ const E = i && "credentials" in n.prototype, R = {
1482
+ ...ee,
1483
+ signal: G,
1484
+ method: h.toUpperCase(),
1485
+ headers: z.normalize().toJSON(),
1486
+ body: S,
1487
+ duplex: "half",
1488
+ credentials: E ? X : void 0
1489
+ };
1490
+ H = i && new n(p, R);
1491
+ let P = await (i ? le(H, ee) : le(p, R));
1492
+ const M = u && (C === "stream" || C === "response");
1493
+ if (u && (_ || M && q)) {
1494
+ const F = {};
1495
+ ["status", "statusText", "headers"].forEach((v) => {
1496
+ F[v] = P[v];
1497
+ });
1498
+ const j = l.toFiniteNumber(P.headers.get("content-length")), [$, V] = _ && qe(
1499
+ j,
1500
+ pe(Me(_), !0)
1501
+ ) || [];
1502
+ P = new r(
1503
+ Ve(P.body, ze, $, () => {
1504
+ V && V(), q && q();
1505
+ }),
1506
+ F
1507
+ );
1508
+ }
1509
+ C = C || "text";
1510
+ let D = await m[l.findKey(m, C) || "text"](
1511
+ P,
1512
+ c
1513
+ );
1514
+ return !M && q && q(), await new Promise((F, j) => {
1515
+ mt(F, j, {
1516
+ data: D,
1517
+ headers: U.from(P.headers),
1518
+ status: P.status,
1519
+ statusText: P.statusText,
1520
+ config: c,
1521
+ request: H
1522
+ });
1523
+ });
1524
+ } catch (E) {
1525
+ throw q && q(), E && E.name === "TypeError" && /Load failed|fetch/i.test(E.message) ? Object.assign(
1526
+ new y(
1527
+ "Network Error",
1528
+ y.ERR_NETWORK,
1529
+ c,
1530
+ H,
1531
+ E && E.response
1532
+ ),
1533
+ {
1534
+ cause: E.cause || E
1535
+ }
1536
+ ) : y.from(E, E && E.code, c, H, E && E.response);
1537
+ }
1538
+ };
1539
+ }, lr = /* @__PURE__ */ new Map(), wt = (e) => {
1540
+ let t = e && e.env || {};
1541
+ const { fetch: n, Request: r, Response: s } = t, i = [r, s, n];
1542
+ let o = i.length, a = o, d, f, u = lr;
1543
+ for (; a--; )
1544
+ d = i[a], f = u.get(d), f === void 0 && u.set(d, f = a ? /* @__PURE__ */ new Map() : ar(t)), u = f;
1545
+ return f;
1546
+ };
1547
+ wt();
1548
+ const ke = {
1549
+ http: Tn,
1550
+ xhr: tr,
1551
+ fetch: {
1552
+ get: wt
1553
+ }
1554
+ };
1555
+ l.forEach(ke, (e, t) => {
1556
+ if (e) {
1557
+ try {
1558
+ Object.defineProperty(e, "name", { value: t });
1559
+ } catch {
1560
+ }
1561
+ Object.defineProperty(e, "adapterName", { value: t });
1562
+ }
1563
+ });
1564
+ const Xe = (e) => `- ${e}`, cr = (e) => l.isFunction(e) || e === null || e === !1;
1565
+ function ur(e, t) {
1566
+ e = l.isArray(e) ? e : [e];
1567
+ const { length: n } = e;
1568
+ let r, s;
1569
+ const i = {};
1570
+ for (let o = 0; o < n; o++) {
1571
+ r = e[o];
1572
+ let a;
1573
+ if (s = r, !cr(r) && (s = ke[(a = String(r)).toLowerCase()], s === void 0))
1574
+ throw new y(`Unknown adapter '${a}'`);
1575
+ if (s && (l.isFunction(s) || (s = s.get(t))))
1576
+ break;
1577
+ i[a || "#" + o] = s;
1578
+ }
1579
+ if (!s) {
1580
+ const o = Object.entries(i).map(
1581
+ ([d, f]) => `adapter ${d} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1582
+ );
1583
+ let a = n ? o.length > 1 ? `since :
1584
+ ` + o.map(Xe).join(`
1585
+ `) : " " + Xe(o[0]) : "as no adapter specified";
1586
+ throw new y(
1587
+ "There is no suitable adapter to dispatch the request " + a,
1588
+ "ERR_NOT_SUPPORT"
1589
+ );
1590
+ }
1591
+ return s;
1592
+ }
1593
+ const gt = {
1594
+ /**
1595
+ * Resolve an adapter from a list of adapter names or functions.
1596
+ * @type {Function}
1597
+ */
1598
+ getAdapter: ur,
1599
+ /**
1600
+ * Exposes all known adapters
1601
+ * @type {Object<string, Function|Object>}
1602
+ */
1603
+ adapters: ke
1604
+ };
1605
+ function Se(e) {
1606
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1607
+ throw new ae(null, e);
1608
+ }
1609
+ function Ge(e) {
1610
+ return Se(e), e.headers = U.from(e.headers), e.data = Re.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || ie.adapter, e)(e).then(
1611
+ function(r) {
1612
+ return Se(e), r.data = Re.call(e, e.transformResponse, r), r.headers = U.from(r.headers), r;
1613
+ },
1614
+ function(r) {
1615
+ return ht(r) || (Se(e), r && r.response && (r.response.data = Re.call(
1616
+ e,
1617
+ e.transformResponse,
1618
+ r.response
1619
+ ), r.response.headers = U.from(r.response.headers))), Promise.reject(r);
1620
+ }
1621
+ );
1622
+ }
1623
+ const Et = "1.14.0", we = {};
1624
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1625
+ we[e] = function(r) {
1626
+ return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1627
+ };
1628
+ });
1629
+ const Qe = {};
1630
+ we.transitional = function(t, n, r) {
1631
+ function s(i, o) {
1632
+ return "[Axios v" + Et + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
1633
+ }
1634
+ return (i, o, a) => {
1635
+ if (t === !1)
1636
+ throw new y(
1637
+ s(o, " has been removed" + (n ? " in " + n : "")),
1638
+ y.ERR_DEPRECATED
1639
+ );
1640
+ return n && !Qe[o] && (Qe[o] = !0, console.warn(
1641
+ s(
1642
+ o,
1643
+ " has been deprecated since v" + n + " and will be removed in the near future"
1644
+ )
1645
+ )), t ? t(i, o, a) : !0;
1646
+ };
1647
+ };
1648
+ we.spelling = function(t) {
1649
+ return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1650
+ };
1651
+ function fr(e, t, n) {
1652
+ if (typeof e != "object")
1653
+ throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
1654
+ const r = Object.keys(e);
1655
+ let s = r.length;
1656
+ for (; s-- > 0; ) {
1657
+ const i = r[s], o = t[i];
1658
+ if (o) {
1659
+ const a = e[i], d = a === void 0 || o(a, i, e);
1660
+ if (d !== !0)
1661
+ throw new y(
1662
+ "option " + i + " must be " + d,
1663
+ y.ERR_BAD_OPTION_VALUE
1664
+ );
1665
+ continue;
1666
+ }
1667
+ if (n !== !0)
1668
+ throw new y("Unknown option " + i, y.ERR_BAD_OPTION);
1669
+ }
1670
+ }
1671
+ const de = {
1672
+ assertOptions: fr,
1673
+ validators: we
1674
+ }, B = de.validators;
1675
+ let J = class {
1676
+ constructor(t) {
1677
+ this.defaults = t || {}, this.interceptors = {
1678
+ request: new je(),
1679
+ response: new je()
1680
+ };
1681
+ }
1682
+ /**
1683
+ * Dispatch a request
1684
+ *
1685
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1686
+ * @param {?Object} config
1687
+ *
1688
+ * @returns {Promise} The Promise to be fulfilled
1689
+ */
1690
+ async request(t, n) {
1691
+ try {
1692
+ return await this._request(t, n);
1693
+ } catch (r) {
1694
+ if (r instanceof Error) {
1695
+ let s = {};
1696
+ Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1697
+ const i = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1698
+ try {
1699
+ r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
1700
+ ` + i) : r.stack = i;
1701
+ } catch {
1702
+ }
1703
+ }
1704
+ throw r;
1705
+ }
1706
+ }
1707
+ _request(t, n) {
1708
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = K(this.defaults, n);
1709
+ const { transitional: r, paramsSerializer: s, headers: i } = n;
1710
+ r !== void 0 && de.assertOptions(
1711
+ r,
1712
+ {
1713
+ silentJSONParsing: B.transitional(B.boolean),
1714
+ forcedJSONParsing: B.transitional(B.boolean),
1715
+ clarifyTimeoutError: B.transitional(B.boolean),
1716
+ legacyInterceptorReqResOrdering: B.transitional(B.boolean)
1717
+ },
1718
+ !1
1719
+ ), s != null && (l.isFunction(s) ? n.paramsSerializer = {
1720
+ serialize: s
1721
+ } : de.assertOptions(
1722
+ s,
1723
+ {
1724
+ encode: B.function,
1725
+ serialize: B.function
1726
+ },
1727
+ !0
1728
+ )), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), de.assertOptions(
1729
+ n,
1730
+ {
1731
+ baseUrl: B.spelling("baseURL"),
1732
+ withXsrfToken: B.spelling("withXSRFToken")
1733
+ },
1734
+ !0
1735
+ ), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1736
+ let o = i && l.merge(i.common, i[n.method]);
1737
+ i && l.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (c) => {
1738
+ delete i[c];
1739
+ }), n.headers = U.concat(o, i);
1740
+ const a = [];
1741
+ let d = !0;
1742
+ this.interceptors.request.forEach(function(p) {
1743
+ if (typeof p.runWhen == "function" && p.runWhen(n) === !1)
1744
+ return;
1745
+ d = d && p.synchronous;
1746
+ const h = n.transitional || Ne;
1747
+ h && h.legacyInterceptorReqResOrdering ? a.unshift(p.fulfilled, p.rejected) : a.push(p.fulfilled, p.rejected);
1748
+ });
1749
+ const f = [];
1750
+ this.interceptors.response.forEach(function(p) {
1751
+ f.push(p.fulfilled, p.rejected);
1752
+ });
1753
+ let u, m = 0, w;
1754
+ if (!d) {
1755
+ const c = [Ge.bind(this), void 0];
1756
+ for (c.unshift(...a), c.push(...f), w = c.length, u = Promise.resolve(n); m < w; )
1757
+ u = u.then(c[m++], c[m++]);
1758
+ return u;
1759
+ }
1760
+ w = a.length;
1761
+ let g = n;
1762
+ for (; m < w; ) {
1763
+ const c = a[m++], p = a[m++];
1764
+ try {
1765
+ g = c(g);
1766
+ } catch (h) {
1767
+ p.call(this, h);
1768
+ break;
1769
+ }
1770
+ }
1771
+ try {
1772
+ u = Ge.call(this, g);
1773
+ } catch (c) {
1774
+ return Promise.reject(c);
1775
+ }
1776
+ for (m = 0, w = f.length; m < w; )
1777
+ u = u.then(f[m++], f[m++]);
1778
+ return u;
1779
+ }
1780
+ getUri(t) {
1781
+ t = K(this.defaults, t);
1782
+ const n = yt(t.baseURL, t.url, t.allowAbsoluteUrls);
1783
+ return dt(n, t.params, t.paramsSerializer);
1784
+ }
1785
+ };
1786
+ l.forEach(["delete", "get", "head", "options"], function(t) {
1787
+ J.prototype[t] = function(n, r) {
1788
+ return this.request(
1789
+ K(r || {}, {
1790
+ method: t,
1791
+ url: n,
1792
+ data: (r || {}).data
1793
+ })
1794
+ );
1795
+ };
1796
+ });
1797
+ l.forEach(["post", "put", "patch"], function(t) {
1798
+ function n(r) {
1799
+ return function(i, o, a) {
1800
+ return this.request(
1801
+ K(a || {}, {
1802
+ method: t,
1803
+ headers: r ? {
1804
+ "Content-Type": "multipart/form-data"
1805
+ } : {},
1806
+ url: i,
1807
+ data: o
1808
+ })
1809
+ );
1810
+ };
1811
+ }
1812
+ J.prototype[t] = n(), J.prototype[t + "Form"] = n(!0);
1813
+ });
1814
+ let dr = class Rt {
1815
+ constructor(t) {
1816
+ if (typeof t != "function")
1817
+ throw new TypeError("executor must be a function.");
1818
+ let n;
1819
+ this.promise = new Promise(function(i) {
1820
+ n = i;
1821
+ });
1822
+ const r = this;
1823
+ this.promise.then((s) => {
1824
+ if (!r._listeners) return;
1825
+ let i = r._listeners.length;
1826
+ for (; i-- > 0; )
1827
+ r._listeners[i](s);
1828
+ r._listeners = null;
1829
+ }), this.promise.then = (s) => {
1830
+ let i;
1831
+ const o = new Promise((a) => {
1832
+ r.subscribe(a), i = a;
1833
+ }).then(s);
1834
+ return o.cancel = function() {
1835
+ r.unsubscribe(i);
1836
+ }, o;
1837
+ }, t(function(i, o, a) {
1838
+ r.reason || (r.reason = new ae(i, o, a), n(r.reason));
1839
+ });
1840
+ }
1841
+ /**
1842
+ * Throws a `CanceledError` if cancellation has been requested.
1843
+ */
1844
+ throwIfRequested() {
1845
+ if (this.reason)
1846
+ throw this.reason;
1847
+ }
1848
+ /**
1849
+ * Subscribe to the cancel signal
1850
+ */
1851
+ subscribe(t) {
1852
+ if (this.reason) {
1853
+ t(this.reason);
1854
+ return;
1855
+ }
1856
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
1857
+ }
1858
+ /**
1859
+ * Unsubscribe from the cancel signal
1860
+ */
1861
+ unsubscribe(t) {
1862
+ if (!this._listeners)
1863
+ return;
1864
+ const n = this._listeners.indexOf(t);
1865
+ n !== -1 && this._listeners.splice(n, 1);
1866
+ }
1867
+ toAbortSignal() {
1868
+ const t = new AbortController(), n = (r) => {
1869
+ t.abort(r);
1870
+ };
1871
+ return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1872
+ }
1873
+ /**
1874
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1875
+ * cancels the `CancelToken`.
1876
+ */
1877
+ static source() {
1878
+ let t;
1879
+ return {
1880
+ token: new Rt(function(s) {
1881
+ t = s;
1882
+ }),
1883
+ cancel: t
1884
+ };
1885
+ }
1886
+ };
1887
+ function pr(e) {
1888
+ return function(n) {
1889
+ return e.apply(null, n);
1890
+ };
1891
+ }
1892
+ function hr(e) {
1893
+ return l.isObject(e) && e.isAxiosError === !0;
1894
+ }
1895
+ const Pe = {
1896
+ Continue: 100,
1897
+ SwitchingProtocols: 101,
1898
+ Processing: 102,
1899
+ EarlyHints: 103,
1900
+ Ok: 200,
1901
+ Created: 201,
1902
+ Accepted: 202,
1903
+ NonAuthoritativeInformation: 203,
1904
+ NoContent: 204,
1905
+ ResetContent: 205,
1906
+ PartialContent: 206,
1907
+ MultiStatus: 207,
1908
+ AlreadyReported: 208,
1909
+ ImUsed: 226,
1910
+ MultipleChoices: 300,
1911
+ MovedPermanently: 301,
1912
+ Found: 302,
1913
+ SeeOther: 303,
1914
+ NotModified: 304,
1915
+ UseProxy: 305,
1916
+ Unused: 306,
1917
+ TemporaryRedirect: 307,
1918
+ PermanentRedirect: 308,
1919
+ BadRequest: 400,
1920
+ Unauthorized: 401,
1921
+ PaymentRequired: 402,
1922
+ Forbidden: 403,
1923
+ NotFound: 404,
1924
+ MethodNotAllowed: 405,
1925
+ NotAcceptable: 406,
1926
+ ProxyAuthenticationRequired: 407,
1927
+ RequestTimeout: 408,
1928
+ Conflict: 409,
1929
+ Gone: 410,
1930
+ LengthRequired: 411,
1931
+ PreconditionFailed: 412,
1932
+ PayloadTooLarge: 413,
1933
+ UriTooLong: 414,
1934
+ UnsupportedMediaType: 415,
1935
+ RangeNotSatisfiable: 416,
1936
+ ExpectationFailed: 417,
1937
+ ImATeapot: 418,
1938
+ MisdirectedRequest: 421,
1939
+ UnprocessableEntity: 422,
1940
+ Locked: 423,
1941
+ FailedDependency: 424,
1942
+ TooEarly: 425,
1943
+ UpgradeRequired: 426,
1944
+ PreconditionRequired: 428,
1945
+ TooManyRequests: 429,
1946
+ RequestHeaderFieldsTooLarge: 431,
1947
+ UnavailableForLegalReasons: 451,
1948
+ InternalServerError: 500,
1949
+ NotImplemented: 501,
1950
+ BadGateway: 502,
1951
+ ServiceUnavailable: 503,
1952
+ GatewayTimeout: 504,
1953
+ HttpVersionNotSupported: 505,
1954
+ VariantAlsoNegotiates: 506,
1955
+ InsufficientStorage: 507,
1956
+ LoopDetected: 508,
1957
+ NotExtended: 510,
1958
+ NetworkAuthenticationRequired: 511,
1959
+ WebServerIsDown: 521,
1960
+ ConnectionTimedOut: 522,
1961
+ OriginIsUnreachable: 523,
1962
+ TimeoutOccurred: 524,
1963
+ SslHandshakeFailed: 525,
1964
+ InvalidSslCertificate: 526
1965
+ };
1966
+ Object.entries(Pe).forEach(([e, t]) => {
1967
+ Pe[t] = e;
1968
+ });
1969
+ function St(e) {
1970
+ const t = new J(e), n = tt(J.prototype.request, t);
1971
+ return l.extend(n, J.prototype, t, { allOwnKeys: !0 }), l.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1972
+ return St(K(e, s));
1973
+ }, n;
1974
+ }
1975
+ const A = St(ie);
1976
+ A.Axios = J;
1977
+ A.CanceledError = ae;
1978
+ A.CancelToken = dr;
1979
+ A.isCancel = ht;
1980
+ A.VERSION = Et;
1981
+ A.toFormData = be;
1982
+ A.AxiosError = y;
1983
+ A.Cancel = A.CanceledError;
1984
+ A.all = function(t) {
1985
+ return Promise.all(t);
1986
+ };
1987
+ A.spread = pr;
1988
+ A.isAxiosError = hr;
1989
+ A.mergeConfig = K;
1990
+ A.AxiosHeaders = U;
1991
+ A.formToJSON = (e) => pt(l.isHTMLForm(e) ? new FormData(e) : e);
1992
+ A.getAdapter = gt.getAdapter;
1993
+ A.HttpStatusCode = Pe;
1994
+ A.default = A;
1995
+ const {
1996
+ Axios: Rr,
1997
+ AxiosError: Sr,
1998
+ CanceledError: Or,
1999
+ isCancel: Ar,
2000
+ CancelToken: Tr,
2001
+ VERSION: Cr,
2002
+ all: Pr,
2003
+ Cancel: xr,
2004
+ isAxiosError: _r,
2005
+ spread: Nr,
2006
+ toFormData: Ur,
2007
+ AxiosHeaders: kr,
2008
+ HttpStatusCode: Fr,
2009
+ formToJSON: vr,
2010
+ getAdapter: Br,
2011
+ mergeConfig: Ir
2012
+ } = A, Ot = A.create({
2013
+ baseURL: "http://t1.lingganai.cyou:90",
2014
+ // Assuming backend runs on 8080
2015
+ timeout: 1e4
2016
+ });
2017
+ Ot.interceptors.response.use(
2018
+ (e) => {
2019
+ const t = e.data;
2020
+ return t.code === 200 ? t.data : Promise.reject(new Error(t.message || "Error"));
2021
+ },
2022
+ (e) => Promise.reject(e)
2023
+ );
2024
+ const Oe = (e, t) => Ot.post("/api/screen/control", {
2025
+ screenClientId: e,
2026
+ action: t
2027
+ }), mr = /* @__PURE__ */ Ze({
134
2028
  __name: "VirtualHumanEventAdapter",
135
2029
  props: {
136
2030
  // 屏幕客户端ID
@@ -145,114 +2039,162 @@ const M = ["src", "muted"], z = /* @__PURE__ */ H({
145
2039
  }
146
2040
  },
147
2041
  emits: ["eventNotifaction", "controlEvent", "end", "pause", "connected", "error", "playComplete"],
148
- setup(r, { emit: b }) {
149
- const e = r, n = b, a = g(null), h = g(!1);
150
- let t = null, d = 0, f = !1, m = 0, v = !1;
151
- const S = () => {
152
- t || (t = new (window.AudioContext || window.webkitAudioContext)({
2042
+ setup(e, { expose: t, emit: n }) {
2043
+ const r = e, s = n, i = Q(null), o = Q(!1);
2044
+ let a = null, d = 0, f = !1, u = 0, m = !1;
2045
+ const w = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
2046
+ let p = null;
2047
+ t({
2048
+ pause: () => o.value ? Oe(r.screenClientId, "pause").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1),
2049
+ resume: () => o.value ? Oe(r.screenClientId, "resume").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1),
2050
+ stop: () => o.value ? Oe(r.screenClientId, "stop").then(() => Promise.resolve(!0)).catch(() => Promise.reject(!1)) : Promise.reject(!1)
2051
+ });
2052
+ const O = (b) => {
2053
+ if (typeof b == "number" && Number.isFinite(b)) return b;
2054
+ if (typeof b == "string" && b.trim() !== "") {
2055
+ const E = Number(b);
2056
+ if (Number.isFinite(E)) return E;
2057
+ }
2058
+ return null;
2059
+ }, T = () => {
2060
+ p !== null && (window.clearInterval(p), p = null);
2061
+ }, _ = () => {
2062
+ T(), w.clear(), g.clear(), c.clear();
2063
+ }, L = () => {
2064
+ for (const [b] of w)
2065
+ if (!g.has(b) && c.has(b)) return !0;
2066
+ return !1;
2067
+ }, C = () => {
2068
+ if (!(!a || a.state !== "running")) {
2069
+ for (const [b, E] of c) {
2070
+ if (g.has(b)) continue;
2071
+ const R = w.get(b);
2072
+ R && a.currentTime + 5e-3 >= E && (g.add(b), w.delete(b), s("eventNotifaction", R));
2073
+ }
2074
+ L() || T();
2075
+ }
2076
+ }, z = () => {
2077
+ p === null && L() && (p = window.setInterval(() => {
2078
+ C();
2079
+ }, 30));
2080
+ }, X = () => {
2081
+ a || (a = new (window.AudioContext || window.webkitAudioContext)({
153
2082
  sampleRate: 24e3
154
- })), t.state === "suspended" && !v && t.resume();
155
- }, k = () => {
156
- f && m === 0 && (n("playComplete", e.screenClientId), f = !1);
157
- }, i = (s) => {
158
- if (S(), !!t)
2083
+ })), a.state === "suspended" && !m && a.resume();
2084
+ }, ee = () => {
2085
+ f && u === 0 && (s("playComplete", r.screenClientId), f = !1);
2086
+ }, le = (b, E) => {
2087
+ if (X(), !!a)
159
2088
  try {
160
- const o = window.atob(s), l = o.length, y = new Uint8Array(l);
161
- for (let p = 0; p < l; p++)
162
- y[p] = o.charCodeAt(p);
163
- const w = new Int16Array(y.buffer), V = new Float32Array(w.length);
164
- for (let p = 0; p < w.length; p++)
165
- V[p] = w[p] / 32768;
166
- const I = t.createBuffer(1, V.length, 24e3);
167
- I.getChannelData(0).set(V);
168
- const P = t.createBufferSource();
169
- P.buffer = I, P.connect(t.destination), d < t.currentTime && (d = t.currentTime), P.start(d), d += I.duration, m++, P.onended = () => {
170
- m--, k();
2089
+ const R = window.atob(b), P = R.length, M = new Uint8Array(P);
2090
+ for (let v = 0; v < P; v++)
2091
+ M[v] = R.charCodeAt(v);
2092
+ const D = new Int16Array(M.buffer), F = new Float32Array(D.length);
2093
+ for (let v = 0; v < D.length; v++)
2094
+ F[v] = D[v] / 32768;
2095
+ const j = a.createBuffer(1, F.length, 24e3);
2096
+ j.getChannelData(0).set(F);
2097
+ const $ = a.createBufferSource();
2098
+ $.buffer = j, $.connect(a.destination);
2099
+ const V = d < a.currentTime ? a.currentTime : d;
2100
+ E !== null && !c.has(E) && (c.set(E, V), C(), z()), $.start(V), d = V + j.duration, u++, $.onended = () => {
2101
+ u--, ee();
171
2102
  };
172
- } catch (o) {
173
- console.error("[VirtualHumanEventAdapter] Failed to decode and play audio:", o);
2103
+ } catch (R) {
2104
+ console.error("[VirtualHumanEventAdapter] Failed to decode and play audio:", R);
174
2105
  }
175
- }, u = (s) => {
176
- switch (s) {
2106
+ }, G = (b) => {
2107
+ switch (b) {
177
2108
  case "play":
178
- f = !1, m = 0, d = 0, v = !1, t && t.state === "suspended" && t.resume();
2109
+ _(), f = !1, u = 0, d = 0, m = !1, a && a.state === "suspended" && a.resume();
179
2110
  break;
180
2111
  case "resume":
181
- v = !1, t && t.state === "suspended" && t.resume();
2112
+ m = !1, a && a.state === "suspended" && a.resume(), C(), z();
182
2113
  break;
183
2114
  case "pause":
184
- v = !0, t && t.state === "running" && t.suspend();
2115
+ m = !0, a && a.state === "running" && a.suspend();
185
2116
  break;
186
2117
  case "stop":
187
- v = !1, t && (t.close(), t = null), d = 0, f = !1, m = 0;
2118
+ _(), m = !1, a && (a.close(), a = null), d = 0, f = !1, u = 0;
188
2119
  break;
189
2120
  case "tts_complete":
190
- f = !0, k();
2121
+ f = !0, ee();
191
2122
  break;
192
2123
  default:
193
- console.warn(`[VirtualHumanEventAdapter] Unknown control action: ${s}`);
2124
+ console.warn(`[VirtualHumanEventAdapter] Unknown control action: ${b}`);
194
2125
  }
195
- }, c = () => {
196
- a.value && a.value.close();
2126
+ }, H = () => {
2127
+ i.value && i.value.close();
197
2128
  try {
198
- const s = new URL(e.wsUrl);
199
- s.searchParams.append("sessionId", e.screenClientId + "-event"), a.value = new WebSocket(s.toString()), a.value.onopen = () => {
200
- h.value = !0, n("connected"), console.log(`[VirtualHumanEventAdapter] Connected to ${e.wsUrl} for session ${e.screenClientId}-event`);
201
- }, a.value.onmessage = (o) => {
2129
+ const b = new URL(r.wsUrl);
2130
+ b.searchParams.append("sessionId", r.screenClientId + "-event"), i.value = new WebSocket(b.toString()), i.value.onopen = () => {
2131
+ o.value = !0, s("connected"), console.log(`[VirtualHumanEventAdapter] Connected to ${r.wsUrl} for session ${r.screenClientId}-event`);
2132
+ }, i.value.onmessage = (E) => {
202
2133
  try {
203
- const l = JSON.parse(o.data);
204
- x(l);
205
- } catch (l) {
206
- console.error("[VirtualHumanEventAdapter] Failed to parse message:", o.data, l);
2134
+ const R = JSON.parse(E.data);
2135
+ q(R);
2136
+ } catch (R) {
2137
+ console.error("[VirtualHumanEventAdapter] Failed to parse message:", E.data, R);
207
2138
  }
208
- }, a.value.onerror = (o) => {
209
- console.error("[VirtualHumanEventAdapter] WebSocket error:", o), n("error", o);
210
- }, a.value.onclose = () => {
211
- h.value = !1, console.log("[VirtualHumanEventAdapter] WebSocket disconnected");
2139
+ }, i.value.onerror = (E) => {
2140
+ console.error("[VirtualHumanEventAdapter] WebSocket error:", E), s("error", E);
2141
+ }, i.value.onclose = () => {
2142
+ o.value = !1, console.log("[VirtualHumanEventAdapter] WebSocket disconnected");
212
2143
  };
213
- } catch (s) {
214
- console.error("[VirtualHumanEventAdapter] Failed to initialize WebSocket:", s), n("error", s);
2144
+ } catch (b) {
2145
+ console.error("[VirtualHumanEventAdapter] Failed to initialize WebSocket:", b), s("error", b);
215
2146
  }
216
- }, x = (s) => {
217
- const { type: o, payload: l, action: y } = s;
218
- switch (o) {
2147
+ }, q = (b) => {
2148
+ const { type: E, payload: R, action: P } = b;
2149
+ switch (E) {
219
2150
  case "audio":
220
- const w = (l == null ? void 0 : l.data) || s.data;
221
- w && i(w);
2151
+ const M = (R == null ? void 0 : R.data) || b.data;
2152
+ if (M) {
2153
+ const D = O((R == null ? void 0 : R.index) ?? b.index);
2154
+ le(M, D);
2155
+ }
222
2156
  break;
223
2157
  case "send_event":
224
- s.event && (console.log("adapter send_event:", s), n("eventNotifaction", s));
2158
+ if (b.event) {
2159
+ console.log("adapter send_event:", b);
2160
+ const D = O(b.index);
2161
+ if (D === null) {
2162
+ s("eventNotifaction", b);
2163
+ break;
2164
+ }
2165
+ w.set(D, b), C(), z();
2166
+ }
225
2167
  break;
226
2168
  case "control":
227
- y && (console.log("adapter control:", y), n("controlEvent", y), u(y));
2169
+ P && (console.log("adapter control:", P), s("controlEvent", P), G(P));
228
2170
  break;
229
2171
  case "end":
230
- console.log("adapter end:", l), n("end", l);
2172
+ console.log("adapter end:", R), s("end", R);
231
2173
  break;
232
2174
  case "pause":
233
- console.log("adapter pause:", l), n("pause", l);
2175
+ console.log("adapter pause:", R), s("pause", R);
234
2176
  break;
235
2177
  default:
236
- console.warn(`[VirtualHumanEventAdapter] Unknown message type: ${o}`);
2178
+ console.warn(`[VirtualHumanEventAdapter] Unknown message type: ${E}`);
237
2179
  }
238
2180
  };
239
- return C(() => e.screenClientId, () => {
240
- e.screenClientId && e.wsUrl && c();
241
- }), C(() => e.wsUrl, () => {
242
- e.screenClientId && e.wsUrl && c();
243
- }), E(() => {
244
- e.screenClientId && e.wsUrl && c();
245
- }), _(() => {
246
- a.value && a.value.close(), t && t.close();
247
- }), (s, o) => q(s.$slots, "default");
248
- }
249
- }), L = (r) => {
250
- r.component("VirtualHumanPersona", O), r.component("VirtualHumanEventAdapter", J);
251
- }, G = {
252
- install: L
2181
+ return ne(() => r.screenClientId, () => {
2182
+ r.screenClientId && r.wsUrl && H();
2183
+ }), ne(() => r.wsUrl, () => {
2184
+ r.screenClientId && r.wsUrl && H();
2185
+ }), Ye(() => {
2186
+ r.screenClientId && r.wsUrl && H();
2187
+ }), et(() => {
2188
+ i.value && i.value.close(), a && a.close();
2189
+ }), (b, E) => Ut(b.$slots, "default");
2190
+ }
2191
+ }), yr = (e) => {
2192
+ e.component("VirtualHumanPersona", Bt), e.component("VirtualHumanEventAdapter", mr);
2193
+ }, Lr = {
2194
+ install: yr
253
2195
  };
254
2196
  export {
255
- J as VirtualHumanEventAdapter,
256
- O as VirtualHumanPersona,
257
- G as default
2197
+ mr as VirtualHumanEventAdapter,
2198
+ Bt as VirtualHumanPersona,
2199
+ Lr as default
258
2200
  };