@yuneta/gobj-js 7.25.4 → 7.25.6

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.
@@ -210,11 +210,11 @@ var T = class {
210
210
  constructor(e, t, n) {
211
211
  this.event_name = e, this.action = t, this.next_state = n;
212
212
  }
213
- }, A = class {
213
+ }, $ = class {
214
214
  constructor(e) {
215
215
  this.state_name = e, this.dl_actions = [];
216
216
  }
217
- }, $ = class {
217
+ }, A = class {
218
218
  constructor(e, t) {
219
219
  this.event_name = e, this.event_flag = Number(t) || 0;
220
220
  }
@@ -592,7 +592,7 @@ function be(e, t) {
592
592
  return null;
593
593
  }
594
594
  function me(e, t) {
595
- return e instanceof j ? de(e, t) ? (gn(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (gn("Cannot add state, typeof not GClass"), -1);
595
+ return e instanceof j ? de(e, t) ? (gn(`state already exists: ${t}`), -1) : (e.dl_states.push(new $(t)), 0) : (gn("Cannot add state, typeof not GClass"), -1);
596
596
  }
597
597
  function he(e, t, n, r, o) {
598
598
  if (!(e instanceof j)) return gn("Cannot add state, typeof not GClass"), -1;
@@ -601,7 +601,7 @@ function he(e, t, n, r, o) {
601
601
  return s ? be(s, n) ? (gn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new D(n, r, o)), 0) : (gn(`state not found: ${t}`), -1);
602
602
  }
603
603
  function Ee(e, t, n) {
604
- Vn(t) || e.push(new $(t, n));
604
+ Vn(t) || e.push(new A(t, n));
605
605
  }
606
606
  function Te(e, t, n) {
607
607
  return e instanceof j ? Ee(e.dl_events, t, n) : (gn("Cannot add state, typeof not GClass"), -1);
@@ -618,7 +618,7 @@ function ye(e, t) {
618
618
  function ve(e) {
619
619
  if (!(e instanceof j)) return gn("Cannot add state, typeof not GClass"), -1;
620
620
  let t = 0;
621
- An(e.dl_states) || (gn(`GClass without states: ${e.gclass_name}`), t += -1);
621
+ $n(e.dl_states) || (gn(`GClass without states: ${e.gclass_name}`), t += -1);
622
622
  for (let n = 0; n < e.dl_states.length; n++) {
623
623
  let r = e.dl_states[n];
624
624
  if (!Vn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
@@ -670,7 +670,7 @@ function xe(e, t) {
670
670
  function De(e, t) {
671
671
  "__json_config_variables__" !== t && gn(`GClass Attribute NOT FOUND: ${Ze(e)}, attr ${t}`);
672
672
  }
673
- function Ae(e, t, n) {
673
+ function $e(e, t, n) {
674
674
  let r = t;
675
675
  (function(e, t, n, r, o) {
676
676
  if (!e || !t) return gn("hsdata or kw NULL"), -1;
@@ -682,7 +682,7 @@ function Ae(e, t, n) {
682
682
  return s;
683
683
  })(ue(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : De, e) < 0 && (gn(`${Ze(e)} json2data() FAILED`), mn(r));
684
684
  }
685
- function $e(e, n, r, o, s) {
685
+ function Ae(e, n, r, o, s) {
686
686
  if (s & N.gobj_flag_yuno) {
687
687
  if (d) return gn("__yuno__ already created"), null;
688
688
  s |= N.gobj_flag_service;
@@ -708,10 +708,10 @@ function $e(e, n, r, o, s) {
708
708
  _.jn_attrs = ie(_, i.attrs_table);
709
709
  for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
710
710
  let a = K(_);
711
- return a && I(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), _.gobj_flag & N.gobj_flag_service && Ne(_), _.gobj_flag & N.gobj_flag_yuno && (d = _), _.gobj_flag & N.gobj_flag_default_service && (b = _), _.gobj_flag & N.gobj_flag_yuno || we(o, _), _.obflag |= w.obflag_created, _.gclass.instances++, Ae(_, r), _.gobj_flag & N.gobj_flag_service && l && l(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), o && o.gclass.gmt.mt_child_added && (a && I(t("👦👦🔵 child_added(%s): %s", et(o), Ze(_))), o.gclass.gmt.mt_child_added(o, _)), a && I(t("💙💙⏪ created: %s", et(_))), _;
711
+ return a && I(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), _.gobj_flag & N.gobj_flag_service && Ne(_), _.gobj_flag & N.gobj_flag_yuno && (d = _), _.gobj_flag & N.gobj_flag_default_service && (b = _), _.gobj_flag & N.gobj_flag_yuno || we(o, _), _.obflag |= w.obflag_created, _.gclass.instances++, $e(_, r), _.gobj_flag & N.gobj_flag_service && l && l(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), o && o.gclass.gmt.mt_child_added && (a && I(t("👦👦🔵 child_added(%s): %s", et(o), Ze(_))), o.gclass.gmt.mt_child_added(o, _)), a && I(t("💙💙⏪ created: %s", et(_))), _;
712
712
  }
713
713
  function ke(e, t, n, r) {
714
- return $e(e, t, n, r, N.gobj_flag_pure_child);
714
+ return Ae(e, t, n, r, N.gobj_flag_pure_child);
715
715
  }
716
716
  function Ie(e) {
717
717
  if (ot(e)) return void gn("gobj NULL or DESTROYED");
@@ -1029,7 +1029,7 @@ function xt(e, n) {
1029
1029
  function Dt(e) {
1030
1030
  return Gn(e) ? e.current_state.state_name : (gn("hgobj NULL"), "");
1031
1031
  }
1032
- function At(e, t, n) {
1032
+ function $t(e, t, n) {
1033
1033
  if (!Gn(e)) return gn("gobj NULL of bad type"), null;
1034
1034
  let r = ye(e.gclass, t);
1035
1035
  if (r) return r;
@@ -1042,12 +1042,12 @@ function At(e, t, n) {
1042
1042
  }
1043
1043
  return null;
1044
1044
  }
1045
- function $t(e, t, n) {
1046
- let r = At(e, t, !1);
1045
+ function At(e, t, n) {
1046
+ let r = $t(e, t, !1);
1047
1047
  return !!r && !(n && !(r.event_flag & n));
1048
1048
  }
1049
1049
  function kt(e, t, n) {
1050
- let r = At(e, t, !1);
1050
+ let r = $t(e, t, !1);
1051
1051
  return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & R.EVF_OUTPUT_EVENT);
1052
1052
  }
1053
1053
  var It = [], Ct = !1;
@@ -1101,21 +1101,21 @@ var Pt = Object.freeze({
1101
1101
  ];
1102
1102
  function Gt(e, t, n, r, o) {
1103
1103
  let s = er(t, r, "__config__", null), l = er(t, r, "__global__", null), i = er(t, r, "__local__", null), _ = tr(t, r, "__filter__", null), a = !0;
1104
- if (t && t !== Zn(null, e, "publisher", null) && (a = !1), o && o !== Zn(null, e, "subscriber", null) && (a = !1), n && n !== Xn(null, e, "event", "") && (a = !1), $n(s) > 0) {
1104
+ if (t && t !== Zn(null, e, "publisher", null) && (a = !1), o && o !== Zn(null, e, "subscriber", null) && (a = !1), n && n !== Xn(null, e, "event", "") && (a = !1), An(s) > 0) {
1105
1105
  let t = er(null, e, "__config__", null);
1106
- $n(t) > 0 && En(t, s) || (a = !1);
1106
+ An(t) > 0 && En(t, s) || (a = !1);
1107
1107
  }
1108
- if ($n(l) > 0) {
1108
+ if (An(l) > 0) {
1109
1109
  let t = er(null, e, "__global__", null);
1110
- $n(t) > 0 && En(t, l) || (a = !1);
1110
+ An(t) > 0 && En(t, l) || (a = !1);
1111
1111
  }
1112
- if ($n(i) > 0) {
1112
+ if (An(i) > 0) {
1113
1113
  let t = er(null, e, "__local__", null);
1114
- $n(t) > 0 && En(t, i) || (a = !1);
1114
+ An(t) > 0 && En(t, i) || (a = !1);
1115
1115
  }
1116
- if ($n(_) > 0) {
1116
+ if (An(_) > 0) {
1117
1117
  let t = tr(null, e, "__filter__", null);
1118
- $n(t) > 0 && En(t, _) || (a = !1);
1118
+ An(t) > 0 && En(t, _) || (a = !1);
1119
1119
  }
1120
1120
  return a;
1121
1121
  }
@@ -1153,14 +1153,14 @@ function Kt(e, n, r, o) {
1153
1153
  }), Vn(n)) n = "";
1154
1154
  else if (!(kt(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return gn(`event NOT in output event list: ${Ze(e)}, ${n}`), 0;
1155
1155
  let l = Vt(e.dl_subscriptions, e, n, r, o);
1156
- An(l) > 0 && (gn(`${Ze(e)}: ${An(l)} subscription(s) REPEATED, will be deleted and override`), mn(l, "subscription REPEATED"), Yt(e, l, !1));
1156
+ $n(l) > 0 && (gn(`${Ze(e)}: ${$n(l)} subscription(s) REPEATED, will be deleted and override`), mn(l, "subscription REPEATED"), Yt(e, l, !1));
1157
1157
  let i = function(e, t, n, r) {
1158
1158
  let o = ie(e, Ft);
1159
1159
  Nn(o, "event", t), Nn(o, "subscriber", r), Nn(o, "publisher", e);
1160
1160
  let s = 0;
1161
1161
  if (n) {
1162
1162
  let t = er(e, n, "__config__", null), r = er(e, n, "__global__", null), l = er(e, n, "__local__", null), i = tr(e, n, "__filter__", null), _ = Xn(e, n, "__service__", "");
1163
- if ($n(r) > 0 && Nn(o, "__global__", hn(r)), $n(t) > 0) {
1163
+ if (An(r) > 0 && Nn(o, "__global__", hn(r)), An(t) > 0) {
1164
1164
  let n = hn(t);
1165
1165
  if (Nn(o, "__config__", n), Jn(n, "__hard_subscription__")) {
1166
1166
  let t = zn(e, n, "__hard_subscription__", !1);
@@ -1171,7 +1171,7 @@ function Kt(e, n, r, o) {
1171
1171
  Sn(n, "__own_event__"), t && (s |= Pt.__own_event__);
1172
1172
  }
1173
1173
  }
1174
- $n(l) > 0 && Nn(o, "__local__", hn(l)), $n(i) > 0 && Nn(o, "__filter__", hn(i)), Vn(_) || Nn(o, "__service__", _);
1174
+ An(l) > 0 && Nn(o, "__local__", hn(l)), An(i) > 0 && Nn(o, "__filter__", hn(i)), Vn(_) || Nn(o, "__service__", _);
1175
1175
  }
1176
1176
  return Nn(o, "subs_flag", s), o;
1177
1177
  }(e, n, r, o);
@@ -1196,7 +1196,7 @@ function Jt(e, t, n, r) {
1196
1196
  function Ht(e, n, r) {
1197
1197
  if (kn(r) || (r = {}), !e || e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return gn("gobj NULL or DESTROYED"), -1;
1198
1198
  if (Vn(n)) return gn(`${Ze(e)}: event EMPTY`), -1;
1199
- let o = At(e, n, !0);
1199
+ let o = $t(e, n, !0);
1200
1200
  if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return gn(`event NOT in output event list: ${Ze(e)}, ev ${n}`), -1;
1201
1201
  let s = (Y(e) || H(e, n)) && !q(e, n);
1202
1202
  if (s && (I(1 === k ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Ze(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Xe(e), Qe(e), e.current_state.state_name, "", n || "", "")), J(e) && Dn(r) && mn(r)), e.gclass.gmt.mt_publish_event) {
@@ -1217,10 +1217,10 @@ function Ht(e, n, r) {
1217
1217
  if (Vn(f) || 0 === Kn(f, n)) {
1218
1218
  er(e, a, "__config__", null, 0);
1219
1219
  let o = er(e, a, "__global__", null, 0), l = er(e, a, "__local__", null, 0), f = tr(e, a, "__filter__", null, 0), g = r, p = 1;
1220
- if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) : $n(f) > 0 && (p = sr(g, f) ? 1 : 0, s && (I(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Ze(u), Ze(e))), mn(f))), p < 0) break;
1220
+ if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) : An(f) > 0 && (p = sr(g, f) ? 1 : 0, s && (I(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Ze(u), Ze(e))), mn(f))), p < 0) break;
1221
1221
  if (!p) continue;
1222
- let d = At(u, n, !0);
1223
- if (d && d.event_flag & R.EVF_SYSTEM_EVENT && !$t(u, d.event_name, 0)) continue;
1222
+ let d = $t(u, n, !0);
1223
+ if (d && d.event_flag & R.EVF_SYSTEM_EVENT && !At(u, d.event_name, 0)) continue;
1224
1224
  l && Bn(g, l), o && Tn(g, o), s && (I(1 === k ? t("🔝🔄 %s (%s) %s%s", n || "", n || "", u.running ? "" : "!!", Ze(u)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Ze(u), Dt(u), n || "", e && !e.running ? "!!" : "", Ze(e))), J(e) && Dn(g) && mn(g));
1225
1225
  let b = Ut(u, n, g, e);
1226
1226
  if (b < 0 && c & Pt.__own_event__) {
@@ -1397,10 +1397,10 @@ function xn(e, t) {
1397
1397
  function Dn(e) {
1398
1398
  return kn(e) ? Object.keys(e).length : 0;
1399
1399
  }
1400
- function An(e) {
1400
+ function $n(e) {
1401
1401
  return In(e) ? e.length : 0;
1402
1402
  }
1403
- function $n(e) {
1403
+ function An(e) {
1404
1404
  return kn(e) ? Object.keys(e).length : In(e) ? e.length : Cn(e) && e.length > 0 ? 1 : 0;
1405
1405
  }
1406
1406
  function kn(e) {
@@ -1461,13 +1461,17 @@ function Jn(e, t) {
1461
1461
  return !(!(t in e) || !e.hasOwnProperty(t));
1462
1462
  }
1463
1463
  function Hn(e, t, n, r) {
1464
- if (e && !Gn(e) && gn("GObj bad instanceof"), !kn(t) && !In(t)) return gn(`${Ze(e)}: kw must be list or dict`), 0;
1465
- if (!Cn(n)) return gn(`${Ze(e)}: path must be a string: ${String(n)}`), 0;
1466
- let o = n.split("`");
1467
- if (o.length <= 1) return t[n];
1468
- let s = o.length;
1469
- for (let l = 0; l < s; l++) if (void 0 === (t = t[o[l]])) return void (r && gn(`${Ze(e)}: path not found: ${String(n)}`));
1470
- return t;
1464
+ e && !Gn(e) && gn("GObj bad instanceof");
1465
+ const o = e ? `${Ze(e)}: ` : "";
1466
+ if (!kn(t) && !In(t)) return void gn(`${o}kw must be list or dict: '${String(n)}'`);
1467
+ if (!Cn(n)) return void gn(`${o}path must be a string: ${String(n)}`);
1468
+ let s = n.split("`"), l = s.length;
1469
+ for (let e = 0; e < l - 1; e++) {
1470
+ if (null == (t = t[s[e]])) return void (r && gn(`${o}path not found: '${n}'`));
1471
+ if (!kn(t) && !In(t)) return void gn(`${o}kw must be list or dict: '${n}'`);
1472
+ }
1473
+ let i = t[s[l - 1]];
1474
+ return void 0 === i && r && gn(`${o}path not found: '${n}'`), i;
1471
1475
  }
1472
1476
  function qn(e, t, n) {
1473
1477
  e && !Gn(e) && gn("GObj bad instanceof");
@@ -1482,7 +1486,7 @@ function zn(e, t, n, r, o) {
1482
1486
  let s = Hn(e, t, n, !1);
1483
1487
  const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT, a = o && o & qt.KW_WILD_NUMBER;
1484
1488
  if (void 0 === s) {
1485
- if (i) {
1489
+ if (i && t) {
1486
1490
  let o = Boolean(r);
1487
1491
  return nr(e, t, n, o), o;
1488
1492
  }
@@ -1491,7 +1495,7 @@ function zn(e, t, n, r, o) {
1491
1495
  let u;
1492
1496
  if (Un(s)) u = s;
1493
1497
  else if (a && Ln(s)) u = 0 !== s;
1494
- else if (a && Cn(s)) u = "true" === s.toLowerCase() || "false" !== s.toLowerCase() && 0 !== (parseInt(s) || 0);
1498
+ else if (a && Cn(s)) u = "true" === s.toLowerCase() || "false" !== s.toLowerCase() && 0 !== (parseInt(s, 10) || 0);
1495
1499
  else {
1496
1500
  if (!a || null !== s) return a ? (gn(`${e ? Ze(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), mn(t), !1) : (gn(`${e ? Ze(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), mn(t), Boolean(r));
1497
1501
  u = !1;
@@ -1503,7 +1507,7 @@ function Qn(e, t, n, r, o) {
1503
1507
  let s = Hn(e, t, n, !1);
1504
1508
  const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT, a = o && o & qt.KW_WILD_NUMBER;
1505
1509
  if (void 0 === s) {
1506
- if (i) {
1510
+ if (i && t) {
1507
1511
  let o = parseInt(r);
1508
1512
  return nr(e, t, n, o), o;
1509
1513
  }
@@ -1531,7 +1535,14 @@ function Xn(e, t, n, r, o) {
1531
1535
  e && !Gn(e) && gn("GObj bad instanceof");
1532
1536
  let s = Hn(e, t, n, !1);
1533
1537
  const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
1534
- return void 0 === s ? i ? (nr(e, t, n, Cn(r) ? r : null), r) : (l && (gn(`path not found: '${n}'`), mn(t)), r) : Cn(s) ? (_ && qn(e, t, n), s) : (l && (gn(`${Ze(e)}: path value MUST BE a string: ${n}`), bn(t)), r);
1538
+ return void 0 === s ? i && t ? (nr(e, t, n, Cn(r) ? r : null), r) : (l && !function(e, t) {
1539
+ let n = Cn(t) ? t.split("`") : [], r = e;
1540
+ for (let e = 0; e < n.length - 1; e++) {
1541
+ if (!kn(r) && !In(r)) return !1;
1542
+ r = r[n[e]];
1543
+ }
1544
+ return !(!kn(r) && !In(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
1545
+ }(t, n) && (gn(`path not found: '${n}'`), mn(t)), r) : Cn(s) ? (_ && qn(e, t, n), s) : (null !== s && (gn(`${e ? Ze(e) + ": " : ""}path MUST BE a json str: '${n}'`), mn(t)), r);
1535
1546
  }
1536
1547
  function Zn(e, t, n, r, o) {
1537
1548
  e && !Gn(e) && gn("GObj bad instanceof");
@@ -1550,7 +1561,7 @@ function er(e, t, n, r, o) {
1550
1561
  e && !Gn(e) && gn("GObj bad instanceof");
1551
1562
  let s = Hn(e, t, n, !1);
1552
1563
  const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
1553
- return void 0 === s ? i && kn(r) && t ? (nr(e, t, n, r), r) : (l && (gn(`path not found: '${n}'`), mn(t)), r) : kn(s) ? (_ && qn(e, t, n), s) : (l && (gn(`${Ze(e)}: path value MUST BE a dict: ${n}`), bn(t)), r);
1564
+ return void 0 === s ? i && kn(r) && t ? (nr(e, t, n, r), r) : (l && (gn(`path not found: '${n}'`), mn(t)), r) : kn(s) ? (_ && qn(e, t, n), s) : (l && (gn(`${e ? Ze(e) + ": " : ""}path MUST BE a json dict: '${n}'`), mn(t)), r);
1554
1565
  }
1555
1566
  function tr(e, t, n, r, o) {
1556
1567
  e && !Gn(e) && gn("GObj bad instanceof");
@@ -1612,7 +1623,7 @@ function or(e, n, r) {
1612
1623
  return s;
1613
1624
  }
1614
1625
  function sr(e, t) {
1615
- return 0 === $n(t) || or(e, t, "");
1626
+ return 0 === An(t) || or(e, t, "");
1616
1627
  }
1617
1628
  function lr(e, t, n, r) {
1618
1629
  e && !Gn(e) && gn("GObj bad instanceof");
@@ -1622,7 +1633,7 @@ function lr(e, t, n, r) {
1622
1633
  t.hasOwnProperty(s) ? o[s] = t[s] : r && gn(`${Ze(e)}: key not found: ${s}`);
1623
1634
  } else if (kn(n) && Dn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r && gn(`${Ze(e)}: key not found: ${s}`);
1624
1635
  else {
1625
- if (!(In(n) && An(n) > 0)) return t;
1636
+ if (!(In(n) && $n(n) > 0)) return t;
1626
1637
  for (let s = 0; s < n.length; s++) {
1627
1638
  let l = n[s];
1628
1639
  t.hasOwnProperty(l) ? o[l] = t[l] : r && gn(`${Ze(e)}: key not found: ${l}`);
@@ -1637,7 +1648,7 @@ function ir(e, t, n, r) {
1637
1648
  tr(e, t, s, 0, 0) ? Sn(o, s) : r && gn(`${Ze(e)}: key not found: ${s}`);
1638
1649
  } else if (kn(n) && Dn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? Sn(o, s) : r && gn(`${Ze(e)}: key not found: ${s}`);
1639
1650
  else {
1640
- if (!(In(n) && An(n) > 0)) return {};
1651
+ if (!(In(n) && $n(n) > 0)) return {};
1641
1652
  for (let s = 0; s < n.length; s++) {
1642
1653
  let l = n[s];
1643
1654
  t.hasOwnProperty(l) ? Sn(o, l) : r && gn(`${Ze(e)}: key not found: ${l}`);
@@ -1839,8 +1850,8 @@ function xr(e) {
1839
1850
  let t = null;
1840
1851
  return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
1841
1852
  }
1842
- var Dr = 256, Ar = 1e5;
1843
- function $r(e) {
1853
+ var Dr = 256, $r = 1e5;
1854
+ function Ar(e) {
1844
1855
  const t = String(e).replace(/`/g, "``");
1845
1856
  return "[" === t[0] ? "[" + t : t;
1846
1857
  }
@@ -2395,7 +2406,7 @@ function jo(e, t, n, r) {
2395
2406
  }
2396
2407
  let l = s.event, i = s.kw;
2397
2408
  if ("ST_SESSION" !== Dt(e)) {
2398
- if ($t(e, l, R.EVF_PUBLIC_EVENT)) {
2409
+ if (At(e, l, R.EVF_PUBLIC_EVENT)) {
2399
2410
  if (!(Ut(e, l, i, e) < 0)) return 0;
2400
2411
  } else gn(`${Ze(e)}: event UNKNOWN in not-session state ${l}`);
2401
2412
  return uo(e), -1;
@@ -2406,10 +2417,10 @@ function jo(e, t, n, r) {
2406
2417
  let c = Xn(e, a, "dst_service", "");
2407
2418
  if ("__subscribing__" === _) return -1;
2408
2419
  if ("__unsubscribing__" === _) return -1;
2409
- if ($t(e, l, R.EVF_PUBLIC_EVENT)) return Ut(e, l, i, e), 0;
2420
+ if (At(e, l, R.EVF_PUBLIC_EVENT)) return Ut(e, l, i, e), 0;
2410
2421
  if (!Vn(c)) {
2411
2422
  let t = Oe(c, !1);
2412
- return t ? $t(t, l, R.EVF_PUBLIC_EVENT) ? (Ut(t, l, i, e), 0) : (gn(`${Ze(e)}: Service found but no event or not public, service '${Ze(t)}', ev '${l}'`), -1) : (pn(`${Ze(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
2423
+ return t ? At(t, l, R.EVF_PUBLIC_EVENT) ? (Ut(t, l, i, e), 0) : (gn(`${Ze(e)}: Service found but no event or not public, service '${Ze(t)}', ev '${l}'`), -1) : (pn(`${Ze(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
2413
2424
  }
2414
2425
  return rt(e) ? Ut(tt(e), l, i, e) : Ht(e, l, i), 0;
2415
2426
  }
@@ -2571,7 +2582,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2571
2582
  }
2572
2583
  return t;
2573
2584
  }, exports.empty_json = function(e) {
2574
- return 0 === $n(e);
2585
+ return 0 === An(e);
2575
2586
  }, exports.empty_string = Vn, exports.escapeHtml = Sr, exports.event_flag_t = R, exports.flat2json = function(e) {
2576
2587
  if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
2577
2588
  let t = null;
@@ -2585,7 +2596,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2585
2596
  let s = t;
2586
2597
  for (let t = 0; t < r.length; t++) {
2587
2598
  const o = r[t], l = "number" == typeof o, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
2588
- if (l && o > Ar) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
2599
+ if (l && o > $r) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
2589
2600
  if (l !== Array.isArray(s)) throw new Error(`flat2json: '${n}' uses a ${l ? "array index" : "key"} where the tree already has a ${Array.isArray(s) ? "array" : "object"}`);
2590
2601
  if (i) {
2591
2602
  if (Array.isArray(s)) {
@@ -2632,7 +2643,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2632
2643
  for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (o.added[e] = r[e]);
2633
2644
  return o;
2634
2645
  }, exports.flat_key_join = function(e) {
2635
- return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : $r(e)).join("`") : "";
2646
+ return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ar(e)).join("`") : "";
2636
2647
  }, exports.flat_key_split = kr, exports.gclass_add_ev_action = he, exports.gclass_add_event_type = Te, exports.gclass_add_state = me, exports.gclass_check_fsm = ve, exports.gclass_create = ge, exports.gclass_event_type = ye, exports.gclass_find_by_name = je, exports.gclass_flag_t = O, exports.gclass_unregister = pe, exports.getPositionRelativeToBody = function(e) {
2637
2648
  if (!e) return {
2638
2649
  top: 0,
@@ -2661,15 +2672,15 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2661
2672
  return F > 1 || !!e && !!(M(e) & C.TRACE_COMMANDS);
2662
2673
  }(e) || H(e, null) && !q(s, null)) && (I(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", We(e) ? "" : "!!", Ze(e), n, Ze(s))), J(e) && mn(o)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, o, s) : e.gclass.command_table ? u ? u(e, n, o, s) : r(0, -1, t("%s: global command parser not available", Ze(e)), 0, 0) : r(0, -1, t("%s: command table not available", Ze(e)), 0, 0));
2663
2674
  }, exports.gobj_create = function(e, t, n, r) {
2664
- return $e(e, t, n, r, 0);
2665
- }, exports.gobj_create2 = $e, exports.gobj_create_default_service = function(e, t, n, r) {
2666
- return $e(e, t, n, r, N.gobj_flag_default_service | N.gobj_flag_autostart);
2675
+ return Ae(e, t, n, r, 0);
2676
+ }, exports.gobj_create2 = Ae, exports.gobj_create_default_service = function(e, t, n, r) {
2677
+ return Ae(e, t, n, r, N.gobj_flag_default_service | N.gobj_flag_autostart);
2667
2678
  }, exports.gobj_create_pure_child = ke, exports.gobj_create_service = function(e, t, n, r) {
2668
- return $e(e, t, n, r, N.gobj_flag_service);
2679
+ return Ae(e, t, n, r, N.gobj_flag_service);
2669
2680
  }, exports.gobj_create_volatil = function(e, t, n, r) {
2670
- return $e(e, t, n, r, N.gobj_flag_volatil);
2681
+ return Ae(e, t, n, r, N.gobj_flag_volatil);
2671
2682
  }, exports.gobj_create_yuno = function(e, t, n) {
2672
- return $e(e, t, n, null, N.gobj_flag_yuno);
2683
+ return Ae(e, t, n, null, N.gobj_flag_yuno);
2673
2684
  }, exports.gobj_current_state = Dt, exports.gobj_default_service = Se, exports.gobj_deliver_posted_events = Lt, exports.gobj_destroy = Ie, exports.gobj_find_child = dt, exports.gobj_find_gobj = function(e, t) {
2674
2685
  if (Vn(t)) return null;
2675
2686
  const n = t.toLowerCase();
@@ -2678,7 +2689,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2678
2689
  return U;
2679
2690
  }, exports.gobj_global_trace_no_level = function() {
2680
2691
  return P;
2681
- }, exports.gobj_has_attr = mt, exports.gobj_has_event = $t, exports.gobj_has_output_event = kt, exports.gobj_hsdata = ue, exports.gobj_is_destroying = ot, exports.gobj_is_playing = Be, exports.gobj_is_pure_child = rt, exports.gobj_is_running = We, exports.gobj_is_service = Ye, exports.gobj_is_volatil = nt, exports.gobj_list_persistent_attrs = function(e, t) {
2692
+ }, exports.gobj_has_attr = mt, exports.gobj_has_event = At, exports.gobj_has_output_event = kt, exports.gobj_hsdata = ue, exports.gobj_is_destroying = ot, exports.gobj_is_playing = Be, exports.gobj_is_pure_child = rt, exports.gobj_is_running = We, exports.gobj_is_service = Ye, exports.gobj_is_volatil = nt, exports.gobj_list_persistent_attrs = function(e, t) {
2682
2693
  return a ? a(e, t) : null;
2683
2694
  }, exports.gobj_list_subscriptions = function(e) {
2684
2695
  let t = Bt(e, null, null, null);
@@ -2694,8 +2705,8 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2694
2705
  return {
2695
2706
  subscriptions: t,
2696
2707
  subscribings: n,
2697
- "total subscriptions": An(t),
2698
- total_subscribings: An(n)
2708
+ "total subscriptions": $n(t),
2709
+ total_subscribings: $n(n)
2699
2710
  };
2700
2711
  }, exports.gobj_load_persistent_attrs = function(e, t) {
2701
2712
  return Ye(e) ? l ? l(e, t) : -1 : (gn(`${Ze(e)}: Only gobj services can load/save writable-persistent`), -1);
@@ -2720,7 +2731,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2720
2731
  }
2721
2732
  }(n, e), n;
2722
2733
  }, exports.gobj_match_gobj = pt, exports.gobj_name = Qe, exports.gobj_parent = tt, exports.gobj_pause = Me, exports.gobj_play = Ve, exports.gobj_post_event = function(e, n, r, o) {
2723
- return e && e instanceof S ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (gn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : Vn(n) ? (gn("gobj_post_event(): event EMPTY"), -1) : $t(e, n, 0) ? It.length >= 1e4 ? (gn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${It.length}`), -1) : (It.push({
2734
+ return e && e instanceof S ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (gn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : Vn(n) ? (gn("gobj_post_event(): event EMPTY"), -1) : At(e, n, 0) ? It.length >= 1e4 ? (gn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${It.length}`), -1) : (It.push({
2724
2735
  dst: e,
2725
2736
  event: n,
2726
2737
  kw: r,
@@ -2878,7 +2889,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2878
2889
  const t = Object.keys(e);
2879
2890
  if (t.length > 0) {
2880
2891
  for (const s of t) {
2881
- const t = $r(s);
2892
+ const t = Ar(s);
2882
2893
  n(e[s], 0 === o ? t : r + "`" + t, o + 1);
2883
2894
  }
2884
2895
  return;
@@ -2889,7 +2900,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2889
2900
  return null == e || n(e, "", 0), t;
2890
2901
  }, exports.json_array_append = wn, exports.json_array_append_new = Rn, exports.json_array_extend = function(e, t) {
2891
2902
  return t ? (Array.prototype.push.apply(e, t), e) : e;
2892
- }, exports.json_array_remove = xn, exports.json_array_size = An, exports.json_deep_copy = hn, exports.json_is_identical = En, exports.json_object_del = Sn, exports.json_object_get = jn, exports.json_object_set = On, exports.json_object_set_new = Nn, exports.json_object_size = Dn, exports.json_object_update = Tn, exports.json_object_update_existing = yn, exports.json_object_update_missing = vn, exports.json_size = $n, exports.jwt2json = function(e, t) {
2903
+ }, exports.json_array_remove = xn, exports.json_array_size = $n, exports.json_deep_copy = hn, exports.json_is_identical = En, exports.json_object_del = Sn, exports.json_object_get = jn, exports.json_object_set = On, exports.json_object_set_new = Nn, exports.json_object_size = Dn, exports.json_object_update = Tn, exports.json_object_update_existing = yn, exports.json_object_update_missing = vn, exports.json_size = An, exports.jwt2json = function(e, t) {
2893
2904
  try {
2894
2905
  let n = jr(e);
2895
2906
  switch (t) {
@@ -2921,13 +2932,13 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
2921
2932
  e && !Gn(e) && gn("GObj bad instanceof");
2922
2933
  let s = Hn(e, t, n, !1);
2923
2934
  const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT;
2924
- return void 0 === s ? i && In(r) && t ? (nr(e, t, n, r), r) : (l && (gn(`path not found: '${n}'`), mn(t)), r) : In(s) ? (_ && qn(e, t, n), s) : (l && (gn(`${Ze(e)}: path value MUST BE an array: ${n}`), bn(t)), r);
2935
+ return void 0 === s ? i && In(r) && t ? (nr(e, t, n, r), r) : (l && (gn(`path not found: '${n}'`), mn(t)), r) : In(s) ? (_ && qn(e, t, n), s) : (l && (gn(`${e ? Ze(e) + ": " : ""}path MUST BE a json list: '${n}'`), mn(t)), r);
2925
2936
  }, exports.kw_get_local_storage_value = _r, exports.kw_get_pointer = Zn, exports.kw_get_real = function(e, t, n, r, o) {
2926
2937
  e && !Gn(e) && gn("GObj bad instanceof");
2927
2938
  let s = Hn(e, t, n, !1);
2928
2939
  const l = o && o & qt.KW_REQUIRED, i = o && o & qt.KW_CREATE, _ = o && o & qt.KW_EXTRACT, a = o && o & qt.KW_WILD_NUMBER;
2929
2940
  if (void 0 === s) {
2930
- if (i) {
2941
+ if (i && t) {
2931
2942
  let o = Number(r);
2932
2943
  return nr(e, t, n, o), o;
2933
2944
  }
@@ -3009,7 +3020,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
3009
3020
  let e = {};
3010
3021
  if (Jn(s, t)) {
3011
3022
  if (!Jn(s, n)) {
3012
- if (!($n(s) > 0)) {
3023
+ if (!(An(s) > 0)) {
3013
3024
  gn("list2options(): object without field value: " + n);
3014
3025
  continue;
3015
3026
  }
@@ -3017,7 +3028,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
3017
3028
  }
3018
3029
  e.id = s[t], e.value = s[n];
3019
3030
  } else {
3020
- if (!($n(s) > 0)) {
3031
+ if (!(An(s) > 0)) {
3021
3032
  gn("list2options(): object without field id: " + t);
3022
3033
  continue;
3023
3034
  }
@@ -3301,11 +3312,11 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
3301
3312
  let n = Lr(e, t);
3302
3313
  return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
3303
3314
  }, exports.treedb_get_field_desc = Gr, exports.treedb_hook_data_size = function(e) {
3304
- if (In(e) && 1 === $n(e)) {
3315
+ if (In(e) && 1 === An(e)) {
3305
3316
  let t = e[0];
3306
3317
  return Jn(t, "size") ? t.size : 1;
3307
3318
  }
3308
- return $n(e);
3319
+ return An(e);
3309
3320
  }, exports.vsprintf = function(e, n) {
3310
3321
  return t.apply(null, [e].concat(n || []));
3311
3322
  }, exports.walk_type_t = x;