@opencx/widget 3.0.85 → 3.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/designs.cjs +24 -24
- package/dist/designs.cjs.map +1 -1
- package/dist/designs.js +3458 -3179
- package/dist/designs.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/is-exhaustive-9o43S91P.cjs +2 -0
- package/dist/is-exhaustive-9o43S91P.cjs.map +1 -0
- package/dist/is-exhaustive-DGJzQK69.js +7 -0
- package/dist/is-exhaustive-DGJzQK69.js.map +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +12 -11
- package/dist/src/designs/react/components/Header.d.ts +3 -0
- package/dist/src/designs/react/components/lib/DynamicIcon.d.ts +6 -0
- package/dist/src/designs/react/components/lib/dialog.d.ts +8 -2
- package/dist/src/designs/react/hooks/useCanvas.d.ts +3 -0
- package/dist/src/designs/react/hooks/useSetWidgetSize.d.ts +8 -0
- package/dist/src/designs/react/hooks/useTheme.d.ts +6 -0
- package/dist/src/designs/react/screens/chat/ChatCanvas.d.ts +2 -0
- package/dist/src/headless/core/__tests__/test-utils.d.ts +2 -2
- package/dist/src/headless/core/api/api-caller.d.ts +2 -2
- package/dist/src/headless/core/api/schema.d.ts +176 -75
- package/dist/src/headless/core/context/session.ctx.d.ts +40 -1
- package/dist/src/headless/core/context/widget.ctx.d.ts +2 -0
- package/dist/src/headless/core/index.d.ts +3 -1
- package/dist/src/headless/core/types/dtos.d.ts +3 -2
- package/dist/src/headless/core/types/icons.d.ts +3 -0
- package/dist/src/headless/core/types/widget-config.d.ts +43 -0
- package/dist/src/headless/core/utils/is-exhaustive.d.ts +1 -0
- package/dist/src/headless/react/hooks/useModes.d.ts +12 -0
- package/dist/src/headless/react/hooks/useSessions.d.ts +44 -0
- package/dist/src/headless/react/index.d.ts +1 -0
- package/dist/{useWidgetTrigger-Be2RN31V.cjs → useModes-C5Jd3NZU.cjs} +4 -4
- package/dist/useModes-C5Jd3NZU.cjs.map +1 -0
- package/dist/{useWidgetTrigger-D94qDfz7.js → useModes-CCwRYrkY.js} +248 -238
- package/dist/useModes-CCwRYrkY.js.map +1 -0
- package/dist/widget.ctx-BIrCsbNY.cjs +5 -0
- package/dist/widget.ctx-BIrCsbNY.cjs.map +1 -0
- package/dist/{widget.ctx-0z1bMkkT.js → widget.ctx-D-BdBFz5.js} +66 -60
- package/dist/widget.ctx-D-BdBFz5.js.map +1 -0
- package/dist-embed/script.js +147 -82
- package/dist-embed/script.js.map +1 -1
- package/package.json +2 -1
- package/dist/src/designs/react/components/WidgetHeader.d.ts +0 -2
- package/dist/src/designs/react/hooks/useWidgetSize.d.ts +0 -4
- package/dist/useWidgetTrigger-Be2RN31V.cjs.map +0 -1
- package/dist/useWidgetTrigger-D94qDfz7.js.map +0 -1
- package/dist/widget.ctx-0z1bMkkT.js.map +0 -1
- package/dist/widget.ctx-BOpwwK5L.cjs +0 -5
- package/dist/widget.ctx-BOpwwK5L.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v4 as
|
|
1
|
+
import Y, { createContext as Me, useRef as W, useState as Fe, useMemo as oe, useEffect as se, useContext as Ue, useSyncExternalStore as Xt, useLayoutEffect as Qt, useCallback as Ee, useDebugValue as Zt } from "react";
|
|
2
|
+
import { v4 as en } from "uuid";
|
|
3
3
|
import { jsx as it } from "react/jsx-runtime";
|
|
4
|
-
import { W as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
4
|
+
import { W as tn } from "./widget.ctx-D-BdBFz5.js";
|
|
5
|
+
const nn = "3.0.87";
|
|
6
|
+
class rn {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
this.components = [];
|
|
9
9
|
const { components: n } = t;
|
|
@@ -28,7 +28,7 @@ class nn {
|
|
|
28
28
|
return (n = this.get(t)) == null ? void 0 : n.component;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const at =
|
|
31
|
+
const at = Me(null);
|
|
32
32
|
function Qn({
|
|
33
33
|
options: e,
|
|
34
34
|
children: t,
|
|
@@ -36,14 +36,14 @@ function Qn({
|
|
|
36
36
|
storage: r,
|
|
37
37
|
loadingComponent: o
|
|
38
38
|
}) {
|
|
39
|
-
const s = W(null), i = W(!1), [f, h] =
|
|
40
|
-
() => new
|
|
39
|
+
const s = W(null), i = W(!1), [f, h] = Fe(null), c = oe(
|
|
40
|
+
() => new rn({
|
|
41
41
|
components: n
|
|
42
42
|
}),
|
|
43
43
|
[n]
|
|
44
44
|
);
|
|
45
45
|
return se(() => {
|
|
46
|
-
i.current || (i.current = !0,
|
|
46
|
+
i.current || (i.current = !0, tn.initialize({ config: e, storage: r }).then(h));
|
|
47
47
|
}, []), f ? /* @__PURE__ */ it(
|
|
48
48
|
at.Provider,
|
|
49
49
|
{
|
|
@@ -52,39 +52,39 @@ function Qn({
|
|
|
52
52
|
config: e,
|
|
53
53
|
components: n,
|
|
54
54
|
componentStore: c,
|
|
55
|
-
version:
|
|
55
|
+
version: nn,
|
|
56
56
|
contentIframeRef: s
|
|
57
57
|
},
|
|
58
58
|
children: t
|
|
59
59
|
}
|
|
60
60
|
) : o || null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function K() {
|
|
63
63
|
const e = Ue(at);
|
|
64
64
|
if (!e)
|
|
65
65
|
throw new Error("useWidget must be used within a WidgetProvider");
|
|
66
66
|
return e;
|
|
67
67
|
}
|
|
68
68
|
function ut() {
|
|
69
|
-
const { config: e } =
|
|
69
|
+
const { config: e } = K();
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
72
|
function ie(e) {
|
|
73
|
-
return
|
|
73
|
+
return Xt(e.subscribe, e.get, e.get);
|
|
74
74
|
}
|
|
75
75
|
function Zn() {
|
|
76
|
-
const { widgetCtx: e } =
|
|
76
|
+
const { widgetCtx: e } = K();
|
|
77
77
|
return {
|
|
78
78
|
contactState: ie(e.contactCtx.state),
|
|
79
79
|
createUnverifiedContact: e.contactCtx.createUnverifiedContact
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const { widgetCtx: e } =
|
|
82
|
+
function on() {
|
|
83
|
+
const { widgetCtx: e } = K();
|
|
84
84
|
return { messagesState: ie(e.messageCtx.state), sendMessage: e.messageCtx.sendMessage };
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const { widgetCtx: e } =
|
|
86
|
+
function ct() {
|
|
87
|
+
const { widgetCtx: e } = K(), { oneOpenSessionAllowed: t } = ut(), n = ie(e.sessionCtx.sessionState), r = ie(e.sessionCtx.sessionsState), { openSessions: o, closedSessions: s } = oe(() => ({
|
|
88
88
|
openSessions: r.data.filter((f) => f.isOpened === !0),
|
|
89
89
|
closedSessions: r.data.filter((f) => f.isOpened === !1)
|
|
90
90
|
}), [r.data]), i = oe(() => t ? o.length === 0 : !0, [t, o.length]);
|
|
@@ -92,6 +92,7 @@ function on() {
|
|
|
92
92
|
sessionState: n,
|
|
93
93
|
sessionsState: r,
|
|
94
94
|
loadMoreSessions: e.sessionCtx.loadMoreSessions,
|
|
95
|
+
resolveSession: e.sessionCtx.resolveSession,
|
|
95
96
|
openSessions: o,
|
|
96
97
|
closedSessions: s,
|
|
97
98
|
canCreateNewSession: i
|
|
@@ -99,7 +100,7 @@ function on() {
|
|
|
99
100
|
}
|
|
100
101
|
function er() {
|
|
101
102
|
var i;
|
|
102
|
-
const { sessionState: e } =
|
|
103
|
+
const { sessionState: e } = ct(), { messagesState: t } = on(), n = ((i = e.session) == null ? void 0 : i.assignee.kind) === "ai", r = t.messages.length > 0 ? t.messages[t.messages.length - 1] : null, o = (r == null ? void 0 : r.type) === "FROM_USER";
|
|
103
104
|
return { isAwaitingBotReply: (n || e.isCreatingSession) && (t.isSendingMessage || o) };
|
|
104
105
|
}
|
|
105
106
|
var tr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -139,7 +140,7 @@ var Ze;
|
|
|
139
140
|
function an() {
|
|
140
141
|
if (Ze) return we;
|
|
141
142
|
Ze = 1;
|
|
142
|
-
var e =
|
|
143
|
+
var e = Y;
|
|
143
144
|
function t(u, d) {
|
|
144
145
|
return u === d && (u !== 0 || 1 / u === 1 / d) || u !== u && d !== d;
|
|
145
146
|
}
|
|
@@ -184,46 +185,46 @@ var et;
|
|
|
184
185
|
function un() {
|
|
185
186
|
return et || (et = 1, process.env.NODE_ENV !== "production" && function() {
|
|
186
187
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
187
|
-
var e =
|
|
188
|
+
var e = Y, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
188
189
|
function n(O) {
|
|
189
190
|
{
|
|
190
|
-
for (var
|
|
191
|
-
S
|
|
192
|
-
r("error", O,
|
|
191
|
+
for (var v = arguments.length, E = new Array(v > 1 ? v - 1 : 0), S = 1; S < v; S++)
|
|
192
|
+
E[S - 1] = arguments[S];
|
|
193
|
+
r("error", O, E);
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
|
-
function r(O,
|
|
196
|
+
function r(O, v, E) {
|
|
196
197
|
{
|
|
197
|
-
var
|
|
198
|
-
|
|
199
|
-
var w =
|
|
198
|
+
var S = t.ReactDebugCurrentFrame, I = S.getStackAddendum();
|
|
199
|
+
I !== "" && (v += "%s", E = E.concat([I]));
|
|
200
|
+
var w = E.map(function(C) {
|
|
200
201
|
return String(C);
|
|
201
202
|
});
|
|
202
|
-
w.unshift("Warning: " +
|
|
203
|
+
w.unshift("Warning: " + v), Function.prototype.apply.call(console[O], console, w);
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
|
-
function o(O,
|
|
206
|
-
return O ===
|
|
206
|
+
function o(O, v) {
|
|
207
|
+
return O === v && (O !== 0 || 1 / O === 1 / v) || O !== O && v !== v;
|
|
207
208
|
}
|
|
208
209
|
var s = typeof Object.is == "function" ? Object.is : o, i = e.useState, f = e.useEffect, h = e.useLayoutEffect, c = e.useDebugValue, a = !1, u = !1;
|
|
209
|
-
function d(O,
|
|
210
|
+
function d(O, v, E) {
|
|
210
211
|
a || e.startTransition !== void 0 && (a = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
211
|
-
var
|
|
212
|
+
var S = v();
|
|
212
213
|
if (!u) {
|
|
213
|
-
var
|
|
214
|
-
s(
|
|
214
|
+
var I = v();
|
|
215
|
+
s(S, I) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
|
|
215
216
|
}
|
|
216
217
|
var w = i({
|
|
217
218
|
inst: {
|
|
218
|
-
value:
|
|
219
|
-
getSnapshot:
|
|
219
|
+
value: S,
|
|
220
|
+
getSnapshot: v
|
|
220
221
|
}
|
|
221
222
|
}), C = w[0].inst, j = w[1];
|
|
222
223
|
return h(function() {
|
|
223
|
-
C.value =
|
|
224
|
+
C.value = S, C.getSnapshot = v, l(C) && j({
|
|
224
225
|
inst: C
|
|
225
226
|
});
|
|
226
|
-
}, [O,
|
|
227
|
+
}, [O, S, v]), f(function() {
|
|
227
228
|
l(C) && j({
|
|
228
229
|
inst: C
|
|
229
230
|
});
|
|
@@ -233,19 +234,19 @@ function un() {
|
|
|
233
234
|
});
|
|
234
235
|
};
|
|
235
236
|
return O(B);
|
|
236
|
-
}, [O]), c(
|
|
237
|
+
}, [O]), c(S), S;
|
|
237
238
|
}
|
|
238
239
|
function l(O) {
|
|
239
|
-
var
|
|
240
|
+
var v = O.getSnapshot, E = O.value;
|
|
240
241
|
try {
|
|
241
|
-
var
|
|
242
|
-
return !s(
|
|
242
|
+
var S = v();
|
|
243
|
+
return !s(E, S);
|
|
243
244
|
} catch {
|
|
244
245
|
return !0;
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
|
-
function y(O,
|
|
248
|
-
return
|
|
248
|
+
function y(O, v, E) {
|
|
249
|
+
return v();
|
|
249
250
|
}
|
|
250
251
|
var _ = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", T = !_, p = T ? y : d, k = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : p;
|
|
251
252
|
me.useSyncExternalStore = k, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
@@ -257,10 +258,10 @@ const $ = () => {
|
|
|
257
258
|
}, P = (
|
|
258
259
|
/*#__NOINLINE__*/
|
|
259
260
|
$()
|
|
260
|
-
), be = Object, g = (e) => e === P,
|
|
261
|
+
), be = Object, g = (e) => e === P, M = (e) => typeof e == "function", G = (e, t) => ({
|
|
261
262
|
...e,
|
|
262
263
|
...t
|
|
263
|
-
}), fn = (e) =>
|
|
264
|
+
}), fn = (e) => M(e.then), le = /* @__PURE__ */ new WeakMap();
|
|
264
265
|
let ln = 0;
|
|
265
266
|
const ae = (e) => {
|
|
266
267
|
const t = typeof e, n = e && e.constructor, r = n == Date;
|
|
@@ -282,7 +283,7 @@ const ae = (e) => {
|
|
|
282
283
|
} else
|
|
283
284
|
o = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
|
|
284
285
|
return o;
|
|
285
|
-
}, q = /* @__PURE__ */ new WeakMap(), Oe = {}, de = {}, We = "undefined", ye = typeof window != We, xe = typeof document != We, dn = () => ye && typeof window.requestAnimationFrame != We,
|
|
286
|
+
}, q = /* @__PURE__ */ new WeakMap(), Oe = {}, de = {}, We = "undefined", ye = typeof window != We, xe = typeof document != We, dn = () => ye && typeof window.requestAnimationFrame != We, ft = (e, t) => {
|
|
286
287
|
const n = q.get(e);
|
|
287
288
|
return [
|
|
288
289
|
// Getter
|
|
@@ -301,7 +302,7 @@ const ae = (e) => {
|
|
|
301
302
|
];
|
|
302
303
|
};
|
|
303
304
|
let je = !0;
|
|
304
|
-
const pn = () => je, [Pe,
|
|
305
|
+
const pn = () => je, [Pe, Ie] = ye && window.addEventListener ? [
|
|
305
306
|
window.addEventListener.bind(window),
|
|
306
307
|
window.removeEventListener.bind(window)
|
|
307
308
|
] : [
|
|
@@ -311,7 +312,7 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
311
312
|
const e = xe && document.visibilityState;
|
|
312
313
|
return g(e) || e !== "hidden";
|
|
313
314
|
}, _n = (e) => (xe && document.addEventListener("visibilitychange", e), Pe("focus", e), () => {
|
|
314
|
-
xe && document.removeEventListener("visibilitychange", e),
|
|
315
|
+
xe && document.removeEventListener("visibilitychange", e), Ie("focus", e);
|
|
315
316
|
}), yn = (e) => {
|
|
316
317
|
const t = () => {
|
|
317
318
|
je = !0, e();
|
|
@@ -319,19 +320,19 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
319
320
|
je = !1;
|
|
320
321
|
};
|
|
321
322
|
return Pe("online", t), Pe("offline", n), () => {
|
|
322
|
-
|
|
323
|
+
Ie("online", t), Ie("offline", n);
|
|
323
324
|
};
|
|
324
325
|
}, gn = {
|
|
325
326
|
isOnline: pn,
|
|
326
327
|
isVisible: hn
|
|
327
|
-
},
|
|
328
|
+
}, vn = {
|
|
328
329
|
initFocus: _n,
|
|
329
330
|
initReconnect: yn
|
|
330
|
-
}, tt = !
|
|
331
|
+
}, tt = !Y.useId, ue = !ye || "Deno" in window, Sn = (e) => dn() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Re = ue ? se : Qt, Te = typeof navigator < "u" && navigator.connection, nt = !ue && Te && ([
|
|
331
332
|
"slow-2g",
|
|
332
333
|
"2g"
|
|
333
334
|
].includes(Te.effectiveType) || Te.saveData), qe = (e) => {
|
|
334
|
-
if (
|
|
335
|
+
if (M(e))
|
|
335
336
|
try {
|
|
336
337
|
e = e();
|
|
337
338
|
} catch {
|
|
@@ -343,16 +344,16 @@ const pn = () => je, [Pe, Le] = ye && window.addEventListener ? [
|
|
|
343
344
|
t
|
|
344
345
|
];
|
|
345
346
|
};
|
|
346
|
-
let
|
|
347
|
-
const
|
|
347
|
+
let En = 0;
|
|
348
|
+
const Le = () => ++En, lt = 0, dt = 1, pt = 2, wn = 3;
|
|
348
349
|
var re = {
|
|
349
350
|
__proto__: null,
|
|
350
351
|
ERROR_REVALIDATE_EVENT: wn,
|
|
351
|
-
FOCUS_EVENT:
|
|
352
|
-
MUTATE_EVENT:
|
|
353
|
-
RECONNECT_EVENT:
|
|
352
|
+
FOCUS_EVENT: lt,
|
|
353
|
+
MUTATE_EVENT: pt,
|
|
354
|
+
RECONNECT_EVENT: dt
|
|
354
355
|
};
|
|
355
|
-
async function
|
|
356
|
+
async function ht(...e) {
|
|
356
357
|
const [t, n, r, o] = e, s = G({
|
|
357
358
|
populateCache: !0,
|
|
358
359
|
throwOnError: !0
|
|
@@ -363,7 +364,7 @@ async function pt(...e) {
|
|
|
363
364
|
const f = s.rollbackOnError;
|
|
364
365
|
let h = s.optimisticData;
|
|
365
366
|
const c = (d) => typeof f == "function" ? f(d) : f !== !1, a = s.throwOnError;
|
|
366
|
-
if (
|
|
367
|
+
if (M(n)) {
|
|
367
368
|
const d = n, l = [], y = t.keys();
|
|
368
369
|
for (const _ of y)
|
|
369
370
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
@@ -374,41 +375,41 @@ async function pt(...e) {
|
|
|
374
375
|
async function u(d) {
|
|
375
376
|
const [l] = qe(d);
|
|
376
377
|
if (!l) return;
|
|
377
|
-
const [y, _] =
|
|
378
|
+
const [y, _] = ft(t, l), [T, p, k, O] = q.get(t), v = () => {
|
|
378
379
|
const V = T[l];
|
|
379
|
-
return (
|
|
380
|
+
return (M(s.revalidate) ? s.revalidate(y().data, d) : s.revalidate !== !1) && (delete k[l], delete O[l], V && V[0]) ? V[0](pt).then(() => y().data) : y().data;
|
|
380
381
|
};
|
|
381
382
|
if (e.length < 3)
|
|
382
|
-
return
|
|
383
|
-
let
|
|
384
|
-
const
|
|
383
|
+
return v();
|
|
384
|
+
let E = r, S;
|
|
385
|
+
const I = Le();
|
|
385
386
|
p[l] = [
|
|
386
|
-
|
|
387
|
+
I,
|
|
387
388
|
0
|
|
388
389
|
];
|
|
389
|
-
const w = !g(h), C = y(), j = C.data, B = C._c,
|
|
390
|
-
if (w && (h =
|
|
390
|
+
const w = !g(h), C = y(), j = C.data, B = C._c, z = g(B) ? j : B;
|
|
391
|
+
if (w && (h = M(h) ? h(z, j) : h, _({
|
|
391
392
|
data: h,
|
|
392
|
-
_c:
|
|
393
|
-
})),
|
|
393
|
+
_c: z
|
|
394
|
+
})), M(E))
|
|
394
395
|
try {
|
|
395
|
-
|
|
396
|
+
E = E(z);
|
|
396
397
|
} catch (V) {
|
|
397
|
-
|
|
398
|
+
S = V;
|
|
398
399
|
}
|
|
399
|
-
if (
|
|
400
|
-
if (
|
|
401
|
-
|
|
402
|
-
}),
|
|
403
|
-
if (
|
|
404
|
-
return
|
|
405
|
-
} else
|
|
406
|
-
data:
|
|
400
|
+
if (E && fn(E))
|
|
401
|
+
if (E = await E.catch((V) => {
|
|
402
|
+
S = V;
|
|
403
|
+
}), I !== p[l][0]) {
|
|
404
|
+
if (S) throw S;
|
|
405
|
+
return E;
|
|
406
|
+
} else S && w && c(S) && (i = !0, _({
|
|
407
|
+
data: z,
|
|
407
408
|
_c: P
|
|
408
409
|
}));
|
|
409
|
-
if (i && !
|
|
410
|
-
if (
|
|
411
|
-
const V = i(
|
|
410
|
+
if (i && !S)
|
|
411
|
+
if (M(i)) {
|
|
412
|
+
const V = i(E, z);
|
|
412
413
|
_({
|
|
413
414
|
data: V,
|
|
414
415
|
error: P,
|
|
@@ -416,19 +417,19 @@ async function pt(...e) {
|
|
|
416
417
|
});
|
|
417
418
|
} else
|
|
418
419
|
_({
|
|
419
|
-
data:
|
|
420
|
+
data: E,
|
|
420
421
|
error: P,
|
|
421
422
|
_c: P
|
|
422
423
|
});
|
|
423
|
-
if (p[l][1] =
|
|
424
|
+
if (p[l][1] = Le(), Promise.resolve(v()).then(() => {
|
|
424
425
|
_({
|
|
425
426
|
_c: P
|
|
426
427
|
});
|
|
427
|
-
}),
|
|
428
|
-
if (a) throw
|
|
428
|
+
}), S) {
|
|
429
|
+
if (a) throw S;
|
|
429
430
|
return;
|
|
430
431
|
}
|
|
431
|
-
return
|
|
432
|
+
return E;
|
|
432
433
|
}
|
|
433
434
|
}
|
|
434
435
|
const rt = (e, t) => {
|
|
@@ -436,7 +437,7 @@ const rt = (e, t) => {
|
|
|
436
437
|
e[n][0] && e[n][0](t);
|
|
437
438
|
}, mn = (e, t) => {
|
|
438
439
|
if (!q.has(e)) {
|
|
439
|
-
const n = G(
|
|
440
|
+
const n = G(vn, t), r = {}, o = ht.bind(P, e);
|
|
440
441
|
let s = $;
|
|
441
442
|
const i = {}, f = (a, u) => {
|
|
442
443
|
const d = i[a] || [];
|
|
@@ -457,7 +458,7 @@ const rt = (e, t) => {
|
|
|
457
458
|
h,
|
|
458
459
|
f
|
|
459
460
|
]), !ue)) {
|
|
460
|
-
const a = n.initFocus(setTimeout.bind(P, rt.bind(P, r,
|
|
461
|
+
const a = n.initFocus(setTimeout.bind(P, rt.bind(P, r, lt))), u = n.initReconnect(setTimeout.bind(P, rt.bind(P, r, dt)));
|
|
461
462
|
s = () => {
|
|
462
463
|
a && a(), u && u(), q.delete(e);
|
|
463
464
|
};
|
|
@@ -477,7 +478,7 @@ const rt = (e, t) => {
|
|
|
477
478
|
}, bn = (e, t, n, r, o) => {
|
|
478
479
|
const s = n.errorRetryCount, i = o.retryCount, f = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
479
480
|
!g(s) && i > s || setTimeout(r, f, o);
|
|
480
|
-
}, On = (e, t) => ae(e) == ae(t), [
|
|
481
|
+
}, On = (e, t) => ae(e) == ae(t), [_t, Rn] = mn(/* @__PURE__ */ new Map()), Tn = G(
|
|
481
482
|
{
|
|
482
483
|
// events
|
|
483
484
|
onLoadingSlow: $,
|
|
@@ -498,7 +499,7 @@ const rt = (e, t) => {
|
|
|
498
499
|
// providers
|
|
499
500
|
compare: On,
|
|
500
501
|
isPaused: () => !1,
|
|
501
|
-
cache:
|
|
502
|
+
cache: _t,
|
|
502
503
|
mutate: Rn,
|
|
503
504
|
fallback: {}
|
|
504
505
|
},
|
|
@@ -511,9 +512,9 @@ const rt = (e, t) => {
|
|
|
511
512
|
r && s && (n.use = r.concat(s)), o && i && (n.fallback = G(o, i));
|
|
512
513
|
}
|
|
513
514
|
return n;
|
|
514
|
-
}, An =
|
|
515
|
-
|
|
516
|
-
}, Pn = (e) =>
|
|
515
|
+
}, An = Me({}), Dn = "$inf$", yt = ye && window.__SWR_DEVTOOLS_USE__, xn = yt ? window.__SWR_DEVTOOLS_USE__ : [], jn = () => {
|
|
516
|
+
yt && (window.__SWR_DEVTOOLS_REACT__ = Y);
|
|
517
|
+
}, Pn = (e) => M(e[1]) ? [
|
|
517
518
|
e[0],
|
|
518
519
|
e[1],
|
|
519
520
|
e[2] || {}
|
|
@@ -521,20 +522,20 @@ const rt = (e, t) => {
|
|
|
521
522
|
e[0],
|
|
522
523
|
null,
|
|
523
524
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
524
|
-
],
|
|
525
|
-
const [i] = qe(t), [, , , f] = q.get(
|
|
525
|
+
], In = () => G(Tn, Ue(An)), Ln = (e) => (t, n, r) => e(t, n && ((...s) => {
|
|
526
|
+
const [i] = qe(t), [, , , f] = q.get(_t);
|
|
526
527
|
if (i.startsWith(Dn))
|
|
527
528
|
return n(...s);
|
|
528
529
|
const h = f[i];
|
|
529
530
|
return g(h) ? n(...s) : (delete f[i], h);
|
|
530
|
-
}), r), Vn = xn.concat(
|
|
531
|
-
const r =
|
|
531
|
+
}), r), Vn = xn.concat(Ln), Nn = (e) => function(...n) {
|
|
532
|
+
const r = In(), [o, s, i] = Pn(n), f = Cn(r, i);
|
|
532
533
|
let h = e;
|
|
533
534
|
const { use: c } = f, a = (c || []).concat(Vn);
|
|
534
535
|
for (let u = a.length; u--; )
|
|
535
536
|
h = a[u](h);
|
|
536
537
|
return h(o, s || f.fetcher || null, f);
|
|
537
|
-
},
|
|
538
|
+
}, Mn = (e, t, n) => {
|
|
538
539
|
const r = t[e] || (t[e] = []);
|
|
539
540
|
return r.push(n), () => {
|
|
540
541
|
const o = r.indexOf(n);
|
|
@@ -542,7 +543,7 @@ const rt = (e, t) => {
|
|
|
542
543
|
};
|
|
543
544
|
};
|
|
544
545
|
jn();
|
|
545
|
-
const ot =
|
|
546
|
+
const ot = Y.use || ((e) => {
|
|
546
547
|
if (e.status === "pending")
|
|
547
548
|
throw e;
|
|
548
549
|
if (e.status === "fulfilled")
|
|
@@ -554,8 +555,8 @@ const ot = z.use || ((e) => {
|
|
|
554
555
|
}), e);
|
|
555
556
|
}), Ce = {
|
|
556
557
|
dedupe: !0
|
|
557
|
-
},
|
|
558
|
-
const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: f, revalidateIfStale: h, refreshInterval: c, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: d } = n, [l, y, _, T] = q.get(r), [p, k] = qe(e), O = W(!1),
|
|
558
|
+
}, Fn = (e, t, n) => {
|
|
559
|
+
const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: f, revalidateIfStale: h, refreshInterval: c, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: d } = n, [l, y, _, T] = q.get(r), [p, k] = qe(e), O = W(!1), v = W(!1), E = W(p), S = W(t), I = W(n), w = () => I.current, C = () => w().isVisible() && w().isOnline(), [j, B, z, V] = ft(r, p), J = W({}).current, Kt = g(i) ? n.fallback[p] : i, He = (m, b) => {
|
|
559
560
|
for (const D in J) {
|
|
560
561
|
const R = D;
|
|
561
562
|
if (R === "data") {
|
|
@@ -567,12 +568,12 @@ const ot = z.use || ((e) => {
|
|
|
567
568
|
return !0;
|
|
568
569
|
}, $e = oe(() => {
|
|
569
570
|
const m = !p || !t ? !1 : g(f) ? w().isPaused() || s ? !1 : g(h) ? !0 : h : f, b = (x) => {
|
|
570
|
-
const
|
|
571
|
-
return delete
|
|
571
|
+
const F = G(x);
|
|
572
|
+
return delete F._k, m ? {
|
|
572
573
|
isValidating: !0,
|
|
573
574
|
isLoading: !0,
|
|
574
|
-
...
|
|
575
|
-
} :
|
|
575
|
+
...F
|
|
576
|
+
} : F;
|
|
576
577
|
}, D = j(), R = V(), N = b(D), ee = D === R ? N : b(R);
|
|
577
578
|
let A = N;
|
|
578
579
|
return [
|
|
@@ -585,8 +586,8 @@ const ot = z.use || ((e) => {
|
|
|
585
586
|
}, [
|
|
586
587
|
r,
|
|
587
588
|
p
|
|
588
|
-
]), X = cn.useSyncExternalStore(
|
|
589
|
-
(m) =>
|
|
589
|
+
]), X = cn.useSyncExternalStore(Ee(
|
|
590
|
+
(m) => z(p, (b, D) => {
|
|
590
591
|
He(D, b) || m();
|
|
591
592
|
}),
|
|
592
593
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -594,20 +595,20 @@ const ot = z.use || ((e) => {
|
|
|
594
595
|
r,
|
|
595
596
|
p
|
|
596
597
|
]
|
|
597
|
-
), $e[0], $e[1]), Ge = !O.current,
|
|
598
|
+
), $e[0], $e[1]), Ge = !O.current, zt = l[p] && l[p].length > 0, Q = X.data, Z = g(Q) ? Kt : Q, ce = X.error, Ke = W(Z), fe = d ? g(Q) ? Ke.current : Q : Z, ze = zt && !g(ce) ? !1 : Ge && !g(f) ? f : w().isPaused() ? !1 : s ? g(Z) ? !1 : h : g(Z) || h, Ye = !!(p && t && Ge && ze), Yt = g(X.isValidating) ? Ye : X.isValidating, kt = g(X.isLoading) ? Ye : X.isLoading, ne = Ee(
|
|
598
599
|
async (m) => {
|
|
599
|
-
const b =
|
|
600
|
-
if (!p || !b ||
|
|
600
|
+
const b = S.current;
|
|
601
|
+
if (!p || !b || v.current || w().isPaused())
|
|
601
602
|
return !1;
|
|
602
603
|
let D, R, N = !0;
|
|
603
|
-
const ee = m || {}, A = !_[p] || !ee.dedupe, x = () => tt ? !
|
|
604
|
+
const ee = m || {}, A = !_[p] || !ee.dedupe, x = () => tt ? !v.current && p === E.current && O.current : p === E.current, F = {
|
|
604
605
|
isValidating: !1,
|
|
605
606
|
isLoading: !1
|
|
606
607
|
}, Je = () => {
|
|
607
|
-
B(
|
|
608
|
+
B(F);
|
|
608
609
|
}, Xe = () => {
|
|
609
|
-
const
|
|
610
|
-
|
|
610
|
+
const L = _[p];
|
|
611
|
+
L && L[1] === R && delete _[p];
|
|
611
612
|
}, Qe = {
|
|
612
613
|
isValidating: !0
|
|
613
614
|
};
|
|
@@ -617,24 +618,24 @@ const ot = z.use || ((e) => {
|
|
|
617
618
|
N && x() && w().onLoadingSlow(p, n);
|
|
618
619
|
}, n.loadingTimeout), _[p] = [
|
|
619
620
|
b(k),
|
|
620
|
-
|
|
621
|
+
Le()
|
|
621
622
|
]), [D, R] = _[p], D = await D, A && setTimeout(Xe, n.dedupingInterval), !_[p] || _[p][1] !== R)
|
|
622
623
|
return A && x() && w().onDiscarded(p), !1;
|
|
623
|
-
|
|
624
|
-
const
|
|
625
|
-
if (!g(
|
|
626
|
-
(R <=
|
|
627
|
-
R <=
|
|
628
|
-
|
|
624
|
+
F.error = P;
|
|
625
|
+
const L = y[p];
|
|
626
|
+
if (!g(L) && // case 1
|
|
627
|
+
(R <= L[0] || // case 2
|
|
628
|
+
R <= L[1] || // case 3
|
|
629
|
+
L[1] === 0))
|
|
629
630
|
return Je(), A && x() && w().onDiscarded(p), !1;
|
|
630
631
|
const U = j().data;
|
|
631
|
-
|
|
632
|
-
} catch (
|
|
632
|
+
F.data = o(U, D) ? U : D, A && x() && w().onSuccess(D, p, n);
|
|
633
|
+
} catch (L) {
|
|
633
634
|
Xe();
|
|
634
|
-
const U = w(), { shouldRetryOnError:
|
|
635
|
-
U.isPaused() || (
|
|
636
|
-
const
|
|
637
|
-
|
|
635
|
+
const U = w(), { shouldRetryOnError: ve } = U;
|
|
636
|
+
U.isPaused() || (F.error = L, A && x() && (U.onError(L, p, U), (ve === !0 || M(ve) && ve(L)) && (!w().revalidateOnFocus || !w().revalidateOnReconnect || C()) && U.onErrorRetry(L, p, U, (Jt) => {
|
|
637
|
+
const Se = l[p];
|
|
638
|
+
Se && Se[0] && Se[0](re.ERROR_REVALIDATE_EVENT, Jt);
|
|
638
639
|
}, {
|
|
639
640
|
retryCount: (ee.retryCount || 0) + 1,
|
|
640
641
|
dedupe: !0
|
|
@@ -657,19 +658,19 @@ const ot = z.use || ((e) => {
|
|
|
657
658
|
p,
|
|
658
659
|
r
|
|
659
660
|
]
|
|
660
|
-
), ke =
|
|
661
|
+
), ke = Ee(
|
|
661
662
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
662
|
-
(...m) =>
|
|
663
|
+
(...m) => ht(r, E.current, ...m),
|
|
663
664
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
664
665
|
[]
|
|
665
666
|
);
|
|
666
667
|
if (Re(() => {
|
|
667
|
-
|
|
668
|
+
S.current = t, I.current = n, g(Q) || (Ke.current = Q);
|
|
668
669
|
}), Re(() => {
|
|
669
670
|
if (!p) return;
|
|
670
671
|
const m = ne.bind(P, Ce);
|
|
671
672
|
let b = 0;
|
|
672
|
-
const R =
|
|
673
|
+
const R = Mn(p, l, (N, ee = {}) => {
|
|
673
674
|
if (N == re.FOCUS_EVENT) {
|
|
674
675
|
const A = Date.now();
|
|
675
676
|
w().revalidateOnFocus && A > b && C() && (b = A + w().focusThrottleInterval, m());
|
|
@@ -682,17 +683,17 @@ const ot = z.use || ((e) => {
|
|
|
682
683
|
return ne(ee);
|
|
683
684
|
}
|
|
684
685
|
});
|
|
685
|
-
return
|
|
686
|
+
return v.current = !1, E.current = p, O.current = !0, B({
|
|
686
687
|
_k: k
|
|
687
|
-
}), ze && (g(Z) || ue ? m() :
|
|
688
|
-
|
|
688
|
+
}), ze && (g(Z) || ue ? m() : Sn(m)), () => {
|
|
689
|
+
v.current = !0, R();
|
|
689
690
|
};
|
|
690
691
|
}, [
|
|
691
692
|
p
|
|
692
693
|
]), Re(() => {
|
|
693
694
|
let m;
|
|
694
695
|
function b() {
|
|
695
|
-
const R =
|
|
696
|
+
const R = M(c) ? c(j().data) : c;
|
|
696
697
|
R && m !== -1 && (m = setTimeout(D, R));
|
|
697
698
|
}
|
|
698
699
|
function D() {
|
|
@@ -706,10 +707,10 @@ const ot = z.use || ((e) => {
|
|
|
706
707
|
a,
|
|
707
708
|
u,
|
|
708
709
|
p
|
|
709
|
-
]),
|
|
710
|
+
]), Zt(fe), s && g(Z) && p) {
|
|
710
711
|
if (!tt && ue)
|
|
711
712
|
throw new Error("Fallback data is required when using suspense in SSR.");
|
|
712
|
-
|
|
713
|
+
S.current = t, I.current = n, v.current = !1;
|
|
713
714
|
const m = T[p];
|
|
714
715
|
if (!g(m)) {
|
|
715
716
|
const b = ke(m);
|
|
@@ -730,35 +731,35 @@ const ot = z.use || ((e) => {
|
|
|
730
731
|
return J.error = !0, ce;
|
|
731
732
|
},
|
|
732
733
|
get isValidating() {
|
|
733
|
-
return J.isValidating = !0,
|
|
734
|
+
return J.isValidating = !0, Yt;
|
|
734
735
|
},
|
|
735
736
|
get isLoading() {
|
|
736
|
-
return J.isLoading = !0,
|
|
737
|
+
return J.isLoading = !0, kt;
|
|
737
738
|
}
|
|
738
739
|
};
|
|
739
|
-
}, Un = Nn(
|
|
740
|
+
}, Un = Nn(Fn);
|
|
740
741
|
function rr() {
|
|
741
|
-
const { widgetCtx: e } =
|
|
742
|
+
const { widgetCtx: e } = K();
|
|
742
743
|
return Un([e.config.token], e.api.widgetPrelude, {
|
|
743
744
|
revalidateOnFocus: !1
|
|
744
745
|
});
|
|
745
746
|
}
|
|
746
747
|
function or() {
|
|
747
|
-
const { widgetCtx: e } =
|
|
748
|
+
const { widgetCtx: e } = K();
|
|
748
749
|
return {
|
|
749
750
|
routerState: ie(e.routerCtx.state),
|
|
750
751
|
toSessionsScreen: e.routerCtx.toSessionsScreen,
|
|
751
752
|
toChatScreen: e.routerCtx.toChatScreen
|
|
752
753
|
};
|
|
753
754
|
}
|
|
754
|
-
var
|
|
755
|
+
var gt = {}, Ve = function(e, t) {
|
|
755
756
|
return Ve = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
756
757
|
n.__proto__ = r;
|
|
757
758
|
} || function(n, r) {
|
|
758
759
|
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
|
|
759
760
|
}, Ve(e, t);
|
|
760
761
|
};
|
|
761
|
-
function
|
|
762
|
+
function vt(e, t) {
|
|
762
763
|
if (typeof t != "function" && t !== null)
|
|
763
764
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
764
765
|
Ve(e, t);
|
|
@@ -776,7 +777,7 @@ var he = function() {
|
|
|
776
777
|
return t;
|
|
777
778
|
}, he.apply(this, arguments);
|
|
778
779
|
};
|
|
779
|
-
function
|
|
780
|
+
function St(e, t) {
|
|
780
781
|
var n = {};
|
|
781
782
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
782
783
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -784,18 +785,18 @@ function Et(e, t) {
|
|
|
784
785
|
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
785
786
|
return n;
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
+
function Et(e, t, n, r) {
|
|
788
789
|
var o = arguments.length, s = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, i;
|
|
789
790
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(e, t, n, r);
|
|
790
791
|
else for (var f = e.length - 1; f >= 0; f--) (i = e[f]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, n, s) : i(t, n)) || s);
|
|
791
792
|
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
792
793
|
}
|
|
793
|
-
function
|
|
794
|
+
function wt(e, t) {
|
|
794
795
|
return function(n, r) {
|
|
795
796
|
t(n, r, e);
|
|
796
797
|
};
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
+
function mt(e, t, n, r, o, s) {
|
|
799
800
|
function i(p) {
|
|
800
801
|
if (p !== void 0 && typeof p != "function") throw new TypeError("Function expected");
|
|
801
802
|
return p;
|
|
@@ -817,21 +818,21 @@ function wt(e, t, n, r, o, s) {
|
|
|
817
818
|
}
|
|
818
819
|
c && Object.defineProperty(c, r.name, a), d = !0;
|
|
819
820
|
}
|
|
820
|
-
function
|
|
821
|
+
function bt(e, t, n) {
|
|
821
822
|
for (var r = arguments.length > 2, o = 0; o < t.length; o++)
|
|
822
823
|
n = r ? t[o].call(e, n) : t[o].call(e);
|
|
823
824
|
return r ? n : void 0;
|
|
824
825
|
}
|
|
825
|
-
function
|
|
826
|
+
function Ot(e) {
|
|
826
827
|
return typeof e == "symbol" ? e : "".concat(e);
|
|
827
828
|
}
|
|
828
|
-
function
|
|
829
|
+
function Rt(e, t, n) {
|
|
829
830
|
return typeof t == "symbol" && (t = t.description ? "[".concat(t.description, "]") : ""), Object.defineProperty(e, "name", { configurable: !0, value: n ? "".concat(n, " ", t) : t });
|
|
830
831
|
}
|
|
831
|
-
function
|
|
832
|
+
function Tt(e, t) {
|
|
832
833
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
833
834
|
}
|
|
834
|
-
function
|
|
835
|
+
function Ct(e, t, n, r) {
|
|
835
836
|
function o(s) {
|
|
836
837
|
return s instanceof n ? s : new n(function(i) {
|
|
837
838
|
i(s);
|
|
@@ -858,7 +859,7 @@ function Tt(e, t, n, r) {
|
|
|
858
859
|
c((r = r.apply(e, t || [])).next());
|
|
859
860
|
});
|
|
860
861
|
}
|
|
861
|
-
function
|
|
862
|
+
function At(e, t) {
|
|
862
863
|
var n = { label: 0, sent: function() {
|
|
863
864
|
if (s[0] & 1) throw s[1];
|
|
864
865
|
return s[1];
|
|
@@ -927,7 +928,7 @@ var ge = Object.create ? function(e, t, n, r) {
|
|
|
927
928
|
} : function(e, t, n, r) {
|
|
928
929
|
r === void 0 && (r = n), e[r] = t[n];
|
|
929
930
|
};
|
|
930
|
-
function
|
|
931
|
+
function Dt(e, t) {
|
|
931
932
|
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) && ge(t, e, n);
|
|
932
933
|
}
|
|
933
934
|
function _e(e) {
|
|
@@ -957,19 +958,19 @@ function Be(e, t) {
|
|
|
957
958
|
}
|
|
958
959
|
return s;
|
|
959
960
|
}
|
|
960
|
-
function
|
|
961
|
+
function xt() {
|
|
961
962
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
962
963
|
e = e.concat(Be(arguments[t]));
|
|
963
964
|
return e;
|
|
964
965
|
}
|
|
965
|
-
function
|
|
966
|
+
function jt() {
|
|
966
967
|
for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
|
|
967
968
|
for (var r = Array(e), o = 0, t = 0; t < n; t++)
|
|
968
969
|
for (var s = arguments[t], i = 0, f = s.length; i < f; i++, o++)
|
|
969
970
|
r[o] = s[i];
|
|
970
971
|
return r;
|
|
971
972
|
}
|
|
972
|
-
function
|
|
973
|
+
function Pt(e, t, n) {
|
|
973
974
|
if (n || arguments.length === 2) for (var r = 0, o = t.length, s; r < o; r++)
|
|
974
975
|
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
975
976
|
return e.concat(s || Array.prototype.slice.call(t));
|
|
@@ -977,7 +978,7 @@ function jt(e, t, n) {
|
|
|
977
978
|
function te(e) {
|
|
978
979
|
return this instanceof te ? (this.v = e, this) : new te(e);
|
|
979
980
|
}
|
|
980
|
-
function
|
|
981
|
+
function It(e, t, n) {
|
|
981
982
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
982
983
|
var r = n.apply(e, t || []), o, s = [];
|
|
983
984
|
return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), f("next"), f("throw"), f("return", i), o[Symbol.asyncIterator] = function() {
|
|
@@ -1028,7 +1029,7 @@ function Lt(e) {
|
|
|
1028
1029
|
} : s;
|
|
1029
1030
|
}
|
|
1030
1031
|
}
|
|
1031
|
-
function
|
|
1032
|
+
function Vt(e) {
|
|
1032
1033
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1033
1034
|
var t = e[Symbol.asyncIterator], n;
|
|
1034
1035
|
return t ? t.call(e) : (e = typeof _e == "function" ? _e(e) : e[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
|
|
@@ -1047,7 +1048,7 @@ function It(e) {
|
|
|
1047
1048
|
}, i);
|
|
1048
1049
|
}
|
|
1049
1050
|
}
|
|
1050
|
-
function
|
|
1051
|
+
function Nt(e, t) {
|
|
1051
1052
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1052
1053
|
}
|
|
1053
1054
|
var Wn = Object.create ? function(e, t) {
|
|
@@ -1055,7 +1056,7 @@ var Wn = Object.create ? function(e, t) {
|
|
|
1055
1056
|
} : function(e, t) {
|
|
1056
1057
|
e.default = t;
|
|
1057
1058
|
};
|
|
1058
|
-
function
|
|
1059
|
+
function Mt(e) {
|
|
1059
1060
|
if (e && e.__esModule) return e;
|
|
1060
1061
|
var t = {};
|
|
1061
1062
|
if (e != null) for (var n in e) n !== "default" && Object.prototype.hasOwnProperty.call(e, n) && ge(t, e, n);
|
|
@@ -1064,22 +1065,22 @@ function Nt(e) {
|
|
|
1064
1065
|
function Ft(e) {
|
|
1065
1066
|
return e && e.__esModule ? e : { default: e };
|
|
1066
1067
|
}
|
|
1067
|
-
function
|
|
1068
|
+
function Ut(e, t, n, r) {
|
|
1068
1069
|
if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
1069
1070
|
if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1070
1071
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
1071
1072
|
}
|
|
1072
|
-
function
|
|
1073
|
+
function Wt(e, t, n, r, o) {
|
|
1073
1074
|
if (r === "m") throw new TypeError("Private method is not writable");
|
|
1074
1075
|
if (r === "a" && !o) throw new TypeError("Private accessor was defined without a setter");
|
|
1075
1076
|
if (typeof t == "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1076
1077
|
return r === "a" ? o.call(e, n) : o ? o.value = n : t.set(e, n), n;
|
|
1077
1078
|
}
|
|
1078
|
-
function
|
|
1079
|
+
function qt(e, t) {
|
|
1079
1080
|
if (t === null || typeof t != "object" && typeof t != "function") throw new TypeError("Cannot use 'in' operator on non-object");
|
|
1080
1081
|
return typeof e == "function" ? t === e : e.has(t);
|
|
1081
1082
|
}
|
|
1082
|
-
function
|
|
1083
|
+
function Bt(e, t, n) {
|
|
1083
1084
|
if (t != null) {
|
|
1084
1085
|
if (typeof t != "object" && typeof t != "function") throw new TypeError("Object expected.");
|
|
1085
1086
|
var r, o;
|
|
@@ -1106,7 +1107,7 @@ var qn = typeof SuppressedError == "function" ? SuppressedError : function(e, t,
|
|
|
1106
1107
|
var r = new Error(n);
|
|
1107
1108
|
return r.name = "SuppressedError", r.error = e, r.suppressed = t, r;
|
|
1108
1109
|
};
|
|
1109
|
-
function
|
|
1110
|
+
function Ht(e) {
|
|
1110
1111
|
function t(s) {
|
|
1111
1112
|
e.error = e.hasError ? new qn(s, e.error, "An error was suppressed during disposal.") : s, e.hasError = !0;
|
|
1112
1113
|
}
|
|
@@ -1129,79 +1130,79 @@ function Bt(e) {
|
|
|
1129
1130
|
}
|
|
1130
1131
|
return o();
|
|
1131
1132
|
}
|
|
1132
|
-
function
|
|
1133
|
+
function $t(e, t) {
|
|
1133
1134
|
return typeof e == "string" && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(n, r, o, s, i) {
|
|
1134
1135
|
return r ? t ? ".jsx" : ".js" : o && (!s || !i) ? n : o + s + "." + i.toLowerCase() + "js";
|
|
1135
1136
|
}) : e;
|
|
1136
1137
|
}
|
|
1137
1138
|
const Bn = {
|
|
1138
|
-
__extends:
|
|
1139
|
+
__extends: vt,
|
|
1139
1140
|
__assign: he,
|
|
1140
|
-
__rest:
|
|
1141
|
-
__decorate:
|
|
1142
|
-
__param:
|
|
1143
|
-
__esDecorate:
|
|
1144
|
-
__runInitializers:
|
|
1145
|
-
__propKey:
|
|
1146
|
-
__setFunctionName:
|
|
1147
|
-
__metadata:
|
|
1148
|
-
__awaiter:
|
|
1149
|
-
__generator:
|
|
1141
|
+
__rest: St,
|
|
1142
|
+
__decorate: Et,
|
|
1143
|
+
__param: wt,
|
|
1144
|
+
__esDecorate: mt,
|
|
1145
|
+
__runInitializers: bt,
|
|
1146
|
+
__propKey: Ot,
|
|
1147
|
+
__setFunctionName: Rt,
|
|
1148
|
+
__metadata: Tt,
|
|
1149
|
+
__awaiter: Ct,
|
|
1150
|
+
__generator: At,
|
|
1150
1151
|
__createBinding: ge,
|
|
1151
|
-
__exportStar:
|
|
1152
|
+
__exportStar: Dt,
|
|
1152
1153
|
__values: _e,
|
|
1153
1154
|
__read: Be,
|
|
1154
|
-
__spread:
|
|
1155
|
-
__spreadArrays:
|
|
1156
|
-
__spreadArray:
|
|
1155
|
+
__spread: xt,
|
|
1156
|
+
__spreadArrays: jt,
|
|
1157
|
+
__spreadArray: Pt,
|
|
1157
1158
|
__await: te,
|
|
1158
|
-
__asyncGenerator:
|
|
1159
|
+
__asyncGenerator: It,
|
|
1159
1160
|
__asyncDelegator: Lt,
|
|
1160
|
-
__asyncValues:
|
|
1161
|
-
__makeTemplateObject:
|
|
1162
|
-
__importStar:
|
|
1161
|
+
__asyncValues: Vt,
|
|
1162
|
+
__makeTemplateObject: Nt,
|
|
1163
|
+
__importStar: Mt,
|
|
1163
1164
|
__importDefault: Ft,
|
|
1164
|
-
__classPrivateFieldGet:
|
|
1165
|
-
__classPrivateFieldSet:
|
|
1166
|
-
__classPrivateFieldIn:
|
|
1167
|
-
__addDisposableResource:
|
|
1168
|
-
__disposeResources:
|
|
1169
|
-
__rewriteRelativeImportExtension:
|
|
1165
|
+
__classPrivateFieldGet: Ut,
|
|
1166
|
+
__classPrivateFieldSet: Wt,
|
|
1167
|
+
__classPrivateFieldIn: qt,
|
|
1168
|
+
__addDisposableResource: Bt,
|
|
1169
|
+
__disposeResources: Ht,
|
|
1170
|
+
__rewriteRelativeImportExtension: $t
|
|
1170
1171
|
}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1171
1172
|
__proto__: null,
|
|
1172
|
-
__addDisposableResource:
|
|
1173
|
+
__addDisposableResource: Bt,
|
|
1173
1174
|
get __assign() {
|
|
1174
1175
|
return he;
|
|
1175
1176
|
},
|
|
1176
1177
|
__asyncDelegator: Lt,
|
|
1177
|
-
__asyncGenerator:
|
|
1178
|
-
__asyncValues:
|
|
1178
|
+
__asyncGenerator: It,
|
|
1179
|
+
__asyncValues: Vt,
|
|
1179
1180
|
__await: te,
|
|
1180
|
-
__awaiter:
|
|
1181
|
-
__classPrivateFieldGet:
|
|
1182
|
-
__classPrivateFieldIn:
|
|
1183
|
-
__classPrivateFieldSet:
|
|
1181
|
+
__awaiter: Ct,
|
|
1182
|
+
__classPrivateFieldGet: Ut,
|
|
1183
|
+
__classPrivateFieldIn: qt,
|
|
1184
|
+
__classPrivateFieldSet: Wt,
|
|
1184
1185
|
__createBinding: ge,
|
|
1185
|
-
__decorate:
|
|
1186
|
-
__disposeResources:
|
|
1187
|
-
__esDecorate:
|
|
1188
|
-
__exportStar:
|
|
1189
|
-
__extends:
|
|
1190
|
-
__generator:
|
|
1186
|
+
__decorate: Et,
|
|
1187
|
+
__disposeResources: Ht,
|
|
1188
|
+
__esDecorate: mt,
|
|
1189
|
+
__exportStar: Dt,
|
|
1190
|
+
__extends: vt,
|
|
1191
|
+
__generator: At,
|
|
1191
1192
|
__importDefault: Ft,
|
|
1192
|
-
__importStar:
|
|
1193
|
-
__makeTemplateObject:
|
|
1194
|
-
__metadata:
|
|
1195
|
-
__param:
|
|
1196
|
-
__propKey:
|
|
1193
|
+
__importStar: Mt,
|
|
1194
|
+
__makeTemplateObject: Nt,
|
|
1195
|
+
__metadata: Tt,
|
|
1196
|
+
__param: wt,
|
|
1197
|
+
__propKey: Ot,
|
|
1197
1198
|
__read: Be,
|
|
1198
|
-
__rest:
|
|
1199
|
-
__rewriteRelativeImportExtension:
|
|
1200
|
-
__runInitializers:
|
|
1201
|
-
__setFunctionName:
|
|
1202
|
-
__spread:
|
|
1203
|
-
__spreadArray:
|
|
1204
|
-
__spreadArrays:
|
|
1199
|
+
__rest: St,
|
|
1200
|
+
__rewriteRelativeImportExtension: $t,
|
|
1201
|
+
__runInitializers: bt,
|
|
1202
|
+
__setFunctionName: Rt,
|
|
1203
|
+
__spread: xt,
|
|
1204
|
+
__spreadArray: Pt,
|
|
1205
|
+
__spreadArrays: jt,
|
|
1205
1206
|
__values: _e,
|
|
1206
1207
|
default: Bn
|
|
1207
1208
|
}, Symbol.toStringTag, { value: "Module" })), $n = /* @__PURE__ */ sn(Hn);
|
|
@@ -1209,7 +1210,7 @@ var pe = {}, st;
|
|
|
1209
1210
|
function Gn() {
|
|
1210
1211
|
if (st) return pe;
|
|
1211
1212
|
st = 1, Object.defineProperty(pe, "__esModule", { value: !0 });
|
|
1212
|
-
var e =
|
|
1213
|
+
var e = Y;
|
|
1213
1214
|
function t() {
|
|
1214
1215
|
var n = e.useRef(!1), r = e.useCallback(function() {
|
|
1215
1216
|
return n.current;
|
|
@@ -1222,8 +1223,8 @@ function Gn() {
|
|
|
1222
1223
|
}
|
|
1223
1224
|
return pe.default = t, pe;
|
|
1224
1225
|
}
|
|
1225
|
-
Object.defineProperty(
|
|
1226
|
-
var Ne = $n, Ae =
|
|
1226
|
+
Object.defineProperty(gt, "__esModule", { value: !0 });
|
|
1227
|
+
var Ne = $n, Ae = Y, Kn = Ne.__importDefault(Gn());
|
|
1227
1228
|
function zn(e, t, n) {
|
|
1228
1229
|
t === void 0 && (t = []), n === void 0 && (n = { loading: !1 });
|
|
1229
1230
|
var r = Ae.useRef(0), o = Kn.default(), s = Ae.useState(n), i = s[0], f = s[1], h = Ae.useCallback(function() {
|
|
@@ -1240,16 +1241,16 @@ function zn(e, t, n) {
|
|
|
1240
1241
|
}, t);
|
|
1241
1242
|
return [i, h];
|
|
1242
1243
|
}
|
|
1243
|
-
var sr =
|
|
1244
|
+
var sr = gt.default = zn;
|
|
1244
1245
|
const H = /* @__PURE__ */ new Map();
|
|
1245
1246
|
function ir() {
|
|
1246
|
-
const [e, t] =
|
|
1247
|
+
const [e, t] = Fe([]), {
|
|
1247
1248
|
widgetCtx: { api: n }
|
|
1248
|
-
} =
|
|
1249
|
+
} = K();
|
|
1249
1250
|
function r(a) {
|
|
1250
1251
|
const u = a.map((d) => ({
|
|
1251
1252
|
file: d,
|
|
1252
|
-
id:
|
|
1253
|
+
id: en(),
|
|
1253
1254
|
status: "pending",
|
|
1254
1255
|
progress: 0
|
|
1255
1256
|
}));
|
|
@@ -1321,9 +1322,9 @@ function ir() {
|
|
|
1321
1322
|
isUploading: e.some((a) => a.status === "uploading")
|
|
1322
1323
|
};
|
|
1323
1324
|
}
|
|
1324
|
-
const
|
|
1325
|
+
const Gt = Me(null);
|
|
1325
1326
|
function ar({ children: e }) {
|
|
1326
|
-
const t = ut(), [n, r] =
|
|
1327
|
+
const t = ut(), [n, r] = Fe(t.isOpen ?? !1);
|
|
1327
1328
|
return se(() => {
|
|
1328
1329
|
r((o) => t.isOpen ?? o);
|
|
1329
1330
|
}, [t.isOpen]), se(() => {
|
|
@@ -1332,32 +1333,41 @@ function ar({ children: e }) {
|
|
|
1332
1333
|
return;
|
|
1333
1334
|
const s = setTimeout(() => r(!0), o * 1e3);
|
|
1334
1335
|
return () => clearTimeout(s);
|
|
1335
|
-
}, [t.openAfterNSeconds]), /* @__PURE__ */ it(
|
|
1336
|
+
}, [t.openAfterNSeconds]), /* @__PURE__ */ it(Gt.Provider, { value: { isOpen: n, setIsOpen: r }, children: e });
|
|
1336
1337
|
}
|
|
1337
1338
|
function ur() {
|
|
1338
|
-
const e = Ue(
|
|
1339
|
+
const e = Ue(Gt);
|
|
1339
1340
|
if (!e)
|
|
1340
1341
|
throw new Error(
|
|
1341
1342
|
"useWidgetTrigger must be used within a WidgetTriggerProvider"
|
|
1342
1343
|
);
|
|
1343
1344
|
return e;
|
|
1344
1345
|
}
|
|
1346
|
+
function cr() {
|
|
1347
|
+
var s;
|
|
1348
|
+
const { widgetCtx: e } = K(), { sessionState: t } = ct(), n = e.modes, r = (s = t.session) == null ? void 0 : s.modeId, o = n.find((i) => i.id === r);
|
|
1349
|
+
return {
|
|
1350
|
+
modes: n,
|
|
1351
|
+
activeMode: o
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1345
1354
|
export {
|
|
1346
1355
|
Qn as W,
|
|
1347
1356
|
sr as _,
|
|
1348
1357
|
ut as a,
|
|
1349
1358
|
Zn as b,
|
|
1350
1359
|
er as c,
|
|
1351
|
-
|
|
1360
|
+
on as d,
|
|
1352
1361
|
rr as e,
|
|
1353
1362
|
ie as f,
|
|
1354
|
-
|
|
1363
|
+
ct as g,
|
|
1355
1364
|
or as h,
|
|
1356
1365
|
ir as i,
|
|
1357
1366
|
ur as j,
|
|
1358
1367
|
ar as k,
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1368
|
+
cr as l,
|
|
1369
|
+
tr as m,
|
|
1370
|
+
nr as n,
|
|
1371
|
+
K as u
|
|
1362
1372
|
};
|
|
1363
|
-
//# sourceMappingURL=
|
|
1373
|
+
//# sourceMappingURL=useModes-CCwRYrkY.js.map
|