@capytale/iframe-react 1.1.7 → 1.1.9
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/index.cjs.js +1 -14
- package/dist/index.d.ts +336 -0
- package/dist/index.es.js +800 -1410
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,875 +1,265 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function m(l, d, v) {
|
|
9
|
-
var u, y = {}, S = null, k = null;
|
|
10
|
-
v !== void 0 && (S = "" + v), d.key !== void 0 && (S = "" + d.key), d.ref !== void 0 && (k = d.ref);
|
|
11
|
-
for (u in d) s.call(d, u) && !i.hasOwnProperty(u) && (y[u] = d[u]);
|
|
12
|
-
if (l && l.defaultProps) for (u in d = l.defaultProps, d) y[u] === void 0 && (y[u] = d[u]);
|
|
13
|
-
return { $$typeof: n, type: l, key: S, ref: k, props: y, _owner: a.current };
|
|
14
|
-
}
|
|
15
|
-
return ee.Fragment = r, ee.jsx = m, ee.jsxs = m, ee;
|
|
16
|
-
}
|
|
17
|
-
var te = {};
|
|
18
|
-
var rt;
|
|
19
|
-
function Ht() {
|
|
20
|
-
return rt || (rt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
21
|
-
var e = H, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), V = Symbol.iterator, I = "@@iterator";
|
|
22
|
-
function $(t) {
|
|
23
|
-
if (t === null || typeof t != "object")
|
|
24
|
-
return null;
|
|
25
|
-
var o = V && t[V] || t[I];
|
|
26
|
-
return typeof o == "function" ? o : null;
|
|
27
|
-
}
|
|
28
|
-
var j = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
29
|
-
function T(t) {
|
|
30
|
-
{
|
|
31
|
-
for (var o = arguments.length, g = new Array(o > 1 ? o - 1 : 0), C = 1; C < o; C++)
|
|
32
|
-
g[C - 1] = arguments[C];
|
|
33
|
-
c("error", t, g);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function c(t, o, g) {
|
|
37
|
-
{
|
|
38
|
-
var C = j.ReactDebugCurrentFrame, A = C.getStackAddendum();
|
|
39
|
-
A !== "" && (o += "%s", g = g.concat([A]));
|
|
40
|
-
var R = g.map(function(b) {
|
|
41
|
-
return String(b);
|
|
42
|
-
});
|
|
43
|
-
R.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, R);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
var p = !1, h = !1, E = !1, F = !1, G = !1, ne;
|
|
47
|
-
ne = Symbol.for("react.module.reference");
|
|
48
|
-
function M(t) {
|
|
49
|
-
return !!(typeof t == "string" || typeof t == "function" || t === s || t === i || G || t === a || t === v || t === u || F || t === k || p || h || E || typeof t == "object" && t !== null && (t.$$typeof === S || t.$$typeof === y || t.$$typeof === m || t.$$typeof === l || t.$$typeof === d || // This needs to include all possible module reference object
|
|
50
|
-
// types supported by any Flight configuration anywhere since
|
|
51
|
-
// we don't know which Flight build this will end up being used
|
|
52
|
-
// with.
|
|
53
|
-
t.$$typeof === ne || t.getModuleId !== void 0));
|
|
54
|
-
}
|
|
55
|
-
function Q(t, o, g) {
|
|
56
|
-
var C = t.displayName;
|
|
57
|
-
if (C)
|
|
58
|
-
return C;
|
|
59
|
-
var A = o.displayName || o.name || "";
|
|
60
|
-
return A !== "" ? g + "(" + A + ")" : g;
|
|
61
|
-
}
|
|
62
|
-
function Oe(t) {
|
|
63
|
-
return t.displayName || "Context";
|
|
64
|
-
}
|
|
65
|
-
function W(t) {
|
|
66
|
-
if (t == null)
|
|
67
|
-
return null;
|
|
68
|
-
if (typeof t.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
69
|
-
return t.displayName || t.name || null;
|
|
70
|
-
if (typeof t == "string")
|
|
71
|
-
return t;
|
|
72
|
-
switch (t) {
|
|
73
|
-
case s:
|
|
74
|
-
return "Fragment";
|
|
75
|
-
case r:
|
|
76
|
-
return "Portal";
|
|
77
|
-
case i:
|
|
78
|
-
return "Profiler";
|
|
79
|
-
case a:
|
|
80
|
-
return "StrictMode";
|
|
81
|
-
case v:
|
|
82
|
-
return "Suspense";
|
|
83
|
-
case u:
|
|
84
|
-
return "SuspenseList";
|
|
85
|
-
}
|
|
86
|
-
if (typeof t == "object")
|
|
87
|
-
switch (t.$$typeof) {
|
|
88
|
-
case l:
|
|
89
|
-
var o = t;
|
|
90
|
-
return Oe(o) + ".Consumer";
|
|
91
|
-
case m:
|
|
92
|
-
var g = t;
|
|
93
|
-
return Oe(g._context) + ".Provider";
|
|
94
|
-
case d:
|
|
95
|
-
return Q(t, t.render, "ForwardRef");
|
|
96
|
-
case y:
|
|
97
|
-
var C = t.displayName || null;
|
|
98
|
-
return C !== null ? C : W(t.type) || "Memo";
|
|
99
|
-
case S: {
|
|
100
|
-
var A = t, R = A._payload, b = A._init;
|
|
101
|
-
try {
|
|
102
|
-
return W(b(R));
|
|
103
|
-
} catch {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
var N = Object.assign, X = 0, Je, je, De, Ve, Ie, Me, Le;
|
|
111
|
-
function $e() {
|
|
112
|
-
}
|
|
113
|
-
$e.__reactDisabledLog = !0;
|
|
114
|
-
function wt() {
|
|
115
|
-
{
|
|
116
|
-
if (X === 0) {
|
|
117
|
-
Je = console.log, je = console.info, De = console.warn, Ve = console.error, Ie = console.group, Me = console.groupCollapsed, Le = console.groupEnd;
|
|
118
|
-
var t = {
|
|
119
|
-
configurable: !0,
|
|
120
|
-
enumerable: !0,
|
|
121
|
-
value: $e,
|
|
122
|
-
writable: !0
|
|
123
|
-
};
|
|
124
|
-
Object.defineProperties(console, {
|
|
125
|
-
info: t,
|
|
126
|
-
log: t,
|
|
127
|
-
warn: t,
|
|
128
|
-
error: t,
|
|
129
|
-
group: t,
|
|
130
|
-
groupCollapsed: t,
|
|
131
|
-
groupEnd: t
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
X++;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function bt() {
|
|
138
|
-
{
|
|
139
|
-
if (X--, X === 0) {
|
|
140
|
-
var t = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
writable: !0
|
|
144
|
-
};
|
|
145
|
-
Object.defineProperties(console, {
|
|
146
|
-
log: N({}, t, {
|
|
147
|
-
value: Je
|
|
148
|
-
}),
|
|
149
|
-
info: N({}, t, {
|
|
150
|
-
value: je
|
|
151
|
-
}),
|
|
152
|
-
warn: N({}, t, {
|
|
153
|
-
value: De
|
|
154
|
-
}),
|
|
155
|
-
error: N({}, t, {
|
|
156
|
-
value: Ve
|
|
157
|
-
}),
|
|
158
|
-
group: N({}, t, {
|
|
159
|
-
value: Ie
|
|
160
|
-
}),
|
|
161
|
-
groupCollapsed: N({}, t, {
|
|
162
|
-
value: Me
|
|
163
|
-
}),
|
|
164
|
-
groupEnd: N({}, t, {
|
|
165
|
-
value: Le
|
|
166
|
-
})
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
X < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
var ye = j.ReactCurrentDispatcher, Ce;
|
|
173
|
-
function re(t, o, g) {
|
|
174
|
-
{
|
|
175
|
-
if (Ce === void 0)
|
|
176
|
-
try {
|
|
177
|
-
throw Error();
|
|
178
|
-
} catch (A) {
|
|
179
|
-
var C = A.stack.trim().match(/\n( *(at )?)/);
|
|
180
|
-
Ce = C && C[1] || "";
|
|
181
|
-
}
|
|
182
|
-
return `
|
|
183
|
-
` + Ce + t;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
var Se = !1, oe;
|
|
187
|
-
{
|
|
188
|
-
var Et = typeof WeakMap == "function" ? WeakMap : Map;
|
|
189
|
-
oe = new Et();
|
|
190
|
-
}
|
|
191
|
-
function Ge(t, o) {
|
|
192
|
-
if (!t || Se)
|
|
193
|
-
return "";
|
|
194
|
-
{
|
|
195
|
-
var g = oe.get(t);
|
|
196
|
-
if (g !== void 0)
|
|
197
|
-
return g;
|
|
198
|
-
}
|
|
199
|
-
var C;
|
|
200
|
-
Se = !0;
|
|
201
|
-
var A = Error.prepareStackTrace;
|
|
202
|
-
Error.prepareStackTrace = void 0;
|
|
203
|
-
var R;
|
|
204
|
-
R = ye.current, ye.current = null, wt();
|
|
205
|
-
try {
|
|
206
|
-
if (o) {
|
|
207
|
-
var b = function() {
|
|
208
|
-
throw Error();
|
|
209
|
-
};
|
|
210
|
-
if (Object.defineProperty(b.prototype, "props", {
|
|
211
|
-
set: function() {
|
|
212
|
-
throw Error();
|
|
213
|
-
}
|
|
214
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
215
|
-
try {
|
|
216
|
-
Reflect.construct(b, []);
|
|
217
|
-
} catch (O) {
|
|
218
|
-
C = O;
|
|
219
|
-
}
|
|
220
|
-
Reflect.construct(t, [], b);
|
|
221
|
-
} else {
|
|
222
|
-
try {
|
|
223
|
-
b.call();
|
|
224
|
-
} catch (O) {
|
|
225
|
-
C = O;
|
|
226
|
-
}
|
|
227
|
-
t.call(b.prototype);
|
|
228
|
-
}
|
|
229
|
-
} else {
|
|
230
|
-
try {
|
|
231
|
-
throw Error();
|
|
232
|
-
} catch (O) {
|
|
233
|
-
C = O;
|
|
234
|
-
}
|
|
235
|
-
t();
|
|
236
|
-
}
|
|
237
|
-
} catch (O) {
|
|
238
|
-
if (O && C && typeof O.stack == "string") {
|
|
239
|
-
for (var w = O.stack.split(`
|
|
240
|
-
`), P = C.stack.split(`
|
|
241
|
-
`), x = w.length - 1, _ = P.length - 1; x >= 1 && _ >= 0 && w[x] !== P[_]; )
|
|
242
|
-
_--;
|
|
243
|
-
for (; x >= 1 && _ >= 0; x--, _--)
|
|
244
|
-
if (w[x] !== P[_]) {
|
|
245
|
-
if (x !== 1 || _ !== 1)
|
|
246
|
-
do
|
|
247
|
-
if (x--, _--, _ < 0 || w[x] !== P[_]) {
|
|
248
|
-
var D = `
|
|
249
|
-
` + w[x].replace(" at new ", " at ");
|
|
250
|
-
return t.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", t.displayName)), typeof t == "function" && oe.set(t, D), D;
|
|
251
|
-
}
|
|
252
|
-
while (x >= 1 && _ >= 0);
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
} finally {
|
|
257
|
-
Se = !1, ye.current = R, bt(), Error.prepareStackTrace = A;
|
|
258
|
-
}
|
|
259
|
-
var Y = t ? t.displayName || t.name : "", q = Y ? re(Y) : "";
|
|
260
|
-
return typeof t == "function" && oe.set(t, q), q;
|
|
261
|
-
}
|
|
262
|
-
function At(t, o, g) {
|
|
263
|
-
return Ge(t, !1);
|
|
264
|
-
}
|
|
265
|
-
function Rt(t) {
|
|
266
|
-
var o = t.prototype;
|
|
267
|
-
return !!(o && o.isReactComponent);
|
|
268
|
-
}
|
|
269
|
-
function ae(t, o, g) {
|
|
270
|
-
if (t == null)
|
|
271
|
-
return "";
|
|
272
|
-
if (typeof t == "function")
|
|
273
|
-
return Ge(t, Rt(t));
|
|
274
|
-
if (typeof t == "string")
|
|
275
|
-
return re(t);
|
|
276
|
-
switch (t) {
|
|
277
|
-
case v:
|
|
278
|
-
return re("Suspense");
|
|
279
|
-
case u:
|
|
280
|
-
return re("SuspenseList");
|
|
281
|
-
}
|
|
282
|
-
if (typeof t == "object")
|
|
283
|
-
switch (t.$$typeof) {
|
|
284
|
-
case d:
|
|
285
|
-
return At(t.render);
|
|
286
|
-
case y:
|
|
287
|
-
return ae(t.type, o, g);
|
|
288
|
-
case S: {
|
|
289
|
-
var C = t, A = C._payload, R = C._init;
|
|
290
|
-
try {
|
|
291
|
-
return ae(R(A), o, g);
|
|
292
|
-
} catch {
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
return "";
|
|
297
|
-
}
|
|
298
|
-
var Z = Object.prototype.hasOwnProperty, We = {}, Ne = j.ReactDebugCurrentFrame;
|
|
299
|
-
function ie(t) {
|
|
300
|
-
if (t) {
|
|
301
|
-
var o = t._owner, g = ae(t.type, t._source, o ? o.type : null);
|
|
302
|
-
Ne.setExtraStackFrame(g);
|
|
303
|
-
} else
|
|
304
|
-
Ne.setExtraStackFrame(null);
|
|
305
|
-
}
|
|
306
|
-
function kt(t, o, g, C, A) {
|
|
307
|
-
{
|
|
308
|
-
var R = Function.call.bind(Z);
|
|
309
|
-
for (var b in t)
|
|
310
|
-
if (R(t, b)) {
|
|
311
|
-
var w = void 0;
|
|
312
|
-
try {
|
|
313
|
-
if (typeof t[b] != "function") {
|
|
314
|
-
var P = Error((C || "React class") + ": " + g + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
315
|
-
throw P.name = "Invariant Violation", P;
|
|
316
|
-
}
|
|
317
|
-
w = t[b](o, b, C, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
318
|
-
} catch (x) {
|
|
319
|
-
w = x;
|
|
320
|
-
}
|
|
321
|
-
w && !(w instanceof Error) && (ie(A), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", C || "React class", g, b, typeof w), ie(null)), w instanceof Error && !(w.message in We) && (We[w.message] = !0, ie(A), T("Failed %s type: %s", g, w.message), ie(null));
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
var Tt = Array.isArray;
|
|
326
|
-
function he(t) {
|
|
327
|
-
return Tt(t);
|
|
328
|
-
}
|
|
329
|
-
function xt(t) {
|
|
330
|
-
{
|
|
331
|
-
var o = typeof Symbol == "function" && Symbol.toStringTag, g = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
332
|
-
return g;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
function Ft(t) {
|
|
336
|
-
try {
|
|
337
|
-
return qe(t), !1;
|
|
338
|
-
} catch {
|
|
339
|
-
return !0;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
function qe(t) {
|
|
343
|
-
return "" + t;
|
|
344
|
-
}
|
|
345
|
-
function Ue(t) {
|
|
346
|
-
if (Ft(t))
|
|
347
|
-
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", xt(t)), qe(t);
|
|
348
|
-
}
|
|
349
|
-
var Be = j.ReactCurrentOwner, _t = {
|
|
350
|
-
key: !0,
|
|
351
|
-
ref: !0,
|
|
352
|
-
__self: !0,
|
|
353
|
-
__source: !0
|
|
354
|
-
}, Ye, ze;
|
|
355
|
-
function Pt(t) {
|
|
356
|
-
if (Z.call(t, "ref")) {
|
|
357
|
-
var o = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
358
|
-
if (o && o.isReactWarning)
|
|
359
|
-
return !1;
|
|
360
|
-
}
|
|
361
|
-
return t.ref !== void 0;
|
|
362
|
-
}
|
|
363
|
-
function Ot(t) {
|
|
364
|
-
if (Z.call(t, "key")) {
|
|
365
|
-
var o = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
366
|
-
if (o && o.isReactWarning)
|
|
367
|
-
return !1;
|
|
368
|
-
}
|
|
369
|
-
return t.key !== void 0;
|
|
370
|
-
}
|
|
371
|
-
function Jt(t, o) {
|
|
372
|
-
typeof t.ref == "string" && Be.current;
|
|
373
|
-
}
|
|
374
|
-
function jt(t, o) {
|
|
375
|
-
{
|
|
376
|
-
var g = function() {
|
|
377
|
-
Ye || (Ye = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
378
|
-
};
|
|
379
|
-
g.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
380
|
-
get: g,
|
|
381
|
-
configurable: !0
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
function Dt(t, o) {
|
|
386
|
-
{
|
|
387
|
-
var g = function() {
|
|
388
|
-
ze || (ze = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
389
|
-
};
|
|
390
|
-
g.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
391
|
-
get: g,
|
|
392
|
-
configurable: !0
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
var Vt = function(t, o, g, C, A, R, b) {
|
|
397
|
-
var w = {
|
|
398
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
399
|
-
$$typeof: n,
|
|
400
|
-
// Built-in properties that belong on the element
|
|
401
|
-
type: t,
|
|
402
|
-
key: o,
|
|
403
|
-
ref: g,
|
|
404
|
-
props: b,
|
|
405
|
-
// Record the component responsible for creating this element.
|
|
406
|
-
_owner: R
|
|
407
|
-
};
|
|
408
|
-
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
409
|
-
configurable: !1,
|
|
410
|
-
enumerable: !1,
|
|
411
|
-
writable: !0,
|
|
412
|
-
value: !1
|
|
413
|
-
}), Object.defineProperty(w, "_self", {
|
|
414
|
-
configurable: !1,
|
|
415
|
-
enumerable: !1,
|
|
416
|
-
writable: !1,
|
|
417
|
-
value: C
|
|
418
|
-
}), Object.defineProperty(w, "_source", {
|
|
419
|
-
configurable: !1,
|
|
420
|
-
enumerable: !1,
|
|
421
|
-
writable: !1,
|
|
422
|
-
value: A
|
|
423
|
-
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
424
|
-
};
|
|
425
|
-
function It(t, o, g, C, A) {
|
|
426
|
-
{
|
|
427
|
-
var R, b = {}, w = null, P = null;
|
|
428
|
-
g !== void 0 && (Ue(g), w = "" + g), Ot(o) && (Ue(o.key), w = "" + o.key), Pt(o) && (P = o.ref, Jt(o, A));
|
|
429
|
-
for (R in o)
|
|
430
|
-
Z.call(o, R) && !_t.hasOwnProperty(R) && (b[R] = o[R]);
|
|
431
|
-
if (t && t.defaultProps) {
|
|
432
|
-
var x = t.defaultProps;
|
|
433
|
-
for (R in x)
|
|
434
|
-
b[R] === void 0 && (b[R] = x[R]);
|
|
435
|
-
}
|
|
436
|
-
if (w || P) {
|
|
437
|
-
var _ = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
438
|
-
w && jt(b, _), P && Dt(b, _);
|
|
439
|
-
}
|
|
440
|
-
return Vt(t, w, P, A, C, Be.current, b);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
var we = j.ReactCurrentOwner, He = j.ReactDebugCurrentFrame;
|
|
444
|
-
function B(t) {
|
|
445
|
-
if (t) {
|
|
446
|
-
var o = t._owner, g = ae(t.type, t._source, o ? o.type : null);
|
|
447
|
-
He.setExtraStackFrame(g);
|
|
448
|
-
} else
|
|
449
|
-
He.setExtraStackFrame(null);
|
|
450
|
-
}
|
|
451
|
-
var be;
|
|
452
|
-
be = !1;
|
|
453
|
-
function Ee(t) {
|
|
454
|
-
return typeof t == "object" && t !== null && t.$$typeof === n;
|
|
455
|
-
}
|
|
456
|
-
function Ke() {
|
|
457
|
-
{
|
|
458
|
-
if (we.current) {
|
|
459
|
-
var t = W(we.current.type);
|
|
460
|
-
if (t)
|
|
461
|
-
return `
|
|
462
|
-
|
|
463
|
-
Check the render method of \`` + t + "`.";
|
|
464
|
-
}
|
|
465
|
-
return "";
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
function Mt(t) {
|
|
469
|
-
return "";
|
|
470
|
-
}
|
|
471
|
-
var Qe = {};
|
|
472
|
-
function Lt(t) {
|
|
473
|
-
{
|
|
474
|
-
var o = Ke();
|
|
475
|
-
if (!o) {
|
|
476
|
-
var g = typeof t == "string" ? t : t.displayName || t.name;
|
|
477
|
-
g && (o = `
|
|
478
|
-
|
|
479
|
-
Check the top-level render call using <` + g + ">.");
|
|
480
|
-
}
|
|
481
|
-
return o;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
function Xe(t, o) {
|
|
485
|
-
{
|
|
486
|
-
if (!t._store || t._store.validated || t.key != null)
|
|
487
|
-
return;
|
|
488
|
-
t._store.validated = !0;
|
|
489
|
-
var g = Lt(o);
|
|
490
|
-
if (Qe[g])
|
|
491
|
-
return;
|
|
492
|
-
Qe[g] = !0;
|
|
493
|
-
var C = "";
|
|
494
|
-
t && t._owner && t._owner !== we.current && (C = " It was passed a child from " + W(t._owner.type) + "."), B(t), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), B(null);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
function Ze(t, o) {
|
|
498
|
-
{
|
|
499
|
-
if (typeof t != "object")
|
|
500
|
-
return;
|
|
501
|
-
if (he(t))
|
|
502
|
-
for (var g = 0; g < t.length; g++) {
|
|
503
|
-
var C = t[g];
|
|
504
|
-
Ee(C) && Xe(C, o);
|
|
505
|
-
}
|
|
506
|
-
else if (Ee(t))
|
|
507
|
-
t._store && (t._store.validated = !0);
|
|
508
|
-
else if (t) {
|
|
509
|
-
var A = $(t);
|
|
510
|
-
if (typeof A == "function" && A !== t.entries)
|
|
511
|
-
for (var R = A.call(t), b; !(b = R.next()).done; )
|
|
512
|
-
Ee(b.value) && Xe(b.value, o);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function $t(t) {
|
|
517
|
-
{
|
|
518
|
-
var o = t.type;
|
|
519
|
-
if (o == null || typeof o == "string")
|
|
520
|
-
return;
|
|
521
|
-
var g;
|
|
522
|
-
if (typeof o == "function")
|
|
523
|
-
g = o.propTypes;
|
|
524
|
-
else if (typeof o == "object" && (o.$$typeof === d || // Note: Memo only checks outer props here.
|
|
525
|
-
// Inner props are checked in the reconciler.
|
|
526
|
-
o.$$typeof === y))
|
|
527
|
-
g = o.propTypes;
|
|
528
|
-
else
|
|
529
|
-
return;
|
|
530
|
-
if (g) {
|
|
531
|
-
var C = W(o);
|
|
532
|
-
kt(g, t.props, "prop", C, t);
|
|
533
|
-
} else if (o.PropTypes !== void 0 && !be) {
|
|
534
|
-
be = !0;
|
|
535
|
-
var A = W(o);
|
|
536
|
-
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A || "Unknown");
|
|
537
|
-
}
|
|
538
|
-
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
function Gt(t) {
|
|
542
|
-
{
|
|
543
|
-
for (var o = Object.keys(t.props), g = 0; g < o.length; g++) {
|
|
544
|
-
var C = o[g];
|
|
545
|
-
if (C !== "children" && C !== "key") {
|
|
546
|
-
B(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), B(null);
|
|
547
|
-
break;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
t.ref !== null && (B(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), B(null));
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
var et = {};
|
|
554
|
-
function tt(t, o, g, C, A, R) {
|
|
555
|
-
{
|
|
556
|
-
var b = M(t);
|
|
557
|
-
if (!b) {
|
|
558
|
-
var w = "";
|
|
559
|
-
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
560
|
-
var P = Mt();
|
|
561
|
-
P ? w += P : w += Ke();
|
|
562
|
-
var x;
|
|
563
|
-
t === null ? x = "null" : he(t) ? x = "array" : t !== void 0 && t.$$typeof === n ? (x = "<" + (W(t.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : x = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", x, w);
|
|
564
|
-
}
|
|
565
|
-
var _ = It(t, o, g, A, R);
|
|
566
|
-
if (_ == null)
|
|
567
|
-
return _;
|
|
568
|
-
if (b) {
|
|
569
|
-
var D = o.children;
|
|
570
|
-
if (D !== void 0)
|
|
571
|
-
if (C)
|
|
572
|
-
if (he(D)) {
|
|
573
|
-
for (var Y = 0; Y < D.length; Y++)
|
|
574
|
-
Ze(D[Y], t);
|
|
575
|
-
Object.freeze && Object.freeze(D);
|
|
576
|
-
} else
|
|
577
|
-
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
578
|
-
else
|
|
579
|
-
Ze(D, t);
|
|
580
|
-
}
|
|
581
|
-
if (Z.call(o, "key")) {
|
|
582
|
-
var q = W(t), O = Object.keys(o).filter(function(Yt) {
|
|
583
|
-
return Yt !== "key";
|
|
584
|
-
}), Ae = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
585
|
-
if (!et[q + Ae]) {
|
|
586
|
-
var Bt = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
|
|
587
|
-
T(`A props object containing a "key" prop is being spread into JSX:
|
|
588
|
-
let props = %s;
|
|
589
|
-
<%s {...props} />
|
|
590
|
-
React keys must be passed directly to JSX without using spread:
|
|
591
|
-
let props = %s;
|
|
592
|
-
<%s key={someKey} {...props} />`, Ae, q, Bt, q), et[q + Ae] = !0;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
return t === s ? Gt(_) : $t(_), _;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
function Wt(t, o, g) {
|
|
599
|
-
return tt(t, o, g, !0);
|
|
600
|
-
}
|
|
601
|
-
function Nt(t, o, g) {
|
|
602
|
-
return tt(t, o, g, !1);
|
|
603
|
-
}
|
|
604
|
-
var qt = Nt, Ut = Wt;
|
|
605
|
-
te.Fragment = s, te.jsx = qt, te.jsxs = Ut;
|
|
606
|
-
}()), te;
|
|
607
|
-
}
|
|
608
|
-
var ot;
|
|
609
|
-
function Kt() {
|
|
610
|
-
return ot || (ot = 1, process.env.NODE_ENV === "production" ? se.exports = zt() : se.exports = Ht()), se.exports;
|
|
611
|
-
}
|
|
612
|
-
var ce = Kt();
|
|
613
|
-
const ut = Symbol("Comlink.proxy"), Qt = Symbol("Comlink.endpoint"), Xt = Symbol("Comlink.releaseProxy"), Re = Symbol("Comlink.finalizer"), ge = Symbol("Comlink.thrown"), ft = (e) => typeof e == "object" && e !== null || typeof e == "function", Zt = {
|
|
614
|
-
canHandle: (e) => ft(e) && e[ut],
|
|
615
|
-
serialize(e) {
|
|
616
|
-
const { port1: n, port2: r } = new MessageChannel();
|
|
617
|
-
return Pe(e, n), [r, [r]];
|
|
1
|
+
import { jsx as Q, jsxs as gt, Fragment as mt } from "react/jsx-runtime";
|
|
2
|
+
import D, { useCallback as T, useEffect as w, useMemo as U } from "react";
|
|
3
|
+
const et = Symbol("Comlink.proxy"), pt = Symbol("Comlink.endpoint"), yt = Symbol("Comlink.releaseProxy"), q = Symbol("Comlink.finalizer"), L = Symbol("Comlink.thrown"), nt = (t) => typeof t == "object" && t !== null || typeof t == "function", vt = {
|
|
4
|
+
canHandle: (t) => nt(t) && t[et],
|
|
5
|
+
serialize(t) {
|
|
6
|
+
const { port1: e, port2: n } = new MessageChannel();
|
|
7
|
+
return _(t, e), [n, [n]];
|
|
618
8
|
},
|
|
619
|
-
deserialize(
|
|
620
|
-
return
|
|
9
|
+
deserialize(t) {
|
|
10
|
+
return t.start(), st(t);
|
|
621
11
|
}
|
|
622
|
-
},
|
|
623
|
-
canHandle: (
|
|
624
|
-
serialize({ value:
|
|
625
|
-
let
|
|
626
|
-
return
|
|
12
|
+
}, Ct = {
|
|
13
|
+
canHandle: (t) => nt(t) && L in t,
|
|
14
|
+
serialize({ value: t }) {
|
|
15
|
+
let e;
|
|
16
|
+
return t instanceof Error ? e = {
|
|
627
17
|
isError: !0,
|
|
628
18
|
value: {
|
|
629
|
-
message:
|
|
630
|
-
name:
|
|
631
|
-
stack:
|
|
19
|
+
message: t.message,
|
|
20
|
+
name: t.name,
|
|
21
|
+
stack: t.stack
|
|
632
22
|
}
|
|
633
|
-
} :
|
|
23
|
+
} : e = { isError: !1, value: t }, [e, []];
|
|
634
24
|
},
|
|
635
|
-
deserialize(
|
|
636
|
-
throw
|
|
25
|
+
deserialize(t) {
|
|
26
|
+
throw t.isError ? Object.assign(new Error(t.value.message), t.value) : t.value;
|
|
637
27
|
}
|
|
638
|
-
},
|
|
639
|
-
["proxy",
|
|
640
|
-
["throw",
|
|
28
|
+
}, ot = /* @__PURE__ */ new Map([
|
|
29
|
+
["proxy", vt],
|
|
30
|
+
["throw", Ct]
|
|
641
31
|
]);
|
|
642
|
-
function
|
|
643
|
-
for (const
|
|
644
|
-
if (
|
|
32
|
+
function St(t, e) {
|
|
33
|
+
for (const n of t)
|
|
34
|
+
if (e === n || n === "*" || n instanceof RegExp && n.test(e))
|
|
645
35
|
return !0;
|
|
646
36
|
return !1;
|
|
647
37
|
}
|
|
648
|
-
function
|
|
649
|
-
|
|
650
|
-
if (!
|
|
38
|
+
function _(t, e = globalThis, n = ["*"]) {
|
|
39
|
+
e.addEventListener("message", function s(o) {
|
|
40
|
+
if (!o || !o.data)
|
|
651
41
|
return;
|
|
652
|
-
if (!
|
|
653
|
-
console.warn(`Invalid origin '${
|
|
42
|
+
if (!St(n, o.origin)) {
|
|
43
|
+
console.warn(`Invalid origin '${o.origin}' for comlink proxy`);
|
|
654
44
|
return;
|
|
655
45
|
}
|
|
656
|
-
const { id:
|
|
657
|
-
let
|
|
46
|
+
const { id: r, type: g, path: c } = Object.assign({ path: [] }, o.data), f = (o.data.argumentList || []).map(J);
|
|
47
|
+
let d;
|
|
658
48
|
try {
|
|
659
|
-
const u =
|
|
660
|
-
switch (
|
|
49
|
+
const u = c.slice(0, -1).reduce((y, C) => y[C], t), m = c.reduce((y, C) => y[C], t);
|
|
50
|
+
switch (g) {
|
|
661
51
|
case "GET":
|
|
662
|
-
|
|
52
|
+
d = m;
|
|
663
53
|
break;
|
|
664
54
|
case "SET":
|
|
665
|
-
u[
|
|
55
|
+
u[c.slice(-1)[0]] = J(o.data.value), d = !0;
|
|
666
56
|
break;
|
|
667
57
|
case "APPLY":
|
|
668
|
-
|
|
58
|
+
d = m.apply(u, f);
|
|
669
59
|
break;
|
|
670
60
|
case "CONSTRUCT":
|
|
671
61
|
{
|
|
672
|
-
const
|
|
673
|
-
|
|
62
|
+
const y = new m(...f);
|
|
63
|
+
d = ct(y);
|
|
674
64
|
}
|
|
675
65
|
break;
|
|
676
66
|
case "ENDPOINT":
|
|
677
67
|
{
|
|
678
|
-
const { port1:
|
|
679
|
-
|
|
68
|
+
const { port1: y, port2: C } = new MessageChannel();
|
|
69
|
+
_(t, C), d = Et(y, [y]);
|
|
680
70
|
}
|
|
681
71
|
break;
|
|
682
72
|
case "RELEASE":
|
|
683
|
-
|
|
73
|
+
d = void 0;
|
|
684
74
|
break;
|
|
685
75
|
default:
|
|
686
76
|
return;
|
|
687
77
|
}
|
|
688
78
|
} catch (u) {
|
|
689
|
-
|
|
79
|
+
d = { value: u, [L]: 0 };
|
|
690
80
|
}
|
|
691
|
-
Promise.resolve(
|
|
692
|
-
const [
|
|
693
|
-
|
|
81
|
+
Promise.resolve(d).catch((u) => ({ value: u, [L]: 0 })).then((u) => {
|
|
82
|
+
const [m, y] = O(u);
|
|
83
|
+
e.postMessage(Object.assign(Object.assign({}, m), { id: r }), y), g === "RELEASE" && (e.removeEventListener("message", s), rt(e), q in t && typeof t[q] == "function" && t[q]());
|
|
694
84
|
}).catch((u) => {
|
|
695
|
-
const [
|
|
85
|
+
const [m, y] = O({
|
|
696
86
|
value: new TypeError("Unserializable return value"),
|
|
697
|
-
[
|
|
87
|
+
[L]: 0
|
|
698
88
|
});
|
|
699
|
-
|
|
89
|
+
e.postMessage(Object.assign(Object.assign({}, m), { id: r }), y);
|
|
700
90
|
});
|
|
701
|
-
}),
|
|
91
|
+
}), e.start && e.start();
|
|
702
92
|
}
|
|
703
|
-
function
|
|
704
|
-
return
|
|
93
|
+
function wt(t) {
|
|
94
|
+
return t.constructor.name === "MessagePort";
|
|
705
95
|
}
|
|
706
|
-
function
|
|
707
|
-
|
|
96
|
+
function rt(t) {
|
|
97
|
+
wt(t) && t.close();
|
|
708
98
|
}
|
|
709
|
-
function
|
|
710
|
-
const
|
|
711
|
-
return
|
|
712
|
-
const { data:
|
|
713
|
-
if (!
|
|
99
|
+
function st(t, e) {
|
|
100
|
+
const n = /* @__PURE__ */ new Map();
|
|
101
|
+
return t.addEventListener("message", function(o) {
|
|
102
|
+
const { data: r } = o;
|
|
103
|
+
if (!r || !r.id)
|
|
714
104
|
return;
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
105
|
+
const g = n.get(r.id);
|
|
106
|
+
if (g)
|
|
717
107
|
try {
|
|
718
|
-
|
|
108
|
+
g(r);
|
|
719
109
|
} finally {
|
|
720
|
-
|
|
110
|
+
n.delete(r.id);
|
|
721
111
|
}
|
|
722
|
-
}),
|
|
112
|
+
}), z(t, n, [], e);
|
|
723
113
|
}
|
|
724
|
-
function
|
|
725
|
-
if (
|
|
114
|
+
function P(t) {
|
|
115
|
+
if (t)
|
|
726
116
|
throw new Error("Proxy has been released and is not useable");
|
|
727
117
|
}
|
|
728
|
-
function
|
|
729
|
-
return
|
|
118
|
+
function it(t) {
|
|
119
|
+
return R(t, /* @__PURE__ */ new Map(), {
|
|
730
120
|
type: "RELEASE"
|
|
731
121
|
}).then(() => {
|
|
732
|
-
|
|
122
|
+
rt(t);
|
|
733
123
|
});
|
|
734
124
|
}
|
|
735
|
-
const
|
|
736
|
-
const
|
|
737
|
-
|
|
125
|
+
const j = /* @__PURE__ */ new WeakMap(), $ = "FinalizationRegistry" in globalThis && new FinalizationRegistry((t) => {
|
|
126
|
+
const e = (j.get(t) || 0) - 1;
|
|
127
|
+
j.set(t, e), e === 0 && it(t);
|
|
738
128
|
});
|
|
739
|
-
function
|
|
740
|
-
const
|
|
741
|
-
|
|
129
|
+
function ht(t, e) {
|
|
130
|
+
const n = (j.get(e) || 0) + 1;
|
|
131
|
+
j.set(e, n), $ && $.register(t, e, t);
|
|
742
132
|
}
|
|
743
|
-
function
|
|
744
|
-
|
|
133
|
+
function At(t) {
|
|
134
|
+
$ && $.unregister(t);
|
|
745
135
|
}
|
|
746
|
-
function
|
|
136
|
+
function z(t, e, n = [], s = function() {
|
|
747
137
|
}) {
|
|
748
|
-
let
|
|
749
|
-
const
|
|
750
|
-
get(
|
|
751
|
-
if (
|
|
138
|
+
let o = !1;
|
|
139
|
+
const r = new Proxy(s, {
|
|
140
|
+
get(g, c) {
|
|
141
|
+
if (P(o), c === yt)
|
|
752
142
|
return () => {
|
|
753
|
-
|
|
143
|
+
At(r), it(t), e.clear(), o = !0;
|
|
754
144
|
};
|
|
755
|
-
if (
|
|
756
|
-
if (
|
|
757
|
-
return { then: () =>
|
|
758
|
-
const
|
|
145
|
+
if (c === "then") {
|
|
146
|
+
if (n.length === 0)
|
|
147
|
+
return { then: () => r };
|
|
148
|
+
const f = R(t, e, {
|
|
759
149
|
type: "GET",
|
|
760
|
-
path:
|
|
761
|
-
}).then(
|
|
762
|
-
return
|
|
150
|
+
path: n.map((d) => d.toString())
|
|
151
|
+
}).then(J);
|
|
152
|
+
return f.then.bind(f);
|
|
763
153
|
}
|
|
764
|
-
return
|
|
154
|
+
return z(t, e, [...n, c]);
|
|
765
155
|
},
|
|
766
|
-
set(
|
|
767
|
-
|
|
768
|
-
const [
|
|
769
|
-
return
|
|
156
|
+
set(g, c, f) {
|
|
157
|
+
P(o);
|
|
158
|
+
const [d, u] = O(f);
|
|
159
|
+
return R(t, e, {
|
|
770
160
|
type: "SET",
|
|
771
|
-
path: [...
|
|
772
|
-
value:
|
|
773
|
-
}, u).then(
|
|
161
|
+
path: [...n, c].map((m) => m.toString()),
|
|
162
|
+
value: d
|
|
163
|
+
}, u).then(J);
|
|
774
164
|
},
|
|
775
|
-
apply(
|
|
776
|
-
|
|
777
|
-
const
|
|
778
|
-
if (
|
|
779
|
-
return
|
|
165
|
+
apply(g, c, f) {
|
|
166
|
+
P(o);
|
|
167
|
+
const d = n[n.length - 1];
|
|
168
|
+
if (d === pt)
|
|
169
|
+
return R(t, e, {
|
|
780
170
|
type: "ENDPOINT"
|
|
781
|
-
}).then(
|
|
782
|
-
if (
|
|
783
|
-
return
|
|
784
|
-
const [u,
|
|
785
|
-
return
|
|
171
|
+
}).then(J);
|
|
172
|
+
if (d === "bind")
|
|
173
|
+
return z(t, e, n.slice(0, -1));
|
|
174
|
+
const [u, m] = Y(f);
|
|
175
|
+
return R(t, e, {
|
|
786
176
|
type: "APPLY",
|
|
787
|
-
path:
|
|
177
|
+
path: n.map((y) => y.toString()),
|
|
788
178
|
argumentList: u
|
|
789
|
-
},
|
|
179
|
+
}, m).then(J);
|
|
790
180
|
},
|
|
791
|
-
construct(
|
|
792
|
-
|
|
793
|
-
const [
|
|
794
|
-
return
|
|
181
|
+
construct(g, c) {
|
|
182
|
+
P(o);
|
|
183
|
+
const [f, d] = Y(c);
|
|
184
|
+
return R(t, e, {
|
|
795
185
|
type: "CONSTRUCT",
|
|
796
|
-
path:
|
|
797
|
-
argumentList:
|
|
798
|
-
},
|
|
186
|
+
path: n.map((u) => u.toString()),
|
|
187
|
+
argumentList: f
|
|
188
|
+
}, d).then(J);
|
|
799
189
|
}
|
|
800
190
|
});
|
|
801
|
-
return
|
|
191
|
+
return ht(r, t), r;
|
|
802
192
|
}
|
|
803
|
-
function
|
|
804
|
-
return Array.prototype.concat.apply([],
|
|
193
|
+
function bt(t) {
|
|
194
|
+
return Array.prototype.concat.apply([], t);
|
|
805
195
|
}
|
|
806
|
-
function
|
|
807
|
-
const
|
|
808
|
-
return [
|
|
196
|
+
function Y(t) {
|
|
197
|
+
const e = t.map(O);
|
|
198
|
+
return [e.map((n) => n[0]), bt(e.map((n) => n[1]))];
|
|
809
199
|
}
|
|
810
|
-
const
|
|
811
|
-
function
|
|
812
|
-
return
|
|
200
|
+
const at = /* @__PURE__ */ new WeakMap();
|
|
201
|
+
function Et(t, e) {
|
|
202
|
+
return at.set(t, e), t;
|
|
813
203
|
}
|
|
814
|
-
function
|
|
815
|
-
return Object.assign(
|
|
204
|
+
function ct(t) {
|
|
205
|
+
return Object.assign(t, { [et]: !0 });
|
|
816
206
|
}
|
|
817
|
-
function
|
|
207
|
+
function kt(t, e = globalThis, n = "*") {
|
|
818
208
|
return {
|
|
819
|
-
postMessage: (s,
|
|
820
|
-
addEventListener:
|
|
821
|
-
removeEventListener:
|
|
209
|
+
postMessage: (s, o) => t.postMessage(s, n, o),
|
|
210
|
+
addEventListener: e.addEventListener.bind(e),
|
|
211
|
+
removeEventListener: e.removeEventListener.bind(e)
|
|
822
212
|
};
|
|
823
213
|
}
|
|
824
|
-
function
|
|
825
|
-
for (const [
|
|
826
|
-
if (
|
|
827
|
-
const [s,
|
|
214
|
+
function O(t) {
|
|
215
|
+
for (const [e, n] of ot)
|
|
216
|
+
if (n.canHandle(t)) {
|
|
217
|
+
const [s, o] = n.serialize(t);
|
|
828
218
|
return [
|
|
829
219
|
{
|
|
830
220
|
type: "HANDLER",
|
|
831
|
-
name:
|
|
221
|
+
name: e,
|
|
832
222
|
value: s
|
|
833
223
|
},
|
|
834
|
-
|
|
224
|
+
o
|
|
835
225
|
];
|
|
836
226
|
}
|
|
837
227
|
return [
|
|
838
228
|
{
|
|
839
229
|
type: "RAW",
|
|
840
|
-
value:
|
|
230
|
+
value: t
|
|
841
231
|
},
|
|
842
|
-
|
|
232
|
+
at.get(t) || []
|
|
843
233
|
];
|
|
844
234
|
}
|
|
845
|
-
function
|
|
846
|
-
switch (
|
|
235
|
+
function J(t) {
|
|
236
|
+
switch (t.type) {
|
|
847
237
|
case "HANDLER":
|
|
848
|
-
return
|
|
238
|
+
return ot.get(t.name).deserialize(t.value);
|
|
849
239
|
case "RAW":
|
|
850
|
-
return
|
|
240
|
+
return t.value;
|
|
851
241
|
}
|
|
852
242
|
}
|
|
853
|
-
function
|
|
854
|
-
return new Promise((
|
|
855
|
-
const
|
|
856
|
-
|
|
243
|
+
function R(t, e, n, s) {
|
|
244
|
+
return new Promise((o) => {
|
|
245
|
+
const r = Jt();
|
|
246
|
+
e.set(r, o), t.start && t.start(), t.postMessage(Object.assign({ id: r }, n), s);
|
|
857
247
|
});
|
|
858
248
|
}
|
|
859
|
-
function
|
|
249
|
+
function Jt() {
|
|
860
250
|
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
|
861
251
|
}
|
|
862
|
-
function
|
|
863
|
-
return
|
|
252
|
+
function Ft(t, e) {
|
|
253
|
+
return t.length === 0 ? e : `[${t}] ${e}`;
|
|
864
254
|
}
|
|
865
|
-
function
|
|
866
|
-
let
|
|
867
|
-
function
|
|
868
|
-
return
|
|
255
|
+
function xt(t, e) {
|
|
256
|
+
let n = !1, s, o, r;
|
|
257
|
+
function g(u) {
|
|
258
|
+
return Ft(t, u);
|
|
869
259
|
}
|
|
870
|
-
let
|
|
260
|
+
let c, f = !1;
|
|
871
261
|
if (window.parent === window)
|
|
872
|
-
console.warn(
|
|
262
|
+
console.warn(g("Contract link is not supported in standalone mode")), c = {
|
|
873
263
|
ready() {
|
|
874
264
|
return Promise.resolve();
|
|
875
265
|
},
|
|
@@ -879,491 +269,491 @@ function fn(e, n) {
|
|
|
879
269
|
done() {
|
|
880
270
|
return Promise.resolve();
|
|
881
271
|
},
|
|
882
|
-
provide(u,
|
|
272
|
+
provide(u, m, y) {
|
|
883
273
|
return Promise.resolve();
|
|
884
274
|
}
|
|
885
275
|
};
|
|
886
276
|
else {
|
|
887
|
-
const u =
|
|
888
|
-
|
|
889
|
-
declare(
|
|
890
|
-
if (s == null) throw new Error(
|
|
891
|
-
s(
|
|
277
|
+
const u = kt(window.parent, void 0, e);
|
|
278
|
+
_({
|
|
279
|
+
declare(m) {
|
|
280
|
+
if (s == null) throw new Error(g("No handler for declare"));
|
|
281
|
+
s(m);
|
|
892
282
|
},
|
|
893
283
|
done() {
|
|
894
|
-
if (
|
|
895
|
-
|
|
284
|
+
if (o == null) throw new Error(g("No handler for done"));
|
|
285
|
+
o();
|
|
896
286
|
},
|
|
897
|
-
provide(
|
|
898
|
-
if (
|
|
899
|
-
|
|
287
|
+
provide(m, y, C) {
|
|
288
|
+
if (r == null) throw new Error(g("No handler for provide"));
|
|
289
|
+
r(m, y, C);
|
|
900
290
|
}
|
|
901
|
-
}, u),
|
|
291
|
+
}, u), c = st(u), f = !0;
|
|
902
292
|
}
|
|
903
|
-
const
|
|
904
|
-
if (!
|
|
905
|
-
if (s == null ||
|
|
906
|
-
|
|
293
|
+
const d = () => {
|
|
294
|
+
if (!n) {
|
|
295
|
+
if (s == null || o == null || r == null) return;
|
|
296
|
+
n = !0, c.ready();
|
|
907
297
|
}
|
|
908
298
|
};
|
|
909
299
|
return {
|
|
910
|
-
declare: (u) =>
|
|
911
|
-
done: () =>
|
|
912
|
-
provide: (u,
|
|
300
|
+
declare: (u) => c.declare(u),
|
|
301
|
+
done: () => c.done(),
|
|
302
|
+
provide: (u, m, y) => c.provide(u, m, ct(y)),
|
|
913
303
|
get name() {
|
|
914
|
-
return
|
|
304
|
+
return t;
|
|
915
305
|
},
|
|
916
306
|
get isReady() {
|
|
917
|
-
return
|
|
307
|
+
return f;
|
|
918
308
|
},
|
|
919
309
|
set onDeclare(u) {
|
|
920
|
-
s = u,
|
|
310
|
+
s = u, d();
|
|
921
311
|
},
|
|
922
312
|
set onDone(u) {
|
|
923
|
-
|
|
313
|
+
o = u, d();
|
|
924
314
|
},
|
|
925
315
|
set onProvide(u) {
|
|
926
|
-
|
|
316
|
+
r = u, d();
|
|
927
317
|
}
|
|
928
318
|
};
|
|
929
319
|
}
|
|
930
|
-
function
|
|
931
|
-
return function(
|
|
932
|
-
let
|
|
933
|
-
function
|
|
934
|
-
if (
|
|
935
|
-
return
|
|
320
|
+
function Rt(t) {
|
|
321
|
+
return function(e) {
|
|
322
|
+
let n, s = !1, o = !1, r, g, c = !1, f = !1, d, u, m, y;
|
|
323
|
+
function C() {
|
|
324
|
+
if (r != null && r !== 0 && g != null)
|
|
325
|
+
return g;
|
|
936
326
|
}
|
|
937
|
-
function
|
|
938
|
-
if (
|
|
939
|
-
return
|
|
327
|
+
function E(i) {
|
|
328
|
+
if (r != null && g != null && !(i > r))
|
|
329
|
+
return g;
|
|
940
330
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
943
|
-
|
|
331
|
+
function A() {
|
|
332
|
+
return m ?? (f ? m = Promise.resolve() : m = new Promise((i, l) => {
|
|
333
|
+
y = i;
|
|
944
334
|
}));
|
|
945
335
|
}
|
|
946
|
-
function
|
|
947
|
-
return
|
|
336
|
+
function F() {
|
|
337
|
+
return d === void 0 && (d = {
|
|
948
338
|
get name() {
|
|
949
|
-
return
|
|
339
|
+
return e;
|
|
950
340
|
},
|
|
951
341
|
get version() {
|
|
952
|
-
return
|
|
342
|
+
return r;
|
|
953
343
|
},
|
|
954
344
|
get i() {
|
|
955
|
-
return
|
|
345
|
+
return C();
|
|
956
346
|
},
|
|
957
|
-
v: (
|
|
958
|
-
}),
|
|
347
|
+
v: (i) => E(i)
|
|
348
|
+
}), d;
|
|
959
349
|
}
|
|
960
|
-
function
|
|
350
|
+
function V() {
|
|
961
351
|
return u === void 0 && (u = {
|
|
962
352
|
get name() {
|
|
963
|
-
return
|
|
353
|
+
return e;
|
|
964
354
|
},
|
|
965
355
|
get version() {
|
|
966
|
-
return
|
|
356
|
+
return f ? r : void 0;
|
|
967
357
|
},
|
|
968
358
|
get i() {
|
|
969
|
-
return
|
|
359
|
+
return f ? C() : void 0;
|
|
970
360
|
},
|
|
971
|
-
v: (
|
|
361
|
+
v: (i) => f ? E(i) : void 0,
|
|
972
362
|
get promise() {
|
|
973
|
-
return
|
|
974
|
-
if (
|
|
975
|
-
return
|
|
363
|
+
return r === 0 ? Promise.reject(t("Remote interface not provided")) : A().then(() => {
|
|
364
|
+
if (r === 0) throw new Error(t("Remote interface not provided"));
|
|
365
|
+
return F();
|
|
976
366
|
});
|
|
977
367
|
}
|
|
978
368
|
}), u;
|
|
979
369
|
}
|
|
980
|
-
function
|
|
981
|
-
|
|
370
|
+
function k() {
|
|
371
|
+
y != null && (y(), y = void 0);
|
|
982
372
|
}
|
|
983
373
|
return {
|
|
984
374
|
get name() {
|
|
985
|
-
return
|
|
375
|
+
return e;
|
|
986
376
|
},
|
|
987
377
|
get localVersion() {
|
|
988
|
-
if (
|
|
989
|
-
return
|
|
378
|
+
if (n != null)
|
|
379
|
+
return n;
|
|
990
380
|
},
|
|
991
|
-
set localVersion(
|
|
992
|
-
if (
|
|
993
|
-
|
|
381
|
+
set localVersion(i) {
|
|
382
|
+
if (n != null && n !== i) throw new Error(t("A different local version is already set"));
|
|
383
|
+
n = i;
|
|
994
384
|
},
|
|
995
385
|
get localVersionSent() {
|
|
996
386
|
return s;
|
|
997
387
|
},
|
|
998
|
-
set localVersionSent(
|
|
999
|
-
if (!
|
|
1000
|
-
s =
|
|
388
|
+
set localVersionSent(i) {
|
|
389
|
+
if (!i && s) throw new Error(t("Local version already notified"));
|
|
390
|
+
s = i, i && n === 0 && (o = !0);
|
|
1001
391
|
},
|
|
1002
392
|
get localInterfaceSent() {
|
|
1003
|
-
return
|
|
393
|
+
return o;
|
|
1004
394
|
},
|
|
1005
|
-
set localInterfaceSent(
|
|
1006
|
-
if (
|
|
1007
|
-
if (!
|
|
1008
|
-
|
|
395
|
+
set localInterfaceSent(i) {
|
|
396
|
+
if (n == null) throw new Error(t("Local version not set"));
|
|
397
|
+
if (!i && o) throw new Error(t("Local interface already sent."));
|
|
398
|
+
o = i;
|
|
1009
399
|
},
|
|
1010
400
|
get remoteVersion() {
|
|
1011
|
-
if (
|
|
1012
|
-
return
|
|
401
|
+
if (r != null)
|
|
402
|
+
return r;
|
|
1013
403
|
},
|
|
1014
|
-
set remoteVersion(
|
|
1015
|
-
if (
|
|
1016
|
-
|
|
404
|
+
set remoteVersion(i) {
|
|
405
|
+
if (r != null && r !== i) throw new Error(t("A different remote version is already set for " + e + `(${r} -> ${i})`));
|
|
406
|
+
r = i, i === 0 && (c = !0);
|
|
1017
407
|
},
|
|
1018
408
|
get remoteVersionReceived() {
|
|
1019
|
-
return
|
|
409
|
+
return r != null;
|
|
1020
410
|
},
|
|
1021
|
-
setRemoteInterface: (
|
|
1022
|
-
if (
|
|
1023
|
-
if (
|
|
1024
|
-
console.warn(
|
|
411
|
+
setRemoteInterface: (i) => {
|
|
412
|
+
if (r == null) throw new Error(t("Remote version not set"));
|
|
413
|
+
if (r === 0) {
|
|
414
|
+
console.warn(t("Remote version is 0, remote interface is ignored."));
|
|
1025
415
|
return;
|
|
1026
416
|
}
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
417
|
+
if (c) throw new Error(t("Interface already provided."));
|
|
418
|
+
g = i, c = !0;
|
|
1029
419
|
},
|
|
1030
420
|
get remoteInterfaceReceived() {
|
|
1031
|
-
return
|
|
421
|
+
return c;
|
|
1032
422
|
},
|
|
1033
423
|
depGroup: void 0,
|
|
1034
424
|
get isActivable() {
|
|
1035
|
-
return
|
|
425
|
+
return c && o;
|
|
1036
426
|
},
|
|
1037
427
|
get isActivated() {
|
|
1038
|
-
return
|
|
428
|
+
return f;
|
|
1039
429
|
},
|
|
1040
430
|
activate() {
|
|
1041
|
-
if (!
|
|
1042
|
-
if (!
|
|
1043
|
-
if (!
|
|
1044
|
-
|
|
431
|
+
if (!f) {
|
|
432
|
+
if (!c) throw new Error(t("Remote interface not provided."));
|
|
433
|
+
if (!o) throw new Error(t("Local interface not sent"));
|
|
434
|
+
f = !0, k();
|
|
1045
435
|
}
|
|
1046
436
|
},
|
|
1047
|
-
getRemote: () =>
|
|
1048
|
-
getLazyRemote: () =>
|
|
437
|
+
getRemote: () => F(),
|
|
438
|
+
getLazyRemote: () => V(),
|
|
1049
439
|
get activationPromise() {
|
|
1050
|
-
return
|
|
440
|
+
return A();
|
|
1051
441
|
}
|
|
1052
442
|
};
|
|
1053
443
|
};
|
|
1054
444
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return function(
|
|
1057
|
-
let
|
|
1058
|
-
function
|
|
1059
|
-
return
|
|
445
|
+
function Tt(t) {
|
|
446
|
+
return function(e, n, s, o) {
|
|
447
|
+
let r = s, g = !1, c = !1;
|
|
448
|
+
function f() {
|
|
449
|
+
return e.every((d) => d.remoteVersionReceived && d.localVersionSent) && n.every((d) => d.remoteVersionReceived);
|
|
1060
450
|
}
|
|
1061
451
|
return {
|
|
1062
452
|
get isDeclared() {
|
|
1063
|
-
return
|
|
453
|
+
return c;
|
|
1064
454
|
},
|
|
1065
|
-
set isDeclared(
|
|
1066
|
-
if (!
|
|
1067
|
-
throw new Error(
|
|
1068
|
-
|
|
455
|
+
set isDeclared(d) {
|
|
456
|
+
if (!d && c)
|
|
457
|
+
throw new Error(t("Factory already declared"));
|
|
458
|
+
c = d;
|
|
1069
459
|
},
|
|
1070
460
|
get isReady() {
|
|
1071
|
-
return
|
|
461
|
+
return f();
|
|
1072
462
|
},
|
|
1073
463
|
get isDone() {
|
|
1074
|
-
return
|
|
464
|
+
return g;
|
|
1075
465
|
},
|
|
1076
466
|
get args() {
|
|
1077
|
-
return
|
|
467
|
+
return e;
|
|
1078
468
|
},
|
|
1079
469
|
get deps() {
|
|
1080
|
-
return
|
|
470
|
+
return n;
|
|
1081
471
|
},
|
|
1082
472
|
invoke() {
|
|
1083
|
-
if (
|
|
1084
|
-
throw new Error(
|
|
1085
|
-
if (!
|
|
1086
|
-
throw new Error(
|
|
1087
|
-
let
|
|
1088
|
-
|
|
473
|
+
if (g)
|
|
474
|
+
throw new Error(t("Factory already invoked"));
|
|
475
|
+
if (!f())
|
|
476
|
+
throw new Error(t("Factory is not ready"));
|
|
477
|
+
let d;
|
|
478
|
+
o ? d = e.map((y) => y.getRemote()) : d = e[0].getRemote();
|
|
1089
479
|
let u;
|
|
1090
|
-
const
|
|
480
|
+
const m = n.length > 0 ? n.map((y) => y.getRemote()) : null;
|
|
1091
481
|
try {
|
|
1092
|
-
u =
|
|
1093
|
-
} catch (
|
|
1094
|
-
throw new Error(
|
|
482
|
+
u = m == null ? r(d) : r(d, m);
|
|
483
|
+
} catch (y) {
|
|
484
|
+
throw new Error(t("error in factory:"), { cause: y });
|
|
1095
485
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
throw new Error(
|
|
1098
|
-
return
|
|
486
|
+
if (o || (u = [u]), u.length != e.length)
|
|
487
|
+
throw new Error(t("Invalid factory result"));
|
|
488
|
+
return g = !0, r = null, u;
|
|
1099
489
|
}
|
|
1100
490
|
};
|
|
1101
491
|
};
|
|
1102
492
|
}
|
|
1103
|
-
function
|
|
1104
|
-
return function(
|
|
1105
|
-
let
|
|
1106
|
-
function
|
|
1107
|
-
return
|
|
493
|
+
function Vt(t) {
|
|
494
|
+
return function(e, n, s, o) {
|
|
495
|
+
let r = n, g = !1;
|
|
496
|
+
function c() {
|
|
497
|
+
return e.every((f) => f.isActivated);
|
|
1108
498
|
}
|
|
1109
499
|
return {
|
|
1110
500
|
get isReady() {
|
|
1111
|
-
return
|
|
501
|
+
return c();
|
|
1112
502
|
},
|
|
1113
503
|
get isDone() {
|
|
1114
|
-
return
|
|
504
|
+
return g;
|
|
1115
505
|
},
|
|
1116
506
|
get args() {
|
|
1117
|
-
return
|
|
507
|
+
return e;
|
|
1118
508
|
},
|
|
1119
509
|
invoke() {
|
|
1120
|
-
if (
|
|
1121
|
-
const u = new Error(
|
|
1122
|
-
throw
|
|
510
|
+
if (g || !c()) {
|
|
511
|
+
const u = new Error(t(g ? "callback already invoked" : "callback parameters are not ready"));
|
|
512
|
+
throw o?.[1](u), u;
|
|
1123
513
|
}
|
|
1124
|
-
const
|
|
1125
|
-
let
|
|
514
|
+
const f = s ? e.map((u) => u.getRemote()) : e[0].getRemote();
|
|
515
|
+
let d;
|
|
1126
516
|
try {
|
|
1127
|
-
|
|
517
|
+
d = r(f);
|
|
1128
518
|
} catch (u) {
|
|
1129
|
-
|
|
519
|
+
o == null ? console.error(t("error in callback:"), u) : o[1](u);
|
|
1130
520
|
} finally {
|
|
1131
|
-
|
|
521
|
+
g = !0;
|
|
1132
522
|
}
|
|
1133
|
-
|
|
523
|
+
o?.[0](d);
|
|
1134
524
|
}
|
|
1135
525
|
};
|
|
1136
526
|
};
|
|
1137
527
|
}
|
|
1138
|
-
function
|
|
1139
|
-
return
|
|
528
|
+
function lt(t, e) {
|
|
529
|
+
return t == null || t.length === 0 ? e : `[${t}] ${e}`;
|
|
1140
530
|
}
|
|
1141
|
-
function
|
|
1142
|
-
function
|
|
1143
|
-
return
|
|
531
|
+
function Dt(t) {
|
|
532
|
+
function e(i) {
|
|
533
|
+
return lt(t.name, i);
|
|
1144
534
|
}
|
|
1145
|
-
const
|
|
1146
|
-
let
|
|
1147
|
-
const
|
|
1148
|
-
function u(
|
|
1149
|
-
let
|
|
1150
|
-
return
|
|
535
|
+
const n = Vt(e), s = Rt(e), o = Tt(e), r = {}, g = [];
|
|
536
|
+
let c = [], f;
|
|
537
|
+
const d = () => (f == null ? f = 0 : f++, f);
|
|
538
|
+
function u(i) {
|
|
539
|
+
let l = r[i];
|
|
540
|
+
return l == null && (l = s(i), l.localVersion == null && (A && (l.localVersion = 0), F && (l.localVersionSent = !0)), l.remoteVersion == null && V && (l.remoteVersion = 0), r[i] = l), l;
|
|
1151
541
|
}
|
|
1152
|
-
function
|
|
1153
|
-
return
|
|
542
|
+
function m(i) {
|
|
543
|
+
return i.map(u);
|
|
1154
544
|
}
|
|
1155
|
-
function
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
545
|
+
function y(...i) {
|
|
546
|
+
const l = d(), p = Array(l).fill(!1);
|
|
547
|
+
i.forEach((v) => {
|
|
548
|
+
v.forEach((S) => {
|
|
549
|
+
S.depGroup != null && (p[S.depGroup] = !0), S.depGroup = l;
|
|
1160
550
|
});
|
|
1161
|
-
}), Object.values(
|
|
1162
|
-
|
|
551
|
+
}), Object.values(r).forEach((v) => {
|
|
552
|
+
v.depGroup != null && v.depGroup !== l && p[v.depGroup] && (v.depGroup = l);
|
|
1163
553
|
});
|
|
1164
554
|
}
|
|
1165
|
-
|
|
1166
|
-
const
|
|
1167
|
-
for (let
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
},
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
}),
|
|
1174
|
-
},
|
|
1175
|
-
let
|
|
1176
|
-
if (
|
|
1177
|
-
throw new Error(
|
|
1178
|
-
if (
|
|
1179
|
-
throw new Error(
|
|
1180
|
-
if (
|
|
1181
|
-
throw new Error(
|
|
1182
|
-
|
|
555
|
+
t.onDeclare = (i) => {
|
|
556
|
+
const l = m(i.map((p) => p.name));
|
|
557
|
+
for (let p = 0; p < i.length; p++)
|
|
558
|
+
i[p].version != null && (l[p].remoteVersion = i[p].version);
|
|
559
|
+
y(l), k();
|
|
560
|
+
}, t.onDone = () => {
|
|
561
|
+
V || (V = !0, Object.values(r).forEach((i) => {
|
|
562
|
+
i.remoteVersion == null && (i.remoteVersion = 0);
|
|
563
|
+
}), k());
|
|
564
|
+
}, t.onProvide = (i, l, p) => {
|
|
565
|
+
let v = r[i];
|
|
566
|
+
if (v == null)
|
|
567
|
+
throw new Error(e(`Contract not declared : ${i}`));
|
|
568
|
+
if (v.remoteVersion != l)
|
|
569
|
+
throw new Error(e(`Remote declared version ${v.remoteVersion} of contract "${i}" but provided version ${l}.`));
|
|
570
|
+
if (v.remoteInterfaceReceived)
|
|
571
|
+
throw new Error(e(`Remote contract "${i}" is already provided.`));
|
|
572
|
+
v.setRemoteInterface(p), k();
|
|
1183
573
|
};
|
|
1184
|
-
let
|
|
1185
|
-
async function
|
|
1186
|
-
if (
|
|
1187
|
-
for (
|
|
1188
|
-
if (
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
for (const
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
}),
|
|
574
|
+
let C = !1, E = !1, A = !1, F = !1, V = !1;
|
|
575
|
+
async function k() {
|
|
576
|
+
if (E = !0, !C) {
|
|
577
|
+
for (C = !0; E; ) {
|
|
578
|
+
if (E = !1, t.isReady) {
|
|
579
|
+
const i = g.filter((l) => !l.isDeclared);
|
|
580
|
+
if (i.length > 0)
|
|
581
|
+
for (const l of i) {
|
|
582
|
+
const p = Array(l.args.length + l.deps.length);
|
|
583
|
+
l.args.forEach((v, S) => p[S] = v), l.deps.forEach((v, S) => p[S + l.args.length] = v), await t.declare(p.map((v) => ({ name: v.name, version: v.localVersion }))), p.forEach((v) => {
|
|
584
|
+
v.localVersion != null && (v.localVersionSent = !0);
|
|
585
|
+
}), l.isDeclared = !0;
|
|
1196
586
|
}
|
|
1197
587
|
}
|
|
1198
|
-
if (
|
|
1199
|
-
const
|
|
1200
|
-
if (
|
|
1201
|
-
for (const
|
|
1202
|
-
await
|
|
1203
|
-
|
|
588
|
+
if (t.isReady && A && g.every((i) => i.isDeclared)) {
|
|
589
|
+
const i = Object.values(r).filter((l) => !l.localVersionSent && l.localVersion != null);
|
|
590
|
+
if (i.length > 0)
|
|
591
|
+
for (const l of i)
|
|
592
|
+
await t.declare([{ name: l.name, version: l.localVersion }]), l.localVersionSent = !0;
|
|
593
|
+
F || (F = !0, await t.done());
|
|
1204
594
|
}
|
|
1205
|
-
if (
|
|
1206
|
-
const
|
|
1207
|
-
if (
|
|
1208
|
-
for (const
|
|
1209
|
-
const
|
|
1210
|
-
for (let
|
|
1211
|
-
const
|
|
1212
|
-
await
|
|
595
|
+
if (t.isReady) {
|
|
596
|
+
const i = g.filter((l) => !l.isDone && l.isReady);
|
|
597
|
+
if (i.length > 0)
|
|
598
|
+
for (const l of i) {
|
|
599
|
+
const p = l.invoke();
|
|
600
|
+
for (let v = 0; v < l.args.length; v++) {
|
|
601
|
+
const S = l.args[v];
|
|
602
|
+
await t.provide(S.name, S.localVersion, p[v]), S.localInterfaceSent = !0;
|
|
1213
603
|
}
|
|
1214
604
|
}
|
|
1215
605
|
}
|
|
1216
|
-
if (
|
|
1217
|
-
const
|
|
1218
|
-
for (const
|
|
1219
|
-
const
|
|
1220
|
-
|
|
606
|
+
if (f != null) {
|
|
607
|
+
const i = Array(f + 1).fill(null);
|
|
608
|
+
for (const l in r) {
|
|
609
|
+
const p = r[l];
|
|
610
|
+
p.depGroup != null && (p.isActivable ? i[p.depGroup] == null && !p.isActivated && (i[p.depGroup] = !0) : i[p.depGroup] = !1);
|
|
1221
611
|
}
|
|
1222
|
-
if (
|
|
1223
|
-
for (const
|
|
1224
|
-
const
|
|
1225
|
-
|
|
612
|
+
if (i.some((l) => l === !0))
|
|
613
|
+
for (const l in r) {
|
|
614
|
+
const p = r[l];
|
|
615
|
+
p.depGroup != null && i[p.depGroup] && p.activate();
|
|
1226
616
|
}
|
|
1227
617
|
}
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
const
|
|
1232
|
-
for (const
|
|
1233
|
-
!
|
|
1234
|
-
|
|
618
|
+
if (t.isReady) {
|
|
619
|
+
const i = c;
|
|
620
|
+
c = [];
|
|
621
|
+
const l = [];
|
|
622
|
+
for (const p of i)
|
|
623
|
+
!p.isDone && p.isReady ? p.invoke() : l.push(p);
|
|
624
|
+
l.push(...c), c = l;
|
|
1235
625
|
}
|
|
1236
626
|
}
|
|
1237
|
-
|
|
627
|
+
C = !1;
|
|
1238
628
|
}
|
|
1239
629
|
}
|
|
1240
630
|
return {
|
|
1241
|
-
get(
|
|
1242
|
-
return u(
|
|
631
|
+
get(i) {
|
|
632
|
+
return u(i);
|
|
1243
633
|
},
|
|
1244
|
-
declareFactory: (
|
|
1245
|
-
if (
|
|
1246
|
-
const
|
|
634
|
+
declareFactory: (i, l, p, v) => {
|
|
635
|
+
if (A) throw new Error(e("Cannot declare a factory after done has been set to true."));
|
|
636
|
+
const S = m(i.map((b) => b.name));
|
|
1247
637
|
{
|
|
1248
|
-
const
|
|
1249
|
-
if (
|
|
1250
|
-
throw new Error(
|
|
638
|
+
const b = S.filter((N) => N.localVersion != null);
|
|
639
|
+
if (b.length > 0)
|
|
640
|
+
throw new Error(e("Cannot declare a factory for already implemented contracts : " + b.map((N) => N.name).join(", ")));
|
|
1251
641
|
}
|
|
1252
|
-
for (let
|
|
1253
|
-
|
|
1254
|
-
const
|
|
1255
|
-
S
|
|
1256
|
-
const
|
|
1257
|
-
|
|
642
|
+
for (let b = 0; b < i.length; b++)
|
|
643
|
+
S[b].localVersion = i[b].version;
|
|
644
|
+
const x = m(l);
|
|
645
|
+
y(S, x);
|
|
646
|
+
const ft = o(S, x, p, v);
|
|
647
|
+
g.push(ft), k();
|
|
1258
648
|
},
|
|
1259
|
-
declareCallback(
|
|
1260
|
-
const
|
|
1261
|
-
!
|
|
649
|
+
declareCallback(i, l, p, v) {
|
|
650
|
+
const S = m(i), x = n(S, l, p, v);
|
|
651
|
+
!C && c.length === 0 && x.isReady ? x.invoke() : (c.push(x), k());
|
|
1262
652
|
},
|
|
1263
653
|
get done() {
|
|
1264
|
-
return
|
|
654
|
+
return A;
|
|
1265
655
|
},
|
|
1266
|
-
set done(
|
|
1267
|
-
if (
|
|
1268
|
-
if (!
|
|
656
|
+
set done(i) {
|
|
657
|
+
if (A) {
|
|
658
|
+
if (!i) throw new Error(e("Cannot set done to false after it has been set to true."));
|
|
1269
659
|
} else
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
}),
|
|
660
|
+
i && (A = !0, Object.values(r).forEach((l) => {
|
|
661
|
+
l.localVersion == null && (l.localVersion = 0);
|
|
662
|
+
}), k());
|
|
1273
663
|
}
|
|
1274
664
|
};
|
|
1275
665
|
}
|
|
1276
|
-
const
|
|
1277
|
-
function
|
|
1278
|
-
const [
|
|
1279
|
-
if (
|
|
1280
|
-
const
|
|
1281
|
-
return isNaN(
|
|
666
|
+
const Pt = /^\d+$/;
|
|
667
|
+
function Mt(t) {
|
|
668
|
+
const [e, n, s] = t.split(":", 3);
|
|
669
|
+
if (n == null || s != null || !Pt.test(n)) return null;
|
|
670
|
+
const o = parseInt(n);
|
|
671
|
+
return isNaN(o) || o === 0 ? null : { name: e, version: o };
|
|
1282
672
|
}
|
|
1283
|
-
function
|
|
1284
|
-
const
|
|
1285
|
-
function
|
|
1286
|
-
return
|
|
673
|
+
function Gt(t) {
|
|
674
|
+
const e = Dt(t);
|
|
675
|
+
function n(s) {
|
|
676
|
+
return lt(t.name, s);
|
|
1287
677
|
}
|
|
1288
678
|
return {
|
|
1289
|
-
plug(s,
|
|
1290
|
-
if (
|
|
1291
|
-
|
|
1292
|
-
let
|
|
1293
|
-
Array.isArray(s) || (s = [s],
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
throw new Error(
|
|
1298
|
-
return
|
|
679
|
+
plug(s, o, r = void 0) {
|
|
680
|
+
if (e.done) throw new Error(n("Cannot plug after plugsDone."));
|
|
681
|
+
r == null && (r = o, o = []);
|
|
682
|
+
let g = !0;
|
|
683
|
+
Array.isArray(s) || (s = [s], g = !1);
|
|
684
|
+
const c = s.map((f) => {
|
|
685
|
+
const d = Mt(f);
|
|
686
|
+
if (d == null)
|
|
687
|
+
throw new Error(n("Invalid contract id : " + f));
|
|
688
|
+
return d;
|
|
1299
689
|
});
|
|
1300
|
-
|
|
690
|
+
e.declareFactory(c, o, r, g);
|
|
1301
691
|
},
|
|
1302
692
|
plugsDone() {
|
|
1303
|
-
|
|
693
|
+
e.done = !0;
|
|
1304
694
|
},
|
|
1305
|
-
use(s,
|
|
1306
|
-
let
|
|
1307
|
-
Array.isArray(s) || (s = [s],
|
|
695
|
+
use(s, o) {
|
|
696
|
+
let r = !0;
|
|
697
|
+
Array.isArray(s) || (s = [s], r = !1), e.declareCallback(s, o, r);
|
|
1308
698
|
},
|
|
1309
|
-
exec(s,
|
|
1310
|
-
let
|
|
1311
|
-
return Array.isArray(s) || (s = [s],
|
|
1312
|
-
|
|
699
|
+
exec(s, o) {
|
|
700
|
+
let r = !0;
|
|
701
|
+
return Array.isArray(s) || (s = [s], r = !1), new Promise((...g) => {
|
|
702
|
+
e.declareCallback(s, o, r, g);
|
|
1313
703
|
});
|
|
1314
704
|
},
|
|
1315
705
|
get(s) {
|
|
1316
|
-
return s.map((
|
|
706
|
+
return s.map((o) => e.get(o).getLazyRemote());
|
|
1317
707
|
}
|
|
1318
708
|
};
|
|
1319
709
|
}
|
|
1320
|
-
const
|
|
1321
|
-
let
|
|
1322
|
-
function
|
|
1323
|
-
return
|
|
710
|
+
const ut = "app-agent";
|
|
711
|
+
let B;
|
|
712
|
+
function It(t) {
|
|
713
|
+
return B != null || (B = Gt(xt(ut, t))), B;
|
|
1324
714
|
}
|
|
1325
|
-
console.log(`[${
|
|
1326
|
-
const
|
|
1327
|
-
let
|
|
1328
|
-
const
|
|
1329
|
-
const
|
|
1330
|
-
if (!Object.is(
|
|
1331
|
-
const
|
|
1332
|
-
|
|
1333
|
-
}
|
|
1334
|
-
},
|
|
1335
|
-
return
|
|
1336
|
-
},
|
|
1337
|
-
function
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
715
|
+
console.log(`[${ut}@1.0.12] loaded`);
|
|
716
|
+
const K = (t) => {
|
|
717
|
+
let e;
|
|
718
|
+
const n = /* @__PURE__ */ new Set(), s = (d, u) => {
|
|
719
|
+
const m = typeof d == "function" ? d(e) : d;
|
|
720
|
+
if (!Object.is(m, e)) {
|
|
721
|
+
const y = e;
|
|
722
|
+
e = u ?? (typeof m != "object" || m === null) ? m : Object.assign({}, e, m), n.forEach((C) => C(e, y));
|
|
723
|
+
}
|
|
724
|
+
}, o = () => e, c = { setState: s, getState: o, getInitialState: () => f, subscribe: (d) => (n.add(d), () => n.delete(d)) }, f = e = t(s, o, c);
|
|
725
|
+
return c;
|
|
726
|
+
}, Lt = (t) => t ? K(t) : K, jt = (t) => t;
|
|
727
|
+
function $t(t, e = jt) {
|
|
728
|
+
const n = D.useSyncExternalStore(
|
|
729
|
+
t.subscribe,
|
|
730
|
+
D.useCallback(() => e(t.getState()), [t, e]),
|
|
731
|
+
D.useCallback(() => e(t.getInitialState()), [t, e])
|
|
1342
732
|
);
|
|
1343
|
-
return
|
|
733
|
+
return D.useDebugValue(n), n;
|
|
1344
734
|
}
|
|
1345
|
-
const
|
|
1346
|
-
const
|
|
1347
|
-
return Object.assign(
|
|
1348
|
-
},
|
|
1349
|
-
const
|
|
1350
|
-
return s.subscribe = (
|
|
1351
|
-
let
|
|
1352
|
-
if (
|
|
1353
|
-
const u =
|
|
1354
|
-
let
|
|
1355
|
-
|
|
1356
|
-
const
|
|
1357
|
-
if (!u(
|
|
1358
|
-
const
|
|
1359
|
-
|
|
735
|
+
const X = (t) => {
|
|
736
|
+
const e = Lt(t), n = (s) => $t(e, s);
|
|
737
|
+
return Object.assign(n, e), n;
|
|
738
|
+
}, dt = (t) => t ? X(t) : X, Ot = (t) => (e, n, s) => {
|
|
739
|
+
const o = s.subscribe;
|
|
740
|
+
return s.subscribe = (g, c, f) => {
|
|
741
|
+
let d = g;
|
|
742
|
+
if (c) {
|
|
743
|
+
const u = f?.equalityFn || Object.is;
|
|
744
|
+
let m = g(s.getState());
|
|
745
|
+
d = (y) => {
|
|
746
|
+
const C = g(y);
|
|
747
|
+
if (!u(m, C)) {
|
|
748
|
+
const E = m;
|
|
749
|
+
c(m = C, E);
|
|
1360
750
|
}
|
|
1361
|
-
},
|
|
751
|
+
}, f?.fireImmediately && c(m, m);
|
|
1362
752
|
}
|
|
1363
|
-
return
|
|
1364
|
-
}, e
|
|
1365
|
-
},
|
|
1366
|
-
|
|
753
|
+
return o(d);
|
|
754
|
+
}, t(e, n, s);
|
|
755
|
+
}, Nt = Ot, a = dt()(
|
|
756
|
+
Nt((t) => ({
|
|
1367
757
|
ready: !1,
|
|
1368
758
|
workflow: "current",
|
|
1369
759
|
mode: "assignment",
|
|
@@ -1398,41 +788,41 @@ const st = (e) => {
|
|
|
1398
788
|
sidebarActions: {},
|
|
1399
789
|
quickActions: {},
|
|
1400
790
|
activitySettingsCallback: null,
|
|
1401
|
-
setGetTextContentFunction: (
|
|
1402
|
-
|
|
791
|
+
setGetTextContentFunction: (e) => {
|
|
792
|
+
t({ getTextContentFunction: e });
|
|
1403
793
|
},
|
|
1404
|
-
setGetJsonContentFunction: (
|
|
1405
|
-
|
|
794
|
+
setGetJsonContentFunction: (e) => {
|
|
795
|
+
t({ getJsonContentFunction: e });
|
|
1406
796
|
},
|
|
1407
|
-
setGetJsonActivityContentFunction: (
|
|
1408
|
-
|
|
797
|
+
setGetJsonActivityContentFunction: (e) => {
|
|
798
|
+
t({ getJsonActivityContentFunction: e });
|
|
1409
799
|
},
|
|
1410
|
-
setGetJsonAssignmentContentFunction: (
|
|
1411
|
-
|
|
800
|
+
setGetJsonAssignmentContentFunction: (e) => {
|
|
801
|
+
t({ getJsonAssignmentContentFunction: e });
|
|
1412
802
|
},
|
|
1413
|
-
setGetJsonActivitySplitContentFunction: (
|
|
1414
|
-
|
|
803
|
+
setGetJsonActivitySplitContentFunction: (e) => {
|
|
804
|
+
t({ getJsonActivitySplitContentFunction: e });
|
|
1415
805
|
},
|
|
1416
|
-
setGetJsonAssignmentSplitContentFunction: (
|
|
1417
|
-
|
|
806
|
+
setGetJsonAssignmentSplitContentFunction: (e) => {
|
|
807
|
+
t({ getJsonAssignmentSplitContentFunction: e });
|
|
1418
808
|
},
|
|
1419
|
-
setSidebarActions: (
|
|
1420
|
-
|
|
809
|
+
setSidebarActions: (e) => {
|
|
810
|
+
t({ sidebarActions: e });
|
|
1421
811
|
},
|
|
1422
|
-
setQuickActions: (
|
|
1423
|
-
|
|
812
|
+
setQuickActions: (e) => {
|
|
813
|
+
t({ quickActions: e });
|
|
1424
814
|
},
|
|
1425
|
-
setActivitySettingsCallback: (
|
|
1426
|
-
|
|
815
|
+
setActivitySettingsCallback: (e) => {
|
|
816
|
+
t({ activitySettingsCallback: e });
|
|
1427
817
|
},
|
|
1428
|
-
incSaveCount: () =>
|
|
1429
|
-
saveCount:
|
|
818
|
+
incSaveCount: () => t((e) => ({
|
|
819
|
+
saveCount: e.saveCount + 1
|
|
1430
820
|
})),
|
|
1431
|
-
incDirtyCount: () =>
|
|
821
|
+
incDirtyCount: () => t((e) => ({ isDirtyCount: e.isDirtyCount + 1 }))
|
|
1432
822
|
}))
|
|
1433
823
|
);
|
|
1434
|
-
let
|
|
1435
|
-
const
|
|
824
|
+
let Z = !1;
|
|
825
|
+
const qt = [
|
|
1436
826
|
"meta-player-events:1",
|
|
1437
827
|
"meta-player-ui:1",
|
|
1438
828
|
"mode:1",
|
|
@@ -1446,77 +836,77 @@ const Rn = [
|
|
|
1446
836
|
"simple-content-eval(json):1",
|
|
1447
837
|
"separate-contents(json):1",
|
|
1448
838
|
"separate-dual-contents(json):1"
|
|
1449
|
-
],
|
|
839
|
+
], tt = {
|
|
1450
840
|
"mode:1": {
|
|
1451
|
-
setMode: (
|
|
1452
|
-
|
|
841
|
+
setMode: (t) => {
|
|
842
|
+
a.setState({ mode: t });
|
|
1453
843
|
}
|
|
1454
844
|
},
|
|
1455
845
|
"reload:1": {
|
|
1456
|
-
reloaded: (
|
|
1457
|
-
console.log("Reloaded with state:",
|
|
846
|
+
reloaded: (t) => {
|
|
847
|
+
console.log("Reloaded with state:", t), console.error("Not implemented yet");
|
|
1458
848
|
}
|
|
1459
849
|
},
|
|
1460
850
|
"theme:1": {
|
|
1461
|
-
setTheme: (
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
851
|
+
setTheme: (t) => {
|
|
852
|
+
if (t === null) {
|
|
853
|
+
a.setState({ theme: null });
|
|
1464
854
|
return;
|
|
1465
855
|
}
|
|
1466
|
-
if (
|
|
1467
|
-
console.warn(`Invalid theme: ${
|
|
856
|
+
if (t !== "light" && t !== "dark") {
|
|
857
|
+
console.warn(`Invalid theme: ${t}. Expected 'light' or 'dark'.`), a.setState({ theme: null });
|
|
1468
858
|
return;
|
|
1469
859
|
}
|
|
1470
|
-
|
|
860
|
+
a.setState({ theme: t });
|
|
1471
861
|
}
|
|
1472
862
|
},
|
|
1473
863
|
"workflow:1": {
|
|
1474
|
-
setWorkflow: (
|
|
1475
|
-
|
|
864
|
+
setWorkflow: (t) => {
|
|
865
|
+
a.setState({ workflow: t });
|
|
1476
866
|
}
|
|
1477
867
|
},
|
|
1478
868
|
"simple-content(text):1": {
|
|
1479
869
|
contentSaved: () => {
|
|
1480
|
-
|
|
1481
|
-
afterSaveCount:
|
|
870
|
+
a.setState((t) => ({
|
|
871
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1482
872
|
}));
|
|
1483
873
|
},
|
|
1484
|
-
getContent: () =>
|
|
1485
|
-
loadContent: (
|
|
1486
|
-
|
|
874
|
+
getContent: () => a.getState().getTextContentFunction(),
|
|
875
|
+
loadContent: (t) => {
|
|
876
|
+
a.setState({ loadedTextContent: t });
|
|
1487
877
|
}
|
|
1488
878
|
},
|
|
1489
879
|
"simple-content(json):1": {
|
|
1490
880
|
contentSaved: () => {
|
|
1491
|
-
|
|
1492
|
-
afterSaveCount:
|
|
881
|
+
a.setState((t) => ({
|
|
882
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1493
883
|
}));
|
|
1494
884
|
},
|
|
1495
|
-
getContent: () =>
|
|
1496
|
-
loadContent: (
|
|
1497
|
-
|
|
885
|
+
getContent: () => a.getState().getJsonContentFunction(),
|
|
886
|
+
loadContent: (t) => {
|
|
887
|
+
a.setState({ loadedJsonContent: t });
|
|
1498
888
|
}
|
|
1499
889
|
},
|
|
1500
890
|
"simple-binary-data(text):1": {
|
|
1501
891
|
contentSaved: () => {
|
|
1502
|
-
|
|
1503
|
-
afterSaveCount:
|
|
892
|
+
a.setState((t) => ({
|
|
893
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1504
894
|
}));
|
|
1505
895
|
},
|
|
1506
|
-
getContent: () =>
|
|
1507
|
-
loadContent: (
|
|
1508
|
-
|
|
896
|
+
getContent: () => a.getState().getTextContentFunction(),
|
|
897
|
+
loadContent: (t) => {
|
|
898
|
+
a.setState({ loadedTextContent: t });
|
|
1509
899
|
}
|
|
1510
900
|
},
|
|
1511
901
|
"simple-content-eval(text):1": {
|
|
1512
902
|
contentSaved: () => {
|
|
1513
|
-
|
|
1514
|
-
afterSaveCount:
|
|
903
|
+
a.setState((t) => ({
|
|
904
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1515
905
|
}));
|
|
1516
906
|
},
|
|
1517
|
-
getContent: () =>
|
|
1518
|
-
loadContent: (
|
|
1519
|
-
|
|
907
|
+
getContent: () => a.getState().getTextContentFunction(),
|
|
908
|
+
loadContent: (t) => {
|
|
909
|
+
a.setState({ loadedTextContent: t });
|
|
1520
910
|
},
|
|
1521
911
|
getAssignmentContent: () => {
|
|
1522
912
|
throw new Error(
|
|
@@ -1526,13 +916,13 @@ const Rn = [
|
|
|
1526
916
|
},
|
|
1527
917
|
"simple-content-eval(json):1": {
|
|
1528
918
|
contentSaved: () => {
|
|
1529
|
-
|
|
1530
|
-
afterSaveCount:
|
|
919
|
+
a.setState((t) => ({
|
|
920
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1531
921
|
}));
|
|
1532
922
|
},
|
|
1533
|
-
getContent: () =>
|
|
1534
|
-
loadContent: (
|
|
1535
|
-
|
|
923
|
+
getContent: () => a.getState().getJsonContentFunction(),
|
|
924
|
+
loadContent: (t) => {
|
|
925
|
+
a.setState({ loadedJsonContent: t });
|
|
1536
926
|
},
|
|
1537
927
|
getAssignmentContent: () => {
|
|
1538
928
|
throw new Error(
|
|
@@ -1542,13 +932,13 @@ const Rn = [
|
|
|
1542
932
|
},
|
|
1543
933
|
"simple-content-eval(json):2": {
|
|
1544
934
|
contentSaved: () => {
|
|
1545
|
-
|
|
1546
|
-
afterSaveCount:
|
|
935
|
+
a.setState((t) => ({
|
|
936
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1547
937
|
}));
|
|
1548
938
|
},
|
|
1549
|
-
getContent: () =>
|
|
1550
|
-
loadContent: (
|
|
1551
|
-
|
|
939
|
+
getContent: () => a.getState().getJsonContentFunction(),
|
|
940
|
+
loadContent: (t) => {
|
|
941
|
+
a.setState({ loadedJsonContent: t });
|
|
1552
942
|
},
|
|
1553
943
|
getAssignmentContent: () => {
|
|
1554
944
|
throw new Error(
|
|
@@ -1558,13 +948,13 @@ const Rn = [
|
|
|
1558
948
|
},
|
|
1559
949
|
"simple-content-eval(text):2": {
|
|
1560
950
|
contentSaved: () => {
|
|
1561
|
-
|
|
1562
|
-
afterSaveCount:
|
|
951
|
+
a.setState((t) => ({
|
|
952
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1563
953
|
}));
|
|
1564
954
|
},
|
|
1565
|
-
getContent: () =>
|
|
1566
|
-
loadContent: (
|
|
1567
|
-
|
|
955
|
+
getContent: () => a.getState().getTextContentFunction(),
|
|
956
|
+
loadContent: (t) => {
|
|
957
|
+
a.setState({ loadedTextContent: t });
|
|
1568
958
|
},
|
|
1569
959
|
getAssignmentContent: () => {
|
|
1570
960
|
throw new Error(
|
|
@@ -1574,40 +964,40 @@ const Rn = [
|
|
|
1574
964
|
},
|
|
1575
965
|
"separate-contents(json):1": {
|
|
1576
966
|
contentSaved: () => {
|
|
1577
|
-
|
|
1578
|
-
afterSaveCount:
|
|
967
|
+
a.setState((t) => ({
|
|
968
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1579
969
|
}));
|
|
1580
970
|
},
|
|
1581
|
-
loadContent: (
|
|
1582
|
-
|
|
1583
|
-
loadedJsonActivityContent:
|
|
1584
|
-
loadedJsonAssignmentContent:
|
|
971
|
+
loadContent: (t, e) => {
|
|
972
|
+
a.setState({
|
|
973
|
+
loadedJsonActivityContent: t,
|
|
974
|
+
loadedJsonAssignmentContent: e
|
|
1585
975
|
});
|
|
1586
976
|
},
|
|
1587
|
-
getActivityContent: () =>
|
|
1588
|
-
getAssignmentContent: () =>
|
|
977
|
+
getActivityContent: () => a.getState().getJsonActivityContentFunction(),
|
|
978
|
+
getAssignmentContent: () => a.getState().getJsonAssignmentContentFunction()
|
|
1589
979
|
},
|
|
1590
980
|
"separate-dual-contents(json):1": {
|
|
1591
981
|
contentSaved: () => {
|
|
1592
|
-
|
|
1593
|
-
afterSaveCount:
|
|
982
|
+
a.setState((t) => ({
|
|
983
|
+
afterSaveCount: t.afterSaveCount + 1
|
|
1594
984
|
}));
|
|
1595
985
|
},
|
|
1596
986
|
loadContent: ({
|
|
1597
|
-
activityContent:
|
|
1598
|
-
assignmentContent:
|
|
1599
|
-
activityBinaryData:
|
|
987
|
+
activityContent: t,
|
|
988
|
+
assignmentContent: e,
|
|
989
|
+
activityBinaryData: n,
|
|
1600
990
|
assignmentBinaryData: s
|
|
1601
991
|
}) => {
|
|
1602
|
-
|
|
1603
|
-
loadedJsonActivityContent:
|
|
1604
|
-
loadedJsonAssignmentContent:
|
|
1605
|
-
loadedJsonActivityBinaryData:
|
|
992
|
+
a.setState({
|
|
993
|
+
loadedJsonActivityContent: t,
|
|
994
|
+
loadedJsonAssignmentContent: e,
|
|
995
|
+
loadedJsonActivityBinaryData: n,
|
|
1606
996
|
loadedJsonAssignmentBinaryData: s
|
|
1607
997
|
});
|
|
1608
998
|
},
|
|
1609
|
-
getActivityContentAndData: () =>
|
|
1610
|
-
getAssignmentContentAndData: () =>
|
|
999
|
+
getActivityContentAndData: () => a.getState().getJsonActivitySplitContentFunction(),
|
|
1000
|
+
getAssignmentContentAndData: () => a.getState().getJsonAssignmentSplitContentFunction()
|
|
1611
1001
|
},
|
|
1612
1002
|
"meta-player-anti-cheat:1": {
|
|
1613
1003
|
lock: () => {
|
|
@@ -1616,62 +1006,62 @@ const Rn = [
|
|
|
1616
1006
|
}
|
|
1617
1007
|
},
|
|
1618
1008
|
"meta-player-ui:1": {
|
|
1619
|
-
executeAction(
|
|
1620
|
-
if (
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1009
|
+
executeAction(t) {
|
|
1010
|
+
if (t.startsWith("qa")) {
|
|
1011
|
+
const n = a.getState().quickActions[t];
|
|
1012
|
+
n ? n() : console.error(`Quick action not found: ${t}`);
|
|
1623
1013
|
} else {
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1014
|
+
const n = a.getState().sidebarActions[t];
|
|
1015
|
+
n ? n() : console.error(`Sidebar action not found: ${t}`);
|
|
1626
1016
|
}
|
|
1627
1017
|
},
|
|
1628
|
-
executeFileUpload(
|
|
1629
|
-
if (
|
|
1630
|
-
const s =
|
|
1631
|
-
s ? s(
|
|
1018
|
+
executeFileUpload(t, e) {
|
|
1019
|
+
if (t.startsWith("qa")) {
|
|
1020
|
+
const s = a.getState().quickActions[t];
|
|
1021
|
+
s ? s(e) : console.error(`Quick action not found: ${t}`);
|
|
1632
1022
|
} else {
|
|
1633
|
-
const s =
|
|
1634
|
-
s ? s(
|
|
1023
|
+
const s = a.getState().sidebarActions[t];
|
|
1024
|
+
s ? s(e) : console.error(`Sidebar action not found: ${t}`);
|
|
1635
1025
|
}
|
|
1636
1026
|
},
|
|
1637
|
-
updateSettings(
|
|
1638
|
-
const
|
|
1639
|
-
|
|
1027
|
+
updateSettings(t) {
|
|
1028
|
+
const e = a.getState().activitySettingsCallback;
|
|
1029
|
+
e ? e(t) : console.warn(
|
|
1640
1030
|
"activitySettingsCallback is not set. Changes:",
|
|
1641
|
-
|
|
1031
|
+
t
|
|
1642
1032
|
);
|
|
1643
1033
|
}
|
|
1644
1034
|
},
|
|
1645
1035
|
"meta-player-events:1": {
|
|
1646
|
-
handleEvent(
|
|
1647
|
-
|
|
1036
|
+
handleEvent(t) {
|
|
1037
|
+
t === "all-loaded" && a.setState({ ready: !0 });
|
|
1648
1038
|
}
|
|
1649
1039
|
}
|
|
1650
|
-
},
|
|
1651
|
-
function
|
|
1652
|
-
if (
|
|
1040
|
+
}, h = It();
|
|
1041
|
+
function Bt(t) {
|
|
1042
|
+
if (Z) {
|
|
1653
1043
|
console.warn("Contracts have already been plugged. Skipping.");
|
|
1654
1044
|
return;
|
|
1655
1045
|
}
|
|
1656
|
-
|
|
1657
|
-
for (const
|
|
1658
|
-
if (!
|
|
1046
|
+
Z = !0;
|
|
1047
|
+
for (const e of t) {
|
|
1048
|
+
if (!qt.includes(e)) {
|
|
1659
1049
|
console.warn(
|
|
1660
|
-
`Contract ${
|
|
1050
|
+
`Contract ${e} is not implemented in Capytale. Skipping plug.`
|
|
1661
1051
|
);
|
|
1662
1052
|
continue;
|
|
1663
1053
|
}
|
|
1664
|
-
if (!(
|
|
1054
|
+
if (!(e in tt)) {
|
|
1665
1055
|
console.warn(
|
|
1666
|
-
`Contract handler for ${
|
|
1056
|
+
`Contract handler for ${e} is not defined. Skipping plug.`
|
|
1667
1057
|
);
|
|
1668
1058
|
continue;
|
|
1669
1059
|
}
|
|
1670
|
-
const
|
|
1671
|
-
|
|
1060
|
+
const n = tt[e];
|
|
1061
|
+
h.plug([e], ([]) => [n]);
|
|
1672
1062
|
}
|
|
1673
|
-
|
|
1674
|
-
for (const
|
|
1063
|
+
h.plugsDone();
|
|
1064
|
+
for (const e of [
|
|
1675
1065
|
"simple-content(text):1",
|
|
1676
1066
|
"simple-content(json):1",
|
|
1677
1067
|
"simple-binary-data(text):1",
|
|
@@ -1680,329 +1070,329 @@ function kn(e) {
|
|
|
1680
1070
|
"simple-content-eval(json):2",
|
|
1681
1071
|
"simple-content-eval(text):2"
|
|
1682
1072
|
])
|
|
1683
|
-
if (console.log(`Contract ${
|
|
1684
|
-
console.log(`Subscribing to content changes for contract ${
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
(
|
|
1073
|
+
if (console.log(`Contract ${e} is being subscribed to content changes.`), t.includes(e)) {
|
|
1074
|
+
console.log(`Subscribing to content changes for contract ${e}`);
|
|
1075
|
+
const n = e.split(":")[0];
|
|
1076
|
+
h.use([n], ([s]) => {
|
|
1077
|
+
a.subscribe(
|
|
1078
|
+
(o) => o.isDirtyCount,
|
|
1689
1079
|
() => {
|
|
1690
1080
|
s.i?.contentChanged(), console.log(
|
|
1691
|
-
`Content changed for contract ${
|
|
1081
|
+
`Content changed for contract ${n}`
|
|
1692
1082
|
);
|
|
1693
1083
|
}
|
|
1694
1084
|
);
|
|
1695
1085
|
});
|
|
1696
1086
|
}
|
|
1697
1087
|
}
|
|
1698
|
-
const
|
|
1699
|
-
if (
|
|
1088
|
+
const ee = () => a((t) => {
|
|
1089
|
+
if (t.mode === null)
|
|
1700
1090
|
throw new Error("Mode is not set. Have you used contract 'mode'?");
|
|
1701
|
-
return
|
|
1702
|
-
}),
|
|
1703
|
-
if (
|
|
1091
|
+
return t.mode;
|
|
1092
|
+
}), ne = () => a((t) => {
|
|
1093
|
+
if (t.workflow === null)
|
|
1704
1094
|
throw new Error(
|
|
1705
1095
|
"Workflow is not set. Have you used contract 'workflow'?"
|
|
1706
1096
|
);
|
|
1707
|
-
return
|
|
1708
|
-
}),
|
|
1709
|
-
if (
|
|
1097
|
+
return t.workflow;
|
|
1098
|
+
}), oe = () => a((t) => {
|
|
1099
|
+
if (t.theme === null)
|
|
1710
1100
|
throw new Error("Theme is not set. Have you used contract 'theme'?");
|
|
1711
|
-
return
|
|
1712
|
-
}),
|
|
1101
|
+
return t.theme;
|
|
1102
|
+
}), re = () => a((t) => t.incSaveCount), se = () => a((t) => t.incDirtyCount), ie = () => a((t) => t.loadedTextContent), ae = () => a((t) => t.loadedJsonContent), ce = () => a((t) => t.loadedJsonActivityContent), le = () => a((t) => t.loadedJsonAssignmentContent), ue = () => a((t) => t.loadedJsonActivityBinaryData), de = () => a((t) => t.loadedJsonAssignmentBinaryData), fe = () => T(() => a.getState().loadedTextContent, []), ge = () => T(() => a.getState().loadedJsonContent, []), me = () => T(() => a.getState().loadedJsonActivityContent, []), pe = () => T(() => a.getState().loadedJsonAssignmentContent, []), ye = () => T(
|
|
1713
1103
|
() => ({
|
|
1714
|
-
content:
|
|
1715
|
-
binaryData:
|
|
1104
|
+
content: a.getState().loadedJsonActivityContent,
|
|
1105
|
+
binaryData: a.getState().loadedJsonActivityBinaryData
|
|
1716
1106
|
}),
|
|
1717
1107
|
[]
|
|
1718
|
-
),
|
|
1108
|
+
), ve = () => T(
|
|
1719
1109
|
() => ({
|
|
1720
|
-
content:
|
|
1721
|
-
binaryData:
|
|
1110
|
+
content: a.getState().loadedJsonAssignmentContent,
|
|
1111
|
+
binaryData: a.getState().loadedJsonAssignmentBinaryData
|
|
1722
1112
|
}),
|
|
1723
1113
|
[]
|
|
1724
|
-
),
|
|
1725
|
-
const
|
|
1726
|
-
(
|
|
1114
|
+
), Ce = (t) => {
|
|
1115
|
+
const e = a(
|
|
1116
|
+
(n) => n.setGetTextContentFunction
|
|
1727
1117
|
);
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
}, [
|
|
1731
|
-
},
|
|
1732
|
-
const
|
|
1733
|
-
(
|
|
1118
|
+
w(() => {
|
|
1119
|
+
e(t);
|
|
1120
|
+
}, [t, e]);
|
|
1121
|
+
}, Se = (t) => {
|
|
1122
|
+
const e = a(
|
|
1123
|
+
(n) => n.setGetJsonContentFunction
|
|
1734
1124
|
);
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
}, [
|
|
1738
|
-
},
|
|
1739
|
-
const
|
|
1740
|
-
(
|
|
1125
|
+
w(() => {
|
|
1126
|
+
e(t);
|
|
1127
|
+
}, [t, e]);
|
|
1128
|
+
}, we = (t) => {
|
|
1129
|
+
const e = a(
|
|
1130
|
+
(n) => n.setGetJsonActivityContentFunction
|
|
1741
1131
|
);
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
}, [
|
|
1745
|
-
},
|
|
1746
|
-
const
|
|
1747
|
-
(
|
|
1132
|
+
w(() => {
|
|
1133
|
+
e(t);
|
|
1134
|
+
}, [t, e]);
|
|
1135
|
+
}, he = (t) => {
|
|
1136
|
+
const e = a(
|
|
1137
|
+
(n) => n.setGetJsonAssignmentContentFunction
|
|
1748
1138
|
);
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
}, [
|
|
1752
|
-
},
|
|
1753
|
-
const
|
|
1754
|
-
(
|
|
1139
|
+
w(() => {
|
|
1140
|
+
e(t);
|
|
1141
|
+
}, [t, e]);
|
|
1142
|
+
}, Ae = (t) => {
|
|
1143
|
+
const e = a(
|
|
1144
|
+
(n) => n.setGetJsonActivitySplitContentFunction
|
|
1755
1145
|
);
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
}, [
|
|
1759
|
-
},
|
|
1760
|
-
const
|
|
1761
|
-
(
|
|
1146
|
+
w(() => {
|
|
1147
|
+
e(t);
|
|
1148
|
+
}, [t, e]);
|
|
1149
|
+
}, be = (t) => {
|
|
1150
|
+
const e = a(
|
|
1151
|
+
(n) => n.setGetJsonAssignmentSplitContentFunction
|
|
1762
1152
|
);
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}, [
|
|
1766
|
-
},
|
|
1767
|
-
const
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
}, [
|
|
1771
|
-
},
|
|
1772
|
-
|
|
1773
|
-
if (
|
|
1153
|
+
w(() => {
|
|
1154
|
+
e(t);
|
|
1155
|
+
}, [t, e]);
|
|
1156
|
+
}, Ee = (t) => {
|
|
1157
|
+
const e = a((n) => n.afterSaveCount);
|
|
1158
|
+
w(() => {
|
|
1159
|
+
e > 0 && t();
|
|
1160
|
+
}, [e]);
|
|
1161
|
+
}, ke = () => (t, e) => {
|
|
1162
|
+
h.use(["meta-player-ui"], ([n]) => {
|
|
1163
|
+
if (n.version === 0) {
|
|
1774
1164
|
console.error(
|
|
1775
1165
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1776
1166
|
);
|
|
1777
1167
|
return;
|
|
1778
1168
|
}
|
|
1779
|
-
|
|
1169
|
+
n.i?.previewTextFile(t, e);
|
|
1780
1170
|
});
|
|
1781
|
-
},
|
|
1782
|
-
|
|
1783
|
-
if (
|
|
1171
|
+
}, Je = () => (t, e) => {
|
|
1172
|
+
h.use(["meta-player-ui"], ([n]) => {
|
|
1173
|
+
if (n.version === 0) {
|
|
1784
1174
|
console.error(
|
|
1785
1175
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1786
1176
|
);
|
|
1787
1177
|
return;
|
|
1788
1178
|
}
|
|
1789
|
-
|
|
1179
|
+
n.i?.previewImageFile(t, e);
|
|
1790
1180
|
});
|
|
1791
1181
|
};
|
|
1792
|
-
let
|
|
1793
|
-
const
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1182
|
+
let M = 0, W = 0;
|
|
1183
|
+
const Fe = (t, e) => {
|
|
1184
|
+
const n = U(t, e), s = a((o) => o.setSidebarActions);
|
|
1185
|
+
w(() => (M++, M > 1 && console.error(
|
|
1796
1186
|
"Capytale iframe React: Multiple sidebar actions registered: ",
|
|
1797
|
-
|
|
1187
|
+
M
|
|
1798
1188
|
), () => {
|
|
1799
|
-
|
|
1800
|
-
}), []),
|
|
1801
|
-
if (
|
|
1189
|
+
M--;
|
|
1190
|
+
}), []), w(() => (h.use(["meta-player-ui"], ([o]) => {
|
|
1191
|
+
if (o.version === 0) {
|
|
1802
1192
|
console.error(
|
|
1803
1193
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1804
1194
|
);
|
|
1805
1195
|
return;
|
|
1806
1196
|
}
|
|
1807
|
-
|
|
1808
|
-
const
|
|
1809
|
-
type:
|
|
1810
|
-
title:
|
|
1811
|
-
icon:
|
|
1812
|
-
id: `sa-${
|
|
1813
|
-
...
|
|
1814
|
-
})),
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
}),
|
|
1197
|
+
W++;
|
|
1198
|
+
const r = n.map((c, f) => ({
|
|
1199
|
+
type: c.type,
|
|
1200
|
+
title: c.title,
|
|
1201
|
+
icon: c.icon,
|
|
1202
|
+
id: `sa-${W}-${f}`,
|
|
1203
|
+
...c.type === "file-upload" ? { accept: c.accept } : {}
|
|
1204
|
+
})), g = {};
|
|
1205
|
+
n.forEach((c, f) => {
|
|
1206
|
+
g[`sa-${W}-${f}`] = c.action;
|
|
1207
|
+
}), o.i?.setSidebarActionButtons(r), s(g);
|
|
1818
1208
|
}), () => {
|
|
1819
|
-
s({}),
|
|
1820
|
-
if (
|
|
1209
|
+
s({}), h.use(["meta-player-ui"], ([o]) => {
|
|
1210
|
+
if (o.version === 0) {
|
|
1821
1211
|
console.error(
|
|
1822
1212
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1823
1213
|
);
|
|
1824
1214
|
return;
|
|
1825
1215
|
}
|
|
1826
|
-
|
|
1216
|
+
o.i?.setSidebarActionButtons([]);
|
|
1827
1217
|
});
|
|
1828
|
-
}), [
|
|
1218
|
+
}), [n]);
|
|
1829
1219
|
};
|
|
1830
|
-
let
|
|
1831
|
-
const
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1220
|
+
let G = 0, H = 0;
|
|
1221
|
+
const xe = (t, e) => {
|
|
1222
|
+
const n = U(t, e), s = a((o) => o.setQuickActions);
|
|
1223
|
+
w(() => (G++, G > 1 && console.error(
|
|
1834
1224
|
"Capytale iframe React: Multiple quick actions registered: ",
|
|
1835
|
-
|
|
1225
|
+
G
|
|
1836
1226
|
), () => {
|
|
1837
|
-
|
|
1838
|
-
}), []),
|
|
1839
|
-
if (
|
|
1227
|
+
G--;
|
|
1228
|
+
}), []), w(() => (h.use(["meta-player-ui"], ([o]) => {
|
|
1229
|
+
if (o.version === 0) {
|
|
1840
1230
|
console.error(
|
|
1841
1231
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1842
1232
|
);
|
|
1843
1233
|
return;
|
|
1844
1234
|
}
|
|
1845
|
-
|
|
1846
|
-
const
|
|
1847
|
-
type:
|
|
1848
|
-
title:
|
|
1849
|
-
icon:
|
|
1850
|
-
id: `qa-${
|
|
1851
|
-
...
|
|
1852
|
-
})),
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
}),
|
|
1235
|
+
H++;
|
|
1236
|
+
const r = n.map((c, f) => ({
|
|
1237
|
+
type: c.type,
|
|
1238
|
+
title: c.title,
|
|
1239
|
+
icon: c.icon,
|
|
1240
|
+
id: `qa-${H}-${f}`,
|
|
1241
|
+
...c.type === "file-upload" ? { accept: c.accept } : {}
|
|
1242
|
+
})), g = {};
|
|
1243
|
+
n.forEach((c, f) => {
|
|
1244
|
+
g[`qa-${H}-${f}`] = c.action;
|
|
1245
|
+
}), o.i?.setQuickActionButtons(r), s(g);
|
|
1856
1246
|
}), () => {
|
|
1857
|
-
s({}),
|
|
1858
|
-
if (
|
|
1247
|
+
s({}), h.use(["meta-player-ui"], ([o]) => {
|
|
1248
|
+
if (o.version === 0) {
|
|
1859
1249
|
console.error(
|
|
1860
1250
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1861
1251
|
);
|
|
1862
1252
|
return;
|
|
1863
1253
|
}
|
|
1864
|
-
|
|
1254
|
+
o.i?.setQuickActionButtons([]);
|
|
1865
1255
|
});
|
|
1866
|
-
}), [
|
|
1256
|
+
}), [n]);
|
|
1867
1257
|
};
|
|
1868
|
-
let
|
|
1869
|
-
const
|
|
1870
|
-
const s =
|
|
1871
|
-
(
|
|
1258
|
+
let I = 0;
|
|
1259
|
+
const Wt = (t, e, n) => {
|
|
1260
|
+
const s = U(t, n), o = a(
|
|
1261
|
+
(r) => r.setActivitySettingsCallback
|
|
1872
1262
|
);
|
|
1873
|
-
|
|
1263
|
+
w(() => (console.log("Mounting useSettings"), I++, I > 1 && console.error(
|
|
1874
1264
|
"Capytale iframe React: Multiple settings registered: ",
|
|
1875
|
-
|
|
1265
|
+
I
|
|
1876
1266
|
), () => {
|
|
1877
|
-
console.log("Unmounting useSettings"),
|
|
1878
|
-
}), []),
|
|
1879
|
-
if (
|
|
1267
|
+
console.log("Unmounting useSettings"), I--;
|
|
1268
|
+
}), []), w(() => (h.use(["meta-player-ui"], ([r]) => {
|
|
1269
|
+
if (r.version === 0) {
|
|
1880
1270
|
console.error(
|
|
1881
1271
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1882
1272
|
);
|
|
1883
1273
|
return;
|
|
1884
1274
|
}
|
|
1885
|
-
console.log("Updating settings UI in MetaPlayer", s),
|
|
1886
|
-
}),
|
|
1887
|
-
|
|
1275
|
+
console.log("Updating settings UI in MetaPlayer", s), r.i?.setSettingsUI(s);
|
|
1276
|
+
}), o(
|
|
1277
|
+
e
|
|
1888
1278
|
), () => {
|
|
1889
|
-
|
|
1279
|
+
o(null);
|
|
1890
1280
|
}), [s]);
|
|
1891
|
-
},
|
|
1892
|
-
|
|
1893
|
-
if (
|
|
1281
|
+
}, Re = () => (e) => {
|
|
1282
|
+
h.use(["meta-player-ui"], ([n]) => {
|
|
1283
|
+
if (n.version === 0) {
|
|
1894
1284
|
console.error(
|
|
1895
1285
|
"Le MétaPlayer ne supporte pas le contrat meta-player-ui"
|
|
1896
1286
|
);
|
|
1897
1287
|
return;
|
|
1898
1288
|
}
|
|
1899
|
-
|
|
1289
|
+
n.i?.showToast(e);
|
|
1900
1290
|
});
|
|
1901
1291
|
};
|
|
1902
|
-
function
|
|
1903
|
-
const
|
|
1904
|
-
for (const
|
|
1905
|
-
n
|
|
1906
|
-
return
|
|
1292
|
+
function Ht(t) {
|
|
1293
|
+
const e = {};
|
|
1294
|
+
for (const n of t.fields)
|
|
1295
|
+
e[n.name] = n.defaultValue;
|
|
1296
|
+
return e;
|
|
1907
1297
|
}
|
|
1908
|
-
function
|
|
1909
|
-
return { [
|
|
1298
|
+
function zt(t) {
|
|
1299
|
+
return { [t.name]: t.defaultValues };
|
|
1910
1300
|
}
|
|
1911
|
-
function
|
|
1912
|
-
return { [
|
|
1301
|
+
function Ut(t) {
|
|
1302
|
+
return { [t.name]: t.defaultValue };
|
|
1913
1303
|
}
|
|
1914
|
-
function
|
|
1915
|
-
switch (
|
|
1304
|
+
function _t(t) {
|
|
1305
|
+
switch (t.type) {
|
|
1916
1306
|
case "form":
|
|
1917
|
-
return
|
|
1307
|
+
return Ht(t);
|
|
1918
1308
|
case "checkboxes":
|
|
1919
1309
|
case "switches":
|
|
1920
|
-
return
|
|
1310
|
+
return zt(t);
|
|
1921
1311
|
case "radio":
|
|
1922
|
-
return
|
|
1312
|
+
return Ut(t);
|
|
1923
1313
|
default:
|
|
1924
1314
|
return {};
|
|
1925
1315
|
}
|
|
1926
1316
|
}
|
|
1927
|
-
function
|
|
1928
|
-
const
|
|
1929
|
-
for (const
|
|
1930
|
-
Object.assign(
|
|
1931
|
-
return
|
|
1317
|
+
function Qt(t) {
|
|
1318
|
+
const e = {};
|
|
1319
|
+
for (const n of t)
|
|
1320
|
+
Object.assign(e, _t(n));
|
|
1321
|
+
return e;
|
|
1932
1322
|
}
|
|
1933
|
-
function
|
|
1934
|
-
const
|
|
1935
|
-
...
|
|
1323
|
+
function Te(t) {
|
|
1324
|
+
const n = dt()((s) => ({
|
|
1325
|
+
...Qt(t)
|
|
1936
1326
|
}));
|
|
1937
|
-
return
|
|
1327
|
+
return n.activitySettings = t, n;
|
|
1938
1328
|
}
|
|
1939
|
-
function
|
|
1940
|
-
|
|
1941
|
-
() =>
|
|
1942
|
-
(
|
|
1943
|
-
|
|
1329
|
+
function Yt(t) {
|
|
1330
|
+
Wt(
|
|
1331
|
+
() => t.activitySettings,
|
|
1332
|
+
(e) => {
|
|
1333
|
+
t.setState(e);
|
|
1944
1334
|
},
|
|
1945
1335
|
[]
|
|
1946
1336
|
);
|
|
1947
1337
|
}
|
|
1948
|
-
function
|
|
1949
|
-
store:
|
|
1338
|
+
function Kt({
|
|
1339
|
+
store: t
|
|
1950
1340
|
}) {
|
|
1951
|
-
return
|
|
1341
|
+
return Yt(t), null;
|
|
1952
1342
|
}
|
|
1953
|
-
const
|
|
1343
|
+
const Xt = [
|
|
1954
1344
|
"meta-player-events:1",
|
|
1955
1345
|
"mode:1",
|
|
1956
1346
|
"workflow:1"
|
|
1957
1347
|
];
|
|
1958
|
-
function
|
|
1959
|
-
children:
|
|
1960
|
-
contracts:
|
|
1961
|
-
loadOnlyWhenReady:
|
|
1348
|
+
function Ve({
|
|
1349
|
+
children: t,
|
|
1350
|
+
contracts: e,
|
|
1351
|
+
loadOnlyWhenReady: n = !0,
|
|
1962
1352
|
activitySettingsStore: s
|
|
1963
1353
|
}) {
|
|
1964
|
-
const
|
|
1965
|
-
return
|
|
1966
|
-
const
|
|
1967
|
-
for (const
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
}, []),
|
|
1971
|
-
s && /* @__PURE__ */
|
|
1972
|
-
|
|
1354
|
+
const o = a((r) => r.ready);
|
|
1355
|
+
return w(() => {
|
|
1356
|
+
const r = [...e];
|
|
1357
|
+
for (const g of Xt)
|
|
1358
|
+
r.includes(g) || r.push(g);
|
|
1359
|
+
Bt(r);
|
|
1360
|
+
}, []), n && !o ? /* @__PURE__ */ Q("div", { className: "capy-loading-container", children: "Chargement en cours..." }) : /* @__PURE__ */ gt(mt, { children: [
|
|
1361
|
+
s && /* @__PURE__ */ Q(Kt, { store: s }),
|
|
1362
|
+
t
|
|
1973
1363
|
] });
|
|
1974
1364
|
}
|
|
1975
1365
|
export {
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
1366
|
+
Ve as Capytale,
|
|
1367
|
+
Te as createActivitySettingsStore,
|
|
1368
|
+
Ee as useAfterSaveAction,
|
|
1369
|
+
me as useGetLoadedJsonActivityContent,
|
|
1370
|
+
ye as useGetLoadedJsonActivitySplitContent,
|
|
1371
|
+
pe as useGetLoadedJsonAssignmentContent,
|
|
1372
|
+
ve as useGetLoadedJsonAssignmentSplitContent,
|
|
1373
|
+
ge as useGetLoadedJsonContent,
|
|
1374
|
+
fe as useGetLoadedTextContent,
|
|
1375
|
+
we as useJsonActivityContentSaveFunction,
|
|
1376
|
+
Ae as useJsonActivitySplitContentSaveFunction,
|
|
1377
|
+
he as useJsonAssignmentContentSaveFunction,
|
|
1378
|
+
be as useJsonAssignmentSplitContentSaveFunction,
|
|
1379
|
+
Se as useJsonContentSaveFunction,
|
|
1380
|
+
ue as useLoadedJsonActivityBinaryData,
|
|
1381
|
+
ce as useLoadedJsonActivityContent,
|
|
1382
|
+
de as useLoadedJsonAssignmentBinaryData,
|
|
1383
|
+
le as useLoadedJsonAssignmentContent,
|
|
1384
|
+
ae as useLoadedJsonContent,
|
|
1385
|
+
ie as useLoadedTextContent,
|
|
1386
|
+
ee as useMode,
|
|
1387
|
+
se as useNotifyIsDirty,
|
|
1388
|
+
Je as usePreviewImageFile,
|
|
1389
|
+
ke as usePreviewTextFile,
|
|
1390
|
+
xe as useQuickActions,
|
|
1391
|
+
re as useRequestSave,
|
|
1392
|
+
Wt as useSettings,
|
|
1393
|
+
Re as useShowToast,
|
|
1394
|
+
Fe as useSidebarActions,
|
|
1395
|
+
Ce as useTextContentSaveFunction,
|
|
1396
|
+
oe as useTheme,
|
|
1397
|
+
ne as useWorkflow
|
|
2008
1398
|
};
|