@yuneta/gobj-js 7.16.1 → 7.16.2
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 +20 -1
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +65 -63
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +20 -2
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +501 -498
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +20 -1
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +2 -0
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +20 -1
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +2 -0
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -231,7 +231,7 @@ function x() {
|
|
|
231
231
|
return W;
|
|
232
232
|
}
|
|
233
233
|
function Y(e) {
|
|
234
|
-
|
|
234
|
+
dr(e) && (e = JSON.stringify(e)), Jn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
235
235
|
}
|
|
236
236
|
var B = Object.freeze({
|
|
237
237
|
TRACE_MACHINE: 65536,
|
|
@@ -327,7 +327,7 @@ var B = Object.freeze({
|
|
|
327
327
|
]
|
|
328
328
|
], q = 0, H = 0, Q = 0;
|
|
329
329
|
function z(e, t) {
|
|
330
|
-
if (
|
|
330
|
+
if (Sr(e)) return 268369920;
|
|
331
331
|
if (/^[0-9]+$/.test(String(e))) {
|
|
332
332
|
const t = Number(e);
|
|
333
333
|
if (t) return t;
|
|
@@ -388,7 +388,7 @@ function ae(e) {
|
|
|
388
388
|
return Q = Number(e) || 0, 0;
|
|
389
389
|
}
|
|
390
390
|
function ue(e, t, n) {
|
|
391
|
-
const r =
|
|
391
|
+
const r = pr(e) ? Ie(e) : e;
|
|
392
392
|
if (!r) return xn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
393
393
|
const l = z(t, "gobj_set_gclass_trace");
|
|
394
394
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
@@ -399,7 +399,7 @@ function _e(e, t, n) {
|
|
|
399
399
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
400
400
|
}
|
|
401
401
|
function ce(e, t, n) {
|
|
402
|
-
const r =
|
|
402
|
+
const r = pr(e) ? Ie(e) : e;
|
|
403
403
|
if (!r) return xn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
404
404
|
const l = z(t, "gobj_set_gclass_no_trace");
|
|
405
405
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
@@ -428,7 +428,7 @@ function de(e, t, n, r, l, o, i) {
|
|
|
428
428
|
}
|
|
429
429
|
function be(e, t) {
|
|
430
430
|
let n = {};
|
|
431
|
-
if (!
|
|
431
|
+
if (!br(t)) return xn("sdata_desc MUST be an array"), Hn(t), n;
|
|
432
432
|
for (let r = 0; r < t.length; r++) {
|
|
433
433
|
const l = t[r];
|
|
434
434
|
l.name && pe(e, n, l);
|
|
@@ -442,7 +442,7 @@ function pe(e, t, n) {
|
|
|
442
442
|
r = String(l);
|
|
443
443
|
break;
|
|
444
444
|
case y.DTP_BOOLEAN:
|
|
445
|
-
r =
|
|
445
|
+
r = Nr(l);
|
|
446
446
|
break;
|
|
447
447
|
case y.DTP_INTEGER:
|
|
448
448
|
r = parseInt(l), isNaN(r) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
@@ -451,25 +451,25 @@ function pe(e, t, n) {
|
|
|
451
451
|
r = Number(l), isNaN(r) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
452
452
|
break;
|
|
453
453
|
case y.DTP_LIST:
|
|
454
|
-
if (
|
|
454
|
+
if (pr(l)) try {
|
|
455
455
|
r = JSON.parse(l);
|
|
456
456
|
} catch (e) {
|
|
457
457
|
xn(`JSON parse error: ${e.message}`);
|
|
458
458
|
}
|
|
459
459
|
else r = l;
|
|
460
|
-
|
|
460
|
+
br(r) || (r = []);
|
|
461
461
|
break;
|
|
462
462
|
case y.DTP_DICT:
|
|
463
|
-
if (
|
|
463
|
+
if (pr(l)) try {
|
|
464
464
|
r = JSON.parse(l);
|
|
465
465
|
} catch (e) {
|
|
466
466
|
xn(`JSON parse error: ${e.message}`);
|
|
467
467
|
}
|
|
468
468
|
else r = l;
|
|
469
|
-
|
|
469
|
+
dr(r) || (r = {});
|
|
470
470
|
break;
|
|
471
471
|
case y.DTP_JSON:
|
|
472
|
-
if (
|
|
472
|
+
if (pr(l)) try {
|
|
473
473
|
r = JSON.parse(l);
|
|
474
474
|
} catch (e) {
|
|
475
475
|
xn(`JSON parse error: ${e.message}`);
|
|
@@ -485,14 +485,14 @@ function me(e, t, n, r) {
|
|
|
485
485
|
switch (n.type) {
|
|
486
486
|
case y.DTP_STRING:
|
|
487
487
|
if (null == r) l = "";
|
|
488
|
-
else if (
|
|
488
|
+
else if (pr(r)) l = String(r);
|
|
489
489
|
else {
|
|
490
490
|
let e = JSON.stringify(r);
|
|
491
491
|
e && (l = String(e));
|
|
492
492
|
}
|
|
493
493
|
break;
|
|
494
494
|
case y.DTP_BOOLEAN:
|
|
495
|
-
l =
|
|
495
|
+
l = Nr(r);
|
|
496
496
|
break;
|
|
497
497
|
case y.DTP_INTEGER:
|
|
498
498
|
l = parseInt(r), isNaN(l) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
@@ -501,35 +501,35 @@ function me(e, t, n, r) {
|
|
|
501
501
|
l = Number(r), isNaN(l) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
502
502
|
break;
|
|
503
503
|
case y.DTP_LIST:
|
|
504
|
-
if (
|
|
504
|
+
if (pr(r)) try {
|
|
505
505
|
l = JSON.parse(r);
|
|
506
506
|
} catch (e) {
|
|
507
507
|
xn(`JSON parse error: ${e.message}`);
|
|
508
508
|
}
|
|
509
509
|
else l = r;
|
|
510
|
-
if (!
|
|
510
|
+
if (!br(l)) return xn(`attr must be an array: ${n.name}`), -1;
|
|
511
511
|
break;
|
|
512
512
|
case y.DTP_DICT:
|
|
513
|
-
if (
|
|
513
|
+
if (pr(r)) try {
|
|
514
514
|
l = JSON.parse(r);
|
|
515
515
|
} catch (e) {
|
|
516
516
|
xn(`JSON parse error: ${e.message}`);
|
|
517
517
|
}
|
|
518
518
|
else l = r;
|
|
519
|
-
if (!
|
|
519
|
+
if (!dr(l)) return xn(`attr must be an object: ${n.name}`), -1;
|
|
520
520
|
break;
|
|
521
521
|
case y.DTP_JSON:
|
|
522
|
-
if (
|
|
522
|
+
if (pr(r)) try {
|
|
523
523
|
l = JSON.parse(r);
|
|
524
524
|
} catch (e) {
|
|
525
525
|
xn(`JSON parse error: ${e.message}`);
|
|
526
526
|
}
|
|
527
527
|
else l = r;
|
|
528
|
-
if (!
|
|
528
|
+
if (!br(l) && !dr(l)) return xn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
529
529
|
break;
|
|
530
530
|
case y.DTP_POINTER: l = r;
|
|
531
531
|
}
|
|
532
|
-
return void 0 === l && xn(`${Tt(e)}: attr undefined: ${n.name}`), t[n.name] = l,
|
|
532
|
+
return void 0 === l && xn(`${Tt(e)}: attr undefined: ${n.name}`), t[n.name] = l, dr(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
533
533
|
}
|
|
534
534
|
function Ee(e) {
|
|
535
535
|
return e.jn_attrs;
|
|
@@ -547,7 +547,7 @@ function he(e, t, n) {
|
|
|
547
547
|
return n && xn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
548
548
|
}
|
|
549
549
|
function ye(e, t, n, r, l, o, i, s, a, u, _) {
|
|
550
|
-
if (
|
|
550
|
+
if (Sr(e)) return xn("gclass_name EMPTY"), null;
|
|
551
551
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return xn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
552
552
|
if (Ie(e)) return xn(`GClass ALREADY exists: ${e}`), null;
|
|
553
553
|
let c = new $(e, r, l, o, i, s, a, u, _);
|
|
@@ -557,17 +557,17 @@ function ye(e, t, n, r, l, o, i, s, a, u, _) {
|
|
|
557
557
|
const f = n.length;
|
|
558
558
|
for (let e = 0; e < f; e++) {
|
|
559
559
|
let t = n[e][0], r = n[e][1];
|
|
560
|
-
if (
|
|
560
|
+
if (Sr(t)) continue;
|
|
561
561
|
if (Ne(c, t) < 0) return ve(c), null;
|
|
562
562
|
const l = r.length;
|
|
563
563
|
for (let e = 0; e < l; e++) {
|
|
564
564
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
565
|
-
|
|
565
|
+
Sr(n) || Re(c, t, n, l, o);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
for (let e = 0; e < t.length; e++) {
|
|
569
569
|
let n = t[e][0], r = t[e][1];
|
|
570
|
-
if (!
|
|
570
|
+
if (!Sr(n)) {
|
|
571
571
|
if (De(c, n)) return xn(`SMachine: event repeated in input_events: ${n}`), ve(c), null;
|
|
572
572
|
we(c, n, r);
|
|
573
573
|
}
|
|
@@ -580,7 +580,7 @@ function ye(e, t, n, r, l, o, i, s, a, u, _) {
|
|
|
580
580
|
}
|
|
581
581
|
function ve(e) {
|
|
582
582
|
let t;
|
|
583
|
-
if (
|
|
583
|
+
if (pr(e)) t = e;
|
|
584
584
|
else {
|
|
585
585
|
if (!(e instanceof $)) return xn("Cannot unregister gclass, type unknown"), -1;
|
|
586
586
|
t = e.gclass_name;
|
|
@@ -609,12 +609,12 @@ function Ne(e, t) {
|
|
|
609
609
|
}
|
|
610
610
|
function Re(e, t, n, r, l) {
|
|
611
611
|
if (!(e instanceof $)) return xn("Cannot add state, typeof not GClass"), -1;
|
|
612
|
-
if (
|
|
612
|
+
if (Sr(t)) return xn("state_name EMPTY"), -1;
|
|
613
613
|
let o = Oe(e, t);
|
|
614
614
|
return o ? Se(o, n) ? (xn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new G(n, r, l)), 0) : (xn(`state not found: ${t}`), -1);
|
|
615
615
|
}
|
|
616
616
|
function je(e, t, n) {
|
|
617
|
-
|
|
617
|
+
Sr(t) || e.push(new M(t, n));
|
|
618
618
|
}
|
|
619
619
|
function we(e, t, n) {
|
|
620
620
|
return e instanceof $ ? je(e.dl_events, t, n) : (xn("Cannot add state, typeof not GClass"), -1);
|
|
@@ -634,18 +634,18 @@ function Ae(e) {
|
|
|
634
634
|
cr(e.dl_states) || (xn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
635
635
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
636
636
|
let r = e.dl_states[n];
|
|
637
|
-
if (!
|
|
637
|
+
if (!Sr(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
638
638
|
let l = r.dl_actions[n];
|
|
639
|
-
|
|
639
|
+
Sr(l.event_name) || (De(e, l.event_name) || (xn(`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 && (Oe(e, l.next_state) || (xn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
643
643
|
let r = e.dl_events[n];
|
|
644
|
-
if (!
|
|
644
|
+
if (!Sr(r.event_name) && (mr(r.event_flag) || (xn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & U.EVF_OUTPUT_EVENT))) {
|
|
645
645
|
let n = !1;
|
|
646
646
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
647
647
|
let l = e.dl_states[t];
|
|
648
|
-
|
|
648
|
+
Sr(l.state_name) || Se(l, r.event_name) && (n = !0);
|
|
649
649
|
}
|
|
650
650
|
n || (xn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
651
651
|
}
|
|
@@ -679,7 +679,7 @@ function Pe(e, t) {
|
|
|
679
679
|
t.parent && xn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
680
680
|
}
|
|
681
681
|
function Ue(e, t) {
|
|
682
|
-
let n =
|
|
682
|
+
let n = Wl(e.dl_children, t);
|
|
683
683
|
n >= 0 && (ar(e.dl_children, n), t.parent = null);
|
|
684
684
|
}
|
|
685
685
|
function Fe(e, t) {
|
|
@@ -716,18 +716,18 @@ function xe(e, n, r, l, o) {
|
|
|
716
716
|
} else {
|
|
717
717
|
if (!l) return xn("gobj NEEDS a parent!"), null;
|
|
718
718
|
if (!("string" == typeof l || l instanceof k)) return xn(`BAD TYPE of parent: ${l}`), null;
|
|
719
|
-
if (
|
|
719
|
+
if (pr(l) && !(l = Ce(l))) return Yn(`parent service not found: ${l}`), null;
|
|
720
720
|
}
|
|
721
721
|
if (o & L.gobj_flag_service && Ce(e, !1)) return xn(`service ALREADY registered: ${n}^${e}`), null;
|
|
722
722
|
if (o & L.gobj_flag_default_service) {
|
|
723
723
|
if (T) return xn(`default service ALREADY registered: ${n}^${e}`), null;
|
|
724
724
|
o |= L.gobj_flag_service;
|
|
725
725
|
}
|
|
726
|
-
if (
|
|
726
|
+
if (Sr(n)) return xn("gclass_name must be a string"), null;
|
|
727
727
|
let i = Ie(n, !1);
|
|
728
728
|
if (!i) return xn(`GClass not registered: ${n}^${e}`), null;
|
|
729
|
-
if (!
|
|
730
|
-
if (!
|
|
729
|
+
if (!pr(e)) return xn(`gobj_name must be a string: ${n}`), null;
|
|
730
|
+
if (!Sr(e)) {
|
|
731
731
|
if (e.includes("`")) return xn(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
732
732
|
if (e.includes("^")) return xn(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
733
733
|
}
|
|
@@ -855,41 +855,41 @@ function pt() {
|
|
|
855
855
|
return e ? Yt(e, "yuno_id") : "";
|
|
856
856
|
}
|
|
857
857
|
function mt(e) {
|
|
858
|
-
return
|
|
858
|
+
return Or(e) ? e.gobj_name : (xn("gobj bad type"), null);
|
|
859
859
|
}
|
|
860
860
|
function Et(e) {
|
|
861
|
-
return
|
|
861
|
+
return Or(e) ? e.gclass.gclass_name : (xn("gobj NULL of bad type"), null);
|
|
862
862
|
}
|
|
863
863
|
function Tt(e) {
|
|
864
|
-
return
|
|
864
|
+
return Or(e) ? e.gclass.gclass_name + "^" + mt(e) : (xn("gobj bad type"), null);
|
|
865
865
|
}
|
|
866
866
|
function ht(e) {
|
|
867
|
-
if (!
|
|
867
|
+
if (!Or(e)) return xn("gobj NULL of bad type"), null;
|
|
868
868
|
let t = Tt(e), n = yt(e);
|
|
869
869
|
for (; n;) t = Tt(n) + "`" + t, n = yt(n);
|
|
870
870
|
return t;
|
|
871
871
|
}
|
|
872
872
|
function yt(e) {
|
|
873
|
-
return
|
|
873
|
+
return Or(e) ? e.parent : (xn("gobj NULL of bad type"), null);
|
|
874
874
|
}
|
|
875
875
|
function vt(e) {
|
|
876
|
-
return
|
|
876
|
+
return Or(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (xn("gobj NULL of bad type"), null);
|
|
877
877
|
}
|
|
878
878
|
function Ot(e) {
|
|
879
|
-
return
|
|
879
|
+
return Or(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (xn("gobj NULL of bad type"), null);
|
|
880
880
|
}
|
|
881
881
|
function St(e) {
|
|
882
|
-
return !
|
|
882
|
+
return !Or(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
883
883
|
}
|
|
884
884
|
function Nt(e) {
|
|
885
|
-
return
|
|
885
|
+
return Or(e) ? e.bottom_gobj : (xn("gobj NULL of bad type"), null);
|
|
886
886
|
}
|
|
887
887
|
function Rt(e, t) {
|
|
888
|
-
if (!
|
|
888
|
+
if (!Or(e)) return xn("gobj NULL of bad type"), null;
|
|
889
889
|
e.bottom_gobj && Yn(`${Tt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
890
890
|
}
|
|
891
891
|
function jt(e, t, n) {
|
|
892
|
-
return
|
|
892
|
+
return Or(e) ? t ? he(e.gclass, t, n) : e.gclass.attrs_table : (xn("gobj NULL of bad type"), null);
|
|
893
893
|
}
|
|
894
894
|
function wt(e, t, n, r, l) {
|
|
895
895
|
return St(e) ? (xn("gobj NULL, destroying, or bad type"), 0) : It(e.dl_children, t, n, r, l);
|
|
@@ -936,12 +936,12 @@ function kt(e, t, n, r, l) {
|
|
|
936
936
|
return 0;
|
|
937
937
|
}
|
|
938
938
|
function Ct(e, t) {
|
|
939
|
-
if (
|
|
939
|
+
if (Sr(t)) return null;
|
|
940
940
|
const n = t.toLowerCase();
|
|
941
941
|
return "__default_service__" === n ? T : "__yuno__" === n || "__root__" === n ? E : Gt(E, t);
|
|
942
942
|
}
|
|
943
943
|
function Lt(e, t) {
|
|
944
|
-
if (!
|
|
944
|
+
if (!Or(e)) return xn("gobj NULL of bad type"), !1;
|
|
945
945
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
946
946
|
t.__disabled__;
|
|
947
947
|
let o = t.__state__;
|
|
@@ -1007,7 +1007,7 @@ function Gt(e, t) {
|
|
|
1007
1007
|
return o ? (n.splice(0, 1), n = n.join("`"), Gt(o, n)) : null;
|
|
1008
1008
|
}
|
|
1009
1009
|
function Vt(e, t) {
|
|
1010
|
-
return !
|
|
1010
|
+
return !Sr(t) && !!he(e.gclass, t, !1);
|
|
1011
1011
|
}
|
|
1012
1012
|
function Mt(e, t, n) {
|
|
1013
1013
|
let r = e.jn_attrs;
|
|
@@ -1030,21 +1030,21 @@ function Wt(e, t, n) {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
function Kt(e, t) {
|
|
1032
1032
|
if (t) {
|
|
1033
|
-
if (0 ===
|
|
1034
|
-
if (0 ===
|
|
1035
|
-
if (0 ===
|
|
1036
|
-
if (0 ===
|
|
1033
|
+
if (0 === wr(t, "__disabled__")) return _t(e);
|
|
1034
|
+
if (0 === wr(t, "__running__")) return ut(e);
|
|
1035
|
+
if (0 === wr(t, "__playing__")) return ft(e);
|
|
1036
|
+
if (0 === wr(t, "__service__")) return ct(e);
|
|
1037
1037
|
}
|
|
1038
1038
|
let n = Te(e, t, !1);
|
|
1039
1039
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1040
1040
|
}
|
|
1041
1041
|
function xt(e, t) {
|
|
1042
|
-
t &&
|
|
1042
|
+
t && wr(t, "__trace_level__");
|
|
1043
1043
|
let n = Te(e, t, !1);
|
|
1044
1044
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1045
1045
|
}
|
|
1046
1046
|
function Yt(e, t) {
|
|
1047
|
-
if (t && 0 ===
|
|
1047
|
+
if (t && 0 === wr(t, "__state__")) return en(e);
|
|
1048
1048
|
let n = Te(e, t, !1);
|
|
1049
1049
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1050
1050
|
}
|
|
@@ -1053,11 +1053,11 @@ function Bt(e, t) {
|
|
|
1053
1053
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1054
1054
|
}
|
|
1055
1055
|
function Jt(e, n, r, l) {
|
|
1056
|
-
if (!
|
|
1056
|
+
if (!pr(n)) return xn(t("gobj_write_attr(%s): path must be a string", Tt(e))), -1;
|
|
1057
1057
|
let o, i = e.jn_attrs, s = n.split("`");
|
|
1058
1058
|
if (s.length <= 1) {
|
|
1059
1059
|
let l = n;
|
|
1060
|
-
return l in i && i.hasOwnProperty(l) ? (i[l] = r,
|
|
1060
|
+
return l in i && i.hasOwnProperty(l) ? (i[l] = r, dr(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (xn(t("gobj_write_attr(%s): attr not found '%s'", Tt(e), l)), -1);
|
|
1061
1061
|
}
|
|
1062
1062
|
let a = s.length;
|
|
1063
1063
|
for (let t = 0; t < a; t++) {
|
|
@@ -1068,7 +1068,7 @@ function Jt(e, n, r, l) {
|
|
|
1068
1068
|
continue;
|
|
1069
1069
|
}
|
|
1070
1070
|
let l = e.jn_attrs;
|
|
1071
|
-
if (o in l && l.hasOwnProperty(o)) return l[o] = r,
|
|
1071
|
+
if (o in l && l.hasOwnProperty(o)) return l[o] = r, dr(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.mt_writing && e.mt_writing(e, o), 0;
|
|
1072
1072
|
break;
|
|
1073
1073
|
}
|
|
1074
1074
|
return xn(t("gobj_write_attr(%s): attr not found '%s'", Tt(e), o)), -1;
|
|
@@ -1081,7 +1081,7 @@ function qt(e) {
|
|
|
1081
1081
|
const o = r[l];
|
|
1082
1082
|
if (o.name && !(n && o.flag & n) && (-1 === t || o.flag & t)) {
|
|
1083
1083
|
const t = pe(e, e.jn_attrs, o);
|
|
1084
|
-
|
|
1084
|
+
dr(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name);
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
1087
|
return 0;
|
|
@@ -1097,15 +1097,15 @@ function Ht(e, t, n, r) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
function Qt(e, t, n) {
|
|
1099
1099
|
let r = Te(e, t, !1);
|
|
1100
|
-
return r ? (r[t] =
|
|
1100
|
+
return r ? (r[t] = Nr(n), dr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1101
1101
|
}
|
|
1102
1102
|
function zt(e, t, n) {
|
|
1103
1103
|
let r = Te(e, t, !1);
|
|
1104
|
-
return r ? (r[t] = parseInt(n),
|
|
1104
|
+
return r ? (r[t] = parseInt(n), dr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1105
1105
|
}
|
|
1106
1106
|
function Xt(e, t, n) {
|
|
1107
1107
|
let r = Te(e, t, !1);
|
|
1108
|
-
return r ? (r[t] = String(n),
|
|
1108
|
+
return r ? (r[t] = String(n), dr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1109
1109
|
}
|
|
1110
1110
|
function Zt(e, n) {
|
|
1111
1111
|
if (St(e)) return xn("gobj NULL or DESTROYED"), null;
|
|
@@ -1119,13 +1119,13 @@ function Zt(e, n) {
|
|
|
1119
1119
|
return (l || o) && (1 === W || Y(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Et(e), mt(e), en(e), e.last_state.state_name))), !0;
|
|
1120
1120
|
}
|
|
1121
1121
|
function en(e) {
|
|
1122
|
-
return
|
|
1122
|
+
return Or(e) ? e.current_state.state_name : (xn("hgobj NULL"), "");
|
|
1123
1123
|
}
|
|
1124
1124
|
function tn(e, n) {
|
|
1125
1125
|
return St(e) ? (xn("gobj NULL or DESTROYED"), null) : n instanceof k ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (Ue(e.parent, e), e.parent = null), Pe(n, e), n.mt_child_added && (te(e) && Jn(t("👦👦🔵 child_added(%s): %s", ht(n), Tt(e))), n.mt_child_added(n, e)), 0) : (xn(`${Tt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
1126
1126
|
}
|
|
1127
1127
|
function nn(e, t, n) {
|
|
1128
|
-
if (!
|
|
1128
|
+
if (!Or(e)) return xn("gobj NULL of bad type"), null;
|
|
1129
1129
|
let r = De(e.gclass, t);
|
|
1130
1130
|
if (r) return r;
|
|
1131
1131
|
if (n) {
|
|
@@ -1147,7 +1147,7 @@ function ln(e, t, n) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
var on = [], sn = !1;
|
|
1149
1149
|
function an(e, n, r, l) {
|
|
1150
|
-
return e && e instanceof k ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (xn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) :
|
|
1150
|
+
return e && e instanceof k ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (xn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : Sr(n) ? (xn("gobj_post_event(): event EMPTY"), -1) : rn(e, n, 0) ? on.length >= 1e4 ? (xn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${on.length}`), -1) : (on.push({
|
|
1151
1151
|
dst: e,
|
|
1152
1152
|
event: n,
|
|
1153
1153
|
kw: r,
|
|
@@ -1178,7 +1178,7 @@ function cn(e, n, r, l) {
|
|
|
1178
1178
|
if (1 === W) Y(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Tt(e), o.state_name, l && !l.running ? "!!" : "", Tt(l)));
|
|
1179
1179
|
else {
|
|
1180
1180
|
let r = "";
|
|
1181
|
-
s.action && (r =
|
|
1181
|
+
s.action && (r = Yl(s.action)), Y(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Et(e), mt(e), o.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", Et(l), mt(l)));
|
|
1182
1182
|
}
|
|
1183
1183
|
r && (X(e) | ee()) & B.TRACE_EV_KW && _r(r) && Hn(r);
|
|
1184
1184
|
}
|
|
@@ -1187,7 +1187,7 @@ function cn(e, n, r, l) {
|
|
|
1187
1187
|
try {
|
|
1188
1188
|
s.action && (a = s.action(e, n, r, l));
|
|
1189
1189
|
} finally {}
|
|
1190
|
-
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Et(e), mt(e), e.current_state.state_name, n || "",
|
|
1190
|
+
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Et(e), mt(e), e.current_state.state_name, n || "", mr(a) ? a : 0)), h--, a;
|
|
1191
1191
|
}
|
|
1192
1192
|
var fn = Object.freeze({
|
|
1193
1193
|
__hard_subscription__: 1,
|
|
@@ -1206,21 +1206,21 @@ var fn = Object.freeze({
|
|
|
1206
1206
|
S()
|
|
1207
1207
|
];
|
|
1208
1208
|
function dn(e, t, n, r, l) {
|
|
1209
|
-
let o =
|
|
1210
|
-
if (t && t !==
|
|
1211
|
-
let t =
|
|
1209
|
+
let o = Wr(t, r, "__config__", null), i = Wr(t, r, "__global__", null), s = Wr(t, r, "__local__", null), a = Kr(t, r, "__filter__", null), u = !0;
|
|
1210
|
+
if (t && t !== Mr(null, e, "publisher", null) && (u = !1), l && l !== Mr(null, e, "subscriber", null) && (u = !1), n && n !== Vr(null, e, "event", "") && (u = !1), fr(o) > 0) {
|
|
1211
|
+
let t = Wr(null, e, "__config__", null);
|
|
1212
1212
|
fr(t) > 0 && Xn(t, o) || (u = !1);
|
|
1213
1213
|
}
|
|
1214
1214
|
if (fr(i) > 0) {
|
|
1215
|
-
let t =
|
|
1215
|
+
let t = Wr(null, e, "__global__", null);
|
|
1216
1216
|
fr(t) > 0 && Xn(t, i) || (u = !1);
|
|
1217
1217
|
}
|
|
1218
1218
|
if (fr(s) > 0) {
|
|
1219
|
-
let t =
|
|
1219
|
+
let t = Wr(null, e, "__local__", null);
|
|
1220
1220
|
fr(t) > 0 && Xn(t, s) || (u = !1);
|
|
1221
1221
|
}
|
|
1222
1222
|
if (fr(a) > 0) {
|
|
1223
|
-
let t =
|
|
1223
|
+
let t = Kr(null, e, "__filter__", null);
|
|
1224
1224
|
fr(t) > 0 && Xn(t, a) || (u = !1);
|
|
1225
1225
|
}
|
|
1226
1226
|
return u;
|
|
@@ -1238,8 +1238,8 @@ function pn(e, t, n, r, l) {
|
|
|
1238
1238
|
return -1;
|
|
1239
1239
|
}
|
|
1240
1240
|
function mn(e, n, r, l) {
|
|
1241
|
-
let o =
|
|
1242
|
-
if (!!(
|
|
1241
|
+
let o = Mr(e, n, "publisher", null, jn.KW_REQUIRED), i = Mr(e, n, "subscriber", null, jn.KW_REQUIRED), s = Vr(e, n, "event", "", jn.KW_REQUIRED);
|
|
1242
|
+
if (!!(Fr(e, n, "subs_flag", null, jn.KW_REQUIRED) & fn.__hard_subscription__) && !r) return -1;
|
|
1243
1243
|
E && Kt(E, "trace_subscriptions") && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Tt(o), Tt(i))), Hn(n)), o.obflag & P.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, n);
|
|
1244
1244
|
let a = pn(o.dl_subscriptions, o, s, n, i);
|
|
1245
1245
|
return a >= 0 ? ar(o.dl_subscriptions, a) : (xn(`${Tt(e)}: subscription in publisher not found`), Hn(n)), a = pn(i.dl_subscribings, o, s, n, i), a >= 0 ? ar(i.dl_subscribings, a) : (xn(`${Tt(e)}: subscription in subscriber not found`), Hn(n)), 0;
|
|
@@ -1256,7 +1256,7 @@ function En(e, n, r, l) {
|
|
|
1256
1256
|
]);
|
|
1257
1257
|
if (Object.keys(r).forEach((t) => {
|
|
1258
1258
|
o.has(t) || xn(`${Tt(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1259
|
-
}),
|
|
1259
|
+
}), Sr(n)) n = "";
|
|
1260
1260
|
else if (!(ln(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return xn(`event NOT in output event list: ${Tt(e)}, ${n}`), 0;
|
|
1261
1261
|
let i = bn(e.dl_subscriptions, e, n, r, l);
|
|
1262
1262
|
cr(i) > 0 && (xn(`${Tt(e)}: ${cr(i)} subscription(s) REPEATED, will be deleted and override`), Hn(i, "subscription REPEATED"), hn(e, i, !1));
|
|
@@ -1265,19 +1265,19 @@ function En(e, n, r, l) {
|
|
|
1265
1265
|
or(l, "event", t), or(l, "subscriber", r), or(l, "publisher", e);
|
|
1266
1266
|
let o = 0;
|
|
1267
1267
|
if (n) {
|
|
1268
|
-
let t =
|
|
1268
|
+
let t = Wr(e, n, "__config__", null), r = Wr(e, n, "__global__", null), i = Wr(e, n, "__local__", null), s = Kr(e, n, "__filter__", null), a = Vr(e, n, "__service__", "");
|
|
1269
1269
|
if (fr(r) > 0 && or(l, "__global__", Qn(r)), fr(t) > 0) {
|
|
1270
1270
|
let n = Qn(t);
|
|
1271
|
-
if (or(l, "__config__", n),
|
|
1272
|
-
let t =
|
|
1271
|
+
if (or(l, "__config__", n), Cr(n, "__hard_subscription__")) {
|
|
1272
|
+
let t = Ur(e, n, "__hard_subscription__", !1);
|
|
1273
1273
|
rr(n, "__hard_subscription__"), t && (o |= fn.__hard_subscription__);
|
|
1274
1274
|
}
|
|
1275
|
-
if (
|
|
1276
|
-
let t =
|
|
1275
|
+
if (Cr(n, "__own_event__")) {
|
|
1276
|
+
let t = Ur(e, n, "__own_event__", !1);
|
|
1277
1277
|
rr(n, "__own_event__"), t && (o |= fn.__own_event__);
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
-
fr(i) > 0 && or(l, "__local__", Qn(i)), fr(s) > 0 && or(l, "__filter__", Qn(s)),
|
|
1280
|
+
fr(i) > 0 && or(l, "__local__", Qn(i)), fr(s) > 0 && or(l, "__filter__", Qn(s)), Sr(a) || or(l, "__service__", a);
|
|
1281
1281
|
}
|
|
1282
1282
|
return or(l, "subs_flag", o), l;
|
|
1283
1283
|
}(e, n, r, l);
|
|
@@ -1300,7 +1300,7 @@ function Tn(e, t, n, r) {
|
|
|
1300
1300
|
]);
|
|
1301
1301
|
if (Object.keys(n).forEach((n) => {
|
|
1302
1302
|
l.has(n) || xn(`${Tt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1303
|
-
}),
|
|
1303
|
+
}), Sr(t)) t = "";
|
|
1304
1304
|
else if (!(ln(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return xn(`event NOT in output event list: ${Tt(e)}, ev ${t}`), 0;
|
|
1305
1305
|
let o = bn(e.dl_subscriptions, e, t, n, r), i = 0;
|
|
1306
1306
|
for (let t = 0; t < o.length; t++) {
|
|
@@ -1320,13 +1320,13 @@ function yn(e, t, n, r) {
|
|
|
1320
1320
|
function vn(e) {
|
|
1321
1321
|
let t = yn(e, null, null, null);
|
|
1322
1322
|
for (let n = 0; n < t.length; n++) {
|
|
1323
|
-
let r = t[n], l =
|
|
1324
|
-
or(r, "s_event",
|
|
1323
|
+
let r = t[n], l = Mr(e, r, "publisher", null, jn.KW_REQUIRED), o = Mr(e, r, "subscriber", null, jn.KW_REQUIRED);
|
|
1324
|
+
or(r, "s_event", Vr(e, r, "event", "", jn.KW_REQUIRED)), or(r, "s_publisher", Tt(l)), or(r, "s_subscriber", Tt(o));
|
|
1325
1325
|
}
|
|
1326
1326
|
let n = On(e, 0, null, 0);
|
|
1327
1327
|
for (let t = 0; t < n.length; t++) {
|
|
1328
|
-
let r = n[t], l =
|
|
1329
|
-
or(r, "s_event",
|
|
1328
|
+
let r = n[t], l = Mr(e, r, "publisher", null, jn.KW_REQUIRED), o = Mr(e, r, "subscriber", null, jn.KW_REQUIRED);
|
|
1329
|
+
or(r, "s_event", Vr(e, r, "event", "", jn.KW_REQUIRED)), or(r, "s_publisher", Tt(l)), or(r, "s_subscriber", Tt(o));
|
|
1330
1330
|
}
|
|
1331
1331
|
return {
|
|
1332
1332
|
subscriptions: t,
|
|
@@ -1339,8 +1339,8 @@ function On(e, t, n, r) {
|
|
|
1339
1339
|
return bn(e.dl_subscribings, r, t, n, e);
|
|
1340
1340
|
}
|
|
1341
1341
|
function Sn(e, n, r) {
|
|
1342
|
-
if (
|
|
1343
|
-
if (
|
|
1342
|
+
if (dr(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return xn("gobj NULL or DESTROYED"), -1;
|
|
1343
|
+
if (Sr(n)) return xn(`${Tt(e)}: event EMPTY`), -1;
|
|
1344
1344
|
let l = nn(e, n, !0);
|
|
1345
1345
|
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return xn(`event NOT in output event list: ${Tt(e)}, ev ${n}`), -1;
|
|
1346
1346
|
let o = E && Kt(E, "trace_subscriptions");
|
|
@@ -1356,17 +1356,17 @@ function Sn(e, n, r) {
|
|
|
1356
1356
|
if (t < 0) break;
|
|
1357
1357
|
if (!t) continue;
|
|
1358
1358
|
}
|
|
1359
|
-
let _ =
|
|
1359
|
+
let _ = Mr(e, u, "subscriber", null, jn.KW_REQUIRED);
|
|
1360
1360
|
if (!_ || St(_)) continue;
|
|
1361
|
-
let c =
|
|
1362
|
-
if (
|
|
1363
|
-
|
|
1364
|
-
let l =
|
|
1365
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) : fr(f) > 0 && (d =
|
|
1361
|
+
let c = Fr(e, u, "subs_flag", 0, jn.KW_REQUIRED), f = Vr(e, u, "event", "", jn.KW_REQUIRED);
|
|
1362
|
+
if (Sr(f) || 0 === wr(f, n)) {
|
|
1363
|
+
Wr(e, u, "__config__", null, 0);
|
|
1364
|
+
let l = Wr(e, u, "__global__", null, 0), i = Wr(e, u, "__local__", null, 0), f = Kr(e, u, "__filter__", null, 0), g = r, d = 1;
|
|
1365
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) : fr(f) > 0 && (d = qr(g, f) ? 1 : 0, o && (Y(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", Tt(_), Tt(e))), Hn(f))), d < 0) break;
|
|
1366
1366
|
if (!d) continue;
|
|
1367
1367
|
let b = nn(_, n, !0);
|
|
1368
1368
|
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !rn(_, b.event_name, 0)) continue;
|
|
1369
|
-
i &&
|
|
1369
|
+
i && kr(g, i), l && Zn(g, l), o && (Y(1 === W ? t("🔝🔄 %s (%s) %s%s", n || "", n || "", _.running ? "" : "!!", Tt(_)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", _.running ? "" : "!!", Tt(_), en(_), n || "", e && !e.running ? "!!" : "", Tt(e))), _r(g) && Hn(g));
|
|
1370
1370
|
let p = cn(_, n, g, e);
|
|
1371
1371
|
if (p < 0 && c & fn.__own_event__) {
|
|
1372
1372
|
s = -1;
|
|
@@ -1463,27 +1463,27 @@ function Kn(e) {
|
|
|
1463
1463
|
return n;
|
|
1464
1464
|
}
|
|
1465
1465
|
function xn(e) {
|
|
1466
|
-
let t = Kn(e), n =
|
|
1466
|
+
let t = Kn(e), n = Vl();
|
|
1467
1467
|
Dn && (Dn === wn.error ? Gn("error", t) && Dn("%c" + n + " ERROR: " + String(t), "color:red") : (Gn("error", t) && wn.error("%c" + n + " ERROR: " + String(t), "color:red"), Dn(`${n} ERROR: ${String(t)}`))), Mn("error", t, n);
|
|
1468
1468
|
}
|
|
1469
1469
|
function Yn(e) {
|
|
1470
|
-
let t = Kn(e), n =
|
|
1470
|
+
let t = Kn(e), n = Vl();
|
|
1471
1471
|
An && (An === wn.warn ? Gn("warning", t) && An("%c" + n + " WARNING: " + String(t), "color:yellow") : (Gn("warning", t) && wn.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), An(`${n} WARNING: ${String(t)}`))), Mn("warning", t, n);
|
|
1472
1472
|
}
|
|
1473
1473
|
function Bn(e) {
|
|
1474
|
-
let t = Kn(e), n =
|
|
1474
|
+
let t = Kn(e), n = Vl();
|
|
1475
1475
|
In && Gn("info", t) && In("%c" + n + " INFO: " + String(t), "color:cyan"), Mn("info", t, n);
|
|
1476
1476
|
}
|
|
1477
1477
|
function Jn(e) {
|
|
1478
|
-
let t = Kn(e), n =
|
|
1478
|
+
let t = Kn(e), n = Vl();
|
|
1479
1479
|
$n && Gn("debug", t) && $n("%c" + n + " DEBUG: " + String(t), "color:silver"), Mn("debug", t, n);
|
|
1480
1480
|
}
|
|
1481
1481
|
function qn(e) {
|
|
1482
|
-
let t = Kn(e), n =
|
|
1482
|
+
let t = Kn(e), n = Vl();
|
|
1483
1483
|
$n && Gn("msg", t) && $n("%c" + n + " MSG: " + String(t), "color:cyan"), Mn("msg", t, n);
|
|
1484
1484
|
}
|
|
1485
1485
|
function Hn(e, t) {
|
|
1486
|
-
Gn("json", t) && (t && window.console.warn("=====> " + t), window.console.dir(e)), Mn("json", e,
|
|
1486
|
+
Gn("json", t) && (t && window.console.warn("=====> " + t), window.console.dir(e)), Mn("json", e, Vl());
|
|
1487
1487
|
}
|
|
1488
1488
|
function Qn(e) {
|
|
1489
1489
|
return structuredClone(e);
|
|
@@ -1557,223 +1557,226 @@ function ur(e, t) {
|
|
|
1557
1557
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
1558
1558
|
}
|
|
1559
1559
|
function _r(e) {
|
|
1560
|
-
return
|
|
1560
|
+
return dr(e) ? Object.keys(e).length : 0;
|
|
1561
1561
|
}
|
|
1562
1562
|
function cr(e) {
|
|
1563
|
-
return
|
|
1563
|
+
return br(e) ? e.length : 0;
|
|
1564
1564
|
}
|
|
1565
1565
|
function fr(e) {
|
|
1566
|
-
return
|
|
1566
|
+
return dr(e) ? Object.keys(e).length : br(e) ? e.length : pr(e) && e.length > 0 ? 1 : 0;
|
|
1567
1567
|
}
|
|
1568
1568
|
function gr(e) {
|
|
1569
|
-
return
|
|
1569
|
+
return 0 === fr(e);
|
|
1570
1570
|
}
|
|
1571
1571
|
function dr(e) {
|
|
1572
|
-
return Array.isArray(e);
|
|
1572
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1573
1573
|
}
|
|
1574
1574
|
function br(e) {
|
|
1575
|
-
return
|
|
1575
|
+
return Array.isArray(e);
|
|
1576
1576
|
}
|
|
1577
1577
|
function pr(e) {
|
|
1578
|
-
return "
|
|
1578
|
+
return "string" == typeof e;
|
|
1579
1579
|
}
|
|
1580
1580
|
function mr(e) {
|
|
1581
|
-
return "
|
|
1581
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1582
1582
|
}
|
|
1583
1583
|
function Er(e) {
|
|
1584
|
-
return
|
|
1584
|
+
return "boolean" == typeof e;
|
|
1585
1585
|
}
|
|
1586
1586
|
function Tr(e) {
|
|
1587
|
-
|
|
1588
|
-
if (!br(e)) return !1;
|
|
1589
|
-
const t = Number(e);
|
|
1590
|
-
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1587
|
+
return null == e;
|
|
1591
1588
|
}
|
|
1592
1589
|
function hr(e) {
|
|
1593
|
-
|
|
1590
|
+
if (mr(e)) return !0;
|
|
1591
|
+
if (!pr(e)) return !1;
|
|
1592
|
+
const t = Number(e);
|
|
1593
|
+
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1594
1594
|
}
|
|
1595
1595
|
function yr(e) {
|
|
1596
|
-
return
|
|
1596
|
+
return e instanceof Date && !isNaN(e);
|
|
1597
1597
|
}
|
|
1598
1598
|
function vr(e) {
|
|
1599
|
-
return
|
|
1599
|
+
return "function" == typeof e;
|
|
1600
1600
|
}
|
|
1601
1601
|
function Or(e) {
|
|
1602
|
-
return
|
|
1602
|
+
return e instanceof k;
|
|
1603
1603
|
}
|
|
1604
1604
|
function Sr(e) {
|
|
1605
|
-
return pr(e)
|
|
1605
|
+
return !pr(e) || 0 === e.length;
|
|
1606
|
+
}
|
|
1607
|
+
function Nr(e) {
|
|
1608
|
+
return mr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1606
1609
|
}
|
|
1607
|
-
function
|
|
1610
|
+
function Rr(e, t, n) {
|
|
1608
1611
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
1609
1612
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
1610
1613
|
}
|
|
1611
|
-
function
|
|
1614
|
+
function jr(e, t) {
|
|
1612
1615
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1613
1616
|
}
|
|
1614
|
-
function
|
|
1617
|
+
function wr(e, t) {
|
|
1615
1618
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1616
1619
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1617
1620
|
}
|
|
1618
|
-
function
|
|
1619
|
-
if (
|
|
1620
|
-
if (
|
|
1621
|
+
function Dr(e, t) {
|
|
1622
|
+
if (dr(e) || dr(t) || br(e) || br(t)) return 0;
|
|
1623
|
+
if (mr(e) || mr(t)) {
|
|
1621
1624
|
let n = Number(e), r = Number(t);
|
|
1622
1625
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1623
1626
|
}
|
|
1624
|
-
if (
|
|
1627
|
+
if (Er(e) || Er(t)) {
|
|
1625
1628
|
let n = Number(e), r = Number(t);
|
|
1626
1629
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1627
1630
|
}
|
|
1628
|
-
return
|
|
1631
|
+
return jr(String(e), String(t));
|
|
1629
1632
|
}
|
|
1630
|
-
function
|
|
1633
|
+
function Ar(e, t, n) {
|
|
1631
1634
|
var r;
|
|
1632
1635
|
return -1 !== (r = (e += "").indexOf(t)) && (n ? e.substring(0, r) : e.slice(r));
|
|
1633
1636
|
}
|
|
1634
|
-
function
|
|
1635
|
-
if (!
|
|
1637
|
+
function Ir(e) {
|
|
1638
|
+
if (!pr(e)) return !1;
|
|
1636
1639
|
let t;
|
|
1637
1640
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1638
1641
|
return 2 === t;
|
|
1639
1642
|
}
|
|
1640
|
-
function
|
|
1641
|
-
if (!
|
|
1643
|
+
function $r(e) {
|
|
1644
|
+
if (!pr(e)) return !1;
|
|
1642
1645
|
let t;
|
|
1643
1646
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1644
1647
|
return 1 === t;
|
|
1645
1648
|
}
|
|
1646
|
-
function
|
|
1647
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1649
|
+
function kr(e, t) {
|
|
1650
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) kr(e, n);
|
|
1648
1651
|
else "string" == typeof t && delete e[t];
|
|
1649
1652
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1650
1653
|
}
|
|
1651
|
-
function
|
|
1654
|
+
function Cr(e, t) {
|
|
1652
1655
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1653
1656
|
}
|
|
1654
|
-
function
|
|
1655
|
-
if (e && !
|
|
1656
|
-
if (!
|
|
1657
|
+
function Lr(e, t, n, r) {
|
|
1658
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !dr(t) && !br(t)) return xn(`${Tt(e)}: kw must be list or dict`), 0;
|
|
1659
|
+
if (!pr(n)) return xn(`${Tt(e)}: path must be a string: ${String(n)}`), 0;
|
|
1657
1660
|
let l = n.split("`");
|
|
1658
1661
|
if (l.length <= 1) return t[n];
|
|
1659
1662
|
let o = l.length;
|
|
1660
1663
|
for (let i = 0; i < o; i++) if (void 0 === (t = t[l[i]])) return void (r && xn(`${Tt(e)}: path not found: ${String(n)}`));
|
|
1661
1664
|
return t;
|
|
1662
1665
|
}
|
|
1663
|
-
function
|
|
1664
|
-
e && !
|
|
1666
|
+
function Pr(e, t, n) {
|
|
1667
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1665
1668
|
let [r, l] = function(e, t) {
|
|
1666
1669
|
let n = e.lastIndexOf(t);
|
|
1667
1670
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1668
1671
|
}(n, "`");
|
|
1669
|
-
return
|
|
1672
|
+
return Sr(l) ? rr(t, n) : rr(Lr(e, t, r, !0), l), 0;
|
|
1670
1673
|
}
|
|
1671
|
-
function
|
|
1672
|
-
e && !
|
|
1673
|
-
let o =
|
|
1674
|
+
function Ur(e, t, n, r, l) {
|
|
1675
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1676
|
+
let o = Lr(e, t, n, !1);
|
|
1674
1677
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1675
1678
|
if (void 0 === o) {
|
|
1676
1679
|
if (s) {
|
|
1677
1680
|
let l = Boolean(r);
|
|
1678
|
-
return
|
|
1681
|
+
return Yr(e, t, n, l), l;
|
|
1679
1682
|
}
|
|
1680
1683
|
return i && (xn(`path not found: '${n}'`), Hn(t)), Boolean(r);
|
|
1681
1684
|
}
|
|
1682
|
-
return a &&
|
|
1685
|
+
return a && Pr(e, t, n), Boolean(o);
|
|
1683
1686
|
}
|
|
1684
|
-
function
|
|
1685
|
-
e && !
|
|
1686
|
-
let o =
|
|
1687
|
+
function Fr(e, t, n, r, l) {
|
|
1688
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1689
|
+
let o = Lr(e, t, n, !1);
|
|
1687
1690
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1688
1691
|
if (void 0 === o) {
|
|
1689
1692
|
if (s) {
|
|
1690
1693
|
let l = parseInt(r);
|
|
1691
|
-
return
|
|
1694
|
+
return Yr(e, t, n, l), l;
|
|
1692
1695
|
}
|
|
1693
1696
|
return i && (xn(`path not found: '${n}'`), Hn(t)), parseInt(r);
|
|
1694
1697
|
}
|
|
1695
|
-
return a &&
|
|
1698
|
+
return a && Pr(e, t, n), mr(o) ? parseInt(o) : (i && (xn(`path value MUST BE a number: ${n}`), qn(t)), parseInt(r));
|
|
1696
1699
|
}
|
|
1697
|
-
function
|
|
1698
|
-
e && !
|
|
1699
|
-
let o =
|
|
1700
|
+
function Gr(e, t, n, r, l) {
|
|
1701
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1702
|
+
let o = Lr(e, t, n, !1);
|
|
1700
1703
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1701
1704
|
if (void 0 === o) {
|
|
1702
1705
|
if (s) {
|
|
1703
1706
|
let l = Number(r);
|
|
1704
|
-
return
|
|
1707
|
+
return Yr(e, t, n, l), l;
|
|
1705
1708
|
}
|
|
1706
1709
|
return i && (xn(`path not found: '${n}'`), Hn(t)), Number(r);
|
|
1707
1710
|
}
|
|
1708
|
-
return a &&
|
|
1711
|
+
return a && Pr(e, t, n), mr(o) ? Number(o) : (i && (xn(`path value MUST BE a number: ${n}`), qn(t)), Number(r));
|
|
1709
1712
|
}
|
|
1710
|
-
function
|
|
1711
|
-
e && !
|
|
1712
|
-
let o =
|
|
1713
|
+
function Vr(e, t, n, r, l) {
|
|
1714
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1715
|
+
let o = Lr(e, t, n, !1);
|
|
1713
1716
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1714
1717
|
if (void 0 === o) {
|
|
1715
1718
|
if (s) {
|
|
1716
1719
|
let l = String(r);
|
|
1717
|
-
return
|
|
1720
|
+
return Yr(e, t, n, l), l;
|
|
1718
1721
|
}
|
|
1719
1722
|
return i && (xn(`path not found: '${n}'`), Hn(t)), String(r);
|
|
1720
1723
|
}
|
|
1721
|
-
return a &&
|
|
1724
|
+
return a && Pr(e, t, n), pr(o) ? String(o) : (i && (xn(`${Tt(e)}: path value MUST BE a string: ${n}`), qn(t)), String(r));
|
|
1722
1725
|
}
|
|
1723
|
-
function
|
|
1724
|
-
e && !
|
|
1725
|
-
let o =
|
|
1726
|
+
function Mr(e, t, n, r, l) {
|
|
1727
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1728
|
+
let o = Lr(e, t, n, !1);
|
|
1726
1729
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1727
1730
|
if (void 0 === o) {
|
|
1728
1731
|
if (s) {
|
|
1729
1732
|
let l = r;
|
|
1730
|
-
return
|
|
1733
|
+
return Yr(e, t, n, l), l;
|
|
1731
1734
|
}
|
|
1732
1735
|
return i && (xn(`path not found: '${n}'`), Hn(t)), r;
|
|
1733
1736
|
}
|
|
1734
|
-
return a &&
|
|
1737
|
+
return a && Pr(e, t, n), o;
|
|
1735
1738
|
}
|
|
1736
|
-
function
|
|
1737
|
-
e && !
|
|
1738
|
-
let o =
|
|
1739
|
+
function Wr(e, t, n, r, l) {
|
|
1740
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1741
|
+
let o = Lr(e, t, n, !1);
|
|
1739
1742
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1740
1743
|
if (void 0 === o) {
|
|
1741
1744
|
if (s) {
|
|
1742
1745
|
let l = Object(r);
|
|
1743
|
-
return
|
|
1746
|
+
return Yr(e, t, n, l), l;
|
|
1744
1747
|
}
|
|
1745
1748
|
return i && (xn(`path not found: '${n}'`), Hn(t)), Object(r);
|
|
1746
1749
|
}
|
|
1747
|
-
return a &&
|
|
1750
|
+
return a && Pr(e, t, n), dr(o) ? Object(o) : (i && (xn(`path value MUST BE a dict: ${n}`), qn(t)), Object(r));
|
|
1748
1751
|
}
|
|
1749
|
-
function
|
|
1750
|
-
e && !
|
|
1751
|
-
let o =
|
|
1752
|
+
function Kr(e, t, n, r, l) {
|
|
1753
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1754
|
+
let o = Lr(e, t, n, !1);
|
|
1752
1755
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1753
1756
|
if (void 0 === o) {
|
|
1754
1757
|
if (s) {
|
|
1755
1758
|
let l = r;
|
|
1756
|
-
return
|
|
1759
|
+
return Yr(e, t, n, l), l;
|
|
1757
1760
|
}
|
|
1758
1761
|
return i && (xn(`path not found: '${n}'`), Hn(t)), r;
|
|
1759
1762
|
}
|
|
1760
|
-
return a &&
|
|
1763
|
+
return a && Pr(e, t, n), o;
|
|
1761
1764
|
}
|
|
1762
|
-
function
|
|
1763
|
-
e && !
|
|
1764
|
-
let o =
|
|
1765
|
+
function xr(e, t, n, r, l) {
|
|
1766
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1767
|
+
let o = Lr(e, t, n, !1);
|
|
1765
1768
|
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1766
1769
|
if (void 0 === o) {
|
|
1767
1770
|
if (s) {
|
|
1768
1771
|
let l = Array(r);
|
|
1769
|
-
return
|
|
1772
|
+
return Yr(e, t, n, l), l;
|
|
1770
1773
|
}
|
|
1771
1774
|
return i && (xn(`path not found: '${n}'`), Hn(t)), Array(r);
|
|
1772
1775
|
}
|
|
1773
|
-
return a &&
|
|
1776
|
+
return a && Pr(e, t, n), br(o) ? Array(o) : (i && (xn(`path value MUST BE an array: ${n}`), qn(t)), Array(r));
|
|
1774
1777
|
}
|
|
1775
|
-
function
|
|
1776
|
-
if (e && !
|
|
1778
|
+
function Yr(e, t, n, r) {
|
|
1779
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !dr(t)) return xn("kw is not an object"), -1;
|
|
1777
1780
|
let l = n.split("`");
|
|
1778
1781
|
if (l.length <= 1) return t[n] = r, 0;
|
|
1779
1782
|
let o = l.length;
|
|
@@ -1783,34 +1786,34 @@ function xr(e, t, n, r) {
|
|
|
1783
1786
|
}
|
|
1784
1787
|
return 0;
|
|
1785
1788
|
}
|
|
1786
|
-
function
|
|
1787
|
-
if (e && !
|
|
1788
|
-
let o =
|
|
1789
|
-
return
|
|
1789
|
+
function Br(e, t, n, r, l) {
|
|
1790
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !dr(t)) return xn("kw is not an object"), -1;
|
|
1791
|
+
let o = Wr(e, t, n, {}, !0);
|
|
1792
|
+
return dr(o) ? (o[r] = l, 0) : (xn("subdict is not an object"), -1);
|
|
1790
1793
|
}
|
|
1791
|
-
function
|
|
1794
|
+
function Jr(e, n, r) {
|
|
1792
1795
|
let l = "", o = !1;
|
|
1793
|
-
if (
|
|
1796
|
+
if (br(n)) {
|
|
1794
1797
|
o = !1;
|
|
1795
1798
|
for (let i = 0; i < n.length; i++) {
|
|
1796
1799
|
let s = n[i];
|
|
1797
|
-
if (l =
|
|
1800
|
+
if (l = Sr(r) ? t("%s", r) : t("%s`%d", r, i), o = Jr(e, s, l), o) break;
|
|
1798
1801
|
}
|
|
1799
|
-
} else if (
|
|
1802
|
+
} else if (dr(n)) {
|
|
1800
1803
|
o = !0;
|
|
1801
1804
|
let i = Object.keys(n);
|
|
1802
1805
|
for (let s = 0; s < i.length; s++) {
|
|
1803
1806
|
let a = i[s], u = n[a];
|
|
1804
|
-
if (l =
|
|
1805
|
-
if (o =
|
|
1807
|
+
if (l = Sr(r) ? t("%s", a) : t("%s`%s", r, a), br(u) || dr(u)) {
|
|
1808
|
+
if (o = Jr(e, u, l), !o) break;
|
|
1806
1809
|
continue;
|
|
1807
1810
|
}
|
|
1808
|
-
let _ =
|
|
1811
|
+
let _ = Kr(0, e, l, 0, 0);
|
|
1809
1812
|
if (_ || (_ = nr(e, l)), !_) {
|
|
1810
1813
|
o = !1;
|
|
1811
1814
|
break;
|
|
1812
1815
|
}
|
|
1813
|
-
if (0 !==
|
|
1816
|
+
if (0 !== Dr(_, u)) {
|
|
1814
1817
|
o = !1;
|
|
1815
1818
|
break;
|
|
1816
1819
|
}
|
|
@@ -1818,51 +1821,51 @@ function Br(e, n, r) {
|
|
|
1818
1821
|
}
|
|
1819
1822
|
return o;
|
|
1820
1823
|
}
|
|
1821
|
-
function
|
|
1822
|
-
return 0 === fr(t) ||
|
|
1824
|
+
function qr(e, t) {
|
|
1825
|
+
return 0 === fr(t) || Jr(e, t, "");
|
|
1823
1826
|
}
|
|
1824
|
-
function
|
|
1825
|
-
if (!n || !
|
|
1827
|
+
function Hr(e, t, n, r) {
|
|
1828
|
+
if (!n || !br(t)) return r && xn("item NULL or kw_list is not a list"), -1;
|
|
1826
1829
|
for (let e = 0; e < t.length; e++) if (Xn(n, t[e])) return e;
|
|
1827
1830
|
return r && xn("item not found in this list"), -1;
|
|
1828
1831
|
}
|
|
1829
|
-
function
|
|
1830
|
-
if (e && !
|
|
1831
|
-
r || (r =
|
|
1832
|
+
function Qr(e, t, n, r) {
|
|
1833
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !t) return null;
|
|
1834
|
+
r || (r = qr);
|
|
1832
1835
|
let l = [];
|
|
1833
|
-
if (
|
|
1836
|
+
if (br(t)) for (let e = 0; e < t.length; e++) {
|
|
1834
1837
|
let o = t[e];
|
|
1835
1838
|
r(o, n) && l.push(Qn(o));
|
|
1836
1839
|
}
|
|
1837
1840
|
else {
|
|
1838
|
-
if (!
|
|
1841
|
+
if (!dr(t)) return xn("kw_select() BAD kw parameter"), null;
|
|
1839
1842
|
r(t, n) && l.push(Qn(t));
|
|
1840
1843
|
}
|
|
1841
1844
|
return l;
|
|
1842
1845
|
}
|
|
1843
|
-
function
|
|
1844
|
-
if (e && !
|
|
1845
|
-
r || (r =
|
|
1846
|
+
function zr(e, t, n, r) {
|
|
1847
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !t) return null;
|
|
1848
|
+
r || (r = qr);
|
|
1846
1849
|
let l = [];
|
|
1847
|
-
if (
|
|
1850
|
+
if (br(t)) for (let e = 0; e < t.length; e++) {
|
|
1848
1851
|
let o = t[e];
|
|
1849
1852
|
r(o, n) && l.push(o);
|
|
1850
1853
|
}
|
|
1851
1854
|
else {
|
|
1852
|
-
if (!
|
|
1855
|
+
if (!dr(t)) return xn("kw_select() BAD kw parameter"), null;
|
|
1853
1856
|
r(t, n) && l.push(t);
|
|
1854
1857
|
}
|
|
1855
1858
|
return l;
|
|
1856
1859
|
}
|
|
1857
|
-
function
|
|
1858
|
-
e && !
|
|
1860
|
+
function Xr(e, t, n, r) {
|
|
1861
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1859
1862
|
let l = {};
|
|
1860
|
-
if (
|
|
1863
|
+
if (pr(n) && !Sr(n)) {
|
|
1861
1864
|
let o = n;
|
|
1862
1865
|
t.hasOwnProperty(o) ? l[o] = t[o] : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1863
|
-
} else if (
|
|
1866
|
+
} else if (dr(n) && _r(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1864
1867
|
else {
|
|
1865
|
-
if (!(
|
|
1868
|
+
if (!(br(n) && cr(n) > 0)) return t;
|
|
1866
1869
|
for (let o = 0; o < n.length; o++) {
|
|
1867
1870
|
let i = n[o];
|
|
1868
1871
|
t.hasOwnProperty(i) ? l[i] = t[i] : r && xn(`${Tt(e)}: key not found: ${i}`);
|
|
@@ -1870,14 +1873,14 @@ function zr(e, t, n, r) {
|
|
|
1870
1873
|
}
|
|
1871
1874
|
return l;
|
|
1872
1875
|
}
|
|
1873
|
-
function
|
|
1876
|
+
function Zr(e, t, n, r) {
|
|
1874
1877
|
let l = {};
|
|
1875
|
-
if (Zn(l, t),
|
|
1878
|
+
if (Zn(l, t), pr(n) && !Sr(n)) {
|
|
1876
1879
|
let o = n;
|
|
1877
|
-
|
|
1878
|
-
} else if (
|
|
1880
|
+
Kr(e, t, o, 0, 0) ? rr(l, o) : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1881
|
+
} else if (dr(n) && _r(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? rr(l, o) : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1879
1882
|
else {
|
|
1880
|
-
if (!(
|
|
1883
|
+
if (!(br(n) && cr(n) > 0)) return {};
|
|
1881
1884
|
for (let o = 0; o < n.length; o++) {
|
|
1882
1885
|
let i = n[o];
|
|
1883
1886
|
t.hasOwnProperty(i) ? rr(l, i) : r && xn(`${Tt(e)}: key not found: ${i}`);
|
|
@@ -1885,15 +1888,15 @@ function Xr(e, t, n, r) {
|
|
|
1885
1888
|
}
|
|
1886
1889
|
return l;
|
|
1887
1890
|
}
|
|
1888
|
-
function
|
|
1891
|
+
function el(e, t, n = !1) {
|
|
1889
1892
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1890
1893
|
let r = window.localStorage.getItem(e);
|
|
1891
|
-
return null === r ? (n &&
|
|
1894
|
+
return null === r ? (n && tl(e, t), t) : JSON.parse(r);
|
|
1892
1895
|
} catch (n) {
|
|
1893
1896
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1894
1897
|
}
|
|
1895
1898
|
}
|
|
1896
|
-
function
|
|
1899
|
+
function tl(e, t) {
|
|
1897
1900
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1898
1901
|
if (!e || void 0 === t) return xn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1899
1902
|
try {
|
|
@@ -1902,7 +1905,7 @@ function el(e, t) {
|
|
|
1902
1905
|
return xn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1903
1906
|
}
|
|
1904
1907
|
}
|
|
1905
|
-
function
|
|
1908
|
+
function nl(e) {
|
|
1906
1909
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1907
1910
|
window.localStorage.removeItem(e);
|
|
1908
1911
|
} catch (t) {
|
|
@@ -1910,82 +1913,82 @@ function tl(e) {
|
|
|
1910
1913
|
}
|
|
1911
1914
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1912
1915
|
}
|
|
1913
|
-
function
|
|
1914
|
-
if (
|
|
1915
|
-
if (
|
|
1916
|
+
function rl(e, t) {
|
|
1917
|
+
if (Tr(e) || Tr(t)) return !0;
|
|
1918
|
+
if (br(e)) {
|
|
1916
1919
|
if (0 === e.length) return !0;
|
|
1917
1920
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1918
|
-
} else if (
|
|
1921
|
+
} else if (dr(e)) {
|
|
1919
1922
|
if (0 === Object.keys(e).length) return !0;
|
|
1920
1923
|
for (let n in e) if (n === t) return !0;
|
|
1921
|
-
} else if (
|
|
1924
|
+
} else if (pr(e) && e === t) return !0;
|
|
1922
1925
|
return !1;
|
|
1923
1926
|
}
|
|
1924
|
-
function
|
|
1925
|
-
if (e && !
|
|
1926
|
-
l || (l =
|
|
1927
|
+
function ll(e, t, n, r, l) {
|
|
1928
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !t) return null;
|
|
1929
|
+
l || (l = qr);
|
|
1927
1930
|
let o = [];
|
|
1928
|
-
if (
|
|
1931
|
+
if (br(t)) for (let i = 0; i < t.length; i++) {
|
|
1929
1932
|
let s, a = t[i];
|
|
1930
|
-
if (
|
|
1933
|
+
if (dr(a)) s = Vr(e, a, "id", "", 0);
|
|
1931
1934
|
else {
|
|
1932
|
-
if (!
|
|
1935
|
+
if (!pr(a)) continue;
|
|
1933
1936
|
s = a;
|
|
1934
1937
|
}
|
|
1935
|
-
|
|
1938
|
+
rl(n, s) && l(a, r) && o.push(a);
|
|
1936
1939
|
}
|
|
1937
1940
|
else {
|
|
1938
|
-
if (!
|
|
1941
|
+
if (!dr(t)) return xn("kw_collect() BAD kw parameter"), null;
|
|
1939
1942
|
for (let e of Object.keys(t)) {
|
|
1940
1943
|
let i = t[e];
|
|
1941
|
-
|
|
1944
|
+
rl(n, e) && l(i, r) && o.push(i);
|
|
1942
1945
|
}
|
|
1943
1946
|
}
|
|
1944
1947
|
return o;
|
|
1945
1948
|
}
|
|
1946
|
-
function
|
|
1947
|
-
e && !
|
|
1949
|
+
function ol(e, t, n) {
|
|
1950
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1948
1951
|
let r = {};
|
|
1949
|
-
if (
|
|
1950
|
-
else if (
|
|
1951
|
-
let l = t[n], o =
|
|
1952
|
-
|
|
1952
|
+
if (Sr(n) || (t = Lr(e, t, n)), dr(t)) r = t;
|
|
1953
|
+
else if (br(t)) for (let n = 0; n < t.length; n++) {
|
|
1954
|
+
let l = t[n], o = Vr(e, l, "id", "", 0);
|
|
1955
|
+
Sr(o) || (r[o] = l);
|
|
1953
1956
|
}
|
|
1954
1957
|
else xn(`${Tt(e)} kwid_new_dict: data type unknown`);
|
|
1955
1958
|
return r;
|
|
1956
1959
|
}
|
|
1957
|
-
function
|
|
1958
|
-
e && !
|
|
1959
|
-
let o =
|
|
1960
|
+
function il(e, t, n, r, l) {
|
|
1961
|
+
e && !Or(e) && xn("GObj bad instanceof");
|
|
1962
|
+
let o = ll(e, t, n, r, l);
|
|
1960
1963
|
return o.length > 0 ? o[0] : null;
|
|
1961
1964
|
}
|
|
1962
|
-
function
|
|
1963
|
-
if (e && !
|
|
1965
|
+
function sl(e, t) {
|
|
1966
|
+
if (e && !Or(e) && xn("GObj bad instanceof"), !t) return [];
|
|
1964
1967
|
let n = [];
|
|
1965
|
-
if (
|
|
1966
|
-
else if (
|
|
1967
|
-
else
|
|
1968
|
-
if (
|
|
1969
|
-
else if (
|
|
1970
|
-
let r =
|
|
1968
|
+
if (pr(t)) n.push(t);
|
|
1969
|
+
else if (dr(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
1970
|
+
else br(t) && t.forEach(function(t) {
|
|
1971
|
+
if (pr(t)) Sr(t) || n.push(t);
|
|
1972
|
+
else if (dr(t)) {
|
|
1973
|
+
let r = Vr(e, t, "id", 0, 0);
|
|
1971
1974
|
r && n.push(r);
|
|
1972
1975
|
}
|
|
1973
1976
|
});
|
|
1974
1977
|
return n;
|
|
1975
1978
|
}
|
|
1976
|
-
function
|
|
1979
|
+
function al(e, t, n) {
|
|
1977
1980
|
t = t || "id", n = n || "value";
|
|
1978
1981
|
let r = [];
|
|
1979
|
-
if (
|
|
1982
|
+
if (br(e)) for (let l = 0; l < e.length; l++) {
|
|
1980
1983
|
let o = e[l];
|
|
1981
|
-
if (
|
|
1984
|
+
if (pr(o)) r.push({
|
|
1982
1985
|
id: e[l],
|
|
1983
1986
|
value: e[l]
|
|
1984
1987
|
});
|
|
1985
|
-
else if (
|
|
1988
|
+
else if (dr(o)) {
|
|
1986
1989
|
let e = {};
|
|
1987
|
-
if (
|
|
1988
|
-
if (!
|
|
1990
|
+
if (Cr(o, t)) {
|
|
1991
|
+
if (!Cr(o, n)) {
|
|
1989
1992
|
if (!(fr(o) > 0)) {
|
|
1990
1993
|
xn("list2options(): object without field value: " + n);
|
|
1991
1994
|
continue;
|
|
@@ -2003,19 +2006,19 @@ function sl(e, t, n) {
|
|
|
2003
2006
|
r.push(e);
|
|
2004
2007
|
} else xn("list2options(): case1 not implemented");
|
|
2005
2008
|
}
|
|
2006
|
-
else if (
|
|
2009
|
+
else if (dr(e)) for (let t of Object.keys(e)) r.push({
|
|
2007
2010
|
id: t,
|
|
2008
2011
|
value: t
|
|
2009
2012
|
});
|
|
2010
2013
|
else xn("list2options(): case2 not implemented");
|
|
2011
2014
|
return r;
|
|
2012
2015
|
}
|
|
2013
|
-
function
|
|
2016
|
+
function ul(e, t) {
|
|
2014
2017
|
if (!e) return -1;
|
|
2015
2018
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2016
2019
|
return -1;
|
|
2017
2020
|
}
|
|
2018
|
-
function
|
|
2021
|
+
function _l(e, t, n) {
|
|
2019
2022
|
if (!e || !t) return xn("ERROR: str_in_list() list or str empty"), !1;
|
|
2020
2023
|
let r = e.length;
|
|
2021
2024
|
if (n) {
|
|
@@ -2027,17 +2030,17 @@ function ul(e, t, n) {
|
|
|
2027
2030
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2028
2031
|
return !1;
|
|
2029
2032
|
}
|
|
2030
|
-
function
|
|
2033
|
+
function cl(e, t, n) {
|
|
2031
2034
|
if (!e) return xn("ERROR: strs_in_list() list empty"), !1;
|
|
2032
2035
|
if (!t) return xn("ERROR: strs_in_list() str empty"), !1;
|
|
2033
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2036
|
+
for (let r = 0; r < t.length; r++) if (_l(e, t[r], n)) return !0;
|
|
2034
2037
|
return !1;
|
|
2035
2038
|
}
|
|
2036
|
-
function
|
|
2039
|
+
function fl(e, t) {
|
|
2037
2040
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2038
2041
|
return !1;
|
|
2039
2042
|
}
|
|
2040
|
-
function
|
|
2043
|
+
function gl(e, t) {
|
|
2041
2044
|
try {
|
|
2042
2045
|
let n = e.__md_iev__;
|
|
2043
2046
|
if (n) return n[t];
|
|
@@ -2045,34 +2048,34 @@ function fl(e, t) {
|
|
|
2045
2048
|
return;
|
|
2046
2049
|
}
|
|
2047
2050
|
}
|
|
2048
|
-
function
|
|
2051
|
+
function dl(e, t, n) {
|
|
2049
2052
|
let r = e.__md_iev__;
|
|
2050
2053
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2051
2054
|
}
|
|
2052
|
-
function
|
|
2053
|
-
if (!
|
|
2055
|
+
function bl(e, t, n, r) {
|
|
2056
|
+
if (!Or(e)) return xn("gobj is not a GObj"), null;
|
|
2054
2057
|
if (!t) return;
|
|
2055
|
-
let l =
|
|
2056
|
-
l || (l = [],
|
|
2058
|
+
let l = gl(t, n);
|
|
2059
|
+
l || (l = [], dl(t, n, l));
|
|
2057
2060
|
try {
|
|
2058
|
-
|
|
2061
|
+
br(l) && l.unshift(r);
|
|
2059
2062
|
} catch (e) {
|
|
2060
2063
|
xn(e);
|
|
2061
2064
|
}
|
|
2062
2065
|
}
|
|
2063
|
-
function
|
|
2064
|
-
if (!
|
|
2065
|
-
if (!
|
|
2066
|
-
let l =
|
|
2066
|
+
function pl(e, t, n, r) {
|
|
2067
|
+
if (!Or(e)) return xn("gobj is not a GObj"), null;
|
|
2068
|
+
if (!dr(t)) return xn("kw is not a dict"), null;
|
|
2069
|
+
let l = gl(t, n);
|
|
2067
2070
|
return l ? 0 === l.length ? (r && xn(`stack empty: ${n}`), null) : l[0] : (r && xn(`stack NOT FOUND: ${n}`), null);
|
|
2068
2071
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return
|
|
2072
|
+
function ml(e, t, n) {
|
|
2073
|
+
return Sr(n) ? Pr(e, t, "__md_iev__`__msg_type__") : Br(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2071
2074
|
}
|
|
2072
|
-
function
|
|
2073
|
-
return
|
|
2075
|
+
function El(e, t) {
|
|
2076
|
+
return Vr(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2074
2077
|
}
|
|
2075
|
-
function
|
|
2078
|
+
function Tl(e, t, n) {
|
|
2076
2079
|
let r = new XMLHttpRequest();
|
|
2077
2080
|
r.open("GET", e, !0), r.setRequestHeader("Accept", "application/json"), r.onreadystatechange = function() {
|
|
2078
2081
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
@@ -2084,14 +2087,14 @@ function El(e, t, n) {
|
|
|
2084
2087
|
var e;
|
|
2085
2088
|
}, r.send();
|
|
2086
2089
|
}
|
|
2087
|
-
function
|
|
2090
|
+
function hl(e, t, n) {
|
|
2088
2091
|
let r = new XMLHttpRequest();
|
|
2089
2092
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2090
2093
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2091
2094
|
}, r.send(t);
|
|
2092
2095
|
}
|
|
2093
|
-
function
|
|
2094
|
-
void 0 !== n &&
|
|
2096
|
+
function yl(e, t, n) {
|
|
2097
|
+
void 0 !== n && pr(n) || (n = "");
|
|
2095
2098
|
for (let r of Object.keys(e)) {
|
|
2096
2099
|
if (!e.hasOwnProperty(r)) continue;
|
|
2097
2100
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2100,61 +2103,61 @@ function hl(e, t, n) {
|
|
|
2100
2103
|
r,
|
|
2101
2104
|
e[r],
|
|
2102
2105
|
n
|
|
2103
|
-
]),
|
|
2106
|
+
]), dr(e[r]) && yl(e[r], t, n), n = n.slice(0, -l.length);
|
|
2104
2107
|
}
|
|
2105
2108
|
}
|
|
2106
|
-
function
|
|
2109
|
+
function vl(e, t, n) {
|
|
2107
2110
|
n && (e = Qn(e));
|
|
2108
|
-
let r =
|
|
2109
|
-
|
|
2110
|
-
let l =
|
|
2111
|
-
return
|
|
2112
|
-
"__" !== t.substring(0, 2) &&
|
|
2111
|
+
let r = Kr(null, e, "type", [], 1);
|
|
2112
|
+
Vr(null, e, "hook", "data", 1);
|
|
2113
|
+
let l = Kr(null, e, "schema", {}, 1), o = Kr(null, e, "topics", {}, 1);
|
|
2114
|
+
return yl(l, function(e, t, n, l) {
|
|
2115
|
+
"__" !== t.substring(0, 2) && Kr(null, o, l, Qn(r), 1);
|
|
2113
2116
|
}, t), e;
|
|
2114
2117
|
}
|
|
2115
|
-
function
|
|
2116
|
-
let l =
|
|
2118
|
+
function Ol(e, t, n, r) {
|
|
2119
|
+
let l = Kr(null, Kr(null, e, "topics", null, 0), t, null, 0);
|
|
2117
2120
|
if (!l) return xn("jdb_update: topic not found: " + t), null;
|
|
2118
|
-
if (
|
|
2121
|
+
if (Sr(r.id)) return xn("jdb_update: record without id: " + r), qn(r), null;
|
|
2119
2122
|
let o, i = n.split("`"), s = l;
|
|
2120
|
-
for (; (o = i.shift()) && !
|
|
2121
|
-
if (0 === i.length && s) if (
|
|
2123
|
+
for (; (o = i.shift()) && !Sr(o) && s;) dr(s) && (s = Kr(null, s, e.hook, [], 1)), s = wl(s, null, o, !1);
|
|
2124
|
+
if (0 === i.length && s) if (br(s)) s.push(r);
|
|
2122
2125
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2123
2126
|
else {
|
|
2124
|
-
let t =
|
|
2127
|
+
let t = Kr(null, s, e.hook, [], 1), n = wl(t, e.hook, r.id, !1);
|
|
2125
2128
|
n ? Object.assign(n, r) : t.push(r);
|
|
2126
2129
|
}
|
|
2127
2130
|
return l;
|
|
2128
2131
|
}
|
|
2129
|
-
function
|
|
2130
|
-
let l =
|
|
2132
|
+
function Sl(e, t, n, r) {
|
|
2133
|
+
let l = Kr(null, Kr(null, e, "topics", null, 0), t, null, 0);
|
|
2131
2134
|
if (!l) return xn("jdb_delete: topic not found: " + t), null;
|
|
2132
|
-
if (
|
|
2135
|
+
if (Sr(r.id)) return xn("jdb_delete: record without id: " + r), qn(r), null;
|
|
2133
2136
|
let o, i = n.split("`"), s = l;
|
|
2134
|
-
for (; (o = i.shift()) && !
|
|
2135
|
-
if (0 === i.length && s) if (
|
|
2136
|
-
let e =
|
|
2137
|
+
for (; (o = i.shift()) && !Sr(o) && s;) dr(s) && (s = Kr(null, s, e.hook, null, 0)), s = wl(s, null, o, !1);
|
|
2138
|
+
if (0 === i.length && s) if (br(s)) {
|
|
2139
|
+
let e = ul(s, r.id);
|
|
2137
2140
|
e >= 0 && s.splice(e, 1);
|
|
2138
2141
|
} else {
|
|
2139
|
-
let t =
|
|
2142
|
+
let t = Kr(null, s, e.hook, null, 0), n = ul(t, r.id);
|
|
2140
2143
|
n >= 0 && t.splice(n, 1);
|
|
2141
2144
|
}
|
|
2142
2145
|
return l;
|
|
2143
2146
|
}
|
|
2144
|
-
function
|
|
2145
|
-
let n =
|
|
2147
|
+
function Nl(e, t) {
|
|
2148
|
+
let n = Kr(null, e, "topics", null, 0);
|
|
2146
2149
|
if (!n) return xn("jdb topics section not found"), qn(e), null;
|
|
2147
|
-
return
|
|
2150
|
+
return Kr(null, n, t, null, 0) || (xn("jdb topic not found: " + t), qn(n), null);
|
|
2148
2151
|
}
|
|
2149
|
-
function
|
|
2150
|
-
let l =
|
|
2151
|
-
return l ? (void 0 === r && (r = !0),
|
|
2152
|
+
function Rl(e, t, n, r) {
|
|
2153
|
+
let l = Kr(null, Kr(null, e, "topics", null, 0), t, null, 0);
|
|
2154
|
+
return l ? (void 0 === r && (r = !0), wl(l, e.hook, n, r)) : (xn("jdb_get: topic not found: " + t), null);
|
|
2152
2155
|
}
|
|
2153
|
-
function
|
|
2154
|
-
let r =
|
|
2156
|
+
function jl(e, t, n) {
|
|
2157
|
+
let r = Kr(null, Kr(null, e, "topics", null, 0), t, null, 0);
|
|
2155
2158
|
return r ? n < r.length ? r[n] : {} : (xn("jdb_get_by_idx: topic not found: " + t), null);
|
|
2156
2159
|
}
|
|
2157
|
-
function
|
|
2160
|
+
function wl(e, t, n, r) {
|
|
2158
2161
|
if (!e) return null;
|
|
2159
2162
|
let l, o = e.length;
|
|
2160
2163
|
for (l = 0; l < o; l++) {
|
|
@@ -2162,19 +2165,19 @@ function jl(e, t, n, r) {
|
|
|
2162
2165
|
if (o) {
|
|
2163
2166
|
let e = o.id;
|
|
2164
2167
|
if (e && e === n) return o;
|
|
2165
|
-
if (r &&
|
|
2166
|
-
let e =
|
|
2168
|
+
if (r && Cr(o, t)) {
|
|
2169
|
+
let e = wl(o[t], t, n, r);
|
|
2167
2170
|
if (e) return e;
|
|
2168
2171
|
}
|
|
2169
2172
|
}
|
|
2170
2173
|
}
|
|
2171
2174
|
return null;
|
|
2172
2175
|
}
|
|
2173
|
-
function
|
|
2176
|
+
function Dl(e, t) {
|
|
2174
2177
|
let n = Qn(e);
|
|
2175
2178
|
return er(n, t), n;
|
|
2176
2179
|
}
|
|
2177
|
-
function
|
|
2180
|
+
function Al(e) {
|
|
2178
2181
|
function t(e) {
|
|
2179
2182
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2180
2183
|
switch (t.length % 4) {
|
|
@@ -2205,9 +2208,9 @@ function Dl(e) {
|
|
|
2205
2208
|
signature: t(n[2])
|
|
2206
2209
|
};
|
|
2207
2210
|
}
|
|
2208
|
-
function
|
|
2211
|
+
function Il(e, t) {
|
|
2209
2212
|
try {
|
|
2210
|
-
let n =
|
|
2213
|
+
let n = Al(e);
|
|
2211
2214
|
switch (t) {
|
|
2212
2215
|
case "header": return JSON.parse(n.header);
|
|
2213
2216
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2217,19 +2220,19 @@ function Al(e, t) {
|
|
|
2217
2220
|
return null;
|
|
2218
2221
|
}
|
|
2219
2222
|
}
|
|
2220
|
-
function
|
|
2223
|
+
function $l(e) {
|
|
2221
2224
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2222
2225
|
}
|
|
2223
|
-
function
|
|
2226
|
+
function kl(e) {
|
|
2224
2227
|
if (!e) return "";
|
|
2225
2228
|
const t = String(e).trim();
|
|
2226
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2229
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : $l(t);
|
|
2227
2230
|
}
|
|
2228
|
-
function
|
|
2231
|
+
function Cl(e) {
|
|
2229
2232
|
const t = document.createElement("template");
|
|
2230
2233
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2231
2234
|
}
|
|
2232
|
-
function
|
|
2235
|
+
function Ll(e, t) {
|
|
2233
2236
|
let [n, r, l, o] = e;
|
|
2234
2237
|
if (!n) return void xn("Tag must be a valid HTML element.");
|
|
2235
2238
|
let i = document.createElement(n), s = "";
|
|
@@ -2238,17 +2241,17 @@ function Cl(e, t) {
|
|
|
2238
2241
|
for (const n of Object.keys(r[e])) t += `${n}: ${r[e][n]};`;
|
|
2239
2242
|
i.style.cssText = t;
|
|
2240
2243
|
} 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]);
|
|
2241
|
-
if (
|
|
2244
|
+
if (pr(l)) if (l = l.trim(), l.length > 0 && "<" === l[0]) i.appendChild(Cl(l));
|
|
2242
2245
|
else if (t && s) i.textContent = t(s) || l;
|
|
2243
2246
|
else i.textContent = l;
|
|
2244
|
-
else if (
|
|
2245
|
-
if (l.length > 0) if (
|
|
2246
|
-
else for (let e of l) Array.isArray(e) && e.length > 0 ? i.appendChild(
|
|
2247
|
+
else if (br(l)) {
|
|
2248
|
+
if (l.length > 0) if (pr(l[0])) i.appendChild(Ll(l, t));
|
|
2249
|
+
else for (let e of l) Array.isArray(e) && e.length > 0 ? i.appendChild(Ll(e, t)) : e instanceof HTMLElement && i.appendChild(e);
|
|
2247
2250
|
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (xn("content ignored"), Hn(l));
|
|
2248
2251
|
if (o && "object" == typeof o) for (const e of Object.keys(o)) i.addEventListener(e, o[e]);
|
|
2249
2252
|
return i;
|
|
2250
2253
|
}
|
|
2251
|
-
function
|
|
2254
|
+
function Pl(e) {
|
|
2252
2255
|
if (!e) return {
|
|
2253
2256
|
top: 0,
|
|
2254
2257
|
left: 0,
|
|
@@ -2268,11 +2271,11 @@ function Ll(e) {
|
|
|
2268
2271
|
bottom: t + i + l
|
|
2269
2272
|
};
|
|
2270
2273
|
}
|
|
2271
|
-
function
|
|
2274
|
+
function Ul(e) {
|
|
2272
2275
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2273
2276
|
}
|
|
2274
|
-
function
|
|
2275
|
-
|
|
2277
|
+
function Fl(e, t) {
|
|
2278
|
+
vr(t) ? (e || (e = document), e.querySelectorAll("[data-i18n]").forEach(function(e) {
|
|
2276
2279
|
let n = e.getAttribute("data-i18n");
|
|
2277
2280
|
for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
|
|
2278
2281
|
n || (n = r.nodeValue), r.nodeValue = t(n);
|
|
@@ -2289,7 +2292,7 @@ function Ul(e, t) {
|
|
|
2289
2292
|
n && e.setAttribute("placeholder", t(n));
|
|
2290
2293
|
})) : xn("You must supply a translation function");
|
|
2291
2294
|
}
|
|
2292
|
-
function
|
|
2295
|
+
function Gl(e = "Time Tracker", t = !1) {
|
|
2293
2296
|
const n = e, r = performance.now();
|
|
2294
2297
|
let l = r;
|
|
2295
2298
|
return t && Yn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
@@ -2300,30 +2303,30 @@ function Fl(e = "Time Tracker", t = !1) {
|
|
|
2300
2303
|
};
|
|
2301
2304
|
} };
|
|
2302
2305
|
}
|
|
2303
|
-
function
|
|
2306
|
+
function Vl() {
|
|
2304
2307
|
const e = /* @__PURE__ */ new Date(), t = e.toISOString().slice(0, 19), n = String(e.getMilliseconds()).padStart(3, "0"), r = e.getTimezoneOffset();
|
|
2305
2308
|
return `${t}.${n}${r > 0 ? "-" : "+"}${String(Math.abs(r) / 60).padStart(2, "0")}${String(Math.abs(r) % 60).padStart(2, "0")}`;
|
|
2306
2309
|
}
|
|
2307
|
-
function
|
|
2310
|
+
function Ml() {
|
|
2308
2311
|
return Math.floor(Date.now() / 1e3);
|
|
2309
2312
|
}
|
|
2310
|
-
function
|
|
2313
|
+
function Wl(e, t) {
|
|
2311
2314
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2312
2315
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2313
2316
|
return -1;
|
|
2314
2317
|
}
|
|
2315
|
-
function
|
|
2318
|
+
function Kl() {
|
|
2316
2319
|
let e = "";
|
|
2317
2320
|
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;
|
|
2318
2321
|
}
|
|
2319
|
-
function
|
|
2322
|
+
function xl(e) {
|
|
2320
2323
|
return e.replace(/[?# ^:]/g, "_");
|
|
2321
2324
|
}
|
|
2322
|
-
function
|
|
2325
|
+
function Yl(e) {
|
|
2323
2326
|
let t = null;
|
|
2324
2327
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2325
2328
|
}
|
|
2326
|
-
function
|
|
2329
|
+
function Bl(e, t = 0, n = !1) {
|
|
2327
2330
|
let r = null, l = null, o = null;
|
|
2328
2331
|
const i = (...i) => {
|
|
2329
2332
|
o = this, l = i;
|
|
@@ -2338,20 +2341,20 @@ function Yl(e, t = 0, n = !1) {
|
|
|
2338
2341
|
clearTimeout(r), r = null, l = null, o = null;
|
|
2339
2342
|
}, i;
|
|
2340
2343
|
}
|
|
2341
|
-
function
|
|
2344
|
+
function Jl(...e) {
|
|
2342
2345
|
let t = "", n = 0;
|
|
2343
2346
|
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++));
|
|
2344
2347
|
return t;
|
|
2345
2348
|
}
|
|
2346
|
-
var
|
|
2347
|
-
function
|
|
2349
|
+
var ql = 256, Hl = 1e5;
|
|
2350
|
+
function Ql(e) {
|
|
2348
2351
|
const t = String(e).replace(/`/g, "``");
|
|
2349
2352
|
return "[" === t[0] ? "[" + t : t;
|
|
2350
2353
|
}
|
|
2351
|
-
function Ql(e) {
|
|
2352
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Hl(e)).join("`") : "";
|
|
2353
|
-
}
|
|
2354
2354
|
function zl(e) {
|
|
2355
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ql(e)).join("`") : "";
|
|
2356
|
+
}
|
|
2357
|
+
function Xl(e) {
|
|
2355
2358
|
if ("string" != typeof e) return null;
|
|
2356
2359
|
let t = [], n = "";
|
|
2357
2360
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2372,9 +2375,9 @@ function zl(e) {
|
|
|
2372
2375
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2373
2376
|
});
|
|
2374
2377
|
}
|
|
2375
|
-
function
|
|
2378
|
+
function Zl(e) {
|
|
2376
2379
|
const t = {}, n = (e, r, l) => {
|
|
2377
|
-
if (l >
|
|
2380
|
+
if (l > ql) throw new Error("json2flat: deeper than 256");
|
|
2378
2381
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2379
2382
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2380
2383
|
const o = `[${t}]`;
|
|
@@ -2384,7 +2387,7 @@ function Xl(e) {
|
|
|
2384
2387
|
const t = Object.keys(e);
|
|
2385
2388
|
if (t.length > 0) {
|
|
2386
2389
|
for (const o of t) {
|
|
2387
|
-
const t =
|
|
2390
|
+
const t = Ql(o);
|
|
2388
2391
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2389
2392
|
}
|
|
2390
2393
|
return;
|
|
@@ -2394,20 +2397,20 @@ function Xl(e) {
|
|
|
2394
2397
|
};
|
|
2395
2398
|
return null == e || n(e, "", 0), t;
|
|
2396
2399
|
}
|
|
2397
|
-
function
|
|
2400
|
+
function eo(e) {
|
|
2398
2401
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2399
2402
|
let t = null;
|
|
2400
2403
|
for (const n of Object.keys(e)) {
|
|
2401
|
-
const r =
|
|
2404
|
+
const r = Xl(n);
|
|
2402
2405
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2403
|
-
if (r.length >
|
|
2406
|
+
if (r.length > ql) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2404
2407
|
const l = "number" == typeof r[0];
|
|
2405
2408
|
if (null === t) t = l ? [] : {};
|
|
2406
2409
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2407
2410
|
let o = t;
|
|
2408
2411
|
for (let t = 0; t < r.length; t++) {
|
|
2409
2412
|
const l = r[t], i = "number" == typeof l, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
2410
|
-
if (i && l >
|
|
2413
|
+
if (i && l > Hl) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2411
2414
|
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"}`);
|
|
2412
2415
|
if (s) {
|
|
2413
2416
|
if (Array.isArray(o)) {
|
|
@@ -2431,23 +2434,23 @@ function Zl(e) {
|
|
|
2431
2434
|
}
|
|
2432
2435
|
return null === t ? {} : t;
|
|
2433
2436
|
}
|
|
2434
|
-
function
|
|
2437
|
+
function to(e, t) {
|
|
2435
2438
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2436
2439
|
}
|
|
2437
|
-
function
|
|
2440
|
+
function no(e, t) {
|
|
2438
2441
|
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, l = {
|
|
2439
2442
|
added: {},
|
|
2440
2443
|
removed: {},
|
|
2441
2444
|
changed: {}
|
|
2442
2445
|
};
|
|
2443
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2446
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? to(n[e], r[e]) || (l.changed[e] = {
|
|
2444
2447
|
from: n[e],
|
|
2445
2448
|
to: r[e]
|
|
2446
2449
|
}) : l.removed[e] = n[e];
|
|
2447
2450
|
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added[e] = r[e]);
|
|
2448
2451
|
return l;
|
|
2449
2452
|
}
|
|
2450
|
-
function
|
|
2453
|
+
function ro(e, t) {
|
|
2451
2454
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2452
2455
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2453
2456
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
@@ -2459,37 +2462,37 @@ function no(e, t) {
|
|
|
2459
2462
|
}
|
|
2460
2463
|
return e;
|
|
2461
2464
|
}
|
|
2462
|
-
function
|
|
2465
|
+
function lo(e) {
|
|
2463
2466
|
return "persistent-attrs-" + Tt(e);
|
|
2464
2467
|
}
|
|
2465
|
-
function lo(e, t) {
|
|
2466
|
-
let n = Wt(e, v.SDF_PERSIST), r = Zr(ro(e), null, !1);
|
|
2467
|
-
if (r && gr(r)) {
|
|
2468
|
-
let l = zr(e, r, t, !1);
|
|
2469
|
-
l = zr(e, l, n, !1), Ht(e, l, v.SDF_PERSIST);
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
2468
|
function oo(e, t) {
|
|
2473
|
-
let n =
|
|
2474
|
-
|
|
2469
|
+
let n = Wt(e, v.SDF_PERSIST), r = el(lo(e), null, !1);
|
|
2470
|
+
if (r && dr(r)) {
|
|
2471
|
+
let l = Xr(e, r, t, !1);
|
|
2472
|
+
l = Xr(e, l, n, !1), Ht(e, l, v.SDF_PERSIST);
|
|
2473
|
+
}
|
|
2475
2474
|
}
|
|
2476
2475
|
function io(e, t) {
|
|
2477
|
-
let n = Xr(e,
|
|
2478
|
-
|
|
2476
|
+
let n = Xr(e, Wt(e, v.SDF_PERSIST), t, !1), r = el(lo(e), null, !1);
|
|
2477
|
+
return r && dr(r) && tr(n, r), tl(lo(e), n);
|
|
2479
2478
|
}
|
|
2480
2479
|
function so(e, t) {
|
|
2481
|
-
let n = Zr(
|
|
2482
|
-
|
|
2480
|
+
let n = Zr(e, el(lo(e), null, !1), t, !1);
|
|
2481
|
+
0 === _r(n) ? nl(lo(e)) : tl(lo(e), n);
|
|
2482
|
+
}
|
|
2483
|
+
function ao(e, t) {
|
|
2484
|
+
let n = el(lo(e), null, !1), r = {};
|
|
2485
|
+
return n && dr(n) && (r = Xr(e, n, t, !1)), r;
|
|
2483
2486
|
}
|
|
2484
|
-
function
|
|
2485
|
-
if (
|
|
2487
|
+
function uo(e) {
|
|
2488
|
+
if (br(e) && 1 === fr(e)) {
|
|
2486
2489
|
let t = e[0];
|
|
2487
|
-
return
|
|
2490
|
+
return Cr(t, "size") ? t.size : 1;
|
|
2488
2491
|
}
|
|
2489
2492
|
return fr(e);
|
|
2490
2493
|
}
|
|
2491
|
-
function
|
|
2492
|
-
if (
|
|
2494
|
+
function _o(e, t) {
|
|
2495
|
+
if (pr(t)) {
|
|
2493
2496
|
if (-1 === t.indexOf("^")) {
|
|
2494
2497
|
let n, r, l = e.fkey;
|
|
2495
2498
|
if (1 !== _r(l)) return xn("bad fkey 1"), xn(e), xn(t), null;
|
|
@@ -2512,18 +2515,18 @@ function uo(e, t) {
|
|
|
2512
2515
|
};
|
|
2513
2516
|
}
|
|
2514
2517
|
}
|
|
2515
|
-
return
|
|
2518
|
+
return dr(t) ? {
|
|
2516
2519
|
topic_name: t.topic_name,
|
|
2517
2520
|
id: t.id,
|
|
2518
2521
|
hook_name: t.hook_name
|
|
2519
2522
|
} : (xn("bad fkey 3"), xn(e), xn(t), null);
|
|
2520
2523
|
}
|
|
2521
|
-
function
|
|
2522
|
-
let n =
|
|
2524
|
+
function co(e, t) {
|
|
2525
|
+
let n = _o(e, t);
|
|
2523
2526
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2524
2527
|
}
|
|
2525
|
-
function
|
|
2526
|
-
if (
|
|
2528
|
+
function fo(e, t) {
|
|
2529
|
+
if (pr(t)) {
|
|
2527
2530
|
if (-1 === t.indexOf("^")) {
|
|
2528
2531
|
let n, r = e.hook;
|
|
2529
2532
|
if (1 !== _r(r)) return xn("bad hook 1"), xn(e), xn(t), null;
|
|
@@ -2544,12 +2547,12 @@ function co(e, t) {
|
|
|
2544
2547
|
};
|
|
2545
2548
|
}
|
|
2546
2549
|
}
|
|
2547
|
-
return
|
|
2550
|
+
return dr(t) ? {
|
|
2548
2551
|
topic_name: t.topic_name,
|
|
2549
2552
|
id: t.id
|
|
2550
2553
|
} : (xn("bad hook 3"), xn(e), xn(t), null);
|
|
2551
2554
|
}
|
|
2552
|
-
var
|
|
2555
|
+
var go = [
|
|
2553
2556
|
"string",
|
|
2554
2557
|
"integer",
|
|
2555
2558
|
"object",
|
|
@@ -2559,7 +2562,7 @@ var fo = [
|
|
|
2559
2562
|
"real",
|
|
2560
2563
|
"boolean",
|
|
2561
2564
|
"blob"
|
|
2562
|
-
],
|
|
2565
|
+
], bo = [
|
|
2563
2566
|
"persistent",
|
|
2564
2567
|
"required",
|
|
2565
2568
|
"notnull",
|
|
@@ -2571,7 +2574,7 @@ var fo = [
|
|
|
2571
2574
|
"stats",
|
|
2572
2575
|
"rstats",
|
|
2573
2576
|
"pstats"
|
|
2574
|
-
],
|
|
2577
|
+
], po = [
|
|
2575
2578
|
"hook",
|
|
2576
2579
|
"fkey",
|
|
2577
2580
|
"enum",
|
|
@@ -2598,7 +2601,7 @@ var fo = [
|
|
|
2598
2601
|
"coordinates",
|
|
2599
2602
|
"gbuffer"
|
|
2600
2603
|
];
|
|
2601
|
-
function
|
|
2604
|
+
function mo(e) {
|
|
2602
2605
|
let t = {
|
|
2603
2606
|
name: e.id,
|
|
2604
2607
|
header: e.header,
|
|
@@ -2616,7 +2619,7 @@ function po(e) {
|
|
|
2616
2619
|
if (!e.flag) return t;
|
|
2617
2620
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2618
2621
|
let r = e.flag[n];
|
|
2619
|
-
if (
|
|
2622
|
+
if (_l(po, r)) {
|
|
2620
2623
|
switch (r) {
|
|
2621
2624
|
case "enum":
|
|
2622
2625
|
t.enum_list = e.enum;
|
|
@@ -2627,7 +2630,7 @@ function po(e) {
|
|
|
2627
2630
|
case "table": t.enum_list = e.table;
|
|
2628
2631
|
}
|
|
2629
2632
|
t.type = r;
|
|
2630
|
-
} else if (
|
|
2633
|
+
} else if (_l(bo, r)) switch (r) {
|
|
2631
2634
|
case "writable":
|
|
2632
2635
|
t.is_writable = !0;
|
|
2633
2636
|
break;
|
|
@@ -2640,7 +2643,7 @@ function po(e) {
|
|
|
2640
2643
|
}
|
|
2641
2644
|
return t;
|
|
2642
2645
|
}
|
|
2643
|
-
function
|
|
2646
|
+
function Eo(e, t) {
|
|
2644
2647
|
let n = {
|
|
2645
2648
|
name: e,
|
|
2646
2649
|
header: e,
|
|
@@ -2654,13 +2657,13 @@ function mo(e, t) {
|
|
|
2654
2657
|
placeholder: void 0,
|
|
2655
2658
|
fkey: null
|
|
2656
2659
|
};
|
|
2657
|
-
if (
|
|
2660
|
+
if (pr(t)) {
|
|
2658
2661
|
let e = t.split(".");
|
|
2659
2662
|
for (let t = 0; t < e.length; t++) {
|
|
2660
2663
|
let r = e[t];
|
|
2661
|
-
if (
|
|
2662
|
-
else if (
|
|
2663
|
-
else if (
|
|
2664
|
+
if (_l(go, r)) n.real_type || (n.real_type = r);
|
|
2665
|
+
else if (_l(po, r)) n.type || (n.type = r);
|
|
2666
|
+
else if (_l(bo, r)) switch (r) {
|
|
2664
2667
|
case "writable":
|
|
2665
2668
|
n.is_writable = !0;
|
|
2666
2669
|
break;
|
|
@@ -2672,35 +2675,35 @@ function mo(e, t) {
|
|
|
2672
2675
|
}
|
|
2673
2676
|
}
|
|
2674
2677
|
n.real_type || (n.real_type = "string");
|
|
2675
|
-
} else
|
|
2678
|
+
} else dr(t) ? (n = mo(t), n.name || (n.name = e), n.header || (n.header = e)) : br(t) && (n.real_type = "array", n.enum_list = t);
|
|
2676
2679
|
return n.type || (n.type = n.real_type), n;
|
|
2677
2680
|
}
|
|
2678
|
-
function
|
|
2681
|
+
function To(e, t) {
|
|
2679
2682
|
let n = {};
|
|
2680
2683
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2681
2684
|
let l;
|
|
2682
|
-
|
|
2683
|
-
let o =
|
|
2685
|
+
dr(r) && (l = r.default);
|
|
2686
|
+
let o = Kr(null, t, e, l);
|
|
2684
2687
|
n[e] = o;
|
|
2685
2688
|
}), n;
|
|
2686
2689
|
}
|
|
2687
|
-
var
|
|
2690
|
+
var ho = [
|
|
2688
2691
|
N(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2689
2692
|
N(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2690
2693
|
N(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2691
2694
|
S()
|
|
2692
|
-
],
|
|
2695
|
+
], yo = {
|
|
2693
2696
|
periodic: !1,
|
|
2694
2697
|
msec: 0,
|
|
2695
2698
|
timer_id: -1
|
|
2696
|
-
},
|
|
2697
|
-
function
|
|
2699
|
+
}, vo = null;
|
|
2700
|
+
function Oo(e, t, n, r) {
|
|
2698
2701
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2699
2702
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2700
2703
|
cn(e, "EV_TIMEOUT", {}, e);
|
|
2701
2704
|
}, l.msec) : l.timer_id = -1, Ot(e) ? cn(yt(e), o, {}, e) : Sn(e, o, {}), l.periodic || -1 !== l.timer_id || ut(e) && rt(e), 0;
|
|
2702
2705
|
}
|
|
2703
|
-
var
|
|
2706
|
+
var So = {
|
|
2704
2707
|
mt_create: function(e) {
|
|
2705
2708
|
let t = e.priv;
|
|
2706
2709
|
const n = Bt(e, "subscriber");
|
|
@@ -2725,31 +2728,31 @@ var Oo = {
|
|
|
2725
2728
|
},
|
|
2726
2729
|
mt_destroy: function(e) {}
|
|
2727
2730
|
};
|
|
2728
|
-
function
|
|
2731
|
+
function No() {
|
|
2729
2732
|
return function(e) {
|
|
2730
|
-
if (
|
|
2733
|
+
if (vo) return xn(`GClass ALREADY created: ${e}`), -1;
|
|
2731
2734
|
const t = [["ST_IDLE", [[
|
|
2732
2735
|
"EV_TIMEOUT",
|
|
2733
|
-
|
|
2736
|
+
Oo,
|
|
2734
2737
|
null
|
|
2735
2738
|
]]]];
|
|
2736
|
-
return (
|
|
2739
|
+
return (vo = ye(e, [
|
|
2737
2740
|
["EV_TIMEOUT", U.EVF_OUTPUT_EVENT],
|
|
2738
2741
|
["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT],
|
|
2739
2742
|
[0, 0]
|
|
2740
|
-
], t,
|
|
2743
|
+
], t, So, 0, ho, yo, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
2741
2744
|
}("C_TIMER");
|
|
2742
2745
|
}
|
|
2743
|
-
function
|
|
2746
|
+
function Ro(e, t) {
|
|
2744
2747
|
return e instanceof k ? "C_TIMER" !== Et(e) ? (xn("not C_TIMER GObj"), -1) : (Qt(e, "periodic", !1), void zt(e, "msec", t)) : (xn("not GObj TYPE"), -1);
|
|
2745
2748
|
}
|
|
2746
|
-
function
|
|
2749
|
+
function jo(e, t) {
|
|
2747
2750
|
return e instanceof k ? "C_TIMER" !== Et(e) ? (xn("not C_TIMER GObj"), -1) : (Qt(e, "periodic", !0), void zt(e, "msec", t)) : (xn("not GObj TYPE"), -1);
|
|
2748
2751
|
}
|
|
2749
|
-
function
|
|
2752
|
+
function wo(e) {
|
|
2750
2753
|
return e instanceof k ? "C_TIMER" !== Et(e) ? (xn("not C_TIMER GObj"), -1) : void zt(e, "msec", -1) : (xn("not GObj TYPE"), -1);
|
|
2751
2754
|
}
|
|
2752
|
-
var
|
|
2755
|
+
var Do = [
|
|
2753
2756
|
N(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2754
2757
|
N(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2755
2758
|
N(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2775,21 +2778,21 @@ var wo = [
|
|
|
2775
2778
|
N(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2776
2779
|
N(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2777
2780
|
S()
|
|
2778
|
-
],
|
|
2779
|
-
function
|
|
2781
|
+
], Ao = { gobj_timer: null }, Io = null;
|
|
2782
|
+
function $o(e, t, n, r) {
|
|
2780
2783
|
return Sn(e, t, n), 0;
|
|
2781
2784
|
}
|
|
2782
|
-
var
|
|
2785
|
+
var ko = {
|
|
2783
2786
|
mt_create: function(e) {
|
|
2784
2787
|
let t = e.priv;
|
|
2785
|
-
Xt(e, "start_date",
|
|
2788
|
+
Xt(e, "start_date", Vl()), Xt(e, "node_uuid", Kl()), e.priv.gobj_timer = He(mt(e), "C_TIMER", {}, e), t.periodic_timeout = Mt(e, "periodic_timeout");
|
|
2786
2789
|
},
|
|
2787
2790
|
mt_writing: function(e, t) {},
|
|
2788
2791
|
mt_start: function(e) {
|
|
2789
|
-
return
|
|
2792
|
+
return jo(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2790
2793
|
},
|
|
2791
2794
|
mt_stop: function(e) {
|
|
2792
|
-
return
|
|
2795
|
+
return wo(e.priv.gobj_timer), ot(e), 0;
|
|
2793
2796
|
},
|
|
2794
2797
|
mt_destroy: function(e) {},
|
|
2795
2798
|
mt_play: function(e) {
|
|
@@ -2800,18 +2803,18 @@ var $o = {
|
|
|
2800
2803
|
return at(ke()), 0;
|
|
2801
2804
|
}
|
|
2802
2805
|
};
|
|
2803
|
-
function
|
|
2806
|
+
function Co() {
|
|
2804
2807
|
return function(e) {
|
|
2805
|
-
if (
|
|
2808
|
+
if (Io) return xn(`GClass ALREADY created: ${e}`), -1;
|
|
2806
2809
|
const t = [["ST_IDLE", [[
|
|
2807
2810
|
"EV_TIMEOUT_PERIODIC",
|
|
2808
|
-
|
|
2811
|
+
$o,
|
|
2809
2812
|
null
|
|
2810
2813
|
]]]];
|
|
2811
|
-
return (
|
|
2814
|
+
return (Io = ye(e, [["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]], t, ko, 0, Do, Ao, 0, 0, 0, 0)) ? 0 : -1;
|
|
2812
2815
|
}("C_YUNO");
|
|
2813
2816
|
}
|
|
2814
|
-
var
|
|
2817
|
+
var Lo = "ievent_gate_stack", Po = [
|
|
2815
2818
|
N(y.DTP_STRING, "wanted_yuno_role", v.SDF_RD, "", "wanted yuno role"),
|
|
2816
2819
|
N(y.DTP_STRING, "wanted_yuno_name", v.SDF_RD, "", "wanted yuno name"),
|
|
2817
2820
|
N(y.DTP_STRING, "wanted_yuno_service", v.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2828,7 +2831,7 @@ var Co = "ievent_gate_stack", Lo = [
|
|
|
2828
2831
|
N(y.DTP_INTEGER, "timeout_idack", v.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2829
2832
|
N(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2830
2833
|
S()
|
|
2831
|
-
],
|
|
2834
|
+
], Uo = {
|
|
2832
2835
|
url: null,
|
|
2833
2836
|
remote_yuno_name: null,
|
|
2834
2837
|
remote_yuno_role: null,
|
|
@@ -2838,8 +2841,8 @@ var Co = "ievent_gate_stack", Lo = [
|
|
|
2838
2841
|
websocket: null,
|
|
2839
2842
|
inside_on_open: !1,
|
|
2840
2843
|
retry_ms: 0
|
|
2841
|
-
},
|
|
2842
|
-
function
|
|
2844
|
+
}, Fo = null;
|
|
2845
|
+
function Go(e) {
|
|
2843
2846
|
e.priv.websocket && xn("Websocket ALREADY setup");
|
|
2844
2847
|
const t = Yt(e, "url");
|
|
2845
2848
|
let n;
|
|
@@ -2863,7 +2866,7 @@ function Fo(e) {
|
|
|
2863
2866
|
}, e));
|
|
2864
2867
|
}, n) : (xn(`${Tt(e)}: Failed to initialize WebSocket.`), null);
|
|
2865
2868
|
}
|
|
2866
|
-
function
|
|
2869
|
+
function Vo(e, t = 1e3, n = "") {
|
|
2867
2870
|
let r = e.priv, l = r.websocket;
|
|
2868
2871
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2869
2872
|
Jn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -2874,25 +2877,25 @@ function Go(e, t = 1e3, n = "") {
|
|
|
2874
2877
|
}
|
|
2875
2878
|
} else Yn("WebSocket is already closed or in the process of closing.");
|
|
2876
2879
|
}
|
|
2877
|
-
function
|
|
2878
|
-
let r =
|
|
2880
|
+
function Mo(e, t, n) {
|
|
2881
|
+
let r = Vl();
|
|
2879
2882
|
try {
|
|
2880
2883
|
Jn("\n" + r + " " + t + "\n"), Hn(n);
|
|
2881
2884
|
} catch (e) {
|
|
2882
2885
|
Jn("ERROR in trace_inter_event: " + e);
|
|
2883
2886
|
}
|
|
2884
2887
|
}
|
|
2885
|
-
var
|
|
2888
|
+
var Wo = class {
|
|
2886
2889
|
constructor(e, t) {
|
|
2887
2890
|
this.event = e, this.kw = t || {};
|
|
2888
2891
|
}
|
|
2889
2892
|
};
|
|
2890
|
-
function
|
|
2893
|
+
function Ko(e, t, n, r) {
|
|
2891
2894
|
return function(e, t) {
|
|
2892
2895
|
let n = e.priv, r = JSON.stringify(t);
|
|
2893
2896
|
if (Kt(gt(), "trace_inter_event")) {
|
|
2894
2897
|
let n = Yt(e, "url"), l = mt(gt()) + " ==> " + n, o = Mt(gt(), "trace_ievent_callback");
|
|
2895
|
-
o ? o(l, t, 1, r.length) :
|
|
2898
|
+
o ? o(l, t, 1, r.length) : Mo(0, l, t);
|
|
2896
2899
|
}
|
|
2897
2900
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Yn(`${Tt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2898
2901
|
try {
|
|
@@ -2902,21 +2905,21 @@ function Wo(e, t, n, r) {
|
|
|
2902
2905
|
}
|
|
2903
2906
|
return 0;
|
|
2904
2907
|
}(e, function(e, t) {
|
|
2905
|
-
return
|
|
2908
|
+
return Sr(e) ? (xn("iev_create() event NULL"), null) : new Wo(e, t);
|
|
2906
2909
|
}(t, n));
|
|
2907
2910
|
}
|
|
2908
|
-
function
|
|
2909
|
-
return
|
|
2911
|
+
function xo(e, t, n) {
|
|
2912
|
+
return Sr(n) && (n = Yt(e, "wanted_yuno_service")), {
|
|
2910
2913
|
dst_yuno: Yt(e, "wanted_yuno_name"),
|
|
2911
2914
|
dst_role: Yt(e, "wanted_yuno_role"),
|
|
2912
2915
|
dst_service: n,
|
|
2913
2916
|
src_yuno: dt(),
|
|
2914
2917
|
src_role: bt(),
|
|
2915
2918
|
src_service: t,
|
|
2916
|
-
host:
|
|
2919
|
+
host: Kl()
|
|
2917
2920
|
};
|
|
2918
2921
|
}
|
|
2919
|
-
function
|
|
2922
|
+
function Yo(e) {
|
|
2920
2923
|
let t = e.priv, n = ft(gt()), r = Yt(gt(), "yuno_version"), l = Yt(gt(), "yuno_release"), o = Yt(gt(), "yuno_tag"), i = Mt(e, "required_services");
|
|
2921
2924
|
i && i.length || (i = Mt(gt(), "required_services"));
|
|
2922
2925
|
let s = {
|
|
@@ -2934,27 +2937,27 @@ function xo(e) {
|
|
|
2934
2937
|
username: Yt(gt(), "__username__"),
|
|
2935
2938
|
launch_id: 0,
|
|
2936
2939
|
yuno_startdate: Yt(gt(), "start_date"),
|
|
2937
|
-
id:
|
|
2940
|
+
id: Kl(),
|
|
2938
2941
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2939
2942
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2940
2943
|
required_services: i
|
|
2941
2944
|
};
|
|
2942
|
-
return
|
|
2945
|
+
return bl(e, s, Lo, xo(e, mt(yt(e)), null)), ml(e, s, "__identity__"), Ro(t.gobj_timer, xt(e, "timeout_idack")), Ko(e, "EV_IDENTITY_CARD", s);
|
|
2943
2946
|
}
|
|
2944
|
-
function
|
|
2945
|
-
if (
|
|
2947
|
+
function Bo(e, t) {
|
|
2948
|
+
if (Sr(t.event)) return -1;
|
|
2946
2949
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
2947
2950
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2948
|
-
return
|
|
2949
|
-
}
|
|
2950
|
-
function Bo(e, t, n, r) {
|
|
2951
|
-
let l = e.priv;
|
|
2952
|
-
return ut(e) && (l.websocket = Fo(e)), 0;
|
|
2951
|
+
return bl(e, n, Lo, xo(e, mt(s), i)), ml(e, n, "__subscribing__"), Ko(e, t.event, n);
|
|
2953
2952
|
}
|
|
2954
2953
|
function Jo(e, t, n, r) {
|
|
2955
|
-
|
|
2954
|
+
let l = e.priv;
|
|
2955
|
+
return ut(e) && (l.websocket = Go(e)), 0;
|
|
2956
2956
|
}
|
|
2957
2957
|
function qo(e, t, n, r) {
|
|
2958
|
+
return Jn("Websocket opened: " + e.priv.url), Yo(e), 0;
|
|
2959
|
+
}
|
|
2960
|
+
function Ho(e, t, n, r) {
|
|
2958
2961
|
let l = e.priv, o = n.e, i = n.url;
|
|
2959
2962
|
return Wn(), Yn(`${Tt(e)}: WebSocket closed ${i} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Sn(e, "EV_ON_CLOSE", {
|
|
2960
2963
|
url: i,
|
|
@@ -2969,7 +2972,7 @@ function qo(e, t, n, r) {
|
|
|
2969
2972
|
code: o.code,
|
|
2970
2973
|
reason: o.reason,
|
|
2971
2974
|
was_clean: o.wasClean
|
|
2972
|
-
})), ut(e) &&
|
|
2975
|
+
})), ut(e) && Ro(l.gobj_timer, function(e) {
|
|
2973
2976
|
let t = e.priv, n = xt(e, "timeout_retry"), r = xt(e, "timeout_retry_max");
|
|
2974
2977
|
r < n && (r = n);
|
|
2975
2978
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -2977,17 +2980,17 @@ function qo(e, t, n, r) {
|
|
|
2977
2980
|
return Math.max(1, Math.round(o));
|
|
2978
2981
|
}(e)), 0;
|
|
2979
2982
|
}
|
|
2980
|
-
function Ho(e, t, n, r) {
|
|
2981
|
-
return xo(e), 0;
|
|
2982
|
-
}
|
|
2983
2983
|
function Qo(e, t, n, r) {
|
|
2984
|
+
return Yo(e), 0;
|
|
2985
|
+
}
|
|
2986
|
+
function zo(e, t, n, r) {
|
|
2984
2987
|
let l = e.priv;
|
|
2985
|
-
|
|
2986
|
-
let o =
|
|
2988
|
+
wo(l.gobj_timer);
|
|
2989
|
+
let o = pl(e, n, Lo, !0), i = Vr(e, o, "src_yuno", ""), s = Vr(e, o, "src_role", ""), a = Vr(e, o, "src_service", "");
|
|
2987
2990
|
Xt(e, "remote_yuno_name", i), Xt(e, "remote_yuno_role", s), Xt(e, "remote_yuno_service", a);
|
|
2988
|
-
let u =
|
|
2991
|
+
let u = Fr(e, n, "result", -1, 0), _ = Vr(e, n, "comment", "", 0), c = Vr(e, n, "username", "", 0), f = Kr(e, n, "services_roles", {});
|
|
2989
2992
|
if (u < 0) {
|
|
2990
|
-
|
|
2993
|
+
Vo(e);
|
|
2991
2994
|
let t = {
|
|
2992
2995
|
url: Yt(e, "url"),
|
|
2993
2996
|
result: u,
|
|
@@ -3012,12 +3015,12 @@ function Qo(e, t, n, r) {
|
|
|
3012
3015
|
}
|
|
3013
3016
|
l.inside_on_open = !1, function(e) {
|
|
3014
3017
|
let t = yn(e, null, null, null);
|
|
3015
|
-
for (let n = 0; n < t.length; n++)
|
|
3018
|
+
for (let n = 0; n < t.length; n++) Bo(e, t[n]);
|
|
3016
3019
|
}(e);
|
|
3017
3020
|
}
|
|
3018
3021
|
return 0;
|
|
3019
3022
|
}
|
|
3020
|
-
function
|
|
3023
|
+
function Xo(e, t, n, r) {
|
|
3021
3024
|
let l = e.priv.url, o = function(e, t) {
|
|
3022
3025
|
let n;
|
|
3023
3026
|
try {
|
|
@@ -3037,35 +3040,35 @@ function zo(e, t, n, r) {
|
|
|
3037
3040
|
}(0, n.data);
|
|
3038
3041
|
if (Kt(gt(), "trace_inter_event")) {
|
|
3039
3042
|
let e = mt(gt()) + " <== " + l, t = n.data.length, r = Mt(gt(), "trace_ievent_callback");
|
|
3040
|
-
r ? r(e, o, 2, t) :
|
|
3043
|
+
r ? r(e, o, 2, t) : Mo(0, e, o);
|
|
3041
3044
|
}
|
|
3042
3045
|
let i = o.event, s = o.kw;
|
|
3043
3046
|
if ("ST_SESSION" !== en(e)) {
|
|
3044
3047
|
if (rn(e, i, U.EVF_PUBLIC_EVENT)) {
|
|
3045
3048
|
if (!(cn(e, i, s, e) < 0)) return 0;
|
|
3046
3049
|
} else xn(`${Tt(e)}: event UNKNOWN in not-session state ${i}`);
|
|
3047
|
-
return
|
|
3050
|
+
return Vo(e), -1;
|
|
3048
3051
|
}
|
|
3049
3052
|
o = null;
|
|
3050
|
-
let a =
|
|
3053
|
+
let a = El(e, s), u = pl(e, s, Lo), _ = Vr(e, u, "dst_role", "");
|
|
3051
3054
|
if (_.toLowerCase() !== bt().toLowerCase()) return xn(`"It's not my role, dst_role: ${_}, my_role: ${bt()}`), 0;
|
|
3052
|
-
let c =
|
|
3055
|
+
let c = Vr(e, u, "dst_service", "");
|
|
3053
3056
|
if ("__subscribing__" === a) return -1;
|
|
3054
3057
|
if ("__unsubscribing__" === a) return -1;
|
|
3055
3058
|
if (rn(e, i, U.EVF_PUBLIC_EVENT)) return cn(e, i, s, e), 0;
|
|
3056
|
-
if (!
|
|
3059
|
+
if (!Sr(c)) {
|
|
3057
3060
|
let t = Ce(c, !1);
|
|
3058
3061
|
return t ? rn(t, i, U.EVF_PUBLIC_EVENT) ? (cn(t, i, s, e), 0) : (xn(`${Tt(e)}: Service found but no event or not public, service '${Tt(t)}', ev '${i}'`), -1) : (Yn(`${Tt(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${i}'`), 0);
|
|
3059
3062
|
}
|
|
3060
3063
|
return Ot(e) ? cn(yt(e), i, s, e) : Sn(e, i, s), 0;
|
|
3061
3064
|
}
|
|
3062
|
-
function
|
|
3065
|
+
function Zo(e, t, n, r) {
|
|
3063
3066
|
return 0;
|
|
3064
3067
|
}
|
|
3065
|
-
function
|
|
3068
|
+
function ei(e, t, n, r) {
|
|
3066
3069
|
return 0;
|
|
3067
3070
|
}
|
|
3068
|
-
var
|
|
3071
|
+
var ti = {
|
|
3069
3072
|
mt_create: function(e) {
|
|
3070
3073
|
let t = e.priv;
|
|
3071
3074
|
t.gobj_timer = He(mt(e), "C_TIMER", {}, e), t.url = Yt(e, "url"), t.remote_yuno_name = Yt(e, "remote_yuno_name"), t.remote_yuno_role = Yt(e, "remote_yuno_role"), t.remote_yuno_service = Yt(e, "remote_yuno_service"), Xt(e, "wanted_yuno_name", t.remote_yuno_name), Xt(e, "wanted_yuno_role", t.remote_yuno_role), Xt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -3089,72 +3092,72 @@ var ei = {
|
|
|
3089
3092
|
},
|
|
3090
3093
|
mt_start: function(e) {
|
|
3091
3094
|
let t = e.priv;
|
|
3092
|
-
return t.retry_ms = 0, t.websocket =
|
|
3095
|
+
return t.retry_ms = 0, t.websocket = Go(e), 0;
|
|
3093
3096
|
},
|
|
3094
3097
|
mt_stop: function(e) {
|
|
3095
3098
|
let t = e.priv;
|
|
3096
|
-
return
|
|
3099
|
+
return wo(t.gobj_timer), t.websocket && Vo(e), 0;
|
|
3097
3100
|
},
|
|
3098
3101
|
mt_destroy: function(e) {},
|
|
3099
3102
|
mt_stats: function(e, t, n, r) {
|
|
3100
3103
|
if ("ST_SESSION" !== en(e)) return xn("Not in session"), null;
|
|
3101
3104
|
n || (n = {});
|
|
3102
|
-
let l =
|
|
3103
|
-
return o || (o = {}),
|
|
3105
|
+
let l = xo(e, mt(r), Vr(e, n, "service", null, 0)), o = Kr(e, n, "__md_stats__", null, jn.KW_EXTRACT);
|
|
3106
|
+
return o || (o = {}), bl(e, n, "stats_stack", {
|
|
3104
3107
|
stats: t,
|
|
3105
3108
|
kw: o
|
|
3106
|
-
}),
|
|
3109
|
+
}), bl(e, n, Lo, l), n.__stats__ = t, ml(e, n, "__stats__"), Ko(e, "EV_MT_STATS", n, r), null;
|
|
3107
3110
|
},
|
|
3108
3111
|
mt_command_parser: function(e, t, n, r) {
|
|
3109
3112
|
if ("ST_SESSION" !== en(e)) return xn("Not in session"), null;
|
|
3110
3113
|
n || (n = {});
|
|
3111
|
-
let l =
|
|
3112
|
-
return o || (o = {}),
|
|
3114
|
+
let l = xo(e, mt(r), Vr(e, n, "service", "", 0)), o = Kr(e, n, "__md_command__", null, jn.KW_EXTRACT);
|
|
3115
|
+
return o || (o = {}), bl(e, n, "command_stack", {
|
|
3113
3116
|
command: t,
|
|
3114
3117
|
kw: o
|
|
3115
|
-
}),
|
|
3118
|
+
}), bl(e, n, Lo, l), n.__command__ = t, ml(e, n, "__command__"), Ko(e, "EV_MT_COMMAND", n, r), null;
|
|
3116
3119
|
},
|
|
3117
3120
|
mt_inject_event: function(e, t, n, r) {
|
|
3118
3121
|
if ("ST_SESSION" !== en(e)) return window.console.error("Not in session"), -1;
|
|
3119
|
-
if (n || (n = {}),
|
|
3122
|
+
if (n || (n = {}), pl(e, n, Lo));
|
|
3120
3123
|
else {
|
|
3121
|
-
let l =
|
|
3122
|
-
rr(n, "__service__"),
|
|
3124
|
+
let l = xo(e, mt(r), Vr(e, n, "__service__", 0, 0));
|
|
3125
|
+
rr(n, "__service__"), bl(e, n, "__message__", t), bl(e, n, Lo, l);
|
|
3123
3126
|
}
|
|
3124
|
-
return
|
|
3127
|
+
return ml(e, n, "__message__"), Ko(e, t, n, r);
|
|
3125
3128
|
},
|
|
3126
3129
|
mt_subscription_added: function(e, t) {
|
|
3127
3130
|
let n = e.priv;
|
|
3128
|
-
return "ST_SESSION" === en(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3131
|
+
return "ST_SESSION" === en(e) && n.websocket ? n.inside_on_open ? 0 : Bo(e, t) : 0;
|
|
3129
3132
|
},
|
|
3130
3133
|
mt_subscription_deleted: function(e, t) {
|
|
3131
3134
|
let n = e.priv;
|
|
3132
3135
|
if ("ST_SESSION" !== en(e) || !n.websocket) return 0;
|
|
3133
3136
|
if (n.inside_on_open) return 0;
|
|
3134
|
-
if (
|
|
3137
|
+
if (Sr(t.event)) return 0;
|
|
3135
3138
|
let r = {}, l = t.__global__, o = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3136
3139
|
o && (r.__config__ = o), l && (r.__global__ = l), i && (r.__filter__ = i);
|
|
3137
|
-
return
|
|
3140
|
+
return bl(e, r, Lo, xo(e, mt(a), s)), ml(e, r, "__unsubscribing__"), Ko(e, t.event, r, e);
|
|
3138
3141
|
}
|
|
3139
3142
|
};
|
|
3140
|
-
function
|
|
3143
|
+
function ni() {
|
|
3141
3144
|
return function(e) {
|
|
3142
|
-
if (
|
|
3145
|
+
if (Fo) return xn(`GClass ALREADY created: ${e}`), -1;
|
|
3143
3146
|
const t = [
|
|
3144
3147
|
["ST_DISCONNECTED", [
|
|
3145
3148
|
[
|
|
3146
3149
|
"EV_ON_OPEN",
|
|
3147
|
-
|
|
3150
|
+
qo,
|
|
3148
3151
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3149
3152
|
],
|
|
3150
3153
|
[
|
|
3151
3154
|
"EV_ON_CLOSE",
|
|
3152
|
-
|
|
3155
|
+
Ho,
|
|
3153
3156
|
null
|
|
3154
3157
|
],
|
|
3155
3158
|
[
|
|
3156
3159
|
"EV_TIMEOUT",
|
|
3157
|
-
|
|
3160
|
+
Jo,
|
|
3158
3161
|
null
|
|
3159
3162
|
],
|
|
3160
3163
|
[
|
|
@@ -3166,22 +3169,22 @@ function ti() {
|
|
|
3166
3169
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3167
3170
|
[
|
|
3168
3171
|
"EV_ON_MESSAGE",
|
|
3169
|
-
|
|
3172
|
+
Xo,
|
|
3170
3173
|
null
|
|
3171
3174
|
],
|
|
3172
3175
|
[
|
|
3173
3176
|
"EV_IDENTITY_CARD_ACK",
|
|
3174
|
-
|
|
3177
|
+
zo,
|
|
3175
3178
|
null
|
|
3176
3179
|
],
|
|
3177
3180
|
[
|
|
3178
3181
|
"EV_ON_CLOSE",
|
|
3179
|
-
|
|
3182
|
+
Ho,
|
|
3180
3183
|
"ST_DISCONNECTED"
|
|
3181
3184
|
],
|
|
3182
3185
|
[
|
|
3183
3186
|
"EV_TIMEOUT",
|
|
3184
|
-
|
|
3187
|
+
Qo,
|
|
3185
3188
|
null
|
|
3186
3189
|
],
|
|
3187
3190
|
[
|
|
@@ -3193,22 +3196,22 @@ function ti() {
|
|
|
3193
3196
|
["ST_SESSION", [
|
|
3194
3197
|
[
|
|
3195
3198
|
"EV_ON_MESSAGE",
|
|
3196
|
-
|
|
3199
|
+
Xo,
|
|
3197
3200
|
null
|
|
3198
3201
|
],
|
|
3199
3202
|
[
|
|
3200
3203
|
"EV_MT_STATS",
|
|
3201
|
-
|
|
3204
|
+
Zo,
|
|
3202
3205
|
null
|
|
3203
3206
|
],
|
|
3204
3207
|
[
|
|
3205
3208
|
"EV_MT_COMMAND",
|
|
3206
|
-
|
|
3209
|
+
ei,
|
|
3207
3210
|
null
|
|
3208
3211
|
],
|
|
3209
3212
|
[
|
|
3210
3213
|
"EV_ON_CLOSE",
|
|
3211
|
-
|
|
3214
|
+
Ho,
|
|
3212
3215
|
"ST_DISCONNECTED"
|
|
3213
3216
|
],
|
|
3214
3217
|
[
|
|
@@ -3219,7 +3222,7 @@ function ti() {
|
|
|
3219
3222
|
]],
|
|
3220
3223
|
[null, null]
|
|
3221
3224
|
];
|
|
3222
|
-
return (
|
|
3225
|
+
return (Fo = ye(e, [
|
|
3223
3226
|
["EV_ON_MESSAGE", U.EVF_OUTPUT_EVENT],
|
|
3224
3227
|
["EV_IDENTITY_CARD_ACK", U.EVF_PUBLIC_EVENT],
|
|
3225
3228
|
["EV_ON_ID_NAK", U.EVF_PUBLIC_EVENT | U.EVF_OUTPUT_EVENT],
|
|
@@ -3230,9 +3233,9 @@ function ti() {
|
|
|
3230
3233
|
["EV_ON_OPEN_ERROR", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3231
3234
|
["EV_TIMEOUT", 0],
|
|
3232
3235
|
[null, 0]
|
|
3233
|
-
], t,
|
|
3236
|
+
], t, ti, 0, Po, Uo, 0, 0, 0, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3234
3237
|
}("C_IEVENT_CLI");
|
|
3235
3238
|
}
|
|
3236
|
-
export { k as GObj, N as SDATA, D as SDATAAUTHZ, R as SDATACM, j as SDATACM2, I as SDATADF, w as SDATAPM, A as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, E as __yuno__, o as build_command_response,
|
|
3239
|
+
export { k as GObj, N as SDATA, D as SDATAAUTHZ, R as SDATACM, j as SDATACM2, I as SDATADF, w as SDATAPM, A as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, E as __yuno__, o as build_command_response, Jl as build_path, s as build_stats_response, xl as clean_name, wo as clear_timeout, Dr as cmp_two_simple_json, l as command_parser, Ll as createElement2, Cl as createOneHtml, Dl as create_json_record, To as create_template_record, Vl as current_timestamp, y as data_type_t, ao as db_list_persistent_attrs, oo as db_load_persistent_attrs, so as db_remove_persistent_attrs, io as db_save_persistent_attrs, Bl as debounce, fl as delete_from_list, zn as duplicate_objects, gr as empty_json, Sr as empty_string, $l as escapeHtml, U as event_flag_t, eo as flat2json, ro as flat_apply, no as flat_diff, zl as flat_key_join, Xl as flat_key_split, Re as gclass_add_ev_action, we as gclass_add_event_type, Ne as gclass_add_state, Ae as gclass_check_fsm, ye as gclass_create, De as gclass_event_type, Ie as gclass_find_by_name, C as gclass_flag_t, ve as gclass_unregister, Pl as getPositionRelativeToBody, Yl as get_function_name, Ml as get_now, Nt as gobj_bottom_gobj, tn as gobj_change_parent, Zt as gobj_change_state, Nn as gobj_command, Qe as gobj_create, xe as gobj_create2, Je as gobj_create_default_service, He as gobj_create_pure_child, Be as gobj_create_service, qe as gobj_create_volatil, Ye as gobj_create_yuno, en as gobj_current_state, ke as gobj_default_service, _n as gobj_deliver_posted_events, ze as gobj_destroy, Pt as gobj_find_child, Ct as gobj_find_gobj, Ce as gobj_find_service, On as gobj_find_subscribings, yn as gobj_find_subscriptions, L as gobj_flag_t, ht as gobj_full_name, Et as gobj_gclass_name, se as gobj_global_trace_level, Vt as gobj_has_attr, rn as gobj_has_event, ln as gobj_has_output_event, Ee as gobj_hsdata, St as gobj_is_destroying, ft as gobj_is_playing, Ot as gobj_is_pure_child, ut as gobj_is_running, ct as gobj_is_service, vt as gobj_is_volatil, Me as gobj_list_persistent_attrs, vn as gobj_list_subscriptions, Fe as gobj_load_persistent_attrs, Ut as gobj_match_children, Ft as gobj_match_children_tree, Lt as gobj_match_gobj, mt as gobj_name, yt as gobj_parent, at as gobj_pause, st as gobj_play, an as gobj_post_event, un as gobj_posted_events_size, Sn as gobj_publish_event, Mt as gobj_read_attr, Wt as gobj_read_attrs, Kt as gobj_read_bool_attr, xt as gobj_read_integer_attr, Bt as gobj_read_pointer_attr, Yt as gobj_read_str_attr, Ve as gobj_remove_persistent_attrs, ge as gobj_repr_global_trace_levels, qt as gobj_reset_volatil_attrs, Ge as gobj_save_persistent_attrs, Gt as gobj_search_path, cn as gobj_send_event, $e as gobj_services, Rt as gobj_set_bottom_gobj, ae as gobj_set_deep_trace, ce as gobj_set_gclass_no_trace, ue as gobj_set_gclass_trace, ie as gobj_set_global_no_trace, oe as gobj_set_global_trace, fe as gobj_set_gobj_no_trace, _e as gobj_set_gobj_trace, K as gobj_set_trace_machine_format, Tt as gobj_short_name, Xe as gobj_start, et as gobj_start_children, nt as gobj_start_tree, de as gobj_start_up, Rn as gobj_stats, rt as gobj_stop, ot as gobj_stop_children, it as gobj_stop_tree, En as gobj_subscribe_event, X as gobj_trace_level, x as gobj_trace_machine_format, Z as gobj_trace_no_level, Tn as gobj_unsubscribe_event, hn as gobj_unsubscribe_list, wt as gobj_walk_gobj_children, Dt as gobj_walk_gobj_children_tree, Jt as gobj_write_attr, Ht as gobj_write_attrs, Qt as gobj_write_bool_attr, zt as gobj_write_integer_attr, Xt as gobj_write_str_attr, gt as gobj_yuno, pt as gobj_yuno_id, dt as gobj_yuno_name, bt as gobj_yuno_role, ul as id_index_in_obj_list, Wl as index_in_list, br as is_array, Er as is_boolean, yr as is_date, vr as is_function, Or as is_gobj, Ir as is_metadata_key, Tr as is_null, mr as is_number, dr as is_object, $r as is_private_key, hr as is_pure_number, pr as is_string, Sl as jdb_delete, Rl as jdb_get, jl as jdb_get_by_idx, Nl as jdb_get_topic, vl as jdb_init, Ol as jdb_update, Zl as json2flat, ir as json_array_append, sr as json_array_append_new, ur as json_array_extend, ar as json_array_remove, cr as json_array_size, Qn as json_deep_copy, Xn as json_is_identical, rr as json_object_del, nr as json_object_get, lr as json_object_set, or as json_object_set_new, _r as json_object_size, Zn as json_object_update, er as json_object_update_existing, tr as json_object_update_missing, fr as json_size, Il as jwt2json, Al as jwtDecode, Xr as kw_clone_by_keys, Zr as kw_clone_by_not_keys, zr as kw_collect, Pr as kw_delete, Hr as kw_find_json_in_list, Lr as kw_find_path, jn as kw_flag_t, Ur as kw_get_bool, Wr as kw_get_dict, Kr as kw_get_dict_value, Fr as kw_get_int, xr as kw_get_list, el as kw_get_local_storage_value, Mr as kw_get_pointer, Gr as kw_get_real, Vr as kw_get_str, Cr as kw_has_key, qr as kw_match_simple, kr as kw_pop, nl as kw_remove_local_storage_value, Qr as kw_select, Yr as kw_set_dict_value, tl as kw_set_local_storage_value, Br as kw_set_subdict_value, ll as kwid_collect, il as kwid_find_one_record, sl as kwid_get_ids, rl as kwid_match_id, ol as kwid_new_dict, al as list2options, Tl as load_json_file, Jn as log_debug, xn as log_error, Bn as log_info, Yn as log_warning, El as msg_iev_get_msg_type, pl as msg_iev_get_stack, bl as msg_iev_push_stack, gl as msg_iev_read_key, ml as msg_iev_set_msg_type, dl as msg_iev_write_key, Kl as node_uuid, Nr as parseBoolean, Ul as parseSVG, Fl as refresh_language, ni as register_c_ievent_cli, No as register_c_timer, Co as register_c_yuno, kl as safeSrc, v as sdata_flag_t, hl as send_http_json_post, Pn as set_console_log_enabled, Fn as set_console_log_filter, Cn as set_log_callback, Wn as set_remote_log_functions, Ro as set_timeout, jo as set_timeout_periodic, t as sprintf, i as stats_parser, _l as str_in_list, wr as strcasecmp, jr as strcmp, Rr as strncmp, cl as strs_in_list, Ar as strstr, Eo as template_get_field_desc, Gl as timeTracker, Hn as trace_json, B as trace_level_t, qn as trace_msg, _o as treedb_decoder_fkey, fo as treedb_decoder_hook, co as treedb_encoder_fkey, mo as treedb_get_field_desc, uo as treedb_hook_data_size, n as vsprintf, F as walk_type_t };
|
|
3237
3240
|
|
|
3238
3241
|
//# sourceMappingURL=gobj-js.es.min.js.map
|