@yuneta/gobj-js 7.9.11 → 7.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +231 -141
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +999 -975
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +230 -142
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1045 -1020
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +231 -141
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +997 -973
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +231 -141
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +996 -972
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +4 -4
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -169,19 +169,19 @@ var S = Object.freeze({
|
|
|
169
169
|
SDF_AUTHZ_RS: 1048576
|
|
170
170
|
});
|
|
171
171
|
S.SDF_RD, S.SDF_WR, S.SDF_STATS, S.SDF_PERSIST, S.SDF_VOLATIL, S.SDF_RSTATS, S.SDF_PSTATS, S.SDF_WR, S.SDF_PERSIST;
|
|
172
|
-
var
|
|
172
|
+
var v = class {
|
|
173
173
|
constructor(e, t, n = 0, r = null, l = "", i = null, o = null, s = 0, a = null, u = null, _ = null) {
|
|
174
174
|
this.type = e, this.name = t, this.alias = i, this.flag = n, this.default_value = r, this.header = o, this.fillspace = s, this.description = l, this.json_fn = a, this.schema = u, this.authpth = _;
|
|
175
175
|
}
|
|
176
|
-
},
|
|
176
|
+
}, O = () => new v(0, null), N = (e, t, n, r, l) => new v(e, t, n, r, l), R = (e, t, n, r, l, i) => new v(e, t, 0, null, i, n, null, 0, l, r, null), D = (e, t, n, r, l, i, o) => new v(e, t, n, null, o, r, null, 0, i, l, null), w = (e, t, n, r, l) => new v(e, t, n, r, l), j = (e, t, n, r, l, i) => new v(e, t, n, null, i, r, null, 0, null, l, null), A = (e, t, n, r, l) => new v(e, t, n, null, l, null, null, 0, null, null, r), I = (e, t, n, r, l, i) => new v(e, t, n, null, i, null, r, l), $ = class {
|
|
177
177
|
constructor(e, t, n, r, l, i, o, s, a) {
|
|
178
178
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = l, this.authz_table = i, this.command_table = o, this.s_user_trace_level = s, this.gclass_flag = Number(a) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
179
179
|
}
|
|
180
|
-
},
|
|
180
|
+
}, k = class {
|
|
181
181
|
constructor(e, t, n, r, l) {
|
|
182
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
182
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = Bn(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
183
183
|
}
|
|
184
|
-
},
|
|
184
|
+
}, C = Object.freeze({
|
|
185
185
|
gcflag_manual_start: 1,
|
|
186
186
|
gcflag_no_check_output_events: 2,
|
|
187
187
|
gcflag_ignore_unknown_attrs: 4,
|
|
@@ -227,11 +227,11 @@ var W = 0;
|
|
|
227
227
|
function K(e) {
|
|
228
228
|
W = 1 === Number(e) ? 1 : 0;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function Y() {
|
|
231
231
|
return W;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
|
|
233
|
+
function x(e) {
|
|
234
|
+
ur(e) && (e = JSON.stringify(e)), Kn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
235
235
|
}
|
|
236
236
|
var B = Object.freeze({
|
|
237
237
|
TRACE_MACHINE: 65536,
|
|
@@ -327,7 +327,7 @@ var B = Object.freeze({
|
|
|
327
327
|
]
|
|
328
328
|
], q = 0, H = 0, Q = 0;
|
|
329
329
|
function z(e, t) {
|
|
330
|
-
if (
|
|
330
|
+
if (Tr(e)) return 268369920;
|
|
331
331
|
if (/^[0-9]+$/.test(String(e))) {
|
|
332
332
|
const t = Number(e);
|
|
333
333
|
if (t) return t;
|
|
@@ -335,7 +335,7 @@ function z(e, t) {
|
|
|
335
335
|
return function(e) {
|
|
336
336
|
for (const [t, n] of J) if (t === e) return n;
|
|
337
337
|
return 0;
|
|
338
|
-
}(String(e)) || (
|
|
338
|
+
}(String(e)) || (Vn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
339
339
|
}
|
|
340
340
|
function X(e) {
|
|
341
341
|
if (Q) return 4294967295;
|
|
@@ -349,11 +349,11 @@ function Z(e) {
|
|
|
349
349
|
function ee() {
|
|
350
350
|
if (!E || !E.jn_attrs) return 0;
|
|
351
351
|
let e = 0;
|
|
352
|
-
if (
|
|
353
|
-
const t = Number(
|
|
352
|
+
if (Gt(E, "tracing")) {
|
|
353
|
+
const t = Number(Vt(E, "tracing")) || 0;
|
|
354
354
|
t >= 1 && (e |= B.TRACE_MACHINE), t >= 2 && (e |= B.TRACE_EV_KW);
|
|
355
355
|
}
|
|
356
|
-
return
|
|
356
|
+
return Gt(E, "trace_timer") && Vt(E, "trace_timer") && (e |= B.TRACE_TIMER), Gt(E, "trace_creation") && Vt(E, "trace_creation") && (e |= B.TRACE_CREATE_DELETE), Gt(E, "trace_start_stop") && Vt(E, "trace_start_stop") && (e |= B.TRACE_START_STOP), e;
|
|
357
357
|
}
|
|
358
358
|
function te(e) {
|
|
359
359
|
return (X(e) | ee()) & B.TRACE_CREATE_DELETE;
|
|
@@ -368,42 +368,48 @@ function re(e, t) {
|
|
|
368
368
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
369
369
|
}
|
|
370
370
|
function le(e, t) {
|
|
371
|
+
if (Q > 1) return !1;
|
|
372
|
+
if (!e) return !0;
|
|
373
|
+
const n = Z(e);
|
|
374
|
+
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
375
|
+
}
|
|
376
|
+
function ie(e, t) {
|
|
371
377
|
const n = z(e, "gobj_set_global_trace");
|
|
372
378
|
return n ? (t ? q |= n : q &= ~n, 0) : -1;
|
|
373
379
|
}
|
|
374
|
-
function
|
|
380
|
+
function oe(e, t) {
|
|
375
381
|
const n = z(e, "gobj_set_global_no_trace");
|
|
376
382
|
return n ? (t ? H |= n : H &= ~n, 0) : -1;
|
|
377
383
|
}
|
|
378
|
-
function
|
|
384
|
+
function se() {
|
|
379
385
|
return q;
|
|
380
386
|
}
|
|
381
|
-
function
|
|
387
|
+
function ae(e) {
|
|
382
388
|
return Q = Number(e) || 0, 0;
|
|
383
389
|
}
|
|
384
|
-
function
|
|
385
|
-
const r =
|
|
386
|
-
if (!r) return
|
|
390
|
+
function ue(e, t, n) {
|
|
391
|
+
const r = cr(e) ? Ie(e) : e;
|
|
392
|
+
if (!r) return Vn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
387
393
|
const l = z(t, "gobj_set_gclass_trace");
|
|
388
394
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
389
395
|
}
|
|
390
|
-
function
|
|
391
|
-
if (!e) return
|
|
396
|
+
function _e(e, t, n) {
|
|
397
|
+
if (!e) return Vn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
392
398
|
const r = z(t, "gobj_set_gobj_trace");
|
|
393
399
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
394
400
|
}
|
|
395
|
-
function
|
|
396
|
-
const r =
|
|
397
|
-
if (!r) return
|
|
401
|
+
function ce(e, t, n) {
|
|
402
|
+
const r = cr(e) ? Ie(e) : e;
|
|
403
|
+
if (!r) return Vn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
398
404
|
const l = z(t, "gobj_set_gclass_no_trace");
|
|
399
405
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
400
406
|
}
|
|
401
|
-
function
|
|
402
|
-
if (!e) return
|
|
407
|
+
function fe(e, t, n) {
|
|
408
|
+
if (!e) return Vn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
403
409
|
const r = z(t, "gobj_set_gobj_no_trace");
|
|
404
410
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
405
411
|
}
|
|
406
|
-
function
|
|
412
|
+
function ge() {
|
|
407
413
|
return J.map(([e, t, n]) => ({
|
|
408
414
|
name: e,
|
|
409
415
|
bit: t,
|
|
@@ -411,178 +417,178 @@ function fe() {
|
|
|
411
417
|
set: !!(q & t)
|
|
412
418
|
}));
|
|
413
419
|
}
|
|
414
|
-
function
|
|
420
|
+
function de(e, t, n, r, l, i, o) {
|
|
415
421
|
u = t, _ = n, c = r, f = l, g = i, d = o;
|
|
416
422
|
const s = [["EV_STATE_CHANGED", U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]];
|
|
417
423
|
for (let e = 0; e < s.length; e++) {
|
|
418
424
|
let t = s[e][0], n = s[e][1];
|
|
419
|
-
|
|
425
|
+
De(b, t, n);
|
|
420
426
|
}
|
|
421
427
|
return 0;
|
|
422
428
|
}
|
|
423
|
-
function
|
|
429
|
+
function be(e, t) {
|
|
424
430
|
let n = {};
|
|
425
|
-
if (!
|
|
431
|
+
if (!_r(t)) return Vn("sdata_desc MUST be an array"), xn(t), n;
|
|
426
432
|
for (let r = 0; r < t.length; r++) {
|
|
427
433
|
const l = t[r];
|
|
428
|
-
l.name &&
|
|
434
|
+
l.name && me(e, n, l);
|
|
429
435
|
}
|
|
430
436
|
return n;
|
|
431
437
|
}
|
|
432
|
-
function
|
|
438
|
+
function me(e, t, n) {
|
|
433
439
|
let r, l = n.default_value;
|
|
434
440
|
switch (n.type) {
|
|
435
441
|
case y.DTP_STRING:
|
|
436
442
|
r = String(l);
|
|
437
443
|
break;
|
|
438
444
|
case y.DTP_BOOLEAN:
|
|
439
|
-
r =
|
|
445
|
+
r = hr(l);
|
|
440
446
|
break;
|
|
441
447
|
case y.DTP_INTEGER:
|
|
442
|
-
r = parseInt(l), isNaN(r) &&
|
|
448
|
+
r = parseInt(l), isNaN(r) && Vn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
443
449
|
break;
|
|
444
450
|
case y.DTP_REAL:
|
|
445
|
-
r = Number(l), isNaN(r) &&
|
|
451
|
+
r = Number(l), isNaN(r) && Vn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
446
452
|
break;
|
|
447
453
|
case y.DTP_LIST:
|
|
448
|
-
if (
|
|
454
|
+
if (cr(l)) try {
|
|
449
455
|
r = JSON.parse(l);
|
|
450
456
|
} catch (e) {
|
|
451
|
-
|
|
457
|
+
Vn(`JSON parse error: ${e.message}`);
|
|
452
458
|
}
|
|
453
459
|
else r = l;
|
|
454
|
-
|
|
460
|
+
_r(r) || (r = []);
|
|
455
461
|
break;
|
|
456
462
|
case y.DTP_DICT:
|
|
457
|
-
if (
|
|
463
|
+
if (cr(l)) try {
|
|
458
464
|
r = JSON.parse(l);
|
|
459
465
|
} catch (e) {
|
|
460
|
-
|
|
466
|
+
Vn(`JSON parse error: ${e.message}`);
|
|
461
467
|
}
|
|
462
468
|
else r = l;
|
|
463
|
-
|
|
469
|
+
ur(r) || (r = {});
|
|
464
470
|
break;
|
|
465
471
|
case y.DTP_JSON:
|
|
466
|
-
if (
|
|
472
|
+
if (cr(l)) try {
|
|
467
473
|
r = JSON.parse(l);
|
|
468
474
|
} catch (e) {
|
|
469
|
-
|
|
475
|
+
Vn(`JSON parse error: ${e.message}`);
|
|
470
476
|
}
|
|
471
477
|
else r = l;
|
|
472
478
|
break;
|
|
473
479
|
case y.DTP_POINTER: r = l;
|
|
474
480
|
}
|
|
475
|
-
return void 0 === r && (
|
|
481
|
+
return void 0 === r && (Vn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
476
482
|
}
|
|
477
|
-
function
|
|
483
|
+
function pe(e, t, n, r) {
|
|
478
484
|
let l;
|
|
479
485
|
switch (n.type) {
|
|
480
486
|
case y.DTP_STRING:
|
|
481
487
|
if (null == r) l = "";
|
|
482
|
-
else if (
|
|
488
|
+
else if (cr(r)) l = String(r);
|
|
483
489
|
else {
|
|
484
490
|
let e = JSON.stringify(r);
|
|
485
491
|
e && (l = String(e));
|
|
486
492
|
}
|
|
487
493
|
break;
|
|
488
494
|
case y.DTP_BOOLEAN:
|
|
489
|
-
l =
|
|
495
|
+
l = hr(r);
|
|
490
496
|
break;
|
|
491
497
|
case y.DTP_INTEGER:
|
|
492
|
-
l = parseInt(r), isNaN(l) &&
|
|
498
|
+
l = parseInt(r), isNaN(l) && Vn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
493
499
|
break;
|
|
494
500
|
case y.DTP_REAL:
|
|
495
|
-
l = Number(r), isNaN(l) &&
|
|
501
|
+
l = Number(r), isNaN(l) && Vn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
496
502
|
break;
|
|
497
503
|
case y.DTP_LIST:
|
|
498
|
-
if (
|
|
504
|
+
if (cr(r)) try {
|
|
499
505
|
l = JSON.parse(r);
|
|
500
506
|
} catch (e) {
|
|
501
|
-
|
|
507
|
+
Vn(`JSON parse error: ${e.message}`);
|
|
502
508
|
}
|
|
503
509
|
else l = r;
|
|
504
|
-
if (!
|
|
510
|
+
if (!_r(l)) return Vn(`attr must be an array: ${n.name}`), -1;
|
|
505
511
|
break;
|
|
506
512
|
case y.DTP_DICT:
|
|
507
|
-
if (
|
|
513
|
+
if (cr(r)) try {
|
|
508
514
|
l = JSON.parse(r);
|
|
509
515
|
} catch (e) {
|
|
510
|
-
|
|
516
|
+
Vn(`JSON parse error: ${e.message}`);
|
|
511
517
|
}
|
|
512
518
|
else l = r;
|
|
513
|
-
if (!
|
|
519
|
+
if (!ur(l)) return Vn(`attr must be an object: ${n.name}`), -1;
|
|
514
520
|
break;
|
|
515
521
|
case y.DTP_JSON:
|
|
516
|
-
if (
|
|
522
|
+
if (cr(r)) try {
|
|
517
523
|
l = JSON.parse(r);
|
|
518
524
|
} catch (e) {
|
|
519
|
-
|
|
525
|
+
Vn(`JSON parse error: ${e.message}`);
|
|
520
526
|
}
|
|
521
527
|
else l = r;
|
|
522
|
-
if (!
|
|
528
|
+
if (!_r(l) && !ur(l)) return Vn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
523
529
|
break;
|
|
524
530
|
case y.DTP_POINTER: l = r;
|
|
525
531
|
}
|
|
526
|
-
return void 0 === l &&
|
|
532
|
+
return void 0 === l && Vn(`${Tt(e)}: attr undefined: ${n.name}`), t[n.name] = l, ur(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
527
533
|
}
|
|
528
|
-
function
|
|
534
|
+
function Ee(e) {
|
|
529
535
|
return e.jn_attrs;
|
|
530
536
|
}
|
|
531
|
-
function Ee(e, t, n) {
|
|
532
|
-
return Ft(e, t) ? pe(e) : e && e.bottom_gobj ? Ee(e.bottom_gobj, t, n) : (n && Ln(`GClass Attribute NOT FOUND: ${Et(e)}, attr ${t}`), null);
|
|
533
|
-
}
|
|
534
537
|
function Te(e, t, n) {
|
|
535
|
-
|
|
538
|
+
return Gt(e, t) ? Ee(e) : e && e.bottom_gobj ? Te(e.bottom_gobj, t, n) : (n && Vn(`GClass Attribute NOT FOUND: ${Tt(e)}, attr ${t}`), null);
|
|
539
|
+
}
|
|
540
|
+
function he(e, t, n) {
|
|
541
|
+
if (!(e && e instanceof $)) return n && Vn("gclass NULL"), null;
|
|
536
542
|
if (!t) return e.attrs_table;
|
|
537
543
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
538
544
|
const r = e.attrs_table[n];
|
|
539
545
|
if (r.name && r.name === t) return r;
|
|
540
546
|
}
|
|
541
|
-
return n &&
|
|
547
|
+
return n && Vn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
542
548
|
}
|
|
543
|
-
function
|
|
544
|
-
if (
|
|
545
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
546
|
-
if (
|
|
549
|
+
function ye(e, t, n, r, l, i, o, s, a, u, _) {
|
|
550
|
+
if (Tr(e)) return Vn("gclass_name EMPTY"), null;
|
|
551
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Vn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
552
|
+
if (Ie(e)) return Vn(`GClass ALREADY exists: ${e}`), null;
|
|
547
553
|
let c = new $(e, r, l, i, o, s, a, u, _);
|
|
548
554
|
(function(e, t) {
|
|
549
|
-
e && e instanceof $ ? t ? m[t] ?
|
|
555
|
+
e && e instanceof $ ? t ? m[t] ? Vn(`gclass ALREADY REGISTERED: ${t}`) : m[t] = e : Vn("gclass_name undefined") : Vn("gclass undefined");
|
|
550
556
|
})(c, e);
|
|
551
557
|
const f = n.length;
|
|
552
558
|
for (let e = 0; e < f; e++) {
|
|
553
559
|
let t = n[e][0], r = n[e][1];
|
|
554
|
-
if (
|
|
555
|
-
if (
|
|
560
|
+
if (Tr(t)) continue;
|
|
561
|
+
if (Ne(c, t) < 0) return Se(c), null;
|
|
556
562
|
const l = r.length;
|
|
557
563
|
for (let e = 0; e < l; e++) {
|
|
558
564
|
let n = r[e][0], l = r[e][1], i = r[e][2];
|
|
559
|
-
|
|
565
|
+
Tr(n) || Re(c, t, n, l, i);
|
|
560
566
|
}
|
|
561
567
|
}
|
|
562
568
|
for (let e = 0; e < t.length; e++) {
|
|
563
569
|
let n = t[e][0], r = t[e][1];
|
|
564
|
-
if (!
|
|
565
|
-
if (
|
|
566
|
-
|
|
570
|
+
if (!Tr(n)) {
|
|
571
|
+
if (je(c, n)) return Vn(`SMachine: event repeated in input_events: ${n}`), Se(c), null;
|
|
572
|
+
we(c, n, r);
|
|
567
573
|
}
|
|
568
574
|
}
|
|
569
575
|
if (!c.fsm_checked) {
|
|
570
|
-
if (
|
|
576
|
+
if (Ae(c) < 0) return Se(c), null;
|
|
571
577
|
c.fsm_checked = !0;
|
|
572
578
|
}
|
|
573
579
|
return c;
|
|
574
580
|
}
|
|
575
|
-
function
|
|
581
|
+
function Se(e) {
|
|
576
582
|
let t;
|
|
577
|
-
if (
|
|
583
|
+
if (cr(e)) t = e;
|
|
578
584
|
else {
|
|
579
|
-
if (!(e instanceof $)) return
|
|
585
|
+
if (!(e instanceof $)) return Vn("Cannot unregister gclass, type unknown"), -1;
|
|
580
586
|
t = e.gclass_name;
|
|
581
587
|
}
|
|
582
588
|
let n = m[t];
|
|
583
|
-
return n ? n.instances > 0 ? (
|
|
589
|
+
return n ? n.instances > 0 ? (Vn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete m[t], 0) : (Vn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
584
590
|
}
|
|
585
|
-
function
|
|
591
|
+
function ve(e, t) {
|
|
586
592
|
const n = e.dl_states.length, r = e.dl_states;
|
|
587
593
|
for (let e = 0; e < n; e++) {
|
|
588
594
|
let n = r[e];
|
|
@@ -598,23 +604,23 @@ function Oe(e, t) {
|
|
|
598
604
|
}
|
|
599
605
|
return null;
|
|
600
606
|
}
|
|
601
|
-
function
|
|
602
|
-
return e instanceof $ ?
|
|
603
|
-
}
|
|
604
|
-
function Ne(e, t, n, r, l) {
|
|
605
|
-
if (!(e instanceof $)) return Ln("Cannot add state, typeof not GClass"), -1;
|
|
606
|
-
if (dr(t)) return Ln("state_name EMPTY"), -1;
|
|
607
|
-
let i = Se(e, t);
|
|
608
|
-
return i ? Oe(i, n) ? (Ln(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new G(n, r, l)), 0) : (Ln(`state not found: ${t}`), -1);
|
|
607
|
+
function Ne(e, t) {
|
|
608
|
+
return e instanceof $ ? ve(e, t) ? (Vn(`state already exists: ${t}`), -1) : (e.dl_states.push(new V(t)), 0) : (Vn("Cannot add state, typeof not GClass"), -1);
|
|
609
609
|
}
|
|
610
|
-
function Re(e, t, n) {
|
|
611
|
-
|
|
610
|
+
function Re(e, t, n, r, l) {
|
|
611
|
+
if (!(e instanceof $)) return Vn("Cannot add state, typeof not GClass"), -1;
|
|
612
|
+
if (Tr(t)) return Vn("state_name EMPTY"), -1;
|
|
613
|
+
let i = ve(e, t);
|
|
614
|
+
return i ? Oe(i, n) ? (Vn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new G(n, r, l)), 0) : (Vn(`state not found: ${t}`), -1);
|
|
612
615
|
}
|
|
613
616
|
function De(e, t, n) {
|
|
614
|
-
|
|
617
|
+
Tr(t) || e.push(new M(t, n));
|
|
615
618
|
}
|
|
616
|
-
function we(e, t) {
|
|
617
|
-
|
|
619
|
+
function we(e, t, n) {
|
|
620
|
+
return e instanceof $ ? De(e.dl_events, t, n) : (Vn("Cannot add state, typeof not GClass"), -1);
|
|
621
|
+
}
|
|
622
|
+
function je(e, t) {
|
|
623
|
+
if (!(e instanceof $)) return Vn("Cannot add state, typeof not GClass"), 0;
|
|
618
624
|
const n = e.dl_events.length, r = e.dl_events;
|
|
619
625
|
for (let e = 0; e < n; e++) {
|
|
620
626
|
let n = r[e];
|
|
@@ -622,273 +628,276 @@ function we(e, t) {
|
|
|
622
628
|
}
|
|
623
629
|
return null;
|
|
624
630
|
}
|
|
625
|
-
function
|
|
626
|
-
if (!(e instanceof $)) return
|
|
631
|
+
function Ae(e) {
|
|
632
|
+
if (!(e instanceof $)) return Vn("Cannot add state, typeof not GClass"), -1;
|
|
627
633
|
let t = 0;
|
|
628
|
-
|
|
634
|
+
sr(e.dl_states) || (Vn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
629
635
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
630
636
|
let r = e.dl_states[n];
|
|
631
|
-
if (!
|
|
637
|
+
if (!Tr(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
632
638
|
let l = r.dl_actions[n];
|
|
633
|
-
|
|
639
|
+
Tr(l.event_name) || (je(e, l.event_name) || (Vn(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (ve(e, l.next_state) || (Vn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
634
640
|
}
|
|
635
641
|
}
|
|
636
642
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
637
643
|
let r = e.dl_events[n];
|
|
638
|
-
if (!
|
|
644
|
+
if (!Tr(r.event_name) && (fr(r.event_flag) || (Vn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & U.EVF_OUTPUT_EVENT))) {
|
|
639
645
|
let n = !1;
|
|
640
646
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
641
647
|
let l = e.dl_states[t];
|
|
642
|
-
|
|
648
|
+
Tr(l.state_name) || Oe(l, r.event_name) && (n = !0);
|
|
643
649
|
}
|
|
644
|
-
n || (
|
|
650
|
+
n || (Vn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
645
651
|
}
|
|
646
652
|
}
|
|
647
653
|
return t;
|
|
648
654
|
}
|
|
649
|
-
function
|
|
655
|
+
function Ie(e, t) {
|
|
650
656
|
let n = null;
|
|
651
657
|
try {
|
|
652
658
|
n = m[e];
|
|
653
659
|
} catch (e) {}
|
|
654
|
-
return n || t &&
|
|
660
|
+
return n || (t && Vn(`gclass not found: ${e}`), null);
|
|
655
661
|
}
|
|
656
|
-
function
|
|
662
|
+
function $e() {
|
|
657
663
|
let e = [];
|
|
658
|
-
for (const t of Object.keys(p))
|
|
664
|
+
for (const t of Object.keys(p)) rr(e, t);
|
|
659
665
|
return e;
|
|
660
666
|
}
|
|
661
|
-
function
|
|
667
|
+
function ke() {
|
|
662
668
|
return !T || T.obflag & P.obflag_destroyed ? null : T;
|
|
663
669
|
}
|
|
664
670
|
function Ce(e, t) {
|
|
665
671
|
e = e.toLowerCase();
|
|
666
|
-
|
|
667
|
-
return !n && t ? (Ln(`gobj service not found: ${e}`), null) : n;
|
|
672
|
+
return p[e] || (t && Vn(`gobj service not found: ${e}`), null);
|
|
668
673
|
}
|
|
669
|
-
function
|
|
670
|
-
let t =
|
|
671
|
-
return t = t.toLowerCase(), p[t] &&
|
|
672
|
-
}
|
|
673
|
-
function Le(e, t) {
|
|
674
|
-
t.parent && Ln(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
674
|
+
function Le(e) {
|
|
675
|
+
let t = pt(e);
|
|
676
|
+
return t = t.toLowerCase(), p[t] && Vn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), p[t] = e, 0;
|
|
675
677
|
}
|
|
676
678
|
function Pe(e, t) {
|
|
677
|
-
|
|
678
|
-
n >= 0 && (Zn(e.dl_children, n), t.parent = null);
|
|
679
|
+
t.parent && Vn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
679
680
|
}
|
|
680
681
|
function Ue(e, t) {
|
|
681
|
-
|
|
682
|
+
let n = Ul(e.dl_children, t);
|
|
683
|
+
n >= 0 && (lr(e.dl_children, n), t.parent = null);
|
|
682
684
|
}
|
|
683
685
|
function Fe(e, t) {
|
|
684
|
-
return
|
|
686
|
+
return ct(e) ? u ? u(e, t) : -1 : (Vn(`${Tt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
685
687
|
}
|
|
686
688
|
function Ge(e, t) {
|
|
687
|
-
return
|
|
689
|
+
return ct(e) ? _ ? _(e, t) : -1 : (Vn(`${Tt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
688
690
|
}
|
|
689
691
|
function Ve(e, t) {
|
|
690
|
-
return
|
|
692
|
+
return ct(e) ? c ? c(e, t) : -1 : (Vn(`${Tt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
691
693
|
}
|
|
692
694
|
function Me(e, t) {
|
|
693
|
-
|
|
695
|
+
return f ? f(e, t) : null;
|
|
694
696
|
}
|
|
695
|
-
function We(e, t
|
|
697
|
+
function We(e, t) {
|
|
698
|
+
"__json_config_variables__" !== t && Vn(`GClass Attribute NOT FOUND: ${Tt(e)}, attr ${t}`);
|
|
699
|
+
}
|
|
700
|
+
function Ke(e, t, n) {
|
|
696
701
|
let r = t;
|
|
697
702
|
(function(e, t, n, r, l) {
|
|
698
|
-
if (!e || !t) return
|
|
703
|
+
if (!e || !t) return Vn("hsdata or kw NULL"), -1;
|
|
699
704
|
let i = 0;
|
|
700
705
|
for (const [o, s] of Object.entries(t)) {
|
|
701
|
-
const t =
|
|
702
|
-
t ? (-1 === n || t.flag & n) && (t.flag & S.SDF_DEPRECATED &&
|
|
706
|
+
const t = he(l.gclass, o, !1);
|
|
707
|
+
t ? (-1 === n || t.flag & n) && (t.flag & S.SDF_DEPRECATED && Mn(`${Tt(l)}: Deprecated attribute used in gobj creation: ${o}`), i += pe(l, e, t, s)) : r && (r(l, o), i--);
|
|
703
708
|
}
|
|
704
709
|
return i;
|
|
705
|
-
})(
|
|
710
|
+
})(Ee(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : We, e) < 0 && (Vn(`${Tt(e)} json2data() FAILED`), xn(r));
|
|
706
711
|
}
|
|
707
|
-
function
|
|
712
|
+
function Ye(e, n, r, l, i) {
|
|
708
713
|
if (i & L.gobj_flag_yuno) {
|
|
709
|
-
if (E) return
|
|
714
|
+
if (E) return Vn("__yuno__ already created"), null;
|
|
710
715
|
i |= L.gobj_flag_service;
|
|
711
716
|
} else {
|
|
712
|
-
if (!l) return
|
|
713
|
-
if (!("string" == typeof l || l instanceof
|
|
714
|
-
if (
|
|
717
|
+
if (!l) return Vn("gobj NEEDS a parent!"), null;
|
|
718
|
+
if (!("string" == typeof l || l instanceof k)) return Vn(`BAD TYPE of parent: ${l}`), null;
|
|
719
|
+
if (cr(l) && !(l = Ce(l))) return Mn(`parent service not found: ${l}`), null;
|
|
715
720
|
}
|
|
716
|
-
if (i & L.gobj_flag_service && Ce(e, !1)) return
|
|
721
|
+
if (i & L.gobj_flag_service && Ce(e, !1)) return Vn(`service ALREADY registered: ${n}^${e}`), null;
|
|
717
722
|
if (i & L.gobj_flag_default_service) {
|
|
718
|
-
if (T) return
|
|
723
|
+
if (T) return Vn(`default service ALREADY registered: ${n}^${e}`), null;
|
|
719
724
|
i |= L.gobj_flag_service;
|
|
720
725
|
}
|
|
721
|
-
if (
|
|
722
|
-
let o =
|
|
723
|
-
if (!o) return
|
|
724
|
-
if (!
|
|
725
|
-
if (!
|
|
726
|
-
if (e.includes("`")) return
|
|
727
|
-
if (e.includes("^")) return
|
|
726
|
+
if (Tr(n)) return Vn("gclass_name must be a string"), null;
|
|
727
|
+
let o = Ie(n, !1);
|
|
728
|
+
if (!o) return Vn(`GClass not registered: ${n}^${e}`), null;
|
|
729
|
+
if (!cr(e)) return Vn(`gobj_name must be a string: ${n}`), null;
|
|
730
|
+
if (!Tr(e)) {
|
|
731
|
+
if (e.includes("`")) return Vn(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
732
|
+
if (e.includes("^")) return Vn(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
728
733
|
}
|
|
729
|
-
let s = new
|
|
730
|
-
s.jn_attrs =
|
|
734
|
+
let s = new k(e, o, r, l, i);
|
|
735
|
+
s.jn_attrs = be(s, o.attrs_table);
|
|
731
736
|
for (const [e, t] of Object.entries(s.jn_attrs)) e in s.priv && (s.priv[e] = t);
|
|
732
737
|
let a = te(s);
|
|
733
|
-
return a &&
|
|
738
|
+
return a && x(t("💙💙⏩ creating: %s^%s", o.gclass_name, e)), s.gobj_flag & L.gobj_flag_service && Le(s), s.gobj_flag & L.gobj_flag_yuno && (E = s), s.gobj_flag & L.gobj_flag_default_service && (T = s), s.gobj_flag & L.gobj_flag_yuno || Pe(l, s), s.obflag |= P.obflag_created, s.gclass.instances++, Ke(s, r), s.gobj_flag & L.gobj_flag_service && u && u(s, null), s.gclass.gmt.mt_create2 ? s.gclass.gmt.mt_create2(s, r) : s.gclass.gmt.mt_create && s.gclass.gmt.mt_create(s), l && l.gclass.gmt.mt_child_added && (a && x(t("👦👦🔵 child_added(%s): %s", ht(l), Tt(s))), l.gclass.gmt.mt_child_added(l, s)), a && x(t("💙💙⏪ created: %s", ht(s))), s;
|
|
734
739
|
}
|
|
735
740
|
function xe(e, t, n) {
|
|
736
|
-
return
|
|
737
|
-
}
|
|
738
|
-
function Ye(e, t, n, r) {
|
|
739
|
-
return Ke(e, t, n, r, L.gobj_flag_service);
|
|
741
|
+
return Ye(e, t, n, null, L.gobj_flag_yuno);
|
|
740
742
|
}
|
|
741
743
|
function Be(e, t, n, r) {
|
|
742
|
-
return
|
|
744
|
+
return Ye(e, t, n, r, L.gobj_flag_service);
|
|
743
745
|
}
|
|
744
746
|
function Je(e, t, n, r) {
|
|
745
|
-
return
|
|
747
|
+
return Ye(e, t, n, r, L.gobj_flag_default_service | L.gobj_flag_autostart);
|
|
746
748
|
}
|
|
747
749
|
function qe(e, t, n, r) {
|
|
748
|
-
return
|
|
750
|
+
return Ye(e, t, n, r, L.gobj_flag_volatil);
|
|
749
751
|
}
|
|
750
752
|
function He(e, t, n, r) {
|
|
751
|
-
return
|
|
753
|
+
return Ye(e, t, n, r, L.gobj_flag_pure_child);
|
|
752
754
|
}
|
|
753
|
-
function Qe(e) {
|
|
754
|
-
|
|
755
|
-
|
|
755
|
+
function Qe(e, t, n, r) {
|
|
756
|
+
return Ye(e, t, n, r, 0);
|
|
757
|
+
}
|
|
758
|
+
function ze(e) {
|
|
759
|
+
if (Ot(e)) return void Vn("gobj NULL or DESTROYED");
|
|
760
|
+
e.__refs__ > 0 && Vn(`${Tt(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Vn(`Destroying a PLAYING gobj: ${ht(e)}`), at(e)), e.running && (Vn(`Destroying a RUNNING gobj: ${ht(e)}`), rt(e)), e.obflag |= P.obflag_destroying, function(e) {
|
|
761
|
+
if (0 === ln.length) return;
|
|
762
|
+
for (let t of ln) t.src === e && (t.src = null);
|
|
763
|
+
ln = ln.filter((t) => t.dst !== e);
|
|
764
|
+
}(e);
|
|
756
765
|
let n = te(e);
|
|
757
|
-
n &&
|
|
758
|
-
let r =
|
|
759
|
-
r && r.gclass.gmt.mt_child_removed && (n &&
|
|
760
|
-
let t =
|
|
761
|
-
t = t.toLowerCase(), p[t] ? delete p[t] :
|
|
762
|
-
}(e),
|
|
766
|
+
n && x(t("💔💔⏩ destroying: %s", ht(e)));
|
|
767
|
+
let r = yt(e);
|
|
768
|
+
r && r.gclass.gmt.mt_child_removed && (n && x(t("👦👦🔴 child_removed(%s): %s", ht(r), Tt(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & L.gobj_flag_service && function(e) {
|
|
769
|
+
let t = pt(e);
|
|
770
|
+
t = t.toLowerCase(), p[t] ? delete p[t] : Vn(`"service NOT found in register": ${t}`);
|
|
771
|
+
}(e), Tn(e, e.dl_subscriptions, !0), Tn(e, e.dl_subscribings, !0), r && (Ue(r, e), St(e) && (Nt(r) !== e || Ot(r) || Rt(r, null))), function(e) {
|
|
763
772
|
let t = e.dl_children.slice();
|
|
764
773
|
for (let e = 0; e < t.length; e++) {
|
|
765
774
|
let n = t[e];
|
|
766
|
-
Ot(n) ||
|
|
775
|
+
Ot(n) || ze(n);
|
|
767
776
|
}
|
|
768
|
-
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n &&
|
|
777
|
+
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && x(t("💔💔⏪ destroyed: %s", ht(e))), e.obflag |= P.obflag_destroyed, e.obflag & P.obflag_created && e.gclass.instances--;
|
|
769
778
|
}
|
|
770
|
-
function
|
|
771
|
-
if (Ot(e)) return
|
|
772
|
-
if (e.running) return
|
|
773
|
-
if (e.disabled) return
|
|
774
|
-
ne(e) &&
|
|
779
|
+
function Xe(e) {
|
|
780
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), -1;
|
|
781
|
+
if (e.running) return Vn(`${Tt(e)}: GObj ALREADY RUNNING`), -1;
|
|
782
|
+
if (e.disabled) return Vn(`${Tt(e)}: GObj DISABLED`), -1;
|
|
783
|
+
ne(e) && x(t("⏺ ⏺ start: %s", ht(e))), e.running = !0;
|
|
775
784
|
let n = 0;
|
|
776
785
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
777
786
|
}
|
|
778
|
-
function
|
|
779
|
-
return e.gclass.gclass_flag &
|
|
780
|
-
}
|
|
781
|
-
function Ze(e) {
|
|
782
|
-
return Ot(e) ? (Ln("gobj NULL or DESTROYED"), -1) : Dt(e, F.WALK_FIRST2LAST, Xe, 0, 0);
|
|
787
|
+
function Ze(e, t, n) {
|
|
788
|
+
return e.gclass.gclass_flag & C.gcflag_manual_start || Ot(e) || ut(e) || _t(e) || Xe(e), 0;
|
|
783
789
|
}
|
|
784
|
-
function et(e
|
|
785
|
-
return e
|
|
790
|
+
function et(e) {
|
|
791
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), -1) : wt(e, F.WALK_FIRST2LAST, Ze, 0, 0);
|
|
786
792
|
}
|
|
787
|
-
function tt(e) {
|
|
788
|
-
return
|
|
793
|
+
function tt(e, t, n) {
|
|
794
|
+
return e.gclass.gclass_flag & C.gcflag_manual_start || _t(e) ? 1 : (ut(e) || Xe(e), 0);
|
|
789
795
|
}
|
|
790
796
|
function nt(e) {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
797
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), -1) : (ne(e) && x(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", ht(e))), e.gclass.gclass_flag & C.gcflag_manual_start || e.disabled ? 0 : (e.running || Xe(e), jt(e, F.WALK_TOP2BOTTOM, tt, 0, 0)));
|
|
798
|
+
}
|
|
799
|
+
function rt(e) {
|
|
800
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), -1;
|
|
801
|
+
if (!e.running) return Vn(`${Tt(e)}: GObj NOT RUNNING`), -1;
|
|
802
|
+
e.playing && (Mn(`${Tt(e)}: GObj stopping without previous pause`), at(e)), ne(e) && x(t("⏹ ⏹ stop: %s", ht(e))), e.running = !1;
|
|
794
803
|
let n = 0;
|
|
795
804
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
796
805
|
}
|
|
797
|
-
function
|
|
798
|
-
return
|
|
799
|
-
}
|
|
800
|
-
function lt(e) {
|
|
801
|
-
return Ot(e) ? (Ln("gobj NULL or DESTROYED"), -1) : Dt(e, F.WALK_FIRST2LAST, rt, 0, 0);
|
|
806
|
+
function lt(e, t, n) {
|
|
807
|
+
return ut(e) && rt(e), 0;
|
|
802
808
|
}
|
|
803
809
|
function it(e) {
|
|
804
|
-
return Ot(e) ? (
|
|
810
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), -1) : wt(e, F.WALK_FIRST2LAST, lt, 0, 0);
|
|
805
811
|
}
|
|
806
812
|
function ot(e) {
|
|
807
|
-
|
|
808
|
-
if (e.playing) return Ln(`${Et(e)}: GObj ALREADY PLAYING`), -1;
|
|
809
|
-
if (e.disabled) return Ln(`${Et(e)}: GObj DISABLED`), -1;
|
|
810
|
-
if (!at(e)) {
|
|
811
|
-
if (e.gclass.gclass_flag & k.gcflag_required_start_to_play) return Ln(`${Et(e)}: Cannot play, start not done`), -1;
|
|
812
|
-
Pn(`${Et(e)}: GObj playing without previous start`), ze(e);
|
|
813
|
-
}
|
|
814
|
-
ne(e) && Y(t("⏯ ⏯ play: %s", Tt(e))), e.playing = !0;
|
|
815
|
-
let n = 0;
|
|
816
|
-
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), n < 0 && (e.playing = !1)), n;
|
|
813
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), -1) : (ne(e) && x(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", ht(e))), ut(e) && rt(e), jt(e, F.WALK_TOP2BOTTOM, lt, 0, 0));
|
|
817
814
|
}
|
|
818
815
|
function st(e) {
|
|
819
|
-
|
|
816
|
+
if (Ot(e)) return Vn(`gobj NULL or DESTROYED: ${Tt(e)}`), -1;
|
|
817
|
+
if (e.playing) return Vn(`${Tt(e)}: GObj ALREADY PLAYING`), -1;
|
|
818
|
+
if (e.disabled) return Vn(`${Tt(e)}: GObj DISABLED`), -1;
|
|
819
|
+
if (!ut(e)) {
|
|
820
|
+
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return Vn(`${Tt(e)}: Cannot play, start not done`), -1;
|
|
821
|
+
Mn(`${Tt(e)}: GObj playing without previous start`), Xe(e);
|
|
822
|
+
}
|
|
823
|
+
ne(e) && x(t("⏯ ⏯ play: %s", ht(e))), e.playing = !0;
|
|
824
|
+
let n = 0;
|
|
825
|
+
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), n < 0 && (e.playing = !1)), n;
|
|
820
826
|
}
|
|
821
827
|
function at(e) {
|
|
822
|
-
return
|
|
828
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), -1) : e.playing ? (ne(e) && x(t("⏸ ⏸ pause: %s", ht(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (Vn(`${Tt(e)}: GObj NOT PLAYING`), -1);
|
|
823
829
|
}
|
|
824
830
|
function ut(e) {
|
|
825
|
-
return
|
|
831
|
+
return !Ot(e) && e.running;
|
|
826
832
|
}
|
|
827
833
|
function _t(e) {
|
|
828
|
-
return !!(e
|
|
834
|
+
return !!Ot(e) || e.disabled;
|
|
829
835
|
}
|
|
830
836
|
function ct(e) {
|
|
831
|
-
return
|
|
837
|
+
return !!(e && e.gobj_flag & L.gobj_flag_service);
|
|
832
838
|
}
|
|
833
|
-
function ft() {
|
|
834
|
-
return !
|
|
839
|
+
function ft(e) {
|
|
840
|
+
return !Ot(e) && e.playing;
|
|
835
841
|
}
|
|
836
842
|
function gt() {
|
|
837
|
-
|
|
838
|
-
return e ? mt(e) : "";
|
|
843
|
+
return !E || E.obflag & P.obflag_destroyed ? null : E;
|
|
839
844
|
}
|
|
840
845
|
function dt() {
|
|
841
|
-
let e =
|
|
842
|
-
return e ?
|
|
846
|
+
let e = gt();
|
|
847
|
+
return e ? pt(e) : "";
|
|
843
848
|
}
|
|
844
849
|
function bt() {
|
|
845
|
-
let e =
|
|
846
|
-
return e ?
|
|
850
|
+
let e = gt();
|
|
851
|
+
return e ? Yt(e, "yuno_role") : "";
|
|
847
852
|
}
|
|
848
|
-
function mt(
|
|
849
|
-
|
|
853
|
+
function mt() {
|
|
854
|
+
let e = gt();
|
|
855
|
+
return e ? Yt(e, "yuno_id") : "";
|
|
850
856
|
}
|
|
851
857
|
function pt(e) {
|
|
852
|
-
return
|
|
858
|
+
return Er(e) ? e.gobj_name : (Vn("gobj bad type"), null);
|
|
853
859
|
}
|
|
854
860
|
function Et(e) {
|
|
855
|
-
return
|
|
861
|
+
return Er(e) ? e.gclass.gclass_name : (Vn("gobj NULL of bad type"), null);
|
|
856
862
|
}
|
|
857
863
|
function Tt(e) {
|
|
858
|
-
|
|
859
|
-
let t = Et(e), n = ht(e);
|
|
860
|
-
for (; n;) t = Et(n) + "`" + t, n = ht(n);
|
|
861
|
-
return t;
|
|
864
|
+
return Er(e) ? e.gclass.gclass_name + "^" + pt(e) : (Vn("gobj bad type"), null);
|
|
862
865
|
}
|
|
863
866
|
function ht(e) {
|
|
864
|
-
|
|
867
|
+
if (!Er(e)) return Vn("gobj NULL of bad type"), null;
|
|
868
|
+
let t = Tt(e), n = yt(e);
|
|
869
|
+
for (; n;) t = Tt(n) + "`" + t, n = yt(n);
|
|
870
|
+
return t;
|
|
865
871
|
}
|
|
866
872
|
function yt(e) {
|
|
867
|
-
return
|
|
873
|
+
return Er(e) ? e.parent : (Vn("gobj NULL of bad type"), null);
|
|
868
874
|
}
|
|
869
875
|
function St(e) {
|
|
870
|
-
return
|
|
871
|
-
}
|
|
872
|
-
function Ot(e) {
|
|
873
|
-
return !gr(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
876
|
+
return Er(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (Vn("gobj NULL of bad type"), null);
|
|
874
877
|
}
|
|
875
878
|
function vt(e) {
|
|
876
|
-
return
|
|
879
|
+
return Er(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (Vn("gobj NULL of bad type"), null);
|
|
877
880
|
}
|
|
878
|
-
function
|
|
879
|
-
|
|
880
|
-
|
|
881
|
+
function Ot(e) {
|
|
882
|
+
return !Er(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
883
|
+
}
|
|
884
|
+
function Nt(e) {
|
|
885
|
+
return Er(e) ? e.bottom_gobj : (Vn("gobj NULL of bad type"), null);
|
|
881
886
|
}
|
|
882
|
-
function Rt(e, t
|
|
883
|
-
|
|
887
|
+
function Rt(e, t) {
|
|
888
|
+
if (!Er(e)) return Vn("gobj NULL of bad type"), null;
|
|
889
|
+
e.bottom_gobj && Mn(`${Tt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
884
890
|
}
|
|
885
|
-
function Dt(e, t, n
|
|
886
|
-
return
|
|
891
|
+
function Dt(e, t, n) {
|
|
892
|
+
return Er(e) ? t ? he(e.gclass, t, n) : e.gclass.attrs_table : (Vn("gobj NULL of bad type"), null);
|
|
887
893
|
}
|
|
888
894
|
function wt(e, t, n, r, l) {
|
|
889
|
-
return Ot(e) ? (
|
|
895
|
+
return Ot(e) ? (Vn("gobj NULL, destroying, or bad type"), 0) : At(e.dl_children, t, n, r, l);
|
|
890
896
|
}
|
|
891
897
|
function jt(e, t, n, r, l) {
|
|
898
|
+
return Ot(e) ? (Vn("gobj NULL, destroying, or bad type"), 0) : $t(e.dl_children, t, n, r, l);
|
|
899
|
+
}
|
|
900
|
+
function At(e, t, n, r, l) {
|
|
892
901
|
let i, o = [...e];
|
|
893
902
|
if (t & F.WALK_LAST2FIRST) for (let e = o.length; e > 0; e--) {
|
|
894
903
|
i = o[e - 1];
|
|
@@ -902,50 +911,50 @@ function jt(e, t, n, r, l) {
|
|
|
902
911
|
}
|
|
903
912
|
return 0;
|
|
904
913
|
}
|
|
905
|
-
function
|
|
906
|
-
let i, o =
|
|
914
|
+
function It(e, t, n, r, l) {
|
|
915
|
+
let i, o = At(e, t, n, r, l);
|
|
907
916
|
if (o < 0) return o;
|
|
908
917
|
if (t & F.WALK_LAST2FIRST) {
|
|
909
|
-
for (let s = e.length; s > 0; s--) if (i = e[s - 1], o =
|
|
910
|
-
} else for (let s = 0; s < e.length; s++) if (i = e[s], o =
|
|
918
|
+
for (let s = e.length; s > 0; s--) if (i = e[s - 1], o = It([...i.dl_children], t, n, r, l), o < 0) return o;
|
|
919
|
+
} else for (let s = 0; s < e.length; s++) if (i = e[s], o = It([...i.dl_children], t, n, r, l), o < 0) return o;
|
|
911
920
|
return o;
|
|
912
921
|
}
|
|
913
|
-
function
|
|
914
|
-
if (t & F.WALK_BYLEVEL) return
|
|
922
|
+
function $t(e, t, n, r, l) {
|
|
923
|
+
if (t & F.WALK_BYLEVEL) return It(e, t, n, r, l);
|
|
915
924
|
let i, o;
|
|
916
925
|
if (t & F.WALK_BOTTOM2TOP) for (let s = e.length; s > 0; s--) {
|
|
917
|
-
if (o = e[s - 1], i =
|
|
926
|
+
if (o = e[s - 1], i = $t([...o.dl_children], t, n, r, l), i < 0) return i;
|
|
918
927
|
if (i = n(o, r, l), i < 0) return i;
|
|
919
928
|
}
|
|
920
929
|
else for (let s = 0; s < e.length; s++) {
|
|
921
930
|
if (o = e[s], i = n(o, r, l), i < 0) return i;
|
|
922
|
-
if (0 === i && (i =
|
|
931
|
+
if (0 === i && (i = $t([...o.dl_children], t, n, r, l), i < 0)) return i;
|
|
923
932
|
}
|
|
924
933
|
return 0;
|
|
925
934
|
}
|
|
926
|
-
function
|
|
927
|
-
if (
|
|
935
|
+
function kt(e, t) {
|
|
936
|
+
if (Tr(t)) return null;
|
|
928
937
|
const n = t.toLowerCase();
|
|
929
|
-
return "__default_service__" === n ? T : "__yuno__" === n || "__root__" === n ? E :
|
|
938
|
+
return "__default_service__" === n ? T : "__yuno__" === n || "__root__" === n ? E : Ft(E, t);
|
|
930
939
|
}
|
|
931
940
|
function Ct(e, t) {
|
|
932
|
-
if (!
|
|
941
|
+
if (!Er(e)) return Vn("gobj NULL of bad type"), !1;
|
|
933
942
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
934
943
|
t.__disabled__;
|
|
935
944
|
let i = t.__state__;
|
|
936
|
-
if (n && n !==
|
|
937
|
-
if (r && r !==
|
|
945
|
+
if (n && n !== Et(e)) return !1;
|
|
946
|
+
if (r && r !== pt(e)) return !1;
|
|
938
947
|
if (l) {
|
|
939
948
|
let t = l.length;
|
|
940
|
-
if (l !==
|
|
949
|
+
if (l !== pt(e).substring(0, t)) return !1;
|
|
941
950
|
}
|
|
942
|
-
if (i && i !==
|
|
951
|
+
if (i && i !== Zt(e)) return !1;
|
|
943
952
|
let o = e.jn_attrs;
|
|
944
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n &&
|
|
953
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && Gt(e, n) && o[n] !== t[n]) return !1;
|
|
945
954
|
return !0;
|
|
946
955
|
}
|
|
947
|
-
function
|
|
948
|
-
if (Ot(e)) return
|
|
956
|
+
function Lt(e, t) {
|
|
957
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), null;
|
|
949
958
|
const n = e.dl_children;
|
|
950
959
|
for (let e = 0; e < n.length; e++) {
|
|
951
960
|
const r = n[e];
|
|
@@ -953,8 +962,8 @@ function kt(e, t) {
|
|
|
953
962
|
}
|
|
954
963
|
return null;
|
|
955
964
|
}
|
|
956
|
-
function
|
|
957
|
-
if (Ot(e)) return
|
|
965
|
+
function Pt(e, t) {
|
|
966
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), null;
|
|
958
967
|
t = t || {};
|
|
959
968
|
let n = [];
|
|
960
969
|
const r = e.dl_children;
|
|
@@ -964,7 +973,7 @@ function Lt(e, t) {
|
|
|
964
973
|
}
|
|
965
974
|
return n;
|
|
966
975
|
}
|
|
967
|
-
function
|
|
976
|
+
function Ut(e, t) {
|
|
968
977
|
t = t || {};
|
|
969
978
|
let n = [];
|
|
970
979
|
return function e(n, r) {
|
|
@@ -975,146 +984,146 @@ function Pt(e, t) {
|
|
|
975
984
|
}
|
|
976
985
|
}(n, e), n;
|
|
977
986
|
}
|
|
978
|
-
function
|
|
987
|
+
function Ft(e, t) {
|
|
979
988
|
if (!t) return null;
|
|
980
989
|
let n = t.split("`");
|
|
981
990
|
if (!function(e, t) {
|
|
982
991
|
let n = t.split("^"), r = null, l = null;
|
|
983
992
|
if (2 === n.length) {
|
|
984
|
-
if (l = n[0], r = n[1], l !==
|
|
993
|
+
if (l = n[0], r = n[1], l !== Et(e)) return !1;
|
|
985
994
|
} else {
|
|
986
995
|
if (1 !== n.length) return !1;
|
|
987
996
|
r = n[0];
|
|
988
997
|
}
|
|
989
|
-
return r ===
|
|
998
|
+
return r === pt(e);
|
|
990
999
|
}(e, n[0])) return null;
|
|
991
1000
|
if (1 === n.length) return e;
|
|
992
1001
|
let r = n[1].split("^"), l = {};
|
|
993
1002
|
1 === r.length ? l.__gobj_name__ = r : (l.__gclass_name__ = r[0], l.__gobj_name__ = r[1]);
|
|
994
|
-
let i =
|
|
995
|
-
return i ? (n.splice(0, 1), n = n.join("`"),
|
|
1003
|
+
let i = Lt(e, l);
|
|
1004
|
+
return i ? (n.splice(0, 1), n = n.join("`"), Ft(i, n)) : null;
|
|
996
1005
|
}
|
|
997
|
-
function
|
|
998
|
-
return !
|
|
1006
|
+
function Gt(e, t) {
|
|
1007
|
+
return !Tr(t) && !!he(e.gclass, t, !1);
|
|
999
1008
|
}
|
|
1000
|
-
function
|
|
1009
|
+
function Vt(e, t, n) {
|
|
1001
1010
|
let r = e.jn_attrs;
|
|
1002
1011
|
if (t in r && r.hasOwnProperty(t)) {
|
|
1003
1012
|
let n = r[t];
|
|
1004
1013
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
1005
1014
|
}
|
|
1006
|
-
return
|
|
1015
|
+
return Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
1007
1016
|
}
|
|
1008
|
-
function
|
|
1017
|
+
function Mt(e, t, n) {
|
|
1009
1018
|
let r = {}, l = e.gclass.attrs_table;
|
|
1010
1019
|
for (let n = 0; n < l.length; n++) {
|
|
1011
1020
|
const i = l[n];
|
|
1012
1021
|
if (i.name && (-1 === t || i.flag & t)) {
|
|
1013
1022
|
let t;
|
|
1014
|
-
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t =
|
|
1023
|
+
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t = Xn(e.jn_attrs, i.name) : (t = e.gclass.gmt.mt_reading(e, i.name), void 0 === t && (t = Xn(e.jn_attrs, i.name))), er(r, i.name, t);
|
|
1015
1024
|
}
|
|
1016
1025
|
}
|
|
1017
1026
|
return r;
|
|
1018
1027
|
}
|
|
1019
|
-
function
|
|
1028
|
+
function Wt(e, t) {
|
|
1020
1029
|
if (t) {
|
|
1021
|
-
if (0 ===
|
|
1022
|
-
if (0 ===
|
|
1023
|
-
if (0 ===
|
|
1024
|
-
if (0 ===
|
|
1030
|
+
if (0 === vr(t, "__disabled__")) return _t(e);
|
|
1031
|
+
if (0 === vr(t, "__running__")) return ut(e);
|
|
1032
|
+
if (0 === vr(t, "__playing__")) return ft(e);
|
|
1033
|
+
if (0 === vr(t, "__service__")) return ct(e);
|
|
1025
1034
|
}
|
|
1026
|
-
let n =
|
|
1027
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1028
|
-
}
|
|
1029
|
-
function Wt(e, t) {
|
|
1030
|
-
t && Er(t, "__trace_level__");
|
|
1031
|
-
let n = Ee(e, t, !1);
|
|
1032
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Jn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ln(`${Et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1035
|
+
let n = Te(e, t, !1);
|
|
1036
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1033
1037
|
}
|
|
1034
1038
|
function Kt(e, t) {
|
|
1035
|
-
|
|
1036
|
-
let n =
|
|
1037
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1039
|
+
t && vr(t, "__trace_level__");
|
|
1040
|
+
let n = Te(e, t, !1);
|
|
1041
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1042
|
+
}
|
|
1043
|
+
function Yt(e, t) {
|
|
1044
|
+
if (t && 0 === vr(t, "__state__")) return Zt(e);
|
|
1045
|
+
let n = Te(e, t, !1);
|
|
1046
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1038
1047
|
}
|
|
1039
1048
|
function xt(e, t) {
|
|
1040
|
-
let n =
|
|
1041
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1049
|
+
let n = Te(e, t, !1);
|
|
1050
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1042
1051
|
}
|
|
1043
|
-
function
|
|
1044
|
-
if (!
|
|
1052
|
+
function Bt(e, n, r, l) {
|
|
1053
|
+
if (!cr(n)) return Vn(t("gobj_write_attr(%s): path must be a string", Tt(e))), -1;
|
|
1045
1054
|
let i, o = e.jn_attrs, s = n.split("`");
|
|
1046
1055
|
if (s.length <= 1) {
|
|
1047
1056
|
let l = n;
|
|
1048
|
-
return l in o && o.hasOwnProperty(l) ? (o[l] = r,
|
|
1057
|
+
return l in o && o.hasOwnProperty(l) ? (o[l] = r, ur(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (Vn(t("gobj_write_attr(%s): attr not found '%s'", Tt(e), l)), -1);
|
|
1049
1058
|
}
|
|
1050
1059
|
let a = s.length;
|
|
1051
1060
|
for (let t = 0; t < a; t++) {
|
|
1052
1061
|
i = s[t];
|
|
1053
|
-
let n =
|
|
1062
|
+
let n = Lt(e, { __gobj_name__: i });
|
|
1054
1063
|
if (n && t < a - 1) {
|
|
1055
1064
|
e = n;
|
|
1056
1065
|
continue;
|
|
1057
1066
|
}
|
|
1058
1067
|
let l = e.jn_attrs;
|
|
1059
|
-
if (i in l && l.hasOwnProperty(i)) return l[i] = r,
|
|
1068
|
+
if (i in l && l.hasOwnProperty(i)) return l[i] = r, ur(e.priv) && e.priv.hasOwnProperty(i) && (e.priv[i] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.mt_writing && e.mt_writing(e, i), 0;
|
|
1060
1069
|
break;
|
|
1061
1070
|
}
|
|
1062
|
-
return
|
|
1071
|
+
return Vn(t("gobj_write_attr(%s): attr not found '%s'", Tt(e), i)), -1;
|
|
1063
1072
|
}
|
|
1064
|
-
function
|
|
1073
|
+
function Jt(e) {
|
|
1065
1074
|
return function(e, t, n) {
|
|
1066
|
-
if (Ot(e)) return
|
|
1075
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), -1;
|
|
1067
1076
|
let r = e.gclass.attrs_table;
|
|
1068
1077
|
for (let l = 0; l < r.length; l++) {
|
|
1069
1078
|
const i = r[l];
|
|
1070
1079
|
if (i.name && !(n && i.flag & n) && (-1 === t || i.flag & t)) {
|
|
1071
|
-
const t =
|
|
1072
|
-
|
|
1080
|
+
const t = me(e, e.jn_attrs, i);
|
|
1081
|
+
ur(e.priv) && e.priv.hasOwnProperty(i.name) && (e.priv[i.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, i.name);
|
|
1073
1082
|
}
|
|
1074
1083
|
}
|
|
1075
1084
|
return 0;
|
|
1076
1085
|
}(e, S.SDF_VOLATIL, 0);
|
|
1077
1086
|
}
|
|
1078
|
-
function
|
|
1079
|
-
let l =
|
|
1087
|
+
function qt(e, t, n, r) {
|
|
1088
|
+
let l = Ee(e), i = 0;
|
|
1080
1089
|
for (const [r, o] of Object.entries(t)) {
|
|
1081
|
-
let t =
|
|
1082
|
-
t && (-1 === n || t.flag & n) && (i +=
|
|
1090
|
+
let t = Dt(e, r, !0);
|
|
1091
|
+
t && (-1 === n || t.flag & n) && (i += pe(e, l, t, o));
|
|
1083
1092
|
}
|
|
1084
1093
|
return i;
|
|
1085
1094
|
}
|
|
1086
|
-
function qt(e, t, n) {
|
|
1087
|
-
let r = Ee(e, t, !1);
|
|
1088
|
-
return r ? (r[t] = br(n), lr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Ln(`${Et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1089
|
-
}
|
|
1090
1095
|
function Ht(e, t, n) {
|
|
1091
|
-
let r =
|
|
1092
|
-
return r ? (r[t] =
|
|
1096
|
+
let r = Te(e, t, !1);
|
|
1097
|
+
return r ? (r[t] = hr(n), ur(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1093
1098
|
}
|
|
1094
1099
|
function Qt(e, t, n) {
|
|
1095
|
-
let r =
|
|
1096
|
-
return r ? (r[t] =
|
|
1100
|
+
let r = Te(e, t, !1);
|
|
1101
|
+
return r ? (r[t] = parseInt(n), ur(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1102
|
+
}
|
|
1103
|
+
function zt(e, t, n) {
|
|
1104
|
+
let r = Te(e, t, !1);
|
|
1105
|
+
return r ? (r[t] = String(n), ur(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Vn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1097
1106
|
}
|
|
1098
|
-
function
|
|
1099
|
-
if (Ot(e)) return
|
|
1107
|
+
function Xt(e, n) {
|
|
1108
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), null;
|
|
1100
1109
|
if (e.current_state.state_name === n) return !1;
|
|
1101
|
-
let r =
|
|
1102
|
-
if (!r) return
|
|
1110
|
+
let r = ve(e.gclass, n);
|
|
1111
|
+
if (!r) return Vn(`${Tt(e)}: state unknown, state ${n}`), !1;
|
|
1103
1112
|
e.last_state = e.current_state, e.current_state = r;
|
|
1104
1113
|
let l = re(e, "EV_STATE_CHANGED"), i = !!function(e) {
|
|
1105
1114
|
return X(e) & B.TRACE_STATES;
|
|
1106
1115
|
}(e);
|
|
1107
|
-
return (l || i) &&
|
|
1116
|
+
return (l || i) && x(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Et(e), pt(e), Zt(e), e.last_state.state_name)), !0;
|
|
1108
1117
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return
|
|
1118
|
+
function Zt(e) {
|
|
1119
|
+
return Er(e) ? e.current_state.state_name : (Vn("hgobj NULL"), "");
|
|
1111
1120
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return Ot(e) ? (
|
|
1121
|
+
function en(e, n) {
|
|
1122
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), null) : n instanceof k ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (Ue(e.parent, e), e.parent = null), Pe(n, e), n.mt_child_added && (te(e) && Kn(t("👦👦🔵 child_added(%s): %s", ht(n), Tt(e))), n.mt_child_added(n, e)), 0) : (Vn(`${Tt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
1114
1123
|
}
|
|
1115
|
-
function
|
|
1116
|
-
if (!
|
|
1117
|
-
let r =
|
|
1124
|
+
function tn(e, t, n) {
|
|
1125
|
+
if (!Er(e)) return Vn("gobj NULL of bad type"), null;
|
|
1126
|
+
let r = je(e.gclass, t);
|
|
1118
1127
|
if (r) return r;
|
|
1119
1128
|
if (n) {
|
|
1120
1129
|
const e = b.length, n = b;
|
|
@@ -1125,52 +1134,62 @@ function en(e, t, n) {
|
|
|
1125
1134
|
}
|
|
1126
1135
|
return null;
|
|
1127
1136
|
}
|
|
1128
|
-
function
|
|
1129
|
-
let r =
|
|
1137
|
+
function nn(e, t, n) {
|
|
1138
|
+
let r = tn(e, t, !1);
|
|
1130
1139
|
return !!r && !(n && !(r.event_flag & n));
|
|
1131
1140
|
}
|
|
1132
|
-
function
|
|
1133
|
-
let r =
|
|
1141
|
+
function rn(e, t, n) {
|
|
1142
|
+
let r = tn(e, t, !1);
|
|
1134
1143
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & U.EVF_OUTPUT_EVENT);
|
|
1135
1144
|
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1145
|
+
var ln = [], on = !1;
|
|
1146
|
+
function sn(e, n, r, l) {
|
|
1147
|
+
return e && e instanceof k ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (Vn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : Tr(n) ? (Vn("gobj_post_event(): event EMPTY"), -1) : nn(e, n, 0) ? ln.length >= 1e4 ? (Vn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${ln.length}`), -1) : (ln.push({
|
|
1148
|
+
dst: e,
|
|
1149
|
+
event: n,
|
|
1150
|
+
kw: r,
|
|
1151
|
+
src: l
|
|
1152
|
+
}), re(e, n) && !le(l, n) && x(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Tt(e), n, ln.length)), on || (on = !0, setTimeout(un, 0)), 0) : (Vn(`gobj_post_event(): event NOT DEFINED in gclass ${Et(e)}, event ${n}`), -1) : (Vn(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
1153
|
+
}
|
|
1154
|
+
function an() {
|
|
1155
|
+
return ln.length;
|
|
1156
|
+
}
|
|
1157
|
+
function un() {
|
|
1158
|
+
on = !1;
|
|
1159
|
+
let e = ln;
|
|
1160
|
+
ln = [];
|
|
1161
|
+
let t = 0;
|
|
1162
|
+
for (let n of e) n.dst.obflag & (P.obflag_destroyed | P.obflag_destroying) || (_n(n.dst, n.event, n.kw, n.src), t++);
|
|
1163
|
+
return ln.length > 0 && !on && (on = !0, setTimeout(un, 0)), t;
|
|
1140
1164
|
}
|
|
1141
|
-
function
|
|
1142
|
-
if (!(e && e instanceof
|
|
1143
|
-
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return
|
|
1165
|
+
function _n(e, n, r, l) {
|
|
1166
|
+
if (!(e && e instanceof k)) return Vn("gobj dst NULL"), -1;
|
|
1167
|
+
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return Vn("gobj dst DESTROYED"), -1;
|
|
1144
1168
|
let i = e.current_state;
|
|
1145
|
-
if (!i) return
|
|
1146
|
-
let o = re(e, n) && !
|
|
1147
|
-
if (Q > 1) return !1;
|
|
1148
|
-
if (!e) return !0;
|
|
1149
|
-
const n = Z(e);
|
|
1150
|
-
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
1151
|
-
}(l, n);
|
|
1169
|
+
if (!i) return Vn(`${Tt(e)}: current_state NULL`), -1;
|
|
1170
|
+
let o = re(e, n) && !le(l, n);
|
|
1152
1171
|
h++;
|
|
1153
1172
|
let s = Oe(i, n);
|
|
1154
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (h--, o && (
|
|
1173
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (h--, o && (x(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Tt(e), i.state_name, n || "", l && !l.running ? "!!" : "", Tt(l))), r && o > 1 && or(r) && xn(r)), e.gclass.gmt.mt_inject_event(e, n, r, l)) : (o && x(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Et(e), pt(e), i.state_name, n || "", l && !l.running ? "!!" : "", Et(l), pt(l))), Vn(`📛📛 Event NOT DEFINED in state 📛📛: ${Tt(e)}, ${i.state_name}, ${n}`), h--, -1);
|
|
1155
1174
|
if (o) {
|
|
1156
|
-
if (1 === W)
|
|
1175
|
+
if (1 === W) x(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Tt(e), i.state_name, l && !l.running ? "!!" : "", Tt(l)));
|
|
1157
1176
|
else {
|
|
1158
1177
|
let r = "";
|
|
1159
|
-
s.action && (r =
|
|
1178
|
+
s.action && (r = Vl(s.action)), x(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Et(e), pt(e), i.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", Et(l), pt(l)));
|
|
1160
1179
|
}
|
|
1161
|
-
r && (X(e) | ee()) & B.TRACE_EV_KW &&
|
|
1180
|
+
r && (X(e) | ee()) & B.TRACE_EV_KW && or(r) && xn(r);
|
|
1162
1181
|
}
|
|
1163
|
-
s.next_state &&
|
|
1182
|
+
s.next_state && Xt(e, s.next_state);
|
|
1164
1183
|
let a = -1;
|
|
1165
1184
|
try {
|
|
1166
1185
|
s.action && (a = s.action(e, n, r, l));
|
|
1167
1186
|
} finally {}
|
|
1168
|
-
return !o || 1 === W || e.obflag & P.obflag_destroyed ||
|
|
1187
|
+
return !o || 1 === W || e.obflag & P.obflag_destroyed || x(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Et(e), pt(e), e.current_state.state_name, n || "", fr(a) ? a : 0)), h--, a;
|
|
1169
1188
|
}
|
|
1170
|
-
var
|
|
1189
|
+
var cn = Object.freeze({
|
|
1171
1190
|
__hard_subscription__: 1,
|
|
1172
1191
|
__own_event__: 2
|
|
1173
|
-
}),
|
|
1192
|
+
}), fn = [
|
|
1174
1193
|
N(y.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1175
1194
|
N(y.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1176
1195
|
N(y.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1181,51 +1200,51 @@ var on = Object.freeze({
|
|
|
1181
1200
|
N(y.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1182
1201
|
N(y.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1183
1202
|
N(y.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1184
|
-
|
|
1203
|
+
O()
|
|
1185
1204
|
];
|
|
1186
|
-
function
|
|
1187
|
-
let i =
|
|
1188
|
-
if (t && t !==
|
|
1189
|
-
let t =
|
|
1190
|
-
|
|
1205
|
+
function gn(e, t, n, r, l) {
|
|
1206
|
+
let i = Ur(t, r, "__config__", null), o = Ur(t, r, "__global__", null), s = Ur(t, r, "__local__", null), a = Fr(t, r, "__filter__", null), u = !0;
|
|
1207
|
+
if (t && t !== Pr(null, e, "publisher", null) && (u = !1), l && l !== Pr(null, e, "subscriber", null) && (u = !1), n && n !== Lr(null, e, "event", "") && (u = !1), ar(i) > 0) {
|
|
1208
|
+
let t = Ur(null, e, "__config__", null);
|
|
1209
|
+
ar(t) > 0 && qn(t, i) || (u = !1);
|
|
1191
1210
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
let t =
|
|
1194
|
-
|
|
1211
|
+
if (ar(o) > 0) {
|
|
1212
|
+
let t = Ur(null, e, "__global__", null);
|
|
1213
|
+
ar(t) > 0 && qn(t, o) || (u = !1);
|
|
1195
1214
|
}
|
|
1196
|
-
if (
|
|
1197
|
-
let t =
|
|
1198
|
-
|
|
1215
|
+
if (ar(s) > 0) {
|
|
1216
|
+
let t = Ur(null, e, "__local__", null);
|
|
1217
|
+
ar(t) > 0 && qn(t, s) || (u = !1);
|
|
1199
1218
|
}
|
|
1200
|
-
if (
|
|
1201
|
-
let t =
|
|
1202
|
-
|
|
1219
|
+
if (ar(a) > 0) {
|
|
1220
|
+
let t = Fr(null, e, "__filter__", null);
|
|
1221
|
+
ar(t) > 0 && qn(t, a) || (u = !1);
|
|
1203
1222
|
}
|
|
1204
1223
|
return u;
|
|
1205
1224
|
}
|
|
1206
|
-
function
|
|
1225
|
+
function dn(e, t, n, r, l) {
|
|
1207
1226
|
let i = [];
|
|
1208
1227
|
for (let o = 0; o < e.length; o++) {
|
|
1209
1228
|
let s = e[o];
|
|
1210
|
-
|
|
1229
|
+
gn(s, t, n, r, l) && nr(i, s);
|
|
1211
1230
|
}
|
|
1212
1231
|
return i;
|
|
1213
1232
|
}
|
|
1214
|
-
function
|
|
1215
|
-
for (let i = 0; i < e.length; i++) if (
|
|
1233
|
+
function bn(e, t, n, r, l) {
|
|
1234
|
+
for (let i = 0; i < e.length; i++) if (gn(e[i], t, n, r, l)) return i;
|
|
1216
1235
|
return -1;
|
|
1217
1236
|
}
|
|
1218
|
-
function
|
|
1219
|
-
let i =
|
|
1220
|
-
if (!!(
|
|
1221
|
-
E &&
|
|
1222
|
-
let a =
|
|
1223
|
-
return a >= 0 ?
|
|
1224
|
-
}
|
|
1225
|
-
function
|
|
1226
|
-
if (null == r && (r = {}), !e) return
|
|
1227
|
-
if (!l) return
|
|
1228
|
-
const i = new Set([
|
|
1237
|
+
function mn(e, n, r, l) {
|
|
1238
|
+
let i = Pr(e, n, "publisher", null, Rn.KW_REQUIRED), o = Pr(e, n, "subscriber", null, Rn.KW_REQUIRED), s = Lr(e, n, "event", "", Rn.KW_REQUIRED);
|
|
1239
|
+
if (!!(kr(e, n, "subs_flag", null, Rn.KW_REQUIRED) & cn.__hard_subscription__) && !r) return -1;
|
|
1240
|
+
E && Wt(E, "trace_subscriptions") && (x(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Tt(i), Tt(o))), xn(n)), i.obflag & P.obflag_destroyed || l || i.gclass.gmt.mt_subscription_deleted && i.gclass.gmt.mt_subscription_deleted(i, n);
|
|
1241
|
+
let a = bn(i.dl_subscriptions, i, s, n, o);
|
|
1242
|
+
return a >= 0 ? lr(i.dl_subscriptions, a) : (Vn(`${Tt(e)}: subscription in publisher not found`), xn(n)), a = bn(o.dl_subscribings, i, s, n, o), a >= 0 ? lr(o.dl_subscribings, a) : (Vn(`${Tt(e)}: subscription in subscriber not found`), xn(n)), 0;
|
|
1243
|
+
}
|
|
1244
|
+
function pn(e, n, r, l) {
|
|
1245
|
+
if (null == r && (r = {}), !e) return Vn(`publisher NULL: ev ${n}`), 0;
|
|
1246
|
+
if (!l) return Vn(`subscriber NULL: ev ${n}`), 0;
|
|
1247
|
+
const i = /* @__PURE__ */ new Set([
|
|
1229
1248
|
"__config__",
|
|
1230
1249
|
"__global__",
|
|
1231
1250
|
"__local__",
|
|
@@ -1233,38 +1252,38 @@ function fn(e, n, r, l) {
|
|
|
1233
1252
|
"__service__"
|
|
1234
1253
|
]);
|
|
1235
1254
|
if (Object.keys(r).forEach((t) => {
|
|
1236
|
-
i.has(t) ||
|
|
1237
|
-
}),
|
|
1238
|
-
else if (!(
|
|
1239
|
-
let o =
|
|
1240
|
-
|
|
1255
|
+
i.has(t) || Vn(`${Tt(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1256
|
+
}), Tr(n)) n = "";
|
|
1257
|
+
else if (!(rn(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return Vn(`event NOT in output event list: ${Tt(e)}, ${n}`), 0;
|
|
1258
|
+
let o = dn(e.dl_subscriptions, e, n, r, l);
|
|
1259
|
+
sr(o) > 0 && (Vn(`${Tt(e)}: ${sr(o)} subscription(s) REPEATED, will be deleted and override`), xn(o, "subscription REPEATED"), Tn(e, o, !1));
|
|
1241
1260
|
let s = function(e, t, n, r) {
|
|
1242
|
-
let l =
|
|
1243
|
-
|
|
1261
|
+
let l = be(e, fn);
|
|
1262
|
+
tr(l, "event", t), tr(l, "subscriber", r), tr(l, "publisher", e);
|
|
1244
1263
|
let i = 0;
|
|
1245
1264
|
if (n) {
|
|
1246
|
-
let t =
|
|
1247
|
-
if (
|
|
1248
|
-
let n =
|
|
1249
|
-
if (
|
|
1250
|
-
let t =
|
|
1251
|
-
|
|
1265
|
+
let t = Ur(e, n, "__config__", null), r = Ur(e, n, "__global__", null), o = Ur(e, n, "__local__", null), s = Fr(e, n, "__filter__", null), a = Lr(e, n, "__service__", "");
|
|
1266
|
+
if (ar(r) > 0 && tr(l, "__global__", Bn(r)), ar(t) > 0) {
|
|
1267
|
+
let n = Bn(t);
|
|
1268
|
+
if (tr(l, "__config__", n), jr(n, "__hard_subscription__")) {
|
|
1269
|
+
let t = $r(e, n, "__hard_subscription__", !1);
|
|
1270
|
+
Zn(n, "__hard_subscription__"), t && (i |= cn.__hard_subscription__);
|
|
1252
1271
|
}
|
|
1253
|
-
if (
|
|
1254
|
-
let t =
|
|
1255
|
-
|
|
1272
|
+
if (jr(n, "__own_event__")) {
|
|
1273
|
+
let t = $r(e, n, "__own_event__", !1);
|
|
1274
|
+
Zn(n, "__own_event__"), t && (i |= cn.__own_event__);
|
|
1256
1275
|
}
|
|
1257
1276
|
}
|
|
1258
|
-
|
|
1277
|
+
ar(o) > 0 && tr(l, "__local__", Bn(o)), ar(s) > 0 && tr(l, "__filter__", Bn(s)), Tr(a) || tr(l, "__service__", a);
|
|
1259
1278
|
}
|
|
1260
|
-
return
|
|
1279
|
+
return tr(l, "subs_flag", i), l;
|
|
1261
1280
|
}(e, n, r, l);
|
|
1262
|
-
return s ? (
|
|
1281
|
+
return s ? (nr(e.dl_subscriptions, s), nr(l.dl_subscribings, s), E && Wt(E, "trace_subscriptions") && (x(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Tt(e), Tt(l))), r && xn(r)), e.gclass.gmt.mt_subscription_added && e.gclass.gmt.mt_subscription_added(e, s) < 0 && (mn(e, s, !0, !0), s = 0), s) : (Vn(`${Tt(e)}: _create_subscription() FAILED`), 0);
|
|
1263
1282
|
}
|
|
1264
|
-
function
|
|
1265
|
-
if (null == n && (n = {}), !e) return
|
|
1266
|
-
if (!r) return
|
|
1267
|
-
const l = new Set([
|
|
1283
|
+
function En(e, t, n, r) {
|
|
1284
|
+
if (null == n && (n = {}), !e) return Vn(`publisher NULL: ev ${t}`), 0;
|
|
1285
|
+
if (!r) return Vn(`subscriber NULL: ev ${t}`), 0;
|
|
1286
|
+
const l = /* @__PURE__ */ new Set([
|
|
1268
1287
|
"__config__",
|
|
1269
1288
|
"__global__",
|
|
1270
1289
|
"__local__",
|
|
@@ -1272,52 +1291,52 @@ function gn(e, t, n, r) {
|
|
|
1272
1291
|
"__service__"
|
|
1273
1292
|
]);
|
|
1274
1293
|
if (Object.keys(n).forEach((n) => {
|
|
1275
|
-
l.has(n) ||
|
|
1276
|
-
}),
|
|
1277
|
-
else if (!(
|
|
1278
|
-
let i =
|
|
1294
|
+
l.has(n) || Vn(`${Tt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1295
|
+
}), Tr(t)) t = "";
|
|
1296
|
+
else if (!(rn(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return Vn(`event NOT in output event list: ${Tt(e)}, ev ${t}`), 0;
|
|
1297
|
+
let i = dn(e.dl_subscriptions, e, t, n, r), o = 0;
|
|
1279
1298
|
for (let t = 0; t < i.length; t++) {
|
|
1280
1299
|
let n = i[t];
|
|
1281
|
-
|
|
1300
|
+
mn(e, n, !1, !1), o++;
|
|
1282
1301
|
}
|
|
1283
|
-
return o || (
|
|
1302
|
+
return o || (Mn(`${Tt(e)}: No subscription found`), xn(n, "No subscription found")), 0;
|
|
1284
1303
|
}
|
|
1285
|
-
function
|
|
1304
|
+
function Tn(e, t, n) {
|
|
1286
1305
|
let r = [...t];
|
|
1287
|
-
for (let t = 0; t < r.length; t++)
|
|
1306
|
+
for (let t = 0; t < r.length; t++) mn(e, r[t], n, !1);
|
|
1288
1307
|
return 0;
|
|
1289
1308
|
}
|
|
1290
|
-
function
|
|
1291
|
-
return null == n && (n = {}),
|
|
1309
|
+
function hn(e, t, n, r) {
|
|
1310
|
+
return null == n && (n = {}), dn(e.dl_subscriptions, e, t, n, r);
|
|
1292
1311
|
}
|
|
1293
|
-
function
|
|
1294
|
-
let t =
|
|
1312
|
+
function yn(e) {
|
|
1313
|
+
let t = hn(e, null, null, null);
|
|
1295
1314
|
for (let n = 0; n < t.length; n++) {
|
|
1296
|
-
let r = t[n], l =
|
|
1297
|
-
|
|
1315
|
+
let r = t[n], l = Pr(e, r, "publisher", null, Rn.KW_REQUIRED), i = Pr(e, r, "subscriber", null, Rn.KW_REQUIRED);
|
|
1316
|
+
tr(r, "s_event", Lr(e, r, "event", "", Rn.KW_REQUIRED)), tr(r, "s_publisher", Tt(l)), tr(r, "s_subscriber", Tt(i));
|
|
1298
1317
|
}
|
|
1299
|
-
let n =
|
|
1318
|
+
let n = Sn(e, 0, null, 0);
|
|
1300
1319
|
for (let t = 0; t < n.length; t++) {
|
|
1301
|
-
let r = n[t], l =
|
|
1302
|
-
|
|
1320
|
+
let r = n[t], l = Pr(e, r, "publisher", null, Rn.KW_REQUIRED), i = Pr(e, r, "subscriber", null, Rn.KW_REQUIRED);
|
|
1321
|
+
tr(r, "s_event", Lr(e, r, "event", "", Rn.KW_REQUIRED)), tr(r, "s_publisher", Tt(l)), tr(r, "s_subscriber", Tt(i));
|
|
1303
1322
|
}
|
|
1304
1323
|
return {
|
|
1305
1324
|
subscriptions: t,
|
|
1306
1325
|
subscribings: n,
|
|
1307
|
-
"total subscriptions":
|
|
1308
|
-
total_subscribings:
|
|
1326
|
+
"total subscriptions": sr(t),
|
|
1327
|
+
total_subscribings: sr(n)
|
|
1309
1328
|
};
|
|
1310
1329
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return
|
|
1330
|
+
function Sn(e, t, n, r) {
|
|
1331
|
+
return dn(e.dl_subscribings, r, t, n, e);
|
|
1313
1332
|
}
|
|
1314
|
-
function
|
|
1315
|
-
if (
|
|
1316
|
-
if (
|
|
1317
|
-
let l =
|
|
1318
|
-
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1319
|
-
let i = E &&
|
|
1320
|
-
if (i && (
|
|
1333
|
+
function vn(e, n, r) {
|
|
1334
|
+
if (ur(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return Vn("gobj NULL or DESTROYED"), -1;
|
|
1335
|
+
if (Tr(n)) return Vn(`${Tt(e)}: event EMPTY`), -1;
|
|
1336
|
+
let l = tn(e, n, !0);
|
|
1337
|
+
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return Vn(`event NOT in output event list: ${Tt(e)}, ev ${n}`), -1;
|
|
1338
|
+
let i = E && Wt(E, "trace_subscriptions");
|
|
1339
|
+
if (i && (x(t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Et(e), pt(e), e.current_state.state_name, "", n || "", "")), xn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1321
1340
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1322
1341
|
if (t <= 0) return t;
|
|
1323
1342
|
}
|
|
@@ -1329,36 +1348,36 @@ function En(e, n, r) {
|
|
|
1329
1348
|
if (t < 0) break;
|
|
1330
1349
|
if (0 === t) continue;
|
|
1331
1350
|
}
|
|
1332
|
-
let _ =
|
|
1351
|
+
let _ = Pr(e, u, "subscriber", null, Rn.KW_REQUIRED);
|
|
1333
1352
|
if (!_ || Ot(_)) continue;
|
|
1334
|
-
let c =
|
|
1335
|
-
if (
|
|
1336
|
-
|
|
1337
|
-
let l =
|
|
1338
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) :
|
|
1353
|
+
let c = kr(e, u, "subs_flag", 0, Rn.KW_REQUIRED), f = Lr(e, u, "event", "", Rn.KW_REQUIRED);
|
|
1354
|
+
if (Tr(f) || 0 === vr(f, n)) {
|
|
1355
|
+
Ur(e, u, "__config__", null, 0);
|
|
1356
|
+
let l = Ur(e, u, "__global__", null, 0), o = Ur(e, u, "__local__", null, 0), f = Fr(e, u, "__filter__", null, 0), g = r, d = 1;
|
|
1357
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) : ar(f) > 0 && (d = Kr(g, f), i && (x(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", Tt(_), Tt(e))), xn(f))), d < 0) break;
|
|
1339
1358
|
if (0 === d) continue;
|
|
1340
|
-
let b =
|
|
1341
|
-
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !
|
|
1342
|
-
o &&
|
|
1343
|
-
let m =
|
|
1344
|
-
if (m < 0 && c &
|
|
1359
|
+
let b = tn(_, n, !0);
|
|
1360
|
+
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !nn(_, b.event_name, 0)) continue;
|
|
1361
|
+
o && wr(g, o), l && Hn(g, l), i && (x(t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", _.running ? "" : "!!", Tt(_), Zt(_), n || "", e && !e.running ? "!!" : "", Tt(e))), xn(g));
|
|
1362
|
+
let m = _n(_, n, g, e);
|
|
1363
|
+
if (m < 0 && c & cn.__own_event__) {
|
|
1345
1364
|
s = -1;
|
|
1346
1365
|
break;
|
|
1347
1366
|
}
|
|
1348
1367
|
if (a += m, s++, Ot(e)) break;
|
|
1349
1368
|
}
|
|
1350
1369
|
}
|
|
1351
|
-
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS ||
|
|
1370
|
+
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS || Mn(`${Tt(e)}: Publish event WITHOUT subscribers, ev ${n}`), a;
|
|
1352
1371
|
}
|
|
1353
|
-
function
|
|
1354
|
-
if (Ot(e)) return
|
|
1355
|
-
let o = E &&
|
|
1356
|
-
return o && (
|
|
1372
|
+
function On(e, n, r, l) {
|
|
1373
|
+
if (Ot(e)) return Vn("gobj NULL or DESTROYED"), -1;
|
|
1374
|
+
let o = E && Kt(E, "tracing");
|
|
1375
|
+
return o && (x(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", ut(e) ? "" : "!!", Tt(e), n, Tt(l))), o > 1 && xn(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, r, l) : e.gclass.command_table ? g ? g(e, n, r, l) : i(0, -1, t("%s: global command parser not available", Tt(e)), 0, 0) : i(0, -1, t("%s: command table not available", Tt(e)), 0, 0);
|
|
1357
1376
|
}
|
|
1358
|
-
function
|
|
1359
|
-
return Ot(e) ? (
|
|
1377
|
+
function Nn(e, n, r, l) {
|
|
1378
|
+
return Ot(e) ? (Vn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, l) : d ? d(e, n, r, l) : s(0, -1, t("%s, stats parser not available", Tt(e)), 0, 0);
|
|
1360
1379
|
}
|
|
1361
|
-
var
|
|
1380
|
+
var Rn = Object.freeze({
|
|
1362
1381
|
KW_REQUIRED: 1,
|
|
1363
1382
|
KW_CREATE: 2,
|
|
1364
1383
|
KW_WILD_NUMBER: 4,
|
|
@@ -1367,7 +1386,8 @@ var yn = Object.freeze({
|
|
|
1367
1386
|
KW_VERBOSE: 32,
|
|
1368
1387
|
KW_LOWER: 64,
|
|
1369
1388
|
KW_RECURSIVE: 128
|
|
1370
|
-
})
|
|
1389
|
+
});
|
|
1390
|
+
Object.freeze({
|
|
1371
1391
|
JSON_OBJECT: 1,
|
|
1372
1392
|
JSON_ARRAY: 2,
|
|
1373
1393
|
JSON_STRING: 3,
|
|
@@ -1376,29 +1396,30 @@ var yn = Object.freeze({
|
|
|
1376
1396
|
JSON_TRUE: 6,
|
|
1377
1397
|
JSON_FALSE: 7,
|
|
1378
1398
|
JSON_NULL: 8
|
|
1379
|
-
})
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1399
|
+
});
|
|
1400
|
+
var Dn = "undefined" != typeof window ? window.console : console, wn = Dn.error, jn = Dn.warn, An = Dn.info, In = Dn.debug, $n = null;
|
|
1401
|
+
function kn(e) {
|
|
1402
|
+
$n = "function" == typeof e ? e : null;
|
|
1403
|
+
}
|
|
1404
|
+
var Cn = !0;
|
|
1405
|
+
function Ln(e) {
|
|
1406
|
+
Cn = !!e;
|
|
1407
|
+
}
|
|
1408
|
+
var Pn = !1;
|
|
1409
|
+
function Un(e, t, n) {
|
|
1410
|
+
if ($n && !Pn) {
|
|
1411
|
+
Pn = !0;
|
|
1391
1412
|
try {
|
|
1392
|
-
|
|
1413
|
+
$n(e, t, n);
|
|
1393
1414
|
} catch (e) {} finally {
|
|
1394
|
-
|
|
1415
|
+
Pn = !1;
|
|
1395
1416
|
}
|
|
1396
1417
|
}
|
|
1397
1418
|
}
|
|
1398
|
-
function
|
|
1399
|
-
e ? (
|
|
1419
|
+
function Fn(e) {
|
|
1420
|
+
e ? (wn = e, jn = e) : (wn = Dn.error, jn = Dn.warn);
|
|
1400
1421
|
}
|
|
1401
|
-
function
|
|
1422
|
+
function Gn(e) {
|
|
1402
1423
|
const t = Array.prototype.slice.call(arguments);
|
|
1403
1424
|
let n = "";
|
|
1404
1425
|
if ("string" == typeof e) {
|
|
@@ -1420,33 +1441,33 @@ function kn(e) {
|
|
|
1420
1441
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1421
1442
|
return n;
|
|
1422
1443
|
}
|
|
1423
|
-
function
|
|
1424
|
-
let t =
|
|
1425
|
-
|
|
1444
|
+
function Vn(e) {
|
|
1445
|
+
let t = Gn(e), n = Ll();
|
|
1446
|
+
wn && (wn === Dn.error ? Cn && wn("%c" + n + " ERROR: " + String(t), "color:red") : (Cn && Dn.error("%c" + n + " ERROR: " + String(t), "color:red"), wn(`${n} ERROR: ${String(t)}`))), Un("error", t, n);
|
|
1426
1447
|
}
|
|
1427
|
-
function
|
|
1428
|
-
let t =
|
|
1429
|
-
|
|
1448
|
+
function Mn(e) {
|
|
1449
|
+
let t = Gn(e), n = Ll();
|
|
1450
|
+
jn && (jn === Dn.warn ? Cn && jn("%c" + n + " WARNING: " + String(t), "color:yellow") : (Cn && Dn.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), jn(`${n} WARNING: ${String(t)}`))), Un("warning", t, n);
|
|
1430
1451
|
}
|
|
1431
|
-
function
|
|
1432
|
-
let t =
|
|
1433
|
-
|
|
1452
|
+
function Wn(e) {
|
|
1453
|
+
let t = Gn(e), n = Ll();
|
|
1454
|
+
An && Cn && An("%c" + n + " INFO: " + String(t), "color:cyan"), Un("info", t, n);
|
|
1434
1455
|
}
|
|
1435
|
-
function
|
|
1436
|
-
let t =
|
|
1437
|
-
|
|
1456
|
+
function Kn(e) {
|
|
1457
|
+
let t = Gn(e), n = Ll();
|
|
1458
|
+
In && Cn && In("%c" + n + " DEBUG: " + String(t), "color:silver"), Un("debug", t, n);
|
|
1438
1459
|
}
|
|
1439
|
-
function
|
|
1440
|
-
let t =
|
|
1441
|
-
|
|
1460
|
+
function Yn(e) {
|
|
1461
|
+
let t = Gn(e), n = Ll();
|
|
1462
|
+
In && Cn && In("%c" + n + " MSG: " + String(t), "color:cyan"), Un("msg", t, n);
|
|
1442
1463
|
}
|
|
1443
|
-
function
|
|
1444
|
-
|
|
1464
|
+
function xn(e, t) {
|
|
1465
|
+
Cn && (t && window.console.warn("=====> " + t), window.console.dir(e)), Un("json", e, Ll());
|
|
1445
1466
|
}
|
|
1446
|
-
function
|
|
1467
|
+
function Bn(e) {
|
|
1447
1468
|
return structuredClone(e);
|
|
1448
1469
|
}
|
|
1449
|
-
function
|
|
1470
|
+
function Jn(...e) {
|
|
1450
1471
|
const t = {};
|
|
1451
1472
|
for (const n of e) {
|
|
1452
1473
|
const e = structuredClone(n);
|
|
@@ -1454,14 +1475,14 @@ function Wn(...e) {
|
|
|
1454
1475
|
}
|
|
1455
1476
|
return t;
|
|
1456
1477
|
}
|
|
1457
|
-
function
|
|
1478
|
+
function qn(e, t) {
|
|
1458
1479
|
if (e === t) return !0;
|
|
1459
1480
|
if (null === e || null === t) return e === t;
|
|
1460
1481
|
if (typeof e != typeof t) return !1;
|
|
1461
1482
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1462
1483
|
if (Array.isArray(e)) {
|
|
1463
1484
|
if (e.length !== t.length) return !1;
|
|
1464
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1485
|
+
for (let n = 0; n < e.length; n++) if (!qn(e[n], t[n])) return !1;
|
|
1465
1486
|
return !0;
|
|
1466
1487
|
}
|
|
1467
1488
|
if ("object" == typeof e) {
|
|
@@ -1469,269 +1490,269 @@ function Kn(e, t) {
|
|
|
1469
1490
|
if (n.length !== r.length) return !1;
|
|
1470
1491
|
for (let l = 0; l < n.length; l++) {
|
|
1471
1492
|
if (n[l] !== r[l]) return !1;
|
|
1472
|
-
if (!
|
|
1493
|
+
if (!qn(e[n[l]], t[r[l]])) return !1;
|
|
1473
1494
|
}
|
|
1474
1495
|
return !0;
|
|
1475
1496
|
}
|
|
1476
1497
|
return e === t;
|
|
1477
1498
|
}
|
|
1478
|
-
function
|
|
1499
|
+
function Hn(e, t) {
|
|
1479
1500
|
if (!t) return e;
|
|
1480
1501
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1481
1502
|
return e;
|
|
1482
1503
|
}
|
|
1483
|
-
function
|
|
1504
|
+
function Qn(e, t) {
|
|
1484
1505
|
if (!t) return e;
|
|
1485
1506
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1486
1507
|
return e;
|
|
1487
1508
|
}
|
|
1488
|
-
function
|
|
1509
|
+
function zn(e, t) {
|
|
1489
1510
|
if (!t) return e;
|
|
1490
1511
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1491
1512
|
return e;
|
|
1492
1513
|
}
|
|
1493
|
-
function
|
|
1514
|
+
function Xn(e, t) {
|
|
1494
1515
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1495
1516
|
}
|
|
1496
|
-
function
|
|
1517
|
+
function Zn(e, t) {
|
|
1497
1518
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1498
1519
|
}
|
|
1499
|
-
function
|
|
1520
|
+
function er(e, t, n) {
|
|
1500
1521
|
e[t] = n;
|
|
1501
1522
|
}
|
|
1502
|
-
function
|
|
1523
|
+
function tr(e, t, n) {
|
|
1503
1524
|
e[t] = n;
|
|
1504
1525
|
}
|
|
1505
|
-
function
|
|
1526
|
+
function nr(e, t) {
|
|
1506
1527
|
e.push(t);
|
|
1507
1528
|
}
|
|
1508
|
-
function
|
|
1529
|
+
function rr(e, t) {
|
|
1509
1530
|
e.push(t);
|
|
1510
1531
|
}
|
|
1511
|
-
function
|
|
1532
|
+
function lr(e, t) {
|
|
1512
1533
|
e.splice(t, 1);
|
|
1513
1534
|
}
|
|
1514
|
-
function
|
|
1535
|
+
function ir(e, t) {
|
|
1515
1536
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
1516
1537
|
}
|
|
1517
|
-
function
|
|
1518
|
-
return
|
|
1538
|
+
function or(e) {
|
|
1539
|
+
return ur(e) ? Object.keys(e).length : 0;
|
|
1519
1540
|
}
|
|
1520
|
-
function
|
|
1521
|
-
return
|
|
1541
|
+
function sr(e) {
|
|
1542
|
+
return _r(e) ? e.length : 0;
|
|
1522
1543
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return
|
|
1544
|
+
function ar(e) {
|
|
1545
|
+
return ur(e) ? Object.keys(e).length : _r(e) ? e.length : cr(e) && e.length > 0 ? 1 : 0;
|
|
1525
1546
|
}
|
|
1526
|
-
function
|
|
1547
|
+
function ur(e) {
|
|
1527
1548
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1528
1549
|
}
|
|
1529
|
-
function
|
|
1550
|
+
function _r(e) {
|
|
1530
1551
|
return Array.isArray(e);
|
|
1531
1552
|
}
|
|
1532
|
-
function
|
|
1553
|
+
function cr(e) {
|
|
1533
1554
|
return "string" == typeof e;
|
|
1534
1555
|
}
|
|
1535
|
-
function
|
|
1556
|
+
function fr(e) {
|
|
1536
1557
|
return "number" == typeof e && Number.isFinite(e);
|
|
1537
1558
|
}
|
|
1538
|
-
function
|
|
1559
|
+
function gr(e) {
|
|
1539
1560
|
return "boolean" == typeof e;
|
|
1540
1561
|
}
|
|
1541
|
-
function
|
|
1562
|
+
function dr(e) {
|
|
1542
1563
|
return null == e;
|
|
1543
1564
|
}
|
|
1544
|
-
function
|
|
1545
|
-
if (
|
|
1546
|
-
if (!
|
|
1565
|
+
function br(e) {
|
|
1566
|
+
if (fr(e)) return !0;
|
|
1567
|
+
if (!cr(e)) return !1;
|
|
1547
1568
|
const t = Number(e);
|
|
1548
1569
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1549
1570
|
}
|
|
1550
|
-
function
|
|
1571
|
+
function mr(e) {
|
|
1551
1572
|
return e instanceof Date && !isNaN(e);
|
|
1552
1573
|
}
|
|
1553
|
-
function
|
|
1574
|
+
function pr(e) {
|
|
1554
1575
|
return "function" == typeof e;
|
|
1555
1576
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return e instanceof
|
|
1577
|
+
function Er(e) {
|
|
1578
|
+
return e instanceof k;
|
|
1558
1579
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return !
|
|
1580
|
+
function Tr(e) {
|
|
1581
|
+
return !cr(e) || 0 === e.length;
|
|
1561
1582
|
}
|
|
1562
|
-
function
|
|
1563
|
-
return
|
|
1583
|
+
function hr(e) {
|
|
1584
|
+
return fr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1564
1585
|
}
|
|
1565
|
-
function
|
|
1586
|
+
function yr(e, t, n) {
|
|
1566
1587
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
1567
1588
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
1568
1589
|
}
|
|
1569
|
-
function
|
|
1590
|
+
function Sr(e, t) {
|
|
1570
1591
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1571
1592
|
}
|
|
1572
|
-
function
|
|
1593
|
+
function vr(e, t) {
|
|
1573
1594
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1574
1595
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1575
1596
|
}
|
|
1576
|
-
function
|
|
1577
|
-
if (
|
|
1578
|
-
if (
|
|
1597
|
+
function Or(e, t) {
|
|
1598
|
+
if (ur(e) || ur(t) || _r(e) || _r(t)) return 0;
|
|
1599
|
+
if (fr(e) || fr(t)) {
|
|
1579
1600
|
let n = Number(e), r = Number(t);
|
|
1580
1601
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1581
1602
|
}
|
|
1582
|
-
if (
|
|
1603
|
+
if (gr(e) || gr(t)) {
|
|
1583
1604
|
let n = Number(e), r = Number(t);
|
|
1584
1605
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1585
1606
|
}
|
|
1586
|
-
return
|
|
1607
|
+
return Sr(String(e), String(t));
|
|
1587
1608
|
}
|
|
1588
|
-
function
|
|
1609
|
+
function Nr(e, t, n) {
|
|
1589
1610
|
var r;
|
|
1590
1611
|
return -1 !== (r = (e += "").indexOf(t)) && (n ? e.substring(0, r) : e.slice(r));
|
|
1591
1612
|
}
|
|
1592
|
-
function
|
|
1593
|
-
if (!
|
|
1613
|
+
function Rr(e) {
|
|
1614
|
+
if (!cr(e)) return !1;
|
|
1594
1615
|
let t;
|
|
1595
1616
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1596
1617
|
return 2 === t;
|
|
1597
1618
|
}
|
|
1598
|
-
function
|
|
1599
|
-
if (!
|
|
1619
|
+
function Dr(e) {
|
|
1620
|
+
if (!cr(e)) return !1;
|
|
1600
1621
|
let t;
|
|
1601
1622
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1602
1623
|
return 1 === t;
|
|
1603
1624
|
}
|
|
1604
|
-
function
|
|
1605
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1625
|
+
function wr(e, t) {
|
|
1626
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) wr(e, n);
|
|
1606
1627
|
else "string" == typeof t && delete e[t];
|
|
1607
1628
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1608
1629
|
}
|
|
1609
|
-
function
|
|
1630
|
+
function jr(e, t) {
|
|
1610
1631
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1611
1632
|
}
|
|
1612
|
-
function
|
|
1613
|
-
if (e && !
|
|
1614
|
-
if (!
|
|
1633
|
+
function Ar(e, t, n, r) {
|
|
1634
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !ur(t) && !_r(t)) return Vn(`${Tt(e)}: kw must be list or dict`), 0;
|
|
1635
|
+
if (!cr(n)) return Vn(`${Tt(e)}: path must be a string: ${String(n)}`), 0;
|
|
1615
1636
|
let l = n.split("`");
|
|
1616
1637
|
if (l.length <= 1) return t[n];
|
|
1617
1638
|
let i = l.length;
|
|
1618
|
-
for (let o = 0; o < i; o++) if (void 0 === (t = t[l[o]])) return void (r &&
|
|
1639
|
+
for (let o = 0; o < i; o++) if (void 0 === (t = t[l[o]])) return void (r && Vn(`${Tt(e)}: path not found: ${String(n)}`));
|
|
1619
1640
|
return t;
|
|
1620
1641
|
}
|
|
1621
|
-
function
|
|
1622
|
-
e && !
|
|
1642
|
+
function Ir(e, t, n) {
|
|
1643
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1623
1644
|
let [r, l] = function(e, t) {
|
|
1624
1645
|
let n = e.lastIndexOf(t);
|
|
1625
1646
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1626
1647
|
}(n, "`");
|
|
1627
|
-
return
|
|
1648
|
+
return Tr(l) ? Zn(t, n) : Zn(Ar(e, t, r, !0), l), 0;
|
|
1628
1649
|
}
|
|
1629
|
-
function
|
|
1630
|
-
e && !
|
|
1631
|
-
let i =
|
|
1632
|
-
const o = l && l &
|
|
1650
|
+
function $r(e, t, n, r, l) {
|
|
1651
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1652
|
+
let i = Ar(e, t, n, !1);
|
|
1653
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1633
1654
|
if (void 0 === i) {
|
|
1634
1655
|
if (s) {
|
|
1635
1656
|
let l = Boolean(r);
|
|
1636
|
-
return
|
|
1657
|
+
return Vr(e, t, n, l), l;
|
|
1637
1658
|
}
|
|
1638
|
-
return o && (
|
|
1659
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), Boolean(r);
|
|
1639
1660
|
}
|
|
1640
|
-
return a &&
|
|
1661
|
+
return a && Ir(e, t, n), Boolean(i);
|
|
1641
1662
|
}
|
|
1642
|
-
function
|
|
1643
|
-
e && !
|
|
1644
|
-
let i =
|
|
1645
|
-
const o = l && l &
|
|
1663
|
+
function kr(e, t, n, r, l) {
|
|
1664
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1665
|
+
let i = Ar(e, t, n, !1);
|
|
1666
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1646
1667
|
if (void 0 === i) {
|
|
1647
1668
|
if (s) {
|
|
1648
1669
|
let l = parseInt(r);
|
|
1649
|
-
return
|
|
1670
|
+
return Vr(e, t, n, l), l;
|
|
1650
1671
|
}
|
|
1651
|
-
return o && (
|
|
1672
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), parseInt(r);
|
|
1652
1673
|
}
|
|
1653
|
-
return a &&
|
|
1674
|
+
return a && Ir(e, t, n), fr(i) ? parseInt(i) : (o && (Vn(`path value MUST BE a number: ${n}`), Yn(t)), parseInt(r));
|
|
1654
1675
|
}
|
|
1655
|
-
function
|
|
1656
|
-
e && !
|
|
1657
|
-
let i =
|
|
1658
|
-
const o = l && l &
|
|
1676
|
+
function Cr(e, t, n, r, l) {
|
|
1677
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1678
|
+
let i = Ar(e, t, n, !1);
|
|
1679
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1659
1680
|
if (void 0 === i) {
|
|
1660
1681
|
if (s) {
|
|
1661
1682
|
let l = Number(r);
|
|
1662
|
-
return
|
|
1683
|
+
return Vr(e, t, n, l), l;
|
|
1663
1684
|
}
|
|
1664
|
-
return o && (
|
|
1685
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), Number(r);
|
|
1665
1686
|
}
|
|
1666
|
-
return a &&
|
|
1687
|
+
return a && Ir(e, t, n), fr(i) ? Number(i) : (o && (Vn(`path value MUST BE a number: ${n}`), Yn(t)), Number(r));
|
|
1667
1688
|
}
|
|
1668
|
-
function
|
|
1669
|
-
e && !
|
|
1670
|
-
let i =
|
|
1671
|
-
const o = l && l &
|
|
1689
|
+
function Lr(e, t, n, r, l) {
|
|
1690
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1691
|
+
let i = Ar(e, t, n, !1);
|
|
1692
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1672
1693
|
if (void 0 === i) {
|
|
1673
1694
|
if (s) {
|
|
1674
1695
|
let l = String(r);
|
|
1675
|
-
return
|
|
1696
|
+
return Vr(e, t, n, l), l;
|
|
1676
1697
|
}
|
|
1677
|
-
return o && (
|
|
1698
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), String(r);
|
|
1678
1699
|
}
|
|
1679
|
-
return a &&
|
|
1700
|
+
return a && Ir(e, t, n), cr(i) ? String(i) : (o && (Vn(`${Tt(e)}: path value MUST BE a string: ${n}`), Yn(t)), String(r));
|
|
1680
1701
|
}
|
|
1681
|
-
function
|
|
1682
|
-
e && !
|
|
1683
|
-
let i =
|
|
1684
|
-
const o = l && l &
|
|
1702
|
+
function Pr(e, t, n, r, l) {
|
|
1703
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1704
|
+
let i = Ar(e, t, n, !1);
|
|
1705
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1685
1706
|
if (void 0 === i) {
|
|
1686
1707
|
if (s) {
|
|
1687
1708
|
let l = r;
|
|
1688
|
-
return
|
|
1709
|
+
return Vr(e, t, n, l), l;
|
|
1689
1710
|
}
|
|
1690
|
-
return o && (
|
|
1711
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), r;
|
|
1691
1712
|
}
|
|
1692
|
-
return a &&
|
|
1713
|
+
return a && Ir(e, t, n), i;
|
|
1693
1714
|
}
|
|
1694
|
-
function
|
|
1695
|
-
e && !
|
|
1696
|
-
let i =
|
|
1697
|
-
const o = l && l &
|
|
1715
|
+
function Ur(e, t, n, r, l) {
|
|
1716
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1717
|
+
let i = Ar(e, t, n, !1);
|
|
1718
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1698
1719
|
if (void 0 === i) {
|
|
1699
1720
|
if (s) {
|
|
1700
1721
|
let l = Object(r);
|
|
1701
|
-
return
|
|
1722
|
+
return Vr(e, t, n, l), l;
|
|
1702
1723
|
}
|
|
1703
|
-
return o && (
|
|
1724
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), Object(r);
|
|
1704
1725
|
}
|
|
1705
|
-
return a &&
|
|
1726
|
+
return a && Ir(e, t, n), ur(i) ? Object(i) : (o && (Vn(`path value MUST BE a dict: ${n}`), Yn(t)), Object(r));
|
|
1706
1727
|
}
|
|
1707
|
-
function
|
|
1708
|
-
e && !
|
|
1709
|
-
let i =
|
|
1710
|
-
const o = l && l &
|
|
1728
|
+
function Fr(e, t, n, r, l) {
|
|
1729
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1730
|
+
let i = Ar(e, t, n, !1);
|
|
1731
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1711
1732
|
if (void 0 === i) {
|
|
1712
1733
|
if (s) {
|
|
1713
1734
|
let l = r;
|
|
1714
|
-
return
|
|
1735
|
+
return Vr(e, t, n, l), l;
|
|
1715
1736
|
}
|
|
1716
|
-
return o && (
|
|
1737
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), r;
|
|
1717
1738
|
}
|
|
1718
|
-
return a &&
|
|
1739
|
+
return a && Ir(e, t, n), i;
|
|
1719
1740
|
}
|
|
1720
|
-
function
|
|
1721
|
-
e && !
|
|
1722
|
-
let i =
|
|
1723
|
-
const o = l && l &
|
|
1741
|
+
function Gr(e, t, n, r, l) {
|
|
1742
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1743
|
+
let i = Ar(e, t, n, !1);
|
|
1744
|
+
const o = l && l & Rn.KW_REQUIRED, s = l && l & Rn.KW_CREATE, a = l && l & Rn.KW_EXTRACT;
|
|
1724
1745
|
if (void 0 === i) {
|
|
1725
1746
|
if (s) {
|
|
1726
1747
|
let l = Array(r);
|
|
1727
|
-
return
|
|
1748
|
+
return Vr(e, t, n, l), l;
|
|
1728
1749
|
}
|
|
1729
|
-
return o && (
|
|
1750
|
+
return o && (Vn(`path not found: '${n}'`), xn(t)), Array(r);
|
|
1730
1751
|
}
|
|
1731
|
-
return a &&
|
|
1752
|
+
return a && Ir(e, t, n), _r(i) ? Array(i) : (o && (Vn(`path value MUST BE an array: ${n}`), Yn(t)), Array(r));
|
|
1732
1753
|
}
|
|
1733
|
-
function
|
|
1734
|
-
if (e && !
|
|
1754
|
+
function Vr(e, t, n, r) {
|
|
1755
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !ur(t)) return Vn("kw is not an object"), -1;
|
|
1735
1756
|
let l = n.split("`");
|
|
1736
1757
|
if (l.length <= 1) return t[n] = r, 0;
|
|
1737
1758
|
let i = l.length;
|
|
@@ -1741,34 +1762,34 @@ function Lr(e, t, n, r) {
|
|
|
1741
1762
|
}
|
|
1742
1763
|
return 0;
|
|
1743
1764
|
}
|
|
1744
|
-
function
|
|
1745
|
-
if (e && !
|
|
1746
|
-
let i =
|
|
1747
|
-
return
|
|
1765
|
+
function Mr(e, t, n, r, l) {
|
|
1766
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !ur(t)) return Vn("kw is not an object"), -1;
|
|
1767
|
+
let i = Ur(e, t, n, {}, !0);
|
|
1768
|
+
return ur(i) ? (i[r] = l, 0) : (Vn("subdict is not an object"), -1);
|
|
1748
1769
|
}
|
|
1749
|
-
function
|
|
1770
|
+
function Wr(e, n, r) {
|
|
1750
1771
|
let l = "", i = !1;
|
|
1751
|
-
if (
|
|
1772
|
+
if (_r(n)) {
|
|
1752
1773
|
i = !1;
|
|
1753
1774
|
for (let o = 0; o < n.length; o++) {
|
|
1754
1775
|
let s = n[o];
|
|
1755
|
-
if (l =
|
|
1776
|
+
if (l = Tr(r) ? t("%s", r) : t("%s`%d", r, o), i = Wr(e, s, l), i) break;
|
|
1756
1777
|
}
|
|
1757
|
-
} else if (
|
|
1778
|
+
} else if (ur(n)) {
|
|
1758
1779
|
i = !0;
|
|
1759
1780
|
let o = Object.keys(n);
|
|
1760
1781
|
for (let s = 0; s < o.length; s++) {
|
|
1761
1782
|
let a = o[s], u = n[a];
|
|
1762
|
-
if (l =
|
|
1763
|
-
if (i =
|
|
1783
|
+
if (l = Tr(r) ? t("%s", a) : t("%s`%s", r, a), _r(u) || ur(u)) {
|
|
1784
|
+
if (i = Wr(e, u, l), !i) break;
|
|
1764
1785
|
continue;
|
|
1765
1786
|
}
|
|
1766
|
-
let _ =
|
|
1767
|
-
if (_ || (_ =
|
|
1787
|
+
let _ = Fr(0, e, l, 0, 0);
|
|
1788
|
+
if (_ || (_ = Xn(e, l)), !_) {
|
|
1768
1789
|
i = !1;
|
|
1769
1790
|
break;
|
|
1770
1791
|
}
|
|
1771
|
-
if (0 !==
|
|
1792
|
+
if (0 !== Or(_, u)) {
|
|
1772
1793
|
i = !1;
|
|
1773
1794
|
break;
|
|
1774
1795
|
}
|
|
@@ -1776,91 +1797,91 @@ function Ur(e, n, r) {
|
|
|
1776
1797
|
}
|
|
1777
1798
|
return i;
|
|
1778
1799
|
}
|
|
1779
|
-
function
|
|
1780
|
-
return 0 ===
|
|
1800
|
+
function Kr(e, t) {
|
|
1801
|
+
return 0 === ar(t) || Wr(e, t, "");
|
|
1781
1802
|
}
|
|
1782
|
-
function
|
|
1783
|
-
if (!n || !
|
|
1784
|
-
for (let e = 0; e < t.length; e++) if (
|
|
1785
|
-
return r &&
|
|
1803
|
+
function Yr(e, t, n, r) {
|
|
1804
|
+
if (!n || !_r(t)) return r && Vn("item NULL or kw_list is not a list"), -1;
|
|
1805
|
+
for (let e = 0; e < t.length; e++) if (qn(n, t[e])) return e;
|
|
1806
|
+
return r && Vn("item not found in this list"), -1;
|
|
1786
1807
|
}
|
|
1787
|
-
function
|
|
1788
|
-
if (e && !
|
|
1789
|
-
r || (r =
|
|
1808
|
+
function xr(e, t, n, r) {
|
|
1809
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !t) return null;
|
|
1810
|
+
r || (r = Kr);
|
|
1790
1811
|
let l = [];
|
|
1791
|
-
if (
|
|
1812
|
+
if (_r(t)) for (let e = 0; e < t.length; e++) {
|
|
1792
1813
|
let i = t[e];
|
|
1793
|
-
r(i, n) && l.push(
|
|
1814
|
+
r(i, n) && l.push(Bn(i));
|
|
1794
1815
|
}
|
|
1795
1816
|
else {
|
|
1796
|
-
if (!
|
|
1797
|
-
r(t, n) && l.push(
|
|
1817
|
+
if (!ur(t)) return Vn("kw_select() BAD kw parameter"), null;
|
|
1818
|
+
r(t, n) && l.push(Bn(t));
|
|
1798
1819
|
}
|
|
1799
1820
|
return l;
|
|
1800
1821
|
}
|
|
1801
|
-
function
|
|
1802
|
-
if (e && !
|
|
1803
|
-
r || (r =
|
|
1822
|
+
function Br(e, t, n, r) {
|
|
1823
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !t) return null;
|
|
1824
|
+
r || (r = Kr);
|
|
1804
1825
|
let l = [];
|
|
1805
|
-
if (
|
|
1826
|
+
if (_r(t)) for (let e = 0; e < t.length; e++) {
|
|
1806
1827
|
let i = t[e];
|
|
1807
1828
|
r(i, n) && l.push(i);
|
|
1808
1829
|
}
|
|
1809
1830
|
else {
|
|
1810
|
-
if (!
|
|
1831
|
+
if (!ur(t)) return Vn("kw_select() BAD kw parameter"), null;
|
|
1811
1832
|
r(t, n) && l.push(t);
|
|
1812
1833
|
}
|
|
1813
1834
|
return l;
|
|
1814
1835
|
}
|
|
1815
|
-
function
|
|
1816
|
-
e && !
|
|
1836
|
+
function Jr(e, t, n, r) {
|
|
1837
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1817
1838
|
let l = {};
|
|
1818
|
-
if (
|
|
1839
|
+
if (cr(n) && !Tr(n)) {
|
|
1819
1840
|
let i = n;
|
|
1820
|
-
t.hasOwnProperty(i) ? l[i] = t[i] : r &&
|
|
1821
|
-
} else if (
|
|
1841
|
+
t.hasOwnProperty(i) ? l[i] = t[i] : r && Vn(`${Tt(e)}: key not found: ${i}`);
|
|
1842
|
+
} else if (ur(n) && or(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? l[i] = t[i] : r && Vn(`${Tt(e)}: key not found: ${i}`);
|
|
1822
1843
|
else {
|
|
1823
|
-
if (!(
|
|
1844
|
+
if (!(_r(n) && sr(n) > 0)) return t;
|
|
1824
1845
|
for (let i = 0; i < n.length; i++) {
|
|
1825
1846
|
let o = n[i];
|
|
1826
|
-
t.hasOwnProperty(o) ? l[o] = t[o] : r &&
|
|
1847
|
+
t.hasOwnProperty(o) ? l[o] = t[o] : r && Vn(`${Tt(e)}: key not found: ${o}`);
|
|
1827
1848
|
}
|
|
1828
1849
|
}
|
|
1829
1850
|
return l;
|
|
1830
1851
|
}
|
|
1831
|
-
function
|
|
1852
|
+
function qr(e, t, n, r) {
|
|
1832
1853
|
let l = {};
|
|
1833
|
-
if (
|
|
1854
|
+
if (Hn(l, t), cr(n) && !Tr(n)) {
|
|
1834
1855
|
let i = n;
|
|
1835
|
-
|
|
1836
|
-
} else if (
|
|
1856
|
+
Fr(e, t, i, 0, 0) ? Zn(l, i) : r && Vn(`${Tt(e)}: key not found: ${i}`);
|
|
1857
|
+
} else if (ur(n) && or(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? Zn(l, i) : r && Vn(`${Tt(e)}: key not found: ${i}`);
|
|
1837
1858
|
else {
|
|
1838
|
-
if (!(
|
|
1859
|
+
if (!(_r(n) && sr(n) > 0)) return {};
|
|
1839
1860
|
for (let i = 0; i < n.length; i++) {
|
|
1840
1861
|
let o = n[i];
|
|
1841
|
-
t.hasOwnProperty(o) ?
|
|
1862
|
+
t.hasOwnProperty(o) ? Zn(l, o) : r && Vn(`${Tt(e)}: key not found: ${o}`);
|
|
1842
1863
|
}
|
|
1843
1864
|
}
|
|
1844
1865
|
return l;
|
|
1845
1866
|
}
|
|
1846
|
-
function
|
|
1867
|
+
function Hr(e, t, n = !1) {
|
|
1847
1868
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1848
1869
|
let r = window.localStorage.getItem(e);
|
|
1849
|
-
return null === r ? (n &&
|
|
1870
|
+
return null === r ? (n && Qr(e, t), t) : JSON.parse(r);
|
|
1850
1871
|
} catch (n) {
|
|
1851
1872
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1852
1873
|
}
|
|
1853
1874
|
}
|
|
1854
|
-
function
|
|
1875
|
+
function Qr(e, t) {
|
|
1855
1876
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1856
|
-
if (!e || void 0 === t) return
|
|
1877
|
+
if (!e || void 0 === t) return Vn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1857
1878
|
try {
|
|
1858
1879
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1859
1880
|
} catch (t) {
|
|
1860
|
-
return
|
|
1881
|
+
return Vn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1861
1882
|
}
|
|
1862
1883
|
}
|
|
1863
|
-
function
|
|
1884
|
+
function zr(e) {
|
|
1864
1885
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1865
1886
|
window.localStorage.removeItem(e);
|
|
1866
1887
|
} catch (t) {
|
|
@@ -1868,113 +1889,113 @@ function Br(e) {
|
|
|
1868
1889
|
}
|
|
1869
1890
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1870
1891
|
}
|
|
1871
|
-
function
|
|
1872
|
-
if (
|
|
1873
|
-
if (
|
|
1892
|
+
function Xr(e, t) {
|
|
1893
|
+
if (dr(e) || dr(t)) return !0;
|
|
1894
|
+
if (_r(e)) {
|
|
1874
1895
|
if (0 === e.length) return !0;
|
|
1875
1896
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1876
|
-
} else if (
|
|
1897
|
+
} else if (ur(e)) {
|
|
1877
1898
|
if (0 === Object.keys(e).length) return !0;
|
|
1878
1899
|
for (let n in e) if (n === t) return !0;
|
|
1879
|
-
} else if (
|
|
1900
|
+
} else if (cr(e) && e === t) return !0;
|
|
1880
1901
|
return !1;
|
|
1881
1902
|
}
|
|
1882
|
-
function
|
|
1883
|
-
if (e && !
|
|
1884
|
-
l || (l =
|
|
1903
|
+
function Zr(e, t, n, r, l) {
|
|
1904
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !t) return null;
|
|
1905
|
+
l || (l = Kr);
|
|
1885
1906
|
let i = [];
|
|
1886
|
-
if (
|
|
1907
|
+
if (_r(t)) for (let o = 0; o < t.length; o++) {
|
|
1887
1908
|
let s, a = t[o];
|
|
1888
|
-
if (
|
|
1909
|
+
if (ur(a)) s = Lr(e, a, "id", "", 0);
|
|
1889
1910
|
else {
|
|
1890
|
-
if (!
|
|
1911
|
+
if (!cr(a)) continue;
|
|
1891
1912
|
s = a;
|
|
1892
1913
|
}
|
|
1893
|
-
|
|
1914
|
+
Xr(n, s) && l(a, r) && i.push(a);
|
|
1894
1915
|
}
|
|
1895
1916
|
else {
|
|
1896
|
-
if (!
|
|
1917
|
+
if (!ur(t)) return Vn("kw_collect() BAD kw parameter"), null;
|
|
1897
1918
|
for (let e of Object.keys(t)) {
|
|
1898
1919
|
let o = t[e];
|
|
1899
|
-
|
|
1920
|
+
Xr(n, e) && l(o, r) && i.push(o);
|
|
1900
1921
|
}
|
|
1901
1922
|
}
|
|
1902
1923
|
return i;
|
|
1903
1924
|
}
|
|
1904
|
-
function
|
|
1905
|
-
e && !
|
|
1925
|
+
function el(e, t, n) {
|
|
1926
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1906
1927
|
let r = {};
|
|
1907
|
-
if (
|
|
1908
|
-
else if (
|
|
1909
|
-
let l = t[n], i =
|
|
1910
|
-
|
|
1928
|
+
if (Tr(n) || (t = Ar(e, t, n)), ur(t)) r = t;
|
|
1929
|
+
else if (_r(t)) for (let n = 0; n < t.length; n++) {
|
|
1930
|
+
let l = t[n], i = Lr(e, l, "id", "", 0);
|
|
1931
|
+
Tr(i) || (r[i] = l);
|
|
1911
1932
|
}
|
|
1912
|
-
else
|
|
1933
|
+
else Vn(`${Tt(e)} kwid_new_dict: data type unknown`);
|
|
1913
1934
|
return r;
|
|
1914
1935
|
}
|
|
1915
|
-
function
|
|
1916
|
-
e && !
|
|
1917
|
-
let i =
|
|
1936
|
+
function tl(e, t, n, r, l) {
|
|
1937
|
+
e && !Er(e) && Vn("GObj bad instanceof");
|
|
1938
|
+
let i = Zr(e, t, n, r, l);
|
|
1918
1939
|
return i.length > 0 ? i[0] : null;
|
|
1919
1940
|
}
|
|
1920
|
-
function
|
|
1921
|
-
if (e && !
|
|
1941
|
+
function nl(e, t) {
|
|
1942
|
+
if (e && !Er(e) && Vn("GObj bad instanceof"), !t) return [];
|
|
1922
1943
|
let n = [];
|
|
1923
|
-
if (
|
|
1924
|
-
else if (
|
|
1925
|
-
else
|
|
1926
|
-
if (
|
|
1927
|
-
else if (
|
|
1928
|
-
let r =
|
|
1944
|
+
if (cr(t)) n.push(t);
|
|
1945
|
+
else if (ur(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
1946
|
+
else _r(t) && t.forEach(function(t) {
|
|
1947
|
+
if (cr(t)) Tr(t) || n.push(t);
|
|
1948
|
+
else if (ur(t)) {
|
|
1949
|
+
let r = Lr(e, t, "id", 0, 0);
|
|
1929
1950
|
r && n.push(r);
|
|
1930
1951
|
}
|
|
1931
1952
|
});
|
|
1932
1953
|
return n;
|
|
1933
1954
|
}
|
|
1934
|
-
function
|
|
1955
|
+
function rl(e, t, n) {
|
|
1935
1956
|
t = t || "id", n = n || "value";
|
|
1936
1957
|
let r = [];
|
|
1937
|
-
if (
|
|
1958
|
+
if (_r(e)) for (let l = 0; l < e.length; l++) {
|
|
1938
1959
|
let i = e[l];
|
|
1939
|
-
if (
|
|
1960
|
+
if (cr(i)) r.push({
|
|
1940
1961
|
id: e[l],
|
|
1941
1962
|
value: e[l]
|
|
1942
1963
|
});
|
|
1943
|
-
else if (
|
|
1964
|
+
else if (ur(i)) {
|
|
1944
1965
|
let e = {};
|
|
1945
|
-
if (
|
|
1946
|
-
if (!
|
|
1947
|
-
if (!(
|
|
1948
|
-
|
|
1966
|
+
if (jr(i, t)) {
|
|
1967
|
+
if (!jr(i, n)) {
|
|
1968
|
+
if (!(ar(i) > 0)) {
|
|
1969
|
+
Vn("list2options(): object without field value: " + n);
|
|
1949
1970
|
continue;
|
|
1950
1971
|
}
|
|
1951
1972
|
n = Object.keys(i)[0];
|
|
1952
1973
|
}
|
|
1953
1974
|
e.id = i[t], e.value = i[n];
|
|
1954
1975
|
} else {
|
|
1955
|
-
if (!(
|
|
1956
|
-
|
|
1976
|
+
if (!(ar(i) > 0)) {
|
|
1977
|
+
Vn("list2options(): object without field id: " + t);
|
|
1957
1978
|
continue;
|
|
1958
1979
|
}
|
|
1959
1980
|
t = Object.keys(i)[0], e.id = t, e.value = i[t];
|
|
1960
1981
|
}
|
|
1961
1982
|
r.push(e);
|
|
1962
|
-
} else
|
|
1983
|
+
} else Vn("list2options(): case1 not implemented");
|
|
1963
1984
|
}
|
|
1964
|
-
else if (
|
|
1985
|
+
else if (ur(e)) for (let t of Object.keys(e)) r.push({
|
|
1965
1986
|
id: t,
|
|
1966
1987
|
value: t
|
|
1967
1988
|
});
|
|
1968
|
-
else
|
|
1989
|
+
else Vn("list2options(): case2 not implemented");
|
|
1969
1990
|
return r;
|
|
1970
1991
|
}
|
|
1971
|
-
function
|
|
1992
|
+
function ll(e, t) {
|
|
1972
1993
|
if (!e) return -1;
|
|
1973
1994
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1974
1995
|
return -1;
|
|
1975
1996
|
}
|
|
1976
|
-
function
|
|
1977
|
-
if (!e || !t) return
|
|
1997
|
+
function il(e, t, n) {
|
|
1998
|
+
if (!e || !t) return Vn("ERROR: str_in_list() list or str empty"), !1;
|
|
1978
1999
|
let r = e.length;
|
|
1979
2000
|
if (n) {
|
|
1980
2001
|
t = t.toLowerCase();
|
|
@@ -1985,17 +2006,17 @@ function el(e, t, n) {
|
|
|
1985
2006
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1986
2007
|
return !1;
|
|
1987
2008
|
}
|
|
1988
|
-
function
|
|
1989
|
-
if (!e) return
|
|
1990
|
-
if (!t) return
|
|
1991
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2009
|
+
function ol(e, t, n) {
|
|
2010
|
+
if (!e) return Vn("ERROR: strs_in_list() list empty"), !1;
|
|
2011
|
+
if (!t) return Vn("ERROR: strs_in_list() str empty"), !1;
|
|
2012
|
+
for (let r = 0; r < t.length; r++) if (il(e, t[r], n)) return !0;
|
|
1992
2013
|
return !1;
|
|
1993
2014
|
}
|
|
1994
|
-
function
|
|
2015
|
+
function sl(e, t) {
|
|
1995
2016
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
1996
2017
|
return !1;
|
|
1997
2018
|
}
|
|
1998
|
-
function
|
|
2019
|
+
function al(e, t) {
|
|
1999
2020
|
try {
|
|
2000
2021
|
let n = e.__md_iev__;
|
|
2001
2022
|
if (n) return n[t];
|
|
@@ -2003,53 +2024,53 @@ function rl(e, t) {
|
|
|
2003
2024
|
return;
|
|
2004
2025
|
}
|
|
2005
2026
|
}
|
|
2006
|
-
function
|
|
2027
|
+
function ul(e, t, n) {
|
|
2007
2028
|
let r = e.__md_iev__;
|
|
2008
2029
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2009
2030
|
}
|
|
2010
|
-
function
|
|
2011
|
-
if (!
|
|
2031
|
+
function _l(e, t, n, r) {
|
|
2032
|
+
if (!Er(e)) return Vn("gobj is not a GObj"), null;
|
|
2012
2033
|
if (!t) return;
|
|
2013
|
-
let l =
|
|
2014
|
-
l || (l = [],
|
|
2034
|
+
let l = al(t, n);
|
|
2035
|
+
l || (l = [], ul(t, n, l));
|
|
2015
2036
|
try {
|
|
2016
|
-
|
|
2037
|
+
_r(l) && l.unshift(r);
|
|
2017
2038
|
} catch (e) {
|
|
2018
|
-
|
|
2039
|
+
Vn(e);
|
|
2019
2040
|
}
|
|
2020
2041
|
}
|
|
2021
|
-
function
|
|
2022
|
-
if (!
|
|
2023
|
-
if (!
|
|
2024
|
-
let l =
|
|
2025
|
-
return l ? 0 === l.length ? (r &&
|
|
2042
|
+
function cl(e, t, n, r) {
|
|
2043
|
+
if (!Er(e)) return Vn("gobj is not a GObj"), null;
|
|
2044
|
+
if (!ur(t)) return Vn("kw is not a dict"), null;
|
|
2045
|
+
let l = al(t, n);
|
|
2046
|
+
return l ? 0 === l.length ? (r && Vn(`stack empty: ${n}`), null) : l[0] : (r && Vn(`stack NOT FOUND: ${n}`), null);
|
|
2026
2047
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return
|
|
2048
|
+
function fl(e, t, n) {
|
|
2049
|
+
return Tr(n) ? Ir(e, t, "__md_iev__`__msg_type__") : Mr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2029
2050
|
}
|
|
2030
|
-
function
|
|
2031
|
-
return
|
|
2051
|
+
function gl(e, t) {
|
|
2052
|
+
return Lr(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2032
2053
|
}
|
|
2033
|
-
function
|
|
2054
|
+
function dl(e, t, n) {
|
|
2034
2055
|
let r = new XMLHttpRequest();
|
|
2035
2056
|
r.open("GET", e, !0), r.setRequestHeader("Accept", "application/json"), r.onreadystatechange = function() {
|
|
2036
2057
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2037
2058
|
t(JSON.parse(r.responseText));
|
|
2038
2059
|
} catch (e) {
|
|
2039
|
-
n && (
|
|
2060
|
+
n && (Vn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2040
2061
|
}
|
|
2041
2062
|
else n && n(r.status);
|
|
2042
2063
|
var e;
|
|
2043
2064
|
}, r.send();
|
|
2044
2065
|
}
|
|
2045
|
-
function
|
|
2066
|
+
function bl(e, t, n) {
|
|
2046
2067
|
let r = new XMLHttpRequest();
|
|
2047
2068
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2048
2069
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2049
2070
|
}, r.send(t);
|
|
2050
2071
|
}
|
|
2051
|
-
function
|
|
2052
|
-
void 0 !== n &&
|
|
2072
|
+
function ml(e, t, n) {
|
|
2073
|
+
void 0 !== n && cr(n) || (n = "");
|
|
2053
2074
|
for (let r of Object.keys(e)) {
|
|
2054
2075
|
if (!e.hasOwnProperty(r)) continue;
|
|
2055
2076
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2058,61 +2079,61 @@ function cl(e, t, n) {
|
|
|
2058
2079
|
r,
|
|
2059
2080
|
e[r],
|
|
2060
2081
|
n
|
|
2061
|
-
]),
|
|
2082
|
+
]), ur(e[r]) && ml(e[r], t, n), n = n.slice(0, -l.length);
|
|
2062
2083
|
}
|
|
2063
2084
|
}
|
|
2064
|
-
function
|
|
2065
|
-
n && (e =
|
|
2066
|
-
let r =
|
|
2067
|
-
|
|
2068
|
-
let l =
|
|
2069
|
-
return
|
|
2070
|
-
"__" !== t.substring(0, 2) &&
|
|
2085
|
+
function pl(e, t, n) {
|
|
2086
|
+
n && (e = Bn(e));
|
|
2087
|
+
let r = Fr(null, e, "type", [], 1);
|
|
2088
|
+
Lr(null, e, "hook", "data", 1);
|
|
2089
|
+
let l = Fr(null, e, "schema", {}, 1), i = Fr(null, e, "topics", {}, 1);
|
|
2090
|
+
return ml(l, function(e, t, n, l) {
|
|
2091
|
+
"__" !== t.substring(0, 2) && Fr(null, i, l, Bn(r), 1);
|
|
2071
2092
|
}, t), e;
|
|
2072
2093
|
}
|
|
2073
|
-
function
|
|
2074
|
-
let l =
|
|
2075
|
-
if (!l) return
|
|
2076
|
-
if (
|
|
2094
|
+
function El(e, t, n, r) {
|
|
2095
|
+
let l = Fr(null, Fr(null, e, "topics", null, 0), t, null, 0);
|
|
2096
|
+
if (!l) return Vn("jdb_update: topic not found: " + t), null;
|
|
2097
|
+
if (Tr(r.id)) return Vn("jdb_update: record without id: " + r), Yn(r), null;
|
|
2077
2098
|
let i, o = n.split("`"), s = l;
|
|
2078
|
-
for (; (i = o.shift()) && !
|
|
2079
|
-
if (0 === o.length && s) if (
|
|
2099
|
+
for (; (i = o.shift()) && !Tr(i) && s;) ur(s) && (s = Fr(null, s, e.hook, [], 1)), s = vl(s, null, i, !1);
|
|
2100
|
+
if (0 === o.length && s) if (_r(s)) s.push(r);
|
|
2080
2101
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2081
2102
|
else {
|
|
2082
|
-
let t =
|
|
2103
|
+
let t = Fr(null, s, e.hook, [], 1), n = vl(t, e.hook, r.id, !1);
|
|
2083
2104
|
n ? Object.assign(n, r) : t.push(r);
|
|
2084
2105
|
}
|
|
2085
2106
|
return l;
|
|
2086
2107
|
}
|
|
2087
|
-
function
|
|
2088
|
-
let l =
|
|
2089
|
-
if (!l) return
|
|
2090
|
-
if (
|
|
2108
|
+
function Tl(e, t, n, r) {
|
|
2109
|
+
let l = Fr(null, Fr(null, e, "topics", null, 0), t, null, 0);
|
|
2110
|
+
if (!l) return Vn("jdb_delete: topic not found: " + t), null;
|
|
2111
|
+
if (Tr(r.id)) return Vn("jdb_delete: record without id: " + r), Yn(r), null;
|
|
2091
2112
|
let i, o = n.split("`"), s = l;
|
|
2092
|
-
for (; (i = o.shift()) && !
|
|
2093
|
-
if (0 === o.length && s) if (
|
|
2094
|
-
let e =
|
|
2113
|
+
for (; (i = o.shift()) && !Tr(i) && s;) ur(s) && (s = Fr(null, s, e.hook, null, 0)), s = vl(s, null, i, !1);
|
|
2114
|
+
if (0 === o.length && s) if (_r(s)) {
|
|
2115
|
+
let e = ll(s, r.id);
|
|
2095
2116
|
e >= 0 && s.splice(e, 1);
|
|
2096
2117
|
} else {
|
|
2097
|
-
let t =
|
|
2118
|
+
let t = Fr(null, s, e.hook, null, 0), n = ll(t, r.id);
|
|
2098
2119
|
n >= 0 && t.splice(n, 1);
|
|
2099
2120
|
}
|
|
2100
2121
|
return l;
|
|
2101
2122
|
}
|
|
2102
|
-
function
|
|
2103
|
-
let n =
|
|
2104
|
-
if (!n) return
|
|
2105
|
-
return
|
|
2123
|
+
function hl(e, t) {
|
|
2124
|
+
let n = Fr(null, e, "topics", null, 0);
|
|
2125
|
+
if (!n) return Vn("jdb topics section not found"), Yn(e), null;
|
|
2126
|
+
return Fr(null, n, t, null, 0) || (Vn("jdb topic not found: " + t), Yn(n), null);
|
|
2106
2127
|
}
|
|
2107
|
-
function
|
|
2108
|
-
let l =
|
|
2109
|
-
return l ? (void 0 === r && (r = !0),
|
|
2128
|
+
function yl(e, t, n, r) {
|
|
2129
|
+
let l = Fr(null, Fr(null, e, "topics", null, 0), t, null, 0);
|
|
2130
|
+
return l ? (void 0 === r && (r = !0), vl(l, e.hook, n, r)) : (Vn("jdb_get: topic not found: " + t), null);
|
|
2110
2131
|
}
|
|
2111
|
-
function
|
|
2112
|
-
let r =
|
|
2113
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2132
|
+
function Sl(e, t, n) {
|
|
2133
|
+
let r = Fr(null, Fr(null, e, "topics", null, 0), t, null, 0);
|
|
2134
|
+
return r ? n < r.length ? r[n] : {} : (Vn("jdb_get_by_idx: topic not found: " + t), null);
|
|
2114
2135
|
}
|
|
2115
|
-
function
|
|
2136
|
+
function vl(e, t, n, r) {
|
|
2116
2137
|
if (!e) return null;
|
|
2117
2138
|
let l, i = e.length;
|
|
2118
2139
|
for (l = 0; l < i; l++) {
|
|
@@ -2120,19 +2141,19 @@ function El(e, t, n, r) {
|
|
|
2120
2141
|
if (i) {
|
|
2121
2142
|
let e = i.id;
|
|
2122
2143
|
if (e && e === n) return i;
|
|
2123
|
-
if (r &&
|
|
2124
|
-
let e =
|
|
2144
|
+
if (r && jr(i, t)) {
|
|
2145
|
+
let e = vl(i[t], t, n, r);
|
|
2125
2146
|
if (e) return e;
|
|
2126
2147
|
}
|
|
2127
2148
|
}
|
|
2128
2149
|
}
|
|
2129
2150
|
return null;
|
|
2130
2151
|
}
|
|
2131
|
-
function
|
|
2132
|
-
let n =
|
|
2133
|
-
return
|
|
2152
|
+
function Ol(e, t) {
|
|
2153
|
+
let n = Bn(e);
|
|
2154
|
+
return Qn(n, t), n;
|
|
2134
2155
|
}
|
|
2135
|
-
function
|
|
2156
|
+
function Nl(e) {
|
|
2136
2157
|
function t(e) {
|
|
2137
2158
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2138
2159
|
switch (t.length % 4) {
|
|
@@ -2163,9 +2184,9 @@ function hl(e) {
|
|
|
2163
2184
|
signature: t(n[2])
|
|
2164
2185
|
};
|
|
2165
2186
|
}
|
|
2166
|
-
function
|
|
2187
|
+
function Rl(e, t) {
|
|
2167
2188
|
try {
|
|
2168
|
-
let n =
|
|
2189
|
+
let n = Nl(e);
|
|
2169
2190
|
switch (t) {
|
|
2170
2191
|
case "header": return JSON.parse(n.header);
|
|
2171
2192
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2175,38 +2196,38 @@ function yl(e, t) {
|
|
|
2175
2196
|
return null;
|
|
2176
2197
|
}
|
|
2177
2198
|
}
|
|
2178
|
-
function
|
|
2199
|
+
function Dl(e) {
|
|
2179
2200
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2180
2201
|
}
|
|
2181
|
-
function
|
|
2202
|
+
function wl(e) {
|
|
2182
2203
|
if (!e) return "";
|
|
2183
2204
|
const t = String(e).trim();
|
|
2184
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2205
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Dl(t);
|
|
2185
2206
|
}
|
|
2186
|
-
function
|
|
2207
|
+
function jl(e) {
|
|
2187
2208
|
const t = document.createElement("template");
|
|
2188
2209
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2189
2210
|
}
|
|
2190
|
-
function
|
|
2211
|
+
function Al(e, t) {
|
|
2191
2212
|
let [n, r, l, i] = e;
|
|
2192
|
-
if (!n) return void
|
|
2213
|
+
if (!n) return void Vn("Tag must be a valid HTML element.");
|
|
2193
2214
|
let o = document.createElement(n), s = "";
|
|
2194
2215
|
if (r && "object" == typeof r) for (let e of Object.keys(r)) if ("style" === e && "object" == typeof r[e]) {
|
|
2195
2216
|
let t = "";
|
|
2196
2217
|
for (const n of Object.keys(r[e])) t += `${n}: ${r[e][n]};`;
|
|
2197
2218
|
o.style.cssText = t;
|
|
2198
2219
|
} else "style" === e ? o.style.cssText = r[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== r[e] && void 0 !== r[e] && (s = r[e], o.setAttribute("data-i18n", s)) : o.setAttribute(e, r[e]);
|
|
2199
|
-
if (
|
|
2220
|
+
if (cr(l)) if (l = l.trim(), l.length > 0 && "<" === l[0]) o.appendChild(jl(l));
|
|
2200
2221
|
else if (t && s) o.textContent = t(s) || l;
|
|
2201
2222
|
else o.textContent = l;
|
|
2202
|
-
else if (
|
|
2203
|
-
if (l.length > 0) if (
|
|
2204
|
-
else for (let e of l) Array.isArray(e) && e.length > 0 ? o.appendChild(
|
|
2205
|
-
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? o.appendChild(l) : null != l && (
|
|
2223
|
+
else if (_r(l)) {
|
|
2224
|
+
if (l.length > 0) if (cr(l[0])) o.appendChild(Al(l, t));
|
|
2225
|
+
else for (let e of l) Array.isArray(e) && e.length > 0 ? o.appendChild(Al(e, t)) : e instanceof HTMLElement && o.appendChild(e);
|
|
2226
|
+
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? o.appendChild(l) : null != l && (Vn("content ignored"), xn(l));
|
|
2206
2227
|
if (i && "object" == typeof i) for (const e of Object.keys(i)) o.addEventListener(e, i[e]);
|
|
2207
2228
|
return o;
|
|
2208
2229
|
}
|
|
2209
|
-
function
|
|
2230
|
+
function Il(e) {
|
|
2210
2231
|
if (!e) return {
|
|
2211
2232
|
top: 0,
|
|
2212
2233
|
left: 0,
|
|
@@ -2226,11 +2247,11 @@ function Rl(e) {
|
|
|
2226
2247
|
bottom: t + o + l
|
|
2227
2248
|
};
|
|
2228
2249
|
}
|
|
2229
|
-
function
|
|
2250
|
+
function $l(e) {
|
|
2230
2251
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2231
2252
|
}
|
|
2232
|
-
function
|
|
2233
|
-
|
|
2253
|
+
function kl(e, t) {
|
|
2254
|
+
pr(t) ? (e || (e = document), e.querySelectorAll("[data-i18n]").forEach(function(e) {
|
|
2234
2255
|
let n = e.getAttribute("data-i18n");
|
|
2235
2256
|
for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
|
|
2236
2257
|
n || (n = r.nodeValue), r.nodeValue = t(n);
|
|
@@ -2245,43 +2266,43 @@ function wl(e, t) {
|
|
|
2245
2266
|
}), e.querySelectorAll("[data-i18n-placeholder]").forEach(function(e) {
|
|
2246
2267
|
let n = e.getAttribute("data-i18n-placeholder");
|
|
2247
2268
|
n && e.setAttribute("placeholder", t(n));
|
|
2248
|
-
})) :
|
|
2269
|
+
})) : Vn("You must supply a translation function");
|
|
2249
2270
|
}
|
|
2250
|
-
function
|
|
2271
|
+
function Cl(e = "Time Tracker", t = !1) {
|
|
2251
2272
|
const n = e, r = performance.now();
|
|
2252
2273
|
let l = r;
|
|
2253
|
-
return t &&
|
|
2274
|
+
return t && Mn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", i = "") => {
|
|
2254
2275
|
const o = performance.now(), s = (o - l) / 1e3, a = (o - r) / 1e3;
|
|
2255
|
-
return t &&
|
|
2276
|
+
return t && Mn(`--\x3e ${n} ${e} - partial: ${s} sec, total: ${a} sec, ${i}`), l = o, {
|
|
2256
2277
|
partial: s,
|
|
2257
2278
|
total: a
|
|
2258
2279
|
};
|
|
2259
2280
|
} };
|
|
2260
2281
|
}
|
|
2261
|
-
function
|
|
2282
|
+
function Ll() {
|
|
2262
2283
|
const e = /* @__PURE__ */ new Date(), t = e.toISOString().slice(0, 19), n = String(e.getMilliseconds()).padStart(3, "0"), r = e.getTimezoneOffset();
|
|
2263
2284
|
return `${t}.${n}${r > 0 ? "-" : "+"}${String(Math.abs(r) / 60).padStart(2, "0")}${String(Math.abs(r) % 60).padStart(2, "0")}`;
|
|
2264
2285
|
}
|
|
2265
|
-
function
|
|
2286
|
+
function Pl() {
|
|
2266
2287
|
return Math.floor(Date.now() / 1e3);
|
|
2267
2288
|
}
|
|
2268
|
-
function
|
|
2289
|
+
function Ul(e, t) {
|
|
2269
2290
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2270
2291
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2271
2292
|
return -1;
|
|
2272
2293
|
}
|
|
2273
|
-
function
|
|
2294
|
+
function Fl() {
|
|
2274
2295
|
let e = "";
|
|
2275
2296
|
return "undefined" != typeof window && window.localStorage ? (e = window.localStorage.getItem("host_uuid"), !e && window.crypto?.randomUUID && (e = window.crypto.randomUUID(), window.localStorage.setItem("host_uuid", e))) : e = "undefined" != typeof globalThis && globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : "00000000-0000-0000-0000-000000000000", e;
|
|
2276
2297
|
}
|
|
2277
|
-
function
|
|
2298
|
+
function Gl(e) {
|
|
2278
2299
|
return e.replace(/[?# ^:]/g, "_");
|
|
2279
2300
|
}
|
|
2280
|
-
function
|
|
2301
|
+
function Vl(e) {
|
|
2281
2302
|
let t = null;
|
|
2282
2303
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2283
2304
|
}
|
|
2284
|
-
function
|
|
2305
|
+
function Ml(e, t = 0, n = !1) {
|
|
2285
2306
|
let r = null, l = null, i = null;
|
|
2286
2307
|
const o = (...o) => {
|
|
2287
2308
|
i = this, l = o;
|
|
@@ -2296,45 +2317,45 @@ function Pl(e, t = 0, n = !1) {
|
|
|
2296
2317
|
clearTimeout(r), r = null, l = null, i = null;
|
|
2297
2318
|
}, o;
|
|
2298
2319
|
}
|
|
2299
|
-
function
|
|
2320
|
+
function Wl(...e) {
|
|
2300
2321
|
let t = "", n = 0;
|
|
2301
2322
|
for (let r of e) null != r && "" !== r && (r = String(r), r = 0 === n ? r.replace(/\/+$/, "") : r.replace(/^\/+/, "").replace(/\/+$/, ""), "" !== r && (n > 0 && (t += "/"), t += r, n++));
|
|
2302
2323
|
return t;
|
|
2303
2324
|
}
|
|
2304
|
-
function
|
|
2305
|
-
return "persistent-attrs-" +
|
|
2325
|
+
function Kl(e) {
|
|
2326
|
+
return "persistent-attrs-" + Tt(e);
|
|
2306
2327
|
}
|
|
2307
|
-
function
|
|
2308
|
-
let n =
|
|
2309
|
-
if (r &&
|
|
2310
|
-
let l =
|
|
2311
|
-
l =
|
|
2328
|
+
function Yl(e, t) {
|
|
2329
|
+
let n = Mt(e, S.SDF_PERSIST), r = Hr(Kl(e), null, !1);
|
|
2330
|
+
if (r && ur(r)) {
|
|
2331
|
+
let l = Jr(e, r, t, !1);
|
|
2332
|
+
l = Jr(e, l, n, !1), qt(e, l, S.SDF_PERSIST);
|
|
2312
2333
|
}
|
|
2313
2334
|
}
|
|
2314
|
-
function
|
|
2315
|
-
let n =
|
|
2316
|
-
return r &&
|
|
2335
|
+
function xl(e, t) {
|
|
2336
|
+
let n = Jr(e, Mt(e, S.SDF_PERSIST), t, !1), r = Hr(Kl(e), null, !1);
|
|
2337
|
+
return r && ur(r) && zn(n, r), Qr(Kl(e), n);
|
|
2317
2338
|
}
|
|
2318
|
-
function
|
|
2319
|
-
let n =
|
|
2320
|
-
0 ===
|
|
2339
|
+
function Bl(e, t) {
|
|
2340
|
+
let n = qr(e, Hr(Kl(e), null, !1), t, !1);
|
|
2341
|
+
0 === or(n) ? zr(Kl(e)) : Qr(Kl(e), n);
|
|
2321
2342
|
}
|
|
2322
|
-
function
|
|
2323
|
-
let n =
|
|
2324
|
-
return n &&
|
|
2343
|
+
function Jl(e, t) {
|
|
2344
|
+
let n = Hr(Kl(e), null, !1), r = {};
|
|
2345
|
+
return n && ur(n) && (r = Jr(e, n, t, !1)), r;
|
|
2325
2346
|
}
|
|
2326
|
-
function
|
|
2327
|
-
if (
|
|
2347
|
+
function ql(e) {
|
|
2348
|
+
if (_r(e) && 1 === ar(e)) {
|
|
2328
2349
|
let t = e[0];
|
|
2329
|
-
return
|
|
2350
|
+
return jr(t, "size") ? t.size : 1;
|
|
2330
2351
|
}
|
|
2331
|
-
return
|
|
2352
|
+
return ar(e);
|
|
2332
2353
|
}
|
|
2333
|
-
function
|
|
2334
|
-
if (
|
|
2354
|
+
function Hl(e, t) {
|
|
2355
|
+
if (cr(t)) {
|
|
2335
2356
|
if (-1 === t.indexOf("^")) {
|
|
2336
2357
|
let n, r, l = e.fkey;
|
|
2337
|
-
if (1 !==
|
|
2358
|
+
if (1 !== or(l)) return Vn("bad fkey 1"), Vn(e), Vn(t), null;
|
|
2338
2359
|
for (const e of Object.keys(l)) {
|
|
2339
2360
|
n = e, r = l[e];
|
|
2340
2361
|
break;
|
|
@@ -2347,28 +2368,28 @@ function xl(e, t) {
|
|
|
2347
2368
|
}
|
|
2348
2369
|
{
|
|
2349
2370
|
let n = t.split("^");
|
|
2350
|
-
return 3 !== n.length ? (
|
|
2371
|
+
return 3 !== n.length ? (Vn("bad fkey 2"), Vn(e), Vn(t), null) : {
|
|
2351
2372
|
topic_name: n[0],
|
|
2352
2373
|
id: n[1],
|
|
2353
2374
|
hook_name: n[2]
|
|
2354
2375
|
};
|
|
2355
2376
|
}
|
|
2356
2377
|
}
|
|
2357
|
-
return
|
|
2378
|
+
return ur(t) ? {
|
|
2358
2379
|
topic_name: t.topic_name,
|
|
2359
2380
|
id: t.id,
|
|
2360
2381
|
hook_name: t.hook_name
|
|
2361
|
-
} : (
|
|
2382
|
+
} : (Vn("bad fkey 3"), Vn(e), Vn(t), null);
|
|
2362
2383
|
}
|
|
2363
|
-
function
|
|
2364
|
-
let n =
|
|
2384
|
+
function Ql(e, t) {
|
|
2385
|
+
let n = Hl(e, t);
|
|
2365
2386
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2366
2387
|
}
|
|
2367
|
-
function
|
|
2368
|
-
if (
|
|
2388
|
+
function zl(e, t) {
|
|
2389
|
+
if (cr(t)) {
|
|
2369
2390
|
if (-1 === t.indexOf("^")) {
|
|
2370
2391
|
let n, r = e.hook;
|
|
2371
|
-
if (1 !==
|
|
2392
|
+
if (1 !== or(r)) return Vn("bad hook 1"), Vn(e), Vn(t), null;
|
|
2372
2393
|
for (let e of Object.keys(r)) {
|
|
2373
2394
|
n = e, r[e];
|
|
2374
2395
|
break;
|
|
@@ -2380,18 +2401,18 @@ function Bl(e, t) {
|
|
|
2380
2401
|
}
|
|
2381
2402
|
{
|
|
2382
2403
|
let n = t.split("^");
|
|
2383
|
-
return 2 !== n.length ? (
|
|
2404
|
+
return 2 !== n.length ? (Vn("bad hook 2"), Vn(e), Vn(t), null) : {
|
|
2384
2405
|
topic_name: n[0],
|
|
2385
2406
|
id: n[1]
|
|
2386
2407
|
};
|
|
2387
2408
|
}
|
|
2388
2409
|
}
|
|
2389
|
-
return
|
|
2410
|
+
return ur(t) ? {
|
|
2390
2411
|
topic_name: t.topic_name,
|
|
2391
2412
|
id: t.id
|
|
2392
|
-
} : (
|
|
2413
|
+
} : (Vn("bad hook 3"), Vn(e), Vn(t), null);
|
|
2393
2414
|
}
|
|
2394
|
-
var
|
|
2415
|
+
var Xl = [
|
|
2395
2416
|
"string",
|
|
2396
2417
|
"integer",
|
|
2397
2418
|
"object",
|
|
@@ -2401,7 +2422,7 @@ var Jl = [
|
|
|
2401
2422
|
"real",
|
|
2402
2423
|
"boolean",
|
|
2403
2424
|
"blob"
|
|
2404
|
-
],
|
|
2425
|
+
], Zl = [
|
|
2405
2426
|
"persistent",
|
|
2406
2427
|
"required",
|
|
2407
2428
|
"notnull",
|
|
@@ -2413,7 +2434,7 @@ var Jl = [
|
|
|
2413
2434
|
"stats",
|
|
2414
2435
|
"rstats",
|
|
2415
2436
|
"pstats"
|
|
2416
|
-
],
|
|
2437
|
+
], ei = [
|
|
2417
2438
|
"hook",
|
|
2418
2439
|
"fkey",
|
|
2419
2440
|
"enum",
|
|
@@ -2439,7 +2460,7 @@ var Jl = [
|
|
|
2439
2460
|
"coordinates",
|
|
2440
2461
|
"gbuffer"
|
|
2441
2462
|
];
|
|
2442
|
-
function
|
|
2463
|
+
function ti(e) {
|
|
2443
2464
|
let t = {
|
|
2444
2465
|
name: e.id,
|
|
2445
2466
|
header: e.header,
|
|
@@ -2457,7 +2478,7 @@ function Ql(e) {
|
|
|
2457
2478
|
if (!e.flag) return t;
|
|
2458
2479
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2459
2480
|
let r = e.flag[n];
|
|
2460
|
-
if (
|
|
2481
|
+
if (il(ei, r)) {
|
|
2461
2482
|
switch (r) {
|
|
2462
2483
|
case "enum":
|
|
2463
2484
|
t.enum_list = e.enum;
|
|
@@ -2468,7 +2489,7 @@ function Ql(e) {
|
|
|
2468
2489
|
case "table": t.enum_list = e.table;
|
|
2469
2490
|
}
|
|
2470
2491
|
t.type = r;
|
|
2471
|
-
} else if (
|
|
2492
|
+
} else if (il(Zl, r)) switch (r) {
|
|
2472
2493
|
case "writable":
|
|
2473
2494
|
t.is_writable = !0;
|
|
2474
2495
|
break;
|
|
@@ -2481,7 +2502,7 @@ function Ql(e) {
|
|
|
2481
2502
|
}
|
|
2482
2503
|
return t;
|
|
2483
2504
|
}
|
|
2484
|
-
function
|
|
2505
|
+
function ni(e, t) {
|
|
2485
2506
|
let n = {
|
|
2486
2507
|
name: e,
|
|
2487
2508
|
header: e,
|
|
@@ -2495,13 +2516,13 @@ function zl(e, t) {
|
|
|
2495
2516
|
placeholder: void 0,
|
|
2496
2517
|
fkey: null
|
|
2497
2518
|
};
|
|
2498
|
-
if (
|
|
2519
|
+
if (cr(t)) {
|
|
2499
2520
|
let e = t.split(".");
|
|
2500
2521
|
for (let t = 0; t < e.length; t++) {
|
|
2501
2522
|
let r = e[t];
|
|
2502
|
-
if (
|
|
2503
|
-
else if (
|
|
2504
|
-
else if (
|
|
2523
|
+
if (il(Xl, r)) n.real_type || (n.real_type = r);
|
|
2524
|
+
else if (il(ei, r)) n.type || (n.type = r);
|
|
2525
|
+
else if (il(Zl, r)) switch (r) {
|
|
2505
2526
|
case "writable":
|
|
2506
2527
|
n.is_writable = !0;
|
|
2507
2528
|
break;
|
|
@@ -2513,82 +2534,84 @@ function zl(e, t) {
|
|
|
2513
2534
|
}
|
|
2514
2535
|
}
|
|
2515
2536
|
n.real_type || (n.real_type = "string");
|
|
2516
|
-
} else
|
|
2537
|
+
} else ur(t) ? (n = ti(t), n.name || (n.name = e), n.header || (n.header = e)) : _r(t) && (n.real_type = "array", n.enum_list = t);
|
|
2517
2538
|
return n.type || (n.type = n.real_type), n;
|
|
2518
2539
|
}
|
|
2519
|
-
function
|
|
2540
|
+
function ri(e, t) {
|
|
2520
2541
|
let n = {};
|
|
2521
2542
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2522
2543
|
let l;
|
|
2523
|
-
|
|
2544
|
+
ur(r) && (l = r.default);
|
|
2545
|
+
let i = Fr(null, t, e, l);
|
|
2546
|
+
n[e] = i;
|
|
2524
2547
|
}), n;
|
|
2525
2548
|
}
|
|
2526
|
-
var
|
|
2549
|
+
var li = [
|
|
2527
2550
|
N(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2528
2551
|
N(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2529
2552
|
N(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2530
|
-
|
|
2531
|
-
],
|
|
2553
|
+
O()
|
|
2554
|
+
], ii = {
|
|
2532
2555
|
periodic: !1,
|
|
2533
2556
|
msec: 0,
|
|
2534
2557
|
timer_id: -1
|
|
2535
|
-
},
|
|
2536
|
-
function
|
|
2558
|
+
}, oi = null;
|
|
2559
|
+
function si(e, t, n, r) {
|
|
2537
2560
|
let l = e.priv, i = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2538
2561
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2539
|
-
|
|
2540
|
-
}, l.msec) : l.timer_id = -1,
|
|
2562
|
+
_n(e, "EV_TIMEOUT", {}, e);
|
|
2563
|
+
}, l.msec) : l.timer_id = -1, vt(e) ? _n(yt(e), i, {}, e) : vn(e, i, {}), l.periodic || -1 !== l.timer_id || ut(e) && rt(e), 0;
|
|
2541
2564
|
}
|
|
2542
|
-
var
|
|
2565
|
+
var ai = {
|
|
2543
2566
|
mt_create: function(e) {
|
|
2544
2567
|
let t = e.priv;
|
|
2545
2568
|
const n = xt(e, "subscriber");
|
|
2546
|
-
n &&
|
|
2569
|
+
n && pn(e, null, {}, n), t.periodic = Wt(e, "periodic"), t.msec = Kt(e, "msec");
|
|
2547
2570
|
},
|
|
2548
2571
|
mt_writing: function(e, t) {
|
|
2549
2572
|
let n = e.priv;
|
|
2550
2573
|
switch (t) {
|
|
2551
2574
|
case "periodic":
|
|
2552
|
-
n.periodic =
|
|
2575
|
+
n.periodic = Wt(e, "periodic");
|
|
2553
2576
|
break;
|
|
2554
|
-
case "msec": n.msec =
|
|
2555
|
-
|
|
2556
|
-
}, n.msec)), n.msec > 0 ?
|
|
2577
|
+
case "msec": n.msec = Kt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2578
|
+
_n(e, "EV_TIMEOUT", {}, e);
|
|
2579
|
+
}, n.msec)), n.msec > 0 ? ut(e) || Xe(e) : ut(e) && rt(e);
|
|
2557
2580
|
}
|
|
2558
2581
|
},
|
|
2559
2582
|
mt_start: function(e) {
|
|
2560
2583
|
return 0;
|
|
2561
2584
|
},
|
|
2562
2585
|
mt_stop: function(e) {
|
|
2563
|
-
return
|
|
2586
|
+
return Qt(e, "msec", -1), 0;
|
|
2564
2587
|
},
|
|
2565
2588
|
mt_destroy: function(e) {}
|
|
2566
2589
|
};
|
|
2567
|
-
function
|
|
2590
|
+
function ui() {
|
|
2568
2591
|
return function(e) {
|
|
2569
|
-
if (
|
|
2592
|
+
if (oi) return Vn(`GClass ALREADY created: ${e}`), -1;
|
|
2570
2593
|
const t = [["ST_IDLE", [[
|
|
2571
2594
|
"EV_TIMEOUT",
|
|
2572
|
-
|
|
2595
|
+
si,
|
|
2573
2596
|
null
|
|
2574
2597
|
]]]];
|
|
2575
|
-
return (
|
|
2598
|
+
return (oi = ye(e, [
|
|
2576
2599
|
["EV_TIMEOUT", U.EVF_OUTPUT_EVENT],
|
|
2577
2600
|
["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT],
|
|
2578
2601
|
[0, 0]
|
|
2579
|
-
], t,
|
|
2602
|
+
], t, ai, 0, li, ii, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
2580
2603
|
}("C_TIMER");
|
|
2581
2604
|
}
|
|
2582
|
-
function
|
|
2583
|
-
return e instanceof
|
|
2605
|
+
function _i(e, t) {
|
|
2606
|
+
return e instanceof k ? "C_TIMER" !== Et(e) ? (Vn("not C_TIMER GObj"), -1) : (Ht(e, "periodic", !1), void Qt(e, "msec", t)) : (Vn("not GObj TYPE"), -1);
|
|
2584
2607
|
}
|
|
2585
|
-
function
|
|
2586
|
-
return e instanceof
|
|
2608
|
+
function ci(e, t) {
|
|
2609
|
+
return e instanceof k ? "C_TIMER" !== Et(e) ? (Vn("not C_TIMER GObj"), -1) : (Ht(e, "periodic", !0), void Qt(e, "msec", t)) : (Vn("not GObj TYPE"), -1);
|
|
2587
2610
|
}
|
|
2588
|
-
function
|
|
2589
|
-
return e instanceof
|
|
2611
|
+
function fi(e) {
|
|
2612
|
+
return e instanceof k ? "C_TIMER" !== Et(e) ? (Vn("not C_TIMER GObj"), -1) : void Qt(e, "msec", -1) : (Vn("not GObj TYPE"), -1);
|
|
2590
2613
|
}
|
|
2591
|
-
var
|
|
2614
|
+
var gi = [
|
|
2592
2615
|
N(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2593
2616
|
N(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2594
2617
|
N(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2613,44 +2636,44 @@ var ai = [
|
|
|
2613
2636
|
N(y.DTP_BOOLEAN, "no_poll", 0, 0, "no poll"),
|
|
2614
2637
|
N(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2615
2638
|
N(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2616
|
-
|
|
2617
|
-
],
|
|
2618
|
-
function
|
|
2619
|
-
return
|
|
2639
|
+
O()
|
|
2640
|
+
], di = { gobj_timer: null }, bi = null;
|
|
2641
|
+
function mi(e, t, n, r) {
|
|
2642
|
+
return vn(e, t, n), 0;
|
|
2620
2643
|
}
|
|
2621
|
-
var
|
|
2644
|
+
var pi = {
|
|
2622
2645
|
mt_create: function(e) {
|
|
2623
2646
|
let t = e.priv;
|
|
2624
|
-
|
|
2647
|
+
zt(e, "start_date", Ll()), zt(e, "node_uuid", Fl()), e.priv.gobj_timer = He(pt(e), "C_TIMER", {}, e), t.periodic_timeout = Vt(e, "periodic_timeout");
|
|
2625
2648
|
},
|
|
2626
2649
|
mt_writing: function(e, t) {},
|
|
2627
2650
|
mt_start: function(e) {
|
|
2628
|
-
return
|
|
2651
|
+
return ci(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2629
2652
|
},
|
|
2630
2653
|
mt_stop: function(e) {
|
|
2631
|
-
return
|
|
2654
|
+
return fi(e.priv.gobj_timer), it(e), 0;
|
|
2632
2655
|
},
|
|
2633
2656
|
mt_destroy: function(e) {},
|
|
2634
2657
|
mt_play: function(e) {
|
|
2635
|
-
let t =
|
|
2636
|
-
return
|
|
2658
|
+
let t = ke();
|
|
2659
|
+
return ut(t) || Xe(t), ft(t) || st(t), 0;
|
|
2637
2660
|
},
|
|
2638
2661
|
mt_pause: function(e) {
|
|
2639
|
-
return
|
|
2662
|
+
return at(ke()), 0;
|
|
2640
2663
|
}
|
|
2641
2664
|
};
|
|
2642
|
-
function
|
|
2665
|
+
function Ei() {
|
|
2643
2666
|
return function(e) {
|
|
2644
|
-
if (
|
|
2667
|
+
if (bi) return Vn(`GClass ALREADY created: ${e}`), -1;
|
|
2645
2668
|
const t = [["ST_IDLE", [[
|
|
2646
2669
|
"EV_TIMEOUT_PERIODIC",
|
|
2647
|
-
|
|
2670
|
+
mi,
|
|
2648
2671
|
null
|
|
2649
2672
|
]]]];
|
|
2650
|
-
return (
|
|
2673
|
+
return (bi = ye(e, [["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]], t, pi, 0, gi, di, 0, 0, 0, 0)) ? 0 : -1;
|
|
2651
2674
|
}("C_YUNO");
|
|
2652
2675
|
}
|
|
2653
|
-
var
|
|
2676
|
+
var Ti = "ievent_gate_stack", hi = [
|
|
2654
2677
|
N(y.DTP_STRING, "wanted_yuno_role", S.SDF_RD, "", "wanted yuno role"),
|
|
2655
2678
|
N(y.DTP_STRING, "wanted_yuno_name", S.SDF_RD, "", "wanted yuno name"),
|
|
2656
2679
|
N(y.DTP_STRING, "wanted_yuno_service", S.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2666,8 +2689,8 @@ var di = "ievent_gate_stack", bi = [
|
|
|
2666
2689
|
N(y.DTP_INTEGER, "timeout_retry_max", S.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2667
2690
|
N(y.DTP_INTEGER, "timeout_idack", S.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2668
2691
|
N(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2669
|
-
|
|
2670
|
-
],
|
|
2692
|
+
O()
|
|
2693
|
+
], yi = {
|
|
2671
2694
|
url: null,
|
|
2672
2695
|
remote_yuno_name: null,
|
|
2673
2696
|
remote_yuno_role: null,
|
|
@@ -2677,91 +2700,91 @@ var di = "ievent_gate_stack", bi = [
|
|
|
2677
2700
|
websocket: null,
|
|
2678
2701
|
inside_on_open: !1,
|
|
2679
2702
|
retry_ms: 0
|
|
2680
|
-
},
|
|
2681
|
-
function
|
|
2682
|
-
e.priv.websocket &&
|
|
2683
|
-
const t =
|
|
2703
|
+
}, Si = null;
|
|
2704
|
+
function vi(e) {
|
|
2705
|
+
e.priv.websocket && Vn("Websocket ALREADY setup");
|
|
2706
|
+
const t = Yt(e, "url");
|
|
2684
2707
|
let n;
|
|
2685
|
-
|
|
2708
|
+
Kn(`====> Starting WebSocket to '${t}' (${Tt(e)})`);
|
|
2686
2709
|
try {
|
|
2687
2710
|
n = new WebSocket(t);
|
|
2688
2711
|
} catch (n) {
|
|
2689
|
-
return
|
|
2712
|
+
return Vn(`${Tt(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2690
2713
|
}
|
|
2691
2714
|
return n ? (n.onopen = () => {
|
|
2692
|
-
|
|
2715
|
+
_n(e, "EV_ON_OPEN", { url: t }, e);
|
|
2693
2716
|
}, n.onmessage = (n) => {
|
|
2694
|
-
|
|
2717
|
+
_n(e, "EV_ON_MESSAGE", {
|
|
2695
2718
|
url: t,
|
|
2696
2719
|
data: n.data
|
|
2697
2720
|
}, e);
|
|
2698
2721
|
}, n.onclose = (n) => {
|
|
2699
|
-
Ot(e) || (
|
|
2722
|
+
Ot(e) || (Wt(gt(), "browser_beforeunload") ? Mn("Close websocket by unload page") : _n(e, "EV_ON_CLOSE", {
|
|
2700
2723
|
url: t,
|
|
2701
2724
|
e: n
|
|
2702
2725
|
}, e));
|
|
2703
|
-
}, n) : (
|
|
2726
|
+
}, n) : (Vn(`${Tt(e)}: Failed to initialize WebSocket.`), null);
|
|
2704
2727
|
}
|
|
2705
|
-
function
|
|
2728
|
+
function Oi(e, t = 1e3, n = "") {
|
|
2706
2729
|
let r = e.priv, l = r.websocket;
|
|
2707
2730
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2708
|
-
|
|
2731
|
+
Kn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2709
2732
|
try {
|
|
2710
2733
|
l.close(t, n);
|
|
2711
2734
|
} catch (e) {
|
|
2712
|
-
|
|
2735
|
+
Vn("Error closing WebSocket:", e.message);
|
|
2713
2736
|
}
|
|
2714
|
-
} else
|
|
2737
|
+
} else Mn("WebSocket is already closed or in the process of closing.");
|
|
2715
2738
|
}
|
|
2716
|
-
function
|
|
2717
|
-
let r =
|
|
2739
|
+
function Ni(e, t, n) {
|
|
2740
|
+
let r = Ll();
|
|
2718
2741
|
try {
|
|
2719
|
-
|
|
2742
|
+
Kn("\n" + r + " " + t + "\n"), xn(n);
|
|
2720
2743
|
} catch (e) {
|
|
2721
|
-
|
|
2744
|
+
Kn("ERROR in trace_inter_event: " + e);
|
|
2722
2745
|
}
|
|
2723
2746
|
}
|
|
2724
|
-
var
|
|
2747
|
+
var Ri = class {
|
|
2725
2748
|
constructor(e, t) {
|
|
2726
2749
|
this.event = e, this.kw = t || {};
|
|
2727
2750
|
}
|
|
2728
2751
|
};
|
|
2729
|
-
function
|
|
2752
|
+
function Di(e, t, n, r) {
|
|
2730
2753
|
return function(e, t) {
|
|
2731
2754
|
let n = e.priv, r = JSON.stringify(t);
|
|
2732
|
-
if (
|
|
2733
|
-
let n =
|
|
2734
|
-
i ? i(l, t, 1, r.length) :
|
|
2755
|
+
if (Wt(gt(), "trace_inter_event")) {
|
|
2756
|
+
let n = Yt(e, "url"), l = pt(gt()) + " ==> " + n, i = Vt(gt(), "trace_ievent_callback");
|
|
2757
|
+
i ? i(l, t, 1, r.length) : Ni(0, l, t);
|
|
2735
2758
|
}
|
|
2736
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2759
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Mn(`${Tt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2737
2760
|
try {
|
|
2738
2761
|
n.websocket.send(r);
|
|
2739
2762
|
} catch (t) {
|
|
2740
|
-
|
|
2763
|
+
Vn(`${Tt(e)}: send_iev(): ${t}`);
|
|
2741
2764
|
}
|
|
2742
2765
|
return 0;
|
|
2743
2766
|
}(e, function(e, t) {
|
|
2744
|
-
return
|
|
2767
|
+
return Tr(e) ? (Vn("iev_create() event NULL"), null) : new Ri(e, t);
|
|
2745
2768
|
}(t, n));
|
|
2746
2769
|
}
|
|
2747
|
-
function
|
|
2748
|
-
return
|
|
2749
|
-
dst_yuno:
|
|
2750
|
-
dst_role:
|
|
2770
|
+
function wi(e, t, n) {
|
|
2771
|
+
return Tr(n) && (n = Yt(e, "wanted_yuno_service")), {
|
|
2772
|
+
dst_yuno: Yt(e, "wanted_yuno_name"),
|
|
2773
|
+
dst_role: Yt(e, "wanted_yuno_role"),
|
|
2751
2774
|
dst_service: n,
|
|
2752
|
-
src_yuno:
|
|
2753
|
-
src_role:
|
|
2775
|
+
src_yuno: dt(),
|
|
2776
|
+
src_role: bt(),
|
|
2754
2777
|
src_service: t,
|
|
2755
|
-
host:
|
|
2778
|
+
host: Fl()
|
|
2756
2779
|
};
|
|
2757
2780
|
}
|
|
2758
|
-
function
|
|
2759
|
-
let t = e.priv, n =
|
|
2760
|
-
o && o.length || (o =
|
|
2781
|
+
function ji(e) {
|
|
2782
|
+
let t = e.priv, n = ft(gt()), r = Yt(gt(), "yuno_version"), l = Yt(gt(), "yuno_release"), i = Yt(gt(), "yuno_tag"), o = Vt(e, "required_services");
|
|
2783
|
+
o && o.length || (o = Vt(gt(), "required_services"));
|
|
2761
2784
|
let s = {
|
|
2762
|
-
yuno_role:
|
|
2763
|
-
yuno_id:
|
|
2764
|
-
yuno_name:
|
|
2785
|
+
yuno_role: bt(),
|
|
2786
|
+
yuno_id: mt(),
|
|
2787
|
+
yuno_name: dt(),
|
|
2765
2788
|
yuno_tag: i,
|
|
2766
2789
|
yuno_version: r,
|
|
2767
2790
|
yuno_release: l,
|
|
@@ -2769,37 +2792,38 @@ function vi(e) {
|
|
|
2769
2792
|
playing: n,
|
|
2770
2793
|
pid: 0,
|
|
2771
2794
|
watcher_pid: 0,
|
|
2772
|
-
jwt:
|
|
2773
|
-
username:
|
|
2795
|
+
jwt: Yt(e, "jwt"),
|
|
2796
|
+
username: Yt(gt(), "__username__"),
|
|
2774
2797
|
launch_id: 0,
|
|
2775
|
-
yuno_startdate:
|
|
2776
|
-
id:
|
|
2798
|
+
yuno_startdate: Yt(gt(), "start_date"),
|
|
2799
|
+
id: Fl(),
|
|
2777
2800
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2778
2801
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2779
2802
|
required_services: o
|
|
2780
2803
|
};
|
|
2781
|
-
return
|
|
2804
|
+
return _l(e, s, Ti, wi(e, pt(yt(e)), null)), fl(e, s, "__identity__"), _i(t.gobj_timer, Kt(e, "timeout_idack")), Di(e, "EV_IDENTITY_CARD", s);
|
|
2782
2805
|
}
|
|
2783
|
-
function
|
|
2784
|
-
if (
|
|
2806
|
+
function Ai(e, t) {
|
|
2807
|
+
if (Tr(t.event)) return -1;
|
|
2785
2808
|
let n = {}, r = t.__global__, l = t.__config__, i = t.__filter__, o = t.__service__, s = t.subscriber;
|
|
2786
|
-
|
|
2809
|
+
l && (n.__config__ = l), r && (n.__global__ = r), i && (n.__filter__ = i);
|
|
2810
|
+
return _l(e, n, Ti, wi(e, pt(s), o)), fl(e, n, "__subscribing__"), Di(e, t.event, n);
|
|
2787
2811
|
}
|
|
2788
|
-
function
|
|
2812
|
+
function Ii(e, t, n, r) {
|
|
2789
2813
|
let l = e.priv;
|
|
2790
|
-
return
|
|
2814
|
+
return ut(e) && (l.websocket = vi(e)), 0;
|
|
2791
2815
|
}
|
|
2792
|
-
function
|
|
2793
|
-
return
|
|
2816
|
+
function $i(e, t, n, r) {
|
|
2817
|
+
return Kn("Websocket opened: " + e.priv.url), ji(e), 0;
|
|
2794
2818
|
}
|
|
2795
|
-
function
|
|
2819
|
+
function ki(e, t, n, r) {
|
|
2796
2820
|
let l = e.priv, i = n.e, o = n.url;
|
|
2797
|
-
return
|
|
2821
|
+
return Fn(), Mn(`${Tt(e)}: WebSocket closed ${o} (Code: ${i.code}, Reason: "${i.reason}", Clean: ${i.wasClean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, vn(e, "EV_ON_CLOSE", {
|
|
2798
2822
|
url: o,
|
|
2799
2823
|
remote_yuno_name: l.remote_yuno_name,
|
|
2800
2824
|
remote_yuno_role: l.remote_yuno_role,
|
|
2801
2825
|
remote_yuno_service: l.remote_yuno_service
|
|
2802
|
-
})) : (
|
|
2826
|
+
})) : (Mn(`${Tt(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${i.code}, Reason: "${i.reason}", Clean: ${i.wasClean})`), vn(e, "EV_ON_OPEN_ERROR", {
|
|
2803
2827
|
url: o,
|
|
2804
2828
|
remote_yuno_name: l.remote_yuno_name,
|
|
2805
2829
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -2807,27 +2831,27 @@ function wi(e, t, n, r) {
|
|
|
2807
2831
|
code: i.code,
|
|
2808
2832
|
reason: i.reason,
|
|
2809
2833
|
was_clean: i.wasClean
|
|
2810
|
-
})),
|
|
2811
|
-
let t = e.priv, n =
|
|
2834
|
+
})), ut(e) && _i(l.gobj_timer, function(e) {
|
|
2835
|
+
let t = e.priv, n = Kt(e, "timeout_retry"), r = Kt(e, "timeout_retry_max");
|
|
2812
2836
|
r < n && (r = n);
|
|
2813
2837
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2814
2838
|
let l = .2 * t.retry_ms, i = t.retry_ms - l + 2 * Math.random() * l;
|
|
2815
2839
|
return Math.max(1, Math.round(i));
|
|
2816
2840
|
}(e)), 0;
|
|
2817
2841
|
}
|
|
2818
|
-
function
|
|
2819
|
-
return
|
|
2842
|
+
function Ci(e, t, n, r) {
|
|
2843
|
+
return ji(e), 0;
|
|
2820
2844
|
}
|
|
2821
|
-
function
|
|
2845
|
+
function Li(e, t, n, r) {
|
|
2822
2846
|
let l = e.priv;
|
|
2823
|
-
|
|
2824
|
-
let i =
|
|
2825
|
-
|
|
2826
|
-
let u =
|
|
2847
|
+
fi(l.gobj_timer);
|
|
2848
|
+
let i = cl(e, n, Ti, !0), o = Lr(e, i, "src_yuno", ""), s = Lr(e, i, "src_role", ""), a = Lr(e, i, "src_service", "");
|
|
2849
|
+
zt(e, "remote_yuno_name", o), zt(e, "remote_yuno_role", s), zt(e, "remote_yuno_service", a);
|
|
2850
|
+
let u = kr(e, n, "result", -1, 0), _ = Lr(e, n, "comment", "", 0), c = Lr(e, n, "username", "", 0), f = Fr(e, n, "services_roles", {});
|
|
2827
2851
|
if (u < 0) {
|
|
2828
|
-
|
|
2852
|
+
Oi(e);
|
|
2829
2853
|
let t = {
|
|
2830
|
-
url:
|
|
2854
|
+
url: Yt(e, "url"),
|
|
2831
2855
|
result: u,
|
|
2832
2856
|
comment: _,
|
|
2833
2857
|
username: c,
|
|
@@ -2835,9 +2859,9 @@ function Ai(e, t, n, r) {
|
|
|
2835
2859
|
remote_yuno_role: s,
|
|
2836
2860
|
remote_yuno_service: a
|
|
2837
2861
|
};
|
|
2838
|
-
|
|
2862
|
+
vt(e) ? _n(yt(e), "EV_ON_ID_NAK", t, e) : vn(e, "EV_ON_ID_NAK", t);
|
|
2839
2863
|
} else {
|
|
2840
|
-
if (
|
|
2864
|
+
if (Xt(e, "ST_SESSION"), l.inside_on_open = !0, l.retry_ms = 0, !l.inform_on_close) {
|
|
2841
2865
|
l.inform_on_close = !0;
|
|
2842
2866
|
let t = {
|
|
2843
2867
|
username: c,
|
|
@@ -2846,153 +2870,154 @@ function Ai(e, t, n, r) {
|
|
|
2846
2870
|
remote_yuno_service: a,
|
|
2847
2871
|
services_roles: f
|
|
2848
2872
|
};
|
|
2849
|
-
|
|
2873
|
+
vt(e) ? _n(yt(e), "EV_ON_OPEN", t, e) : vn(e, "EV_ON_OPEN", t);
|
|
2850
2874
|
}
|
|
2851
2875
|
l.inside_on_open = !1, function(e) {
|
|
2852
|
-
let t =
|
|
2853
|
-
for (let n = 0; n < t.length; n++)
|
|
2876
|
+
let t = hn(e, null, null, null);
|
|
2877
|
+
for (let n = 0; n < t.length; n++) Ai(e, t[n]);
|
|
2854
2878
|
}(e);
|
|
2855
2879
|
}
|
|
2856
2880
|
return 0;
|
|
2857
2881
|
}
|
|
2858
|
-
function
|
|
2882
|
+
function Pi(e, t, n, r) {
|
|
2859
2883
|
let l = e.priv.url, i = function(e, t) {
|
|
2860
2884
|
let n;
|
|
2861
2885
|
try {
|
|
2862
2886
|
n = JSON.parse(t);
|
|
2863
2887
|
} catch (e) {
|
|
2864
|
-
return
|
|
2888
|
+
return Vn("parsing inter_event json: " + e), null;
|
|
2865
2889
|
}
|
|
2866
|
-
if (!(n instanceof Object)) return
|
|
2890
|
+
if (!(n instanceof Object)) return Vn("parsing inter_event: websocket data not a json object"), null;
|
|
2867
2891
|
let r = n.event;
|
|
2868
|
-
if (!r) return
|
|
2869
|
-
if ("string" != typeof r) return
|
|
2892
|
+
if (!r) return Vn("parsing inter_event: no event"), null;
|
|
2893
|
+
if ("string" != typeof r) return Vn("parsing inter_event: event not a string"), null;
|
|
2870
2894
|
let l = n.kw;
|
|
2871
2895
|
return l ? l instanceof Object ? {
|
|
2872
2896
|
event: r,
|
|
2873
2897
|
kw: l || {}
|
|
2874
|
-
} : (
|
|
2898
|
+
} : (Vn("parsing inter_event: kw not a json object"), null) : (Vn("parsing inter_kw: no kw"), null);
|
|
2875
2899
|
}(0, n.data);
|
|
2876
|
-
if (
|
|
2877
|
-
let e =
|
|
2878
|
-
r ? r(e, i, 2, t) :
|
|
2900
|
+
if (Wt(gt(), "trace_inter_event")) {
|
|
2901
|
+
let e = pt(gt()) + " <== " + l, t = n.data.length, r = Vt(gt(), "trace_ievent_callback");
|
|
2902
|
+
r ? r(e, i, 2, t) : Ni(0, e, i);
|
|
2879
2903
|
}
|
|
2880
2904
|
let o = i.event, s = i.kw;
|
|
2881
|
-
if ("ST_SESSION" !==
|
|
2882
|
-
if (
|
|
2883
|
-
if (0 ===
|
|
2884
|
-
} else
|
|
2885
|
-
return
|
|
2905
|
+
if ("ST_SESSION" !== Zt(e)) {
|
|
2906
|
+
if (nn(e, o, U.EVF_PUBLIC_EVENT)) {
|
|
2907
|
+
if (0 === _n(e, o, s, e)) return 0;
|
|
2908
|
+
} else Vn(`${Tt(e)}: event UNKNOWN in not-session state ${o}`);
|
|
2909
|
+
return Oi(e), -1;
|
|
2886
2910
|
}
|
|
2887
2911
|
i = null;
|
|
2888
|
-
let a =
|
|
2889
|
-
if (_.toLowerCase() !==
|
|
2890
|
-
let c =
|
|
2912
|
+
let a = gl(e, s), u = cl(e, s, Ti), _ = Lr(e, u, "dst_role", "");
|
|
2913
|
+
if (_.toLowerCase() !== bt().toLowerCase()) return Vn(`"It's not my role, dst_role: ${_}, my_role: ${bt()}`), 0;
|
|
2914
|
+
let c = Lr(e, u, "dst_service", "");
|
|
2891
2915
|
if ("__subscribing__" === a) return -1;
|
|
2892
2916
|
if ("__unsubscribing__" === a) return -1;
|
|
2893
|
-
if (
|
|
2917
|
+
if (nn(e, o, U.EVF_PUBLIC_EVENT)) return _n(e, o, s, e), 0;
|
|
2894
2918
|
let f = Ce(c, !0);
|
|
2895
2919
|
if (f) {
|
|
2896
|
-
if (!
|
|
2897
|
-
|
|
2898
|
-
} else
|
|
2920
|
+
if (!nn(f, o, U.EVF_PUBLIC_EVENT)) return Vn(`${Tt(e)}: Service found but no event or not public, service '${Tt(f)}', ev '${o}'`), -1;
|
|
2921
|
+
_n(f, o, s, e);
|
|
2922
|
+
} else vt(e) ? _n(yt(e), o, s, e) : vn(e, o, s);
|
|
2899
2923
|
return 0;
|
|
2900
2924
|
}
|
|
2901
|
-
function
|
|
2925
|
+
function Ui(e, t, n, r) {
|
|
2902
2926
|
return 0;
|
|
2903
2927
|
}
|
|
2904
|
-
function
|
|
2928
|
+
function Fi(e, t, n, r) {
|
|
2905
2929
|
return 0;
|
|
2906
2930
|
}
|
|
2907
|
-
var
|
|
2931
|
+
var Gi = {
|
|
2908
2932
|
mt_create: function(e) {
|
|
2909
2933
|
let t = e.priv;
|
|
2910
|
-
t.gobj_timer =
|
|
2934
|
+
t.gobj_timer = He(pt(e), "C_TIMER", {}, e), t.url = Yt(e, "url"), t.remote_yuno_name = Yt(e, "remote_yuno_name"), t.remote_yuno_role = Yt(e, "remote_yuno_role"), t.remote_yuno_service = Yt(e, "remote_yuno_service"), zt(e, "wanted_yuno_name", t.remote_yuno_name), zt(e, "wanted_yuno_role", t.remote_yuno_role), zt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2911
2935
|
const n = xt(e, "subscriber");
|
|
2912
|
-
n &&
|
|
2936
|
+
n && pn(e, null, {}, n);
|
|
2913
2937
|
},
|
|
2914
2938
|
mt_writing: function(e, t) {
|
|
2915
2939
|
let n = e.priv;
|
|
2916
2940
|
switch (t) {
|
|
2917
2941
|
case "url":
|
|
2918
|
-
n.url =
|
|
2942
|
+
n.url = Yt(e, "url");
|
|
2919
2943
|
break;
|
|
2920
2944
|
case "remote_yuno_name":
|
|
2921
|
-
n.remote_yuno_name =
|
|
2945
|
+
n.remote_yuno_name = Yt(e, "remote_yuno_name");
|
|
2922
2946
|
break;
|
|
2923
2947
|
case "remote_yuno_role":
|
|
2924
|
-
n.remote_yuno_role =
|
|
2948
|
+
n.remote_yuno_role = Yt(e, "remote_yuno_role");
|
|
2925
2949
|
break;
|
|
2926
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
2950
|
+
case "remote_yuno_service": n.remote_yuno_service = Yt(e, "remote_yuno_service");
|
|
2927
2951
|
}
|
|
2928
2952
|
},
|
|
2929
2953
|
mt_start: function(e) {
|
|
2930
2954
|
let t = e.priv;
|
|
2931
|
-
return t.retry_ms = 0, t.websocket =
|
|
2955
|
+
return t.retry_ms = 0, t.websocket = vi(e), 0;
|
|
2932
2956
|
},
|
|
2933
2957
|
mt_stop: function(e) {
|
|
2934
2958
|
let t = e.priv;
|
|
2935
|
-
return
|
|
2959
|
+
return fi(t.gobj_timer), t.websocket && Oi(e), 0;
|
|
2936
2960
|
},
|
|
2937
2961
|
mt_destroy: function(e) {},
|
|
2938
2962
|
mt_stats: function(e, t, n, r) {
|
|
2939
|
-
if ("ST_SESSION" !==
|
|
2963
|
+
if ("ST_SESSION" !== Zt(e)) return Vn("Not in session"), null;
|
|
2940
2964
|
n || (n = {});
|
|
2941
|
-
let l =
|
|
2942
|
-
return i || (i = {}),
|
|
2965
|
+
let l = wi(e, pt(r), Lr(e, n, "service", null, 0)), i = Fr(e, n, "__md_stats__", null, Rn.KW_EXTRACT);
|
|
2966
|
+
return i || (i = {}), _l(e, n, "stats_stack", {
|
|
2943
2967
|
stats: t,
|
|
2944
2968
|
kw: i
|
|
2945
|
-
}),
|
|
2969
|
+
}), _l(e, n, Ti, l), n.__stats__ = t, fl(e, n, "__stats__"), Di(e, "EV_MT_STATS", n, r), null;
|
|
2946
2970
|
},
|
|
2947
2971
|
mt_command_parser: function(e, t, n, r) {
|
|
2948
|
-
if ("ST_SESSION" !==
|
|
2972
|
+
if ("ST_SESSION" !== Zt(e)) return Vn("Not in session"), null;
|
|
2949
2973
|
n || (n = {});
|
|
2950
|
-
let l =
|
|
2951
|
-
return i || (i = {}),
|
|
2974
|
+
let l = wi(e, pt(r), Lr(e, n, "service", "", 0)), i = Fr(e, n, "__md_command__", null, Rn.KW_EXTRACT);
|
|
2975
|
+
return i || (i = {}), _l(e, n, "command_stack", {
|
|
2952
2976
|
command: t,
|
|
2953
2977
|
kw: i
|
|
2954
|
-
}),
|
|
2978
|
+
}), _l(e, n, Ti, l), n.__command__ = t, fl(e, n, "__command__"), Di(e, "EV_MT_COMMAND", n, r), null;
|
|
2955
2979
|
},
|
|
2956
2980
|
mt_inject_event: function(e, t, n, r) {
|
|
2957
|
-
if ("ST_SESSION" !==
|
|
2958
|
-
if (n || (n = {}),
|
|
2981
|
+
if ("ST_SESSION" !== Zt(e)) return window.console.error("Not in session"), -1;
|
|
2982
|
+
if (n || (n = {}), cl(e, n, Ti));
|
|
2959
2983
|
else {
|
|
2960
|
-
let l =
|
|
2961
|
-
|
|
2984
|
+
let l = wi(e, pt(r), Lr(e, n, "__service__", 0, 0));
|
|
2985
|
+
Zn(n, "__service__"), _l(e, n, "__message__", t), _l(e, n, Ti, l);
|
|
2962
2986
|
}
|
|
2963
|
-
return
|
|
2987
|
+
return fl(e, n, "__message__"), Di(e, t, n, r);
|
|
2964
2988
|
},
|
|
2965
2989
|
mt_subscription_added: function(e, t) {
|
|
2966
2990
|
let n = e.priv;
|
|
2967
|
-
return "ST_SESSION" ===
|
|
2991
|
+
return "ST_SESSION" === Zt(e) && n.websocket ? n.inside_on_open ? 0 : Ai(e, t) : 0;
|
|
2968
2992
|
},
|
|
2969
2993
|
mt_subscription_deleted: function(e, t) {
|
|
2970
2994
|
let n = e.priv;
|
|
2971
|
-
if ("ST_SESSION" !==
|
|
2995
|
+
if ("ST_SESSION" !== Zt(e) || !n.websocket) return 0;
|
|
2972
2996
|
if (n.inside_on_open) return 0;
|
|
2973
|
-
if (
|
|
2997
|
+
if (Tr(t.event)) return 0;
|
|
2974
2998
|
let r = {}, l = t.__global__, i = t.__config__, o = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
2975
|
-
|
|
2999
|
+
i && (r.__config__ = i), l && (r.__global__ = l), o && (r.__filter__ = o);
|
|
3000
|
+
return _l(e, r, Ti, wi(e, pt(a), s)), fl(e, r, "__unsubscribing__"), Di(e, t.event, r, e);
|
|
2976
3001
|
}
|
|
2977
3002
|
};
|
|
2978
|
-
function
|
|
3003
|
+
function Vi() {
|
|
2979
3004
|
return function(e) {
|
|
2980
|
-
if (
|
|
3005
|
+
if (Si) return Vn(`GClass ALREADY created: ${e}`), -1;
|
|
2981
3006
|
const t = [
|
|
2982
3007
|
["ST_DISCONNECTED", [
|
|
2983
3008
|
[
|
|
2984
3009
|
"EV_ON_OPEN",
|
|
2985
|
-
|
|
3010
|
+
$i,
|
|
2986
3011
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2987
3012
|
],
|
|
2988
3013
|
[
|
|
2989
3014
|
"EV_ON_CLOSE",
|
|
2990
|
-
|
|
3015
|
+
ki,
|
|
2991
3016
|
null
|
|
2992
3017
|
],
|
|
2993
3018
|
[
|
|
2994
3019
|
"EV_TIMEOUT",
|
|
2995
|
-
|
|
3020
|
+
Ii,
|
|
2996
3021
|
null
|
|
2997
3022
|
],
|
|
2998
3023
|
[
|
|
@@ -3004,22 +3029,22 @@ function Li() {
|
|
|
3004
3029
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3005
3030
|
[
|
|
3006
3031
|
"EV_ON_MESSAGE",
|
|
3007
|
-
|
|
3032
|
+
Pi,
|
|
3008
3033
|
null
|
|
3009
3034
|
],
|
|
3010
3035
|
[
|
|
3011
3036
|
"EV_IDENTITY_CARD_ACK",
|
|
3012
|
-
|
|
3037
|
+
Li,
|
|
3013
3038
|
null
|
|
3014
3039
|
],
|
|
3015
3040
|
[
|
|
3016
3041
|
"EV_ON_CLOSE",
|
|
3017
|
-
|
|
3042
|
+
ki,
|
|
3018
3043
|
"ST_DISCONNECTED"
|
|
3019
3044
|
],
|
|
3020
3045
|
[
|
|
3021
3046
|
"EV_TIMEOUT",
|
|
3022
|
-
|
|
3047
|
+
Ci,
|
|
3023
3048
|
null
|
|
3024
3049
|
],
|
|
3025
3050
|
[
|
|
@@ -3031,22 +3056,22 @@ function Li() {
|
|
|
3031
3056
|
["ST_SESSION", [
|
|
3032
3057
|
[
|
|
3033
3058
|
"EV_ON_MESSAGE",
|
|
3034
|
-
|
|
3059
|
+
Pi,
|
|
3035
3060
|
null
|
|
3036
3061
|
],
|
|
3037
3062
|
[
|
|
3038
3063
|
"EV_MT_STATS",
|
|
3039
|
-
|
|
3064
|
+
Ui,
|
|
3040
3065
|
null
|
|
3041
3066
|
],
|
|
3042
3067
|
[
|
|
3043
3068
|
"EV_MT_COMMAND",
|
|
3044
|
-
|
|
3069
|
+
Fi,
|
|
3045
3070
|
null
|
|
3046
3071
|
],
|
|
3047
3072
|
[
|
|
3048
3073
|
"EV_ON_CLOSE",
|
|
3049
|
-
|
|
3074
|
+
ki,
|
|
3050
3075
|
"ST_DISCONNECTED"
|
|
3051
3076
|
],
|
|
3052
3077
|
[
|
|
@@ -3057,7 +3082,7 @@ function Li() {
|
|
|
3057
3082
|
]],
|
|
3058
3083
|
[null, null]
|
|
3059
3084
|
];
|
|
3060
|
-
return (
|
|
3085
|
+
return (Si = ye(e, [
|
|
3061
3086
|
["EV_ON_MESSAGE", U.EVF_OUTPUT_EVENT],
|
|
3062
3087
|
["EV_IDENTITY_CARD_ACK", U.EVF_PUBLIC_EVENT],
|
|
3063
3088
|
["EV_ON_ID_NAK", U.EVF_PUBLIC_EVENT | U.EVF_OUTPUT_EVENT],
|
|
@@ -3068,9 +3093,9 @@ function Li() {
|
|
|
3068
3093
|
["EV_ON_OPEN_ERROR", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3069
3094
|
["EV_TIMEOUT", 0],
|
|
3070
3095
|
[null, 0]
|
|
3071
|
-
], t,
|
|
3096
|
+
], t, Gi, 0, hi, yi, 0, 0, 0, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3072
3097
|
}("C_IEVENT_CLI");
|
|
3073
3098
|
}
|
|
3074
|
-
export {
|
|
3099
|
+
export { k as GObj, N as SDATA, j as SDATAAUTHZ, R as SDATACM, D as SDATACM2, I as SDATADF, w as SDATAPM, A as SDATAPM0, O as SDATA_END, v as SDataDesc, a as YUNETA_VERSION, E as __yuno__, i as build_command_response, Wl as build_path, s as build_stats_response, Gl as clean_name, fi as clear_timeout, Or as cmp_two_simple_json, l as command_parser, Al as createElement2, jl as createOneHtml, Ol as create_json_record, ri as create_template_record, Ll as current_timestamp, y as data_type_t, Jl as db_list_persistent_attrs, Yl as db_load_persistent_attrs, Bl as db_remove_persistent_attrs, xl as db_save_persistent_attrs, Ml as debounce, sl as delete_from_list, Jn as duplicate_objects, Tr as empty_string, Dl as escapeHtml, U as event_flag_t, Re as gclass_add_ev_action, we as gclass_add_event_type, Ne as gclass_add_state, Ae as gclass_check_fsm, ye as gclass_create, je as gclass_event_type, Ie as gclass_find_by_name, C as gclass_flag_t, Se as gclass_unregister, Il as getPositionRelativeToBody, Vl as get_function_name, Pl as get_now, Nt as gobj_bottom_gobj, en as gobj_change_parent, Xt as gobj_change_state, On as gobj_command, Qe as gobj_create, Ye as gobj_create2, Je as gobj_create_default_service, He as gobj_create_pure_child, Be as gobj_create_service, qe as gobj_create_volatil, xe as gobj_create_yuno, Zt as gobj_current_state, ke as gobj_default_service, un as gobj_deliver_posted_events, ze as gobj_destroy, Lt as gobj_find_child, kt as gobj_find_gobj, Ce as gobj_find_service, Sn as gobj_find_subscribings, hn as gobj_find_subscriptions, L as gobj_flag_t, ht as gobj_full_name, Et as gobj_gclass_name, se as gobj_global_trace_level, Gt as gobj_has_attr, nn as gobj_has_event, rn as gobj_has_output_event, Ee as gobj_hsdata, Ot as gobj_is_destroying, ft as gobj_is_playing, vt as gobj_is_pure_child, ut as gobj_is_running, ct as gobj_is_service, St as gobj_is_volatil, Me as gobj_list_persistent_attrs, yn as gobj_list_subscriptions, Fe as gobj_load_persistent_attrs, Pt as gobj_match_children, Ut as gobj_match_children_tree, Ct as gobj_match_gobj, pt as gobj_name, yt as gobj_parent, at as gobj_pause, st as gobj_play, sn as gobj_post_event, an as gobj_posted_events_size, vn as gobj_publish_event, Vt as gobj_read_attr, Mt as gobj_read_attrs, Wt as gobj_read_bool_attr, Kt as gobj_read_integer_attr, xt as gobj_read_pointer_attr, Yt as gobj_read_str_attr, Ve as gobj_remove_persistent_attrs, ge as gobj_repr_global_trace_levels, Jt as gobj_reset_volatil_attrs, Ge as gobj_save_persistent_attrs, Ft as gobj_search_path, _n as gobj_send_event, $e as gobj_services, Rt as gobj_set_bottom_gobj, ae as gobj_set_deep_trace, ce as gobj_set_gclass_no_trace, ue as gobj_set_gclass_trace, oe as gobj_set_global_no_trace, ie as gobj_set_global_trace, fe as gobj_set_gobj_no_trace, _e as gobj_set_gobj_trace, K as gobj_set_trace_machine_format, Tt as gobj_short_name, Xe as gobj_start, et as gobj_start_children, nt as gobj_start_tree, de as gobj_start_up, Nn as gobj_stats, rt as gobj_stop, it as gobj_stop_children, ot as gobj_stop_tree, pn as gobj_subscribe_event, X as gobj_trace_level, Y as gobj_trace_machine_format, Z as gobj_trace_no_level, En as gobj_unsubscribe_event, Tn as gobj_unsubscribe_list, wt as gobj_walk_gobj_children, jt as gobj_walk_gobj_children_tree, Bt as gobj_write_attr, qt as gobj_write_attrs, Ht as gobj_write_bool_attr, Qt as gobj_write_integer_attr, zt as gobj_write_str_attr, gt as gobj_yuno, mt as gobj_yuno_id, dt as gobj_yuno_name, bt as gobj_yuno_role, ll as id_index_in_obj_list, Ul as index_in_list, _r as is_array, gr as is_boolean, mr as is_date, pr as is_function, Er as is_gobj, Rr as is_metadata_key, dr as is_null, fr as is_number, ur as is_object, Dr as is_private_key, br as is_pure_number, cr as is_string, Tl as jdb_delete, yl as jdb_get, Sl as jdb_get_by_idx, hl as jdb_get_topic, pl as jdb_init, El as jdb_update, nr as json_array_append, rr as json_array_append_new, ir as json_array_extend, lr as json_array_remove, sr as json_array_size, Bn as json_deep_copy, qn as json_is_identical, Zn as json_object_del, Xn as json_object_get, er as json_object_set, tr as json_object_set_new, or as json_object_size, Hn as json_object_update, Qn as json_object_update_existing, zn as json_object_update_missing, ar as json_size, Rl as jwt2json, Nl as jwtDecode, Jr as kw_clone_by_keys, qr as kw_clone_by_not_keys, Br as kw_collect, Ir as kw_delete, Yr as kw_find_json_in_list, Ar as kw_find_path, Rn as kw_flag_t, $r as kw_get_bool, Ur as kw_get_dict, Fr as kw_get_dict_value, kr as kw_get_int, Gr as kw_get_list, Hr as kw_get_local_storage_value, Pr as kw_get_pointer, Cr as kw_get_real, Lr as kw_get_str, jr as kw_has_key, Kr as kw_match_simple, wr as kw_pop, zr as kw_remove_local_storage_value, xr as kw_select, Vr as kw_set_dict_value, Qr as kw_set_local_storage_value, Mr as kw_set_subdict_value, Zr as kwid_collect, tl as kwid_find_one_record, nl as kwid_get_ids, Xr as kwid_match_id, el as kwid_new_dict, rl as list2options, dl as load_json_file, Kn as log_debug, Vn as log_error, Wn as log_info, Mn as log_warning, gl as msg_iev_get_msg_type, cl as msg_iev_get_stack, _l as msg_iev_push_stack, al as msg_iev_read_key, fl as msg_iev_set_msg_type, ul as msg_iev_write_key, Fl as node_uuid, hr as parseBoolean, $l as parseSVG, kl as refresh_language, Vi as register_c_ievent_cli, ui as register_c_timer, Ei as register_c_yuno, wl as safeSrc, S as sdata_flag_t, bl as send_http_json_post, Ln as set_console_log_enabled, kn as set_log_callback, Fn as set_remote_log_functions, _i as set_timeout, ci as set_timeout_periodic, t as sprintf, o as stats_parser, il as str_in_list, vr as strcasecmp, Sr as strcmp, yr as strncmp, ol as strs_in_list, Nr as strstr, ni as template_get_field_desc, Cl as timeTracker, xn as trace_json, B as trace_level_t, Yn as trace_msg, Hl as treedb_decoder_fkey, zl as treedb_decoder_hook, Ql as treedb_encoder_fkey, ti as treedb_get_field_desc, ql as treedb_hook_data_size, n as vsprintf };
|
|
3075
3100
|
|
|
3076
3101
|
//# sourceMappingURL=gobj-js.es.min.js.map
|