@foisit/vue-wrapper 2.4.5 → 3.1.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.
- package/README.md +63 -4
- package/index.d.ts +1 -0
- package/index.mjs +636 -398
- package/lib/services/AssistantService.d.ts +1 -1
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
const se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {}, ze = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [],
|
|
6
|
+
const se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {}, ze = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [], ve = () => {
|
|
7
7
|
}, Be = (i) => i.charCodeAt(0) === 111 && i.charCodeAt(1) === 110 && // uppercase letter
|
|
8
|
-
(i.charCodeAt(2) > 122 || i.charCodeAt(2) < 97),
|
|
8
|
+
(i.charCodeAt(2) > 122 || i.charCodeAt(2) < 97), W = Object.assign, L = Array.isArray, R = (i) => typeof i == "function", $ = (i) => typeof i == "string", we = (i) => typeof i == "symbol", F = (i) => i !== null && typeof i == "object";
|
|
9
9
|
let he;
|
|
10
10
|
const Q = () => he || (he = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
11
11
|
function le(i) {
|
|
12
|
-
if (
|
|
12
|
+
if (L(i)) {
|
|
13
13
|
const e = {};
|
|
14
14
|
for (let t = 0; t < i.length; t++) {
|
|
15
|
-
const s = i[t], n =
|
|
15
|
+
const s = i[t], n = $(s) ? Ye(s) : le(s);
|
|
16
16
|
if (n)
|
|
17
17
|
for (const o in n)
|
|
18
18
|
e[o] = n[o];
|
|
19
19
|
}
|
|
20
20
|
return e;
|
|
21
|
-
} else if (
|
|
21
|
+
} else if ($(i) || F(i))
|
|
22
22
|
return i;
|
|
23
23
|
}
|
|
24
24
|
const Ue = /;(?![^(]*\))/g, We = /:([^]+)/, je = /\/\*[^]*?\*\//g;
|
|
@@ -33,14 +33,14 @@ function Ye(i) {
|
|
|
33
33
|
}
|
|
34
34
|
function ce(i) {
|
|
35
35
|
let e = "";
|
|
36
|
-
if (
|
|
36
|
+
if ($(i))
|
|
37
37
|
e = i;
|
|
38
|
-
else if (
|
|
38
|
+
else if (L(i))
|
|
39
39
|
for (let t = 0; t < i.length; t++) {
|
|
40
40
|
const s = ce(i[t]);
|
|
41
41
|
s && (e += s + " ");
|
|
42
42
|
}
|
|
43
|
-
else if (
|
|
43
|
+
else if (F(i))
|
|
44
44
|
for (const t in i)
|
|
45
45
|
i[t] && (e += t + " ");
|
|
46
46
|
return e.trim();
|
|
@@ -54,7 +54,7 @@ process.env.NODE_ENV;
|
|
|
54
54
|
process.env.NODE_ENV;
|
|
55
55
|
process.env.NODE_ENV;
|
|
56
56
|
new Set(
|
|
57
|
-
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((i) => i !== "arguments" && i !== "caller").map((i) => Symbol[i]).filter(
|
|
57
|
+
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((i) => i !== "arguments" && i !== "caller").map((i) => Symbol[i]).filter(we)
|
|
58
58
|
);
|
|
59
59
|
function Ce(i) {
|
|
60
60
|
return ne(i) ? Ce(i.__v_raw) : !!(i && i.__v_isReactive);
|
|
@@ -68,9 +68,9 @@ function Z(i) {
|
|
|
68
68
|
function oe(i) {
|
|
69
69
|
return i ? !!i.__v_raw : !1;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function H(i) {
|
|
72
72
|
const e = i && i.__v_raw;
|
|
73
|
-
return e ?
|
|
73
|
+
return e ? H(e) : i;
|
|
74
74
|
}
|
|
75
75
|
function de(i) {
|
|
76
76
|
return i ? i.__v_isRef === !0 : !1;
|
|
@@ -80,18 +80,18 @@ function de(i) {
|
|
|
80
80
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
81
81
|
* @license MIT
|
|
82
82
|
**/
|
|
83
|
-
const
|
|
83
|
+
const P = [];
|
|
84
84
|
function Ge(i) {
|
|
85
|
-
|
|
85
|
+
P.push(i);
|
|
86
86
|
}
|
|
87
87
|
function Ke() {
|
|
88
|
-
|
|
88
|
+
P.pop();
|
|
89
89
|
}
|
|
90
90
|
let ee = !1;
|
|
91
|
-
function
|
|
91
|
+
function M(i, ...e) {
|
|
92
92
|
if (ee) return;
|
|
93
93
|
ee = !0;
|
|
94
|
-
const t =
|
|
94
|
+
const t = P.length ? P[P.length - 1].component : null, s = t && t.appContext.config.warnHandler, n = Je();
|
|
95
95
|
if (s)
|
|
96
96
|
ue(
|
|
97
97
|
s,
|
|
@@ -119,7 +119,7 @@ function _(i, ...e) {
|
|
|
119
119
|
ee = !1;
|
|
120
120
|
}
|
|
121
121
|
function Je() {
|
|
122
|
-
let i =
|
|
122
|
+
let i = P[P.length - 1];
|
|
123
123
|
if (!i)
|
|
124
124
|
return [];
|
|
125
125
|
const e = [];
|
|
@@ -152,13 +152,13 @@ function Qe({ vnode: i, recurseCount: e }) {
|
|
|
152
152
|
function Ze(i) {
|
|
153
153
|
const e = [], t = Object.keys(i);
|
|
154
154
|
return t.slice(0, 3).forEach((s) => {
|
|
155
|
-
e.push(...
|
|
155
|
+
e.push(...ke(s, i[s]));
|
|
156
156
|
}), t.length > 3 && e.push(" ..."), e;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return
|
|
158
|
+
function ke(i, e, t) {
|
|
159
|
+
return $(e) ? (e = JSON.stringify(e), t ? e : [`${i}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? t ? e : [`${i}=${e}`] : de(e) ? (e = ke(i, H(e.value), !0), t ? e : [`${i}=Ref<`, e, ">"]) : R(e) ? [`${i}=fn${e.name ? `<${e.name}>` : ""}`] : (e = H(e), t ? e : [`${i}=`, e]);
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const Se = {
|
|
162
162
|
sp: "serverPrefetch hook",
|
|
163
163
|
bc: "beforeCreate hook",
|
|
164
164
|
c: "created hook",
|
|
@@ -195,19 +195,19 @@ function ue(i, e, t, s) {
|
|
|
195
195
|
try {
|
|
196
196
|
return s ? i(...s) : i();
|
|
197
197
|
} catch (n) {
|
|
198
|
-
|
|
198
|
+
Ee(n, e, t);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Ee(i, e, t, s = !0) {
|
|
202
202
|
const n = e ? e.vnode : null, { errorHandler: o, throwUnhandledErrorInProduction: a } = e && e.appContext.config || se;
|
|
203
203
|
if (e) {
|
|
204
204
|
let r = e.parent;
|
|
205
|
-
const
|
|
205
|
+
const l = e.proxy, m = process.env.NODE_ENV !== "production" ? Se[t] : `https://vuejs.org/error-reference/#runtime-${t}`;
|
|
206
206
|
for (; r; ) {
|
|
207
207
|
const d = r.ec;
|
|
208
208
|
if (d) {
|
|
209
|
-
for (let
|
|
210
|
-
if (d[
|
|
209
|
+
for (let c = 0; c < d.length; c++)
|
|
210
|
+
if (d[c](i, l, m) === !1)
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
r = r.parent;
|
|
@@ -215,8 +215,8 @@ function ke(i, e, t, s = !0) {
|
|
|
215
215
|
if (o) {
|
|
216
216
|
ue(o, null, 10, [
|
|
217
217
|
i,
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
l,
|
|
219
|
+
m
|
|
220
220
|
]);
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
@@ -225,8 +225,8 @@ function ke(i, e, t, s = !0) {
|
|
|
225
225
|
}
|
|
226
226
|
function et(i, e, t, s = !0, n = !1) {
|
|
227
227
|
if (process.env.NODE_ENV !== "production") {
|
|
228
|
-
const o =
|
|
229
|
-
if (t && Ge(t),
|
|
228
|
+
const o = Se[e];
|
|
229
|
+
if (t && Ge(t), M(`Unhandled error${o ? ` during execution of ${o}` : ""}`), t && Ke(), s)
|
|
230
230
|
throw i;
|
|
231
231
|
console.error(i);
|
|
232
232
|
} else {
|
|
@@ -235,57 +235,57 @@ function et(i, e, t, s = !0, n = !1) {
|
|
|
235
235
|
console.error(i);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const
|
|
239
|
-
let
|
|
240
|
-
const
|
|
241
|
-
let
|
|
238
|
+
const _ = [];
|
|
239
|
+
let N = -1;
|
|
240
|
+
const z = [];
|
|
241
|
+
let O = null, D = 0;
|
|
242
242
|
const tt = /* @__PURE__ */ Promise.resolve();
|
|
243
243
|
let re = null;
|
|
244
244
|
const it = 100;
|
|
245
245
|
function st(i) {
|
|
246
|
-
let e =
|
|
246
|
+
let e = N + 1, t = _.length;
|
|
247
247
|
for (; e < t; ) {
|
|
248
|
-
const s = e + t >>> 1, n =
|
|
248
|
+
const s = e + t >>> 1, n = _[s], o = B(n);
|
|
249
249
|
o < i || o === i && n.flags & 2 ? e = s + 1 : t = s;
|
|
250
250
|
}
|
|
251
251
|
return e;
|
|
252
252
|
}
|
|
253
253
|
function nt(i) {
|
|
254
254
|
if (!(i.flags & 1)) {
|
|
255
|
-
const e =
|
|
255
|
+
const e = B(i), t = _[_.length - 1];
|
|
256
256
|
!t || // fast path when the job id is larger than the tail
|
|
257
|
-
!(i.flags & 2) && e >=
|
|
257
|
+
!(i.flags & 2) && e >= B(t) ? _.push(i) : _.splice(st(e), 0, i), i.flags |= 1, _e();
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
function _e() {
|
|
261
261
|
re || (re = tt.then(Ae));
|
|
262
262
|
}
|
|
263
263
|
function ot(i) {
|
|
264
|
-
|
|
264
|
+
L(i) ? z.push(...i) : O && i.id === -1 ? O.splice(D + 1, 0, i) : i.flags & 1 || (z.push(i), i.flags |= 1), _e();
|
|
265
265
|
}
|
|
266
266
|
function rt(i) {
|
|
267
|
-
if (
|
|
268
|
-
const e = [...new Set(
|
|
269
|
-
(t, s) =>
|
|
267
|
+
if (z.length) {
|
|
268
|
+
const e = [...new Set(z)].sort(
|
|
269
|
+
(t, s) => B(t) - B(s)
|
|
270
270
|
);
|
|
271
|
-
if (
|
|
272
|
-
|
|
271
|
+
if (z.length = 0, O) {
|
|
272
|
+
O.push(...e);
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
|
-
for (
|
|
276
|
-
const t =
|
|
275
|
+
for (O = e, process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map()), D = 0; D < O.length; D++) {
|
|
276
|
+
const t = O[D];
|
|
277
277
|
process.env.NODE_ENV !== "production" && Le(i, t) || (t.flags & 4 && (t.flags &= -2), t.flags & 8 || t(), t.flags &= -2);
|
|
278
278
|
}
|
|
279
|
-
|
|
279
|
+
O = null, D = 0;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const B = (i) => i.id == null ? i.flags & 2 ? -1 : 1 / 0 : i.id;
|
|
283
283
|
function Ae(i) {
|
|
284
284
|
process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map());
|
|
285
|
-
const e = process.env.NODE_ENV !== "production" ? (t) => Le(i, t) :
|
|
285
|
+
const e = process.env.NODE_ENV !== "production" ? (t) => Le(i, t) : ve;
|
|
286
286
|
try {
|
|
287
|
-
for (
|
|
288
|
-
const t =
|
|
287
|
+
for (N = 0; N < _.length; N++) {
|
|
288
|
+
const t = _[N];
|
|
289
289
|
if (t && !(t.flags & 8)) {
|
|
290
290
|
if (process.env.NODE_ENV !== "production" && e(t))
|
|
291
291
|
continue;
|
|
@@ -297,18 +297,18 @@ function Ae(i) {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
} finally {
|
|
300
|
-
for (;
|
|
301
|
-
const t =
|
|
300
|
+
for (; N < _.length; N++) {
|
|
301
|
+
const t = _[N];
|
|
302
302
|
t && (t.flags &= -2);
|
|
303
303
|
}
|
|
304
|
-
|
|
304
|
+
N = -1, _.length = 0, rt(i), re = null, (_.length || z.length) && Ae(i);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
function Le(i, e) {
|
|
308
308
|
const t = i.get(e) || 0;
|
|
309
309
|
if (t > it) {
|
|
310
310
|
const s = e.i, n = s && Pe(s.type);
|
|
311
|
-
return
|
|
311
|
+
return Ee(
|
|
312
312
|
`Maximum recursive updates exceeded${n ? ` in component <${n}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
|
|
313
313
|
null,
|
|
314
314
|
10
|
|
@@ -357,7 +357,7 @@ function ct(i, e) {
|
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
359
|
function pe(i, e) {
|
|
360
|
-
|
|
360
|
+
W(i, e);
|
|
361
361
|
for (const t in i)
|
|
362
362
|
t !== "__file" && !(t in e) && delete i[t];
|
|
363
363
|
}
|
|
@@ -372,100 +372,100 @@ function ie(i) {
|
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
let
|
|
375
|
+
let q, j = [];
|
|
376
376
|
function Me(i, e) {
|
|
377
377
|
var t, s;
|
|
378
|
-
|
|
378
|
+
q = i, q ? (q.enabled = !0, j.forEach(({ event: n, args: o }) => q.emit(n, ...o)), j = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
|
|
379
379
|
window.HTMLElement && // also exclude jsdom
|
|
380
380
|
// eslint-disable-next-line no-restricted-syntax
|
|
381
381
|
!((s = (t = window.navigator) == null ? void 0 : t.userAgent) != null && s.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((o) => {
|
|
382
382
|
Me(o, e);
|
|
383
383
|
}), setTimeout(() => {
|
|
384
|
-
|
|
384
|
+
q || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, j = []);
|
|
385
385
|
}, 3e3)) : j = [];
|
|
386
386
|
}
|
|
387
|
-
let
|
|
387
|
+
let T = null, dt = null;
|
|
388
388
|
function ut(i, e) {
|
|
389
|
-
if (process.env.NODE_ENV !== "production" && (!
|
|
390
|
-
let t =
|
|
391
|
-
const s =
|
|
392
|
-
s === t && (t =
|
|
389
|
+
if (process.env.NODE_ENV !== "production" && (!I || I.isMounted) && M("provide() can only be used inside setup()."), I) {
|
|
390
|
+
let t = I.provides;
|
|
391
|
+
const s = I.parent && I.parent.provides;
|
|
392
|
+
s === t && (t = I.provides = Object.create(s)), t[i] = e;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
function ft(i, e, t = !1) {
|
|
396
|
-
const s =
|
|
397
|
-
if (s ||
|
|
396
|
+
const s = Nt();
|
|
397
|
+
if (s || xt) {
|
|
398
398
|
let n = s ? s.parent == null || s.ce ? s.vnode.appContext && s.vnode.appContext.provides : s.parent.provides : void 0;
|
|
399
399
|
if (n && i in n)
|
|
400
400
|
return n[i];
|
|
401
401
|
if (arguments.length > 1)
|
|
402
|
-
return t &&
|
|
403
|
-
process.env.NODE_ENV !== "production" &&
|
|
404
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
402
|
+
return t && R(e) ? e.call(s && s.proxy) : e;
|
|
403
|
+
process.env.NODE_ENV !== "production" && M(`injection "${String(i)}" not found.`);
|
|
404
|
+
} else process.env.NODE_ENV !== "production" && M("inject() can only be used inside setup() or functional components.");
|
|
405
405
|
}
|
|
406
406
|
const mt = (i) => i.__isTeleport;
|
|
407
|
-
function
|
|
408
|
-
i.shapeFlag & 6 && i.component ? (i.transition = e,
|
|
407
|
+
function Ne(i, e) {
|
|
408
|
+
i.shapeFlag & 6 && i.component ? (i.transition = e, Ne(i.component.subTree, e)) : i.shapeFlag & 128 ? (i.ssContent.transition = e.clone(i.ssContent), i.ssFallback.transition = e.clone(i.ssFallback)) : i.transition = e;
|
|
409
409
|
}
|
|
410
410
|
// @__NO_SIDE_EFFECTS__
|
|
411
411
|
function ht(i, e) {
|
|
412
|
-
return
|
|
412
|
+
return R(i) ? (
|
|
413
413
|
// #8236: extend call and options.name access are considered side-effects
|
|
414
414
|
// by Rollup, so we have to wrap it in a pure-annotated IIFE.
|
|
415
|
-
|
|
415
|
+
W({ name: i.name }, e, { setup: i })
|
|
416
416
|
) : i;
|
|
417
417
|
}
|
|
418
418
|
Q().requestIdleCallback;
|
|
419
419
|
Q().cancelIdleCallback;
|
|
420
420
|
const pt = (i) => !!i.type.__asyncLoader, gt = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
421
|
-
function
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
return ge(),
|
|
425
|
-
|
|
421
|
+
function bt(i, e, t = {}, s, n) {
|
|
422
|
+
if (T.ce || T.parent && pt(T.parent) && T.parent.ce) {
|
|
423
|
+
const m = Object.keys(t).length > 0;
|
|
424
|
+
return ge(), be(
|
|
425
|
+
U,
|
|
426
426
|
null,
|
|
427
427
|
[fe("slot", t, s)],
|
|
428
|
-
|
|
428
|
+
m ? -2 : 64
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
let o = i[e];
|
|
432
|
-
process.env.NODE_ENV !== "production" && o && o.length > 1 && (
|
|
432
|
+
process.env.NODE_ENV !== "production" && o && o.length > 1 && (M(
|
|
433
433
|
"SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."
|
|
434
434
|
), o = () => []), o && o._c && (o._d = !1), ge();
|
|
435
|
-
const a = o &&
|
|
435
|
+
const a = o && Ie(o(t)), r = t.key || // slot content array of a dynamic conditional slot may have a branch
|
|
436
436
|
// key attached in the `createSlots` helper, respect that
|
|
437
|
-
a && a.key,
|
|
438
|
-
|
|
437
|
+
a && a.key, l = be(
|
|
438
|
+
U,
|
|
439
439
|
{
|
|
440
|
-
key: (r && !
|
|
440
|
+
key: (r && !we(r) ? r : `_${e}`) + // #7256 force differentiate fallback content from actual content
|
|
441
441
|
(!a && s ? "_fb" : "")
|
|
442
442
|
},
|
|
443
443
|
a || [],
|
|
444
444
|
a && i._ === 1 ? 64 : -2
|
|
445
445
|
);
|
|
446
|
-
return
|
|
446
|
+
return l.scopeId && (l.slotScopeIds = [l.scopeId + "-s"]), o && o._c && (o._d = !0), l;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
return i.some((e) => Oe(e) ? !(e.type ===
|
|
448
|
+
function Ie(i) {
|
|
449
|
+
return i.some((e) => Oe(e) ? !(e.type === Re || e.type === U && !Ie(e.children)) : !0) ? i : null;
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
process.env.NODE_ENV !== "production" && (
|
|
451
|
+
const yt = {};
|
|
452
|
+
process.env.NODE_ENV !== "production" && (yt.ownKeys = (i) => (M(
|
|
453
453
|
"Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
|
|
454
454
|
), Reflect.ownKeys(i)));
|
|
455
|
-
let
|
|
456
|
-
const
|
|
457
|
-
let
|
|
455
|
+
let xt = null;
|
|
456
|
+
const vt = {}, Te = (i) => Object.getPrototypeOf(i) === vt, wt = (i) => i.__isSuspense, U = /* @__PURE__ */ Symbol.for("v-fgt"), Ct = /* @__PURE__ */ Symbol.for("v-txt"), Re = /* @__PURE__ */ Symbol.for("v-cmt"), Y = [];
|
|
457
|
+
let A = null;
|
|
458
458
|
function ge(i = !1) {
|
|
459
|
-
Y.push(
|
|
459
|
+
Y.push(A = i ? null : []);
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
Y.pop(),
|
|
461
|
+
function kt() {
|
|
462
|
+
Y.pop(), A = Y[Y.length - 1] || null;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
return i.dynamicChildren =
|
|
464
|
+
function St(i) {
|
|
465
|
+
return i.dynamicChildren = A || ze, kt(), A && A.push(i), i;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
return
|
|
467
|
+
function be(i, e, t, s, n) {
|
|
468
|
+
return St(
|
|
469
469
|
fe(
|
|
470
470
|
i,
|
|
471
471
|
e,
|
|
@@ -479,15 +479,15 @@ function ye(i, e, t, s, n) {
|
|
|
479
479
|
function Oe(i) {
|
|
480
480
|
return i ? i.__v_isVNode === !0 : !1;
|
|
481
481
|
}
|
|
482
|
-
const
|
|
482
|
+
const Et = (...i) => Fe(
|
|
483
483
|
...i
|
|
484
484
|
), $e = ({ key: i }) => i ?? null, G = ({
|
|
485
485
|
ref: i,
|
|
486
486
|
ref_key: e,
|
|
487
487
|
ref_for: t
|
|
488
|
-
}) => (typeof i == "number" && (i = "" + i), i != null ?
|
|
489
|
-
function _t(i, e = null, t = null, s = 0, n = null, o = i ===
|
|
490
|
-
const
|
|
488
|
+
}) => (typeof i == "number" && (i = "" + i), i != null ? $(i) || de(i) || R(i) ? { i: T, r: i, k: e, f: !!t } : i : null);
|
|
489
|
+
function _t(i, e = null, t = null, s = 0, n = null, o = i === U ? 0 : 1, a = !1, r = !1) {
|
|
490
|
+
const l = {
|
|
491
491
|
__v_isVNode: !0,
|
|
492
492
|
__v_skip: !0,
|
|
493
493
|
type: i,
|
|
@@ -514,36 +514,36 @@ function _t(i, e = null, t = null, s = 0, n = null, o = i === q ? 0 : 1, a = !1,
|
|
|
514
514
|
dynamicProps: n,
|
|
515
515
|
dynamicChildren: null,
|
|
516
516
|
appContext: null,
|
|
517
|
-
ctx:
|
|
517
|
+
ctx: T
|
|
518
518
|
};
|
|
519
|
-
return r ? (me(
|
|
519
|
+
return r ? (me(l, t), o & 128 && i.normalize(l)) : t && (l.shapeFlag |= $(t) ? 8 : 16), process.env.NODE_ENV !== "production" && l.key !== l.key && M("VNode created with invalid key (NaN). VNode type:", l.type), // avoid a block node from tracking itself
|
|
520
520
|
!a && // has current parent block
|
|
521
|
-
|
|
521
|
+
A && // presence of a patch flag indicates this node needs patching on updates.
|
|
522
522
|
// component nodes also should always be patched, because even if the
|
|
523
523
|
// component doesn't need to update, it needs to persist the instance on to
|
|
524
524
|
// the next vnode so that it can be properly unmounted later.
|
|
525
|
-
(
|
|
525
|
+
(l.patchFlag > 0 || o & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
|
|
526
526
|
// vnode should not be considered dynamic due to handler caching.
|
|
527
|
-
|
|
527
|
+
l.patchFlag !== 32 && A.push(l), l;
|
|
528
528
|
}
|
|
529
|
-
const fe = process.env.NODE_ENV !== "production" ?
|
|
529
|
+
const fe = process.env.NODE_ENV !== "production" ? Et : Fe;
|
|
530
530
|
function Fe(i, e = null, t = null, s = 0, n = null, o = !1) {
|
|
531
|
-
if ((!i || i === gt) && (process.env.NODE_ENV !== "production" && !i &&
|
|
531
|
+
if ((!i || i === gt) && (process.env.NODE_ENV !== "production" && !i && M(`Invalid vnode type when creating vnode: ${i}.`), i = Re), Oe(i)) {
|
|
532
532
|
const r = X(
|
|
533
533
|
i,
|
|
534
534
|
e,
|
|
535
535
|
!0
|
|
536
536
|
/* mergeRef: true */
|
|
537
537
|
);
|
|
538
|
-
return t && me(r, t), !o &&
|
|
538
|
+
return t && me(r, t), !o && A && (r.shapeFlag & 6 ? A[A.indexOf(i)] = r : A.push(r)), r.patchFlag = -2, r;
|
|
539
539
|
}
|
|
540
540
|
if (De(i) && (i = i.__vccOpts), e) {
|
|
541
541
|
e = At(e);
|
|
542
|
-
let { class: r, style:
|
|
543
|
-
r &&
|
|
542
|
+
let { class: r, style: l } = e;
|
|
543
|
+
r && !$(r) && (e.class = ce(r)), F(l) && (oe(l) && !L(l) && (l = W({}, l)), e.style = le(l));
|
|
544
544
|
}
|
|
545
|
-
const a =
|
|
546
|
-
return process.env.NODE_ENV !== "production" && a & 4 && oe(i) && (i =
|
|
545
|
+
const a = $(i) ? 1 : wt(i) ? 128 : mt(i) ? 64 : F(i) ? 4 : R(i) ? 2 : 0;
|
|
546
|
+
return process.env.NODE_ENV !== "production" && a & 4 && oe(i) && (i = H(i), M(
|
|
547
547
|
"Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
|
|
548
548
|
`
|
|
549
549
|
Component that was made reactive: `,
|
|
@@ -560,24 +560,24 @@ Component that was made reactive: `,
|
|
|
560
560
|
);
|
|
561
561
|
}
|
|
562
562
|
function At(i) {
|
|
563
|
-
return i ? oe(i) ||
|
|
563
|
+
return i ? oe(i) || Te(i) ? W({}, i) : i : null;
|
|
564
564
|
}
|
|
565
565
|
function X(i, e, t = !1, s = !1) {
|
|
566
|
-
const { props: n, ref: o, patchFlag: a, children: r, transition:
|
|
566
|
+
const { props: n, ref: o, patchFlag: a, children: r, transition: l } = i, m = e ? Mt(n || {}, e) : n, d = {
|
|
567
567
|
__v_isVNode: !0,
|
|
568
568
|
__v_skip: !0,
|
|
569
569
|
type: i.type,
|
|
570
|
-
props:
|
|
571
|
-
key:
|
|
570
|
+
props: m,
|
|
571
|
+
key: m && $e(m),
|
|
572
572
|
ref: e && e.ref ? (
|
|
573
573
|
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
574
574
|
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
575
575
|
// the refs so the single vnode can be set on multiple refs
|
|
576
|
-
t && o ?
|
|
576
|
+
t && o ? L(o) ? o.concat(G(e)) : [o, G(e)] : G(e)
|
|
577
577
|
) : o,
|
|
578
578
|
scopeId: i.scopeId,
|
|
579
579
|
slotScopeIds: i.slotScopeIds,
|
|
580
|
-
children: process.env.NODE_ENV !== "production" && a === -1 &&
|
|
580
|
+
children: process.env.NODE_ENV !== "production" && a === -1 && L(r) ? r.map(He) : r,
|
|
581
581
|
target: i.target,
|
|
582
582
|
targetStart: i.targetStart,
|
|
583
583
|
targetAnchor: i.targetAnchor,
|
|
@@ -587,12 +587,12 @@ function X(i, e, t = !1, s = !1) {
|
|
|
587
587
|
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
588
588
|
// note: preserve flag for fragments since they use the flag for children
|
|
589
589
|
// fast paths only.
|
|
590
|
-
patchFlag: e && i.type !==
|
|
590
|
+
patchFlag: e && i.type !== U ? a === -1 ? 16 : a | 16 : a,
|
|
591
591
|
dynamicProps: i.dynamicProps,
|
|
592
592
|
dynamicChildren: i.dynamicChildren,
|
|
593
593
|
appContext: i.appContext,
|
|
594
594
|
dirs: i.dirs,
|
|
595
|
-
transition:
|
|
595
|
+
transition: l,
|
|
596
596
|
// These should technically only be non-null on mounted VNodes. However,
|
|
597
597
|
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
598
598
|
// them since them being non-null during a mount doesn't affect the logic as
|
|
@@ -607,14 +607,14 @@ function X(i, e, t = !1, s = !1) {
|
|
|
607
607
|
ctx: i.ctx,
|
|
608
608
|
ce: i.ce
|
|
609
609
|
};
|
|
610
|
-
return
|
|
610
|
+
return l && s && Ne(
|
|
611
611
|
d,
|
|
612
|
-
|
|
612
|
+
l.clone(d)
|
|
613
613
|
), d;
|
|
614
614
|
}
|
|
615
615
|
function He(i) {
|
|
616
616
|
const e = X(i);
|
|
617
|
-
return
|
|
617
|
+
return L(i.children) && (e.children = i.children.map(He)), e;
|
|
618
618
|
}
|
|
619
619
|
function Lt(i = " ", e = 0) {
|
|
620
620
|
return fe(Ct, null, i, e);
|
|
@@ -624,7 +624,7 @@ function me(i, e) {
|
|
|
624
624
|
const { shapeFlag: s } = i;
|
|
625
625
|
if (e == null)
|
|
626
626
|
e = null;
|
|
627
|
-
else if (
|
|
627
|
+
else if (L(e))
|
|
628
628
|
t = 16;
|
|
629
629
|
else if (typeof e == "object")
|
|
630
630
|
if (s & 65) {
|
|
@@ -632,8 +632,8 @@ function me(i, e) {
|
|
|
632
632
|
n && (n._c && (n._d = !1), me(i, n()), n._c && (n._d = !0));
|
|
633
633
|
return;
|
|
634
634
|
} else
|
|
635
|
-
t = 32, !e._ && !
|
|
636
|
-
else
|
|
635
|
+
t = 32, !e._ && !Te(e) && (e._ctx = T);
|
|
636
|
+
else R(e) ? (e = { default: e, _ctx: T }, t = 32) : (e = String(e), s & 64 ? (t = 16, e = [Lt(e)]) : t = 8);
|
|
637
637
|
i.children = e, i.shapeFlag |= t;
|
|
638
638
|
}
|
|
639
639
|
function Mt(...i) {
|
|
@@ -647,13 +647,13 @@ function Mt(...i) {
|
|
|
647
647
|
e.style = le([e.style, s.style]);
|
|
648
648
|
else if (Be(n)) {
|
|
649
649
|
const o = e[n], a = s[n];
|
|
650
|
-
a && o !== a && !(
|
|
650
|
+
a && o !== a && !(L(o) && o.includes(a)) && (e[n] = o ? [].concat(o, a) : a);
|
|
651
651
|
} else n !== "" && (e[n] = s[n]);
|
|
652
652
|
}
|
|
653
653
|
return e;
|
|
654
654
|
}
|
|
655
|
-
let
|
|
656
|
-
const
|
|
655
|
+
let I = null;
|
|
656
|
+
const Nt = () => I || T;
|
|
657
657
|
{
|
|
658
658
|
const i = Q(), e = (t, s) => {
|
|
659
659
|
let n;
|
|
@@ -663,16 +663,16 @@ const It = () => L || M;
|
|
|
663
663
|
};
|
|
664
664
|
e(
|
|
665
665
|
"__VUE_INSTANCE_SETTERS__",
|
|
666
|
-
(t) =>
|
|
666
|
+
(t) => I = t
|
|
667
667
|
), e(
|
|
668
668
|
"__VUE_SSR_SETTERS__",
|
|
669
669
|
(t) => t
|
|
670
670
|
);
|
|
671
671
|
}
|
|
672
672
|
process.env.NODE_ENV;
|
|
673
|
-
const
|
|
673
|
+
const It = /(?:^|[-_])\w/g, Tt = (i) => i.replace(It, (e) => e.toUpperCase()).replace(/[-_]/g, "");
|
|
674
674
|
function Pe(i, e = !0) {
|
|
675
|
-
return
|
|
675
|
+
return R(i) ? i.displayName || i.name : i.name || e && i.__name;
|
|
676
676
|
}
|
|
677
677
|
function Ve(i, e, t = !1) {
|
|
678
678
|
let s = Pe(e);
|
|
@@ -690,72 +690,72 @@ function Ve(i, e, t = !1) {
|
|
|
690
690
|
i.parent.type.components
|
|
691
691
|
) || n(i.appContext.components);
|
|
692
692
|
}
|
|
693
|
-
return s ?
|
|
693
|
+
return s ? Tt(s) : t ? "App" : "Anonymous";
|
|
694
694
|
}
|
|
695
695
|
function De(i) {
|
|
696
|
-
return
|
|
696
|
+
return R(i) && "__vccOpts" in i;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Rt() {
|
|
699
699
|
if (process.env.NODE_ENV === "production" || typeof window > "u")
|
|
700
700
|
return;
|
|
701
701
|
const i = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, t = { style: "color:#f5222d" }, s = { style: "color:#eb2f96" }, n = {
|
|
702
702
|
__vue_custom_formatter: !0,
|
|
703
|
-
header(
|
|
704
|
-
if (!
|
|
703
|
+
header(c) {
|
|
704
|
+
if (!F(c))
|
|
705
705
|
return null;
|
|
706
|
-
if (
|
|
706
|
+
if (c.__isVue)
|
|
707
707
|
return ["div", i, "VueInstance"];
|
|
708
|
-
if (de(
|
|
709
|
-
const
|
|
708
|
+
if (de(c)) {
|
|
709
|
+
const u = c.value;
|
|
710
710
|
return [
|
|
711
711
|
"div",
|
|
712
712
|
{},
|
|
713
|
-
["span", i, d(
|
|
713
|
+
["span", i, d(c)],
|
|
714
714
|
"<",
|
|
715
|
-
r(
|
|
715
|
+
r(u),
|
|
716
716
|
">"
|
|
717
717
|
];
|
|
718
718
|
} else {
|
|
719
|
-
if (Ce(
|
|
719
|
+
if (Ce(c))
|
|
720
720
|
return [
|
|
721
721
|
"div",
|
|
722
722
|
{},
|
|
723
|
-
["span", i, Z(
|
|
723
|
+
["span", i, Z(c) ? "ShallowReactive" : "Reactive"],
|
|
724
724
|
"<",
|
|
725
|
-
r(
|
|
726
|
-
`>${ne(
|
|
725
|
+
r(c),
|
|
726
|
+
`>${ne(c) ? " (readonly)" : ""}`
|
|
727
727
|
];
|
|
728
|
-
if (ne(
|
|
728
|
+
if (ne(c))
|
|
729
729
|
return [
|
|
730
730
|
"div",
|
|
731
731
|
{},
|
|
732
|
-
["span", i, Z(
|
|
732
|
+
["span", i, Z(c) ? "ShallowReadonly" : "Readonly"],
|
|
733
733
|
"<",
|
|
734
|
-
r(
|
|
734
|
+
r(c),
|
|
735
735
|
">"
|
|
736
736
|
];
|
|
737
737
|
}
|
|
738
738
|
return null;
|
|
739
739
|
},
|
|
740
|
-
hasBody(
|
|
741
|
-
return
|
|
740
|
+
hasBody(c) {
|
|
741
|
+
return c && c.__isVue;
|
|
742
742
|
},
|
|
743
|
-
body(
|
|
744
|
-
if (
|
|
743
|
+
body(c) {
|
|
744
|
+
if (c && c.__isVue)
|
|
745
745
|
return [
|
|
746
746
|
"div",
|
|
747
747
|
{},
|
|
748
|
-
...o(
|
|
748
|
+
...o(c.$)
|
|
749
749
|
];
|
|
750
750
|
}
|
|
751
751
|
};
|
|
752
|
-
function o(
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
return
|
|
752
|
+
function o(c) {
|
|
753
|
+
const u = [];
|
|
754
|
+
c.type.props && c.props && u.push(a("props", H(c.props))), c.setupState !== se && u.push(a("setup", c.setupState)), c.data !== se && u.push(a("data", H(c.data)));
|
|
755
|
+
const y = l(c, "computed");
|
|
756
|
+
y && u.push(a("computed", y));
|
|
757
|
+
const f = l(c, "inject");
|
|
758
|
+
return f && u.push(a("injected", f)), u.push([
|
|
759
759
|
"div",
|
|
760
760
|
{},
|
|
761
761
|
[
|
|
@@ -765,11 +765,11 @@ function Tt() {
|
|
|
765
765
|
},
|
|
766
766
|
"$ (internal): "
|
|
767
767
|
],
|
|
768
|
-
["object", { object:
|
|
769
|
-
]),
|
|
768
|
+
["object", { object: c }]
|
|
769
|
+
]), u;
|
|
770
770
|
}
|
|
771
|
-
function a(
|
|
772
|
-
return
|
|
771
|
+
function a(c, u) {
|
|
772
|
+
return u = W({}, u), Object.keys(u).length ? [
|
|
773
773
|
"div",
|
|
774
774
|
{ style: "line-height:1.25em;margin-bottom:0.6em" },
|
|
775
775
|
[
|
|
@@ -777,41 +777,41 @@ function Tt() {
|
|
|
777
777
|
{
|
|
778
778
|
style: "color:#476582"
|
|
779
779
|
},
|
|
780
|
-
|
|
780
|
+
c
|
|
781
781
|
],
|
|
782
782
|
[
|
|
783
783
|
"div",
|
|
784
784
|
{
|
|
785
785
|
style: "padding-left:1.25em"
|
|
786
786
|
},
|
|
787
|
-
...Object.keys(
|
|
787
|
+
...Object.keys(u).map((y) => [
|
|
788
788
|
"div",
|
|
789
789
|
{},
|
|
790
|
-
["span", s,
|
|
791
|
-
r(
|
|
790
|
+
["span", s, y + ": "],
|
|
791
|
+
r(u[y], !1)
|
|
792
792
|
])
|
|
793
793
|
]
|
|
794
794
|
] : ["span", {}];
|
|
795
795
|
}
|
|
796
|
-
function r(
|
|
797
|
-
return typeof
|
|
796
|
+
function r(c, u = !0) {
|
|
797
|
+
return typeof c == "number" ? ["span", e, c] : typeof c == "string" ? ["span", t, JSON.stringify(c)] : typeof c == "boolean" ? ["span", s, c] : F(c) ? ["object", { object: u ? H(c) : c }] : ["span", t, String(c)];
|
|
798
798
|
}
|
|
799
|
-
function c
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
799
|
+
function l(c, u) {
|
|
800
|
+
const y = c.type;
|
|
801
|
+
if (R(y))
|
|
802
802
|
return;
|
|
803
|
-
const
|
|
804
|
-
for (const
|
|
805
|
-
|
|
806
|
-
return
|
|
807
|
-
}
|
|
808
|
-
function
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
803
|
+
const f = {};
|
|
804
|
+
for (const h in c.ctx)
|
|
805
|
+
m(y, h, u) && (f[h] = c.ctx[h]);
|
|
806
|
+
return f;
|
|
807
|
+
}
|
|
808
|
+
function m(c, u, y) {
|
|
809
|
+
const f = c[y];
|
|
810
|
+
if (L(f) && f.includes(u) || F(f) && u in f || c.extends && m(c.extends, u, y) || c.mixins && c.mixins.some((h) => m(h, u, y)))
|
|
811
811
|
return !0;
|
|
812
812
|
}
|
|
813
|
-
function d(
|
|
814
|
-
return Z(
|
|
813
|
+
function d(c) {
|
|
814
|
+
return Z(c) ? "ShallowRef" : c.effect ? "ComputedRef" : "Ref";
|
|
815
815
|
}
|
|
816
816
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(n) : window.devtoolsFormatters = [n];
|
|
817
817
|
}
|
|
@@ -824,10 +824,10 @@ process.env.NODE_ENV;
|
|
|
824
824
|
* @license MIT
|
|
825
825
|
**/
|
|
826
826
|
function Ot() {
|
|
827
|
-
|
|
827
|
+
Rt();
|
|
828
828
|
}
|
|
829
829
|
process.env.NODE_ENV !== "production" && Ot();
|
|
830
|
-
class
|
|
830
|
+
class ye {
|
|
831
831
|
constructor(e) {
|
|
832
832
|
this.endpoint = e || "https://foisit-ninja.netlify.app/.netlify/functions/intent";
|
|
833
833
|
}
|
|
@@ -861,10 +861,10 @@ class be {
|
|
|
861
861
|
class $t {
|
|
862
862
|
constructor(e = !0) {
|
|
863
863
|
if (this.commands = /* @__PURE__ */ new Map(), this.openAIService = null, this.context = null, this.pendingConfirmation = null, this.enableSmartIntent = !0, this.selectOptionsCache = /* @__PURE__ */ new Map(), typeof e == "boolean") {
|
|
864
|
-
this.enableSmartIntent = e, this.enableSmartIntent && (this.openAIService = new
|
|
864
|
+
this.enableSmartIntent = e, this.enableSmartIntent && (this.openAIService = new ye());
|
|
865
865
|
return;
|
|
866
866
|
}
|
|
867
|
-
this.enableSmartIntent = e.enableSmartIntent ?? !0, this.enableSmartIntent && (this.openAIService = new
|
|
867
|
+
this.enableSmartIntent = e.enableSmartIntent ?? !0, this.enableSmartIntent && (this.openAIService = new ye(e.intentEndpoint));
|
|
868
868
|
}
|
|
869
869
|
/** Add a new command (string or object) */
|
|
870
870
|
addCommand(e, t) {
|
|
@@ -887,16 +887,16 @@ class $t {
|
|
|
887
887
|
}
|
|
888
888
|
/** Execute a command by matching input */
|
|
889
889
|
async executeCommand(e) {
|
|
890
|
-
if (typeof e == "object" && e !== null) {
|
|
890
|
+
if (Array.isArray(e) && (e = e.join(", ")), typeof e == "object" && e !== null) {
|
|
891
891
|
if (this.isStructured(e)) {
|
|
892
|
-
const
|
|
892
|
+
const l = String(e.commandId), m = e.params ?? {}, d = this.getCommandById(l);
|
|
893
893
|
if (!d) return { message: "That command is not available.", type: "error" };
|
|
894
|
-
const
|
|
895
|
-
return
|
|
894
|
+
const c = this.sanitizeParamsForCommand(d, m), y = (d.parameters ?? []).filter((f) => f.required).filter((f) => c[f.name] == null || c[f.name] === "");
|
|
895
|
+
return y.length > 0 ? (this.context = { commandId: this.getCommandIdentifier(d), params: c }, {
|
|
896
896
|
message: `Please provide the required details for "${d.command}".`,
|
|
897
897
|
type: "form",
|
|
898
|
-
fields:
|
|
899
|
-
}) : d.critical ? (this.pendingConfirmation = { commandId: this.getCommandIdentifier(d), params:
|
|
898
|
+
fields: y
|
|
899
|
+
}) : d.critical ? (this.pendingConfirmation = { commandId: this.getCommandIdentifier(d), params: c }, this.buildConfirmResponse(d)) : this.safeRunAction(d, c);
|
|
900
900
|
}
|
|
901
901
|
if (!this.context)
|
|
902
902
|
return { message: "Session expired or invalid context.", type: "error" };
|
|
@@ -923,8 +923,8 @@ class $t {
|
|
|
923
923
|
if (["yes", "y", "confirm", "ok", "okay"].includes(o)) {
|
|
924
924
|
const { commandId: a, params: r } = this.pendingConfirmation;
|
|
925
925
|
this.pendingConfirmation = null;
|
|
926
|
-
const
|
|
927
|
-
return
|
|
926
|
+
const l = this.getCommandById(a);
|
|
927
|
+
return l ? this.safeRunAction(l, r) : { message: "That action is no longer available.", type: "error" };
|
|
928
928
|
}
|
|
929
929
|
return ["no", "n", "cancel", "stop"].includes(o) ? (this.pendingConfirmation = null, { message: "Cancelled.", type: "success" }) : {
|
|
930
930
|
message: "Please confirm: Yes or No.",
|
|
@@ -966,12 +966,12 @@ class $t {
|
|
|
966
966
|
return { message: "I'm not sure what you mean.", type: "error" };
|
|
967
967
|
if (t.macro)
|
|
968
968
|
return this.safeRunAction(t, {});
|
|
969
|
-
const s = e.params ?? {}, n = this.sanitizeParamsForCommand(t, s), o = t.allowAiParamExtraction === !1 ? {} : n, r = (t.parameters ?? []).filter((
|
|
969
|
+
const s = e.params ?? {}, n = this.sanitizeParamsForCommand(t, s), o = t.allowAiParamExtraction === !1 ? {} : n, r = (t.parameters ?? []).filter((m) => m.required).filter((m) => o[m.name] == null || o[m.name] === "");
|
|
970
970
|
if (e.incomplete || r.length > 0) {
|
|
971
971
|
if (this.context = { commandId: this.getCommandIdentifier(t), params: o }, !(t.collectRequiredViaForm !== !1) && this.shouldAskSingleQuestion(r)) {
|
|
972
|
-
const
|
|
972
|
+
const c = r.map((u) => u.name).join(" and ");
|
|
973
973
|
return {
|
|
974
|
-
message: e.message || `Please provide ${
|
|
974
|
+
message: e.message || `Please provide ${c}.`,
|
|
975
975
|
type: "question"
|
|
976
976
|
};
|
|
977
977
|
}
|
|
@@ -986,8 +986,8 @@ class $t {
|
|
|
986
986
|
commandId: this.getCommandIdentifier(t),
|
|
987
987
|
params: o
|
|
988
988
|
}, this.buildConfirmResponse(t);
|
|
989
|
-
const
|
|
990
|
-
return this.normalizeResponse(
|
|
989
|
+
const l = await t.action(o);
|
|
990
|
+
return this.normalizeResponse(l);
|
|
991
991
|
}
|
|
992
992
|
return e.type === "ambiguous" && e.options && e.options.length ? {
|
|
993
993
|
message: e.message || "Did you mean one of these?",
|
|
@@ -1045,15 +1045,15 @@ class $t {
|
|
|
1045
1045
|
delete s[n.name];
|
|
1046
1046
|
continue;
|
|
1047
1047
|
}
|
|
1048
|
-
if (Array.isArray(n.options) && n.options.length > 0 && !n.options.some((
|
|
1048
|
+
if (Array.isArray(n.options) && n.options.length > 0 && !n.options.some((l) => String(l.value) === String(a))) {
|
|
1049
1049
|
delete s[n.name];
|
|
1050
1050
|
continue;
|
|
1051
1051
|
}
|
|
1052
1052
|
s[n.name] = a;
|
|
1053
1053
|
}
|
|
1054
1054
|
if (n.type === "file") {
|
|
1055
|
-
const a = s[n.name], r = a && typeof a == "object" && typeof a.name == "string" && typeof a.size == "number",
|
|
1056
|
-
(n.delivery ?? "file") === "base64" ? !
|
|
1055
|
+
const a = s[n.name], r = a && typeof a == "object" && typeof a.name == "string" && typeof a.size == "number", l = typeof a == "string" && /^data:[^;]+;base64,/.test(a);
|
|
1056
|
+
(n.delivery ?? "file") === "base64" ? !l && !r && delete s[n.name] : r || delete s[n.name];
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
1059
|
return s;
|
|
@@ -1081,18 +1081,18 @@ class $t {
|
|
|
1081
1081
|
async tryDeterministicMatch(e) {
|
|
1082
1082
|
const t = [];
|
|
1083
1083
|
for (const r of this.commands.values()) {
|
|
1084
|
-
let
|
|
1085
|
-
const
|
|
1086
|
-
e.includes(
|
|
1084
|
+
let l = 0;
|
|
1085
|
+
const m = r.command.toLowerCase();
|
|
1086
|
+
e.includes(m) && (l += 5);
|
|
1087
1087
|
const d = r.keywords ?? [];
|
|
1088
|
-
for (const
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1088
|
+
for (const c of d) {
|
|
1089
|
+
const u = c.toLowerCase().trim();
|
|
1090
|
+
u && (e === u ? l += 4 : e.includes(u) && (l += 3));
|
|
1091
1091
|
}
|
|
1092
|
-
|
|
1092
|
+
l > 0 && t.push({ cmd: r, score: l });
|
|
1093
1093
|
}
|
|
1094
1094
|
if (t.length === 0) return null;
|
|
1095
|
-
t.sort((r,
|
|
1095
|
+
t.sort((r, l) => l.score - r.score);
|
|
1096
1096
|
const s = t[0].score, n = t.filter((r) => r.score === s).slice(0, 3);
|
|
1097
1097
|
if (n.length > 1)
|
|
1098
1098
|
return {
|
|
@@ -1209,7 +1209,7 @@ class Ft {
|
|
|
1209
1209
|
return this.fallbackMessage;
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
const
|
|
1212
|
+
const xe = () => {
|
|
1213
1213
|
if (typeof window > "u") return null;
|
|
1214
1214
|
const i = window;
|
|
1215
1215
|
return i.SpeechRecognition ?? i.webkitSpeechRecognition ?? null;
|
|
@@ -1227,7 +1227,7 @@ class Ht {
|
|
|
1227
1227
|
}, this.onTTSEnd = () => {
|
|
1228
1228
|
this.ttsSpeaking = !1, this.isListening && this.restartAllowed ? this.safeRestart() : this.emitStatus(this.isListening ? "listening" : "idle");
|
|
1229
1229
|
};
|
|
1230
|
-
const s =
|
|
1230
|
+
const s = xe();
|
|
1231
1231
|
if (s) {
|
|
1232
1232
|
this.recognition = new s(), this.recognition.lang = e, this.recognition.interimResults = t.interimResults ?? !0, this.recognition.continuous = t.continuous ?? !0, this.recognition.onresult = (o) => this.handleResult(o, t), this.recognition.onend = () => this.handleEnd(), this.recognition.onstart = () => {
|
|
1233
1233
|
this.log("recognition onstart"), this.engineActive = !0, this.hadResultThisSession = !1, this.restartTimer && (clearTimeout(this.restartTimer), this.restartTimer = null), this.backoffMs = 250, this.isListening && !this.ttsSpeaking && this.emitStatus("listening");
|
|
@@ -1259,7 +1259,7 @@ class Ht {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
/** Check if SpeechRecognition is available */
|
|
1261
1261
|
isSupported() {
|
|
1262
|
-
return
|
|
1262
|
+
return xe() !== null;
|
|
1263
1263
|
}
|
|
1264
1264
|
/** Allow consumers (wrappers) to observe status changes */
|
|
1265
1265
|
onStatusChange(e) {
|
|
@@ -1298,10 +1298,10 @@ class Ht {
|
|
|
1298
1298
|
if (!this.resultCallback) return;
|
|
1299
1299
|
const s = t.confidenceThreshold ?? 0.6;
|
|
1300
1300
|
for (let a = e.resultIndex; a < e.results.length; a++) {
|
|
1301
|
-
const r = e.results[a],
|
|
1302
|
-
if (
|
|
1301
|
+
const r = e.results[a], l = r && r[0], m = ((o = (n = l == null ? void 0 : l.transcript) == null ? void 0 : n.trim) == null ? void 0 : o.call(n)) || "", d = (l == null ? void 0 : l.confidence) ?? 0;
|
|
1302
|
+
if (m && !(!r.isFinal && t.interimResults === !1) && !(r.isFinal && d < s))
|
|
1303
1303
|
try {
|
|
1304
|
-
this.hadResultThisSession = !0, this.resultCallback(
|
|
1304
|
+
this.hadResultThisSession = !0, this.resultCallback(m, !!r.isFinal);
|
|
1305
1305
|
} catch {
|
|
1306
1306
|
this.error("VoiceProcessor: result callback error");
|
|
1307
1307
|
}
|
|
@@ -1504,8 +1504,14 @@ class Bt {
|
|
|
1504
1504
|
* - `showInvocation`: if true, show the invocation as a user message
|
|
1505
1505
|
*/
|
|
1506
1506
|
async runCommand(e) {
|
|
1507
|
-
if (!e || !e.commandId)
|
|
1508
|
-
|
|
1507
|
+
if (!e || !e.commandId)
|
|
1508
|
+
throw new Error("runCommand requires a commandId");
|
|
1509
|
+
const {
|
|
1510
|
+
commandId: t,
|
|
1511
|
+
params: s,
|
|
1512
|
+
openOverlay: n = !0,
|
|
1513
|
+
showInvocation: o = !0
|
|
1514
|
+
} = e;
|
|
1509
1515
|
n && !this.isOpen && this.toggle();
|
|
1510
1516
|
const a = this.commandHandlers.get(t);
|
|
1511
1517
|
if (a && o && this.messagesContainer && this.addMessage(`Command: ${t}`, "user"), a)
|
|
@@ -1523,7 +1529,10 @@ class Bt {
|
|
|
1523
1529
|
else r == null || this.addMessage(String(r), "system");
|
|
1524
1530
|
return r;
|
|
1525
1531
|
} catch (r) {
|
|
1526
|
-
throw this.hideLoading(), this.addMessage(
|
|
1532
|
+
throw this.hideLoading(), this.addMessage(
|
|
1533
|
+
`Command "${t}" failed: ${String(r)}`,
|
|
1534
|
+
"system"
|
|
1535
|
+
), r;
|
|
1527
1536
|
}
|
|
1528
1537
|
if (this.externalCommandExecutor)
|
|
1529
1538
|
try {
|
|
@@ -1531,9 +1540,15 @@ class Bt {
|
|
|
1531
1540
|
const r = await this.externalCommandExecutor({ commandId: t, params: s });
|
|
1532
1541
|
return this.hideLoading(), r;
|
|
1533
1542
|
} catch (r) {
|
|
1534
|
-
throw this.hideLoading(), this.addMessage(
|
|
1535
|
-
|
|
1536
|
-
|
|
1543
|
+
throw this.hideLoading(), this.addMessage(
|
|
1544
|
+
`Command "${t}" failed: ${String(r)}`,
|
|
1545
|
+
"system"
|
|
1546
|
+
), r;
|
|
1547
|
+
}
|
|
1548
|
+
this.addMessage(
|
|
1549
|
+
`No handler registered for command "${t}".`,
|
|
1550
|
+
"system"
|
|
1551
|
+
);
|
|
1537
1552
|
}
|
|
1538
1553
|
init() {
|
|
1539
1554
|
var t, s;
|
|
@@ -1541,17 +1556,23 @@ class Bt {
|
|
|
1541
1556
|
this.injectOverlayStyles();
|
|
1542
1557
|
const e = document.getElementById("foisit-overlay-container");
|
|
1543
1558
|
if (e && e instanceof HTMLElement) {
|
|
1544
|
-
this.container = e, this.chatWindow = e.querySelector(
|
|
1559
|
+
this.container = e, this.chatWindow = e.querySelector(
|
|
1560
|
+
".foisit-chat"
|
|
1561
|
+
), this.messagesContainer = e.querySelector(
|
|
1562
|
+
".foisit-messages"
|
|
1563
|
+
), this.input = e.querySelector(
|
|
1564
|
+
"input.foisit-input"
|
|
1565
|
+
), ((t = this.config.floatingButton) == null ? void 0 : t.visible) !== !1 && !e.querySelector(".foisit-floating-btn") && this.renderFloatingButton(), this.chatWindow || this.renderChatWindow(), this.config.enableGestureActivation && (this.gestureHandler = new ae(), this.gestureHandler.setupTripleTapListener(() => this.toggle()));
|
|
1545
1566
|
return;
|
|
1546
1567
|
}
|
|
1547
1568
|
this.container = document.createElement("div"), this.container.id = "foisit-overlay-container", this.container.className = "foisit-overlay-container", document.body.appendChild(this.container), ((s = this.config.floatingButton) == null ? void 0 : s.visible) !== !1 && this.renderFloatingButton(), this.renderChatWindow(), this.config.enableGestureActivation && (this.gestureHandler = new ae(), this.gestureHandler.setupTripleTapListener(() => this.toggle()));
|
|
1548
1569
|
}
|
|
1549
1570
|
renderFloatingButton() {
|
|
1550
|
-
var n, o, a, r,
|
|
1571
|
+
var n, o, a, r, l, m;
|
|
1551
1572
|
const e = document.createElement("button");
|
|
1552
1573
|
e.innerHTML = ((n = this.config.floatingButton) == null ? void 0 : n.customHtml) || "🎙️";
|
|
1553
|
-
const t = ((a = (o = this.config.floatingButton) == null ? void 0 : o.position) == null ? void 0 : a.bottom) || "20px", s = ((
|
|
1554
|
-
e.className = "foisit-floating-btn", e.style.bottom = t, e.style.right = s, e.onclick = () => this.toggle(), e.onmouseenter = () => e.style.transform = "scale(1.05)", e.onmouseleave = () => e.style.transform = "scale(1)", (
|
|
1574
|
+
const t = ((a = (o = this.config.floatingButton) == null ? void 0 : o.position) == null ? void 0 : a.bottom) || "20px", s = ((l = (r = this.config.floatingButton) == null ? void 0 : r.position) == null ? void 0 : l.right) || "20px";
|
|
1575
|
+
e.className = "foisit-floating-btn", e.style.bottom = t, e.style.right = s, e.onclick = () => this.toggle(), e.onmouseenter = () => e.style.transform = "scale(1.05)", e.onmouseleave = () => e.style.transform = "scale(1)", (m = this.container) == null || m.appendChild(e);
|
|
1555
1576
|
}
|
|
1556
1577
|
renderChatWindow() {
|
|
1557
1578
|
var o;
|
|
@@ -1567,8 +1588,8 @@ class Bt {
|
|
|
1567
1588
|
n.className = "foisit-input-area", this.input = document.createElement("input"), this.input.placeholder = this.config.inputPlaceholder || "Type a command...", this.input.className = "foisit-input", this.input.addEventListener("keydown", (a) => {
|
|
1568
1589
|
var r;
|
|
1569
1590
|
if (a.key === "Enter" && ((r = this.input) != null && r.value.trim())) {
|
|
1570
|
-
const
|
|
1571
|
-
this.input.value = "", this.onSubmit && this.onSubmit(
|
|
1591
|
+
const l = this.input.value.trim();
|
|
1592
|
+
this.input.value = "", this.onSubmit && this.onSubmit(l);
|
|
1572
1593
|
}
|
|
1573
1594
|
}), n.appendChild(this.input), this.chatWindow.appendChild(e), this.chatWindow.appendChild(this.messagesContainer), this.chatWindow.appendChild(n), (o = this.container) == null || o.appendChild(this.chatWindow);
|
|
1574
1595
|
}
|
|
@@ -1598,182 +1619,260 @@ class Bt {
|
|
|
1598
1619
|
const n = (e || "").length || 0, o = Math.max(120, 700 - Math.min(600, Math.floor(n * 6)));
|
|
1599
1620
|
s.style.opacity = "0", s.style.transform = "translateY(8px)", s.style.transition = "none", this.messagesContainer.appendChild(s), this.animateMessageEntrance(s, o), this.scrollToBottom();
|
|
1600
1621
|
}
|
|
1601
|
-
addOptions(e) {
|
|
1622
|
+
addOptions(e, t) {
|
|
1602
1623
|
if (!this.messagesContainer) return;
|
|
1603
|
-
const t = document.createElement("div");
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1624
|
+
const s = (t == null ? void 0 : t.allowMultiple) === !0, n = document.createElement("div");
|
|
1625
|
+
if (n.className = "foisit-options-container", !s)
|
|
1626
|
+
e.forEach((o) => {
|
|
1627
|
+
const a = document.createElement("button");
|
|
1628
|
+
a.textContent = o.label, a.className = "foisit-option-chip", a.setAttribute("type", "button"), a.setAttribute("aria-label", o.label);
|
|
1629
|
+
const r = () => {
|
|
1630
|
+
if (o.commandId) {
|
|
1631
|
+
this.onSubmit && this.onSubmit({ commandId: o.commandId });
|
|
1632
|
+
return;
|
|
1633
|
+
}
|
|
1634
|
+
const l = o && typeof o.value == "string" && o.value.trim() ? o.value : o.label;
|
|
1635
|
+
this.onSubmit && this.onSubmit(l);
|
|
1636
|
+
};
|
|
1637
|
+
a.onclick = r, a.onkeydown = (l) => {
|
|
1638
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), r());
|
|
1639
|
+
}, n.appendChild(a);
|
|
1640
|
+
});
|
|
1641
|
+
else {
|
|
1642
|
+
const o = /* @__PURE__ */ new Set();
|
|
1643
|
+
e.forEach((r) => {
|
|
1644
|
+
const l = document.createElement("button");
|
|
1645
|
+
l.textContent = r.label, l.className = "foisit-option-chip", l.setAttribute("type", "button"), l.setAttribute("aria-label", r.label);
|
|
1646
|
+
const m = r && typeof r.value == "string" && r.value.trim() ? r.value : r.label;
|
|
1647
|
+
l.onclick = () => {
|
|
1648
|
+
o.has(m) ? (o.delete(m), l.classList.remove("selected")) : (o.add(m), l.classList.add("selected"));
|
|
1649
|
+
}, l.onkeydown = (d) => {
|
|
1650
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), l.click());
|
|
1651
|
+
}, n.appendChild(l);
|
|
1652
|
+
});
|
|
1653
|
+
const a = document.createElement("button");
|
|
1654
|
+
a.type = "button", a.className = "foisit-option-chip foisit-confirm", a.textContent = (t == null ? void 0 : t.confirmLabel) || "Submit", a.onclick = () => {
|
|
1655
|
+
const r = Array.from(o);
|
|
1656
|
+
this.onSubmit && this.onSubmit(r);
|
|
1657
|
+
}, n.appendChild(a);
|
|
1658
|
+
}
|
|
1659
|
+
this.messagesContainer.appendChild(n), this.scrollToBottom();
|
|
1619
1660
|
}
|
|
1620
1661
|
addForm(e, t, s) {
|
|
1621
1662
|
if (!this.messagesContainer) return;
|
|
1622
1663
|
this.addMessage(e, "system");
|
|
1623
1664
|
const n = document.createElement("form");
|
|
1624
1665
|
n.className = "foisit-form";
|
|
1625
|
-
const o = [], a = (d,
|
|
1626
|
-
const
|
|
1627
|
-
return
|
|
1666
|
+
const o = [], a = (d, c) => {
|
|
1667
|
+
const u = document.createElement("div");
|
|
1668
|
+
return u.className = "foisit-form-label", u.innerHTML = d + (c ? ' <span class="foisit-req-star">*</span>' : ""), u;
|
|
1628
1669
|
}, r = () => {
|
|
1629
1670
|
const d = document.createElement("div");
|
|
1630
1671
|
return d.className = "foisit-form-error", d.style.display = "none", d;
|
|
1631
1672
|
};
|
|
1632
1673
|
(t ?? []).forEach((d) => {
|
|
1633
|
-
const
|
|
1634
|
-
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1637
|
-
let
|
|
1674
|
+
const c = document.createElement("div");
|
|
1675
|
+
c.className = "foisit-form-group";
|
|
1676
|
+
const u = d.label || d.description || d.name;
|
|
1677
|
+
c.appendChild(a(u, d.required));
|
|
1678
|
+
let y;
|
|
1638
1679
|
if (d.type === "select") {
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1680
|
+
const h = d;
|
|
1681
|
+
if (h.multiple) {
|
|
1682
|
+
const b = document.createElement("div");
|
|
1683
|
+
b.className = "foisit-multiselect-container";
|
|
1684
|
+
const g = (k) => {
|
|
1685
|
+
k.forEach((p) => {
|
|
1686
|
+
const S = document.createElement("label");
|
|
1687
|
+
S.className = "foisit-multiselect-label";
|
|
1688
|
+
const v = document.createElement("input");
|
|
1689
|
+
v.type = "checkbox", v.value = String(p.value ?? p.label ?? ""), v.className = "foisit-form-checkbox", S.appendChild(v), S.appendChild(document.createTextNode(" " + String(p.label ?? p.value ?? ""))), b.appendChild(S), b.appendChild(document.createElement("br"));
|
|
1690
|
+
});
|
|
1691
|
+
};
|
|
1692
|
+
if (Array.isArray(h.options) && h.options.length)
|
|
1693
|
+
g(h.options);
|
|
1694
|
+
else if (typeof h.getOptions == "function") {
|
|
1695
|
+
const k = document.createElement("div");
|
|
1696
|
+
k.textContent = "Loading...", b.appendChild(k);
|
|
1697
|
+
const p = h.getOptions;
|
|
1698
|
+
Promise.resolve().then(() => p()).then((S) => {
|
|
1699
|
+
b.innerHTML = "", g(S);
|
|
1700
|
+
}).catch(() => {
|
|
1701
|
+
b.innerHTML = "";
|
|
1702
|
+
const S = document.createElement("div");
|
|
1703
|
+
S.textContent = "Error loading options", b.appendChild(S);
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
y = b, o.push({ name: d.name, type: d.type, el: y, required: d.required, multiple: !0 }), c.appendChild(y);
|
|
1707
|
+
const w = r();
|
|
1708
|
+
c.appendChild(w), n.appendChild(c);
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1711
|
+
const x = document.createElement("select");
|
|
1712
|
+
x.className = "foisit-form-input";
|
|
1713
|
+
const E = document.createElement("option");
|
|
1714
|
+
E.value = "", E.textContent = "Select...", x.appendChild(E);
|
|
1715
|
+
const C = (b) => {
|
|
1716
|
+
(b ?? []).forEach((g) => {
|
|
1717
|
+
const w = document.createElement("option");
|
|
1718
|
+
w.value = String(g.value ?? g.label ?? ""), w.textContent = String(g.label ?? g.value ?? ""), x.appendChild(w);
|
|
1647
1719
|
});
|
|
1648
1720
|
};
|
|
1649
1721
|
if (Array.isArray(d.options) && d.options.length)
|
|
1650
|
-
|
|
1722
|
+
C(d.options);
|
|
1651
1723
|
else if (typeof d.getOptions == "function") {
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
for (;
|
|
1655
|
-
|
|
1724
|
+
const b = d.getOptions, g = document.createElement("option");
|
|
1725
|
+
g.value = "", g.textContent = "Loading...", x.appendChild(g), Promise.resolve().then(() => b()).then((w) => {
|
|
1726
|
+
for (; x.options.length > 1; ) x.remove(1);
|
|
1727
|
+
C(w);
|
|
1656
1728
|
}).catch(() => {
|
|
1657
|
-
for (;
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1729
|
+
for (; x.options.length > 1; ) x.remove(1);
|
|
1730
|
+
const w = document.createElement("option");
|
|
1731
|
+
w.value = "", w.textContent = "Error loading options", x.appendChild(w);
|
|
1660
1732
|
});
|
|
1661
1733
|
}
|
|
1662
|
-
d.defaultValue != null && (
|
|
1734
|
+
d.defaultValue != null && (x.value = String(d.defaultValue)), y = x;
|
|
1663
1735
|
} else if (d.type === "file") {
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1666
|
-
const
|
|
1667
|
-
if (
|
|
1668
|
-
const
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1736
|
+
const h = d, x = document.createElement("input");
|
|
1737
|
+
x.className = "foisit-form-input", x.type = "file", h.accept && Array.isArray(h.accept) && (x.accept = h.accept.join(",")), h.multiple && (x.multiple = !0), h.capture && (h.capture === !0 ? x.setAttribute("capture", "") : x.setAttribute("capture", String(h.capture))), x.addEventListener("change", async () => {
|
|
1738
|
+
const E = Array.from(x.files || []), C = f;
|
|
1739
|
+
if (C.style.display = "none", C.textContent = "", E.length === 0) return;
|
|
1740
|
+
const b = h.maxFiles ?? (h.multiple ? 10 : 1);
|
|
1741
|
+
if (E.length > b) {
|
|
1742
|
+
C.textContent = `Please select at most ${b} file(s).`, C.style.display = "block";
|
|
1671
1743
|
return;
|
|
1672
1744
|
}
|
|
1673
|
-
const
|
|
1674
|
-
if (
|
|
1675
|
-
|
|
1745
|
+
const g = h.maxSizeBytes ?? 1 / 0, w = E.reduce((p, S) => p + S.size, 0);
|
|
1746
|
+
if (E.some((p) => p.size > g)) {
|
|
1747
|
+
C.textContent = `One or more files exceed the maximum size of ${Math.round(
|
|
1748
|
+
g / 1024
|
|
1749
|
+
)} KB.`, C.style.display = "block";
|
|
1676
1750
|
return;
|
|
1677
1751
|
}
|
|
1678
|
-
const
|
|
1679
|
-
if (
|
|
1680
|
-
|
|
1752
|
+
const k = h.maxTotalBytes ?? 1 / 0;
|
|
1753
|
+
if (w > k) {
|
|
1754
|
+
C.textContent = `Total selected files exceed the maximum of ${Math.round(
|
|
1755
|
+
k / 1024
|
|
1756
|
+
)} KB.`, C.style.display = "block";
|
|
1681
1757
|
return;
|
|
1682
1758
|
}
|
|
1683
|
-
if (
|
|
1684
|
-
const
|
|
1685
|
-
if (!
|
|
1686
|
-
|
|
1759
|
+
if (h.accept && Array.isArray(h.accept)) {
|
|
1760
|
+
const p = h.accept;
|
|
1761
|
+
if (!E.every((v) => v.type ? p.some(
|
|
1762
|
+
(V) => V.startsWith(".") ? v.name.toLowerCase().endsWith(V.toLowerCase()) : v.type === V || v.type.startsWith(V.split("/")[0] + "/")
|
|
1763
|
+
) : !0)) {
|
|
1764
|
+
C.textContent = "One or more files have an unsupported type.", C.style.display = "block";
|
|
1687
1765
|
return;
|
|
1688
1766
|
}
|
|
1689
1767
|
}
|
|
1690
|
-
}),
|
|
1768
|
+
}), y = x;
|
|
1691
1769
|
} else {
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1770
|
+
const h = document.createElement("input");
|
|
1771
|
+
h.className = "foisit-form-input", d.type === "string" && (h.placeholder = d.placeholder || "Type here..."), d.type === "number" ? (h.type = "number", typeof d.min == "number" && (h.min = String(d.min)), typeof d.max == "number" && (h.max = String(d.max)), typeof d.step == "number" && (h.step = String(d.step)), d.defaultValue != null && (h.value = String(d.defaultValue))) : d.type === "date" ? (h.type = "date", typeof d.min == "string" && (h.min = d.min), typeof d.max == "string" && (h.max = d.max), d.defaultValue != null && (h.value = String(d.defaultValue))) : (h.type = "text", d.defaultValue != null && (h.value = String(d.defaultValue))), y = h;
|
|
1694
1772
|
}
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1773
|
+
const f = r();
|
|
1774
|
+
c.appendChild(y), c.appendChild(f), o.push({
|
|
1697
1775
|
name: d.name,
|
|
1698
1776
|
type: d.type,
|
|
1699
|
-
el:
|
|
1777
|
+
el: y,
|
|
1700
1778
|
required: d.required
|
|
1701
|
-
}), n.appendChild(
|
|
1779
|
+
}), n.appendChild(c);
|
|
1702
1780
|
});
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1781
|
+
const l = document.createElement("div");
|
|
1782
|
+
l.className = "foisit-form-actions";
|
|
1783
|
+
const m = document.createElement("button");
|
|
1784
|
+
m.type = "submit", m.textContent = "Submit", m.className = "foisit-option-chip", m.style.fontWeight = "600", l.appendChild(m), n.appendChild(l), n.onsubmit = async (d) => {
|
|
1785
|
+
var y;
|
|
1707
1786
|
d.preventDefault();
|
|
1708
|
-
const
|
|
1709
|
-
let
|
|
1710
|
-
n.querySelectorAll(".foisit-form-error").forEach((
|
|
1711
|
-
|
|
1712
|
-
}), n.querySelectorAll(".foisit-form-input").forEach((
|
|
1713
|
-
|
|
1787
|
+
const c = {};
|
|
1788
|
+
let u = !1;
|
|
1789
|
+
n.querySelectorAll(".foisit-form-error").forEach((f) => {
|
|
1790
|
+
f.style.display = "none", f.textContent = "";
|
|
1791
|
+
}), n.querySelectorAll(".foisit-form-input").forEach((f) => {
|
|
1792
|
+
f.classList.remove("foisit-error-border");
|
|
1714
1793
|
});
|
|
1715
|
-
for (const
|
|
1716
|
-
if (
|
|
1717
|
-
|
|
1718
|
-
if (
|
|
1719
|
-
f
|
|
1794
|
+
for (const f of o) {
|
|
1795
|
+
if (f.multiple) {
|
|
1796
|
+
let b = [];
|
|
1797
|
+
if (f.el instanceof HTMLSelectElement ? b = Array.from(f.el.selectedOptions).map((g) => g.value) : b = Array.from(
|
|
1798
|
+
f.el.querySelectorAll("input[type=checkbox]:checked")
|
|
1799
|
+
).map((w) => w.value), f.required && b.length === 0) {
|
|
1800
|
+
u = !0, f.el.classList.add("foisit-error-border");
|
|
1801
|
+
const g = (y = f.el.parentElement) == null ? void 0 : y.querySelector(
|
|
1802
|
+
".foisit-form-error"
|
|
1803
|
+
);
|
|
1804
|
+
g && (g.textContent = "This field is required", g.style.display = "block");
|
|
1805
|
+
}
|
|
1806
|
+
b.length > 0 && (c[f.name] = b);
|
|
1807
|
+
continue;
|
|
1808
|
+
}
|
|
1809
|
+
if (f.type === "file") {
|
|
1810
|
+
const b = f.el.parentElement, g = b == null ? void 0 : b.querySelector(
|
|
1811
|
+
".foisit-form-error"
|
|
1812
|
+
), w = f.el, k = Array.from(w.files || []);
|
|
1813
|
+
if (f.required && k.length === 0) {
|
|
1814
|
+
u = !0, w.classList.add("foisit-error-border"), g && (g.textContent = "This file is required", g.style.display = "block");
|
|
1720
1815
|
continue;
|
|
1721
1816
|
}
|
|
1722
|
-
if (
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1817
|
+
if (k.length === 0) continue;
|
|
1818
|
+
const p = (t ?? []).find((v) => v.name === f.name), S = (p == null ? void 0 : p.delivery) ?? "file";
|
|
1819
|
+
if (p != null && p.maxWidth || p != null && p.maxHeight)
|
|
1725
1820
|
try {
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1728
|
-
|
|
1821
|
+
const v = await this.getImageDimensions(k[0]);
|
|
1822
|
+
if (p.maxWidth && v.width > p.maxWidth) {
|
|
1823
|
+
u = !0, g && (g.textContent = `Image width must be ≤ ${p.maxWidth}px`, g.style.display = "block");
|
|
1729
1824
|
continue;
|
|
1730
1825
|
}
|
|
1731
|
-
if (
|
|
1732
|
-
|
|
1826
|
+
if (p.maxHeight && v.height > p.maxHeight) {
|
|
1827
|
+
u = !0, g && (g.textContent = `Image height must be ≤ ${p.maxHeight}px`, g.style.display = "block");
|
|
1733
1828
|
continue;
|
|
1734
1829
|
}
|
|
1735
1830
|
} catch {
|
|
1736
1831
|
}
|
|
1737
|
-
if (
|
|
1832
|
+
if (p != null && p.maxDurationSec)
|
|
1738
1833
|
try {
|
|
1739
|
-
const
|
|
1740
|
-
if (
|
|
1741
|
-
|
|
1834
|
+
const v = await this.getMediaDuration(k[0]);
|
|
1835
|
+
if (v && v > p.maxDurationSec) {
|
|
1836
|
+
u = !0, g && (g.textContent = `Media duration must be ≤ ${p.maxDurationSec}s`, g.style.display = "block");
|
|
1742
1837
|
continue;
|
|
1743
1838
|
}
|
|
1744
1839
|
} catch {
|
|
1745
1840
|
}
|
|
1746
|
-
if (
|
|
1747
|
-
|
|
1748
|
-
else if (
|
|
1841
|
+
if (S === "file")
|
|
1842
|
+
c[f.name] = p != null && p.multiple ? k : k[0];
|
|
1843
|
+
else if (S === "base64")
|
|
1749
1844
|
try {
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1845
|
+
const v = await Promise.all(
|
|
1846
|
+
k.map((V) => this.readFileAsDataURL(V))
|
|
1847
|
+
);
|
|
1848
|
+
c[f.name] = p != null && p.multiple ? v : v[0];
|
|
1752
1849
|
} catch {
|
|
1753
|
-
|
|
1850
|
+
u = !0, g && (g.textContent = "Failed to encode file(s) to base64.", g.style.display = "block");
|
|
1754
1851
|
continue;
|
|
1755
1852
|
}
|
|
1756
1853
|
continue;
|
|
1757
1854
|
}
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
|
|
1855
|
+
const x = (f.el.value ?? "").toString().trim(), E = f.el.parentElement, C = E == null ? void 0 : E.querySelector(
|
|
1856
|
+
".foisit-form-error"
|
|
1857
|
+
);
|
|
1858
|
+
if (f.required && (x == null || x === "")) {
|
|
1859
|
+
u = !0, f.el.classList.add("foisit-error-border"), C && (C.textContent = "This field is required", C.style.display = "block");
|
|
1761
1860
|
continue;
|
|
1762
1861
|
}
|
|
1763
|
-
if (
|
|
1764
|
-
if (
|
|
1765
|
-
const
|
|
1766
|
-
Number.isNaN(
|
|
1862
|
+
if (x !== "")
|
|
1863
|
+
if (f.type === "number") {
|
|
1864
|
+
const b = Number(x);
|
|
1865
|
+
Number.isNaN(b) || (c[f.name] = b);
|
|
1767
1866
|
} else
|
|
1768
|
-
|
|
1867
|
+
c[f.name] = x;
|
|
1769
1868
|
}
|
|
1770
|
-
if (
|
|
1869
|
+
if (u) {
|
|
1771
1870
|
n.classList.add("foisit-shake"), setTimeout(() => n.classList.remove("foisit-shake"), 400);
|
|
1772
1871
|
return;
|
|
1773
1872
|
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
}), s(
|
|
1873
|
+
m.disabled = !0, m.style.opacity = "0.6", o.forEach((f) => {
|
|
1874
|
+
f.el.disabled = !0;
|
|
1875
|
+
}), s(c);
|
|
1777
1876
|
}, this.messagesContainer.appendChild(n), this.scrollToBottom();
|
|
1778
1877
|
}
|
|
1779
1878
|
showLoading() {
|
|
@@ -1796,7 +1895,10 @@ class Bt {
|
|
|
1796
1895
|
/** Subtle entrance animation for new messages */
|
|
1797
1896
|
animateMessageEntrance(e, t) {
|
|
1798
1897
|
if (!e) return;
|
|
1799
|
-
e.style.transition = `opacity ${t}ms cubic-bezier(0.22, 0.9, 0.32, 1), transform ${Math.max(
|
|
1898
|
+
e.style.transition = `opacity ${t}ms cubic-bezier(0.22, 0.9, 0.32, 1), transform ${Math.max(
|
|
1899
|
+
120,
|
|
1900
|
+
t
|
|
1901
|
+
)}ms cubic-bezier(0.22, 0.9, 0.32, 1)`, requestAnimationFrame(() => {
|
|
1800
1902
|
e.style.opacity = "1", e.style.transform = "translateY(0)";
|
|
1801
1903
|
});
|
|
1802
1904
|
const s = () => {
|
|
@@ -1816,9 +1918,9 @@ class Bt {
|
|
|
1816
1918
|
t.scrollTop = n;
|
|
1817
1919
|
return;
|
|
1818
1920
|
}
|
|
1819
|
-
const o = n - s, a = performance.now(), r = (
|
|
1820
|
-
const
|
|
1821
|
-
t.scrollTop = Math.round(s + o * d),
|
|
1921
|
+
const o = n - s, a = performance.now(), r = (l) => {
|
|
1922
|
+
const m = Math.min(1, (l - a) / e), d = 1 - Math.pow(1 - m, 3);
|
|
1923
|
+
t.scrollTop = Math.round(s + o * d), m < 1 && requestAnimationFrame(r);
|
|
1822
1924
|
};
|
|
1823
1925
|
requestAnimationFrame(r);
|
|
1824
1926
|
}
|
|
@@ -1840,7 +1942,22 @@ class Bt {
|
|
|
1840
1942
|
/** Simple markdown renderer for AI responses */
|
|
1841
1943
|
renderMarkdown(e) {
|
|
1842
1944
|
let t = this.escapeHtml(e);
|
|
1843
|
-
return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, (s, n, o) => `<pre class="foisit-code-block"><code${n ? ` class="language-${n}"` : ""}>${o.trim()}</code></pre>`), t = t.replace(
|
|
1945
|
+
return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, (s, n, o) => `<pre class="foisit-code-block"><code${n ? ` class="language-${n}"` : ""}>${o.trim()}</code></pre>`), t = t.replace(
|
|
1946
|
+
/`([^`]+)`/g,
|
|
1947
|
+
'<code class="foisit-inline-code">$1</code>'
|
|
1948
|
+
), t = t.replace(/^###### (.+)$/gm, '<h6 class="foisit-md-h6">$1</h6>'), t = t.replace(/^##### (.+)$/gm, '<h5 class="foisit-md-h5">$1</h5>'), t = t.replace(/^#### (.+)$/gm, '<h4 class="foisit-md-h4">$1</h4>'), t = t.replace(/^### (.+)$/gm, '<h3 class="foisit-md-h3">$1</h3>'), t = t.replace(/^## (.+)$/gm, '<h2 class="foisit-md-h2">$1</h2>'), t = t.replace(/^# (.+)$/gm, '<h1 class="foisit-md-h1">$1</h1>'), t = t.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^_]+)__/g, "<strong>$1</strong>"), t = t.replace(/\*([^*]+)\*/g, "<em>$1</em>"), t = t.replace(new RegExp("(?<!_)_([^_]+)_(?!_)", "g"), "<em>$1</em>"), t = t.replace(/~~([^~]+)~~/g, "<del>$1</del>"), t = t.replace(
|
|
1949
|
+
/\[([^\]]+)\]\(([^)]+)\)/g,
|
|
1950
|
+
'<a href="$2" target="_blank" rel="noopener noreferrer" class="foisit-md-link">$1</a>'
|
|
1951
|
+
), t = t.replace(/^[\-\*] (.+)$/gm, '<li class="foisit-md-li">$1</li>'), t = t.replace(
|
|
1952
|
+
/(<li class="foisit-md-li">.*<\/li>\n?)+/g,
|
|
1953
|
+
(s) => `<ul class="foisit-md-ul">${s}</ul>`
|
|
1954
|
+
), t = t.replace(/^\d+\. (.+)$/gm, '<li class="foisit-md-li">$1</li>'), t = t.replace(
|
|
1955
|
+
new RegExp('(?<!<\\/ul>)(<li class="foisit-md-li">.*<\\/li>\\n?)+', "g"),
|
|
1956
|
+
(s) => s.includes("<ul") ? s : `<ol class="foisit-md-ol">${s}</ol>`
|
|
1957
|
+
), t = t.replace(
|
|
1958
|
+
/^> (.+)$/gm,
|
|
1959
|
+
'<blockquote class="foisit-md-blockquote">$1</blockquote>'
|
|
1960
|
+
), t = t.replace(/^(---|___|\*\*\*)$/gm, '<hr class="foisit-md-hr">'), t = t.replace(/\n\n+/g, '</p><p class="foisit-md-p">'), t = t.replace(/\n/g, "<br>"), t.match(/^<(h[1-6]|ul|ol|pre|blockquote|hr|p)/) || (t = `<p class="foisit-md-p">${t}</p>`), t;
|
|
1844
1961
|
}
|
|
1845
1962
|
readFileAsDataURL(e) {
|
|
1846
1963
|
return new Promise((t, s) => {
|
|
@@ -1853,7 +1970,10 @@ class Bt {
|
|
|
1853
1970
|
try {
|
|
1854
1971
|
const s = URL.createObjectURL(e), n = new Image();
|
|
1855
1972
|
n.onload = () => {
|
|
1856
|
-
const o = {
|
|
1973
|
+
const o = {
|
|
1974
|
+
width: n.naturalWidth || n.width,
|
|
1975
|
+
height: n.naturalHeight || n.height
|
|
1976
|
+
};
|
|
1857
1977
|
URL.revokeObjectURL(s), t(o);
|
|
1858
1978
|
}, n.onerror = () => {
|
|
1859
1979
|
URL.revokeObjectURL(s), t({ width: 0, height: 0 });
|
|
@@ -1874,8 +1994,8 @@ class Bt {
|
|
|
1874
1994
|
n.preload = "metadata", n.onloadedmetadata = () => {
|
|
1875
1995
|
if (o) return;
|
|
1876
1996
|
o = !0, clearTimeout(a);
|
|
1877
|
-
const
|
|
1878
|
-
URL.revokeObjectURL(s), t(
|
|
1997
|
+
const l = n.duration || 0;
|
|
1998
|
+
URL.revokeObjectURL(s), t(l);
|
|
1879
1999
|
}, n.onerror = () => {
|
|
1880
2000
|
o || (o = !0, clearTimeout(a), URL.revokeObjectURL(s), t(0));
|
|
1881
2001
|
}, n.src = s;
|
|
@@ -1887,57 +2007,104 @@ class Bt {
|
|
|
1887
2007
|
injectOverlayStyles() {
|
|
1888
2008
|
if (document.getElementById("foisit-overlay-styles")) return;
|
|
1889
2009
|
const e = document.createElement("style");
|
|
1890
|
-
e.id = "foisit-overlay-styles"
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
2010
|
+
e.id = "foisit-overlay-styles";
|
|
2011
|
+
const t = this.config.theme || "glass", s = this.config.themeColors || {};
|
|
2012
|
+
if (t === "solid") {
|
|
2013
|
+
const n = s.background || "#1a1a2e", o = s.text || "#ffffff", a = s.accent || "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", r = s.checkboxAccent || "#667eea", l = s.checkboxBorder || "rgba(255,255,255,0.16)", m = s.checkboxCheck || "#ffffff", d = s.userBubbleBg || "rgba(102, 126, 234, 0.2)", c = s.systemBubbleBg || "rgba(255, 255, 255, 0.08)", u = s.border || "rgba(255, 255, 255, 0.1)";
|
|
2014
|
+
e.textContent = `
|
|
2015
|
+
:root {
|
|
2016
|
+
/* SOLID THEME - Custom Colors */
|
|
2017
|
+
--foisit-bg: ${n};
|
|
2018
|
+
--foisit-border: 1px solid ${u};
|
|
2019
|
+
--foisit-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
2020
|
+
--foisit-text: ${o};
|
|
2021
|
+
--foisit-accent: ${a};
|
|
2022
|
+
--foisit-backdrop: none;
|
|
1898
2023
|
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
2024
|
+
/* Input */
|
|
2025
|
+
--foisit-input-color: ${o};
|
|
2026
|
+
--foisit-input-placeholder: ${o}99;
|
|
1902
2027
|
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
2028
|
+
/* Bubbles */
|
|
2029
|
+
--foisit-bubble-user-bg: ${d};
|
|
2030
|
+
--foisit-bubble-user-text: ${o};
|
|
1906
2031
|
|
|
1907
|
-
|
|
1908
|
-
|
|
2032
|
+
--foisit-bubble-sys-bg: ${c};
|
|
2033
|
+
--foisit-bubble-sys-text: ${o}ee;
|
|
1909
2034
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2035
|
+
/* Checkbox accent color for custom-styled checkboxes */
|
|
2036
|
+
--foisit-checkbox-accent: ${r};
|
|
2037
|
+
/* Checkbox border and checkmark colors */
|
|
2038
|
+
--foisit-checkbox-border: ${l};
|
|
2039
|
+
--foisit-checkbox-check: ${m};
|
|
1915
2040
|
|
|
1916
|
-
|
|
2041
|
+
/* Form Colors */
|
|
2042
|
+
--foisit-req-star: #f87171;
|
|
2043
|
+
--foisit-error-text: #fca5a5;
|
|
2044
|
+
--foisit-error-border: #f87171;
|
|
2045
|
+
}
|
|
2046
|
+
`;
|
|
2047
|
+
} else
|
|
2048
|
+
e.textContent = `
|
|
1917
2049
|
:root {
|
|
1918
|
-
/*
|
|
1919
|
-
|
|
1920
|
-
--foisit-
|
|
1921
|
-
--foisit-
|
|
1922
|
-
--foisit-
|
|
2050
|
+
/* LIGHT MODE (Default) - Smoother gradient */
|
|
2051
|
+
/* Changed: Softer, right-focused radial highlight to avoid a heavy white bottom */
|
|
2052
|
+
--foisit-bg: radial-gradient(ellipse at 75% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03));
|
|
2053
|
+
--foisit-border: 1px solid rgba(255, 255, 255, 0.25);
|
|
2054
|
+
--foisit-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
|
2055
|
+
--foisit-text: #333;
|
|
2056
|
+
--foisit-backdrop: blur(20px);
|
|
1923
2057
|
|
|
1924
2058
|
/* Input */
|
|
1925
|
-
--foisit-input-color:
|
|
1926
|
-
--foisit-input-placeholder: rgba(
|
|
2059
|
+
--foisit-input-color: #333;
|
|
2060
|
+
--foisit-input-placeholder: rgba(60, 60, 67, 0.6);
|
|
1927
2061
|
|
|
1928
2062
|
/* Bubbles */
|
|
1929
|
-
--foisit-bubble-user-bg: rgba(
|
|
1930
|
-
--foisit-bubble-user-text:
|
|
2063
|
+
--foisit-bubble-user-bg: rgba(0, 0, 0, 0.04);
|
|
2064
|
+
--foisit-bubble-user-text: #333;
|
|
1931
2065
|
|
|
1932
|
-
--foisit-bubble-sys-bg: rgba(255, 255, 255, 0.
|
|
1933
|
-
--foisit-bubble-sys-text:
|
|
2066
|
+
--foisit-bubble-sys-bg: rgba(255, 255, 255, 0.45);
|
|
2067
|
+
--foisit-bubble-sys-text: #333;
|
|
1934
2068
|
|
|
1935
2069
|
/* Form Colors */
|
|
1936
|
-
--foisit-req-star: #
|
|
1937
|
-
--foisit-error-text: #
|
|
1938
|
-
--foisit-error-border: #
|
|
2070
|
+
--foisit-req-star: #ef4444; /* Red asterisk */
|
|
2071
|
+
--foisit-error-text: #dc2626;
|
|
2072
|
+
--foisit-error-border: #fca5a5;
|
|
2073
|
+
--foisit-checkbox-accent: #667eea;
|
|
2074
|
+
--foisit-checkbox-border: rgba(0,0,0,0.18);
|
|
2075
|
+
--foisit-checkbox-check: #ffffff;
|
|
1939
2076
|
}
|
|
1940
|
-
|
|
2077
|
+
|
|
2078
|
+
@media (prefers-color-scheme: dark) {
|
|
2079
|
+
:root {
|
|
2080
|
+
/* DARK MODE */
|
|
2081
|
+
--foisit-bg: linear-gradient(135deg, rgba(40, 40, 40, 0.65), rgba(40, 40, 40, 0.25));
|
|
2082
|
+
--foisit-border: 1px solid rgba(255, 255, 255, 0.1);
|
|
2083
|
+
--foisit-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
|
|
2084
|
+
--foisit-text: #fff;
|
|
2085
|
+
--foisit-backdrop: blur(20px);
|
|
2086
|
+
|
|
2087
|
+
/* Input */
|
|
2088
|
+
--foisit-input-color: white;
|
|
2089
|
+
--foisit-input-placeholder: rgba(235, 235, 245, 0.5);
|
|
2090
|
+
|
|
2091
|
+
/* Bubbles */
|
|
2092
|
+
--foisit-bubble-user-bg: rgba(255, 255, 255, 0.1);
|
|
2093
|
+
--foisit-bubble-user-text: white;
|
|
2094
|
+
|
|
2095
|
+
--foisit-bubble-sys-bg: rgba(255, 255, 255, 0.05);
|
|
2096
|
+
--foisit-bubble-sys-text: rgba(255, 255, 255, 0.9);
|
|
2097
|
+
|
|
2098
|
+
/* Form Colors */
|
|
2099
|
+
--foisit-req-star: #f87171;
|
|
2100
|
+
--foisit-error-text: #fca5a5;
|
|
2101
|
+
--foisit-error-border: #f87171;
|
|
2102
|
+
--foisit-checkbox-border: rgba(255,255,255,0.16);
|
|
2103
|
+
--foisit-checkbox-check: #ffffff;
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
`;
|
|
2107
|
+
e.textContent += `
|
|
1941
2108
|
|
|
1942
2109
|
@keyframes foisitPulse {
|
|
1943
2110
|
0%, 100% { transform: scale(0.8); opacity: 0.5; }
|
|
@@ -1985,8 +2152,8 @@ class Bt {
|
|
|
1985
2152
|
border: var(--foisit-border);
|
|
1986
2153
|
box-shadow: var(--foisit-shadow);
|
|
1987
2154
|
|
|
1988
|
-
backdrop-filter:
|
|
1989
|
-
-webkit-backdrop-filter:
|
|
2155
|
+
backdrop-filter: var(--foisit-backdrop);
|
|
2156
|
+
-webkit-backdrop-filter: var(--foisit-backdrop);
|
|
1990
2157
|
|
|
1991
2158
|
border-radius: 18px;
|
|
1992
2159
|
display: none;
|
|
@@ -2119,6 +2286,60 @@ class Bt {
|
|
|
2119
2286
|
.foisit-option-chip:hover {
|
|
2120
2287
|
background: rgba(127,127,127,0.15);
|
|
2121
2288
|
}
|
|
2289
|
+
.foisit-option-chip.selected {
|
|
2290
|
+
background: rgba(127,127,127,0.25);
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
.foisit-multiselect-container {
|
|
2294
|
+
display: flex;
|
|
2295
|
+
flex-direction: column;
|
|
2296
|
+
gap: 6px;
|
|
2297
|
+
margin-top: 6px;
|
|
2298
|
+
}
|
|
2299
|
+
.foisit-multiselect-label {
|
|
2300
|
+
font-size: 13px;
|
|
2301
|
+
color: var(--foisit-text);
|
|
2302
|
+
display: flex;
|
|
2303
|
+
align-items: center;
|
|
2304
|
+
gap: 10px;
|
|
2305
|
+
}
|
|
2306
|
+
.foisit-form-checkbox {
|
|
2307
|
+
margin-right: 8px;
|
|
2308
|
+
width: 18px;
|
|
2309
|
+
height: 18px;
|
|
2310
|
+
-webkit-appearance: none;
|
|
2311
|
+
appearance: none;
|
|
2312
|
+
border: 1.5px solid var(--foisit-checkbox-border);
|
|
2313
|
+
border-radius: 4px;
|
|
2314
|
+
display: inline-block;
|
|
2315
|
+
position: relative;
|
|
2316
|
+
vertical-align: middle;
|
|
2317
|
+
background: transparent;
|
|
2318
|
+
transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
|
|
2319
|
+
}
|
|
2320
|
+
.foisit-form-checkbox:focus {
|
|
2321
|
+
box-shadow: 0 0 0 5px rgba(100,150,255,0.12);
|
|
2322
|
+
outline: none;
|
|
2323
|
+
}
|
|
2324
|
+
.foisit-form-checkbox:checked {
|
|
2325
|
+
background: var(--foisit-checkbox-accent);
|
|
2326
|
+
border-color: var(--foisit-checkbox-accent);
|
|
2327
|
+
}
|
|
2328
|
+
.foisit-form-checkbox:checked::after {
|
|
2329
|
+
content: '';
|
|
2330
|
+
position: absolute;
|
|
2331
|
+
left: 5px;
|
|
2332
|
+
top: 3px;
|
|
2333
|
+
width: 5px;
|
|
2334
|
+
height: 9px;
|
|
2335
|
+
border: solid var(--foisit-checkbox-check);
|
|
2336
|
+
border-width: 0 2px 2px 0;
|
|
2337
|
+
transform: rotate(45deg);
|
|
2338
|
+
}
|
|
2339
|
+
.foisit-form-checkbox:disabled {
|
|
2340
|
+
opacity: 0.5;
|
|
2341
|
+
cursor: not-allowed;
|
|
2342
|
+
}
|
|
2122
2343
|
|
|
2123
2344
|
/* Form Styling */
|
|
2124
2345
|
.foisit-form {
|
|
@@ -2195,8 +2416,8 @@ class Bt {
|
|
|
2195
2416
|
border: 1px solid rgba(255,255,255,0.2);
|
|
2196
2417
|
background: var(--foisit-bg);
|
|
2197
2418
|
color: var(--foisit-text);
|
|
2198
|
-
backdrop-filter:
|
|
2199
|
-
-webkit-backdrop-filter:
|
|
2419
|
+
backdrop-filter: var(--foisit-backdrop);
|
|
2420
|
+
-webkit-backdrop-filter: var(--foisit-backdrop);
|
|
2200
2421
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
2201
2422
|
cursor: pointer;
|
|
2202
2423
|
pointer-events: auto;
|
|
@@ -2304,11 +2525,17 @@ class Ut {
|
|
|
2304
2525
|
}), this.fallbackHandler = new Ft(), this.voiceProcessor = new Ht(), this.textToSpeech = new qe(), this.stateManager = new zt(), this.gestureHandler = new ae(), this.overlayManager = new Bt({
|
|
2305
2526
|
floatingButton: this.config.floatingButton,
|
|
2306
2527
|
inputPlaceholder: this.config.inputPlaceholder,
|
|
2307
|
-
enableGestureActivation: this.config.enableGestureActivation
|
|
2528
|
+
enableGestureActivation: this.config.enableGestureActivation,
|
|
2529
|
+
theme: this.config.theme,
|
|
2530
|
+
themeColors: this.config.themeColors
|
|
2308
2531
|
}), this.overlayManager.setExternalCommandExecutor(async (t) => this.commandHandler.executeCommand(t)), this.config.commands.forEach((t) => this.commandHandler.addCommand(t)), this.config.fallbackResponse && this.fallbackHandler.setFallbackMessage(this.config.fallbackResponse), this.overlayManager.registerCallbacks(
|
|
2309
2532
|
async (t) => {
|
|
2310
2533
|
if (typeof t == "string")
|
|
2311
2534
|
this.overlayManager.addMessage(t, "user");
|
|
2535
|
+
else if (Array.isArray(t))
|
|
2536
|
+
t.forEach(
|
|
2537
|
+
(s) => this.overlayManager.addMessage(String(s), "user")
|
|
2538
|
+
);
|
|
2312
2539
|
else if (t && typeof t == "object") {
|
|
2313
2540
|
const s = this.extractUserLabel(t);
|
|
2314
2541
|
s && this.overlayManager.addMessage(s, "user");
|
|
@@ -2320,11 +2547,15 @@ class Ut {
|
|
|
2320
2547
|
}
|
|
2321
2548
|
/** Start listening for activation and commands */
|
|
2322
2549
|
startListening() {
|
|
2323
|
-
console.log(
|
|
2550
|
+
console.log(
|
|
2551
|
+
"AssistantService: Voice is disabled; startListening() is a no-op."
|
|
2552
|
+
);
|
|
2324
2553
|
}
|
|
2325
2554
|
/** Stop listening */
|
|
2326
2555
|
stopListening() {
|
|
2327
|
-
console.log(
|
|
2556
|
+
console.log(
|
|
2557
|
+
"AssistantService: Voice is disabled; stopListening() is a no-op."
|
|
2558
|
+
), this.isActivated = !1;
|
|
2328
2559
|
}
|
|
2329
2560
|
/** Reset activation state so the next activation flow can occur. */
|
|
2330
2561
|
reactivate() {
|
|
@@ -2370,7 +2601,10 @@ class Ut {
|
|
|
2370
2601
|
}
|
|
2371
2602
|
if (t.type === "error") {
|
|
2372
2603
|
const s = typeof e == "string" ? e : "";
|
|
2373
|
-
s ? (this.fallbackHandler.handleFallback(s), this.overlayManager.addMessage(
|
|
2604
|
+
s ? (this.fallbackHandler.handleFallback(s), this.overlayManager.addMessage(
|
|
2605
|
+
this.fallbackHandler.getFallbackMessage(),
|
|
2606
|
+
"system"
|
|
2607
|
+
)) : t.message && this.overlayManager.addMessage(t.message, "system");
|
|
2374
2608
|
return;
|
|
2375
2609
|
}
|
|
2376
2610
|
if ((t.type === "ambiguous" || t.type === "confirm") && t.options) {
|
|
@@ -2441,6 +2675,10 @@ class Ut {
|
|
|
2441
2675
|
async (s) => {
|
|
2442
2676
|
if (typeof s == "string")
|
|
2443
2677
|
this.overlayManager.addMessage(s, "user");
|
|
2678
|
+
else if (Array.isArray(s))
|
|
2679
|
+
s.forEach(
|
|
2680
|
+
(n) => this.overlayManager.addMessage(String(n), "user")
|
|
2681
|
+
);
|
|
2444
2682
|
else if (s && typeof s == "object") {
|
|
2445
2683
|
const n = this.extractUserLabel(s);
|
|
2446
2684
|
n && this.overlayManager.addMessage(n, "user");
|
|
@@ -2481,7 +2719,7 @@ const Wt = /* @__PURE__ */ ht({
|
|
|
2481
2719
|
return t;
|
|
2482
2720
|
};
|
|
2483
2721
|
function Yt(i, e, t, s, n, o) {
|
|
2484
|
-
return
|
|
2722
|
+
return bt(i.$slots, "default");
|
|
2485
2723
|
}
|
|
2486
2724
|
const Gt = /* @__PURE__ */ jt(Wt, [["render", Yt]]), Kt = () => {
|
|
2487
2725
|
const i = ft("assistantService");
|