@yuneta/gobj-js 7.26.14 → 7.26.16
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 +48 -24
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +889 -878
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +48 -24
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +928 -917
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +48 -24
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +889 -878
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +48 -24
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +889 -878
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -178,7 +178,7 @@ var O = class {
|
|
|
178
178
|
}
|
|
179
179
|
}, I = class {
|
|
180
180
|
constructor(e, t, n, r, l) {
|
|
181
|
-
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 =
|
|
181
|
+
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 = Rr(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
183
183
|
}, C = Object.freeze({
|
|
184
184
|
gcflag_manual_start: 1,
|
|
@@ -230,7 +230,7 @@ function K() {
|
|
|
230
230
|
return W;
|
|
231
231
|
}
|
|
232
232
|
function Y(e) {
|
|
233
|
-
|
|
233
|
+
Jr(e) && (e = JSON.stringify(e)), cr(" ".repeat(Math.max(1, 2 * y)) + String(e));
|
|
234
234
|
}
|
|
235
235
|
var B = Object.freeze({
|
|
236
236
|
TRACE_MACHINE: 65536,
|
|
@@ -332,7 +332,7 @@ function Q(e, t) {
|
|
|
332
332
|
return n;
|
|
333
333
|
}
|
|
334
334
|
function X(e, t, n) {
|
|
335
|
-
if (
|
|
335
|
+
if (rl(e)) return void 0 === n ? 268369920 : 65535;
|
|
336
336
|
if (/^[0-9]+$/.test(String(e))) {
|
|
337
337
|
const t = Number(e);
|
|
338
338
|
if (t) return t;
|
|
@@ -343,7 +343,7 @@ function X(e, t, n) {
|
|
|
343
343
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
344
344
|
}
|
|
345
345
|
return 0;
|
|
346
|
-
}(String(e), n) || (
|
|
346
|
+
}(String(e), n) || (ar(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
347
347
|
}
|
|
348
348
|
function Z(e) {
|
|
349
349
|
if (z) return 4294967295;
|
|
@@ -405,39 +405,39 @@ function de() {
|
|
|
405
405
|
return Q(H, null);
|
|
406
406
|
}
|
|
407
407
|
function be(e) {
|
|
408
|
-
const t =
|
|
409
|
-
return t ? Q(t.trace_level | q, t.s_user_trace_level) : (
|
|
408
|
+
const t = Hr(e) ? Me(e) : e;
|
|
409
|
+
return t ? Q(t.trace_level | q, t.s_user_trace_level) : (ar(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
410
410
|
}
|
|
411
411
|
function pe(e) {
|
|
412
|
-
const t =
|
|
413
|
-
return t ? Q(t.trace_level, t.s_user_trace_level) : (
|
|
412
|
+
const t = Hr(e) ? Me(e) : e;
|
|
413
|
+
return t ? Q(t.trace_level, t.s_user_trace_level) : (ar(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
414
414
|
}
|
|
415
415
|
function me(e) {
|
|
416
|
-
const t =
|
|
417
|
-
return t ? Q(t.no_trace_level, t.s_user_trace_level) : (
|
|
416
|
+
const t = Hr(e) ? Me(e) : e;
|
|
417
|
+
return t ? Q(t.no_trace_level, t.s_user_trace_level) : (ar(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
418
418
|
}
|
|
419
419
|
function he(e) {
|
|
420
420
|
return z = Number(e) || 0, 0;
|
|
421
421
|
}
|
|
422
422
|
function Ee(e, t, n) {
|
|
423
|
-
const r =
|
|
424
|
-
if (!r) return
|
|
423
|
+
const r = Hr(e) ? Me(e) : e;
|
|
424
|
+
if (!r) return ar(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
425
425
|
const l = null === t ? 4294967295 : X(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
426
426
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
427
427
|
}
|
|
428
428
|
function ye(e, t, n) {
|
|
429
|
-
if (!e) return
|
|
429
|
+
if (!e) return ar("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
430
430
|
const r = X(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
431
431
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
432
432
|
}
|
|
433
433
|
function Te(e, t, n) {
|
|
434
|
-
const r =
|
|
435
|
-
if (!r) return
|
|
434
|
+
const r = Hr(e) ? Me(e) : e;
|
|
435
|
+
if (!r) return ar(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
436
436
|
const l = null === t ? 4294967295 : X(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
437
437
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
438
438
|
}
|
|
439
439
|
function ve(e, t, n) {
|
|
440
|
-
if (!e) return
|
|
440
|
+
if (!e) return ar("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
441
441
|
const r = X(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
442
442
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
443
443
|
}
|
|
@@ -460,7 +460,7 @@ function Se(e, t, n, r, l, o, i) {
|
|
|
460
460
|
}
|
|
461
461
|
function Ne(e, t) {
|
|
462
462
|
let n = {};
|
|
463
|
-
if (!
|
|
463
|
+
if (!qr(t)) return ar("sdata_desc MUST be an array"), gr(t), n;
|
|
464
464
|
for (let r = 0; r < t.length; r++) {
|
|
465
465
|
const l = t[r];
|
|
466
466
|
l.name && we(e, n, l);
|
|
@@ -474,85 +474,85 @@ function we(e, t, n) {
|
|
|
474
474
|
r = String(l);
|
|
475
475
|
break;
|
|
476
476
|
case T.DTP_BOOLEAN:
|
|
477
|
-
r =
|
|
477
|
+
r = ll(l);
|
|
478
478
|
break;
|
|
479
479
|
case T.DTP_INTEGER:
|
|
480
|
-
r = parseInt(l), isNaN(r) &&
|
|
480
|
+
r = parseInt(l), isNaN(r) && ar(`${Rt(e)}: attr NaN: ${n.name}`);
|
|
481
481
|
break;
|
|
482
482
|
case T.DTP_REAL:
|
|
483
|
-
r = Number(l), isNaN(r) &&
|
|
483
|
+
r = Number(l), isNaN(r) && ar(`${Rt(e)}: attr NaN: ${n.name}`);
|
|
484
484
|
break;
|
|
485
485
|
case T.DTP_LIST:
|
|
486
|
-
if (
|
|
486
|
+
if (Hr(l)) try {
|
|
487
487
|
r = JSON.parse(l);
|
|
488
488
|
} catch (e) {
|
|
489
|
-
|
|
489
|
+
ar(`JSON parse error: ${e.message}`);
|
|
490
490
|
}
|
|
491
491
|
else r = l;
|
|
492
|
-
|
|
492
|
+
qr(r) || (r = []);
|
|
493
493
|
break;
|
|
494
494
|
case T.DTP_DICT:
|
|
495
|
-
if (
|
|
495
|
+
if (Hr(l)) try {
|
|
496
496
|
r = JSON.parse(l);
|
|
497
497
|
} catch (e) {
|
|
498
|
-
|
|
498
|
+
ar(`JSON parse error: ${e.message}`);
|
|
499
499
|
}
|
|
500
500
|
else r = l;
|
|
501
|
-
|
|
501
|
+
Jr(r) || (r = {});
|
|
502
502
|
break;
|
|
503
503
|
case T.DTP_JSON:
|
|
504
504
|
if ("" === l || void 0 === l) r = null;
|
|
505
|
-
else if (
|
|
505
|
+
else if (Hr(l)) try {
|
|
506
506
|
r = JSON.parse(l);
|
|
507
507
|
} catch (e) {
|
|
508
|
-
|
|
508
|
+
ar(`JSON parse error: ${e.message}`);
|
|
509
509
|
}
|
|
510
510
|
else r = l;
|
|
511
511
|
break;
|
|
512
512
|
case T.DTP_POINTER: r = l;
|
|
513
513
|
}
|
|
514
|
-
return void 0 === r && (
|
|
514
|
+
return void 0 === r && (ar(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
515
515
|
}
|
|
516
516
|
function je(e, t, n, r) {
|
|
517
517
|
let l;
|
|
518
518
|
switch (n.type) {
|
|
519
519
|
case T.DTP_STRING:
|
|
520
520
|
if (null == r) l = "";
|
|
521
|
-
else if (
|
|
521
|
+
else if (Hr(r)) l = String(r);
|
|
522
522
|
else {
|
|
523
523
|
let e = JSON.stringify(r);
|
|
524
524
|
e && (l = String(e));
|
|
525
525
|
}
|
|
526
526
|
break;
|
|
527
527
|
case T.DTP_BOOLEAN:
|
|
528
|
-
l =
|
|
528
|
+
l = ll(r);
|
|
529
529
|
break;
|
|
530
530
|
case T.DTP_INTEGER:
|
|
531
|
-
if (l = parseInt(r), isNaN(l)) return
|
|
531
|
+
if (l = parseInt(r), isNaN(l)) return ar(`${Rt(e)}: attr NaN: ${n.name}`), -1;
|
|
532
532
|
break;
|
|
533
533
|
case T.DTP_REAL:
|
|
534
|
-
if (l = Number(r), isNaN(l)) return
|
|
534
|
+
if (l = Number(r), isNaN(l)) return ar(`${Rt(e)}: attr NaN: ${n.name}`), -1;
|
|
535
535
|
break;
|
|
536
536
|
case T.DTP_LIST:
|
|
537
|
-
if (
|
|
537
|
+
if (Hr(r)) try {
|
|
538
538
|
l = JSON.parse(r);
|
|
539
539
|
} catch (e) {
|
|
540
|
-
|
|
540
|
+
ar(`JSON parse error: ${e.message}`);
|
|
541
541
|
}
|
|
542
542
|
else l = r;
|
|
543
|
-
if (!
|
|
543
|
+
if (!qr(l)) return ar(`attr must be an array: ${n.name}`), -1;
|
|
544
544
|
break;
|
|
545
545
|
case T.DTP_DICT:
|
|
546
|
-
if (
|
|
546
|
+
if (Hr(r)) try {
|
|
547
547
|
l = JSON.parse(r);
|
|
548
548
|
} catch (e) {
|
|
549
|
-
|
|
549
|
+
ar(`JSON parse error: ${e.message}`);
|
|
550
550
|
}
|
|
551
551
|
else l = r;
|
|
552
|
-
if (!
|
|
552
|
+
if (!Jr(l)) return ar(`attr must be an object: ${n.name}`), -1;
|
|
553
553
|
break;
|
|
554
554
|
case T.DTP_JSON:
|
|
555
|
-
if (l = r,
|
|
555
|
+
if (l = r, Hr(r)) {
|
|
556
556
|
const e = r.trim();
|
|
557
557
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
558
558
|
l = JSON.parse(e);
|
|
@@ -563,46 +563,46 @@ function je(e, t, n, r) {
|
|
|
563
563
|
break;
|
|
564
564
|
case T.DTP_POINTER: l = r;
|
|
565
565
|
}
|
|
566
|
-
return void 0 === l &&
|
|
566
|
+
return void 0 === l && ar(`${Rt(e)}: attr undefined: ${n.name}`), t[n.name] = l, Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, 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;
|
|
567
567
|
}
|
|
568
568
|
function $e(e) {
|
|
569
569
|
return e.jn_attrs;
|
|
570
570
|
}
|
|
571
571
|
function Re(e, t, n) {
|
|
572
|
-
return zt(e, t) ? $e(e) : e && e.bottom_gobj ? Re(e.bottom_gobj, t, n) : (n &&
|
|
572
|
+
return zt(e, t) ? $e(e) : e && e.bottom_gobj ? Re(e.bottom_gobj, t, n) : (n && ar(`GClass Attribute NOT FOUND: ${Rt(e)}, attr ${t}`), null);
|
|
573
573
|
}
|
|
574
574
|
function De(e, t, n) {
|
|
575
|
-
if (!(e && e instanceof k)) return n &&
|
|
575
|
+
if (!(e && e instanceof k)) return n && ar("gclass NULL"), null;
|
|
576
576
|
if (!t) return e.attrs_table;
|
|
577
577
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
578
578
|
const r = e.attrs_table[n];
|
|
579
579
|
if (r.name && r.name === t) return r;
|
|
580
580
|
}
|
|
581
|
-
return n &&
|
|
581
|
+
return n && ar(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
582
582
|
}
|
|
583
583
|
function Ae(e, t, n, r, l, o, i, s, a, u, _) {
|
|
584
|
-
if (
|
|
585
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
586
|
-
if (Me(e)) return
|
|
584
|
+
if (rl(e)) return ar("gclass_name EMPTY"), null;
|
|
585
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return ar(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
586
|
+
if (Me(e)) return ar(`GClass ALREADY exists: ${e}`), null;
|
|
587
587
|
let c = new k(e, r, l, o, i, s, a, u, _);
|
|
588
588
|
(function(e, t) {
|
|
589
|
-
e && e instanceof k ? t ? p[t] ?
|
|
589
|
+
e && e instanceof k ? t ? p[t] ? ar(`gclass ALREADY REGISTERED: ${t}`) : p[t] = e : ar("gclass_name undefined") : ar("gclass undefined");
|
|
590
590
|
})(c, e);
|
|
591
591
|
const f = n.length;
|
|
592
592
|
for (let e = 0; e < f; e++) {
|
|
593
593
|
let t = n[e][0], r = n[e][1];
|
|
594
|
-
if (
|
|
594
|
+
if (rl(t)) continue;
|
|
595
595
|
if (Le(c, t) < 0) return ke(c), null;
|
|
596
596
|
const l = r.length;
|
|
597
597
|
for (let e = 0; e < l; e++) {
|
|
598
598
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
599
|
-
|
|
599
|
+
rl(n) || Pe(c, t, n, l, o);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
for (let e = 0; e < t.length; e++) {
|
|
603
603
|
let n = t[e][0], r = t[e][1];
|
|
604
|
-
if (!
|
|
605
|
-
if (Ve(c, n)) return
|
|
604
|
+
if (!rl(n)) {
|
|
605
|
+
if (Ve(c, n)) return ar(`SMachine: event repeated in input_events: ${n}`), ke(c), null;
|
|
606
606
|
Fe(c, n, r);
|
|
607
607
|
}
|
|
608
608
|
}
|
|
@@ -614,13 +614,13 @@ function Ae(e, t, n, r, l, o, i, s, a, u, _) {
|
|
|
614
614
|
}
|
|
615
615
|
function ke(e) {
|
|
616
616
|
let t;
|
|
617
|
-
if (
|
|
617
|
+
if (Hr(e)) t = e;
|
|
618
618
|
else {
|
|
619
|
-
if (!(e instanceof k)) return
|
|
619
|
+
if (!(e instanceof k)) return ar("Cannot unregister gclass, type unknown"), -1;
|
|
620
620
|
t = e.gclass_name;
|
|
621
621
|
}
|
|
622
622
|
let n = p[t];
|
|
623
|
-
return n ? n.instances > 0 ? (
|
|
623
|
+
return n ? n.instances > 0 ? (ar(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete p[t], 0) : (ar(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
624
624
|
}
|
|
625
625
|
function Ie(e, t) {
|
|
626
626
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -639,22 +639,22 @@ function Ce(e, t) {
|
|
|
639
639
|
return null;
|
|
640
640
|
}
|
|
641
641
|
function Le(e, t) {
|
|
642
|
-
return e instanceof k ? Ie(e, t) ? (
|
|
642
|
+
return e instanceof k ? Ie(e, t) ? (ar(`state already exists: ${t}`), -1) : (e.dl_states.push(new G(t)), 0) : (ar("Cannot add state, typeof not GClass"), -1);
|
|
643
643
|
}
|
|
644
644
|
function Pe(e, t, n, r, l) {
|
|
645
|
-
if (!(e instanceof k)) return
|
|
646
|
-
if (
|
|
645
|
+
if (!(e instanceof k)) return ar("Cannot add state, typeof not GClass"), -1;
|
|
646
|
+
if (rl(t)) return ar("state_name EMPTY"), -1;
|
|
647
647
|
let o = Ie(e, t);
|
|
648
|
-
return o ? Ce(o, n) ? (
|
|
648
|
+
return o ? Ce(o, n) ? (ar(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new V(n, r, l)), 0) : (ar(`state not found: ${t}`), -1);
|
|
649
649
|
}
|
|
650
650
|
function Ue(e, t, n) {
|
|
651
|
-
|
|
651
|
+
rl(t) || e.push(new M(t, n));
|
|
652
652
|
}
|
|
653
653
|
function Fe(e, t, n) {
|
|
654
|
-
return e instanceof k ? Ue(e.dl_events, t, n) : (
|
|
654
|
+
return e instanceof k ? Ue(e.dl_events, t, n) : (ar("Cannot add state, typeof not GClass"), -1);
|
|
655
655
|
}
|
|
656
656
|
function Ve(e, t) {
|
|
657
|
-
if (!(e instanceof k)) return
|
|
657
|
+
if (!(e instanceof k)) return ar("Cannot add state, typeof not GClass"), 0;
|
|
658
658
|
const n = e.dl_events.length, r = e.dl_events;
|
|
659
659
|
for (let e = 0; e < n; e++) {
|
|
660
660
|
let n = r[e];
|
|
@@ -663,25 +663,25 @@ function Ve(e, t) {
|
|
|
663
663
|
return null;
|
|
664
664
|
}
|
|
665
665
|
function Ge(e) {
|
|
666
|
-
if (!(e instanceof k)) return
|
|
666
|
+
if (!(e instanceof k)) return ar("Cannot add state, typeof not GClass"), -1;
|
|
667
667
|
let t = 0;
|
|
668
|
-
|
|
668
|
+
Kr(e.dl_states) || (ar(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
669
669
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
670
670
|
let r = e.dl_states[n];
|
|
671
|
-
if (!
|
|
671
|
+
if (!rl(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
672
672
|
let l = r.dl_actions[n];
|
|
673
|
-
|
|
673
|
+
rl(l.event_name) || (Ve(e, l.event_name) || (ar(`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 && (Ie(e, l.next_state) || (ar(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
677
677
|
let r = e.dl_events[n];
|
|
678
|
-
if (!
|
|
678
|
+
if (!rl(r.event_name) && (zr(r.event_flag) || (ar(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & U.EVF_OUTPUT_EVENT))) {
|
|
679
679
|
let n = !1;
|
|
680
680
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
681
681
|
let l = e.dl_states[t];
|
|
682
|
-
|
|
682
|
+
rl(l.state_name) || Ce(l, r.event_name) && (n = !0);
|
|
683
683
|
}
|
|
684
|
-
n || (
|
|
684
|
+
n || (ar(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
return t;
|
|
@@ -691,83 +691,83 @@ function Me(e, t) {
|
|
|
691
691
|
try {
|
|
692
692
|
n = p[e];
|
|
693
693
|
} catch (e) {}
|
|
694
|
-
return n || (t &&
|
|
694
|
+
return n || (t && ar(`gclass not found: ${e}`), null);
|
|
695
695
|
}
|
|
696
696
|
function We() {
|
|
697
697
|
let e = [];
|
|
698
|
-
for (const t of Object.keys(m))
|
|
698
|
+
for (const t of Object.keys(m)) Gr(e, t);
|
|
699
699
|
return e;
|
|
700
700
|
}
|
|
701
701
|
function xe() {
|
|
702
702
|
return !E || E.obflag & P.obflag_destroyed ? null : E;
|
|
703
703
|
}
|
|
704
704
|
function Ke(e, t) {
|
|
705
|
-
if (!
|
|
705
|
+
if (!Hr(e)) return ar(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
706
706
|
e = e.toLowerCase();
|
|
707
|
-
return m[e] || (t &&
|
|
707
|
+
return m[e] || (t && ar(`gobj service not found: ${e}`), null);
|
|
708
708
|
}
|
|
709
709
|
function Ye(e) {
|
|
710
710
|
let t = jt(e);
|
|
711
|
-
return t = t.toLowerCase(), m[t] &&
|
|
711
|
+
return t = t.toLowerCase(), m[t] && ar(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), m[t] = e, 0;
|
|
712
712
|
}
|
|
713
713
|
function Be(e, t) {
|
|
714
|
-
t.parent &&
|
|
714
|
+
t.parent && ar(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
715
715
|
}
|
|
716
716
|
function Je(e, t) {
|
|
717
|
-
let n =
|
|
718
|
-
n >= 0 && (
|
|
717
|
+
let n = Co(e.dl_children, t);
|
|
718
|
+
n >= 0 && (Mr(e.dl_children, n), t.parent = null);
|
|
719
719
|
}
|
|
720
720
|
function qe(e, t) {
|
|
721
|
-
return Tt(e) ? u ? u(e, t) : -1 : (
|
|
721
|
+
return Tt(e) ? u ? u(e, t) : -1 : (ar(`${Rt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
722
722
|
}
|
|
723
723
|
function He(e, t) {
|
|
724
|
-
return Tt(e) ? _ ? _(e, t) : -1 : (
|
|
724
|
+
return Tt(e) ? _ ? _(e, t) : -1 : (ar(`${Rt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
725
725
|
}
|
|
726
726
|
function ze(e, t) {
|
|
727
|
-
return Tt(e) ? c ? c(e, t) : -1 : (
|
|
727
|
+
return Tt(e) ? c ? c(e, t) : -1 : (ar(`${Rt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
728
728
|
}
|
|
729
729
|
function Qe(e, t) {
|
|
730
730
|
return f ? f(e, t) : null;
|
|
731
731
|
}
|
|
732
732
|
function Xe(e, t) {
|
|
733
|
-
"__json_config_variables__" !== t &&
|
|
733
|
+
"__json_config_variables__" !== t && ar(`GClass Attribute NOT FOUND: ${Rt(e)}, attr ${t}`);
|
|
734
734
|
}
|
|
735
735
|
function Ze(e, t, n) {
|
|
736
736
|
let r = t;
|
|
737
737
|
(function(e, t, n, r, l) {
|
|
738
|
-
if (!e || !t) return
|
|
738
|
+
if (!e || !t) return ar("hsdata or kw NULL"), -1;
|
|
739
739
|
let o = 0;
|
|
740
740
|
for (const [i, s] of Object.entries(t)) {
|
|
741
741
|
const t = De(l.gclass, i, !1);
|
|
742
|
-
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED &&
|
|
742
|
+
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED && ur(`${Rt(l)}: Deprecated attribute used in gobj creation: ${i}`), o += je(l, e, t, s)) : r && (r(l, i), o--);
|
|
743
743
|
}
|
|
744
744
|
return o;
|
|
745
|
-
})($e(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : Xe, e) < 0 && (
|
|
745
|
+
})($e(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : Xe, e) < 0 && (ar(`${Rt(e)} json2data() FAILED`), $r(r));
|
|
746
746
|
}
|
|
747
747
|
function et(e, n, r, l, o) {
|
|
748
748
|
if (o & L.gobj_flag_yuno) {
|
|
749
|
-
if (h) return
|
|
749
|
+
if (h) return ar("__yuno__ already created"), null;
|
|
750
750
|
o |= L.gobj_flag_service;
|
|
751
751
|
} else {
|
|
752
|
-
if (!l) return
|
|
753
|
-
if (!("string" == typeof l || l instanceof I)) return
|
|
754
|
-
if (
|
|
752
|
+
if (!l) return ar("gobj NEEDS a parent!"), null;
|
|
753
|
+
if (!("string" == typeof l || l instanceof I)) return ar(`BAD TYPE of parent: ${l}`), null;
|
|
754
|
+
if (Hr(l)) {
|
|
755
755
|
const e = l;
|
|
756
|
-
if (!(l = Ke(e))) return
|
|
756
|
+
if (!(l = Ke(e))) return ur(`parent service not found: ${e}`), null;
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
if (o & L.gobj_flag_service && Ke(e, !1)) return
|
|
759
|
+
if (o & L.gobj_flag_service && Ke(e, !1)) return ar(`service ALREADY registered: ${n}^${e}`), null;
|
|
760
760
|
if (o & L.gobj_flag_default_service) {
|
|
761
|
-
if (E) return
|
|
761
|
+
if (E) return ar(`default service ALREADY registered: ${n}^${e}`), null;
|
|
762
762
|
o |= L.gobj_flag_service;
|
|
763
763
|
}
|
|
764
|
-
if (
|
|
764
|
+
if (rl(n)) return ar("gclass_name must be a string"), null;
|
|
765
765
|
let i = Me(n, !1);
|
|
766
|
-
if (!i) return
|
|
767
|
-
if (!
|
|
768
|
-
if (!
|
|
769
|
-
if (e.includes("`")) return
|
|
770
|
-
if (e.includes("^")) return
|
|
766
|
+
if (!i) return ar(`GClass not registered: ${n}^${e}`), null;
|
|
767
|
+
if (!Hr(e)) return ar(`gobj_name must be a string: ${n}`), null;
|
|
768
|
+
if (!rl(e)) {
|
|
769
|
+
if (e.includes("`")) return ar(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
770
|
+
if (e.includes("^")) return ar(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
771
771
|
}
|
|
772
772
|
let s = new I(e, i, r, l, o);
|
|
773
773
|
s.jn_attrs = Ne(s, i.attrs_table);
|
|
@@ -794,8 +794,8 @@ function it(e, t, n, r) {
|
|
|
794
794
|
return et(e, t, n, r, 0);
|
|
795
795
|
}
|
|
796
796
|
function st(e) {
|
|
797
|
-
if (Ct(e)) return void
|
|
798
|
-
e.__refs__ > 0 &&
|
|
797
|
+
if (Ct(e)) return void ar("gobj NULL or DESTROYED");
|
|
798
|
+
e.__refs__ > 0 && ar(`${Rt(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (ar(`Destroying a PLAYING gobj: ${Dt(e)}`), ht(e)), e.running && (ar(`Destroying a RUNNING gobj: ${Dt(e)}`), gt(e)), e.obflag |= P.obflag_destroying, function(e) {
|
|
799
799
|
if (0 === pn.length) return;
|
|
800
800
|
for (let t of pn) t.src === e && (t.src = null);
|
|
801
801
|
pn = pn.filter((t) => t.dst !== e);
|
|
@@ -805,7 +805,7 @@ function st(e) {
|
|
|
805
805
|
let r = At(e);
|
|
806
806
|
r && r.gclass.gmt.mt_child_removed && (n && Y(t("👦👦🔴 child_removed(%s): %s", Dt(r), Rt(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & L.gobj_flag_service && function(e) {
|
|
807
807
|
let t = jt(e);
|
|
808
|
-
t = t.toLowerCase(), m[t] ? delete m[t] :
|
|
808
|
+
t = t.toLowerCase(), m[t] ? delete m[t] : ar(`"service NOT found in register": ${t}`);
|
|
809
809
|
}(e), e === E && (E = null), kn(e, e.dl_subscriptions, !0), kn(e, e.dl_subscribings, !0), r && (Je(r, e), kt(e) && (Lt(r) !== e || Ct(r) || Pt(r, null))), function(e) {
|
|
810
810
|
let t = e.dl_children.slice();
|
|
811
811
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -815,9 +815,9 @@ function st(e) {
|
|
|
815
815
|
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && Y(t("💔💔⏪ destroyed: %s", Dt(e))), e.obflag |= P.obflag_destroyed, e.obflag & P.obflag_created && e.gclass.instances--;
|
|
816
816
|
}
|
|
817
817
|
function at(e) {
|
|
818
|
-
if (Ct(e)) return
|
|
819
|
-
if (e.running) return
|
|
820
|
-
if (e.disabled) return
|
|
818
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
819
|
+
if (e.running) return ar(`${Rt(e)}: GObj ALREADY RUNNING`), -1;
|
|
820
|
+
if (e.disabled) return ar(`${Rt(e)}: GObj DISABLED`), -1;
|
|
821
821
|
re(e) && Y(t("⏺ ⏺ start: %s", Dt(e))), e.running = !0;
|
|
822
822
|
let n = 0;
|
|
823
823
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
@@ -826,18 +826,18 @@ function ut(e, t, n) {
|
|
|
826
826
|
return e.gclass.gclass_flag & C.gcflag_manual_start || Ct(e) || Et(e) || yt(e) || at(e), 0;
|
|
827
827
|
}
|
|
828
828
|
function _t(e) {
|
|
829
|
-
return Ct(e) ? (
|
|
829
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : Ft(e, F.WALK_FIRST2LAST, ut, 0, 0);
|
|
830
830
|
}
|
|
831
831
|
function ct(e, t, n) {
|
|
832
832
|
return e.gclass.gclass_flag & C.gcflag_manual_start || yt(e) ? 1 : (Et(e) || at(e), 0);
|
|
833
833
|
}
|
|
834
834
|
function ft(e) {
|
|
835
|
-
return Ct(e) ? (
|
|
835
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : (re(e) && Y(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Dt(e))), e.gclass.gclass_flag & C.gcflag_manual_start || e.disabled ? 0 : (e.running || at(e), Vt(e, F.WALK_TOP2BOTTOM, ct, 0, 0)));
|
|
836
836
|
}
|
|
837
837
|
function gt(e) {
|
|
838
|
-
if (Ct(e)) return
|
|
839
|
-
if (!e.running) return
|
|
840
|
-
e.playing && (
|
|
838
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
839
|
+
if (!e.running) return ar(`${Rt(e)}: GObj NOT RUNNING`), -1;
|
|
840
|
+
e.playing && (ur(`${Rt(e)}: GObj stopping without previous pause`), ht(e)), re(e) && Y(t("⏹ ⏹ stop: %s", Dt(e))), e.running = !1;
|
|
841
841
|
let n = 0;
|
|
842
842
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
843
843
|
}
|
|
@@ -845,25 +845,25 @@ function dt(e, t, n) {
|
|
|
845
845
|
return Et(e) && gt(e), 0;
|
|
846
846
|
}
|
|
847
847
|
function bt(e) {
|
|
848
|
-
return Ct(e) ? (
|
|
848
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : Ft(e, F.WALK_FIRST2LAST, dt, 0, 0);
|
|
849
849
|
}
|
|
850
850
|
function pt(e) {
|
|
851
|
-
return Ct(e) ? (
|
|
851
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : (re(e) && Y(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Dt(e))), Et(e) && gt(e), Vt(e, F.WALK_TOP2BOTTOM, dt, 0, 0));
|
|
852
852
|
}
|
|
853
853
|
function mt(e) {
|
|
854
|
-
if (Ct(e)) return
|
|
855
|
-
if (e.playing) return
|
|
856
|
-
if (e.disabled) return
|
|
854
|
+
if (Ct(e)) return ar(`gobj NULL or DESTROYED: ${Rt(e)}`), -1;
|
|
855
|
+
if (e.playing) return ar(`${Rt(e)}: GObj ALREADY PLAYING`), -1;
|
|
856
|
+
if (e.disabled) return ar(`${Rt(e)}: GObj DISABLED`), -1;
|
|
857
857
|
if (!Et(e)) {
|
|
858
|
-
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return
|
|
859
|
-
|
|
858
|
+
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return ar(`${Rt(e)}: Cannot play, start not done`), -1;
|
|
859
|
+
ur(`${Rt(e)}: GObj playing without previous start`), at(e);
|
|
860
860
|
}
|
|
861
861
|
re(e) && Y(t("⏯ ⏯ play: %s", Dt(e))), e.playing = !0;
|
|
862
862
|
let n = 0;
|
|
863
863
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
864
864
|
}
|
|
865
865
|
function ht(e) {
|
|
866
|
-
return Ct(e) ? (
|
|
866
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : e.playing ? (re(e) && Y(t("⏸ ⏸ pause: %s", Dt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (ar(`${Rt(e)}: GObj NOT PLAYING`), -1);
|
|
867
867
|
}
|
|
868
868
|
function Et(e) {
|
|
869
869
|
return !Ct(e) && e.running;
|
|
@@ -893,50 +893,50 @@ function wt() {
|
|
|
893
893
|
return e ? tn(e, "yuno_id") : "";
|
|
894
894
|
}
|
|
895
895
|
function jt(e) {
|
|
896
|
-
return
|
|
896
|
+
return nl(e) ? e.gobj_name : (ar("gobj bad type"), null);
|
|
897
897
|
}
|
|
898
898
|
function $t(e) {
|
|
899
|
-
return
|
|
899
|
+
return nl(e) ? e.gclass.gclass_name : (ar("gobj NULL of bad type"), null);
|
|
900
900
|
}
|
|
901
901
|
function Rt(e) {
|
|
902
|
-
return
|
|
902
|
+
return nl(e) ? e.gclass.gclass_name + "^" + jt(e) : (ar("gobj bad type"), null);
|
|
903
903
|
}
|
|
904
904
|
function Dt(e) {
|
|
905
|
-
if (!
|
|
905
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), null;
|
|
906
906
|
let t = Rt(e), n = At(e);
|
|
907
907
|
for (; n;) t = Rt(n) + "`" + t, n = At(n);
|
|
908
908
|
return t;
|
|
909
909
|
}
|
|
910
910
|
function At(e) {
|
|
911
|
-
return
|
|
911
|
+
return nl(e) ? e.parent : (ar("gobj NULL of bad type"), null);
|
|
912
912
|
}
|
|
913
913
|
function kt(e) {
|
|
914
|
-
return
|
|
914
|
+
return nl(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (ar("gobj NULL of bad type"), null);
|
|
915
915
|
}
|
|
916
916
|
function It(e) {
|
|
917
|
-
return
|
|
917
|
+
return nl(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (ar("gobj NULL of bad type"), null);
|
|
918
918
|
}
|
|
919
919
|
function Ct(e) {
|
|
920
|
-
return !
|
|
920
|
+
return !nl(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
921
921
|
}
|
|
922
922
|
function Lt(e) {
|
|
923
|
-
return
|
|
923
|
+
return nl(e) ? e.bottom_gobj : (ar("gobj NULL of bad type"), null);
|
|
924
924
|
}
|
|
925
925
|
function Pt(e, t) {
|
|
926
|
-
if (!
|
|
927
|
-
e.bottom_gobj && t &&
|
|
926
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), null;
|
|
927
|
+
e.bottom_gobj && t && ur(`${Rt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
928
928
|
}
|
|
929
929
|
function Ut(e, t, n) {
|
|
930
|
-
return
|
|
930
|
+
return nl(e) ? t ? De(e.gclass, t, n) : e.gclass.attrs_table : (ar("gobj NULL of bad type"), null);
|
|
931
931
|
}
|
|
932
932
|
function Ft(e, t, n, r, l) {
|
|
933
|
-
return Ct(e) ? (
|
|
933
|
+
return Ct(e) ? (ar("gobj NULL, destroying, or bad type"), 0) : Mt(e.dl_children, t, n, r, l);
|
|
934
934
|
}
|
|
935
935
|
function Vt(e, t, n, r, l) {
|
|
936
|
-
return Ct(e) ? (
|
|
936
|
+
return Ct(e) ? (ar("gobj NULL, destroying, or bad type"), 0) : xt(e.dl_children, t, n, r, l);
|
|
937
937
|
}
|
|
938
938
|
function Gt(e) {
|
|
939
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
939
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || ar(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
940
940
|
}
|
|
941
941
|
function Mt(e, t, n, r, l) {
|
|
942
942
|
let o, i = [...e];
|
|
@@ -974,12 +974,12 @@ function xt(e, t, n, r, l) {
|
|
|
974
974
|
return 0;
|
|
975
975
|
}
|
|
976
976
|
function Kt(e, t) {
|
|
977
|
-
if (
|
|
977
|
+
if (rl(t)) return null;
|
|
978
978
|
const n = t.toLowerCase();
|
|
979
979
|
return "__default_service__" === n ? E : "__yuno__" === n || "__root__" === n ? h : Ht(h, t);
|
|
980
980
|
}
|
|
981
981
|
function Yt(e, t) {
|
|
982
|
-
if (!
|
|
982
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), !1;
|
|
983
983
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
984
984
|
t.__disabled__;
|
|
985
985
|
let o = t.__state__;
|
|
@@ -995,7 +995,7 @@ function Yt(e, t) {
|
|
|
995
995
|
return !0;
|
|
996
996
|
}
|
|
997
997
|
function Bt(e, t) {
|
|
998
|
-
if (Ct(e)) return
|
|
998
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), null;
|
|
999
999
|
const n = e.dl_children;
|
|
1000
1000
|
for (let e = 0; e < n.length; e++) {
|
|
1001
1001
|
const r = n[e];
|
|
@@ -1004,7 +1004,7 @@ function Bt(e, t) {
|
|
|
1004
1004
|
return null;
|
|
1005
1005
|
}
|
|
1006
1006
|
function Jt(e, t) {
|
|
1007
|
-
if (Ct(e)) return
|
|
1007
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), null;
|
|
1008
1008
|
t = t || {};
|
|
1009
1009
|
let n = [];
|
|
1010
1010
|
const r = e.dl_children;
|
|
@@ -1045,7 +1045,7 @@ function Ht(e, t) {
|
|
|
1045
1045
|
return o ? (n.splice(0, 1), n = n.join("`"), Ht(o, n)) : null;
|
|
1046
1046
|
}
|
|
1047
1047
|
function zt(e, t) {
|
|
1048
|
-
return !
|
|
1048
|
+
return !rl(t) && !!De(e.gclass, t, !1);
|
|
1049
1049
|
}
|
|
1050
1050
|
function Qt(e, t, n) {
|
|
1051
1051
|
let r = e.jn_attrs;
|
|
@@ -1053,7 +1053,7 @@ function Qt(e, t, n) {
|
|
|
1053
1053
|
let n = r[t];
|
|
1054
1054
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
1055
1055
|
}
|
|
1056
|
-
return
|
|
1056
|
+
return ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
1057
1057
|
}
|
|
1058
1058
|
function Xt(e, t, n) {
|
|
1059
1059
|
let r = {}, l = e.gclass.attrs_table;
|
|
@@ -1061,41 +1061,41 @@ function Xt(e, t, n) {
|
|
|
1061
1061
|
const o = l[n];
|
|
1062
1062
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
1063
1063
|
let t;
|
|
1064
|
-
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t =
|
|
1064
|
+
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t = Lr(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Lr(e.jn_attrs, o.name))), Ur(r, o.name, t);
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
return r;
|
|
1068
1068
|
}
|
|
1069
1069
|
function Zt(e, t) {
|
|
1070
1070
|
if (t) {
|
|
1071
|
-
if (0 ===
|
|
1072
|
-
if (0 ===
|
|
1073
|
-
if (0 ===
|
|
1074
|
-
if (0 ===
|
|
1071
|
+
if (0 === sl(t, "__disabled__")) return yt(e);
|
|
1072
|
+
if (0 === sl(t, "__running__")) return Et(e);
|
|
1073
|
+
if (0 === sl(t, "__playing__")) return vt(e);
|
|
1074
|
+
if (0 === sl(t, "__service__")) return Tt(e);
|
|
1075
1075
|
}
|
|
1076
1076
|
let n = Re(e, t, !1);
|
|
1077
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1077
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1078
1078
|
}
|
|
1079
1079
|
function en(e, t) {
|
|
1080
|
-
t &&
|
|
1080
|
+
t && sl(t, "__trace_level__");
|
|
1081
1081
|
let n = Re(e, t, !1);
|
|
1082
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1082
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1083
1083
|
}
|
|
1084
1084
|
function tn(e, t) {
|
|
1085
|
-
if (t && 0 ===
|
|
1085
|
+
if (t && 0 === sl(t, "__state__")) return cn(e);
|
|
1086
1086
|
let n = Re(e, t, !1);
|
|
1087
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1087
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1088
1088
|
}
|
|
1089
1089
|
function nn(e, t) {
|
|
1090
1090
|
let n = Re(e, t, !1);
|
|
1091
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1091
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1092
1092
|
}
|
|
1093
1093
|
function rn(e, n, r, l) {
|
|
1094
|
-
if (!
|
|
1094
|
+
if (!Hr(n)) return ar(t("gobj_write_attr(%s): path must be a string", Rt(e))), -1;
|
|
1095
1095
|
let o, i = e.jn_attrs, s = n.split("`");
|
|
1096
1096
|
if (s.length <= 1) {
|
|
1097
1097
|
let l = n;
|
|
1098
|
-
return l in i && Object.prototype.hasOwnProperty.call(i, l) ? (i[l] = r,
|
|
1098
|
+
return l in i && Object.prototype.hasOwnProperty.call(i, l) ? (i[l] = r, Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, 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) : (ar(t("gobj_write_attr(%s): attr not found '%s'", Rt(e), l)), -1);
|
|
1099
1099
|
}
|
|
1100
1100
|
let a = s.length;
|
|
1101
1101
|
for (let t = 0; t < a; t++) {
|
|
@@ -1106,18 +1106,18 @@ function rn(e, n, r, l) {
|
|
|
1106
1106
|
continue;
|
|
1107
1107
|
}
|
|
1108
1108
|
let l = e.jn_attrs;
|
|
1109
|
-
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r,
|
|
1109
|
+
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r, Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o) && (e.priv[o] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
1110
1110
|
break;
|
|
1111
1111
|
}
|
|
1112
|
-
return
|
|
1112
|
+
return ar(t("gobj_write_attr(%s): attr not found '%s'", Rt(e), o)), -1;
|
|
1113
1113
|
}
|
|
1114
1114
|
function ln(e) {
|
|
1115
1115
|
return function(e, t, n) {
|
|
1116
|
-
if (Ct(e)) return
|
|
1116
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
1117
1117
|
let r = e.gclass.attrs_table;
|
|
1118
1118
|
for (let l = 0; l < r.length; l++) {
|
|
1119
1119
|
const o = r[l];
|
|
1120
|
-
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (we(e, e.jn_attrs, o),
|
|
1120
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (we(e, e.jn_attrs, o), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o.name) && (e.priv[o.name] = e.jn_attrs[o.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name)));
|
|
1121
1121
|
}
|
|
1122
1122
|
return 0;
|
|
1123
1123
|
}(e, v.SDF_VOLATIL, 0);
|
|
@@ -1132,21 +1132,21 @@ function on(e, t, n, r) {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
function sn(e, t, n) {
|
|
1134
1134
|
let r = Re(e, t, !1);
|
|
1135
|
-
return r ? (r[t] =
|
|
1135
|
+
return r ? (r[t] = ll(n), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1136
1136
|
}
|
|
1137
1137
|
function an(e, t, n) {
|
|
1138
1138
|
let r = Re(e, t, !1);
|
|
1139
|
-
return r ? (r[t] = parseInt(n),
|
|
1139
|
+
return r ? (r[t] = parseInt(n), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1140
1140
|
}
|
|
1141
1141
|
function un(e, t, n) {
|
|
1142
1142
|
let r = Re(e, t, !1);
|
|
1143
|
-
return r ? (r[t] = String(n),
|
|
1143
|
+
return r ? (r[t] = String(n), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1144
1144
|
}
|
|
1145
1145
|
function _n(e, n) {
|
|
1146
|
-
if (Ct(e)) return
|
|
1146
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), null;
|
|
1147
1147
|
if (e.current_state.state_name === n) return !1;
|
|
1148
1148
|
let r = Ie(e.gclass, n);
|
|
1149
|
-
if (!r) return
|
|
1149
|
+
if (!r) return ar(`${Rt(e)}: state unknown, state ${n}`), !1;
|
|
1150
1150
|
e.last_state = e.current_state, e.current_state = r;
|
|
1151
1151
|
let l = oe(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1152
1152
|
return Z(e) & B.TRACE_STATES;
|
|
@@ -1154,13 +1154,13 @@ function _n(e, n) {
|
|
|
1154
1154
|
return (l || o) && (1 === W || Y(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", $t(e), jt(e), cn(e), e.last_state.state_name))), !0;
|
|
1155
1155
|
}
|
|
1156
1156
|
function cn(e) {
|
|
1157
|
-
return
|
|
1157
|
+
return nl(e) ? e.current_state.state_name : (ar("hgobj NULL"), "");
|
|
1158
1158
|
}
|
|
1159
1159
|
function fn(e, n) {
|
|
1160
|
-
return Ct(e) ? (
|
|
1160
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), null) : n instanceof I ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (Je(e.parent, e), e.parent = null), Be(n, e), n.gclass.gmt.mt_child_added && (te(e) && cr(t("👦👦🔵 child_added(%s): %s", Dt(n), Rt(e))), n.gclass.gmt.mt_child_added(n, e)), 0) : (ar(`${Rt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
1161
1161
|
}
|
|
1162
1162
|
function gn(e, t, n) {
|
|
1163
|
-
if (!
|
|
1163
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), null;
|
|
1164
1164
|
let r = Ve(e.gclass, t);
|
|
1165
1165
|
if (r) return r;
|
|
1166
1166
|
if (n) {
|
|
@@ -1182,12 +1182,12 @@ function bn(e, t, n) {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
var pn = [], mn = !1;
|
|
1184
1184
|
function hn(e, n, r, l) {
|
|
1185
|
-
return e && e instanceof I ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (
|
|
1185
|
+
return e && e instanceof I ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (ar(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : rl(n) ? (ar("gobj_post_event(): event EMPTY"), -1) : dn(e, n, 0) ? pn.length >= 1e4 ? (ar(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${pn.length}`), -1) : (pn.push({
|
|
1186
1186
|
dst: e,
|
|
1187
1187
|
event: n,
|
|
1188
1188
|
kw: r,
|
|
1189
1189
|
src: l
|
|
1190
|
-
}), oe(e, n) && !ie(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Rt(e), n, pn.length)), mn || (mn = !0, setTimeout(yn, 0)), 0) : (
|
|
1190
|
+
}), oe(e, n) && !ie(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Rt(e), n, pn.length)), mn || (mn = !0, setTimeout(yn, 0)), 0) : (ar(`gobj_post_event(): event NOT DEFINED in gclass ${$t(e)}, event ${n}`), -1) : (ar(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
1191
1191
|
}
|
|
1192
1192
|
function En() {
|
|
1193
1193
|
return pn.length;
|
|
@@ -1211,21 +1211,21 @@ function yn() {
|
|
|
1211
1211
|
return pn.length > 0 && !mn && (mn = !0, setTimeout(yn, 0)), t;
|
|
1212
1212
|
}
|
|
1213
1213
|
function Tn(e, n, r, l) {
|
|
1214
|
-
if (!(e && e instanceof I)) return
|
|
1215
|
-
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return
|
|
1214
|
+
if (!(e && e instanceof I)) return ar("gobj dst NULL"), -1;
|
|
1215
|
+
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return ar("gobj dst DESTROYED"), -1;
|
|
1216
1216
|
let o = e.current_state;
|
|
1217
|
-
if (!o) return
|
|
1217
|
+
if (!o) return ar(`${Rt(e)}: current_state NULL`), -1;
|
|
1218
1218
|
let i = oe(e, n) && !ie(l, n);
|
|
1219
1219
|
y++;
|
|
1220
1220
|
let s = Ce(o, n);
|
|
1221
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (y--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), o.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Rt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Rt(l))), r && le(e) &&
|
|
1221
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (y--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), o.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Rt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Rt(l))), r && le(e) && xr(r) && $r(r)), e.gclass.gmt.mt_inject_event(e, n, r, l)) : (i && Y(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", $t(e), jt(e), o.state_name, n || "", l && !l.running ? "!!" : "", $t(l), jt(l))), ar(`📛📛 Event NOT DEFINED in state 📛📛: ${Rt(e)}, ${o.state_name}, ${n}`), y--, -1);
|
|
1222
1222
|
if (i) {
|
|
1223
1223
|
if (1 === W) Y(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Rt(e), o.state_name, l && !l.running ? "!!" : "", Rt(l)));
|
|
1224
1224
|
else {
|
|
1225
1225
|
let r = "";
|
|
1226
|
-
s.action && (r =
|
|
1226
|
+
s.action && (r = Uo(s.action)), Y(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", $t(e), jt(e), o.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", $t(l), jt(l)));
|
|
1227
1227
|
}
|
|
1228
|
-
r && le(e) &&
|
|
1228
|
+
r && le(e) && xr(r) && $r(r);
|
|
1229
1229
|
}
|
|
1230
1230
|
s.next_state && _n(e, s.next_state);
|
|
1231
1231
|
let a = -1;
|
|
@@ -1233,14 +1233,14 @@ function Tn(e, n, r, l) {
|
|
|
1233
1233
|
s.action && (a = s.action(e, n, r, l));
|
|
1234
1234
|
} catch (t) {
|
|
1235
1235
|
if (y--, !t || !t.__gobj_logged__) {
|
|
1236
|
-
|
|
1236
|
+
ar(`${Rt(e)}: action of ${n} in ${o.state_name} THREW: ${t && t.stack ? t.stack : t}`);
|
|
1237
1237
|
try {
|
|
1238
1238
|
t.__gobj_logged__ = !0;
|
|
1239
1239
|
} catch (e) {}
|
|
1240
1240
|
}
|
|
1241
1241
|
throw t;
|
|
1242
1242
|
}
|
|
1243
|
-
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, n || "",
|
|
1243
|
+
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, n || "", zr(a) ? a : 0)), y--, a;
|
|
1244
1244
|
}
|
|
1245
1245
|
var vn = Object.freeze({
|
|
1246
1246
|
__rename_event_name__: 1,
|
|
@@ -1273,35 +1273,35 @@ var Sn = [
|
|
|
1273
1273
|
];
|
|
1274
1274
|
function Nn(e, t) {
|
|
1275
1275
|
let n = e ? e.__config__ : null;
|
|
1276
|
-
if (!
|
|
1276
|
+
if (!Jr(n) || !gl(n, "__hard_subscription__") && !gl(n, "__own_event__") && !gl(n, "__rename_event_name__")) return {
|
|
1277
1277
|
kw: e,
|
|
1278
1278
|
renamed_event: ""
|
|
1279
1279
|
};
|
|
1280
|
-
let r =
|
|
1280
|
+
let r = kr({}, e), l = kr({}, n);
|
|
1281
1281
|
r.__config__ = l;
|
|
1282
|
-
let o = "", i = l.__rename_event_name__, s = "string" != typeof i ||
|
|
1283
|
-
return s && (o = s.event_name, delete l.__rename_event_name__, t &&
|
|
1282
|
+
let o = "", i = l.__rename_event_name__, s = "string" != typeof i || rl(i) ? null : On(i);
|
|
1283
|
+
return s && (o = s.event_name, delete l.__rename_event_name__, t && Yr(r.__global__) > 0 && (r.__global__ = kr(kr({}, r.__global__), { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1284
1284
|
kw: r,
|
|
1285
1285
|
renamed_event: o
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
1288
|
function wn(e, t, n, r, l, o) {
|
|
1289
|
-
let i =
|
|
1290
|
-
if (t && t !==
|
|
1291
|
-
let t =
|
|
1292
|
-
|
|
1289
|
+
let i = Sl(t, l, "__config__", null), s = Sl(t, l, "__global__", null), a = Sl(t, l, "__local__", null), u = Nl(t, l, "__filter__", null), _ = !0;
|
|
1290
|
+
if (t && t !== Ol(null, e, "publisher", null) && (_ = !1), o && o !== Ol(null, e, "subscriber", null) && (_ = !1), n && n !== vl(null, e, "event", "") && (_ = !1), r && r !== vl(null, e, "renamed_event", "") && (_ = !1), Yr(i) > 0) {
|
|
1291
|
+
let t = Sl(null, e, "__config__", null);
|
|
1292
|
+
Yr(t) > 0 && Ar(t, i) || (_ = !1);
|
|
1293
1293
|
}
|
|
1294
|
-
if (
|
|
1295
|
-
let t =
|
|
1296
|
-
|
|
1294
|
+
if (Yr(s) > 0) {
|
|
1295
|
+
let t = Sl(null, e, "__global__", null);
|
|
1296
|
+
Yr(t) > 0 && Ar(t, s) || (_ = !1);
|
|
1297
1297
|
}
|
|
1298
|
-
if (
|
|
1299
|
-
let t =
|
|
1300
|
-
|
|
1298
|
+
if (Yr(a) > 0) {
|
|
1299
|
+
let t = Sl(null, e, "__local__", null);
|
|
1300
|
+
Yr(t) > 0 && Ar(t, a) || (_ = !1);
|
|
1301
1301
|
}
|
|
1302
|
-
if (
|
|
1303
|
-
let t =
|
|
1304
|
-
|
|
1302
|
+
if (Yr(u) > 0) {
|
|
1303
|
+
let t = Nl(null, e, "__filter__", null);
|
|
1304
|
+
Yr(t) > 0 && Ar(t, u) || (_ = !1);
|
|
1305
1305
|
}
|
|
1306
1306
|
return _;
|
|
1307
1307
|
}
|
|
@@ -1309,7 +1309,7 @@ function jn(e, t, n, r, l, o) {
|
|
|
1309
1309
|
let i = [];
|
|
1310
1310
|
for (let s = 0; s < e.length; s++) {
|
|
1311
1311
|
let a = e[s];
|
|
1312
|
-
wn(a, t, n, r, l, o) &&
|
|
1312
|
+
wn(a, t, n, r, l, o) && Vr(i, a);
|
|
1313
1313
|
}
|
|
1314
1314
|
return i;
|
|
1315
1315
|
}
|
|
@@ -1317,17 +1317,17 @@ function $n(e, t) {
|
|
|
1317
1317
|
return e.indexOf(t);
|
|
1318
1318
|
}
|
|
1319
1319
|
function Rn(e, n, r, l) {
|
|
1320
|
-
let o =
|
|
1321
|
-
if (!!(
|
|
1320
|
+
let o = Ol(e, n, "publisher", null, Vn.KW_REQUIRED), i = Ol(e, n, "subscriber", null, Vn.KW_REQUIRED), s = vl(e, n, "event", "", Vn.KW_REQUIRED);
|
|
1321
|
+
if (!!(yl(e, n, "subs_flag", null, Vn.KW_REQUIRED) & vn.__hard_subscription__) && !r) return -1;
|
|
1322
1322
|
let a = ne(i) || ne(o);
|
|
1323
1323
|
if ($n(o.dl_subscriptions, n) < 0) return a && Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", s || "", Rt(o), Rt(i))), 1;
|
|
1324
|
-
a && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Rt(o), Rt(i))),
|
|
1324
|
+
a && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Rt(o), Rt(i))), gr(n)), o.obflag & P.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, n);
|
|
1325
1325
|
let u = $n(o.dl_subscriptions, n);
|
|
1326
|
-
return u >= 0 ?
|
|
1326
|
+
return u >= 0 ? Mr(o.dl_subscriptions, u) : (ar(`${Rt(e)}: subscription in publisher not found`), gr(n)), u = $n(i.dl_subscribings, n), u >= 0 ? Mr(i.dl_subscribings, u) : (ar(`${Rt(e)}: subscription in subscriber not found`), gr(n)), 0;
|
|
1327
1327
|
}
|
|
1328
1328
|
function Dn(e, n, r, l) {
|
|
1329
|
-
if (null == r && (r = {}), !e) return
|
|
1330
|
-
if (!l) return
|
|
1329
|
+
if (null == r && (r = {}), !e) return ar(`publisher NULL: ev ${n}`), 0;
|
|
1330
|
+
if (!l) return ar(`subscriber NULL: ev ${n}`), 0;
|
|
1331
1331
|
const o = /* @__PURE__ */ new Set([
|
|
1332
1332
|
"__config__",
|
|
1333
1333
|
"__global__",
|
|
@@ -1336,57 +1336,57 @@ function Dn(e, n, r, l) {
|
|
|
1336
1336
|
"__service__"
|
|
1337
1337
|
]);
|
|
1338
1338
|
if (Object.keys(r).forEach((t) => {
|
|
1339
|
-
o.has(t) ||
|
|
1340
|
-
}),
|
|
1341
|
-
else if (!(bn(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1339
|
+
o.has(t) || ar(`${Rt(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1340
|
+
}), rl(n)) n = "";
|
|
1341
|
+
else if (!(bn(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ar(`event NOT in output event list: ${Rt(e)}, ${n}`), 0;
|
|
1342
1342
|
let i = Nn(r, n), s = jn(e.dl_subscriptions, e, n, i.renamed_event, i.kw, l), a = null;
|
|
1343
|
-
for (let t = 0; t < s.length; t++) if (
|
|
1343
|
+
for (let t = 0; t < s.length; t++) if (yl(e, s[t], "subs_flag", 0, Vn.KW_REQUIRED) & vn.__hard_subscription__) {
|
|
1344
1344
|
a = s[t];
|
|
1345
1345
|
break;
|
|
1346
1346
|
}
|
|
1347
|
-
if (a) return
|
|
1348
|
-
|
|
1347
|
+
if (a) return ur(`${Rt(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${n}, subscriber: ${Rt(l)})`), a;
|
|
1348
|
+
Kr(s) > 0 && (ar(`${Rt(e)}: ${Kr(s)} subscription(s) REPEATED, will be deleted and override`), gr(s, "subscription REPEATED"), kn(e, s, !1));
|
|
1349
1349
|
let u = function(e, t, n, r) {
|
|
1350
1350
|
let l = Ne(e, Sn);
|
|
1351
|
-
|
|
1351
|
+
Fr(l, "event", t), Fr(l, "subscriber", r), Fr(l, "publisher", e);
|
|
1352
1352
|
let o = 0;
|
|
1353
1353
|
if (n) {
|
|
1354
|
-
let r =
|
|
1355
|
-
if (
|
|
1356
|
-
let n =
|
|
1357
|
-
|
|
1358
|
-
let i =
|
|
1359
|
-
if (!
|
|
1354
|
+
let r = Sl(e, n, "__config__", null), i = Sl(e, n, "__global__", null), s = Sl(e, n, "__local__", null), a = Nl(e, n, "__filter__", null), u = vl(e, n, "__service__", "");
|
|
1355
|
+
if (Yr(i) > 0 && Fr(l, "__global__", Rr(i)), Yr(r) > 0) {
|
|
1356
|
+
let n = Rr(r);
|
|
1357
|
+
Fr(l, "__config__", n);
|
|
1358
|
+
let i = vl(e, n, "__rename_event_name__", "");
|
|
1359
|
+
if (!rl(i)) {
|
|
1360
1360
|
let r = On(i);
|
|
1361
1361
|
if (r) {
|
|
1362
|
-
|
|
1363
|
-
let i =
|
|
1364
|
-
|
|
1365
|
-
} else
|
|
1362
|
+
Fr(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= vn.__rename_event_name__;
|
|
1363
|
+
let i = Sl(e, l, "__global__", null);
|
|
1364
|
+
Jr(i) || (i = {}, Fr(l, "__global__", i)), i.__original_event_name__ = t;
|
|
1365
|
+
} else ar(`${Rt(e)}: EVENT NOT FOUND (__rename_event_name__: ${i})`);
|
|
1366
1366
|
}
|
|
1367
|
-
if (
|
|
1368
|
-
let t =
|
|
1369
|
-
|
|
1367
|
+
if (gl(n, "__hard_subscription__")) {
|
|
1368
|
+
let t = El(e, n, "__hard_subscription__", !1);
|
|
1369
|
+
Pr(n, "__hard_subscription__"), t && (o |= vn.__hard_subscription__);
|
|
1370
1370
|
}
|
|
1371
|
-
if (
|
|
1372
|
-
let t =
|
|
1373
|
-
|
|
1371
|
+
if (gl(n, "__own_event__")) {
|
|
1372
|
+
let t = El(e, n, "__own_event__", !1);
|
|
1373
|
+
Pr(n, "__own_event__"), t && (o |= vn.__own_event__);
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
|
-
|
|
1376
|
+
Yr(s) > 0 && Fr(l, "__local__", Rr(s)), Yr(a) > 0 && Fr(l, "__filter__", Rr(a)), rl(u) || Fr(l, "__service__", u);
|
|
1377
1377
|
}
|
|
1378
|
-
return
|
|
1378
|
+
return Fr(l, "subs_flag", o), l;
|
|
1379
1379
|
}(e, n, r, l);
|
|
1380
|
-
if (!u) return
|
|
1381
|
-
if (
|
|
1380
|
+
if (!u) return ar(`${Rt(e)}: _create_subscription() FAILED`), 0;
|
|
1381
|
+
if (Vr(e.dl_subscriptions, u), Vr(l.dl_subscribings, u), (ne(l) || ne(e)) && (Y(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Rt(e), Rt(l))), r && (le(l) || le(e)) && $r(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1382
1382
|
let t = e.gclass.gmt.mt_subscription_added(e, u);
|
|
1383
1383
|
(t < 0 || !1 === t) && (Rn(e, u, !0, !0), u = 0);
|
|
1384
1384
|
}
|
|
1385
1385
|
return u;
|
|
1386
1386
|
}
|
|
1387
1387
|
function An(e, t, n, r) {
|
|
1388
|
-
if (null == n && (n = {}), !e) return
|
|
1389
|
-
if (!r) return
|
|
1388
|
+
if (null == n && (n = {}), !e) return ar(`publisher NULL: ev ${t}`), 0;
|
|
1389
|
+
if (!r) return ar(`subscriber NULL: ev ${t}`), 0;
|
|
1390
1390
|
const l = /* @__PURE__ */ new Set([
|
|
1391
1391
|
"__config__",
|
|
1392
1392
|
"__global__",
|
|
@@ -1395,20 +1395,20 @@ function An(e, t, n, r) {
|
|
|
1395
1395
|
"__service__"
|
|
1396
1396
|
]);
|
|
1397
1397
|
if (Object.keys(n).forEach((n) => {
|
|
1398
|
-
l.has(n) ||
|
|
1399
|
-
}),
|
|
1400
|
-
else if (!(bn(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1398
|
+
l.has(n) || ar(`${Rt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1399
|
+
}), rl(t)) t = "";
|
|
1400
|
+
else if (!(bn(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ar(`event NOT in output event list: ${Rt(e)}, ev ${t}`), 0;
|
|
1401
1401
|
let o = Nn(n, t), i = jn(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), s = 0, a = 0, u = 0;
|
|
1402
1402
|
for (let t = 0; t < i.length; t++) {
|
|
1403
1403
|
let n = i[t], r = Rn(e, n, !1, !1);
|
|
1404
1404
|
0 === r ? s++ : r < 0 ? a++ : u++;
|
|
1405
1405
|
}
|
|
1406
|
-
return a ?
|
|
1406
|
+
return a ? ur(`${Rt(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${a})`) : s || u || (ur(`${Rt(e)}: No subscription found`), $r(n, "No subscription found")), 0;
|
|
1407
1407
|
}
|
|
1408
1408
|
function kn(e, t, n) {
|
|
1409
1409
|
let r = [...t], l = 0;
|
|
1410
1410
|
for (let t = 0; t < r.length; t++) Rn(e, r[t], n, !1) > 0 && l++;
|
|
1411
|
-
return l &&
|
|
1411
|
+
return l && ur(`${Rt(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1412
1412
|
}
|
|
1413
1413
|
function In(e, t, n, r) {
|
|
1414
1414
|
return null == n && (n = {}), jn(e.dl_subscriptions, e, t, null, n, r);
|
|
@@ -1416,31 +1416,31 @@ function In(e, t, n, r) {
|
|
|
1416
1416
|
function Cn(e) {
|
|
1417
1417
|
let t = In(e, null, null, null);
|
|
1418
1418
|
for (let n = 0; n < t.length; n++) {
|
|
1419
|
-
let r = t[n], l =
|
|
1420
|
-
|
|
1419
|
+
let r = t[n], l = Ol(e, r, "publisher", null, Vn.KW_REQUIRED), o = Ol(e, r, "subscriber", null, Vn.KW_REQUIRED);
|
|
1420
|
+
Fr(r, "s_event", vl(e, r, "event", "", Vn.KW_REQUIRED)), Fr(r, "s_publisher", Rt(l)), Fr(r, "s_subscriber", Rt(o));
|
|
1421
1421
|
}
|
|
1422
1422
|
let n = Ln(e, 0, null, 0);
|
|
1423
1423
|
for (let t = 0; t < n.length; t++) {
|
|
1424
|
-
let r = n[t], l =
|
|
1425
|
-
|
|
1424
|
+
let r = n[t], l = Ol(e, r, "publisher", null, Vn.KW_REQUIRED), o = Ol(e, r, "subscriber", null, Vn.KW_REQUIRED);
|
|
1425
|
+
Fr(r, "s_event", vl(e, r, "event", "", Vn.KW_REQUIRED)), Fr(r, "s_publisher", Rt(l)), Fr(r, "s_subscriber", Rt(o));
|
|
1426
1426
|
}
|
|
1427
1427
|
return {
|
|
1428
1428
|
subscriptions: t,
|
|
1429
1429
|
subscribings: n,
|
|
1430
|
-
"total subscriptions":
|
|
1431
|
-
total_subscribings:
|
|
1430
|
+
"total subscriptions": Kr(t),
|
|
1431
|
+
total_subscribings: Kr(n)
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
function Ln(e, t, n, r) {
|
|
1435
1435
|
return jn(e.dl_subscribings, r, t, null, n, e);
|
|
1436
1436
|
}
|
|
1437
1437
|
function Pn(e, n, r) {
|
|
1438
|
-
if (
|
|
1439
|
-
if (
|
|
1438
|
+
if (Jr(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return ar("gobj NULL or DESTROYED"), -1;
|
|
1439
|
+
if (rl(n)) return ar(`${Rt(e)}: event EMPTY`), -1;
|
|
1440
1440
|
let l = gn(e, n, !0);
|
|
1441
|
-
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1441
|
+
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ar(`event NOT in output event list: ${Rt(e)}, ev ${n}`), -1;
|
|
1442
1442
|
let o = (ne(e) || oe(e, n)) && !ie(e, n);
|
|
1443
|
-
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, "", n || "", "")), le(e) &&
|
|
1443
|
+
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, "", n || "", "")), le(e) && xr(r) && $r(r)), e.gclass.gmt.mt_publish_event) {
|
|
1444
1444
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1445
1445
|
if (t <= 0) return t;
|
|
1446
1446
|
}
|
|
@@ -1452,20 +1452,20 @@ function Pn(e, n, r) {
|
|
|
1452
1452
|
if (t < 0) break;
|
|
1453
1453
|
if (!t) continue;
|
|
1454
1454
|
}
|
|
1455
|
-
let _ =
|
|
1455
|
+
let _ = Ol(e, u, "subscriber", null, Vn.KW_REQUIRED);
|
|
1456
1456
|
if (!_ || Ct(_)) continue;
|
|
1457
|
-
let c =
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
let l =
|
|
1461
|
-
|
|
1457
|
+
let c = yl(e, u, "subs_flag", 0, Vn.KW_REQUIRED), f = vl(e, u, "event", "", Vn.KW_REQUIRED);
|
|
1458
|
+
if (rl(f) || 0 === sl(f, n)) {
|
|
1459
|
+
Sl(e, u, "__config__", null, 0);
|
|
1460
|
+
let l = Sl(e, u, "__global__", null, 0), i = Sl(e, u, "__local__", null, 0), f = Nl(e, u, "__filter__", null, 0), g = u.renamed_event;
|
|
1461
|
+
rl(g) && (g = n);
|
|
1462
1462
|
let d = 1;
|
|
1463
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, r, _) :
|
|
1463
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, r, _) : Yr(f) > 0 && (d = Dl(r, f) ? 1 : 0, o && (Y(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", Rt(_), Rt(e))), gr(f))), d < 0) break;
|
|
1464
1464
|
if (!d) continue;
|
|
1465
1465
|
let b = gn(_, n, !0);
|
|
1466
1466
|
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !dn(_, b.event_name, 0)) continue;
|
|
1467
1467
|
let p = r;
|
|
1468
|
-
(
|
|
1468
|
+
(Yr(i) > 0 || Yr(l) > 0) && (p = kr({}, r)), Yr(i) > 0 && fl(p, i), Yr(l) > 0 && kr(p, Rr(l)), o && (Y(1 === W ? t("🔝🔄 %s (%s) %s%s", n || "", g || "", _.running ? "" : "!!", Rt(_)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", _.running ? "" : "!!", Rt(_), cn(_), n || "", g || "", e && !e.running ? "!!" : "", Rt(e))), le(e) && xr(p) && $r(p));
|
|
1469
1469
|
let m = Tn(_, g, p, e);
|
|
1470
1470
|
if (m < 0 && c & vn.__own_event__) {
|
|
1471
1471
|
s = -1;
|
|
@@ -1474,20 +1474,20 @@ function Pn(e, n, r) {
|
|
|
1474
1474
|
if (a += m, s++, Ct(e)) break;
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
|
-
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS ||
|
|
1477
|
+
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS || ur(`${Rt(e)}: Publish event WITHOUT subscribers, ev ${n}`), a;
|
|
1478
1478
|
}
|
|
1479
1479
|
function Un(e, n, r, l) {
|
|
1480
|
-
if (Ct(e)) return
|
|
1480
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
1481
1481
|
if (function(e) {
|
|
1482
1482
|
return z > 1 || !!e && !!(Z(e) & B.TRACE_COMMANDS);
|
|
1483
1483
|
}(e) || oe(e, null) && !ie(l, null)) {
|
|
1484
|
-
let o =
|
|
1485
|
-
Y(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", Et(e) ? "" : "!!", Rt(e), null !== o ? o : n, Rt(l))), le(e) &&
|
|
1484
|
+
let o = vr(n);
|
|
1485
|
+
Y(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", Et(e) ? "" : "!!", Rt(e), null !== o ? o : n, Rt(l))), le(e) && $r(r);
|
|
1486
1486
|
}
|
|
1487
1487
|
return 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) : o(0, -1, t("%s: global command parser not available", Rt(e)), 0, 0) : o(0, -1, t("%s: command table not available", Rt(e)), 0, 0);
|
|
1488
1488
|
}
|
|
1489
1489
|
function Fn(e, n, r, l) {
|
|
1490
|
-
return Ct(e) ? (
|
|
1490
|
+
return Ct(e) ? (ar("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", Rt(e)), 0, 0);
|
|
1491
1491
|
}
|
|
1492
1492
|
var Vn = Object.freeze({
|
|
1493
1493
|
KW_REQUIRED: 1,
|
|
@@ -1574,10 +1574,28 @@ function lr(e) {
|
|
|
1574
1574
|
try {
|
|
1575
1575
|
return JSON.stringify(e);
|
|
1576
1576
|
} catch (t) {
|
|
1577
|
-
|
|
1577
|
+
try {
|
|
1578
|
+
return String(e);
|
|
1579
|
+
} catch (t) {
|
|
1580
|
+
return `<${typeof e}: not printable>`;
|
|
1581
|
+
}
|
|
1578
1582
|
}
|
|
1579
1583
|
}
|
|
1580
1584
|
function or(e) {
|
|
1585
|
+
try {
|
|
1586
|
+
return String(e);
|
|
1587
|
+
} catch (t) {
|
|
1588
|
+
return lr(e);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
function ir(e, t) {
|
|
1592
|
+
try {
|
|
1593
|
+
return e(t);
|
|
1594
|
+
} catch (e) {
|
|
1595
|
+
return or(t);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
function sr(e) {
|
|
1581
1599
|
const t = Array.prototype.slice.call(arguments);
|
|
1582
1600
|
let n = "";
|
|
1583
1601
|
if ("string" == typeof e) {
|
|
@@ -1586,44 +1604,44 @@ function or(e) {
|
|
|
1586
1604
|
n = e.replace(/%[sdifoO]/g, (e) => {
|
|
1587
1605
|
const n = t[r++];
|
|
1588
1606
|
switch (e) {
|
|
1589
|
-
case "%s": return
|
|
1607
|
+
case "%s": return or(n);
|
|
1590
1608
|
case "%d":
|
|
1591
|
-
case "%i": return parseInt
|
|
1592
|
-
case "%f": return parseFloat
|
|
1609
|
+
case "%i": return ir(parseInt, n);
|
|
1610
|
+
case "%f": return ir(parseFloat, n);
|
|
1593
1611
|
case "%o":
|
|
1594
|
-
case "%O": return "object" == typeof n ? lr(n) :
|
|
1612
|
+
case "%O": return "object" == typeof n ? lr(n) : or(n);
|
|
1595
1613
|
default: return e;
|
|
1596
1614
|
}
|
|
1597
1615
|
});
|
|
1598
|
-
const l = t.slice(r).map((e) => "object" == typeof e ? lr(e) :
|
|
1616
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? lr(e) : or(e));
|
|
1599
1617
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1600
|
-
} else n = t.map((e) => "object" == typeof e ? lr(e) :
|
|
1618
|
+
} else n = t.map((e) => "object" == typeof e ? lr(e) : or(e)).join(" ");
|
|
1601
1619
|
return n;
|
|
1602
1620
|
}
|
|
1603
|
-
function
|
|
1604
|
-
let n =
|
|
1621
|
+
function ar(e, ...t) {
|
|
1622
|
+
let n = sr(e, ...t), r = ko();
|
|
1605
1623
|
Mn && (Mn === Gn.error ? Zn("error", n) && Mn("%c" + r + " ERROR: " + String(n), "color:red") : (Zn("error", n) && Gn.error("%c" + r + " ERROR: " + String(n), "color:red"), Mn(`${r} ERROR: ${String(n)}`))), tr("error", n, r);
|
|
1606
1624
|
}
|
|
1607
|
-
function
|
|
1608
|
-
let n =
|
|
1625
|
+
function ur(e, ...t) {
|
|
1626
|
+
let n = sr(e, ...t), r = ko();
|
|
1609
1627
|
Wn && (Wn === Gn.warn ? Zn("warning", n) && Wn("%c" + r + " WARNING: " + String(n), "color:yellow") : (Zn("warning", n) && Gn.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), Wn(`${r} WARNING: ${String(n)}`))), tr("warning", n, r);
|
|
1610
1628
|
}
|
|
1611
|
-
function
|
|
1612
|
-
let n =
|
|
1629
|
+
function _r(e, ...t) {
|
|
1630
|
+
let n = sr(e, ...t), r = ko();
|
|
1613
1631
|
xn && Zn("info", n) && xn("%c" + r + " INFO: " + String(n), "color:cyan"), tr("info", n, r);
|
|
1614
1632
|
}
|
|
1615
|
-
function
|
|
1616
|
-
let n =
|
|
1633
|
+
function cr(e, ...t) {
|
|
1634
|
+
let n = sr(e, ...t), r = ko();
|
|
1617
1635
|
Kn && Zn("debug", n) && Kn("%c" + r + " DEBUG: " + String(n), "color:silver"), tr("debug", n, r);
|
|
1618
1636
|
}
|
|
1619
|
-
function
|
|
1620
|
-
let n =
|
|
1637
|
+
function fr(e, ...t) {
|
|
1638
|
+
let n = sr(e, ...t), r = ko();
|
|
1621
1639
|
Kn && Zn("msg", n) && Kn("%c" + r + " MSG: " + String(n), "color:cyan"), tr("msg", n, r);
|
|
1622
1640
|
}
|
|
1623
|
-
function
|
|
1624
|
-
Zn("json", t) && (t && Gn.warn("=====> " + t), Gn.dir(e)), tr("json", e,
|
|
1641
|
+
function gr(e, t) {
|
|
1642
|
+
Zn("json", t) && (t && Gn.warn("=====> " + t), Gn.dir(e)), tr("json", e, ko());
|
|
1625
1643
|
}
|
|
1626
|
-
var
|
|
1644
|
+
var dr = [
|
|
1627
1645
|
"passw",
|
|
1628
1646
|
"pwd",
|
|
1629
1647
|
"passphrase",
|
|
@@ -1635,12 +1653,12 @@ var fr = [
|
|
|
1635
1653
|
"cookie",
|
|
1636
1654
|
"credential",
|
|
1637
1655
|
"salt"
|
|
1638
|
-
],
|
|
1656
|
+
], br = [
|
|
1639
1657
|
"apikey",
|
|
1640
1658
|
"sessionid",
|
|
1641
1659
|
"sessionkey",
|
|
1642
1660
|
"authdata"
|
|
1643
|
-
],
|
|
1661
|
+
], pr = /* @__PURE__ */ new Set([
|
|
1644
1662
|
"endpoint",
|
|
1645
1663
|
"url",
|
|
1646
1664
|
"uri",
|
|
@@ -1664,25 +1682,25 @@ var fr = [
|
|
|
1664
1682
|
"expires",
|
|
1665
1683
|
"mode"
|
|
1666
1684
|
]);
|
|
1667
|
-
function
|
|
1685
|
+
function mr(e) {
|
|
1668
1686
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1669
1687
|
let t = e.toLowerCase(), n = !1;
|
|
1670
|
-
for (const e of
|
|
1688
|
+
for (const e of dr) if (t.indexOf(e) >= 0) {
|
|
1671
1689
|
n = !0;
|
|
1672
1690
|
break;
|
|
1673
1691
|
}
|
|
1674
1692
|
if (!n) {
|
|
1675
1693
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1676
|
-
for (const t of
|
|
1694
|
+
for (const t of br) if (e.indexOf(t) >= 0) {
|
|
1677
1695
|
n = !0;
|
|
1678
1696
|
break;
|
|
1679
1697
|
}
|
|
1680
1698
|
}
|
|
1681
1699
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1682
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1700
|
+
for (const e of t.split(/[_\-. \t]/)) if (pr.has(e)) return !1;
|
|
1683
1701
|
return !0;
|
|
1684
1702
|
}
|
|
1685
|
-
function
|
|
1703
|
+
function hr(e, t, n) {
|
|
1686
1704
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1687
1705
|
let o = t;
|
|
1688
1706
|
for (;;) {
|
|
@@ -1698,12 +1716,12 @@ function pr(e, t, n) {
|
|
|
1698
1716
|
o = t;
|
|
1699
1717
|
}
|
|
1700
1718
|
}
|
|
1701
|
-
var
|
|
1702
|
-
function
|
|
1719
|
+
var Er = 128, yr = 4194304, Tr = "<not shown: too large to mask>";
|
|
1720
|
+
function vr(e) {
|
|
1703
1721
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1704
|
-
if (e.length >
|
|
1722
|
+
if (e.length > yr) return Tr;
|
|
1705
1723
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1706
|
-
for (; null !== (t = r.exec(e));)
|
|
1724
|
+
for (; null !== (t = r.exec(e));) mr(t[2].slice(-128)) && (n = !0);
|
|
1707
1725
|
let l = [], o = 0, i = !1, s = "", a = 0, u = 0;
|
|
1708
1726
|
const _ = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1709
1727
|
for (; u < e.length;) {
|
|
@@ -1716,8 +1734,8 @@ function yr(e) {
|
|
|
1716
1734
|
u++;
|
|
1717
1735
|
continue;
|
|
1718
1736
|
}
|
|
1719
|
-
let r = e.substring(Math.max(a, u -
|
|
1720
|
-
if (a = u + 1, !(
|
|
1737
|
+
let r = e.substring(Math.max(a, u - Er), u);
|
|
1738
|
+
if (a = u + 1, !(mr(r) || n && "value" === r.toLowerCase())) {
|
|
1721
1739
|
u++;
|
|
1722
1740
|
continue;
|
|
1723
1741
|
}
|
|
@@ -1726,18 +1744,18 @@ function yr(e) {
|
|
|
1726
1744
|
if (f) {
|
|
1727
1745
|
for (c = u + 1; c < e.length && e[c] !== f;) c++;
|
|
1728
1746
|
e[c] === f && c++;
|
|
1729
|
-
} else c =
|
|
1747
|
+
} else c = hr(e, u, s);
|
|
1730
1748
|
c > u && (l.push(e.substring(o, u)), l.push("********"), o = c, i = !0), u = c, a = u;
|
|
1731
1749
|
}
|
|
1732
1750
|
return i ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1733
1751
|
}
|
|
1734
|
-
var
|
|
1735
|
-
var
|
|
1736
|
-
function
|
|
1752
|
+
var Or = 64, Sr = "<not shown: the masking failed>";
|
|
1753
|
+
var Nr = Symbol("mask-in-progress");
|
|
1754
|
+
function wr(e, t, n, r) {
|
|
1737
1755
|
if ("string" == typeof e) {
|
|
1738
|
-
if (e.length > r.left) return r.left = 0,
|
|
1756
|
+
if (e.length > r.left) return r.left = 0, Tr;
|
|
1739
1757
|
r.left -= e.length;
|
|
1740
|
-
let t =
|
|
1758
|
+
let t = vr(e);
|
|
1741
1759
|
return null !== t ? t : e;
|
|
1742
1760
|
}
|
|
1743
1761
|
let l = Array.isArray(e);
|
|
@@ -1746,13 +1764,13 @@ function Sr(e, t, n, r) {
|
|
|
1746
1764
|
let t = Object.getPrototypeOf(e);
|
|
1747
1765
|
return t === Object.prototype || null === t;
|
|
1748
1766
|
}(e)) return e;
|
|
1749
|
-
if (r.left <= 0) return
|
|
1767
|
+
if (r.left <= 0) return Tr;
|
|
1750
1768
|
if (t.has(e)) {
|
|
1751
1769
|
let n = t.get(e);
|
|
1752
|
-
return n ===
|
|
1770
|
+
return n === Nr ? "<cycle>" : n;
|
|
1753
1771
|
}
|
|
1754
|
-
if (n >=
|
|
1755
|
-
r.left -= 1, t.set(e,
|
|
1772
|
+
if (n >= Or) return "<deeper not shown>";
|
|
1773
|
+
r.left -= 1, t.set(e, Nr);
|
|
1756
1774
|
let o, i = !1, s = !1;
|
|
1757
1775
|
if (l) {
|
|
1758
1776
|
o = [];
|
|
@@ -1762,13 +1780,13 @@ function Sr(e, t, n, r) {
|
|
|
1762
1780
|
break;
|
|
1763
1781
|
}
|
|
1764
1782
|
r.left -= 1;
|
|
1765
|
-
let a =
|
|
1783
|
+
let a = wr(e[l], t, n + 1, r);
|
|
1766
1784
|
a !== e[l] && (i = !0), o.push(a);
|
|
1767
1785
|
}
|
|
1768
|
-
s && o.push(
|
|
1786
|
+
s && o.push(Tr);
|
|
1769
1787
|
} else {
|
|
1770
1788
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1771
|
-
let l = "string" == typeof e.attribute &&
|
|
1789
|
+
let l = "string" == typeof e.attribute && mr(e.attribute.slice(-128));
|
|
1772
1790
|
for (const a in e) {
|
|
1773
1791
|
if (!Object.prototype.hasOwnProperty.call(e, a)) continue;
|
|
1774
1792
|
if (r.left <= 0) {
|
|
@@ -1777,38 +1795,38 @@ function Sr(e, t, n, r) {
|
|
|
1777
1795
|
}
|
|
1778
1796
|
r.left -= 1 + a.length;
|
|
1779
1797
|
let u, _ = e[a];
|
|
1780
|
-
u = (
|
|
1798
|
+
u = (mr(a.slice(-128)) || l && "value" === a) && null != _ && "" !== _ ? "********" : wr(_, t, n + 1, r), u !== _ && (i = !0), bl(o, a, u);
|
|
1781
1799
|
}
|
|
1782
|
-
s && (o["<more>"] =
|
|
1800
|
+
s && (o["<more>"] = Tr);
|
|
1783
1801
|
}
|
|
1784
1802
|
return i || s || (o = e), t.set(e, o), o;
|
|
1785
1803
|
}
|
|
1786
|
-
function
|
|
1804
|
+
function jr(e) {
|
|
1787
1805
|
try {
|
|
1788
|
-
return
|
|
1806
|
+
return wr(e, /* @__PURE__ */ new WeakMap(), 0, { left: yr });
|
|
1789
1807
|
} catch (e) {
|
|
1790
|
-
return
|
|
1808
|
+
return Sr;
|
|
1791
1809
|
}
|
|
1792
1810
|
}
|
|
1793
|
-
function
|
|
1794
|
-
|
|
1811
|
+
function $r(e, t) {
|
|
1812
|
+
gr(jr(e), t);
|
|
1795
1813
|
}
|
|
1796
|
-
function
|
|
1814
|
+
function Rr(e) {
|
|
1797
1815
|
return structuredClone(e);
|
|
1798
1816
|
}
|
|
1799
|
-
function
|
|
1817
|
+
function Dr(...e) {
|
|
1800
1818
|
const t = {};
|
|
1801
|
-
for (const n of e)
|
|
1819
|
+
for (const n of e) kr(t, structuredClone(n));
|
|
1802
1820
|
return t;
|
|
1803
1821
|
}
|
|
1804
|
-
function
|
|
1822
|
+
function Ar(e, t) {
|
|
1805
1823
|
if (e === t) return !0;
|
|
1806
1824
|
if (null === e || null === t) return e === t;
|
|
1807
1825
|
if (typeof e != typeof t) return !1;
|
|
1808
1826
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1809
1827
|
if (Array.isArray(e)) {
|
|
1810
1828
|
if (e.length !== t.length) return !1;
|
|
1811
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1829
|
+
for (let n = 0; n < e.length; n++) if (!Ar(e[n], t[n])) return !1;
|
|
1812
1830
|
return !0;
|
|
1813
1831
|
}
|
|
1814
1832
|
if ("object" == typeof e) {
|
|
@@ -1816,153 +1834,153 @@ function Rr(e, t) {
|
|
|
1816
1834
|
if (n.length !== r.length) return !1;
|
|
1817
1835
|
for (let l = 0; l < n.length; l++) {
|
|
1818
1836
|
if (n[l] !== r[l]) return !1;
|
|
1819
|
-
if (!
|
|
1837
|
+
if (!Ar(e[n[l]], t[r[l]])) return !1;
|
|
1820
1838
|
}
|
|
1821
1839
|
return !0;
|
|
1822
1840
|
}
|
|
1823
1841
|
return e === t;
|
|
1824
1842
|
}
|
|
1825
|
-
function
|
|
1843
|
+
function kr(e, t) {
|
|
1826
1844
|
if (!t) return e;
|
|
1827
|
-
for (let n of Object.keys(t))
|
|
1845
|
+
for (let n of Object.keys(t)) bl(e, n, t[n]);
|
|
1828
1846
|
return e;
|
|
1829
1847
|
}
|
|
1830
|
-
function
|
|
1848
|
+
function Ir(e, t) {
|
|
1831
1849
|
if (!t) return e;
|
|
1832
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
1850
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && bl(e, n, t[n]);
|
|
1833
1851
|
return e;
|
|
1834
1852
|
}
|
|
1835
|
-
function
|
|
1853
|
+
function Cr(e, t) {
|
|
1836
1854
|
if (!t) return e;
|
|
1837
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
1855
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && bl(e, n, t[n]);
|
|
1838
1856
|
return e;
|
|
1839
1857
|
}
|
|
1840
|
-
function
|
|
1858
|
+
function Lr(e, t) {
|
|
1841
1859
|
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1842
1860
|
}
|
|
1843
|
-
function
|
|
1861
|
+
function Pr(e, t) {
|
|
1844
1862
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1845
1863
|
}
|
|
1846
|
-
function
|
|
1847
|
-
|
|
1864
|
+
function Ur(e, t, n) {
|
|
1865
|
+
bl(e, t, n);
|
|
1848
1866
|
}
|
|
1849
|
-
function
|
|
1850
|
-
|
|
1867
|
+
function Fr(e, t, n) {
|
|
1868
|
+
bl(e, t, n);
|
|
1851
1869
|
}
|
|
1852
|
-
function
|
|
1870
|
+
function Vr(e, t) {
|
|
1853
1871
|
e.push(t);
|
|
1854
1872
|
}
|
|
1855
|
-
function
|
|
1873
|
+
function Gr(e, t) {
|
|
1856
1874
|
e.push(t);
|
|
1857
1875
|
}
|
|
1858
|
-
function
|
|
1876
|
+
function Mr(e, t) {
|
|
1859
1877
|
e.splice(t, 1);
|
|
1860
1878
|
}
|
|
1861
|
-
function
|
|
1879
|
+
function Wr(e, t) {
|
|
1862
1880
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
1863
1881
|
}
|
|
1864
|
-
function Mr(e) {
|
|
1865
|
-
return Yr(e) ? Object.keys(e).length : 0;
|
|
1866
|
-
}
|
|
1867
|
-
function Wr(e) {
|
|
1868
|
-
return Br(e) ? e.length : 0;
|
|
1869
|
-
}
|
|
1870
1882
|
function xr(e) {
|
|
1871
|
-
return
|
|
1883
|
+
return Jr(e) ? Object.keys(e).length : 0;
|
|
1872
1884
|
}
|
|
1873
1885
|
function Kr(e) {
|
|
1874
|
-
return
|
|
1886
|
+
return qr(e) ? e.length : 0;
|
|
1875
1887
|
}
|
|
1876
1888
|
function Yr(e) {
|
|
1877
|
-
return
|
|
1889
|
+
return Jr(e) ? Object.keys(e).length : qr(e) ? e.length : Hr(e) && e.length > 0 ? 1 : 0;
|
|
1878
1890
|
}
|
|
1879
1891
|
function Br(e) {
|
|
1880
|
-
return
|
|
1892
|
+
return 0 === Yr(e);
|
|
1881
1893
|
}
|
|
1882
1894
|
function Jr(e) {
|
|
1883
|
-
return "
|
|
1895
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1884
1896
|
}
|
|
1885
1897
|
function qr(e) {
|
|
1886
|
-
return
|
|
1898
|
+
return Array.isArray(e);
|
|
1887
1899
|
}
|
|
1888
1900
|
function Hr(e) {
|
|
1889
|
-
return "
|
|
1901
|
+
return "string" == typeof e;
|
|
1890
1902
|
}
|
|
1891
1903
|
function zr(e) {
|
|
1892
|
-
return
|
|
1904
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1893
1905
|
}
|
|
1894
1906
|
function Qr(e) {
|
|
1895
|
-
|
|
1896
|
-
if (!Jr(e)) return !1;
|
|
1897
|
-
const t = Number(e);
|
|
1898
|
-
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1907
|
+
return "boolean" == typeof e;
|
|
1899
1908
|
}
|
|
1900
1909
|
function Xr(e) {
|
|
1901
|
-
return
|
|
1910
|
+
return null == e;
|
|
1902
1911
|
}
|
|
1903
1912
|
function Zr(e) {
|
|
1904
|
-
|
|
1913
|
+
if (zr(e)) return !0;
|
|
1914
|
+
if (!Hr(e)) return !1;
|
|
1915
|
+
const t = Number(e);
|
|
1916
|
+
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1905
1917
|
}
|
|
1906
1918
|
function el(e) {
|
|
1907
|
-
return e instanceof
|
|
1919
|
+
return e instanceof Date && !isNaN(e);
|
|
1908
1920
|
}
|
|
1909
1921
|
function tl(e) {
|
|
1910
|
-
return
|
|
1922
|
+
return "function" == typeof e;
|
|
1911
1923
|
}
|
|
1912
1924
|
function nl(e) {
|
|
1913
|
-
return
|
|
1925
|
+
return e instanceof I;
|
|
1914
1926
|
}
|
|
1915
|
-
function rl(e
|
|
1927
|
+
function rl(e) {
|
|
1928
|
+
return !Hr(e) || 0 === e.length;
|
|
1929
|
+
}
|
|
1930
|
+
function ll(e) {
|
|
1931
|
+
return zr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1932
|
+
}
|
|
1933
|
+
function ol(e, t, n) {
|
|
1916
1934
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
1917
1935
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
1918
1936
|
}
|
|
1919
|
-
function
|
|
1937
|
+
function il(e, t) {
|
|
1920
1938
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1921
1939
|
}
|
|
1922
|
-
function
|
|
1940
|
+
function sl(e, t) {
|
|
1923
1941
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1924
1942
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1925
1943
|
}
|
|
1926
|
-
function
|
|
1927
|
-
if (
|
|
1928
|
-
if (
|
|
1944
|
+
function al(e, t) {
|
|
1945
|
+
if (Jr(e) || Jr(t) || qr(e) || qr(t)) return 0;
|
|
1946
|
+
if (zr(e) || zr(t)) {
|
|
1929
1947
|
let n = Number(e), r = Number(t);
|
|
1930
1948
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1931
1949
|
}
|
|
1932
|
-
if (
|
|
1950
|
+
if (Qr(e) || Qr(t)) {
|
|
1933
1951
|
let n = Number(e), r = Number(t);
|
|
1934
1952
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1935
1953
|
}
|
|
1936
|
-
return
|
|
1954
|
+
return il(String(e), String(t));
|
|
1937
1955
|
}
|
|
1938
|
-
function
|
|
1956
|
+
function ul(e, t, n) {
|
|
1939
1957
|
var r;
|
|
1940
1958
|
return -1 !== (r = (e += "").indexOf(t)) && (n ? e.substring(0, r) : e.slice(r));
|
|
1941
1959
|
}
|
|
1942
|
-
function
|
|
1943
|
-
if (!
|
|
1960
|
+
function _l(e) {
|
|
1961
|
+
if (!Hr(e)) return !1;
|
|
1944
1962
|
let t = 0;
|
|
1945
1963
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1946
1964
|
return 2 === t;
|
|
1947
1965
|
}
|
|
1948
|
-
function
|
|
1949
|
-
if (!
|
|
1966
|
+
function cl(e) {
|
|
1967
|
+
if (!Hr(e)) return !1;
|
|
1950
1968
|
let t = 0;
|
|
1951
1969
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1952
1970
|
return 1 === t;
|
|
1953
1971
|
}
|
|
1954
|
-
function
|
|
1955
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1972
|
+
function fl(e, t) {
|
|
1973
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) fl(e, n);
|
|
1956
1974
|
else "string" == typeof t && delete e[t];
|
|
1957
1975
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1958
1976
|
}
|
|
1959
|
-
function
|
|
1977
|
+
function gl(e, t) {
|
|
1960
1978
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1961
1979
|
}
|
|
1962
|
-
function
|
|
1980
|
+
function dl(e, t) {
|
|
1963
1981
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1964
1982
|
}
|
|
1965
|
-
function
|
|
1983
|
+
function bl(e, t, n) {
|
|
1966
1984
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1967
1985
|
value: n,
|
|
1968
1986
|
writable: !0,
|
|
@@ -1970,235 +1988,235 @@ function gl(e, t, n) {
|
|
|
1970
1988
|
configurable: !0
|
|
1971
1989
|
}) : e[t] = n;
|
|
1972
1990
|
}
|
|
1973
|
-
function
|
|
1991
|
+
function pl(e, t) {
|
|
1974
1992
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
1975
1993
|
const n = Number(t);
|
|
1976
1994
|
return n >= e.length ? -1 : n;
|
|
1977
1995
|
}
|
|
1978
|
-
function
|
|
1979
|
-
e && !
|
|
1996
|
+
function ml(e, t, n, r) {
|
|
1997
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
1980
1998
|
const l = e ? `${Rt(e)}: ` : "";
|
|
1981
|
-
if (!
|
|
1982
|
-
if (!
|
|
1999
|
+
if (!Jr(t) && !qr(t)) return void ar(`${l}kw must be list or dict: '${String(n)}'`);
|
|
2000
|
+
if (!Hr(n)) return void ar(`${l}path must be a string: ${String(n)}`);
|
|
1983
2001
|
let o = n.split("`"), i = o.length;
|
|
1984
2002
|
for (let e = 0; e < i; e++) {
|
|
1985
|
-
if (
|
|
1986
|
-
const i =
|
|
1987
|
-
if (i < 0) return void (r &&
|
|
2003
|
+
if (qr(t)) {
|
|
2004
|
+
const i = pl(t, o[e]);
|
|
2005
|
+
if (i < 0) return void (r && ar(`${l}path not found: '${n}'`));
|
|
1988
2006
|
o[e] = String(i);
|
|
1989
2007
|
}
|
|
1990
|
-
if (
|
|
2008
|
+
if (dl(t, o[e])) return void (r && ar(`${l}path not found: '${n}'`));
|
|
1991
2009
|
if (e === i - 1) break;
|
|
1992
|
-
if (null == (t = t[o[e]])) return void (r &&
|
|
1993
|
-
if (!
|
|
2010
|
+
if (null == (t = t[o[e]])) return void (r && ar(`${l}path not found: '${n}'`));
|
|
2011
|
+
if (!Jr(t) && !qr(t)) return void ar(`${l}kw must be list or dict: '${n}'`);
|
|
1994
2012
|
}
|
|
1995
2013
|
let s = t[o[i - 1]];
|
|
1996
|
-
return void 0 === s && r &&
|
|
2014
|
+
return void 0 === s && r && ar(`${l}path not found: '${n}'`), s;
|
|
1997
2015
|
}
|
|
1998
|
-
function
|
|
1999
|
-
e && !
|
|
2016
|
+
function hl(e, t, n) {
|
|
2017
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2000
2018
|
const r = e ? Rt(e) + ": " : "";
|
|
2001
|
-
if (!
|
|
2019
|
+
if (!Hr(n)) return ar(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
2002
2020
|
let [l, o] = function(e, t) {
|
|
2003
2021
|
let n = e.lastIndexOf(t);
|
|
2004
2022
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
2005
2023
|
}(n, "`"), i = t;
|
|
2006
|
-
if (
|
|
2007
|
-
else if (i =
|
|
2008
|
-
return
|
|
2024
|
+
if (rl(o)) o = n;
|
|
2025
|
+
else if (i = ml(e, t, l, !0), void 0 === i) return -1;
|
|
2026
|
+
return qr(i) ? (ar(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : Jr(i) && Object.prototype.hasOwnProperty.call(i, o) ? (delete i[o], 0) : (ar(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
2009
2027
|
}
|
|
2010
|
-
function
|
|
2011
|
-
e && !
|
|
2012
|
-
let o =
|
|
2028
|
+
function El(e, t, n, r, l) {
|
|
2029
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2030
|
+
let o = ml(e, t, n, !1);
|
|
2013
2031
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
2014
2032
|
if (void 0 === o) {
|
|
2015
2033
|
if (s && t) {
|
|
2016
2034
|
let l = Boolean(r);
|
|
2017
|
-
return
|
|
2035
|
+
return jl(e, t, n, l), l;
|
|
2018
2036
|
}
|
|
2019
|
-
return i && (
|
|
2037
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), Boolean(r);
|
|
2020
2038
|
}
|
|
2021
2039
|
let _;
|
|
2022
|
-
if (
|
|
2023
|
-
else if (u &&
|
|
2024
|
-
else if (u &&
|
|
2040
|
+
if (Qr(o)) _ = o;
|
|
2041
|
+
else if (u && zr(o)) _ = 0 !== o;
|
|
2042
|
+
else if (u && Hr(o)) _ = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
2025
2043
|
else {
|
|
2026
|
-
if (!u || null !== o) return u ? (
|
|
2044
|
+
if (!u || null !== o) return u ? (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $r(t), !1) : (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), $r(t), Boolean(r));
|
|
2027
2045
|
_ = !1;
|
|
2028
2046
|
}
|
|
2029
|
-
return a &&
|
|
2047
|
+
return a && hl(e, t, n), _;
|
|
2030
2048
|
}
|
|
2031
|
-
function
|
|
2032
|
-
e && !
|
|
2033
|
-
let o =
|
|
2049
|
+
function yl(e, t, n, r, l) {
|
|
2050
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2051
|
+
let o = ml(e, t, n, !1);
|
|
2034
2052
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
2035
2053
|
if (void 0 === o) {
|
|
2036
2054
|
if (s && t) {
|
|
2037
2055
|
let l = parseInt(r);
|
|
2038
|
-
return
|
|
2056
|
+
return jl(e, t, n, l), l;
|
|
2039
2057
|
}
|
|
2040
|
-
return i && (
|
|
2058
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), parseInt(r);
|
|
2041
2059
|
}
|
|
2042
2060
|
let _;
|
|
2043
|
-
if (
|
|
2061
|
+
if (zr(o)) _ = Math.trunc(o);
|
|
2044
2062
|
else {
|
|
2045
|
-
if (!u) return
|
|
2046
|
-
if (
|
|
2047
|
-
else if (
|
|
2063
|
+
if (!u) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json integer: '${n}'`), $r(t), parseInt(r);
|
|
2064
|
+
if (Qr(o)) _ = o ? 1 : 0;
|
|
2065
|
+
else if (Hr(o)) _ = function(e) {
|
|
2048
2066
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
2049
2067
|
if (!t) return 0;
|
|
2050
2068
|
let n, r = t[2];
|
|
2051
2069
|
return n = r.length > 1 && ("x" === r[1] || "X" === r[1]) ? parseInt(r.substring(2), 16) : "0" === r[0] ? parseInt(r, 8) : parseInt(r, 10), "-" === t[1] ? -n : n;
|
|
2052
2070
|
}(o);
|
|
2053
2071
|
else {
|
|
2054
|
-
if (null !== o) return
|
|
2072
|
+
if (null !== o) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $r(t), 0;
|
|
2055
2073
|
_ = 0;
|
|
2056
2074
|
}
|
|
2057
2075
|
}
|
|
2058
|
-
return a &&
|
|
2076
|
+
return a && hl(e, t, n), _;
|
|
2059
2077
|
}
|
|
2060
|
-
function
|
|
2061
|
-
e && !
|
|
2062
|
-
let o =
|
|
2078
|
+
function Tl(e, t, n, r, l) {
|
|
2079
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2080
|
+
let o = ml(e, t, n, !1);
|
|
2063
2081
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
2064
2082
|
if (void 0 === o) {
|
|
2065
2083
|
if (s && t) {
|
|
2066
2084
|
let l = Number(r);
|
|
2067
|
-
return
|
|
2085
|
+
return jl(e, t, n, l), l;
|
|
2068
2086
|
}
|
|
2069
|
-
return i && (
|
|
2087
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), Number(r);
|
|
2070
2088
|
}
|
|
2071
2089
|
let _;
|
|
2072
|
-
if (
|
|
2090
|
+
if (zr(o)) _ = o;
|
|
2073
2091
|
else {
|
|
2074
|
-
if (!u) return
|
|
2075
|
-
if (
|
|
2076
|
-
else if (
|
|
2092
|
+
if (!u) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json real: '${n}'`), $r(t), Number(r);
|
|
2093
|
+
if (Qr(o)) _ = o ? 1 : 0;
|
|
2094
|
+
else if (Hr(o)) _ = parseFloat(o), Number.isNaN(_) && (_ = 0);
|
|
2077
2095
|
else {
|
|
2078
|
-
if (null !== o) return
|
|
2096
|
+
if (null !== o) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $r(t), 0;
|
|
2079
2097
|
_ = 0;
|
|
2080
2098
|
}
|
|
2081
2099
|
}
|
|
2082
|
-
return a &&
|
|
2100
|
+
return a && hl(e, t, n), _;
|
|
2083
2101
|
}
|
|
2084
|
-
function
|
|
2085
|
-
e && !
|
|
2086
|
-
let o =
|
|
2102
|
+
function vl(e, t, n, r, l) {
|
|
2103
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2104
|
+
let o = ml(e, t, n, !1);
|
|
2087
2105
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2088
|
-
return void 0 === o ? s && t ? (
|
|
2089
|
-
let n =
|
|
2106
|
+
return void 0 === o ? s && t ? (jl(e, t, n, Hr(r) ? r : null), r) : (i && !function(e, t) {
|
|
2107
|
+
let n = Hr(t) ? t.split("`") : [], r = e;
|
|
2090
2108
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2091
|
-
if (!
|
|
2109
|
+
if (!Jr(r) && !qr(r)) return !1;
|
|
2092
2110
|
r = r[n[e]];
|
|
2093
2111
|
}
|
|
2094
|
-
return !(!
|
|
2095
|
-
}(t, n) && (
|
|
2112
|
+
return !(!Jr(r) && !qr(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2113
|
+
}(t, n) && (ar(`path not found: '${n}'`), $r(t)), r) : Hr(o) ? (a && hl(e, t, n), o) : (null !== o && (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json str: '${n}'`), $r(t)), r);
|
|
2096
2114
|
}
|
|
2097
|
-
function
|
|
2098
|
-
e && !
|
|
2099
|
-
let o =
|
|
2115
|
+
function Ol(e, t, n, r, l) {
|
|
2116
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2117
|
+
let o = ml(e, t, n, !1);
|
|
2100
2118
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2101
2119
|
if (void 0 === o) {
|
|
2102
2120
|
if (s) {
|
|
2103
2121
|
let l = r;
|
|
2104
|
-
return
|
|
2122
|
+
return jl(e, t, n, l), l;
|
|
2105
2123
|
}
|
|
2106
|
-
return i && (
|
|
2124
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), r;
|
|
2107
2125
|
}
|
|
2108
|
-
return a &&
|
|
2126
|
+
return a && hl(e, t, n), o;
|
|
2109
2127
|
}
|
|
2110
|
-
function
|
|
2111
|
-
e && !
|
|
2112
|
-
let o =
|
|
2128
|
+
function Sl(e, t, n, r, l) {
|
|
2129
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2130
|
+
let o = ml(e, t, n, !1);
|
|
2113
2131
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2114
|
-
return void 0 === o ? s &&
|
|
2132
|
+
return void 0 === o ? s && Jr(r) && t ? (jl(e, t, n, r), r) : (i && (ar(`path not found: '${n}'`), $r(t)), r) : Jr(o) ? (a && hl(e, t, n), o) : s && null === o && Jr(r) ? (jl(e, t, n, r), r) : s && null === o ? (i && (ar(`path not found: '${n}'`), $r(t)), r) : ((i || s) && (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (s ? ", cannot create" : "")), $r(t)), r);
|
|
2115
2133
|
}
|
|
2116
|
-
function
|
|
2117
|
-
e && !
|
|
2118
|
-
let o =
|
|
2134
|
+
function Nl(e, t, n, r, l) {
|
|
2135
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2136
|
+
let o = ml(e, t, n, !1);
|
|
2119
2137
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2120
2138
|
if (void 0 === o) {
|
|
2121
2139
|
if (s) {
|
|
2122
2140
|
let l = r;
|
|
2123
|
-
return
|
|
2141
|
+
return jl(e, t, n, l), l;
|
|
2124
2142
|
}
|
|
2125
|
-
return i && (
|
|
2143
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), r;
|
|
2126
2144
|
}
|
|
2127
|
-
return a &&
|
|
2145
|
+
return a && hl(e, t, n), o;
|
|
2128
2146
|
}
|
|
2129
|
-
function
|
|
2130
|
-
e && !
|
|
2131
|
-
let o =
|
|
2147
|
+
function wl(e, t, n, r, l) {
|
|
2148
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2149
|
+
let o = ml(e, t, n, !1);
|
|
2132
2150
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2133
|
-
return void 0 === o ? s &&
|
|
2151
|
+
return void 0 === o ? s && qr(r) && t ? (jl(e, t, n, r), r) : (i && (ar(`path not found: '${n}'`), $r(t)), r) : qr(o) ? (a && hl(e, t, n), o) : s && null === o && qr(r) ? (jl(e, t, n, r), r) : s && null === o ? (i && (ar(`path not found: '${n}'`), $r(t)), r) : ((i || s) && (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json list: '${n}'` + (s ? ", cannot create" : "")), $r(t)), r);
|
|
2134
2152
|
}
|
|
2135
|
-
function
|
|
2136
|
-
if (e && !
|
|
2137
|
-
if (!
|
|
2138
|
-
if ("" === n) return
|
|
2139
|
-
if (n.split("`").includes("")) return
|
|
2153
|
+
function jl(e, t, n, r) {
|
|
2154
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !Jr(t)) return ar("kw is not an object"), -1;
|
|
2155
|
+
if (!Hr(n)) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2156
|
+
if ("" === n) return ar((e ? Rt(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2157
|
+
if (n.split("`").includes("")) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
2140
2158
|
let l = n.split("`"), o = l.length;
|
|
2141
2159
|
for (let i = 0; i < o; i++) {
|
|
2142
2160
|
let s = l[i];
|
|
2143
|
-
if (
|
|
2144
|
-
const r =
|
|
2145
|
-
if (r < 0) return
|
|
2161
|
+
if (qr(t)) {
|
|
2162
|
+
const r = pl(t, s);
|
|
2163
|
+
if (r < 0) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not an index of its list: '${n}'`), -1;
|
|
2146
2164
|
s = String(r);
|
|
2147
2165
|
}
|
|
2148
|
-
if (i === o - 1)
|
|
2166
|
+
if (i === o - 1) bl(t, s, r);
|
|
2149
2167
|
else {
|
|
2150
|
-
let r =
|
|
2151
|
-
if (void 0 === r)
|
|
2152
|
-
else if (!
|
|
2168
|
+
let r = dl(t, s) ? void 0 : t[s];
|
|
2169
|
+
if (void 0 === r) bl(t, s, {});
|
|
2170
|
+
else if (!Jr(r) && !qr(r)) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not a dict or a list: '${n}'`), -1;
|
|
2153
2171
|
t = t[s];
|
|
2154
2172
|
}
|
|
2155
2173
|
}
|
|
2156
2174
|
return 0;
|
|
2157
2175
|
}
|
|
2158
|
-
function
|
|
2159
|
-
if (e && !
|
|
2160
|
-
let o =
|
|
2176
|
+
function $l(e, t, n, r, l) {
|
|
2177
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !Jr(t)) return ar("kw is not an object"), -1;
|
|
2178
|
+
let o = ml(e, t, n, !1);
|
|
2161
2179
|
if (void 0 === o) {
|
|
2162
|
-
if (!
|
|
2180
|
+
if (!Hr(n) || function(e, t) {
|
|
2163
2181
|
let n = t.split("`"), r = e;
|
|
2164
2182
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2165
|
-
if (
|
|
2166
|
-
const t =
|
|
2183
|
+
if (qr(r)) {
|
|
2184
|
+
const t = pl(r, n[e]);
|
|
2167
2185
|
if (t < 0) return !1;
|
|
2168
2186
|
r = r[t];
|
|
2169
2187
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
2170
2188
|
if (null == r) return !1;
|
|
2171
|
-
if (!
|
|
2189
|
+
if (!Jr(r) && !qr(r)) return !0;
|
|
2172
2190
|
}
|
|
2173
2191
|
return !1;
|
|
2174
2192
|
}(t, n)) return -1;
|
|
2175
|
-
if (o = {},
|
|
2193
|
+
if (o = {}, jl(e, t, n, o) < 0) return -1;
|
|
2176
2194
|
}
|
|
2177
|
-
return
|
|
2195
|
+
return Jr(o) ? (bl(o, r, l), 0) : (ar(`subdict is not an object: '${n}'`), -1);
|
|
2178
2196
|
}
|
|
2179
|
-
function
|
|
2197
|
+
function Rl(e, n, r) {
|
|
2180
2198
|
let l = "", o = !1;
|
|
2181
|
-
if (
|
|
2199
|
+
if (qr(n)) {
|
|
2182
2200
|
o = !1;
|
|
2183
2201
|
for (let i = 0; i < n.length; i++) {
|
|
2184
2202
|
let s = n[i];
|
|
2185
|
-
if (l =
|
|
2203
|
+
if (l = rl(r) ? t("%s", r) : t("%s`%d", r, i), o = Rl(e, s, l), o) break;
|
|
2186
2204
|
}
|
|
2187
|
-
} else if (
|
|
2205
|
+
} else if (Jr(n)) {
|
|
2188
2206
|
o = !0;
|
|
2189
2207
|
let i = Object.keys(n);
|
|
2190
2208
|
for (let s = 0; s < i.length; s++) {
|
|
2191
2209
|
let a = i[s], u = n[a];
|
|
2192
|
-
if (l =
|
|
2193
|
-
if (o =
|
|
2210
|
+
if (l = rl(r) ? t("%s", a) : t("%s`%s", r, a), qr(u) || Jr(u)) {
|
|
2211
|
+
if (o = Rl(e, u, l), !o) break;
|
|
2194
2212
|
continue;
|
|
2195
2213
|
}
|
|
2196
|
-
let _ =
|
|
2197
|
-
if (void 0 === _ && (_ =
|
|
2214
|
+
let _ = Nl(0, e, l, void 0, 0);
|
|
2215
|
+
if (void 0 === _ && (_ = Lr(e, l)), void 0 === _) {
|
|
2198
2216
|
o = !1;
|
|
2199
2217
|
break;
|
|
2200
2218
|
}
|
|
2201
|
-
if (0 !==
|
|
2219
|
+
if (0 !== al(_, u)) {
|
|
2202
2220
|
o = !1;
|
|
2203
2221
|
break;
|
|
2204
2222
|
}
|
|
@@ -2206,92 +2224,92 @@ function jl(e, n, r) {
|
|
|
2206
2224
|
}
|
|
2207
2225
|
return o;
|
|
2208
2226
|
}
|
|
2209
|
-
function
|
|
2210
|
-
return 0 ===
|
|
2227
|
+
function Dl(e, t) {
|
|
2228
|
+
return 0 === Yr(t) || Rl(e, t, "");
|
|
2211
2229
|
}
|
|
2212
|
-
function
|
|
2213
|
-
if (!n || !
|
|
2214
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2215
|
-
return r &&
|
|
2230
|
+
function Al(e, t, n, r) {
|
|
2231
|
+
if (!n || !qr(t)) return r && ar("item NULL or kw_list is not a list"), -1;
|
|
2232
|
+
for (let e = 0; e < t.length; e++) if (Ar(n, t[e])) return e;
|
|
2233
|
+
return r && ar("item not found in this list"), -1;
|
|
2216
2234
|
}
|
|
2217
|
-
function
|
|
2218
|
-
if (e && !
|
|
2219
|
-
r || (r =
|
|
2235
|
+
function kl(e, t, n, r) {
|
|
2236
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return null;
|
|
2237
|
+
r || (r = Dl);
|
|
2220
2238
|
let l = [];
|
|
2221
|
-
if (
|
|
2239
|
+
if (qr(t)) for (let e = 0; e < t.length; e++) {
|
|
2222
2240
|
let o = t[e];
|
|
2223
|
-
r(o, n) && l.push(
|
|
2241
|
+
r(o, n) && l.push(Rr(o));
|
|
2224
2242
|
}
|
|
2225
2243
|
else {
|
|
2226
|
-
if (!
|
|
2227
|
-
r(t, n) && l.push(
|
|
2244
|
+
if (!Jr(t)) return ar("kw_select() BAD kw parameter"), null;
|
|
2245
|
+
r(t, n) && l.push(Rr(t));
|
|
2228
2246
|
}
|
|
2229
2247
|
return l;
|
|
2230
2248
|
}
|
|
2231
|
-
function
|
|
2232
|
-
if (e && !
|
|
2233
|
-
r || (r =
|
|
2249
|
+
function Il(e, t, n, r) {
|
|
2250
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return null;
|
|
2251
|
+
r || (r = Dl);
|
|
2234
2252
|
let l = [];
|
|
2235
|
-
if (
|
|
2253
|
+
if (qr(t)) for (let e = 0; e < t.length; e++) {
|
|
2236
2254
|
let o = t[e];
|
|
2237
2255
|
r(o, n) && l.push(o);
|
|
2238
2256
|
}
|
|
2239
2257
|
else {
|
|
2240
|
-
if (!
|
|
2258
|
+
if (!Jr(t)) return ar("kw_select() BAD kw parameter"), null;
|
|
2241
2259
|
r(t, n) && l.push(t);
|
|
2242
2260
|
}
|
|
2243
2261
|
return l;
|
|
2244
2262
|
}
|
|
2245
|
-
function
|
|
2246
|
-
e && !
|
|
2263
|
+
function Cl(e, t, n, r) {
|
|
2264
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2247
2265
|
let l = {};
|
|
2248
|
-
if (
|
|
2266
|
+
if (Hr(n) && !rl(n)) {
|
|
2249
2267
|
let o = n;
|
|
2250
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
2251
|
-
} else if (
|
|
2268
|
+
Object.prototype.hasOwnProperty.call(t, o) ? bl(l, o, t[o]) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2269
|
+
} else if (Jr(n) && xr(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? bl(l, o, t[o]) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2252
2270
|
else {
|
|
2253
|
-
if (!(
|
|
2271
|
+
if (!(qr(n) && Kr(n) > 0)) return t;
|
|
2254
2272
|
for (let o = 0; o < n.length; o++) {
|
|
2255
2273
|
let i = n[o];
|
|
2256
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2274
|
+
Object.prototype.hasOwnProperty.call(t, i) ? bl(l, i, t[i]) : r && ar(`${Rt(e)}: key not found: ${i}`);
|
|
2257
2275
|
}
|
|
2258
2276
|
}
|
|
2259
2277
|
return l;
|
|
2260
2278
|
}
|
|
2261
|
-
function
|
|
2279
|
+
function Ll(e, t, n, r) {
|
|
2262
2280
|
let l = {};
|
|
2263
|
-
if (!
|
|
2264
|
-
if (
|
|
2281
|
+
if (!Jr(t)) return l;
|
|
2282
|
+
if (kr(l, t), Hr(n) && !rl(n)) {
|
|
2265
2283
|
let o = n;
|
|
2266
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
2267
|
-
} else if (
|
|
2284
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Pr(l, o) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2285
|
+
} else if (Jr(n) && xr(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Pr(l, o) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2268
2286
|
else {
|
|
2269
|
-
if (!(
|
|
2287
|
+
if (!(qr(n) && Kr(n) > 0)) return {};
|
|
2270
2288
|
for (let o = 0; o < n.length; o++) {
|
|
2271
2289
|
let i = n[o];
|
|
2272
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2290
|
+
Object.prototype.hasOwnProperty.call(t, i) ? Pr(l, i) : r && ar(`${Rt(e)}: key not found: ${i}`);
|
|
2273
2291
|
}
|
|
2274
2292
|
}
|
|
2275
2293
|
return l;
|
|
2276
2294
|
}
|
|
2277
|
-
function
|
|
2295
|
+
function Pl(e, t, n = !1) {
|
|
2278
2296
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
2279
2297
|
let r = window.localStorage.getItem(e);
|
|
2280
|
-
return null === r ? (n &&
|
|
2298
|
+
return null === r ? (n && Ul(e, t), t) : JSON.parse(r);
|
|
2281
2299
|
} catch (n) {
|
|
2282
2300
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
2283
2301
|
}
|
|
2284
2302
|
}
|
|
2285
|
-
function
|
|
2303
|
+
function Ul(e, t) {
|
|
2286
2304
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
2287
|
-
if (!e || void 0 === t) return
|
|
2305
|
+
if (!e || void 0 === t) return ar(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
2288
2306
|
try {
|
|
2289
2307
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
2290
2308
|
} catch (t) {
|
|
2291
|
-
return
|
|
2309
|
+
return ar(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
2292
2310
|
}
|
|
2293
2311
|
}
|
|
2294
|
-
function
|
|
2312
|
+
function Fl(e) {
|
|
2295
2313
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
2296
2314
|
window.localStorage.removeItem(e);
|
|
2297
2315
|
} catch (t) {
|
|
@@ -2299,125 +2317,125 @@ function Pl(e) {
|
|
|
2299
2317
|
}
|
|
2300
2318
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2301
2319
|
}
|
|
2302
|
-
function
|
|
2303
|
-
if (
|
|
2304
|
-
if (
|
|
2320
|
+
function Vl(e, t) {
|
|
2321
|
+
if (Xr(e) || Xr(t)) return !0;
|
|
2322
|
+
if (qr(e)) {
|
|
2305
2323
|
if (0 === e.length) return !0;
|
|
2306
2324
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2307
|
-
} else if (
|
|
2325
|
+
} else if (Jr(e)) {
|
|
2308
2326
|
if (0 === Object.keys(e).length) return !0;
|
|
2309
2327
|
for (let n in e) if (n === t) return !0;
|
|
2310
|
-
} else if (
|
|
2328
|
+
} else if (Hr(e) && e === t) return !0;
|
|
2311
2329
|
return !1;
|
|
2312
2330
|
}
|
|
2313
|
-
function
|
|
2314
|
-
if (e && !
|
|
2315
|
-
l || (l =
|
|
2331
|
+
function Gl(e, t, n, r, l) {
|
|
2332
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return null;
|
|
2333
|
+
l || (l = Dl);
|
|
2316
2334
|
let o = [];
|
|
2317
|
-
if (
|
|
2335
|
+
if (qr(t)) for (let i = 0; i < t.length; i++) {
|
|
2318
2336
|
let s, a = t[i];
|
|
2319
|
-
if (
|
|
2337
|
+
if (Jr(a)) s = vl(e, a, "id", "", 0);
|
|
2320
2338
|
else {
|
|
2321
|
-
if (!
|
|
2339
|
+
if (!Hr(a)) continue;
|
|
2322
2340
|
s = a;
|
|
2323
2341
|
}
|
|
2324
|
-
|
|
2342
|
+
Vl(n, s) && l(a, r) && o.push(a);
|
|
2325
2343
|
}
|
|
2326
2344
|
else {
|
|
2327
|
-
if (!
|
|
2345
|
+
if (!Jr(t)) return ar("kw_collect() BAD kw parameter"), null;
|
|
2328
2346
|
for (let e of Object.keys(t)) {
|
|
2329
2347
|
let i = t[e];
|
|
2330
|
-
|
|
2348
|
+
Vl(n, e) && l(i, r) && o.push(i);
|
|
2331
2349
|
}
|
|
2332
2350
|
}
|
|
2333
2351
|
return o;
|
|
2334
2352
|
}
|
|
2335
|
-
function
|
|
2336
|
-
e && !
|
|
2353
|
+
function Ml(e, t, n) {
|
|
2354
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2337
2355
|
let r = {};
|
|
2338
|
-
if (
|
|
2339
|
-
else if (
|
|
2340
|
-
let l = t[n], o =
|
|
2341
|
-
|
|
2356
|
+
if (rl(n) || (t = ml(e, t, n)), Jr(t)) r = t;
|
|
2357
|
+
else if (qr(t)) for (let n = 0; n < t.length; n++) {
|
|
2358
|
+
let l = t[n], o = vl(e, l, "id", "", Vn.KW_REQUIRED);
|
|
2359
|
+
rl(o) || bl(r, o, l);
|
|
2342
2360
|
}
|
|
2343
|
-
else
|
|
2361
|
+
else ar(`${Rt(e)} kwid_new_dict: data type unknown`);
|
|
2344
2362
|
return r;
|
|
2345
2363
|
}
|
|
2346
|
-
function
|
|
2347
|
-
if (e && !
|
|
2348
|
-
if (
|
|
2364
|
+
function Wl(e, t, n) {
|
|
2365
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), rl(n) || (t = ml(e, t, n)), qr(t)) return t;
|
|
2366
|
+
if (Jr(t)) {
|
|
2349
2367
|
let n = [];
|
|
2350
2368
|
for (let r of Object.keys(t)) {
|
|
2351
2369
|
let l = t[r];
|
|
2352
|
-
|
|
2370
|
+
Jr(l) ? (l.id = r, n.push(l)) : ar(`${Rt(e)} kwid_new_list: not a record: '${r}'`);
|
|
2353
2371
|
}
|
|
2354
2372
|
return n;
|
|
2355
2373
|
}
|
|
2356
|
-
return
|
|
2374
|
+
return ar(`${Rt(e)} kwid_new_list: wrong type for list`), [];
|
|
2357
2375
|
}
|
|
2358
|
-
function
|
|
2359
|
-
e && !
|
|
2360
|
-
let o =
|
|
2376
|
+
function xl(e, t, n, r, l) {
|
|
2377
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2378
|
+
let o = Gl(e, t, n, r, l);
|
|
2361
2379
|
return o && 0 !== o.length ? o[0] : null;
|
|
2362
2380
|
}
|
|
2363
|
-
function
|
|
2364
|
-
if (e && !
|
|
2381
|
+
function Kl(e, t) {
|
|
2382
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return [];
|
|
2365
2383
|
let n = [];
|
|
2366
|
-
if (
|
|
2367
|
-
else if (
|
|
2368
|
-
else
|
|
2369
|
-
if (
|
|
2370
|
-
else if (
|
|
2371
|
-
let r =
|
|
2384
|
+
if (Hr(t)) n.push(t);
|
|
2385
|
+
else if (Jr(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
2386
|
+
else qr(t) && t.forEach(function(t) {
|
|
2387
|
+
if (Hr(t)) rl(t) || n.push(t);
|
|
2388
|
+
else if (Jr(t)) {
|
|
2389
|
+
let r = vl(e, t, "id", 0, 0);
|
|
2372
2390
|
r && n.push(r);
|
|
2373
2391
|
}
|
|
2374
2392
|
});
|
|
2375
2393
|
return n;
|
|
2376
2394
|
}
|
|
2377
|
-
function
|
|
2395
|
+
function Yl(e, t, n) {
|
|
2378
2396
|
t = t || "id", n = n || "value";
|
|
2379
2397
|
let r = [];
|
|
2380
|
-
if (
|
|
2398
|
+
if (qr(e)) for (let l = 0; l < e.length; l++) {
|
|
2381
2399
|
let o = e[l];
|
|
2382
|
-
if (
|
|
2400
|
+
if (Hr(o)) r.push({
|
|
2383
2401
|
id: e[l],
|
|
2384
2402
|
value: e[l]
|
|
2385
2403
|
});
|
|
2386
|
-
else if (
|
|
2404
|
+
else if (Jr(o)) {
|
|
2387
2405
|
let e = {};
|
|
2388
|
-
if (
|
|
2389
|
-
if (!
|
|
2390
|
-
if (!(
|
|
2391
|
-
|
|
2406
|
+
if (gl(o, t)) {
|
|
2407
|
+
if (!gl(o, n)) {
|
|
2408
|
+
if (!(Yr(o) > 0)) {
|
|
2409
|
+
ar("list2options(): object without field value: " + n);
|
|
2392
2410
|
continue;
|
|
2393
2411
|
}
|
|
2394
2412
|
n = Object.keys(o)[0];
|
|
2395
2413
|
}
|
|
2396
2414
|
e.id = o[t], e.value = o[n];
|
|
2397
2415
|
} else {
|
|
2398
|
-
if (!(
|
|
2399
|
-
|
|
2416
|
+
if (!(Yr(o) > 0)) {
|
|
2417
|
+
ar("list2options(): object without field id: " + t);
|
|
2400
2418
|
continue;
|
|
2401
2419
|
}
|
|
2402
2420
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
2403
2421
|
}
|
|
2404
2422
|
r.push(e);
|
|
2405
|
-
} else
|
|
2423
|
+
} else ar("list2options(): case1 not implemented");
|
|
2406
2424
|
}
|
|
2407
|
-
else if (
|
|
2425
|
+
else if (Jr(e)) for (let t of Object.keys(e)) r.push({
|
|
2408
2426
|
id: t,
|
|
2409
2427
|
value: t
|
|
2410
2428
|
});
|
|
2411
|
-
else
|
|
2429
|
+
else ar("list2options(): case2 not implemented");
|
|
2412
2430
|
return r;
|
|
2413
2431
|
}
|
|
2414
|
-
function
|
|
2432
|
+
function Bl(e, t) {
|
|
2415
2433
|
if (!e) return -1;
|
|
2416
2434
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2417
2435
|
return -1;
|
|
2418
2436
|
}
|
|
2419
|
-
function
|
|
2420
|
-
if (!e || !t) return
|
|
2437
|
+
function Jl(e, t, n) {
|
|
2438
|
+
if (!e || !t) return ar("ERROR: str_in_list() list or str empty"), !1;
|
|
2421
2439
|
let r = e.length;
|
|
2422
2440
|
if (n) {
|
|
2423
2441
|
t = t.toLowerCase();
|
|
@@ -2428,17 +2446,17 @@ function Yl(e, t, n) {
|
|
|
2428
2446
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2429
2447
|
return !1;
|
|
2430
2448
|
}
|
|
2431
|
-
function
|
|
2432
|
-
if (!e) return
|
|
2433
|
-
if (!t) return
|
|
2434
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2449
|
+
function ql(e, t, n) {
|
|
2450
|
+
if (!e) return ar("ERROR: strs_in_list() list empty"), !1;
|
|
2451
|
+
if (!t) return ar("ERROR: strs_in_list() str empty"), !1;
|
|
2452
|
+
for (let r = 0; r < t.length; r++) if (Jl(e, t[r], n)) return !0;
|
|
2435
2453
|
return !1;
|
|
2436
2454
|
}
|
|
2437
|
-
function
|
|
2455
|
+
function Hl(e, t) {
|
|
2438
2456
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2439
2457
|
return !1;
|
|
2440
2458
|
}
|
|
2441
|
-
function
|
|
2459
|
+
function zl(e, t) {
|
|
2442
2460
|
try {
|
|
2443
2461
|
let n = e.__md_iev__;
|
|
2444
2462
|
if (n) return n[t];
|
|
@@ -2446,53 +2464,53 @@ function ql(e, t) {
|
|
|
2446
2464
|
return;
|
|
2447
2465
|
}
|
|
2448
2466
|
}
|
|
2449
|
-
function
|
|
2467
|
+
function Ql(e, t, n) {
|
|
2450
2468
|
let r = e.__md_iev__;
|
|
2451
2469
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2452
2470
|
}
|
|
2453
|
-
function
|
|
2454
|
-
if (!
|
|
2471
|
+
function Xl(e, t, n, r) {
|
|
2472
|
+
if (!nl(e)) return ar("gobj is not a GObj"), null;
|
|
2455
2473
|
if (!t) return;
|
|
2456
|
-
let l =
|
|
2457
|
-
l || (l = [],
|
|
2474
|
+
let l = zl(t, n);
|
|
2475
|
+
l || (l = [], Ql(t, n, l));
|
|
2458
2476
|
try {
|
|
2459
|
-
|
|
2477
|
+
qr(l) && l.unshift(r);
|
|
2460
2478
|
} catch (e) {
|
|
2461
|
-
|
|
2479
|
+
ar(e);
|
|
2462
2480
|
}
|
|
2463
2481
|
}
|
|
2464
|
-
function
|
|
2465
|
-
if (!
|
|
2466
|
-
if (!
|
|
2467
|
-
let l =
|
|
2468
|
-
return l ? 0 === l.length ? (r &&
|
|
2482
|
+
function Zl(e, t, n, r) {
|
|
2483
|
+
if (!nl(e)) return ar("gobj is not a GObj"), null;
|
|
2484
|
+
if (!Jr(t)) return ar("kw is not a dict"), null;
|
|
2485
|
+
let l = zl(t, n);
|
|
2486
|
+
return l ? 0 === l.length ? (r && ar(`stack empty: ${n}`), null) : l[0] : (r && ar(`stack NOT FOUND: ${n}`), null);
|
|
2469
2487
|
}
|
|
2470
|
-
function
|
|
2471
|
-
return
|
|
2488
|
+
function eo(e, t, n) {
|
|
2489
|
+
return rl(n) ? hl(e, t, "__md_iev__`__msg_type__") : $l(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2472
2490
|
}
|
|
2473
|
-
function
|
|
2474
|
-
return
|
|
2491
|
+
function to(e, t) {
|
|
2492
|
+
return vl(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2475
2493
|
}
|
|
2476
|
-
function
|
|
2494
|
+
function no(e, t, n) {
|
|
2477
2495
|
let r = new XMLHttpRequest();
|
|
2478
2496
|
r.open("GET", e, !0), r.setRequestHeader("Accept", "application/json"), r.onreadystatechange = function() {
|
|
2479
2497
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2480
2498
|
t(JSON.parse(r.responseText));
|
|
2481
2499
|
} catch (e) {
|
|
2482
|
-
n && (
|
|
2500
|
+
n && (ar(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2483
2501
|
}
|
|
2484
2502
|
else n && n(r.status);
|
|
2485
2503
|
var e;
|
|
2486
2504
|
}, r.send();
|
|
2487
2505
|
}
|
|
2488
|
-
function
|
|
2506
|
+
function ro(e, t, n) {
|
|
2489
2507
|
let r = new XMLHttpRequest();
|
|
2490
2508
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2491
2509
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2492
2510
|
}, r.send(t);
|
|
2493
2511
|
}
|
|
2494
|
-
function
|
|
2495
|
-
void 0 !== n &&
|
|
2512
|
+
function lo(e, t, n) {
|
|
2513
|
+
void 0 !== n && Hr(n) || (n = "");
|
|
2496
2514
|
for (let r of Object.keys(e)) {
|
|
2497
2515
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2498
2516
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2501,69 +2519,62 @@ function no(e, t, n) {
|
|
|
2501
2519
|
r,
|
|
2502
2520
|
e[r],
|
|
2503
2521
|
n
|
|
2504
|
-
]),
|
|
2522
|
+
]), Jr(e[r]) && lo(e[r], t, n), n = n.slice(0, -l.length);
|
|
2505
2523
|
}
|
|
2506
2524
|
}
|
|
2507
|
-
function
|
|
2508
|
-
n && (e =
|
|
2509
|
-
let r =
|
|
2510
|
-
|
|
2511
|
-
let l =
|
|
2512
|
-
return
|
|
2513
|
-
"__" === t.substring(0, 2) ||
|
|
2525
|
+
function oo(e, t, n) {
|
|
2526
|
+
n && (e = Rr(e));
|
|
2527
|
+
let r = Nl(null, e, "type", [], Vn.KW_CREATE);
|
|
2528
|
+
vl(null, e, "hook", "data", Vn.KW_CREATE);
|
|
2529
|
+
let l = Nl(null, e, "schema", {}, Vn.KW_CREATE), o = Nl(null, e, "topics", {}, Vn.KW_CREATE);
|
|
2530
|
+
return lo(l, function(e, t, n, l) {
|
|
2531
|
+
"__" === t.substring(0, 2) || Jr(n) || Nl(null, o, l, Rr(r), Vn.KW_CREATE);
|
|
2514
2532
|
}, t), e;
|
|
2515
2533
|
}
|
|
2516
|
-
function
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
function oo(e, t, n, r) {
|
|
2524
|
-
let l = Ol(null, Ol(null, e, "topics", null, 0), t, null, 0);
|
|
2525
|
-
if (!l) return ir("jdb_update: topic not found: " + t), null;
|
|
2526
|
-
if (!Yr(r) || tl(r.id)) return ir(`jdb_update: record without id: ${lo(r)}`), null;
|
|
2527
|
-
if (!Jr(n)) return ir(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
2528
|
-
if ("" !== n && n.split("`").includes("")) return ir(`jdb_update: empty segment in path: '${n}'`), null;
|
|
2534
|
+
function io(e, t, n, r) {
|
|
2535
|
+
let l = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2536
|
+
if (!l) return ar("jdb_update: topic not found: " + t), null;
|
|
2537
|
+
if (!Jr(r) || rl(r.id)) return ar(`jdb_update: record without id: ${lr(r)}`), null;
|
|
2538
|
+
if (!Hr(n)) return ar(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
2539
|
+
if ("" !== n && n.split("`").includes("")) return ar(`jdb_update: empty segment in path: '${n}'`), null;
|
|
2529
2540
|
let o, i, s = n.split("`"), a = l;
|
|
2530
|
-
for (; (o = s.shift()) && !
|
|
2531
|
-
if (!a || 0 !== s.length) return
|
|
2532
|
-
if (
|
|
2541
|
+
for (; (o = s.shift()) && !rl(o) && a;) Jr(a) && (a = Nl(null, a, e.hook, null, 0)), a = co(a, null, o, !1);
|
|
2542
|
+
if (!a || 0 !== s.length) return ar(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
2543
|
+
if (qr(a)) i = a;
|
|
2533
2544
|
else {
|
|
2534
|
-
if (a.id === r.id) return
|
|
2535
|
-
if (i =
|
|
2536
|
-
else if (!
|
|
2537
|
-
}
|
|
2538
|
-
let u =
|
|
2539
|
-
return u ?
|
|
2540
|
-
}
|
|
2541
|
-
function
|
|
2542
|
-
let l =
|
|
2543
|
-
if (!l) return
|
|
2544
|
-
if (!
|
|
2545
|
-
if (!
|
|
2546
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
2545
|
+
if (a.id === r.id) return kr(a, r), l;
|
|
2546
|
+
if (i = Nl(null, a, e.hook, null, 0), null == i) i = [], Ur(a, e.hook, i);
|
|
2547
|
+
else if (!qr(i)) return ar(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
2548
|
+
}
|
|
2549
|
+
let u = co(i, e.hook, r.id, !1);
|
|
2550
|
+
return u ? kr(u, r) : i.push(r), l;
|
|
2551
|
+
}
|
|
2552
|
+
function so(e, t, n, r) {
|
|
2553
|
+
let l = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2554
|
+
if (!l) return ar("jdb_delete: topic not found: " + t), null;
|
|
2555
|
+
if (!Jr(r) || rl(r.id)) return ar(`jdb_delete: record without id: ${lr(r)}`), null;
|
|
2556
|
+
if (!Hr(n)) return ar(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
2557
|
+
if ("" !== n && n.split("`").includes("")) return ar(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
2547
2558
|
let o, i = n.split("`"), s = l;
|
|
2548
|
-
for (; (o = i.shift()) && !
|
|
2549
|
-
if (!s || 0 !== i.length) return
|
|
2550
|
-
let a =
|
|
2551
|
-
return u < 0 ? (
|
|
2559
|
+
for (; (o = i.shift()) && !rl(o) && s;) Jr(s) && (s = Nl(null, s, e.hook, null, 0)), s = co(s, null, o, !1);
|
|
2560
|
+
if (!s || 0 !== i.length) return ar(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
2561
|
+
let a = qr(s) ? s : Nl(null, s, e.hook, null, 0), u = Bl(a, r.id);
|
|
2562
|
+
return u < 0 ? (ar(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), l);
|
|
2552
2563
|
}
|
|
2553
|
-
function
|
|
2554
|
-
let n =
|
|
2555
|
-
if (!n) return
|
|
2556
|
-
return
|
|
2564
|
+
function ao(e, t) {
|
|
2565
|
+
let n = Nl(null, e, "topics", null, 0);
|
|
2566
|
+
if (!n) return ar("jdb topics section not found"), fr(e), null;
|
|
2567
|
+
return Nl(null, n, t, null, 0) || (ar("jdb topic not found: " + t), fr(n), null);
|
|
2557
2568
|
}
|
|
2558
|
-
function
|
|
2559
|
-
let l =
|
|
2560
|
-
return l ? (void 0 === r && (r = !0),
|
|
2569
|
+
function uo(e, t, n, r) {
|
|
2570
|
+
let l = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2571
|
+
return l ? (void 0 === r && (r = !0), co(l, e.hook, n, r)) : (ar("jdb_get: topic not found: " + t), null);
|
|
2561
2572
|
}
|
|
2562
|
-
function
|
|
2563
|
-
let r =
|
|
2564
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2573
|
+
function _o(e, t, n) {
|
|
2574
|
+
let r = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2575
|
+
return r ? n < r.length ? r[n] : {} : (ar("jdb_get_by_idx: topic not found: " + t), null);
|
|
2565
2576
|
}
|
|
2566
|
-
function
|
|
2577
|
+
function co(e, t, n, r) {
|
|
2567
2578
|
if (!e) return null;
|
|
2568
2579
|
let l, o = e.length;
|
|
2569
2580
|
for (l = 0; l < o; l++) {
|
|
@@ -2571,19 +2582,19 @@ function _o(e, t, n, r) {
|
|
|
2571
2582
|
if (o) {
|
|
2572
2583
|
let e = o.id;
|
|
2573
2584
|
if (e && e === n) return o;
|
|
2574
|
-
if (r &&
|
|
2575
|
-
let e =
|
|
2585
|
+
if (r && gl(o, t)) {
|
|
2586
|
+
let e = co(o[t], t, n, r);
|
|
2576
2587
|
if (e) return e;
|
|
2577
2588
|
}
|
|
2578
2589
|
}
|
|
2579
2590
|
}
|
|
2580
2591
|
return null;
|
|
2581
2592
|
}
|
|
2582
|
-
function
|
|
2583
|
-
let n =
|
|
2584
|
-
return
|
|
2593
|
+
function fo(e, t) {
|
|
2594
|
+
let n = Rr(e);
|
|
2595
|
+
return Ir(n, t), n;
|
|
2585
2596
|
}
|
|
2586
|
-
function
|
|
2597
|
+
function go(e) {
|
|
2587
2598
|
function t(e) {
|
|
2588
2599
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2589
2600
|
switch (t.length % 4) {
|
|
@@ -2614,9 +2625,9 @@ function fo(e) {
|
|
|
2614
2625
|
signature: t(n[2])
|
|
2615
2626
|
};
|
|
2616
2627
|
}
|
|
2617
|
-
function
|
|
2628
|
+
function bo(e, t) {
|
|
2618
2629
|
try {
|
|
2619
|
-
let n =
|
|
2630
|
+
let n = go(e);
|
|
2620
2631
|
switch (t) {
|
|
2621
2632
|
case "header": return JSON.parse(n.header);
|
|
2622
2633
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2626,15 +2637,15 @@ function go(e, t) {
|
|
|
2626
2637
|
return null;
|
|
2627
2638
|
}
|
|
2628
2639
|
}
|
|
2629
|
-
function
|
|
2640
|
+
function po(e) {
|
|
2630
2641
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2631
2642
|
}
|
|
2632
|
-
function
|
|
2643
|
+
function mo(e) {
|
|
2633
2644
|
if (!e) return "";
|
|
2634
2645
|
const t = String(e).trim();
|
|
2635
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2646
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : po(t);
|
|
2636
2647
|
}
|
|
2637
|
-
var
|
|
2648
|
+
var ho = class {
|
|
2638
2649
|
constructor(e) {
|
|
2639
2650
|
this.html = e, Object.freeze(this);
|
|
2640
2651
|
}
|
|
@@ -2642,52 +2653,52 @@ var mo = class {
|
|
|
2642
2653
|
return this.html;
|
|
2643
2654
|
}
|
|
2644
2655
|
};
|
|
2645
|
-
function ho(e) {
|
|
2646
|
-
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new mo("")) : new mo(e);
|
|
2647
|
-
}
|
|
2648
2656
|
function Eo(e) {
|
|
2649
|
-
return e
|
|
2657
|
+
return "string" != typeof e ? (ar("html_markup: not a string, type " + typeof e), new ho("")) : new ho(e);
|
|
2650
2658
|
}
|
|
2651
2659
|
function yo(e) {
|
|
2660
|
+
return e instanceof ho;
|
|
2661
|
+
}
|
|
2662
|
+
function To(e) {
|
|
2652
2663
|
const t = document.createElement("template");
|
|
2653
2664
|
return t.innerHTML = e.html.trim(), t.content;
|
|
2654
2665
|
}
|
|
2655
|
-
var
|
|
2656
|
-
function
|
|
2657
|
-
|
|
2666
|
+
var vo = !1, Oo = /* @__PURE__ */ new Set();
|
|
2667
|
+
function So(e) {
|
|
2668
|
+
vo = !!e;
|
|
2658
2669
|
}
|
|
2659
|
-
function
|
|
2660
|
-
return
|
|
2670
|
+
function No() {
|
|
2671
|
+
return vo;
|
|
2661
2672
|
}
|
|
2662
|
-
function
|
|
2673
|
+
function wo(e) {
|
|
2663
2674
|
const t = document.createElement("template");
|
|
2664
2675
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2665
2676
|
}
|
|
2666
|
-
function
|
|
2677
|
+
function jo(e, t) {
|
|
2667
2678
|
let [n, r, l, o] = e;
|
|
2668
|
-
if (!n) return void
|
|
2679
|
+
if (!n) return void ar("Tag must be a valid HTML element.");
|
|
2669
2680
|
let i = document.createElement(n), s = "";
|
|
2670
2681
|
if (r && "object" == typeof r) for (let e of Object.keys(r)) if ("style" === e && "object" == typeof r[e]) {
|
|
2671
2682
|
let t = "";
|
|
2672
2683
|
for (const n of Object.keys(r[e])) t += `${n}: ${r[e][n]};`;
|
|
2673
2684
|
i.style.cssText = t;
|
|
2674
2685
|
} else "style" === e ? i.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], i.setAttribute("data-i18n", s)) : i.setAttribute(e, r[e]);
|
|
2675
|
-
if (
|
|
2676
|
-
else if (
|
|
2686
|
+
if (yo(l)) i.appendChild(To(l));
|
|
2687
|
+
else if (Hr(l)) if (l = l.trim(), l.length > 0 && "<" === l[0] && !vo) i.appendChild(wo(l));
|
|
2677
2688
|
else if (l.length > 0 && "<" === l[0] && function(e) {
|
|
2678
|
-
if (
|
|
2689
|
+
if (Oo.size >= 100) return;
|
|
2679
2690
|
const t = e.slice(0, 80);
|
|
2680
|
-
|
|
2691
|
+
Oo.has(t) || (Oo.add(t), ur(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2681
2692
|
}(l), t && s) i.textContent = t(s) || l;
|
|
2682
2693
|
else i.textContent = l;
|
|
2683
|
-
else if (
|
|
2684
|
-
if (l.length > 0) if (
|
|
2685
|
-
else for (let e of l) Array.isArray(e) ? e.length > 0 && i.appendChild(
|
|
2686
|
-
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (
|
|
2694
|
+
else if (qr(l)) {
|
|
2695
|
+
if (l.length > 0) if (Hr(l[0])) i.appendChild(jo(l, t));
|
|
2696
|
+
else for (let e of l) Array.isArray(e) ? e.length > 0 && i.appendChild(jo(e, t)) : e instanceof Node ? i.appendChild(e) : yo(e) ? i.appendChild(To(e)) : Hr(e) ? i.appendChild(document.createTextNode(e)) : null != e && !1 !== e && ar("createElement2: child ignored, type " + typeof e);
|
|
2697
|
+
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (ar("content ignored"), gr(l));
|
|
2687
2698
|
if (o && "object" == typeof o) for (const e of Object.keys(o)) i.addEventListener(e, o[e]);
|
|
2688
2699
|
return i;
|
|
2689
2700
|
}
|
|
2690
|
-
function
|
|
2701
|
+
function $o(e) {
|
|
2691
2702
|
if (!e) return {
|
|
2692
2703
|
top: 0,
|
|
2693
2704
|
left: 0,
|
|
@@ -2707,11 +2718,11 @@ function jo(e) {
|
|
|
2707
2718
|
bottom: t + i + l
|
|
2708
2719
|
};
|
|
2709
2720
|
}
|
|
2710
|
-
function
|
|
2721
|
+
function Ro(e) {
|
|
2711
2722
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2712
2723
|
}
|
|
2713
|
-
function
|
|
2714
|
-
if (!
|
|
2724
|
+
function Do(e, t) {
|
|
2725
|
+
if (!tl(t)) return void ar("You must supply a translation function");
|
|
2715
2726
|
e || (e = document);
|
|
2716
2727
|
const n = (t) => {
|
|
2717
2728
|
let n = [];
|
|
@@ -2734,41 +2745,41 @@ function Ro(e, t) {
|
|
|
2734
2745
|
n && e.setAttribute("placeholder", t(n));
|
|
2735
2746
|
});
|
|
2736
2747
|
}
|
|
2737
|
-
function
|
|
2748
|
+
function Ao(e = "Time Tracker", t = !1) {
|
|
2738
2749
|
const n = e, r = performance.now();
|
|
2739
2750
|
let l = r;
|
|
2740
|
-
return t &&
|
|
2751
|
+
return t && ur(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
2741
2752
|
const i = performance.now(), s = (i - l) / 1e3, a = (i - r) / 1e3;
|
|
2742
|
-
return t &&
|
|
2753
|
+
return t && ur(`--\x3e ${n} ${e} - partial: ${s} sec, total: ${a} sec, ${o}`), l = i, {
|
|
2743
2754
|
partial: s,
|
|
2744
2755
|
total: a
|
|
2745
2756
|
};
|
|
2746
2757
|
} };
|
|
2747
2758
|
}
|
|
2748
|
-
function
|
|
2759
|
+
function ko(e) {
|
|
2749
2760
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2750
2761
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2751
2762
|
}
|
|
2752
|
-
function
|
|
2763
|
+
function Io() {
|
|
2753
2764
|
return Math.floor(Date.now() / 1e3);
|
|
2754
2765
|
}
|
|
2755
|
-
function
|
|
2766
|
+
function Co(e, t) {
|
|
2756
2767
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2757
2768
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2758
2769
|
return -1;
|
|
2759
2770
|
}
|
|
2760
|
-
function
|
|
2771
|
+
function Lo() {
|
|
2761
2772
|
let e = "";
|
|
2762
2773
|
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;
|
|
2763
2774
|
}
|
|
2764
|
-
function
|
|
2775
|
+
function Po(e) {
|
|
2765
2776
|
return e.replace(/[?# ^:]/g, "_");
|
|
2766
2777
|
}
|
|
2767
|
-
function
|
|
2778
|
+
function Uo(e) {
|
|
2768
2779
|
let t = null;
|
|
2769
2780
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2770
2781
|
}
|
|
2771
|
-
function
|
|
2782
|
+
function Fo(e, t = 0, n = !1) {
|
|
2772
2783
|
let r = null, l = null, o = null;
|
|
2773
2784
|
const i = (...i) => {
|
|
2774
2785
|
o = this, l = i;
|
|
@@ -2783,20 +2794,20 @@ function Uo(e, t = 0, n = !1) {
|
|
|
2783
2794
|
clearTimeout(r), r = null, l = null, o = null;
|
|
2784
2795
|
}, i;
|
|
2785
2796
|
}
|
|
2786
|
-
function
|
|
2797
|
+
function Vo(...e) {
|
|
2787
2798
|
let t = "", n = 0;
|
|
2788
2799
|
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++));
|
|
2789
2800
|
return t;
|
|
2790
2801
|
}
|
|
2791
|
-
var
|
|
2792
|
-
function
|
|
2802
|
+
var Go = 256, Mo = 1e5;
|
|
2803
|
+
function Wo(e) {
|
|
2793
2804
|
const t = String(e).replace(/`/g, "``");
|
|
2794
2805
|
return "[" === t[0] ? "[" + t : t;
|
|
2795
2806
|
}
|
|
2796
|
-
function Wo(e) {
|
|
2797
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Mo(e)).join("`") : "";
|
|
2798
|
-
}
|
|
2799
2807
|
function xo(e) {
|
|
2808
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Wo(e)).join("`") : "";
|
|
2809
|
+
}
|
|
2810
|
+
function Ko(e) {
|
|
2800
2811
|
if ("string" != typeof e) return null;
|
|
2801
2812
|
let t = [], n = "";
|
|
2802
2813
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2817,9 +2828,9 @@ function xo(e) {
|
|
|
2817
2828
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2818
2829
|
});
|
|
2819
2830
|
}
|
|
2820
|
-
function
|
|
2831
|
+
function Yo(e) {
|
|
2821
2832
|
const t = {}, n = (e, r, l) => {
|
|
2822
|
-
if (l >
|
|
2833
|
+
if (l > Go) throw new Error("json2flat: deeper than 256");
|
|
2823
2834
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2824
2835
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2825
2836
|
const o = `[${t}]`;
|
|
@@ -2829,30 +2840,30 @@ function Ko(e) {
|
|
|
2829
2840
|
const t = Object.keys(e);
|
|
2830
2841
|
if (t.length > 0) {
|
|
2831
2842
|
for (const o of t) {
|
|
2832
|
-
const t =
|
|
2843
|
+
const t = Wo(o);
|
|
2833
2844
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2834
2845
|
}
|
|
2835
2846
|
return;
|
|
2836
2847
|
}
|
|
2837
2848
|
}
|
|
2838
|
-
0 !== l &&
|
|
2849
|
+
0 !== l && bl(t, r, e);
|
|
2839
2850
|
};
|
|
2840
2851
|
return null == e || n(e, "", 0), t;
|
|
2841
2852
|
}
|
|
2842
|
-
function
|
|
2853
|
+
function Bo(e) {
|
|
2843
2854
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2844
2855
|
let t = null;
|
|
2845
2856
|
for (const n of Object.keys(e)) {
|
|
2846
|
-
const r =
|
|
2857
|
+
const r = Ko(n);
|
|
2847
2858
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2848
|
-
if (r.length >
|
|
2859
|
+
if (r.length > Go) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2849
2860
|
const l = "number" == typeof r[0];
|
|
2850
2861
|
if (null === t) t = l ? [] : {};
|
|
2851
2862
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2852
2863
|
let o = t;
|
|
2853
2864
|
for (let t = 0; t < r.length; t++) {
|
|
2854
2865
|
const l = r[t], i = "number" == typeof l, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
2855
|
-
if (i && l >
|
|
2866
|
+
if (i && l > Mo) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2856
2867
|
if (i !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2857
2868
|
if (s) {
|
|
2858
2869
|
if (Array.isArray(o)) {
|
|
@@ -2860,7 +2871,7 @@ function Yo(e) {
|
|
|
2860
2871
|
o[l] = e[n];
|
|
2861
2872
|
} else {
|
|
2862
2873
|
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2863
|
-
|
|
2874
|
+
bl(o, l, e[n]);
|
|
2864
2875
|
}
|
|
2865
2876
|
break;
|
|
2866
2877
|
}
|
|
@@ -2868,7 +2879,7 @@ function Yo(e) {
|
|
|
2868
2879
|
if (Array.isArray(o)) {
|
|
2869
2880
|
for (; o.length <= l;) o.push(null);
|
|
2870
2881
|
u = o[l], null == u && (u = a ? [] : {}, o[l] = u);
|
|
2871
|
-
} else u =
|
|
2882
|
+
} else u = dl(o, l) ? void 0 : o[l], void 0 === u && (u = a ? [] : {}, bl(o, l, u));
|
|
2872
2883
|
if (null === u || "object" != typeof u) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2873
2884
|
if (a !== Array.isArray(u)) throw new Error(`flat2json: '${n}' needs a ${a ? "array" : "object"} where the tree already has a ${Array.isArray(u) ? "array" : "object"}`);
|
|
2874
2885
|
o = u;
|
|
@@ -2876,68 +2887,68 @@ function Yo(e) {
|
|
|
2876
2887
|
}
|
|
2877
2888
|
return null === t ? {} : t;
|
|
2878
2889
|
}
|
|
2879
|
-
function
|
|
2890
|
+
function Jo(e, t) {
|
|
2880
2891
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2881
2892
|
}
|
|
2882
|
-
function
|
|
2893
|
+
function qo(e, t) {
|
|
2883
2894
|
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, l = {
|
|
2884
2895
|
added: {},
|
|
2885
2896
|
removed: {},
|
|
2886
2897
|
changed: {}
|
|
2887
2898
|
};
|
|
2888
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2899
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Jo(n[e], r[e]) || bl(l.changed, e, {
|
|
2889
2900
|
from: n[e],
|
|
2890
2901
|
to: r[e]
|
|
2891
|
-
}) :
|
|
2892
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
2902
|
+
}) : bl(l.removed, e, n[e]);
|
|
2903
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || bl(l.added, e, r[e]);
|
|
2893
2904
|
return l;
|
|
2894
2905
|
}
|
|
2895
|
-
function
|
|
2906
|
+
function Ho(e, t) {
|
|
2896
2907
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2897
2908
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2898
2909
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2899
|
-
for (const n of Object.keys(t.added || {}))
|
|
2910
|
+
for (const n of Object.keys(t.added || {})) bl(e, n, t.added[n]);
|
|
2900
2911
|
for (const n of Object.keys(t.changed || {})) {
|
|
2901
2912
|
const r = t.changed[n];
|
|
2902
2913
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2903
|
-
|
|
2914
|
+
bl(e, n, r.to);
|
|
2904
2915
|
}
|
|
2905
2916
|
return e;
|
|
2906
2917
|
}
|
|
2907
|
-
function
|
|
2918
|
+
function zo(e) {
|
|
2908
2919
|
return "persistent-attrs-" + Rt(e);
|
|
2909
2920
|
}
|
|
2910
|
-
function zo(e, t) {
|
|
2911
|
-
let n = Xt(e, v.SDF_PERSIST), r = Cl(Ho(e), null, !1);
|
|
2912
|
-
if (r && Yr(r)) {
|
|
2913
|
-
let l = kl(e, r, t, !1);
|
|
2914
|
-
l = kl(e, l, n, !1), on(e, l, v.SDF_PERSIST);
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
2921
|
function Qo(e, t) {
|
|
2918
|
-
let n =
|
|
2919
|
-
|
|
2922
|
+
let n = Xt(e, v.SDF_PERSIST), r = Pl(zo(e), null, !1);
|
|
2923
|
+
if (r && Jr(r)) {
|
|
2924
|
+
let l = Cl(e, r, t, !1);
|
|
2925
|
+
l = Cl(e, l, n, !1), on(e, l, v.SDF_PERSIST);
|
|
2926
|
+
}
|
|
2920
2927
|
}
|
|
2921
2928
|
function Xo(e, t) {
|
|
2922
|
-
let n =
|
|
2923
|
-
|
|
2929
|
+
let n = Cl(e, Xt(e, v.SDF_PERSIST), t, !1), r = Pl(zo(e), null, !1);
|
|
2930
|
+
return r && Jr(r) && Cr(n, r), Ul(zo(e), n);
|
|
2924
2931
|
}
|
|
2925
2932
|
function Zo(e, t) {
|
|
2926
|
-
let n =
|
|
2927
|
-
|
|
2933
|
+
let n = Ll(e, Pl(zo(e), null, !1), t, !1);
|
|
2934
|
+
0 === xr(n) ? Fl(zo(e)) : Ul(zo(e), n);
|
|
2935
|
+
}
|
|
2936
|
+
function ei(e, t) {
|
|
2937
|
+
let n = Pl(zo(e), null, !1), r = {};
|
|
2938
|
+
return n && Jr(n) && (r = Cl(e, n, t, !1)), r;
|
|
2928
2939
|
}
|
|
2929
|
-
function
|
|
2930
|
-
if (
|
|
2940
|
+
function ti(e) {
|
|
2941
|
+
if (qr(e) && 1 === Yr(e)) {
|
|
2931
2942
|
let t = e[0];
|
|
2932
|
-
return
|
|
2943
|
+
return gl(t, "size") ? t.size : 1;
|
|
2933
2944
|
}
|
|
2934
|
-
return
|
|
2945
|
+
return Yr(e);
|
|
2935
2946
|
}
|
|
2936
|
-
function
|
|
2937
|
-
if (
|
|
2947
|
+
function ni(e, t) {
|
|
2948
|
+
if (Hr(t)) {
|
|
2938
2949
|
if (-1 === t.indexOf("^")) {
|
|
2939
2950
|
let n, r, l = e.fkey;
|
|
2940
|
-
if (1 !==
|
|
2951
|
+
if (1 !== xr(l)) return ar("bad fkey 1"), ar(e), ar(t), null;
|
|
2941
2952
|
for (const e of Object.keys(l)) {
|
|
2942
2953
|
n = e, r = l[e];
|
|
2943
2954
|
break;
|
|
@@ -2950,28 +2961,28 @@ function ti(e, t) {
|
|
|
2950
2961
|
}
|
|
2951
2962
|
{
|
|
2952
2963
|
let n = t.split("^");
|
|
2953
|
-
return 3 !== n.length ? (
|
|
2964
|
+
return 3 !== n.length ? (ar("bad fkey 2"), ar(e), ar(t), null) : {
|
|
2954
2965
|
topic_name: n[0],
|
|
2955
2966
|
id: n[1],
|
|
2956
2967
|
hook_name: n[2]
|
|
2957
2968
|
};
|
|
2958
2969
|
}
|
|
2959
2970
|
}
|
|
2960
|
-
return
|
|
2971
|
+
return Jr(t) ? {
|
|
2961
2972
|
topic_name: t.topic_name,
|
|
2962
2973
|
id: t.id,
|
|
2963
2974
|
hook_name: t.hook_name
|
|
2964
|
-
} : (
|
|
2975
|
+
} : (ar("bad fkey 3"), ar(e), ar(t), null);
|
|
2965
2976
|
}
|
|
2966
|
-
function
|
|
2967
|
-
let n =
|
|
2977
|
+
function ri(e, t) {
|
|
2978
|
+
let n = ni(e, t);
|
|
2968
2979
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2969
2980
|
}
|
|
2970
|
-
function
|
|
2971
|
-
if (
|
|
2981
|
+
function li(e, t) {
|
|
2982
|
+
if (Hr(t)) {
|
|
2972
2983
|
if (-1 === t.indexOf("^")) {
|
|
2973
2984
|
let n, r = e.hook;
|
|
2974
|
-
if (1 !==
|
|
2985
|
+
if (1 !== xr(r)) return ar("bad hook 1"), ar(e), ar(t), null;
|
|
2975
2986
|
for (let e of Object.keys(r)) {
|
|
2976
2987
|
n = e, r[e];
|
|
2977
2988
|
break;
|
|
@@ -2983,18 +2994,18 @@ function ri(e, t) {
|
|
|
2983
2994
|
}
|
|
2984
2995
|
{
|
|
2985
2996
|
let n = t.split("^");
|
|
2986
|
-
return 2 !== n.length ? (
|
|
2997
|
+
return 2 !== n.length ? (ar("bad hook 2"), ar(e), ar(t), null) : {
|
|
2987
2998
|
topic_name: n[0],
|
|
2988
2999
|
id: n[1]
|
|
2989
3000
|
};
|
|
2990
3001
|
}
|
|
2991
3002
|
}
|
|
2992
|
-
return
|
|
3003
|
+
return Jr(t) ? {
|
|
2993
3004
|
topic_name: t.topic_name,
|
|
2994
3005
|
id: t.id
|
|
2995
|
-
} : (
|
|
3006
|
+
} : (ar("bad hook 3"), ar(e), ar(t), null);
|
|
2996
3007
|
}
|
|
2997
|
-
var
|
|
3008
|
+
var oi = [
|
|
2998
3009
|
"string",
|
|
2999
3010
|
"integer",
|
|
3000
3011
|
"object",
|
|
@@ -3004,7 +3015,7 @@ var li = [
|
|
|
3004
3015
|
"real",
|
|
3005
3016
|
"boolean",
|
|
3006
3017
|
"blob"
|
|
3007
|
-
],
|
|
3018
|
+
], ii = [
|
|
3008
3019
|
"persistent",
|
|
3009
3020
|
"required",
|
|
3010
3021
|
"notnull",
|
|
@@ -3016,7 +3027,7 @@ var li = [
|
|
|
3016
3027
|
"stats",
|
|
3017
3028
|
"rstats",
|
|
3018
3029
|
"pstats"
|
|
3019
|
-
],
|
|
3030
|
+
], si = [
|
|
3020
3031
|
"hook",
|
|
3021
3032
|
"fkey",
|
|
3022
3033
|
"enum",
|
|
@@ -3045,7 +3056,7 @@ var li = [
|
|
|
3045
3056
|
"coordinates",
|
|
3046
3057
|
"gbuffer"
|
|
3047
3058
|
];
|
|
3048
|
-
function
|
|
3059
|
+
function ai(e) {
|
|
3049
3060
|
let t = {
|
|
3050
3061
|
name: e.id,
|
|
3051
3062
|
header: e.header,
|
|
@@ -3064,7 +3075,7 @@ function si(e) {
|
|
|
3064
3075
|
if (!e.flag) return t;
|
|
3065
3076
|
for (let n = 0; n < e.flag.length; n++) {
|
|
3066
3077
|
let r = e.flag[n];
|
|
3067
|
-
if (
|
|
3078
|
+
if (Jl(si, r)) {
|
|
3068
3079
|
switch (r) {
|
|
3069
3080
|
case "enum":
|
|
3070
3081
|
t.enum_list = e.enum;
|
|
@@ -3078,7 +3089,7 @@ function si(e) {
|
|
|
3078
3089
|
case "file": t.is_file = !0;
|
|
3079
3090
|
}
|
|
3080
3091
|
t.type = r;
|
|
3081
|
-
} else if (
|
|
3092
|
+
} else if (Jl(ii, r)) switch (r) {
|
|
3082
3093
|
case "writable":
|
|
3083
3094
|
t.is_writable = !0;
|
|
3084
3095
|
break;
|
|
@@ -3091,7 +3102,7 @@ function si(e) {
|
|
|
3091
3102
|
}
|
|
3092
3103
|
return t.is_file && (t.type = "file"), t;
|
|
3093
3104
|
}
|
|
3094
|
-
function
|
|
3105
|
+
function ui(e, t) {
|
|
3095
3106
|
let n = {
|
|
3096
3107
|
name: e,
|
|
3097
3108
|
header: e,
|
|
@@ -3105,13 +3116,13 @@ function ai(e, t) {
|
|
|
3105
3116
|
placeholder: void 0,
|
|
3106
3117
|
fkey: null
|
|
3107
3118
|
};
|
|
3108
|
-
if (
|
|
3119
|
+
if (Hr(t)) {
|
|
3109
3120
|
let e = t.split(".");
|
|
3110
3121
|
for (let t = 0; t < e.length; t++) {
|
|
3111
3122
|
let r = e[t];
|
|
3112
|
-
if (
|
|
3113
|
-
else if (
|
|
3114
|
-
else if (
|
|
3123
|
+
if (Jl(oi, r)) n.real_type || (n.real_type = r);
|
|
3124
|
+
else if (Jl(si, r)) n.type || (n.type = r);
|
|
3125
|
+
else if (Jl(ii, r)) switch (r) {
|
|
3115
3126
|
case "writable":
|
|
3116
3127
|
n.is_writable = !0;
|
|
3117
3128
|
break;
|
|
@@ -3123,35 +3134,35 @@ function ai(e, t) {
|
|
|
3123
3134
|
}
|
|
3124
3135
|
}
|
|
3125
3136
|
n.real_type || (n.real_type = "string");
|
|
3126
|
-
} else
|
|
3137
|
+
} else Jr(t) ? (n = ai(t), n.name || (n.name = e), n.header || (n.header = e)) : qr(t) && (n.real_type = "array", n.enum_list = t);
|
|
3127
3138
|
return n.type || (n.type = n.real_type), n;
|
|
3128
3139
|
}
|
|
3129
|
-
function
|
|
3140
|
+
function _i(e, t) {
|
|
3130
3141
|
let n = {};
|
|
3131
3142
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
3132
3143
|
let l;
|
|
3133
|
-
|
|
3134
|
-
let o =
|
|
3135
|
-
|
|
3144
|
+
Jr(r) && (l = r.default);
|
|
3145
|
+
let o = Nl(null, t, e, l);
|
|
3146
|
+
Ur(n, e, o);
|
|
3136
3147
|
}), n;
|
|
3137
3148
|
}
|
|
3138
|
-
var
|
|
3149
|
+
var ci = [
|
|
3139
3150
|
N(T.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
3140
3151
|
N(T.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
3141
3152
|
N(T.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
3142
3153
|
S()
|
|
3143
|
-
],
|
|
3154
|
+
], fi = {
|
|
3144
3155
|
periodic: !1,
|
|
3145
3156
|
msec: 0,
|
|
3146
3157
|
timer_id: -1
|
|
3147
|
-
},
|
|
3148
|
-
function
|
|
3158
|
+
}, gi = null;
|
|
3159
|
+
function di(e, t, n, r) {
|
|
3149
3160
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
3150
3161
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
3151
3162
|
Tn(e, "EV_TIMEOUT", {}, e);
|
|
3152
3163
|
}, l.msec) : l.timer_id = -1, It(e) ? Tn(At(e), o, {}, e) : Pn(e, o, {}), l.periodic || -1 !== l.timer_id || Et(e) && gt(e), 0;
|
|
3153
3164
|
}
|
|
3154
|
-
var
|
|
3165
|
+
var bi = {
|
|
3155
3166
|
mt_create: function(e) {
|
|
3156
3167
|
let t = e.priv;
|
|
3157
3168
|
const n = nn(e, "subscriber");
|
|
@@ -3176,31 +3187,31 @@ var di = {
|
|
|
3176
3187
|
},
|
|
3177
3188
|
mt_destroy: function(e) {}
|
|
3178
3189
|
};
|
|
3179
|
-
function
|
|
3190
|
+
function pi() {
|
|
3180
3191
|
return function(e) {
|
|
3181
|
-
if (
|
|
3192
|
+
if (gi) return ar(`GClass ALREADY created: ${e}`), -1;
|
|
3182
3193
|
const t = [["ST_IDLE", [[
|
|
3183
3194
|
"EV_TIMEOUT",
|
|
3184
|
-
|
|
3195
|
+
di,
|
|
3185
3196
|
null
|
|
3186
3197
|
]]]];
|
|
3187
|
-
return (
|
|
3198
|
+
return (gi = Ae(e, [
|
|
3188
3199
|
["EV_TIMEOUT", U.EVF_OUTPUT_EVENT],
|
|
3189
3200
|
["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT],
|
|
3190
3201
|
[0, 0]
|
|
3191
|
-
], t,
|
|
3202
|
+
], t, bi, 0, ci, fi, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
3192
3203
|
}("C_TIMER");
|
|
3193
3204
|
}
|
|
3194
|
-
function pi(e, t) {
|
|
3195
|
-
return e instanceof I ? "C_TIMER" !== $t(e) ? (ir("not C_TIMER GObj"), -1) : (sn(e, "periodic", !1), void an(e, "msec", t)) : (ir("not GObj TYPE"), -1);
|
|
3196
|
-
}
|
|
3197
3205
|
function mi(e, t) {
|
|
3198
|
-
return e instanceof I ? "C_TIMER" !== $t(e) ? (
|
|
3206
|
+
return e instanceof I ? "C_TIMER" !== $t(e) ? (ar("not C_TIMER GObj"), -1) : (sn(e, "periodic", !1), void an(e, "msec", t)) : (ar("not GObj TYPE"), -1);
|
|
3199
3207
|
}
|
|
3200
|
-
function hi(e) {
|
|
3201
|
-
return e instanceof I ? "C_TIMER" !== $t(e) ? (
|
|
3208
|
+
function hi(e, t) {
|
|
3209
|
+
return e instanceof I ? "C_TIMER" !== $t(e) ? (ar("not C_TIMER GObj"), -1) : (sn(e, "periodic", !0), void an(e, "msec", t)) : (ar("not GObj TYPE"), -1);
|
|
3202
3210
|
}
|
|
3203
|
-
|
|
3211
|
+
function Ei(e) {
|
|
3212
|
+
return e instanceof I ? "C_TIMER" !== $t(e) ? (ar("not C_TIMER GObj"), -1) : void an(e, "msec", -1) : (ar("not GObj TYPE"), -1);
|
|
3213
|
+
}
|
|
3214
|
+
var yi = [
|
|
3204
3215
|
N(T.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
3205
3216
|
N(T.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
3206
3217
|
N(T.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -3220,63 +3231,63 @@ var Ei = [
|
|
|
3220
3231
|
N(T.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
3221
3232
|
N(T.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
3222
3233
|
S()
|
|
3223
|
-
],
|
|
3224
|
-
function
|
|
3234
|
+
], Ti = { gobj_timer: null }, vi = null;
|
|
3235
|
+
function Oi(e, t, n, r) {
|
|
3225
3236
|
let l = Qt(e, t);
|
|
3226
|
-
return
|
|
3237
|
+
return Jr(l) || (l = {}), l[n] = r, rn(e, t, l), He(e, t);
|
|
3227
3238
|
}
|
|
3228
|
-
function
|
|
3239
|
+
function Si(e) {
|
|
3229
3240
|
if (!0 === e || !1 === e) return e;
|
|
3230
3241
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
3231
3242
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
3232
3243
|
}
|
|
3233
|
-
function
|
|
3244
|
+
function Ni() {
|
|
3234
3245
|
return `${Nt()}^${St()}`;
|
|
3235
3246
|
}
|
|
3236
|
-
function
|
|
3247
|
+
function wi(e, t, n, r) {
|
|
3237
3248
|
return Pn(e, t, n), 0;
|
|
3238
3249
|
}
|
|
3239
|
-
var
|
|
3250
|
+
var ji = {
|
|
3240
3251
|
mt_create: function(e) {
|
|
3241
3252
|
let t = e.priv;
|
|
3242
|
-
un(e, "start_date",
|
|
3253
|
+
un(e, "start_date", ko()), un(e, "node_uuid", Lo()), e.priv.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.periodic_timeout = Qt(e, "periodic_timeout"), function(e) {
|
|
3243
3254
|
let t = Qt(e, "trace_levels");
|
|
3244
|
-
if (!
|
|
3255
|
+
if (!Jr(t)) return 0;
|
|
3245
3256
|
let n = t.__global_trace__;
|
|
3246
|
-
if (
|
|
3257
|
+
if (qr(n)) {
|
|
3247
3258
|
ce(4294967295, !1);
|
|
3248
3259
|
for (let e of n) se(e, !0);
|
|
3249
3260
|
}
|
|
3250
3261
|
for (const [n, r] of Object.entries(t)) {
|
|
3251
3262
|
let t = Me(n);
|
|
3252
|
-
if (t) if (
|
|
3263
|
+
if (t) if (qr(r)) {
|
|
3253
3264
|
Ee(t, null, !1);
|
|
3254
3265
|
for (let e of r) Ee(t, e, !0);
|
|
3255
|
-
} else
|
|
3266
|
+
} else ar(`${jt(e)}: trace_levels of ${n} MUST be a list`);
|
|
3256
3267
|
}
|
|
3257
3268
|
}(e), function(e) {
|
|
3258
3269
|
let t = Qt(e, "no_trace_levels");
|
|
3259
|
-
if (!
|
|
3270
|
+
if (!Jr(t)) return 0;
|
|
3260
3271
|
let n = t.__global_no_trace__;
|
|
3261
|
-
if (
|
|
3272
|
+
if (qr(n)) {
|
|
3262
3273
|
fe(4294967295, !1);
|
|
3263
3274
|
for (let e of n) ae(e, !0);
|
|
3264
3275
|
}
|
|
3265
3276
|
for (const [n, r] of Object.entries(t)) {
|
|
3266
3277
|
let t = Me(n);
|
|
3267
|
-
if (t) if (
|
|
3278
|
+
if (t) if (qr(r)) {
|
|
3268
3279
|
Te(t, null, !1);
|
|
3269
3280
|
for (let e of r) Te(t, e, !0);
|
|
3270
|
-
} else
|
|
3281
|
+
} else ar(`${jt(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
3271
3282
|
}
|
|
3272
3283
|
}(e);
|
|
3273
3284
|
},
|
|
3274
3285
|
mt_writing: function(e, t) {},
|
|
3275
3286
|
mt_start: function(e) {
|
|
3276
|
-
return
|
|
3287
|
+
return hi(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
3277
3288
|
},
|
|
3278
3289
|
mt_stop: function(e) {
|
|
3279
|
-
return
|
|
3290
|
+
return Ei(e.priv.gobj_timer), bt(e), 0;
|
|
3280
3291
|
},
|
|
3281
3292
|
mt_destroy: function(e) {},
|
|
3282
3293
|
mt_play: function(e) {
|
|
@@ -3293,35 +3304,35 @@ var wi = {
|
|
|
3293
3304
|
case "get-global-no-trace": return o(0, 0, null, null, de());
|
|
3294
3305
|
case "set-global-trace":
|
|
3295
3306
|
case "set-global-no-trace": {
|
|
3296
|
-
let r = "set-global-no-trace" === t, l = n.level, i =
|
|
3297
|
-
return l ? null === i ? o(0, -1, `${
|
|
3307
|
+
let r = "set-global-no-trace" === t, l = n.level, i = Si(n.set);
|
|
3308
|
+
return l ? null === i ? o(0, -1, `${Ni()}: bitmask set or re-set?`, null, null) : (r ? ae(l, i) : se(l, i)) < 0 ? o(0, -1, `${Ni()}: global trace level not found: ${l}`, null, null) : r ? (Oi(e, "no_trace_levels", "__global_no_trace__", de()), o(0, 0, null, null, de())) : (Oi(e, "trace_levels", "__global_trace__", ge()), o(0, 0, null, null, ge())) : o(0, -1, `${Ni()}: what level?`, null, null);
|
|
3298
3309
|
}
|
|
3299
3310
|
case "get-gclass-trace":
|
|
3300
3311
|
case "get-gclass-no-trace":
|
|
3301
3312
|
case "set-gclass-trace":
|
|
3302
3313
|
case "set-gclass-no-trace": {
|
|
3303
3314
|
let r = t.indexOf("no-trace") >= 0, l = n.gclass_name || n.gclass || "", i = Me(l);
|
|
3304
|
-
if (!i) return o(0, -1, `${
|
|
3315
|
+
if (!i) return o(0, -1, `${Ni()}: what gclass is '${l}'?`, null, null);
|
|
3305
3316
|
if (0 === t.indexOf("get-")) return o(0, 0, null, null, r ? me(i) : be(i));
|
|
3306
|
-
let s = n.level, a =
|
|
3307
|
-
return s ? null === a ? o(0, -1, `${
|
|
3317
|
+
let s = n.level, a = Si(n.set);
|
|
3318
|
+
return s ? null === a ? o(0, -1, `${Ni()}: bitmask set or re-set?`, null, null) : (r ? Te(i, s, a) : Ee(i, s, a)) < 0 ? o(0, -1, `${Ni()}: trace level of ${l} not found: ${s}`, null, null) : r ? (Oi(e, "no_trace_levels", l, me(i)), o(0, 0, null, null, me(i))) : (Oi(e, "trace_levels", l, pe(i)), o(0, 0, null, null, be(i))) : o(0, -1, `${Ni()}: what level?`, null, null);
|
|
3308
3319
|
}
|
|
3309
|
-
default: return o(0, -1, `${
|
|
3320
|
+
default: return o(0, -1, `${Ni()}: command not available: ${t}`, null, null);
|
|
3310
3321
|
}
|
|
3311
3322
|
}
|
|
3312
3323
|
};
|
|
3313
|
-
function
|
|
3324
|
+
function $i() {
|
|
3314
3325
|
return function(e) {
|
|
3315
|
-
if (
|
|
3326
|
+
if (vi) return ar(`GClass ALREADY created: ${e}`), -1;
|
|
3316
3327
|
const t = [["ST_IDLE", [[
|
|
3317
3328
|
"EV_TIMEOUT_PERIODIC",
|
|
3318
|
-
|
|
3329
|
+
wi,
|
|
3319
3330
|
null
|
|
3320
3331
|
]]]];
|
|
3321
|
-
return (
|
|
3332
|
+
return (vi = Ae(e, [["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]], t, ji, 0, yi, Ti, 0, 0, 0, 0)) ? 0 : -1;
|
|
3322
3333
|
}("C_YUNO");
|
|
3323
3334
|
}
|
|
3324
|
-
var
|
|
3335
|
+
var Ri = "ievent_gate_stack", Di = [
|
|
3325
3336
|
N(T.DTP_STRING, "wanted_yuno_role", v.SDF_RD, "", "wanted yuno role"),
|
|
3326
3337
|
N(T.DTP_STRING, "wanted_yuno_name", v.SDF_RD, "", "wanted yuno name"),
|
|
3327
3338
|
N(T.DTP_STRING, "wanted_yuno_service", v.SDF_RD, "", "wanted yuno service"),
|
|
@@ -3338,15 +3349,15 @@ var $i = "ievent_gate_stack", Ri = [
|
|
|
3338
3349
|
N(T.DTP_INTEGER, "timeout_idack", v.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3339
3350
|
N(T.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3340
3351
|
S()
|
|
3341
|
-
],
|
|
3352
|
+
], Ai = [
|
|
3342
3353
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3343
3354
|
["ievents2", "Trace inter-events with full kw"],
|
|
3344
3355
|
["identity-card", "Trace identity_card messages"]
|
|
3345
3356
|
];
|
|
3346
|
-
function
|
|
3357
|
+
function ki(e) {
|
|
3347
3358
|
return !!(3 & Z(e));
|
|
3348
3359
|
}
|
|
3349
|
-
var
|
|
3360
|
+
var Ii = {
|
|
3350
3361
|
url: null,
|
|
3351
3362
|
remote_yuno_name: null,
|
|
3352
3363
|
remote_yuno_role: null,
|
|
@@ -3356,23 +3367,23 @@ var ki = {
|
|
|
3356
3367
|
websocket: null,
|
|
3357
3368
|
inside_on_open: !1,
|
|
3358
3369
|
retry_ms: 0
|
|
3359
|
-
},
|
|
3360
|
-
function
|
|
3361
|
-
e.priv.websocket &&
|
|
3370
|
+
}, Ci = null;
|
|
3371
|
+
function Li(e) {
|
|
3372
|
+
e.priv.websocket && ar("Websocket ALREADY setup");
|
|
3362
3373
|
const t = tn(e, "url");
|
|
3363
|
-
|
|
3374
|
+
cr(`====> Starting WebSocket to '${t}' (${Rt(e)})`);
|
|
3364
3375
|
const n = ++e.priv.ws_seq;
|
|
3365
3376
|
let r;
|
|
3366
3377
|
try {
|
|
3367
3378
|
r = new WebSocket(t);
|
|
3368
3379
|
} catch (r) {
|
|
3369
|
-
return
|
|
3380
|
+
return ar(`${Rt(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), hn(e, "EV_ON_CLOSE", {
|
|
3370
3381
|
url: t,
|
|
3371
3382
|
ws_seq: n,
|
|
3372
3383
|
code: 1006,
|
|
3373
3384
|
reason: r.message,
|
|
3374
3385
|
was_clean: !1
|
|
3375
|
-
}, e) < 0 &&
|
|
3386
|
+
}, e) < 0 && mi(e.priv.gobj_timer, Bi(e)), null;
|
|
3376
3387
|
}
|
|
3377
3388
|
return r ? (r.onopen = () => {
|
|
3378
3389
|
n !== e.priv.ws_seq || Ct(e) || Tn(e, "EV_ON_OPEN", {
|
|
@@ -3385,69 +3396,69 @@ function Ci(e) {
|
|
|
3385
3396
|
data: r.data
|
|
3386
3397
|
}, e);
|
|
3387
3398
|
}, r.onclose = (r) => {
|
|
3388
|
-
Ct(e) || n === e.priv.ws_seq && (Zt(Ot(), "browser_beforeunload") ?
|
|
3399
|
+
Ct(e) || n === e.priv.ws_seq && (Zt(Ot(), "browser_beforeunload") ? ur("Close websocket by unload page") : Tn(e, "EV_ON_CLOSE", {
|
|
3389
3400
|
url: t,
|
|
3390
3401
|
ws_seq: n,
|
|
3391
3402
|
code: r.code,
|
|
3392
3403
|
reason: r.reason,
|
|
3393
3404
|
was_clean: r.wasClean
|
|
3394
3405
|
}, e));
|
|
3395
|
-
}, r) : (
|
|
3406
|
+
}, r) : (ar(`${Rt(e)}: Failed to initialize WebSocket.`), null);
|
|
3396
3407
|
}
|
|
3397
|
-
function
|
|
3408
|
+
function Pi(e, t = 1e3, n = "") {
|
|
3398
3409
|
let r = e.priv, l = r.websocket;
|
|
3399
3410
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
3400
|
-
|
|
3411
|
+
cr(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
3401
3412
|
try {
|
|
3402
3413
|
l.close(t, n);
|
|
3403
3414
|
} catch (t) {
|
|
3404
|
-
|
|
3415
|
+
ar(`${Rt(e)}: Error closing WebSocket: ${t.message}`);
|
|
3405
3416
|
}
|
|
3406
|
-
} else
|
|
3417
|
+
} else ur("WebSocket is already closed or in the process of closing.");
|
|
3407
3418
|
}
|
|
3408
|
-
function
|
|
3409
|
-
let r =
|
|
3419
|
+
function Ui(e, t, n) {
|
|
3420
|
+
let r = ko();
|
|
3410
3421
|
try {
|
|
3411
|
-
|
|
3422
|
+
cr("\n" + r + " " + t + "\n"), $r(n);
|
|
3412
3423
|
} catch (e) {
|
|
3413
|
-
|
|
3424
|
+
cr("ERROR in trace_inter_event: " + e);
|
|
3414
3425
|
}
|
|
3415
3426
|
}
|
|
3416
|
-
var
|
|
3427
|
+
var Fi = class {
|
|
3417
3428
|
constructor(e, t) {
|
|
3418
3429
|
this.event = e, this.kw = t || {};
|
|
3419
3430
|
}
|
|
3420
3431
|
};
|
|
3421
|
-
function
|
|
3432
|
+
function Vi(e, t, n, r) {
|
|
3422
3433
|
return function(e, t) {
|
|
3423
3434
|
let n = e.priv, r = JSON.stringify(t);
|
|
3424
|
-
if (
|
|
3435
|
+
if (ki(e)) {
|
|
3425
3436
|
let n = tn(e, "url"), l = jt(Ot()) + " ==> " + n, o = Qt(Ot(), "trace_ievent_callback");
|
|
3426
|
-
o ? o(l, t, 1, r.length) :
|
|
3437
|
+
o ? o(l, t, 1, r.length) : Ui(0, l, t);
|
|
3427
3438
|
}
|
|
3428
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
3439
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return ur(`${Rt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3429
3440
|
try {
|
|
3430
3441
|
n.websocket.send(r);
|
|
3431
3442
|
} catch (t) {
|
|
3432
|
-
|
|
3443
|
+
ar(`${Rt(e)}: send_iev(): ${t}`);
|
|
3433
3444
|
}
|
|
3434
3445
|
return 0;
|
|
3435
3446
|
}(e, function(e, t) {
|
|
3436
|
-
return
|
|
3447
|
+
return rl(e) ? (ar("iev_create() event NULL"), null) : new Fi(e, t);
|
|
3437
3448
|
}(t, n));
|
|
3438
3449
|
}
|
|
3439
|
-
function
|
|
3440
|
-
return
|
|
3450
|
+
function Gi(e, t, n) {
|
|
3451
|
+
return rl(n) && (n = tn(e, "wanted_yuno_service")), {
|
|
3441
3452
|
dst_yuno: tn(e, "wanted_yuno_name"),
|
|
3442
3453
|
dst_role: tn(e, "wanted_yuno_role"),
|
|
3443
3454
|
dst_service: n,
|
|
3444
3455
|
src_yuno: St(),
|
|
3445
3456
|
src_role: Nt(),
|
|
3446
3457
|
src_service: t,
|
|
3447
|
-
host:
|
|
3458
|
+
host: Lo()
|
|
3448
3459
|
};
|
|
3449
3460
|
}
|
|
3450
|
-
function
|
|
3461
|
+
function Mi(e) {
|
|
3451
3462
|
let t = e.priv, n = vt(Ot()), r = tn(Ot(), "yuno_version"), l = tn(Ot(), "yuno_release"), o = tn(Ot(), "yuno_tag"), i = Qt(e, "required_services");
|
|
3452
3463
|
i && i.length || (i = Qt(Ot(), "required_services"));
|
|
3453
3464
|
let s = {
|
|
@@ -3465,34 +3476,34 @@ function Gi(e) {
|
|
|
3465
3476
|
username: tn(Ot(), "__username__"),
|
|
3466
3477
|
launch_id: 0,
|
|
3467
3478
|
yuno_startdate: tn(Ot(), "start_date"),
|
|
3468
|
-
id:
|
|
3479
|
+
id: Lo(),
|
|
3469
3480
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3470
3481
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3471
3482
|
required_services: i
|
|
3472
3483
|
};
|
|
3473
|
-
return
|
|
3484
|
+
return Xl(e, s, Ri, Gi(e, jt(At(e)), null)), eo(e, s, "__identity__"), mi(t.gobj_timer, en(e, "timeout_idack")), Vi(e, "EV_IDENTITY_CARD", s);
|
|
3474
3485
|
}
|
|
3475
|
-
function
|
|
3476
|
-
if (
|
|
3486
|
+
function Wi(e, t) {
|
|
3487
|
+
if (rl(t.event)) return -1;
|
|
3477
3488
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
3478
3489
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
3479
|
-
return
|
|
3480
|
-
}
|
|
3481
|
-
function Wi(e, t, n, r) {
|
|
3482
|
-
let l = e.priv;
|
|
3483
|
-
return Et(e) && (l.websocket = Ci(e)), 0;
|
|
3490
|
+
return Xl(e, n, Ri, Gi(e, jt(s), i)), eo(e, n, "__subscribing__"), Vi(e, t.event, n);
|
|
3484
3491
|
}
|
|
3485
3492
|
function xi(e, t, n, r) {
|
|
3486
|
-
|
|
3493
|
+
let l = e.priv;
|
|
3494
|
+
return Et(e) && (l.websocket = Li(e)), 0;
|
|
3487
3495
|
}
|
|
3488
3496
|
function Ki(e, t, n, r) {
|
|
3497
|
+
return cr("Websocket opened: " + e.priv.url), Mi(e), 0;
|
|
3498
|
+
}
|
|
3499
|
+
function Yi(e, t, n, r) {
|
|
3489
3500
|
let l = e.priv, o = n.url;
|
|
3490
|
-
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (rr(),
|
|
3501
|
+
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (rr(), ur(`${Rt(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), 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, Pn(e, "EV_ON_CLOSE", {
|
|
3491
3502
|
url: o,
|
|
3492
3503
|
remote_yuno_name: l.remote_yuno_name,
|
|
3493
3504
|
remote_yuno_role: l.remote_yuno_role,
|
|
3494
3505
|
remote_yuno_service: l.remote_yuno_service
|
|
3495
|
-
})) : Et(e) && (
|
|
3506
|
+
})) : Et(e) && (ur(`${Rt(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Pn(e, "EV_ON_OPEN_ERROR", {
|
|
3496
3507
|
url: o,
|
|
3497
3508
|
remote_yuno_name: l.remote_yuno_name,
|
|
3498
3509
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -3500,25 +3511,25 @@ function Ki(e, t, n, r) {
|
|
|
3500
3511
|
code: n.code,
|
|
3501
3512
|
reason: n.reason,
|
|
3502
3513
|
was_clean: n.was_clean
|
|
3503
|
-
})), Et(e) &&
|
|
3514
|
+
})), Et(e) && mi(l.gobj_timer, Bi(e))), 0;
|
|
3504
3515
|
}
|
|
3505
|
-
function
|
|
3516
|
+
function Bi(e) {
|
|
3506
3517
|
let t = e.priv, n = en(e, "timeout_retry"), r = en(e, "timeout_retry_max");
|
|
3507
3518
|
r < n && (r = n), t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
3508
3519
|
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
3509
3520
|
return Math.max(1, Math.round(o));
|
|
3510
3521
|
}
|
|
3511
|
-
function Bi(e, t, n, r) {
|
|
3512
|
-
return Gi(e), 0;
|
|
3513
|
-
}
|
|
3514
3522
|
function Ji(e, t, n, r) {
|
|
3523
|
+
return Mi(e), 0;
|
|
3524
|
+
}
|
|
3525
|
+
function qi(e, t, n, r) {
|
|
3515
3526
|
let l = e.priv;
|
|
3516
|
-
|
|
3517
|
-
let o =
|
|
3527
|
+
Ei(l.gobj_timer);
|
|
3528
|
+
let o = Zl(e, n, Ri, !0), i = vl(e, o, "src_yuno", ""), s = vl(e, o, "src_role", ""), a = vl(e, o, "src_service", "");
|
|
3518
3529
|
un(e, "remote_yuno_name", i), un(e, "remote_yuno_role", s), un(e, "remote_yuno_service", a);
|
|
3519
|
-
let u =
|
|
3530
|
+
let u = yl(e, n, "result", -1, 0), _ = vl(e, n, "comment", "", 0), c = vl(e, n, "username", "", 0), f = Nl(e, n, "services_roles", {});
|
|
3520
3531
|
if (u < 0) {
|
|
3521
|
-
|
|
3532
|
+
Pi(e);
|
|
3522
3533
|
let t = {
|
|
3523
3534
|
url: tn(e, "url"),
|
|
3524
3535
|
result: u,
|
|
@@ -3543,61 +3554,61 @@ function Ji(e, t, n, r) {
|
|
|
3543
3554
|
}
|
|
3544
3555
|
l.inside_on_open = !1, function(e) {
|
|
3545
3556
|
let t = In(e, null, null, null);
|
|
3546
|
-
for (let n = 0; n < t.length; n++)
|
|
3557
|
+
for (let n = 0; n < t.length; n++) Wi(e, t[n]);
|
|
3547
3558
|
}(e);
|
|
3548
3559
|
}
|
|
3549
3560
|
return 0;
|
|
3550
3561
|
}
|
|
3551
|
-
function
|
|
3562
|
+
function Hi(e, t, n, r) {
|
|
3552
3563
|
let l = e.priv.url, o = function(e, t) {
|
|
3553
3564
|
let n;
|
|
3554
3565
|
try {
|
|
3555
3566
|
n = JSON.parse(t);
|
|
3556
3567
|
} catch (t) {
|
|
3557
|
-
return
|
|
3568
|
+
return ur(`${Rt(e)}: parsing inter_event json: ${t}`), null;
|
|
3558
3569
|
}
|
|
3559
|
-
if (!(n instanceof Object)) return
|
|
3570
|
+
if (!(n instanceof Object)) return ur(`${Rt(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
3560
3571
|
let r = n.event;
|
|
3561
|
-
if (!r) return
|
|
3562
|
-
if ("string" != typeof r) return
|
|
3572
|
+
if (!r) return ur(`${Rt(e)}: parsing inter_event: no event`), null;
|
|
3573
|
+
if ("string" != typeof r) return ur(`${Rt(e)}: parsing inter_event: event not a string`), null;
|
|
3563
3574
|
let l = n.kw;
|
|
3564
3575
|
return l ? l instanceof Object ? {
|
|
3565
3576
|
event: r,
|
|
3566
3577
|
kw: l || {}
|
|
3567
|
-
} : (
|
|
3578
|
+
} : (ur(`${Rt(e)}: parsing inter_event: kw not a json object`), null) : (ur(`${Rt(e)}: parsing inter_kw: no kw`), null);
|
|
3568
3579
|
}(e, n.data);
|
|
3569
|
-
if (!o) return
|
|
3570
|
-
if (
|
|
3580
|
+
if (!o) return ur(`${Rt(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
3581
|
+
if (ki(e)) {
|
|
3571
3582
|
let e = jt(Ot()) + " <== " + l, t = n.data.length, r = Qt(Ot(), "trace_ievent_callback");
|
|
3572
|
-
r ? r(e, o, 2, t) :
|
|
3583
|
+
r ? r(e, o, 2, t) : Ui(0, e, o);
|
|
3573
3584
|
}
|
|
3574
3585
|
let i = o.event, s = o.kw;
|
|
3575
3586
|
if ("ST_SESSION" !== cn(e)) {
|
|
3576
3587
|
if (dn(e, i, U.EVF_PUBLIC_EVENT)) {
|
|
3577
3588
|
if (!(Tn(e, i, s, e) < 0)) return 0;
|
|
3578
|
-
} else
|
|
3579
|
-
return
|
|
3589
|
+
} else ar(`${Rt(e)}: event UNKNOWN in not-session state ${i}`);
|
|
3590
|
+
return Pi(e), -1;
|
|
3580
3591
|
}
|
|
3581
3592
|
o = null;
|
|
3582
|
-
let a =
|
|
3583
|
-
if (_.toLowerCase() !== Nt().toLowerCase()) return
|
|
3584
|
-
let c =
|
|
3585
|
-
if ("__subscribing__" === a) return
|
|
3586
|
-
if ("__unsubscribing__" === a) return
|
|
3593
|
+
let a = to(e, s), u = Zl(e, s, Ri), _ = vl(e, u, "dst_role", "");
|
|
3594
|
+
if (_.toLowerCase() !== Nt().toLowerCase()) return ar(`"It's not my role, dst_role: ${_}, my_role: ${Nt()}`), 0;
|
|
3595
|
+
let c = vl(e, u, "dst_service", "");
|
|
3596
|
+
if ("__subscribing__" === a) return ur(`${Rt(e)}: subscription event ignored, I'm client (service: ${c}, event: ${i})`), -1;
|
|
3597
|
+
if ("__unsubscribing__" === a) return ur(`${Rt(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${i})`), -1;
|
|
3587
3598
|
if (dn(e, i, U.EVF_PUBLIC_EVENT)) return Tn(e, i, s, e), 0;
|
|
3588
|
-
if (!
|
|
3599
|
+
if (!rl(c)) {
|
|
3589
3600
|
let t = Ke(c, !1);
|
|
3590
|
-
return t ? dn(t, i, U.EVF_PUBLIC_EVENT) ? (Tn(t, i, s, e), 0) : (
|
|
3601
|
+
return t ? dn(t, i, U.EVF_PUBLIC_EVENT) ? (Tn(t, i, s, e), 0) : (ar(`${Rt(e)}: Service found but no event or not public, service '${Rt(t)}', ev '${i}'`), -1) : (ur(`${Rt(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${i}'`), 0);
|
|
3591
3602
|
}
|
|
3592
3603
|
return It(e) ? Tn(At(e), i, s, e) : Pn(e, i, s), 0;
|
|
3593
3604
|
}
|
|
3594
|
-
function
|
|
3605
|
+
function zi(e, t, n, r) {
|
|
3595
3606
|
return 0;
|
|
3596
3607
|
}
|
|
3597
|
-
function
|
|
3608
|
+
function Qi(e, t, n, r) {
|
|
3598
3609
|
return 0;
|
|
3599
3610
|
}
|
|
3600
|
-
var
|
|
3611
|
+
var Xi = {
|
|
3601
3612
|
mt_create: function(e) {
|
|
3602
3613
|
let t = e.priv;
|
|
3603
3614
|
t.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = tn(e, "url"), t.remote_yuno_name = tn(e, "remote_yuno_name"), t.remote_yuno_role = tn(e, "remote_yuno_role"), t.remote_yuno_service = tn(e, "remote_yuno_service"), un(e, "wanted_yuno_name", t.remote_yuno_name), un(e, "wanted_yuno_role", t.remote_yuno_role), un(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -3627,72 +3638,72 @@ var Qi = {
|
|
|
3627
3638
|
code: 1e3,
|
|
3628
3639
|
reason: "restarted",
|
|
3629
3640
|
was_clean: !0
|
|
3630
|
-
}, e),
|
|
3641
|
+
}, e), Ei(t.gobj_timer)), t.websocket = Li(e), 0;
|
|
3631
3642
|
},
|
|
3632
3643
|
mt_stop: function(e) {
|
|
3633
3644
|
let t = e.priv;
|
|
3634
|
-
return
|
|
3645
|
+
return Ei(t.gobj_timer), t.websocket && Pi(e), 0;
|
|
3635
3646
|
},
|
|
3636
3647
|
mt_destroy: function(e) {},
|
|
3637
3648
|
mt_stats: function(e, t, n, r) {
|
|
3638
|
-
if ("ST_SESSION" !== cn(e)) return
|
|
3649
|
+
if ("ST_SESSION" !== cn(e)) return ar("Not in session"), null;
|
|
3639
3650
|
n || (n = {});
|
|
3640
|
-
let l =
|
|
3641
|
-
return o || (o = {}),
|
|
3651
|
+
let l = Gi(e, jt(r), vl(e, n, "service", null, 0)), o = Nl(e, n, "__md_stats__", null, Vn.KW_EXTRACT);
|
|
3652
|
+
return o || (o = {}), Xl(e, n, "stats_stack", {
|
|
3642
3653
|
stats: t,
|
|
3643
3654
|
kw: o
|
|
3644
|
-
}),
|
|
3655
|
+
}), Xl(e, n, Ri, l), n.__stats__ = t, eo(e, n, "__stats__"), Vi(e, "EV_MT_STATS", n, r), null;
|
|
3645
3656
|
},
|
|
3646
3657
|
mt_command_parser: function(e, t, n, r) {
|
|
3647
|
-
if ("ST_SESSION" !== cn(e)) return
|
|
3658
|
+
if ("ST_SESSION" !== cn(e)) return ar("Not in session"), null;
|
|
3648
3659
|
n || (n = {});
|
|
3649
|
-
let l =
|
|
3650
|
-
return o || (o = {}),
|
|
3660
|
+
let l = Gi(e, jt(r), vl(e, n, "service", "", 0)), o = Nl(e, n, "__md_command__", null, Vn.KW_EXTRACT);
|
|
3661
|
+
return o || (o = {}), Xl(e, n, "command_stack", {
|
|
3651
3662
|
command: t,
|
|
3652
3663
|
kw: o
|
|
3653
|
-
}),
|
|
3664
|
+
}), Xl(e, n, Ri, l), n.__command__ = t, eo(e, n, "__command__"), Vi(e, "EV_MT_COMMAND", n, r), null;
|
|
3654
3665
|
},
|
|
3655
3666
|
mt_inject_event: function(e, t, n, r) {
|
|
3656
3667
|
if ("ST_SESSION" !== cn(e)) return window.console.error("Not in session"), -1;
|
|
3657
|
-
if (n =
|
|
3668
|
+
if (n = kr({}, Jr(n) ? n : {}), Jr(n.__md_iev__) && (n.__md_iev__ = Rr(n.__md_iev__)), Zl(e, n, Ri));
|
|
3658
3669
|
else {
|
|
3659
|
-
let l =
|
|
3660
|
-
|
|
3670
|
+
let l = Gi(e, jt(r), vl(e, n, "__service__", 0, 0));
|
|
3671
|
+
Pr(n, "__service__"), Xl(e, n, "__message__", t), Xl(e, n, Ri, l);
|
|
3661
3672
|
}
|
|
3662
|
-
return
|
|
3673
|
+
return eo(e, n, "__message__"), Vi(e, t, n, r);
|
|
3663
3674
|
},
|
|
3664
3675
|
mt_subscription_added: function(e, t) {
|
|
3665
3676
|
let n = e.priv;
|
|
3666
|
-
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3677
|
+
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 : Wi(e, t) : 0;
|
|
3667
3678
|
},
|
|
3668
3679
|
mt_subscription_deleted: function(e, t) {
|
|
3669
3680
|
let n = e.priv;
|
|
3670
3681
|
if ("ST_SESSION" !== cn(e) || !n.websocket) return 0;
|
|
3671
3682
|
if (n.inside_on_open) return 0;
|
|
3672
|
-
if (
|
|
3683
|
+
if (rl(t.event)) return 0;
|
|
3673
3684
|
let r = {}, l = t.__global__, o = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3674
3685
|
o && (r.__config__ = o), l && (r.__global__ = l), i && (r.__filter__ = i);
|
|
3675
|
-
return
|
|
3686
|
+
return Xl(e, r, Ri, Gi(e, jt(a), s)), eo(e, r, "__unsubscribing__"), Vi(e, t.event, r, e);
|
|
3676
3687
|
}
|
|
3677
3688
|
};
|
|
3678
|
-
function
|
|
3689
|
+
function Zi() {
|
|
3679
3690
|
return function(e) {
|
|
3680
|
-
if (
|
|
3691
|
+
if (Ci) return ar(`GClass ALREADY created: ${e}`), -1;
|
|
3681
3692
|
const t = [
|
|
3682
3693
|
["ST_DISCONNECTED", [
|
|
3683
3694
|
[
|
|
3684
3695
|
"EV_ON_OPEN",
|
|
3685
|
-
|
|
3696
|
+
Ki,
|
|
3686
3697
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3687
3698
|
],
|
|
3688
3699
|
[
|
|
3689
3700
|
"EV_ON_CLOSE",
|
|
3690
|
-
|
|
3701
|
+
Yi,
|
|
3691
3702
|
null
|
|
3692
3703
|
],
|
|
3693
3704
|
[
|
|
3694
3705
|
"EV_TIMEOUT",
|
|
3695
|
-
|
|
3706
|
+
xi,
|
|
3696
3707
|
null
|
|
3697
3708
|
],
|
|
3698
3709
|
[
|
|
@@ -3704,22 +3715,22 @@ function Xi() {
|
|
|
3704
3715
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3705
3716
|
[
|
|
3706
3717
|
"EV_ON_MESSAGE",
|
|
3707
|
-
|
|
3718
|
+
Hi,
|
|
3708
3719
|
null
|
|
3709
3720
|
],
|
|
3710
3721
|
[
|
|
3711
3722
|
"EV_IDENTITY_CARD_ACK",
|
|
3712
|
-
|
|
3723
|
+
qi,
|
|
3713
3724
|
null
|
|
3714
3725
|
],
|
|
3715
3726
|
[
|
|
3716
3727
|
"EV_ON_CLOSE",
|
|
3717
|
-
|
|
3728
|
+
Yi,
|
|
3718
3729
|
"ST_DISCONNECTED"
|
|
3719
3730
|
],
|
|
3720
3731
|
[
|
|
3721
3732
|
"EV_TIMEOUT",
|
|
3722
|
-
|
|
3733
|
+
Ji,
|
|
3723
3734
|
null
|
|
3724
3735
|
],
|
|
3725
3736
|
[
|
|
@@ -3731,22 +3742,22 @@ function Xi() {
|
|
|
3731
3742
|
["ST_SESSION", [
|
|
3732
3743
|
[
|
|
3733
3744
|
"EV_ON_MESSAGE",
|
|
3734
|
-
|
|
3745
|
+
Hi,
|
|
3735
3746
|
null
|
|
3736
3747
|
],
|
|
3737
3748
|
[
|
|
3738
3749
|
"EV_MT_STATS",
|
|
3739
|
-
|
|
3750
|
+
zi,
|
|
3740
3751
|
null
|
|
3741
3752
|
],
|
|
3742
3753
|
[
|
|
3743
3754
|
"EV_MT_COMMAND",
|
|
3744
|
-
|
|
3755
|
+
Qi,
|
|
3745
3756
|
null
|
|
3746
3757
|
],
|
|
3747
3758
|
[
|
|
3748
3759
|
"EV_ON_CLOSE",
|
|
3749
|
-
|
|
3760
|
+
Yi,
|
|
3750
3761
|
"ST_DISCONNECTED"
|
|
3751
3762
|
],
|
|
3752
3763
|
[
|
|
@@ -3757,7 +3768,7 @@ function Xi() {
|
|
|
3757
3768
|
]],
|
|
3758
3769
|
[null, null]
|
|
3759
3770
|
];
|
|
3760
|
-
return (
|
|
3771
|
+
return (Ci = Ae(e, [
|
|
3761
3772
|
["EV_ON_MESSAGE", U.EVF_OUTPUT_EVENT],
|
|
3762
3773
|
["EV_IDENTITY_CARD_ACK", U.EVF_PUBLIC_EVENT],
|
|
3763
3774
|
["EV_ON_ID_NAK", U.EVF_PUBLIC_EVENT | U.EVF_OUTPUT_EVENT],
|
|
@@ -3768,9 +3779,9 @@ function Xi() {
|
|
|
3768
3779
|
["EV_ON_OPEN_ERROR", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3769
3780
|
["EV_TIMEOUT", 0],
|
|
3770
3781
|
[null, 0]
|
|
3771
|
-
], t,
|
|
3782
|
+
], t, Xi, 0, Di, Ii, 0, 0, Ai, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3772
3783
|
}("C_IEVENT_CLI");
|
|
3773
3784
|
}
|
|
3774
|
-
export { I as GObj, N as SDATA, R as SDATAAUTHZ, w as SDATACM, j as SDATACM2, A as SDATADF, $ as SDATAPM, D as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, h as __yuno__, o as build_command_response,
|
|
3785
|
+
export { I as GObj, N as SDATA, R as SDATAAUTHZ, w as SDATACM, j as SDATACM2, A as SDATADF, $ as SDATAPM, D as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, h as __yuno__, o as build_command_response, Vo as build_path, s as build_stats_response, Po as clean_name, Ei as clear_timeout, al as cmp_two_simple_json, l as command_parser, jo as createElement2, wo as createOneHtml, fo as create_json_record, _i as create_template_record, ko as current_timestamp, T as data_type_t, ei as db_list_persistent_attrs, Qo as db_load_persistent_attrs, Zo as db_remove_persistent_attrs, Xo as db_save_persistent_attrs, Fo as debounce, Hl as delete_from_list, Dr as duplicate_objects, Br as empty_json, rl as empty_string, po as escapeHtml, U as event_flag_t, Bo as flat2json, Ho as flat_apply, qo as flat_diff, xo as flat_key_join, Ko as flat_key_split, Pe as gclass_add_ev_action, Fe as gclass_add_event_type, Le as gclass_add_state, Ge as gclass_check_fsm, Ae as gclass_create, Ve as gclass_event_type, Me as gclass_find_by_name, C as gclass_flag_t, ke as gclass_unregister, $o as getPositionRelativeToBody, Uo as get_function_name, Io as get_now, Lt as gobj_bottom_gobj, fn as gobj_change_parent, _n as gobj_change_state, Un as gobj_command, it as gobj_create, et as gobj_create2, rt as gobj_create_default_service, ot as gobj_create_pure_child, nt as gobj_create_service, lt as gobj_create_volatil, tt as gobj_create_yuno, cn as gobj_current_state, xe as gobj_default_service, yn as gobj_deliver_posted_events, st as gobj_destroy, Bt as gobj_find_child, Kt as gobj_find_gobj, Ke as gobj_find_service, Ln as gobj_find_subscribings, In as gobj_find_subscriptions, L as gobj_flag_t, Dt as gobj_full_name, $t as gobj_gclass_name, be as gobj_get_gclass_trace_level, pe as gobj_get_gclass_trace_level2, me as gobj_get_gclass_trace_no_level, ge as gobj_get_global_trace_level, de as gobj_get_global_trace_no_level, ue as gobj_global_trace_level, _e as gobj_global_trace_no_level, zt as gobj_has_attr, dn as gobj_has_event, bn as gobj_has_output_event, $e as gobj_hsdata, Ct as gobj_is_destroying, vt as gobj_is_playing, It as gobj_is_pure_child, Et as gobj_is_running, Tt as gobj_is_service, kt as gobj_is_volatil, Qe as gobj_list_persistent_attrs, Cn as gobj_list_subscriptions, qe as gobj_load_persistent_attrs, Jt as gobj_match_children, qt as gobj_match_children_tree, Yt as gobj_match_gobj, jt as gobj_name, At as gobj_parent, ht as gobj_pause, mt as gobj_play, hn as gobj_post_event, En as gobj_posted_events_size, Pn as gobj_publish_event, Qt as gobj_read_attr, Xt as gobj_read_attrs, Zt as gobj_read_bool_attr, en as gobj_read_integer_attr, nn as gobj_read_pointer_attr, tn as gobj_read_str_attr, ze as gobj_remove_persistent_attrs, Oe as gobj_repr_global_trace_levels, ln as gobj_reset_volatil_attrs, He as gobj_save_persistent_attrs, Ht as gobj_search_path, Tn as gobj_send_event, We as gobj_services, Pt as gobj_set_bottom_gobj, he as gobj_set_deep_trace, Te as gobj_set_gclass_no_trace, Ee as gobj_set_gclass_trace, ae as gobj_set_global_no_trace, fe as gobj_set_global_no_trace2, se as gobj_set_global_trace, ce as gobj_set_global_trace2, ve as gobj_set_gobj_no_trace, ye as gobj_set_gobj_trace, x as gobj_set_trace_machine_format, Rt as gobj_short_name, at as gobj_start, _t as gobj_start_children, ft as gobj_start_tree, Se as gobj_start_up, Fn as gobj_stats, gt as gobj_stop, bt as gobj_stop_children, pt as gobj_stop_tree, Dn as gobj_subscribe_event, Z as gobj_trace_level, K as gobj_trace_machine_format, ee as gobj_trace_no_level, An as gobj_unsubscribe_event, kn as gobj_unsubscribe_list, Ft as gobj_walk_gobj_children, Vt as gobj_walk_gobj_children_tree, rn as gobj_write_attr, on as gobj_write_attrs, sn as gobj_write_bool_attr, an as gobj_write_integer_attr, un as gobj_write_str_attr, Ot as gobj_yuno, wt as gobj_yuno_id, St as gobj_yuno_name, Nt as gobj_yuno_role, Eo as html_markup, Bl as id_index_in_obj_list, Co as index_in_list, qr as is_array, Qr as is_boolean, el as is_date, tl as is_function, nl as is_gobj, yo as is_html_markup, _l as is_metadata_key, Xr as is_null, zr as is_number, Jr as is_object, cl as is_private_key, Zr as is_pure_number, mr as is_secret_name, Hr as is_string, so as jdb_delete, uo as jdb_get, _o as jdb_get_by_idx, ao as jdb_get_topic, oo as jdb_init, io as jdb_update, Yo as json2flat, Vr as json_array_append, Gr as json_array_append_new, Wr as json_array_extend, Mr as json_array_remove, Kr as json_array_size, Rr as json_deep_copy, Ar as json_is_identical, jr as json_mask_secrets, Pr as json_object_del, Lr as json_object_get, Ur as json_object_set, Fr as json_object_set_new, xr as json_object_size, kr as json_object_update, Ir as json_object_update_existing, Cr as json_object_update_missing, Yr as json_size, bo as jwt2json, go as jwtDecode, Cl as kw_clone_by_keys, Ll as kw_clone_by_not_keys, Il as kw_collect, hl as kw_delete, Al as kw_find_json_in_list, ml as kw_find_path, Vn as kw_flag_t, El as kw_get_bool, Sl as kw_get_dict, Nl as kw_get_dict_value, yl as kw_get_int, wl as kw_get_list, Pl as kw_get_local_storage_value, Ol as kw_get_pointer, Tl as kw_get_real, vl as kw_get_str, gl as kw_has_key, Dl as kw_match_simple, fl as kw_pop, Fl as kw_remove_local_storage_value, kl as kw_select, jl as kw_set_dict_value, Ul as kw_set_local_storage_value, $l as kw_set_subdict_value, Gl as kwid_collect, xl as kwid_find_one_record, Kl as kwid_get_ids, Vl as kwid_match_id, Ml as kwid_new_dict, Wl as kwid_new_list, Yl as list2options, no as load_json_file, cr as log_debug, ar as log_error, _r as log_info, ur as log_warning, vr as mask_secrets_inline, to as msg_iev_get_msg_type, Zl as msg_iev_get_stack, Xl as msg_iev_push_stack, zl as msg_iev_read_key, eo as msg_iev_set_msg_type, Ql as msg_iev_write_key, Lo as node_uuid, ll as parseBoolean, Ro as parseSVG, Do as refresh_language, Zi as register_c_ievent_cli, pi as register_c_timer, $i as register_c_yuno, mo as safeSrc, v as sdata_flag_t, ro as send_http_json_post, zn as set_console_log_enabled, Xn as set_console_log_filter, qn as set_log_callback, rr as set_remote_log_functions, So as set_strings_are_text, mi as set_timeout, hi as set_timeout_periodic, t as sprintf, i as stats_parser, Jl as str_in_list, sl as strcasecmp, il as strcmp, No as strings_are_text, ol as strncmp, ql as strs_in_list, ul as strstr, ui as template_get_field_desc, Ao as timeTracker, gr as trace_json, $r as trace_json_masked, B as trace_level_t, fr as trace_msg, ni as treedb_decoder_fkey, li as treedb_decoder_hook, ri as treedb_encoder_fkey, ai as treedb_get_field_desc, ti as treedb_hook_data_size, n as vsprintf, F as walk_type_t };
|
|
3775
3786
|
|
|
3776
3787
|
//# sourceMappingURL=gobj-js.es.min.js.map
|