@yuneta/gobj-js 7.16.6 → 7.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +63 -10
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +310 -299
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +63 -11
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +280 -268
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +63 -10
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +98 -87
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +63 -10
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +218 -207
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.iife.min.js
CHANGED
|
@@ -170,11 +170,11 @@ var gobjJs = function(e) {
|
|
|
170
170
|
constructor(e, t, n = 0, r = null, o = "", i = null, l = null, s = 0, _ = null, a = null, u = null) {
|
|
171
171
|
this.type = e, this.name = t, this.alias = i, this.flag = n, this.default_value = r, this.header = l, this.fillspace = s, this.description = o, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
172
172
|
}
|
|
173
|
-
}, j = () => new y(0, null), v = (e, t, n, r, o) => new y(e, t, n, r, o),
|
|
173
|
+
}, j = () => new y(0, null), v = (e, t, n, r, o) => new y(e, t, n, r, o), O = class {
|
|
174
174
|
constructor(e, t, n, r, o, i, l, s, _) {
|
|
175
175
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = o, this.authz_table = i, this.command_table = l, this.s_user_trace_level = s, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
176
176
|
}
|
|
177
|
-
},
|
|
177
|
+
}, S = class {
|
|
178
178
|
constructor(e, t, n, r, o) {
|
|
179
179
|
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(o) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = en(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
180
180
|
}
|
|
@@ -318,7 +318,7 @@ var gobjJs = function(e) {
|
|
|
318
318
|
]
|
|
319
319
|
], F = 0, G = 0, V = 0;
|
|
320
320
|
function M(e, t) {
|
|
321
|
-
if (
|
|
321
|
+
if (On(e)) return 268369920;
|
|
322
322
|
if (/^[0-9]+$/.test(String(e))) {
|
|
323
323
|
const t = Number(e);
|
|
324
324
|
if (t) return t;
|
|
@@ -380,7 +380,7 @@ var gobjJs = function(e) {
|
|
|
380
380
|
r = String(o);
|
|
381
381
|
break;
|
|
382
382
|
case T.DTP_BOOLEAN:
|
|
383
|
-
r =
|
|
383
|
+
r = Sn(o);
|
|
384
384
|
break;
|
|
385
385
|
case T.DTP_INTEGER:
|
|
386
386
|
r = parseInt(o), isNaN(r) && qt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
@@ -430,7 +430,7 @@ var gobjJs = function(e) {
|
|
|
430
430
|
}
|
|
431
431
|
break;
|
|
432
432
|
case T.DTP_BOOLEAN:
|
|
433
|
-
o =
|
|
433
|
+
o = Sn(r);
|
|
434
434
|
break;
|
|
435
435
|
case T.DTP_INTEGER:
|
|
436
436
|
o = parseInt(r), isNaN(o) && qt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
@@ -476,7 +476,7 @@ var gobjJs = function(e) {
|
|
|
476
476
|
return ot(e, t) ? X(e) : e && e.bottom_gobj ? Z(e.bottom_gobj, t, n) : (n && qt(`GClass Attribute NOT FOUND: ${Ve(e)}, attr ${t}`), null);
|
|
477
477
|
}
|
|
478
478
|
function ee(e, t, n) {
|
|
479
|
-
if (!(e && e instanceof
|
|
479
|
+
if (!(e && e instanceof O)) return n && qt("gclass NULL"), null;
|
|
480
480
|
if (!t) return e.attrs_table;
|
|
481
481
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
482
482
|
const r = e.attrs_table[n];
|
|
@@ -485,27 +485,27 @@ var gobjJs = function(e) {
|
|
|
485
485
|
return n && qt(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
486
486
|
}
|
|
487
487
|
function te(e, t, n, r, o, i, l, s, _, a, u) {
|
|
488
|
-
if (
|
|
488
|
+
if (On(e)) return qt("gclass_name EMPTY"), null;
|
|
489
489
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return qt(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
490
490
|
if (ce(e)) return qt(`GClass ALREADY exists: ${e}`), null;
|
|
491
|
-
let c = new
|
|
491
|
+
let c = new O(e, r, o, i, l, s, _, a, u);
|
|
492
492
|
(function(e, t) {
|
|
493
|
-
e && e instanceof
|
|
493
|
+
e && e instanceof O ? t ? d[t] ? qt(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : qt("gclass_name undefined") : qt("gclass undefined");
|
|
494
494
|
})(c, e);
|
|
495
495
|
const f = n.length;
|
|
496
496
|
for (let e = 0; e < f; e++) {
|
|
497
497
|
let t = n[e][0], r = n[e][1];
|
|
498
|
-
if (
|
|
498
|
+
if (On(t)) continue;
|
|
499
499
|
if (ie(c, t) < 0) return ne(c), null;
|
|
500
500
|
const o = r.length;
|
|
501
501
|
for (let e = 0; e < o; e++) {
|
|
502
502
|
let n = r[e][0], o = r[e][1], i = r[e][2];
|
|
503
|
-
|
|
503
|
+
On(n) || le(c, t, n, o, i);
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
for (let e = 0; e < t.length; e++) {
|
|
507
507
|
let n = t[e][0], r = t[e][1];
|
|
508
|
-
if (!
|
|
508
|
+
if (!On(n)) {
|
|
509
509
|
if (ae(c, n)) return qt(`SMachine: event repeated in input_events: ${n}`), ne(c), null;
|
|
510
510
|
_e(c, n, r);
|
|
511
511
|
}
|
|
@@ -520,7 +520,7 @@ var gobjJs = function(e) {
|
|
|
520
520
|
let t;
|
|
521
521
|
if (En(e)) t = e;
|
|
522
522
|
else {
|
|
523
|
-
if (!(e instanceof
|
|
523
|
+
if (!(e instanceof O)) return qt("Cannot unregister gclass, type unknown"), -1;
|
|
524
524
|
t = e.gclass_name;
|
|
525
525
|
}
|
|
526
526
|
let n = d[t];
|
|
@@ -543,22 +543,22 @@ var gobjJs = function(e) {
|
|
|
543
543
|
return null;
|
|
544
544
|
}
|
|
545
545
|
function ie(e, t) {
|
|
546
|
-
return e instanceof
|
|
546
|
+
return e instanceof O ? re(e, t) ? (qt(`state already exists: ${t}`), -1) : (e.dl_states.push(new I(t)), 0) : (qt("Cannot add state, typeof not GClass"), -1);
|
|
547
547
|
}
|
|
548
548
|
function le(e, t, n, r, o) {
|
|
549
|
-
if (!(e instanceof
|
|
550
|
-
if (
|
|
549
|
+
if (!(e instanceof O)) return qt("Cannot add state, typeof not GClass"), -1;
|
|
550
|
+
if (On(t)) return qt("state_name EMPTY"), -1;
|
|
551
551
|
let i = re(e, t);
|
|
552
552
|
return i ? oe(i, n) ? (qt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new k(n, r, o)), 0) : (qt(`state not found: ${t}`), -1);
|
|
553
553
|
}
|
|
554
554
|
function se(e, t, n) {
|
|
555
|
-
|
|
555
|
+
On(t) || e.push(new $(t, n));
|
|
556
556
|
}
|
|
557
557
|
function _e(e, t, n) {
|
|
558
|
-
return e instanceof
|
|
558
|
+
return e instanceof O ? se(e.dl_events, t, n) : (qt("Cannot add state, typeof not GClass"), -1);
|
|
559
559
|
}
|
|
560
560
|
function ae(e, t) {
|
|
561
|
-
if (!(e instanceof
|
|
561
|
+
if (!(e instanceof O)) return qt("Cannot add state, typeof not GClass"), 0;
|
|
562
562
|
const n = e.dl_events.length, r = e.dl_events;
|
|
563
563
|
for (let e = 0; e < n; e++) {
|
|
564
564
|
let n = r[e];
|
|
@@ -567,23 +567,23 @@ var gobjJs = function(e) {
|
|
|
567
567
|
return null;
|
|
568
568
|
}
|
|
569
569
|
function ue(e) {
|
|
570
|
-
if (!(e instanceof
|
|
570
|
+
if (!(e instanceof O)) return qt("Cannot add state, typeof not GClass"), -1;
|
|
571
571
|
let t = 0;
|
|
572
572
|
dn(e.dl_states) || (qt(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
573
573
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
574
574
|
let r = e.dl_states[n];
|
|
575
|
-
if (!
|
|
575
|
+
if (!On(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
576
576
|
let o = r.dl_actions[n];
|
|
577
|
-
|
|
577
|
+
On(o.event_name) || (ae(e, o.event_name) || (qt(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${o.event_name}`), t += -1), o.next_state && (re(e, o.next_state) || (qt(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
581
581
|
let r = e.dl_events[n];
|
|
582
|
-
if (!
|
|
582
|
+
if (!On(r.event_name) && (Tn(r.event_flag) || (qt(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & D.EVF_OUTPUT_EVENT))) {
|
|
583
583
|
let n = !1;
|
|
584
584
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
585
585
|
let o = e.dl_states[t];
|
|
586
|
-
|
|
586
|
+
On(o.state_name) || oe(o, r.event_name) && (n = !0);
|
|
587
587
|
}
|
|
588
588
|
n || (qt(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
589
589
|
}
|
|
@@ -636,7 +636,7 @@ var gobjJs = function(e) {
|
|
|
636
636
|
i |= w.gobj_flag_service;
|
|
637
637
|
} else {
|
|
638
638
|
if (!o) return qt("gobj NEEDS a parent!"), null;
|
|
639
|
-
if (!("string" == typeof o || o instanceof
|
|
639
|
+
if (!("string" == typeof o || o instanceof S)) return qt(`BAD TYPE of parent: ${o}`), null;
|
|
640
640
|
if (En(o) && !(o = ge(o))) return zt(`parent service not found: ${o}`), null;
|
|
641
641
|
}
|
|
642
642
|
if (i & w.gobj_flag_service && ge(e, !1)) return qt(`service ALREADY registered: ${t}^${e}`), null;
|
|
@@ -644,15 +644,15 @@ var gobjJs = function(e) {
|
|
|
644
644
|
if (m) return qt(`default service ALREADY registered: ${t}^${e}`), null;
|
|
645
645
|
i |= w.gobj_flag_service;
|
|
646
646
|
}
|
|
647
|
-
if (
|
|
647
|
+
if (On(t)) return qt("gclass_name must be a string"), null;
|
|
648
648
|
let l = ce(t, !1);
|
|
649
649
|
if (!l) return qt(`GClass not registered: ${t}^${e}`), null;
|
|
650
650
|
if (!En(e)) return qt(`gobj_name must be a string: ${t}`), null;
|
|
651
|
-
if (!
|
|
651
|
+
if (!On(e)) {
|
|
652
652
|
if (e.includes("`")) return qt(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
653
653
|
if (e.includes("^")) return qt(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
654
654
|
}
|
|
655
|
-
let _ = new
|
|
655
|
+
let _ = new S(e, l, r, o, i);
|
|
656
656
|
_.jn_attrs = q(_, l.attrs_table);
|
|
657
657
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
658
658
|
let a = Y(_);
|
|
@@ -663,7 +663,7 @@ var gobjJs = function(e) {
|
|
|
663
663
|
}
|
|
664
664
|
function ye(e) {
|
|
665
665
|
if (Ye(e)) return void qt("gobj NULL or DESTROYED");
|
|
666
|
-
e.__refs__ > 0 && qt(`${Ve(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (qt(`Destroying a PLAYING gobj: ${Me(e)}`), De(e)), e.running && (qt(`Destroying a RUNNING gobj: ${Me(e)}`),
|
|
666
|
+
e.__refs__ > 0 && qt(`${Ve(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (qt(`Destroying a PLAYING gobj: ${Me(e)}`), De(e)), e.running && (qt(`Destroying a RUNNING gobj: ${Me(e)}`), Se(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
667
667
|
if (0 === ht.length) return;
|
|
668
668
|
for (let t of ht) t.src === e && (t.src = null);
|
|
669
669
|
ht = ht.filter((t) => t.dst !== e);
|
|
@@ -693,10 +693,10 @@ var gobjJs = function(e) {
|
|
|
693
693
|
function ve(e, t, n) {
|
|
694
694
|
return e.gclass.gclass_flag & N.gcflag_manual_start || Ye(e) || Ae(e) || ke(e) || je(e), 0;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Oe(e, t, n) {
|
|
697
697
|
return e.gclass.gclass_flag & N.gcflag_manual_start || ke(e) ? 1 : (Ae(e) || je(e), 0);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Se(e) {
|
|
700
700
|
if (Ye(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
701
701
|
if (!e.running) return qt(`${Ve(e)}: GObj NOT RUNNING`), -1;
|
|
702
702
|
e.playing && (zt(`${Ve(e)}: GObj stopping without previous pause`), De(e)), B(e) && L(n("⏹ ⏹ stop: %s", Me(e))), e.running = !1;
|
|
@@ -704,7 +704,7 @@ var gobjJs = function(e) {
|
|
|
704
704
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
705
705
|
}
|
|
706
706
|
function Ne(e, t, n) {
|
|
707
|
-
return Ae(e) &&
|
|
707
|
+
return Ae(e) && Se(e), 0;
|
|
708
708
|
}
|
|
709
709
|
function we(e) {
|
|
710
710
|
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, A.WALK_FIRST2LAST, Ne, 0, 0);
|
|
@@ -877,7 +877,7 @@ var gobjJs = function(e) {
|
|
|
877
877
|
return i ? (n.splice(0, 1), n = n.join("`"), rt(i, n)) : null;
|
|
878
878
|
}
|
|
879
879
|
function ot(e, t) {
|
|
880
|
-
return !
|
|
880
|
+
return !On(t) && !!ee(e.gclass, t, !1);
|
|
881
881
|
}
|
|
882
882
|
function it(e, t, n) {
|
|
883
883
|
let r = e.jn_attrs;
|
|
@@ -932,7 +932,7 @@ var gobjJs = function(e) {
|
|
|
932
932
|
}
|
|
933
933
|
function ft(e, t, n) {
|
|
934
934
|
let r = Z(e, t, !1);
|
|
935
|
-
return r ? (r[t] =
|
|
935
|
+
return r ? (r[t] = Sn(n), pn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (qt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
936
936
|
}
|
|
937
937
|
function gt(e, t, n) {
|
|
938
938
|
let r = Z(e, t, !1);
|
|
@@ -987,7 +987,7 @@ var gobjJs = function(e) {
|
|
|
987
987
|
return ht.length > 0 && !yt && (yt = !0, setTimeout(jt, 0)), t;
|
|
988
988
|
}
|
|
989
989
|
function vt(e, t, r, o) {
|
|
990
|
-
if (!(e && e instanceof
|
|
990
|
+
if (!(e && e instanceof S)) return qt("gobj dst NULL"), -1;
|
|
991
991
|
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return qt("gobj dst DESTROYED"), -1;
|
|
992
992
|
let i = e.current_state;
|
|
993
993
|
if (!i) return qt(`${Ve(e)}: current_state NULL`), -1;
|
|
@@ -1010,10 +1010,10 @@ var gobjJs = function(e) {
|
|
|
1010
1010
|
} finally {}
|
|
1011
1011
|
return !l || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ge(e), Fe(e), e.current_state.state_name, t || "", Tn(_) ? _ : 0)), E--, _;
|
|
1012
1012
|
}
|
|
1013
|
-
var
|
|
1013
|
+
var Ot = Object.freeze({
|
|
1014
1014
|
__hard_subscription__: 1,
|
|
1015
1015
|
__own_event__: 2
|
|
1016
|
-
}),
|
|
1016
|
+
}), St = [
|
|
1017
1017
|
v(T.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1018
1018
|
v(T.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1019
1019
|
v(T.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1060,7 +1060,7 @@ var gobjJs = function(e) {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
function Dt(e, t, r, o) {
|
|
1062
1062
|
let i = Pn(e, t, "publisher", null, Lt.KW_REQUIRED), l = Pn(e, t, "subscriber", null, Lt.KW_REQUIRED), s = Ln(e, t, "event", "", Lt.KW_REQUIRED);
|
|
1063
|
-
if (!!(Cn(e, t, "subs_flag", null, Lt.KW_REQUIRED) &
|
|
1063
|
+
if (!!(Cn(e, t, "subs_flag", null, Lt.KW_REQUIRED) & Ot.__hard_subscription__) && !r) return -1;
|
|
1064
1064
|
p && st(p, "trace_subscriptions") && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Ve(i), Ve(l))), Zt(t)), i.obflag & R.obflag_destroyed || o || i.gclass.gmt.mt_subscription_deleted && i.gclass.gmt.mt_subscription_deleted(i, t);
|
|
1065
1065
|
let _ = Rt(i.dl_subscriptions, i, s, t, l);
|
|
1066
1066
|
return _ >= 0 ? fn(i.dl_subscriptions, _) : (qt(`${Ve(e)}: subscription in publisher not found`), Zt(t)), _ = Rt(l.dl_subscribings, i, s, t, l), _ >= 0 ? fn(l.dl_subscribings, _) : (qt(`${Ve(e)}: subscription in subscriber not found`), Zt(t)), 0;
|
|
@@ -1077,12 +1077,12 @@ var gobjJs = function(e) {
|
|
|
1077
1077
|
]);
|
|
1078
1078
|
if (Object.keys(r).forEach((n) => {
|
|
1079
1079
|
i.has(n) || qt(`${Ve(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1080
|
-
}),
|
|
1080
|
+
}), On(t)) t = "";
|
|
1081
1081
|
else if (!(Tt(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Ve(e)}, ${t}`), 0;
|
|
1082
1082
|
let l = wt(e.dl_subscriptions, e, t, r, o);
|
|
1083
1083
|
dn(l) > 0 && (qt(`${Ve(e)}: ${dn(l)} subscription(s) REPEATED, will be deleted and override`), Zt(l, "subscription REPEATED"), kt(e, l, !1));
|
|
1084
1084
|
let s = function(e, t, n, r) {
|
|
1085
|
-
let o = q(e,
|
|
1085
|
+
let o = q(e, St);
|
|
1086
1086
|
an(o, "event", t), an(o, "subscriber", r), an(o, "publisher", e);
|
|
1087
1087
|
let i = 0;
|
|
1088
1088
|
if (n) {
|
|
@@ -1091,14 +1091,14 @@ var gobjJs = function(e) {
|
|
|
1091
1091
|
let n = en(t);
|
|
1092
1092
|
if (an(o, "__config__", n), An(n, "__hard_subscription__")) {
|
|
1093
1093
|
let t = $n(e, n, "__hard_subscription__", !1);
|
|
1094
|
-
sn(n, "__hard_subscription__"), t && (i |=
|
|
1094
|
+
sn(n, "__hard_subscription__"), t && (i |= Ot.__hard_subscription__);
|
|
1095
1095
|
}
|
|
1096
1096
|
if (An(n, "__own_event__")) {
|
|
1097
1097
|
let t = $n(e, n, "__own_event__", !1);
|
|
1098
|
-
sn(n, "__own_event__"), t && (i |=
|
|
1098
|
+
sn(n, "__own_event__"), t && (i |= Ot.__own_event__);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
bn(l) > 0 && an(o, "__local__", en(l)), bn(s) > 0 && an(o, "__filter__", en(s)),
|
|
1101
|
+
bn(l) > 0 && an(o, "__local__", en(l)), bn(s) > 0 && an(o, "__filter__", en(s)), On(_) || an(o, "__service__", _);
|
|
1102
1102
|
}
|
|
1103
1103
|
return an(o, "subs_flag", i), o;
|
|
1104
1104
|
}(e, t, r, o);
|
|
@@ -1122,7 +1122,7 @@ var gobjJs = function(e) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
function Ct(e, t, r) {
|
|
1124
1124
|
if (pn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return qt("gobj NULL or DESTROYED"), -1;
|
|
1125
|
-
if (
|
|
1125
|
+
if (On(t)) return qt(`${Ve(e)}: event EMPTY`), -1;
|
|
1126
1126
|
let o = mt(e, t, !0);
|
|
1127
1127
|
if (!(o && o.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Ve(e)}, ev ${t}`), -1;
|
|
1128
1128
|
let i = p && st(p, "trace_subscriptions");
|
|
@@ -1141,7 +1141,7 @@ var gobjJs = function(e) {
|
|
|
1141
1141
|
let u = Pn(e, a, "subscriber", null, Lt.KW_REQUIRED);
|
|
1142
1142
|
if (!u || Ye(u)) continue;
|
|
1143
1143
|
let c = Cn(e, a, "subs_flag", 0, Lt.KW_REQUIRED), f = Ln(e, a, "event", "", Lt.KW_REQUIRED);
|
|
1144
|
-
if (
|
|
1144
|
+
if (On(f) || 0 === wn(f, t)) {
|
|
1145
1145
|
Un(e, a, "__config__", null, 0);
|
|
1146
1146
|
let o = Un(e, a, "__global__", null, 0), l = Un(e, a, "__local__", null, 0), f = Fn(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1147
1147
|
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : bn(f) > 0 && (d = Wn(g, f) ? 1 : 0, i && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", Ve(u), Ve(e))), Zt(f))), d < 0) break;
|
|
@@ -1150,7 +1150,7 @@ var gobjJs = function(e) {
|
|
|
1150
1150
|
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !Et(u, b.event_name, 0)) continue;
|
|
1151
1151
|
l && Dn(g, l), o && nn(g, o), i && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", t || "", u.running ? "" : "!!", Ve(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Ve(u), pt(u), t || "", e && !e.running ? "!!" : "", Ve(e))), gn(g) && Zt(g));
|
|
1152
1152
|
let p = vt(u, t, g, e);
|
|
1153
|
-
if (p < 0 && c &
|
|
1153
|
+
if (p < 0 && c & Ot.__own_event__) {
|
|
1154
1154
|
s = -1;
|
|
1155
1155
|
break;
|
|
1156
1156
|
}
|
|
@@ -1337,12 +1337,12 @@ var gobjJs = function(e) {
|
|
|
1337
1337
|
return "function" == typeof e;
|
|
1338
1338
|
}
|
|
1339
1339
|
function vn(e) {
|
|
1340
|
-
return e instanceof
|
|
1340
|
+
return e instanceof S;
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function On(e) {
|
|
1343
1343
|
return !En(e) || 0 === e.length;
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function Sn(e) {
|
|
1346
1346
|
return Tn(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1347
1347
|
}
|
|
1348
1348
|
function Nn(e, t) {
|
|
@@ -1387,7 +1387,7 @@ var gobjJs = function(e) {
|
|
|
1387
1387
|
let n = e.lastIndexOf(t);
|
|
1388
1388
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1389
1389
|
}(n, "`");
|
|
1390
|
-
return
|
|
1390
|
+
return On(o) ? sn(t, n) : sn(kn(e, t, r, !0), o), 0;
|
|
1391
1391
|
}
|
|
1392
1392
|
function $n(e, t, n, r, o) {
|
|
1393
1393
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
@@ -1489,14 +1489,14 @@ var gobjJs = function(e) {
|
|
|
1489
1489
|
i = !1;
|
|
1490
1490
|
for (let l = 0; l < t.length; l++) {
|
|
1491
1491
|
let s = t[l];
|
|
1492
|
-
if (o =
|
|
1492
|
+
if (o = On(r) ? n("%s", r) : n("%s`%d", r, l), i = Mn(e, s, o), i) break;
|
|
1493
1493
|
}
|
|
1494
1494
|
} else if (pn(t)) {
|
|
1495
1495
|
i = !0;
|
|
1496
1496
|
let l = Object.keys(t);
|
|
1497
1497
|
for (let s = 0; s < l.length; s++) {
|
|
1498
1498
|
let _ = l[s], a = t[_];
|
|
1499
|
-
if (o =
|
|
1499
|
+
if (o = On(r) ? n("%s", _) : n("%s`%s", r, _), mn(a) || pn(a)) {
|
|
1500
1500
|
if (i = Mn(e, a, o), !i) break;
|
|
1501
1501
|
continue;
|
|
1502
1502
|
}
|
|
@@ -1519,7 +1519,7 @@ var gobjJs = function(e) {
|
|
|
1519
1519
|
function Kn(e, t, n, r) {
|
|
1520
1520
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
1521
1521
|
let o = {};
|
|
1522
|
-
if (En(n) && !
|
|
1522
|
+
if (En(n) && !On(n)) {
|
|
1523
1523
|
let i = n;
|
|
1524
1524
|
t.hasOwnProperty(i) ? o[i] = t[i] : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
1525
1525
|
} else if (pn(n) && gn(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? o[i] = t[i] : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
@@ -1534,7 +1534,7 @@ var gobjJs = function(e) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
function xn(e, t, n, r) {
|
|
1536
1536
|
let o = {};
|
|
1537
|
-
if (nn(o, t), En(n) && !
|
|
1537
|
+
if (nn(o, t), En(n) && !On(n)) {
|
|
1538
1538
|
let i = n;
|
|
1539
1539
|
Fn(e, t, i, 0, 0) ? sn(o, i) : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
1540
1540
|
} else if (pn(n) && gn(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? sn(o, i) : r && qt(`${Ve(e)}: key not found: ${i}`);
|
|
@@ -1652,7 +1652,7 @@ var gobjJs = function(e) {
|
|
|
1652
1652
|
return o ? 0 === o.length ? (r && qt(`stack empty: ${n}`), null) : o[0] : (r && qt(`stack NOT FOUND: ${n}`), null);
|
|
1653
1653
|
}
|
|
1654
1654
|
function nr(e, t, n) {
|
|
1655
|
-
return
|
|
1655
|
+
return On(n) ? In(e, t, "__md_iev__`__msg_type__") : Vn(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1656
1656
|
}
|
|
1657
1657
|
function rr(e, t) {
|
|
1658
1658
|
return Ln(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
@@ -1900,12 +1900,12 @@ var gobjJs = function(e) {
|
|
|
1900
1900
|
}
|
|
1901
1901
|
return t.is_file && (t.type = "file"), t;
|
|
1902
1902
|
}
|
|
1903
|
-
var
|
|
1903
|
+
var Or = [
|
|
1904
1904
|
v(T.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1905
1905
|
v(T.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1906
1906
|
v(T.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1907
1907
|
j()
|
|
1908
|
-
],
|
|
1908
|
+
], Sr = {
|
|
1909
1909
|
periodic: !1,
|
|
1910
1910
|
msec: 0,
|
|
1911
1911
|
timer_id: -1
|
|
@@ -1914,7 +1914,7 @@ var gobjJs = function(e) {
|
|
|
1914
1914
|
let o = e.priv, i = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1915
1915
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1916
1916
|
vt(e, "EV_TIMEOUT", {}, e);
|
|
1917
|
-
}, o.msec) : o.timer_id = -1, xe(e) ? vt(We(e), i, {}, e) : Ct(e, i, {}), o.periodic || -1 !== o.timer_id || Ae(e) &&
|
|
1917
|
+
}, o.msec) : o.timer_id = -1, xe(e) ? vt(We(e), i, {}, e) : Ct(e, i, {}), o.periodic || -1 !== o.timer_id || Ae(e) && Se(e), 0;
|
|
1918
1918
|
}
|
|
1919
1919
|
var Rr = {
|
|
1920
1920
|
mt_create: function(e) {
|
|
@@ -1930,7 +1930,7 @@ var gobjJs = function(e) {
|
|
|
1930
1930
|
break;
|
|
1931
1931
|
case "msec": n.msec = _t(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1932
1932
|
vt(e, "EV_TIMEOUT", {}, e);
|
|
1933
|
-
}, n.msec)), n.msec > 0 ? Ae(e) || je(e) : Ae(e) &&
|
|
1933
|
+
}, n.msec)), n.msec > 0 ? Ae(e) || je(e) : Ae(e) && Se(e);
|
|
1934
1934
|
}
|
|
1935
1935
|
},
|
|
1936
1936
|
mt_start: function(e) {
|
|
@@ -1942,13 +1942,13 @@ var gobjJs = function(e) {
|
|
|
1942
1942
|
mt_destroy: function(e) {}
|
|
1943
1943
|
};
|
|
1944
1944
|
function Dr(e, t) {
|
|
1945
|
-
return e instanceof
|
|
1945
|
+
return e instanceof S ? "C_TIMER" !== Ge(e) ? (qt("not C_TIMER GObj"), -1) : (ft(e, "periodic", !1), void gt(e, "msec", t)) : (qt("not GObj TYPE"), -1);
|
|
1946
1946
|
}
|
|
1947
1947
|
function Ar(e, t) {
|
|
1948
|
-
return e instanceof
|
|
1948
|
+
return e instanceof S ? "C_TIMER" !== Ge(e) ? (qt("not C_TIMER GObj"), -1) : (ft(e, "periodic", !0), void gt(e, "msec", t)) : (qt("not GObj TYPE"), -1);
|
|
1949
1949
|
}
|
|
1950
1950
|
function kr(e) {
|
|
1951
|
-
return e instanceof
|
|
1951
|
+
return e instanceof S ? "C_TIMER" !== Ge(e) ? (qt("not C_TIMER GObj"), -1) : void gt(e, "msec", -1) : (qt("not GObj TYPE"), -1);
|
|
1952
1952
|
}
|
|
1953
1953
|
var Ir = [
|
|
1954
1954
|
v(T.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
@@ -2092,11 +2092,11 @@ var gobjJs = function(e) {
|
|
|
2092
2092
|
}
|
|
2093
2093
|
return 0;
|
|
2094
2094
|
}(e, function(e, t) {
|
|
2095
|
-
return
|
|
2095
|
+
return On(e) ? (qt("iev_create() event NULL"), null) : new xr(e, t);
|
|
2096
2096
|
}(t, n));
|
|
2097
2097
|
}
|
|
2098
2098
|
function Br(e, t, n) {
|
|
2099
|
-
return
|
|
2099
|
+
return On(n) && (n = at(e, "wanted_yuno_service")), {
|
|
2100
2100
|
dst_yuno: at(e, "wanted_yuno_name"),
|
|
2101
2101
|
dst_role: at(e, "wanted_yuno_role"),
|
|
2102
2102
|
dst_service: n,
|
|
@@ -2132,7 +2132,7 @@ var gobjJs = function(e) {
|
|
|
2132
2132
|
return er(e, _, Ur, Br(e, Fe(We(e)), null)), nr(e, _, "__identity__"), Dr(t.gobj_timer, _t(e, "timeout_idack")), Yr(e, "EV_IDENTITY_CARD", _);
|
|
2133
2133
|
}
|
|
2134
2134
|
function Hr(e, t) {
|
|
2135
|
-
if (
|
|
2135
|
+
if (On(t.event)) return -1;
|
|
2136
2136
|
let n = {}, r = t.__global__, o = t.__config__, i = t.__filter__, l = t.__service__, s = t.subscriber;
|
|
2137
2137
|
o && (n.__config__ = o), r && (n.__global__ = r), i && (n.__filter__ = i);
|
|
2138
2138
|
return er(e, n, Ur, Br(e, Fe(s), l)), nr(e, n, "__subscribing__"), Yr(e, t.event, n);
|
|
@@ -2243,7 +2243,7 @@ var gobjJs = function(e) {
|
|
|
2243
2243
|
if ("__subscribing__" === _) return -1;
|
|
2244
2244
|
if ("__unsubscribing__" === _) return -1;
|
|
2245
2245
|
if (Et(e, l, D.EVF_PUBLIC_EVENT)) return vt(e, l, s, e), 0;
|
|
2246
|
-
if (!
|
|
2246
|
+
if (!On(c)) {
|
|
2247
2247
|
let t = ge(c, !1);
|
|
2248
2248
|
return t ? Et(t, l, D.EVF_PUBLIC_EVENT) ? (vt(t, l, s, e), 0) : (qt(`${Ve(e)}: Service found but no event or not public, service '${Ve(t)}', ev '${l}'`), -1) : (zt(`${Ve(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
|
|
2249
2249
|
}
|
|
@@ -2321,13 +2321,13 @@ var gobjJs = function(e) {
|
|
|
2321
2321
|
let n = e.priv;
|
|
2322
2322
|
if ("ST_SESSION" !== pt(e) || !n.websocket) return 0;
|
|
2323
2323
|
if (n.inside_on_open) return 0;
|
|
2324
|
-
if (
|
|
2324
|
+
if (On(t.event)) return 0;
|
|
2325
2325
|
let r = {}, o = t.__global__, i = t.__config__, l = t.__filter__, s = t.__service__, _ = t.subscriber;
|
|
2326
2326
|
i && (r.__config__ = i), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
2327
2327
|
return er(e, r, Ur, Br(e, Fe(_), s)), nr(e, r, "__unsubscribing__"), Yr(e, t.event, r, e);
|
|
2328
2328
|
}
|
|
2329
2329
|
};
|
|
2330
|
-
return e.GObj =
|
|
2330
|
+
return e.GObj = S, e.SDATA = v, e.SDATAAUTHZ = (e, t, n, r, o, i) => new y(e, t, n, null, i, r, null, 0, null, o, null), e.SDATACM = (e, t, n, r, o, i) => new y(e, t, 0, null, i, n, null, 0, o, r, null), e.SDATACM2 = (e, t, n, r, o, i, l) => new y(e, t, n, null, l, r, null, 0, i, o, null), e.SDATADF = (e, t, n, r, o, i) => new y(e, t, n, null, i, null, r, o), e.SDATAPM = (e, t, n, r, o) => new y(e, t, n, r, o), e.SDATAPM0 = (e, t, n, r, o) => new y(e, t, n, null, o, null, null, 0, null, null, r), e.SDATA_END = j, e.SDataDesc = y, e.YUNETA_VERSION = l, Object.defineProperty(e, "__yuno__", {
|
|
2331
2331
|
enumerable: !0,
|
|
2332
2332
|
get: function() {
|
|
2333
2333
|
return p;
|
|
@@ -2408,7 +2408,7 @@ var gobjJs = function(e) {
|
|
|
2408
2408
|
return t;
|
|
2409
2409
|
}, e.empty_json = function(e) {
|
|
2410
2410
|
return 0 === bn(e);
|
|
2411
|
-
}, e.empty_string =
|
|
2411
|
+
}, e.empty_string = On, e.escapeHtml = sr, e.event_flag_t = D, e.flat2json = function(e) {
|
|
2412
2412
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2413
2413
|
let t = null;
|
|
2414
2414
|
for (const n of Object.keys(e)) {
|
|
@@ -2491,7 +2491,7 @@ var gobjJs = function(e) {
|
|
|
2491
2491
|
}, e.get_function_name = fr, e.get_now = function() {
|
|
2492
2492
|
return Math.floor(Date.now() / 1e3);
|
|
2493
2493
|
}, e.gobj_bottom_gobj = Be, e.gobj_change_parent = function(e, t) {
|
|
2494
|
-
return Ye(e) ? (qt("gobj NULL or DESTROYED"), null) : t instanceof
|
|
2494
|
+
return Ye(e) ? (qt("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (pe(e.parent, e), e.parent = null), be(t, e), t.mt_child_added && (Y(e) && Qt(n("👦👦🔵 child_added(%s): %s", Me(t), Ve(e))), t.mt_child_added(t, e)), 0) : (qt(`${Ve(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2495
2495
|
}, e.gobj_change_state = bt, e.gobj_command = function(e, t, r, i) {
|
|
2496
2496
|
if (Ye(e)) return qt("gobj NULL or DESTROYED"), -1;
|
|
2497
2497
|
let l = p && _t(p, "tracing");
|
|
@@ -2507,7 +2507,7 @@ var gobjJs = function(e) {
|
|
|
2507
2507
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2508
2508
|
return Te(e, t, n, null, w.gobj_flag_yuno);
|
|
2509
2509
|
}, e.gobj_current_state = pt, e.gobj_default_service = fe, e.gobj_deliver_posted_events = jt, e.gobj_destroy = ye, e.gobj_find_child = nt, e.gobj_find_gobj = function(e, t) {
|
|
2510
|
-
if (
|
|
2510
|
+
if (On(t)) return null;
|
|
2511
2511
|
const n = t.toLowerCase();
|
|
2512
2512
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : rt(p, t);
|
|
2513
2513
|
}, e.gobj_find_service = ge, e.gobj_find_subscribings = $t, e.gobj_find_subscriptions = It, e.gobj_flag_t = w, e.gobj_full_name = Me, e.gobj_gclass_name = Ge, e.gobj_global_trace_level = function() {
|
|
@@ -2554,7 +2554,7 @@ var gobjJs = function(e) {
|
|
|
2554
2554
|
}
|
|
2555
2555
|
}(n, e), n;
|
|
2556
2556
|
}, e.gobj_match_gobj = tt, e.gobj_name = Fe, e.gobj_parent = We, e.gobj_pause = De, e.gobj_play = Re, e.gobj_post_event = function(e, t, r, o) {
|
|
2557
|
-
return e && e instanceof
|
|
2557
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (qt(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : On(t) ? (qt("gobj_post_event(): event EMPTY"), -1) : Et(e, t, 0) ? ht.length >= 1e4 ? (qt(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${ht.length}`), -1) : (ht.push({
|
|
2558
2558
|
dst: e,
|
|
2559
2559
|
event: t,
|
|
2560
2560
|
kw: r,
|
|
@@ -2621,7 +2621,7 @@ var gobjJs = function(e) {
|
|
|
2621
2621
|
}, e.gobj_short_name = Ve, e.gobj_start = je, e.gobj_start_children = function(e) {
|
|
2622
2622
|
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : qe(e, A.WALK_FIRST2LAST, ve, 0, 0);
|
|
2623
2623
|
}, e.gobj_start_tree = function(e) {
|
|
2624
|
-
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", Me(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || je(e), ze(e, A.WALK_TOP2BOTTOM,
|
|
2624
|
+
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", Me(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || je(e), ze(e, A.WALK_TOP2BOTTOM, Oe, 0, 0)));
|
|
2625
2625
|
}, e.gobj_start_up = function(e, t, n, r, o, i, l) {
|
|
2626
2626
|
s = t, _ = n, a = r, u = o, c = i, f = l;
|
|
2627
2627
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -2632,8 +2632,8 @@ var gobjJs = function(e) {
|
|
|
2632
2632
|
return 0;
|
|
2633
2633
|
}, e.gobj_stats = function(e, t, r, o) {
|
|
2634
2634
|
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, o) : f ? f(e, t, r, o) : i(0, -1, n("%s, stats parser not available", Ve(e)), 0, 0);
|
|
2635
|
-
}, e.gobj_stop =
|
|
2636
|
-
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Me(e))), Ae(e) &&
|
|
2635
|
+
}, e.gobj_stop = Se, e.gobj_stop_children = we, e.gobj_stop_tree = function(e) {
|
|
2636
|
+
return Ye(e) ? (qt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Me(e))), Ae(e) && Se(e), ze(e, A.WALK_TOP2BOTTOM, Ne, 0, 0));
|
|
2637
2637
|
}, e.gobj_subscribe_event = At, e.gobj_trace_level = W, e.gobj_trace_machine_format = function() {
|
|
2638
2638
|
return C;
|
|
2639
2639
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
@@ -2648,7 +2648,7 @@ var gobjJs = function(e) {
|
|
|
2648
2648
|
]);
|
|
2649
2649
|
if (Object.keys(n).forEach((n) => {
|
|
2650
2650
|
o.has(n) || qt(`${Ve(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2651
|
-
}),
|
|
2651
|
+
}), On(t)) t = "";
|
|
2652
2652
|
else if (!(Tt(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return qt(`event NOT in output event list: ${Ve(e)}, ev ${t}`), 0;
|
|
2653
2653
|
let i = wt(e.dl_subscriptions, e, t, n, r), l = 0;
|
|
2654
2654
|
for (let t = 0; t < i.length; t++) {
|
|
@@ -2696,9 +2696,9 @@ var gobjJs = function(e) {
|
|
|
2696
2696
|
}, e.is_string = En, e.jdb_delete = function(e, t, n, r) {
|
|
2697
2697
|
let o = Fn(null, Fn(null, e, "topics", null, 0), t, null, 0);
|
|
2698
2698
|
if (!o) return qt("jdb_delete: topic not found: " + t), null;
|
|
2699
|
-
if (
|
|
2699
|
+
if (On(r.id)) return qt("jdb_delete: record without id: " + r), Xt(r), null;
|
|
2700
2700
|
let i, l = n.split("`"), s = o;
|
|
2701
|
-
for (; (i = l.shift()) && !
|
|
2701
|
+
for (; (i = l.shift()) && !On(i) && s;) pn(s) && (s = Fn(null, s, e.hook, null, 0)), s = ir(s, null, i, !1);
|
|
2702
2702
|
if (0 === l.length && s) if (mn(s)) {
|
|
2703
2703
|
let e = zn(s, r.id);
|
|
2704
2704
|
e >= 0 && s.splice(e, 1);
|
|
@@ -2728,9 +2728,9 @@ var gobjJs = function(e) {
|
|
|
2728
2728
|
}, e.jdb_update = function(e, t, n, r) {
|
|
2729
2729
|
let o = Fn(null, Fn(null, e, "topics", null, 0), t, null, 0);
|
|
2730
2730
|
if (!o) return qt("jdb_update: topic not found: " + t), null;
|
|
2731
|
-
if (
|
|
2731
|
+
if (On(r.id)) return qt("jdb_update: record without id: " + r), Xt(r), null;
|
|
2732
2732
|
let i, l = n.split("`"), s = o;
|
|
2733
|
-
for (; (i = l.shift()) && !
|
|
2733
|
+
for (; (i = l.shift()) && !On(i) && s;) pn(s) && (s = Fn(null, s, e.hook, [], 1)), s = ir(s, null, i, !1);
|
|
2734
2734
|
if (0 === l.length && s) if (mn(s)) s.push(r);
|
|
2735
2735
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2736
2736
|
else {
|
|
@@ -2829,14 +2829,14 @@ var gobjJs = function(e) {
|
|
|
2829
2829
|
}, e.kw_set_dict_value = Gn, e.kw_set_local_storage_value = Bn, e.kw_set_subdict_value = Vn, e.kwid_collect = qn, e.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2830
2830
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
2831
2831
|
let i = qn(e, t, n, r, o);
|
|
2832
|
-
return i
|
|
2832
|
+
return i && 0 !== i.length ? i[0] : null;
|
|
2833
2833
|
}, e.kwid_get_ids = function(e, t) {
|
|
2834
2834
|
if (e && !vn(e) && qt("GObj bad instanceof"), !t) return [];
|
|
2835
2835
|
let n = [];
|
|
2836
2836
|
if (En(t)) n.push(t);
|
|
2837
2837
|
else if (pn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2838
2838
|
else mn(t) && t.forEach(function(t) {
|
|
2839
|
-
if (En(t))
|
|
2839
|
+
if (En(t)) On(t) || n.push(t);
|
|
2840
2840
|
else if (pn(t)) {
|
|
2841
2841
|
let r = Ln(e, t, "id", 0, 0);
|
|
2842
2842
|
r && n.push(r);
|
|
@@ -2846,13 +2846,24 @@ var gobjJs = function(e) {
|
|
|
2846
2846
|
}, e.kwid_match_id = Hn, e.kwid_new_dict = function(e, t, n) {
|
|
2847
2847
|
e && !vn(e) && qt("GObj bad instanceof");
|
|
2848
2848
|
let r = {};
|
|
2849
|
-
if (
|
|
2849
|
+
if (On(n) || (t = kn(e, t, n)), pn(t)) r = t;
|
|
2850
2850
|
else if (mn(t)) for (let n = 0; n < t.length; n++) {
|
|
2851
|
-
let o = t[n], i = Ln(e, o, "id", "",
|
|
2852
|
-
|
|
2851
|
+
let o = t[n], i = Ln(e, o, "id", "", Lt.KW_REQUIRED);
|
|
2852
|
+
On(i) || (r[i] = o);
|
|
2853
2853
|
}
|
|
2854
2854
|
else qt(`${Ve(e)} kwid_new_dict: data type unknown`);
|
|
2855
2855
|
return r;
|
|
2856
|
+
}, e.kwid_new_list = function(e, t, n) {
|
|
2857
|
+
if (e && !vn(e) && qt("GObj bad instanceof"), On(n) || (t = kn(e, t, n)), mn(t)) return t;
|
|
2858
|
+
if (pn(t)) {
|
|
2859
|
+
let n = [];
|
|
2860
|
+
for (let r of Object.keys(t)) {
|
|
2861
|
+
let o = t[r];
|
|
2862
|
+
pn(o) ? (o.id = r, n.push(o)) : qt(`${Ve(e)} kwid_new_list: not a record: '${r}'`);
|
|
2863
|
+
}
|
|
2864
|
+
return n;
|
|
2865
|
+
}
|
|
2866
|
+
return qt(`${Ve(e)} kwid_new_list: wrong type for list`), [];
|
|
2856
2867
|
}, e.list2options = function(e, t, n) {
|
|
2857
2868
|
t = t || "id", n = n || "value";
|
|
2858
2869
|
let r = [];
|
|
@@ -2903,7 +2914,7 @@ var gobjJs = function(e) {
|
|
|
2903
2914
|
}, e.log_debug = Qt, e.log_error = qt, e.log_info = function(e) {
|
|
2904
2915
|
let t = Ht(e), n = ar();
|
|
2905
2916
|
Gt && xt("info", t) && Gt("%c" + n + " INFO: " + String(t), "color:cyan"), Bt("info", t, n);
|
|
2906
|
-
}, e.log_warning = zt, e.msg_iev_get_msg_type = rr, e.msg_iev_get_stack = tr, e.msg_iev_push_stack = er, e.msg_iev_read_key = Xn, e.msg_iev_set_msg_type = nr, e.msg_iev_write_key = Zn, e.node_uuid = cr, e.parseBoolean =
|
|
2917
|
+
}, e.log_warning = zt, e.msg_iev_get_msg_type = rr, e.msg_iev_get_stack = tr, e.msg_iev_push_stack = er, e.msg_iev_read_key = Xn, e.msg_iev_set_msg_type = nr, e.msg_iev_write_key = Zn, e.node_uuid = cr, e.parseBoolean = Sn, e.parseSVG = function(e) {
|
|
2907
2918
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2908
2919
|
}, e.refresh_language = function(e, t) {
|
|
2909
2920
|
if (!jn(t)) return void qt("You must supply a translation function");
|
|
@@ -3035,7 +3046,7 @@ var gobjJs = function(e) {
|
|
|
3035
3046
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3036
3047
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3037
3048
|
[0, 0]
|
|
3038
|
-
], t, Rr, 0,
|
|
3049
|
+
], t, Rr, 0, Or, Sr, 0, 0, 0, N.gcflag_manual_start)) ? 0 : -1;
|
|
3039
3050
|
}("C_TIMER");
|
|
3040
3051
|
}, e.register_c_yuno = function() {
|
|
3041
3052
|
return function(e) {
|