@yuneta/gobj-js 7.26.27 → 7.26.28
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/README.md +15 -3
- package/dist/gobj-js.cjs.js +140 -49
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +755 -701
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +140 -49
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +292 -239
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +140 -49
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +742 -688
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +140 -49
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +742 -688
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
};
|
|
230
230
|
var x = 1;
|
|
231
231
|
function K(e) {
|
|
232
|
-
|
|
232
|
+
Bo(e) && (e = JSON.stringify(e)), ar(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
233
233
|
}
|
|
234
234
|
var B = Object.freeze({
|
|
235
235
|
TRACE_MACHINE: 65536,
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
B.TRACE_COMMANDS,
|
|
324
324
|
"Trace commands"
|
|
325
325
|
]
|
|
326
|
-
], J = 0,
|
|
326
|
+
], J = 0, q = 0, H = 0;
|
|
327
327
|
function z(e, t) {
|
|
328
328
|
let n = [];
|
|
329
329
|
for (const [t, r] of Y) e & r && n.push(t);
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
return n;
|
|
332
332
|
}
|
|
333
333
|
function Q(e, t, n) {
|
|
334
|
-
if (
|
|
334
|
+
if (Zo(e)) return void 0 === n ? 268369920 : 65535;
|
|
335
335
|
if (/^[0-9]+$/.test(String(e))) {
|
|
336
336
|
const t = Number(e);
|
|
337
337
|
if (t) return t;
|
|
@@ -345,12 +345,12 @@
|
|
|
345
345
|
}(String(e), n) || (ir(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
346
346
|
}
|
|
347
347
|
function X(e) {
|
|
348
|
-
if (
|
|
348
|
+
if (H) return 4294967295;
|
|
349
349
|
let t = J;
|
|
350
350
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
351
351
|
}
|
|
352
352
|
function Z(e) {
|
|
353
|
-
let t =
|
|
353
|
+
let t = q;
|
|
354
354
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
355
355
|
}
|
|
356
356
|
function ee(e) {
|
|
@@ -366,13 +366,13 @@
|
|
|
366
366
|
return X(e) & B.TRACE_EV_KW;
|
|
367
367
|
}
|
|
368
368
|
function oe(e, t) {
|
|
369
|
-
if (
|
|
369
|
+
if (H > 1) return !0;
|
|
370
370
|
if (!e) return !1;
|
|
371
371
|
const n = X(e);
|
|
372
372
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
373
373
|
}
|
|
374
374
|
function le(e, t) {
|
|
375
|
-
if (
|
|
375
|
+
if (H > 1) return !1;
|
|
376
376
|
if (!e) return !0;
|
|
377
377
|
const n = Z(e);
|
|
378
378
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
@@ -383,47 +383,47 @@
|
|
|
383
383
|
}
|
|
384
384
|
function se(e, t) {
|
|
385
385
|
const n = Q(e, "gobj_set_global_no_trace");
|
|
386
|
-
return n ? (t ?
|
|
386
|
+
return n ? (t ? q |= n : q &= ~n, 0) : -1;
|
|
387
387
|
}
|
|
388
388
|
function ae(e, t) {
|
|
389
389
|
return J = t ? (J | e) >>> 0 : (J & ~e) >>> 0, 0;
|
|
390
390
|
}
|
|
391
391
|
function ue(e, t) {
|
|
392
|
-
return
|
|
392
|
+
return q = t ? (q | e) >>> 0 : (q & ~e) >>> 0, 0;
|
|
393
393
|
}
|
|
394
394
|
function _e() {
|
|
395
395
|
return z(J, null);
|
|
396
396
|
}
|
|
397
397
|
function ce() {
|
|
398
|
-
return z(
|
|
398
|
+
return z(q, null);
|
|
399
399
|
}
|
|
400
400
|
function fe(e) {
|
|
401
|
-
const t =
|
|
401
|
+
const t = Jo(e) ? et(e) : e;
|
|
402
402
|
return t ? z(t.trace_level | J, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
403
403
|
}
|
|
404
404
|
function ge(e) {
|
|
405
|
-
const t =
|
|
405
|
+
const t = Jo(e) ? et(e) : e;
|
|
406
406
|
return t ? z(t.trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
407
407
|
}
|
|
408
408
|
function de(e) {
|
|
409
|
-
const t =
|
|
409
|
+
const t = Jo(e) ? et(e) : e;
|
|
410
410
|
return t ? z(t.no_trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
411
411
|
}
|
|
412
412
|
function be(e, t, n) {
|
|
413
|
-
const r =
|
|
413
|
+
const r = Jo(e) ? et(e) : e;
|
|
414
414
|
if (!r) return ir(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
415
415
|
const o = null === t ? 4294967295 : Q(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
416
416
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
417
417
|
}
|
|
418
418
|
function pe(e, t, n) {
|
|
419
|
-
const r =
|
|
419
|
+
const r = Jo(e) ? et(e) : e;
|
|
420
420
|
if (!r) return ir(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
421
421
|
const o = null === t ? 4294967295 : Q(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
422
422
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
423
423
|
}
|
|
424
424
|
function me(e, t) {
|
|
425
425
|
let n = {};
|
|
426
|
-
if (!
|
|
426
|
+
if (!Yo(t)) return ir("sdata_desc MUST be an array"), _r(t), n;
|
|
427
427
|
for (let r = 0; r < t.length; r++) {
|
|
428
428
|
const o = t[r];
|
|
429
429
|
o.name && he(e, n, o);
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
r = String(o);
|
|
438
438
|
break;
|
|
439
439
|
case E.DTP_BOOLEAN:
|
|
440
|
-
r =
|
|
440
|
+
r = el(o);
|
|
441
441
|
break;
|
|
442
442
|
case E.DTP_INTEGER:
|
|
443
443
|
r = parseInt(o), isNaN(r) && ir(`${kt(e)}: attr NaN: ${n.name}`);
|
|
@@ -446,26 +446,26 @@
|
|
|
446
446
|
r = Number(o), isNaN(r) && ir(`${kt(e)}: attr NaN: ${n.name}`);
|
|
447
447
|
break;
|
|
448
448
|
case E.DTP_LIST:
|
|
449
|
-
if (
|
|
449
|
+
if (Jo(o)) try {
|
|
450
450
|
r = JSON.parse(o);
|
|
451
451
|
} catch (e) {
|
|
452
452
|
ir(`JSON parse error: ${e.message}`);
|
|
453
453
|
}
|
|
454
454
|
else r = o;
|
|
455
|
-
|
|
455
|
+
Yo(r) || (r = []);
|
|
456
456
|
break;
|
|
457
457
|
case E.DTP_DICT:
|
|
458
|
-
if (
|
|
458
|
+
if (Jo(o)) try {
|
|
459
459
|
r = JSON.parse(o);
|
|
460
460
|
} catch (e) {
|
|
461
461
|
ir(`JSON parse error: ${e.message}`);
|
|
462
462
|
}
|
|
463
463
|
else r = o;
|
|
464
|
-
|
|
464
|
+
Bo(r) || (r = {});
|
|
465
465
|
break;
|
|
466
466
|
case E.DTP_JSON:
|
|
467
467
|
if ("" === o || void 0 === o) r = null;
|
|
468
|
-
else if (
|
|
468
|
+
else if (Jo(o)) try {
|
|
469
469
|
r = JSON.parse(o);
|
|
470
470
|
} catch (e) {
|
|
471
471
|
ir(`JSON parse error: ${e.message}`);
|
|
@@ -554,16 +554,16 @@
|
|
|
554
554
|
}(e)) return t;
|
|
555
555
|
}
|
|
556
556
|
function $e(e, t) {
|
|
557
|
-
return T(e) ?
|
|
557
|
+
return T(e) ? Jo(t) : w(e) ? Bo(t) : S(e) ? Yo(t) : !$(e) || "number" == typeof t || "boolean" == typeof t;
|
|
558
558
|
}
|
|
559
559
|
function Ae(e) {
|
|
560
560
|
return e >= -0x8000000000000000 && e < 0x8000000000000000;
|
|
561
561
|
}
|
|
562
562
|
function Re(e) {
|
|
563
|
-
return
|
|
563
|
+
return Yo(e) ? "an array" : Bo(e) ? "an object" : Jo(e) ? je : "number" == typeof e ? Number.isInteger(e) && Ae(e) ? "an integer" : "a real" : "boolean" == typeof e ? "a boolean" : "null";
|
|
564
564
|
}
|
|
565
565
|
function De(e, t, n) {
|
|
566
|
-
if (
|
|
566
|
+
if (Jo(t) || (t = ""), T(e)) return {
|
|
567
567
|
value: t,
|
|
568
568
|
refused: null
|
|
569
569
|
};
|
|
@@ -658,9 +658,9 @@
|
|
|
658
658
|
value: void 0,
|
|
659
659
|
refused: null
|
|
660
660
|
};
|
|
661
|
-
const n =
|
|
661
|
+
const n = Jo(t) && t.indexOf("\0") >= 0;
|
|
662
662
|
if (N(e)) {
|
|
663
|
-
if (!
|
|
663
|
+
if (!Jo(t) || n) return {
|
|
664
664
|
value: t,
|
|
665
665
|
refused: null
|
|
666
666
|
};
|
|
@@ -673,7 +673,7 @@
|
|
|
673
673
|
return T(e) || w(e) || S(e) || $(e) ? n ? {
|
|
674
674
|
value: void 0,
|
|
675
675
|
refused: "a text with a NUL in it"
|
|
676
|
-
} :
|
|
676
|
+
} : Jo(t) && !T(e) ? De(e, t, !0) : $e(e, t) ? $(e) ? function(e, t) {
|
|
677
677
|
return "number" != typeof t || Number.isFinite(t) ? j(e) ? {
|
|
678
678
|
value: "boolean" == typeof t ? t : 0 !== t,
|
|
679
679
|
refused: null
|
|
@@ -777,7 +777,7 @@
|
|
|
777
777
|
function Fe(e) {
|
|
778
778
|
if (Le(e)) try {
|
|
779
779
|
const t = JSON.stringify(e);
|
|
780
|
-
return
|
|
780
|
+
return Jo(t) ? t : void 0;
|
|
781
781
|
} catch (e) {
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
@@ -794,7 +794,7 @@
|
|
|
794
794
|
let l;
|
|
795
795
|
if (t.flag & A.SDF_SECRET) l = "********";
|
|
796
796
|
else {
|
|
797
|
-
l =
|
|
797
|
+
l = Jo(n) ? n : Fe(void 0 === n ? null : n), void 0 === l && (l = `<${Ue}>`);
|
|
798
798
|
const e = To(l);
|
|
799
799
|
if (null !== e && (l = e), l.length > 64) {
|
|
800
800
|
let e = 64;
|
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
switch (n.type) {
|
|
810
810
|
case E.DTP_STRING:
|
|
811
811
|
if (null == r) o = "";
|
|
812
|
-
else if (
|
|
812
|
+
else if (Jo(r)) o = String(r);
|
|
813
813
|
else if (o = Fe(r), void 0 === o) return Me(e, n, r, Ue), -1;
|
|
814
814
|
break;
|
|
815
815
|
case E.DTP_BOOLEAN:
|
|
@@ -825,7 +825,7 @@
|
|
|
825
825
|
}
|
|
826
826
|
break;
|
|
827
827
|
case E.DTP_JSON:
|
|
828
|
-
if (o = r,
|
|
828
|
+
if (o = r, Jo(r)) {
|
|
829
829
|
const e = r.trim();
|
|
830
830
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
831
831
|
o = JSON.parse(e);
|
|
@@ -836,7 +836,7 @@
|
|
|
836
836
|
break;
|
|
837
837
|
case E.DTP_POINTER: o = r;
|
|
838
838
|
}
|
|
839
|
-
return void 0 === o && ir(`${kt(e)}: attr undefined: ${n.name}`), t[n.name] = o,
|
|
839
|
+
return void 0 === o && ir(`${kt(e)}: attr undefined: ${n.name}`), t[n.name] = o, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = o), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
840
840
|
}
|
|
841
841
|
function Ve(e) {
|
|
842
842
|
return e.jn_attrs;
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
return n && ir(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
855
855
|
}
|
|
856
856
|
function Ke(e, t, n, r, o, l, i, s, a, u, _) {
|
|
857
|
-
if (
|
|
857
|
+
if (Zo(e)) return ir("gclass_name EMPTY"), null;
|
|
858
858
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return ir(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
859
859
|
if (et(e)) return ir(`GClass ALREADY exists: ${e}`), null;
|
|
860
860
|
let c = new C(e, r, o, l, i, s, a, u, _);
|
|
@@ -864,17 +864,17 @@
|
|
|
864
864
|
const f = n.length;
|
|
865
865
|
for (let e = 0; e < f; e++) {
|
|
866
866
|
let t = n[e][0], r = n[e][1];
|
|
867
|
-
if (
|
|
868
|
-
if (
|
|
867
|
+
if (Zo(t)) continue;
|
|
868
|
+
if (qe(c, t) < 0) return Be(c), null;
|
|
869
869
|
const o = r.length;
|
|
870
870
|
for (let e = 0; e < o; e++) {
|
|
871
871
|
let n = r[e][0], o = r[e][1], l = r[e][2];
|
|
872
|
-
|
|
872
|
+
Zo(n) || He(c, t, n, o, l);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
for (let e = 0; e < t.length; e++) {
|
|
876
876
|
let n = t[e][0], r = t[e][1];
|
|
877
|
-
if (!
|
|
877
|
+
if (!Zo(n)) {
|
|
878
878
|
if (Xe(c, n)) return ir(`SMachine: event repeated in input_events: ${n}`), Be(c), null;
|
|
879
879
|
Qe(c, n, r);
|
|
880
880
|
}
|
|
@@ -887,7 +887,7 @@
|
|
|
887
887
|
}
|
|
888
888
|
function Be(e) {
|
|
889
889
|
let t;
|
|
890
|
-
if (
|
|
890
|
+
if (Jo(e)) t = e;
|
|
891
891
|
else {
|
|
892
892
|
if (!(e instanceof C)) return ir("Cannot unregister gclass, type unknown"), -1;
|
|
893
893
|
t = e.gclass_name;
|
|
@@ -911,17 +911,17 @@
|
|
|
911
911
|
}
|
|
912
912
|
return null;
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function qe(e, t) {
|
|
915
915
|
return e instanceof C ? Ye(e, t) ? (ir(`state already exists: ${t}`), -1) : (e.dl_states.push(new V(t)), 0) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function He(e, t, n, r, o) {
|
|
918
918
|
if (!(e instanceof C)) return ir("Cannot add state, typeof not GClass"), -1;
|
|
919
|
-
if (
|
|
919
|
+
if (Zo(t)) return ir("state_name EMPTY"), -1;
|
|
920
920
|
let l = Ye(e, t);
|
|
921
921
|
return l ? Je(l, n) ? (ir(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (l.dl_actions.push(new G(n, r, o)), 0) : (ir(`state not found: ${t}`), -1);
|
|
922
922
|
}
|
|
923
923
|
function ze(e, t, n) {
|
|
924
|
-
|
|
924
|
+
Zo(t) || e.push(new W(t, n));
|
|
925
925
|
}
|
|
926
926
|
function Qe(e, t, n) {
|
|
927
927
|
return e instanceof C ? ze(e.dl_events, t, n) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
@@ -941,18 +941,18 @@
|
|
|
941
941
|
Wo(e.dl_states) || (ir(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
942
942
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
943
943
|
let r = e.dl_states[n];
|
|
944
|
-
if (!
|
|
944
|
+
if (!Zo(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
945
945
|
let o = r.dl_actions[n];
|
|
946
|
-
|
|
946
|
+
Zo(o.event_name) || (Xe(e, o.event_name) || (ir(`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 && (Ye(e, o.next_state) || (ir(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
950
950
|
let r = e.dl_events[n];
|
|
951
|
-
if (!
|
|
951
|
+
if (!Zo(r.event_name) && (qo(r.event_flag) || (ir(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & F.EVF_OUTPUT_EVENT))) {
|
|
952
952
|
let n = !1;
|
|
953
953
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
954
954
|
let o = e.dl_states[t];
|
|
955
|
-
|
|
955
|
+
Zo(o.state_name) || Je(o, r.event_name) && (n = !0);
|
|
956
956
|
}
|
|
957
957
|
n || (ir(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
958
958
|
}
|
|
@@ -970,7 +970,7 @@
|
|
|
970
970
|
return !m || m.obflag & U.obflag_destroyed ? null : m;
|
|
971
971
|
}
|
|
972
972
|
function nt(e, t) {
|
|
973
|
-
if (!
|
|
973
|
+
if (!Jo(e)) return ir(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
974
974
|
e = e.toLowerCase();
|
|
975
975
|
return b[e] || (t && ir(`gobj service not found: ${e}`), null);
|
|
976
976
|
}
|
|
@@ -982,7 +982,7 @@
|
|
|
982
982
|
t.parent && ir(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
983
983
|
}
|
|
984
984
|
function lt(e, t) {
|
|
985
|
-
let n =
|
|
985
|
+
let n = zl(e.dl_children, t);
|
|
986
986
|
n >= 0 && (Go(e.dl_children, n), t.parent = null);
|
|
987
987
|
}
|
|
988
988
|
function it(e, t) {
|
|
@@ -1010,7 +1010,7 @@
|
|
|
1010
1010
|
} else {
|
|
1011
1011
|
if (!o) return ir("gobj NEEDS a parent!"), null;
|
|
1012
1012
|
if (!("string" == typeof o || o instanceof I)) return ir(`BAD TYPE of parent: ${o}`), null;
|
|
1013
|
-
if (
|
|
1013
|
+
if (Jo(o)) {
|
|
1014
1014
|
const e = o;
|
|
1015
1015
|
if (!(o = nt(e))) return sr(`parent service not found: ${e}`), null;
|
|
1016
1016
|
}
|
|
@@ -1020,11 +1020,11 @@
|
|
|
1020
1020
|
if (m) return ir(`default service ALREADY registered: ${t}^${e}`), null;
|
|
1021
1021
|
l |= L.gobj_flag_service;
|
|
1022
1022
|
}
|
|
1023
|
-
if (
|
|
1023
|
+
if (Zo(t)) return ir("gclass_name must be a string"), null;
|
|
1024
1024
|
let i = et(t, !1);
|
|
1025
1025
|
if (!i) return ir(`GClass not registered: ${t}^${e}`), null;
|
|
1026
|
-
if (!
|
|
1027
|
-
if (!
|
|
1026
|
+
if (!Jo(e)) return ir(`gobj_name must be a string: ${t}`), null;
|
|
1027
|
+
if (!Zo(e)) {
|
|
1028
1028
|
if (e.includes("`")) return ir(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
1029
1029
|
if (e.includes("^")) return ir(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
1030
1030
|
}
|
|
@@ -1080,17 +1080,38 @@
|
|
|
1080
1080
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1081
1081
|
if (e.running) return ir(`${kt(e)}: GObj ALREADY RUNNING`), -1;
|
|
1082
1082
|
if (e.disabled) return ir(`${kt(e)}: GObj DISABLED`), -1;
|
|
1083
|
+
const t = function(e) {
|
|
1084
|
+
const t = Ve(e), n = [];
|
|
1085
|
+
if (!Yo(e.gclass.attrs_table)) return null;
|
|
1086
|
+
for (const r of e.gclass.attrs_table) {
|
|
1087
|
+
if (!(r.name && r.flag & A.SDF_REQUIRED)) continue;
|
|
1088
|
+
const e = t[r.name];
|
|
1089
|
+
switch (r.type) {
|
|
1090
|
+
case E.DTP_STRING:
|
|
1091
|
+
Jo(e) && !Zo(e) || n.push(r.name);
|
|
1092
|
+
break;
|
|
1093
|
+
case E.DTP_LIST:
|
|
1094
|
+
case E.DTP_DICT:
|
|
1095
|
+
case E.DTP_JSON:
|
|
1096
|
+
Ko(e) && n.push(r.name);
|
|
1097
|
+
break;
|
|
1098
|
+
case E.DTP_POINTER: e || n.push(r.name);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return n.length ? n : null;
|
|
1102
|
+
}(e);
|
|
1103
|
+
if (t) return ir(`${kt(e)}: Cannot start without all required attributes: ` + JSON.stringify(t)), -1;
|
|
1083
1104
|
ne(e) && K(n("⏺ ⏺ start: %s", Ct(e))), e.running = !0;
|
|
1084
|
-
let
|
|
1105
|
+
let r = 0;
|
|
1085
1106
|
if (e.gclass.gmt.mt_start) {
|
|
1086
|
-
const
|
|
1107
|
+
const t = vn(e, "mt_start", y.FRAME_METHOD);
|
|
1087
1108
|
try {
|
|
1088
|
-
|
|
1109
|
+
r = e.gclass.gmt.mt_start(e);
|
|
1089
1110
|
} finally {
|
|
1090
|
-
En(
|
|
1111
|
+
En(t);
|
|
1091
1112
|
}
|
|
1092
1113
|
}
|
|
1093
|
-
return
|
|
1114
|
+
return r;
|
|
1094
1115
|
}
|
|
1095
1116
|
function gt(e) {
|
|
1096
1117
|
const t = vn(e, "gobj_start", y.FRAME_WATCH);
|
|
@@ -1199,89 +1220,102 @@
|
|
|
1199
1220
|
return e ? tn(e, "yuno_id") : "";
|
|
1200
1221
|
}
|
|
1201
1222
|
function Rt(e) {
|
|
1202
|
-
return
|
|
1223
|
+
return Xo(e) ? e.gobj_name : (ir("gobj bad type"), null);
|
|
1203
1224
|
}
|
|
1204
1225
|
function Dt(e) {
|
|
1205
|
-
return
|
|
1226
|
+
return Xo(e) ? e.gclass.gclass_name : (ir("gobj NULL of bad type"), null);
|
|
1206
1227
|
}
|
|
1207
1228
|
function kt(e) {
|
|
1208
|
-
return
|
|
1229
|
+
return Xo(e) ? e.gclass.gclass_name + "^" + Rt(e) : (ir("gobj bad type"), null);
|
|
1209
1230
|
}
|
|
1210
1231
|
function Ct(e) {
|
|
1211
|
-
if (!
|
|
1232
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1212
1233
|
let t = kt(e), n = It(e);
|
|
1213
1234
|
for (; n;) t = kt(n) + "`" + t, n = It(n);
|
|
1214
1235
|
return t;
|
|
1215
1236
|
}
|
|
1216
1237
|
function It(e) {
|
|
1217
|
-
return
|
|
1238
|
+
return Xo(e) ? e.parent : (ir("gobj NULL of bad type"), null);
|
|
1218
1239
|
}
|
|
1219
1240
|
function Pt(e) {
|
|
1220
|
-
return
|
|
1241
|
+
return Xo(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (ir("gobj NULL of bad type"), null);
|
|
1221
1242
|
}
|
|
1222
1243
|
function Lt(e) {
|
|
1223
|
-
return
|
|
1244
|
+
return Xo(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (ir("gobj NULL of bad type"), null);
|
|
1224
1245
|
}
|
|
1225
1246
|
function Ut(e) {
|
|
1226
|
-
return !
|
|
1247
|
+
return !Xo(e) || !!(e.obflag & (U.obflag_destroyed | U.obflag_destroying));
|
|
1227
1248
|
}
|
|
1228
1249
|
function Ft(e) {
|
|
1229
|
-
return
|
|
1250
|
+
return Xo(e) ? e.bottom_gobj : (ir("gobj NULL of bad type"), null);
|
|
1230
1251
|
}
|
|
1231
1252
|
function Mt(e, t) {
|
|
1232
|
-
if (!
|
|
1253
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1233
1254
|
e.bottom_gobj && t && sr(`${kt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
1234
1255
|
}
|
|
1235
1256
|
function Gt(e, t, n) {
|
|
1236
|
-
return
|
|
1257
|
+
return Xo(e) ? t ? xe(e.gclass, t, n) : e.gclass.attrs_table : (ir("gobj NULL of bad type"), null);
|
|
1237
1258
|
}
|
|
1238
1259
|
function Vt(e, t, n, r, o) {
|
|
1239
|
-
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) :
|
|
1260
|
+
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : function(e, t, n, r, o, l) {
|
|
1261
|
+
let i, s = [...e.dl_children];
|
|
1262
|
+
if (n & M.WALK_LAST2FIRST) for (let n = s.length; n > 0; n--) {
|
|
1263
|
+
if (i = s[n - 1], Kt(i, e, t)) continue;
|
|
1264
|
+
t.add(i);
|
|
1265
|
+
let a = xt(r(i, o, l));
|
|
1266
|
+
if (a < 0) return a;
|
|
1267
|
+
}
|
|
1268
|
+
else for (let n = 0; n < s.length; n++) {
|
|
1269
|
+
if (i = s[n], Kt(i, e, t)) continue;
|
|
1270
|
+
t.add(i);
|
|
1271
|
+
let a = xt(r(i, o, l));
|
|
1272
|
+
if (a < 0) return a;
|
|
1273
|
+
}
|
|
1274
|
+
return 0;
|
|
1275
|
+
}(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1240
1276
|
}
|
|
1241
1277
|
function Wt(e, t, n, r, o) {
|
|
1242
|
-
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Yt(e
|
|
1278
|
+
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Yt(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1243
1279
|
}
|
|
1244
1280
|
function xt(e) {
|
|
1245
1281
|
return "number" == typeof e && isFinite(e) ? e : (null == e || ir(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
1246
1282
|
}
|
|
1247
|
-
function Kt(e, t, n
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1283
|
+
function Kt(e, t, n) {
|
|
1284
|
+
return Ut(e) || e.parent !== t || n.has(e);
|
|
1285
|
+
}
|
|
1286
|
+
function Bt(e, t, n, r, o, l) {
|
|
1287
|
+
let i = [...e.dl_children];
|
|
1288
|
+
n & M.WALK_LAST2FIRST && i.reverse();
|
|
1289
|
+
let s = [];
|
|
1290
|
+
for (const n of i) {
|
|
1291
|
+
if (Kt(n, e, t)) continue;
|
|
1292
|
+
t.add(n), s.push(n);
|
|
1293
|
+
let i = xt(r(n, o, l));
|
|
1294
|
+
if (i < 0) return i;
|
|
1253
1295
|
}
|
|
1254
|
-
|
|
1255
|
-
if (
|
|
1256
|
-
let
|
|
1257
|
-
if (
|
|
1296
|
+
for (const e of s) {
|
|
1297
|
+
if (Ut(e)) continue;
|
|
1298
|
+
let i = Bt(e, t, n, r, o, l);
|
|
1299
|
+
if (i < 0) return i;
|
|
1258
1300
|
}
|
|
1259
1301
|
return 0;
|
|
1260
1302
|
}
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
if (
|
|
1265
|
-
for (let
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
}
|
|
1269
|
-
function Yt(e, t, n, r, o) {
|
|
1270
|
-
if (t & M.WALK_BYLEVEL) return Bt(e, t, n, r, o);
|
|
1271
|
-
let l, i, s = [...e];
|
|
1272
|
-
if (t & M.WALK_BOTTOM2TOP) {
|
|
1273
|
-
for (let e = s.length; e > 0; e--) if (i = s[e - 1], !Ut(i)) {
|
|
1274
|
-
if (l = Yt(i.dl_children, t, n, r, o), l < 0) return l;
|
|
1275
|
-
if (!Ut(i) && (l = xt(n(i, r, o)), l < 0)) return l;
|
|
1303
|
+
function Yt(e, t, n, r, o, l) {
|
|
1304
|
+
if (n & M.WALK_BYLEVEL) return Bt(e, t, n, r, o, l);
|
|
1305
|
+
let i, s, a = [...e.dl_children];
|
|
1306
|
+
if (n & M.WALK_BOTTOM2TOP) {
|
|
1307
|
+
for (let u = a.length; u > 0; u--) if (s = a[u - 1], !Kt(s, e, t)) {
|
|
1308
|
+
if (i = Yt(s, t, n, r, o, l), i < 0) return i;
|
|
1309
|
+
if (!Ut(s) && (t.add(s), i = xt(r(s, o, l)), i < 0)) return i;
|
|
1276
1310
|
}
|
|
1277
|
-
} else for (let
|
|
1278
|
-
if (
|
|
1279
|
-
if (0 ===
|
|
1311
|
+
} else for (let u = 0; u < a.length; u++) if (s = a[u], !Kt(s, e, t)) {
|
|
1312
|
+
if (t.add(s), i = xt(r(s, o, l)), i < 0) return i;
|
|
1313
|
+
if (0 === i && !Ut(s) && (i = Yt(s, t, n, r, o, l), i < 0)) return i;
|
|
1280
1314
|
}
|
|
1281
1315
|
return 0;
|
|
1282
1316
|
}
|
|
1283
1317
|
function Jt(e, t) {
|
|
1284
|
-
if (!
|
|
1318
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), !1;
|
|
1285
1319
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
1286
1320
|
t.__disabled__;
|
|
1287
1321
|
let l = t.__state__;
|
|
@@ -1296,7 +1330,7 @@
|
|
|
1296
1330
|
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && zt(e, n) && i[n] !== t[n]) return !1;
|
|
1297
1331
|
return !0;
|
|
1298
1332
|
}
|
|
1299
|
-
function
|
|
1333
|
+
function qt(e, t) {
|
|
1300
1334
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), null;
|
|
1301
1335
|
const n = e.dl_children;
|
|
1302
1336
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -1305,7 +1339,7 @@
|
|
|
1305
1339
|
}
|
|
1306
1340
|
return null;
|
|
1307
1341
|
}
|
|
1308
|
-
function
|
|
1342
|
+
function Ht(e, t) {
|
|
1309
1343
|
if (!t) return null;
|
|
1310
1344
|
let n = t.split("`");
|
|
1311
1345
|
if (!function(e, t) {
|
|
@@ -1321,11 +1355,11 @@
|
|
|
1321
1355
|
if (1 === n.length) return e;
|
|
1322
1356
|
let r = n[1].split("^"), o = {};
|
|
1323
1357
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
1324
|
-
let l =
|
|
1325
|
-
return l ? (n.splice(0, 1), n = n.join("`"),
|
|
1358
|
+
let l = qt(e, o);
|
|
1359
|
+
return l ? (n.splice(0, 1), n = n.join("`"), Ht(l, n)) : null;
|
|
1326
1360
|
}
|
|
1327
1361
|
function zt(e, t) {
|
|
1328
|
-
return !
|
|
1362
|
+
return !Zo(t) && !!xe(e.gclass, t, !1);
|
|
1329
1363
|
}
|
|
1330
1364
|
function Qt(e, t, n) {
|
|
1331
1365
|
let r = e.jn_attrs;
|
|
@@ -1348,21 +1382,21 @@
|
|
|
1348
1382
|
}
|
|
1349
1383
|
function Zt(e, t) {
|
|
1350
1384
|
if (t) {
|
|
1351
|
-
if (0 ===
|
|
1352
|
-
if (0 ===
|
|
1353
|
-
if (0 ===
|
|
1354
|
-
if (0 ===
|
|
1385
|
+
if (0 === nl(t, "__disabled__")) return jt(e);
|
|
1386
|
+
if (0 === nl(t, "__running__")) return Tt(e);
|
|
1387
|
+
if (0 === nl(t, "__playing__")) return St(e);
|
|
1388
|
+
if (0 === nl(t, "__service__")) return Ot(e);
|
|
1355
1389
|
}
|
|
1356
1390
|
let n = We(e, t, !1);
|
|
1357
1391
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1358
1392
|
}
|
|
1359
1393
|
function en(e, t) {
|
|
1360
|
-
t &&
|
|
1394
|
+
t && nl(t, "__trace_level__");
|
|
1361
1395
|
let n = We(e, t, !1);
|
|
1362
1396
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1363
1397
|
}
|
|
1364
1398
|
function tn(e, t) {
|
|
1365
|
-
if (t && 0 ===
|
|
1399
|
+
if (t && 0 === nl(t, "__state__")) return fn(e);
|
|
1366
1400
|
let n = We(e, t, !1);
|
|
1367
1401
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1368
1402
|
}
|
|
@@ -1371,7 +1405,7 @@
|
|
|
1371
1405
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1372
1406
|
}
|
|
1373
1407
|
function rn(e, t, r, o) {
|
|
1374
|
-
if (!
|
|
1408
|
+
if (!Jo(t)) return ir(n("gobj_write_attr(%s): path must be a string", kt(e))), -1;
|
|
1375
1409
|
let l, i = e.jn_attrs, s = t.split("`");
|
|
1376
1410
|
if (s.length <= 1) {
|
|
1377
1411
|
let o = t;
|
|
@@ -1380,7 +1414,7 @@
|
|
|
1380
1414
|
let a = s.length;
|
|
1381
1415
|
for (let t = 0; t < a; t++) {
|
|
1382
1416
|
l = s[t];
|
|
1383
|
-
let n =
|
|
1417
|
+
let n = qt(e, { __gobj_name__: l });
|
|
1384
1418
|
if (n && t < a - 1) {
|
|
1385
1419
|
e = n;
|
|
1386
1420
|
continue;
|
|
@@ -1399,7 +1433,7 @@
|
|
|
1399
1433
|
let o;
|
|
1400
1434
|
if (T(n)) {
|
|
1401
1435
|
if (null == r) return { value: "" };
|
|
1402
|
-
if (
|
|
1436
|
+
if (Jo(r)) return { value: r };
|
|
1403
1437
|
o = {
|
|
1404
1438
|
value: Fe(r),
|
|
1405
1439
|
refused: Ue
|
|
@@ -1429,7 +1463,7 @@
|
|
|
1429
1463
|
let r = We(e, t, !1);
|
|
1430
1464
|
if (r) {
|
|
1431
1465
|
const o = ln(e, t, E.DTP_BOOLEAN, n);
|
|
1432
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1466
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1433
1467
|
}
|
|
1434
1468
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1435
1469
|
}
|
|
@@ -1437,7 +1471,7 @@
|
|
|
1437
1471
|
let r = We(e, t, !1);
|
|
1438
1472
|
if (r) {
|
|
1439
1473
|
const o = ln(e, t, E.DTP_INTEGER, n);
|
|
1440
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1474
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1441
1475
|
}
|
|
1442
1476
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1443
1477
|
}
|
|
@@ -1445,7 +1479,7 @@
|
|
|
1445
1479
|
let r = We(e, t, !1);
|
|
1446
1480
|
if (r) {
|
|
1447
1481
|
const o = ln(e, t, E.DTP_STRING, n);
|
|
1448
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1482
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1449
1483
|
}
|
|
1450
1484
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1451
1485
|
}
|
|
@@ -1461,10 +1495,10 @@
|
|
|
1461
1495
|
return (o || l) && (1 === x || K(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Dt(e), Rt(e), fn(e), e.last_state.state_name))), !0;
|
|
1462
1496
|
}
|
|
1463
1497
|
function fn(e) {
|
|
1464
|
-
return
|
|
1498
|
+
return Xo(e) ? e.current_state.state_name : (ir("hgobj NULL"), "");
|
|
1465
1499
|
}
|
|
1466
1500
|
function gn(e, t, n) {
|
|
1467
|
-
if (!
|
|
1501
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1468
1502
|
let r = Xe(e.gclass, t);
|
|
1469
1503
|
if (r) return r;
|
|
1470
1504
|
if (n) {
|
|
@@ -1486,7 +1520,7 @@
|
|
|
1486
1520
|
}
|
|
1487
1521
|
var pn = [], mn = !1;
|
|
1488
1522
|
function hn(e, t, r, o) {
|
|
1489
|
-
return e && e instanceof I ? e.obflag & (U.obflag_destroyed | U.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) :
|
|
1523
|
+
return e && e instanceof I ? e.obflag & (U.obflag_destroyed | U.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Zo(t) ? (ir("gobj_post_event(): event EMPTY"), -1) : dn(e, t, 0) ? pn.length >= 1e4 ? (ir(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${pn.length}`), -1) : (pn.push({
|
|
1490
1524
|
dst: e,
|
|
1491
1525
|
event: t,
|
|
1492
1526
|
kw: r,
|
|
@@ -1552,7 +1586,7 @@
|
|
|
1552
1586
|
if (1 === x) K(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", kt(e), l.state_name, o && !o.running ? "!!" : "", kt(o)));
|
|
1553
1587
|
else {
|
|
1554
1588
|
let r = "";
|
|
1555
|
-
s.action && (r =
|
|
1589
|
+
s.action && (r = ei(s.action)), K(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Dt(e), Rt(e), l.state_name, "", t || "", "", r, o && !o.running ? "!!" : "", Dt(o), Rt(o)));
|
|
1556
1590
|
}
|
|
1557
1591
|
r && re(e) && Vo(r) && $o(r);
|
|
1558
1592
|
}
|
|
@@ -1571,7 +1605,7 @@
|
|
|
1571
1605
|
} finally {
|
|
1572
1606
|
En(a);
|
|
1573
1607
|
}
|
|
1574
|
-
return i && 1 !== x && !a.destroyed && K(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Dt(e), Rt(e), e.current_state.state_name, t || "",
|
|
1608
|
+
return i && 1 !== x && !a.destroyed && K(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Dt(e), Rt(e), e.current_state.state_name, t || "", qo(u) ? u : 0)), h--, u;
|
|
1575
1609
|
}
|
|
1576
1610
|
var On = Object.freeze({
|
|
1577
1611
|
__rename_event_name__: 1,
|
|
@@ -1604,34 +1638,34 @@
|
|
|
1604
1638
|
];
|
|
1605
1639
|
function Nn(e, t) {
|
|
1606
1640
|
let n = e ? e.__config__ : null;
|
|
1607
|
-
if (!
|
|
1641
|
+
if (!Bo(n) || !ll(n, "__hard_subscription__") && !ll(n, "__own_event__") && !ll(n, "__rename_event_name__")) return {
|
|
1608
1642
|
kw: e,
|
|
1609
1643
|
renamed_event: ""
|
|
1610
1644
|
};
|
|
1611
1645
|
let r = Do({}, e), o = Do({}, n);
|
|
1612
1646
|
r.__config__ = o;
|
|
1613
|
-
let l = "", i = o.__rename_event_name__, s = "string" != typeof i ||
|
|
1647
|
+
let l = "", i = o.__rename_event_name__, s = "string" != typeof i || Zo(i) ? null : Sn(i, 0, !1);
|
|
1614
1648
|
return s && (l = s.event_name, delete o.__rename_event_name__, t && xo(r.__global__) > 0 && (r.__global__ = Do(Do({}, r.__global__), { __original_event_name__: t }))), delete o.__hard_subscription__, delete o.__own_event__, {
|
|
1615
1649
|
kw: r,
|
|
1616
1650
|
renamed_event: l
|
|
1617
1651
|
};
|
|
1618
1652
|
}
|
|
1619
1653
|
function $n(e, t, n, r, o, l) {
|
|
1620
|
-
let i =
|
|
1621
|
-
if (t && t !==
|
|
1622
|
-
let t =
|
|
1654
|
+
let i = bl(t, o, "__config__", null), s = bl(t, o, "__global__", null), a = bl(t, o, "__local__", null), u = pl(t, o, "__filter__", null), _ = !0;
|
|
1655
|
+
if (t && t !== dl(null, e, "publisher", null) && (_ = !1), l && l !== dl(null, e, "subscriber", null) && (_ = !1), n && n !== gl(null, e, "event", "") && (_ = !1), r && r !== gl(null, e, "renamed_event", "") && (_ = !1), xo(i) > 0) {
|
|
1656
|
+
let t = bl(null, e, "__config__", null);
|
|
1623
1657
|
xo(t) > 0 && Ro(t, i) || (_ = !1);
|
|
1624
1658
|
}
|
|
1625
1659
|
if (xo(s) > 0) {
|
|
1626
|
-
let t =
|
|
1660
|
+
let t = bl(null, e, "__global__", null);
|
|
1627
1661
|
xo(t) > 0 && Ro(t, s) || (_ = !1);
|
|
1628
1662
|
}
|
|
1629
1663
|
if (xo(a) > 0) {
|
|
1630
|
-
let t =
|
|
1664
|
+
let t = bl(null, e, "__local__", null);
|
|
1631
1665
|
xo(t) > 0 && Ro(t, a) || (_ = !1);
|
|
1632
1666
|
}
|
|
1633
1667
|
if (xo(u) > 0) {
|
|
1634
|
-
let t =
|
|
1668
|
+
let t = pl(null, e, "__filter__", null);
|
|
1635
1669
|
xo(t) > 0 && Ro(t, u) || (_ = !1);
|
|
1636
1670
|
}
|
|
1637
1671
|
return _;
|
|
@@ -1648,8 +1682,8 @@
|
|
|
1648
1682
|
return e.indexOf(t);
|
|
1649
1683
|
}
|
|
1650
1684
|
function Dn(e, t, r, o) {
|
|
1651
|
-
let l =
|
|
1652
|
-
if (!!(
|
|
1685
|
+
let l = dl(e, t, "publisher", null, Un.KW_REQUIRED), i = dl(e, t, "subscriber", null, Un.KW_REQUIRED), s = gl(e, t, "event", "", Un.KW_REQUIRED);
|
|
1686
|
+
if (!!(fl(e, t, "subs_flag", null, Un.KW_REQUIRED) & On.__hard_subscription__) && !r) return -1;
|
|
1653
1687
|
let a = te(i) || te(l);
|
|
1654
1688
|
if (Rn(l.dl_subscriptions, t) < 0) return a && K(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", s || "", kt(l), kt(i))), 1;
|
|
1655
1689
|
a && (K(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", kt(l), kt(i))), _r(t)), l.obflag & U.obflag_destroyed || o || l.gclass.gmt.mt_subscription_deleted && l.gclass.gmt.mt_subscription_deleted(l, t);
|
|
@@ -1668,10 +1702,10 @@
|
|
|
1668
1702
|
]);
|
|
1669
1703
|
if (Object.keys(r).forEach((n) => {
|
|
1670
1704
|
l.has(n) || ir(`${kt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1671
|
-
}),
|
|
1705
|
+
}), Zo(t)) t = "";
|
|
1672
1706
|
else if (!(bn(e, t, F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ${t}`), 0;
|
|
1673
1707
|
let i = Nn(r, t), s = An(e.dl_subscriptions, e, t, i.renamed_event, i.kw, o), a = null;
|
|
1674
|
-
for (let t = 0; t < s.length; t++) if (
|
|
1708
|
+
for (let t = 0; t < s.length; t++) if (fl(e, s[t], "subs_flag", 0, Un.KW_REQUIRED) & On.__hard_subscription__) {
|
|
1675
1709
|
a = s[t];
|
|
1676
1710
|
break;
|
|
1677
1711
|
}
|
|
@@ -1682,29 +1716,29 @@
|
|
|
1682
1716
|
Uo(o, "event", t), Uo(o, "subscriber", r), Uo(o, "publisher", e);
|
|
1683
1717
|
let l = 0;
|
|
1684
1718
|
if (n) {
|
|
1685
|
-
let r =
|
|
1719
|
+
let r = bl(e, n, "__config__", null), i = bl(e, n, "__global__", null), s = bl(e, n, "__local__", null), a = pl(e, n, "__filter__", null), u = gl(e, n, "__service__", "");
|
|
1686
1720
|
if (xo(i) > 0 && Uo(o, "__global__", Ao(i)), xo(r) > 0) {
|
|
1687
1721
|
let n = Ao(r);
|
|
1688
1722
|
Uo(o, "__config__", n);
|
|
1689
|
-
let i =
|
|
1690
|
-
if (!
|
|
1723
|
+
let i = gl(e, n, "__rename_event_name__", "");
|
|
1724
|
+
if (!Zo(i)) {
|
|
1691
1725
|
let r = Sn(i, 0, !1);
|
|
1692
1726
|
if (r) {
|
|
1693
1727
|
Uo(o, "renamed_event", r.event_name), delete n.__rename_event_name__, l |= On.__rename_event_name__;
|
|
1694
|
-
let i =
|
|
1695
|
-
|
|
1728
|
+
let i = bl(e, o, "__global__", null);
|
|
1729
|
+
Bo(i) || (i = {}, Uo(o, "__global__", i)), i.__original_event_name__ = t;
|
|
1696
1730
|
} else ir(`${kt(e)}: EVENT NOT FOUND (__rename_event_name__: ${i})`);
|
|
1697
1731
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
let t =
|
|
1732
|
+
if (ll(n, "__hard_subscription__")) {
|
|
1733
|
+
let t = cl(e, n, "__hard_subscription__", !1);
|
|
1700
1734
|
Po(n, "__hard_subscription__"), t && (l |= On.__hard_subscription__);
|
|
1701
1735
|
}
|
|
1702
|
-
if (
|
|
1703
|
-
let t =
|
|
1736
|
+
if (ll(n, "__own_event__")) {
|
|
1737
|
+
let t = cl(e, n, "__own_event__", !1);
|
|
1704
1738
|
Po(n, "__own_event__"), t && (l |= On.__own_event__);
|
|
1705
1739
|
}
|
|
1706
1740
|
}
|
|
1707
|
-
xo(s) > 0 && Uo(o, "__local__", Ao(s)), xo(a) > 0 && Uo(o, "__filter__", Ao(a)),
|
|
1741
|
+
xo(s) > 0 && Uo(o, "__local__", Ao(s)), xo(a) > 0 && Uo(o, "__filter__", Ao(a)), Zo(u) || Uo(o, "__service__", u);
|
|
1708
1742
|
}
|
|
1709
1743
|
return Uo(o, "subs_flag", l), o;
|
|
1710
1744
|
}(e, t, r, o);
|
|
@@ -1727,8 +1761,8 @@
|
|
|
1727
1761
|
return An(e.dl_subscribings, r, t, null, n, e);
|
|
1728
1762
|
}
|
|
1729
1763
|
function Ln(e, t, r) {
|
|
1730
|
-
if (
|
|
1731
|
-
if (
|
|
1764
|
+
if (Bo(r) || (r = {}), !e || e.obflag & (U.obflag_destroyed | U.obflag_destroying)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1765
|
+
if (Zo(t)) return ir(`${kt(e)}: event EMPTY`), -1;
|
|
1732
1766
|
let o = gn(e, t, !0);
|
|
1733
1767
|
if (!(o && o.event_flag & (F.EVF_SYSTEM_EVENT | F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ev ${t}`), -1;
|
|
1734
1768
|
let l = (te(e) || oe(e, t)) && !le(e, t);
|
|
@@ -1746,20 +1780,20 @@
|
|
|
1746
1780
|
if (n < 0) break;
|
|
1747
1781
|
if (!n) continue;
|
|
1748
1782
|
}
|
|
1749
|
-
let c =
|
|
1783
|
+
let c = dl(e, _, "subscriber", null, Un.KW_REQUIRED);
|
|
1750
1784
|
if (!c || Ut(c)) continue;
|
|
1751
|
-
let f =
|
|
1752
|
-
if (
|
|
1753
|
-
|
|
1754
|
-
let o =
|
|
1755
|
-
|
|
1785
|
+
let f = fl(e, _, "subs_flag", 0, Un.KW_REQUIRED), g = gl(e, _, "event", "", Un.KW_REQUIRED);
|
|
1786
|
+
if (Zo(g) || 0 === nl(g, t)) {
|
|
1787
|
+
bl(e, _, "__config__", null, 0);
|
|
1788
|
+
let o = bl(e, _, "__global__", null, 0), i = bl(e, _, "__local__", null, 0), g = pl(e, _, "__filter__", null, 0), d = _.renamed_event;
|
|
1789
|
+
Zo(d) && (d = t);
|
|
1756
1790
|
let b = 1;
|
|
1757
|
-
if (e.gclass.gmt.mt_publication_filter ? b = e.gclass.gmt.mt_publication_filter(e, t, r, c) : xo(g) > 0 && (b =
|
|
1791
|
+
if (e.gclass.gmt.mt_publication_filter ? b = e.gclass.gmt.mt_publication_filter(e, t, r, c) : xo(g) > 0 && (b = vl(r, g) ? 1 : 0, l && (K(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", b ? "👍" : "👎", t || "", kt(c), kt(e))), _r(g))), b < 0) break;
|
|
1758
1792
|
if (!b) continue;
|
|
1759
1793
|
let p = gn(c, t, !0);
|
|
1760
1794
|
if (p && p.event_flag & F.EVF_SYSTEM_EVENT && !dn(c, p.event_name, 0)) continue;
|
|
1761
1795
|
let m = r;
|
|
1762
|
-
(xo(i) > 0 || xo(o) > 0) && (m = Do({}, r)), xo(i) > 0 &&
|
|
1796
|
+
(xo(i) > 0 || xo(o) > 0) && (m = Do({}, r)), xo(i) > 0 && ol(m, i), xo(o) > 0 && Do(m, Ao(o)), l && (K(1 === x ? n("🔝🔄 %s (%s) %s%s", t || "", d || "", c.running ? "" : "!!", kt(c)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", c.running ? "" : "!!", kt(c), fn(c), t || "", d || "", e && !e.running ? "!!" : "", kt(e))), re(e) && Vo(m) && $o(m));
|
|
1763
1797
|
let h = jn(c, d, m, e);
|
|
1764
1798
|
if (h < 0 && f & On.__own_event__) {
|
|
1765
1799
|
s = -1;
|
|
@@ -1796,7 +1830,7 @@
|
|
|
1796
1830
|
var Fn = "undefined" != typeof window ? window.console : console, Mn = Fn.error, Gn = Fn.warn, Vn = Fn.info, Wn = Fn.debug, xn = null, Kn = 600, Bn = [];
|
|
1797
1831
|
var Yn = !0;
|
|
1798
1832
|
var Jn = null;
|
|
1799
|
-
function
|
|
1833
|
+
function qn(e, t) {
|
|
1800
1834
|
if (!Yn) return !1;
|
|
1801
1835
|
if (!Jn) return !0;
|
|
1802
1836
|
try {
|
|
@@ -1805,9 +1839,9 @@
|
|
|
1805
1839
|
return !0;
|
|
1806
1840
|
}
|
|
1807
1841
|
}
|
|
1808
|
-
var
|
|
1842
|
+
var Hn = !1;
|
|
1809
1843
|
function zn(e, t, n) {
|
|
1810
|
-
|
|
1844
|
+
Hn || (function(e, t, n) {
|
|
1811
1845
|
let r = t;
|
|
1812
1846
|
"json" === e && (r = Zn(t)), Bn.push([
|
|
1813
1847
|
e,
|
|
@@ -1817,12 +1851,12 @@
|
|
|
1817
1851
|
}(e, t, n), Qn(e, t, n));
|
|
1818
1852
|
}
|
|
1819
1853
|
function Qn(e, t, n) {
|
|
1820
|
-
if (xn && !
|
|
1821
|
-
|
|
1854
|
+
if (xn && !Hn) {
|
|
1855
|
+
Hn = !0;
|
|
1822
1856
|
try {
|
|
1823
1857
|
xn(e, t, n);
|
|
1824
1858
|
} catch (e) {} finally {
|
|
1825
|
-
|
|
1859
|
+
Hn = !1;
|
|
1826
1860
|
}
|
|
1827
1861
|
}
|
|
1828
1862
|
}
|
|
@@ -1901,22 +1935,22 @@
|
|
|
1901
1935
|
}
|
|
1902
1936
|
function ir(e, ...t) {
|
|
1903
1937
|
let n = nr(e, ...t), r = Hl();
|
|
1904
|
-
Mn && (Mn === Fn.error ?
|
|
1938
|
+
Mn && (Mn === Fn.error ? qn("error", n) && rr(Mn, "%c" + r + " ERROR: " + String(n), "color:red") : (qn("error", n) && Fn.error("%c" + r + " ERROR: " + String(n), "color:red"), lr(Mn, `${r} ERROR: ${String(n)}`))), zn("error", n, r);
|
|
1905
1939
|
}
|
|
1906
1940
|
function sr(e, ...t) {
|
|
1907
1941
|
let n = nr(e, ...t), r = Hl();
|
|
1908
|
-
Gn && (Gn === Fn.warn ?
|
|
1942
|
+
Gn && (Gn === Fn.warn ? qn("warning", n) && rr(Gn, "%c" + r + " WARNING: " + String(n), "color:yellow") : (qn("warning", n) && Fn.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), lr(Gn, `${r} WARNING: ${String(n)}`))), zn("warning", n, r);
|
|
1909
1943
|
}
|
|
1910
1944
|
function ar(e, ...t) {
|
|
1911
1945
|
let n = nr(e, ...t), r = Hl();
|
|
1912
|
-
Wn &&
|
|
1946
|
+
Wn && qn("debug", n) && rr(Wn, "%c" + r + " DEBUG: " + String(n), "color:silver"), zn("debug", n, r);
|
|
1913
1947
|
}
|
|
1914
1948
|
function ur(e, ...t) {
|
|
1915
1949
|
let n = nr(e, ...t), r = Hl();
|
|
1916
|
-
Wn &&
|
|
1950
|
+
Wn && qn("msg", n) && rr(Wn, "%c" + r + " MSG: " + String(n), "color:cyan"), zn("msg", n, r);
|
|
1917
1951
|
}
|
|
1918
1952
|
function _r(e, t) {
|
|
1919
|
-
|
|
1953
|
+
qn("json", t) && (t && rr(Fn.warn, "=====> " + er(t)), rr(Fn.dir, e)), zn("json", e, Hl());
|
|
1920
1954
|
}
|
|
1921
1955
|
function cr(e) {
|
|
1922
1956
|
const t = new Array(128).fill(null);
|
|
@@ -2260,9 +2294,9 @@
|
|
|
2260
2294
|
function Br(e, t, n) {
|
|
2261
2295
|
for (let r = t; r < n; r++) e[r] = 1;
|
|
2262
2296
|
}
|
|
2263
|
-
var Yr = 0, Jr = 1,
|
|
2264
|
-
function
|
|
2265
|
-
const l = n ===
|
|
2297
|
+
var Yr = 0, Jr = 1, qr = 2;
|
|
2298
|
+
function Hr(e, t, n, r, o) {
|
|
2299
|
+
const l = n === qr ? Tr : Er;
|
|
2266
2300
|
let i = !1;
|
|
2267
2301
|
const s = (t) => t >= e.length || " " === e[t] || " " === e[t] || "\0" === e[t];
|
|
2268
2302
|
let a = "", u = 0, _ = 0;
|
|
@@ -2476,7 +2510,7 @@
|
|
|
2476
2510
|
const s = i.join(""), a = new Uint8Array(s.length);
|
|
2477
2511
|
(function(e, t) {
|
|
2478
2512
|
const n = po(e, Er), r = new Uint8Array(e.length);
|
|
2479
|
-
|
|
2513
|
+
Hr(e, n, Yr, t, r), _o(e, t, r), fo(e, t), go(e, t), bo(e, t);
|
|
2480
2514
|
})(s, a), vo(s, a, n + 1);
|
|
2481
2515
|
let u = 0;
|
|
2482
2516
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -2486,13 +2520,13 @@
|
|
|
2486
2520
|
}
|
|
2487
2521
|
function Eo(e, t) {
|
|
2488
2522
|
const n = po(e, Er), r = po(e, Tr), o = new Uint8Array(e.length);
|
|
2489
|
-
(
|
|
2523
|
+
(Hr(e, n, Yr, t, o) || n !== r) && Hr(e, r, qr, t, null), function(e) {
|
|
2490
2524
|
for (let t = 0; t < e.length; t++) {
|
|
2491
2525
|
const n = e.charCodeAt(t);
|
|
2492
2526
|
if ((101 === n || 98 === n || 66 === n) && Mr(e, t)[1]) return !0;
|
|
2493
2527
|
}
|
|
2494
2528
|
return !1;
|
|
2495
|
-
}(e) &&
|
|
2529
|
+
}(e) && Hr(e, n, Jr, t, null), _o(e, t, o), fo(e, t), go(e, t), bo(e, t), vo(e, t, 0);
|
|
2496
2530
|
}
|
|
2497
2531
|
function To(e) {
|
|
2498
2532
|
if ("string" != typeof e) return null;
|
|
@@ -2564,7 +2598,7 @@
|
|
|
2564
2598
|
}
|
|
2565
2599
|
r.left -= 1 + a.length;
|
|
2566
2600
|
let u, _ = e[a];
|
|
2567
|
-
u = (jr(a, 0, a.length, Er) || o && "value" === a) && null != _ && "" !== _ ? "********" : wo(_, t, n + 1, r), u !== _ && (i = !0),
|
|
2601
|
+
u = (jr(a, 0, a.length, Er) || o && "value" === a) && null != _ && "" !== _ ? "********" : wo(_, t, n + 1, r), u !== _ && (i = !0), sl(l, a, u);
|
|
2568
2602
|
}
|
|
2569
2603
|
s && (l["<more>"] = Kr);
|
|
2570
2604
|
}
|
|
@@ -2606,17 +2640,17 @@
|
|
|
2606
2640
|
}
|
|
2607
2641
|
function Do(e, t) {
|
|
2608
2642
|
if (!t) return e;
|
|
2609
|
-
for (let n of Object.keys(t))
|
|
2643
|
+
for (let n of Object.keys(t)) sl(e, n, t[n]);
|
|
2610
2644
|
return e;
|
|
2611
2645
|
}
|
|
2612
2646
|
function ko(e, t) {
|
|
2613
2647
|
if (!t) return e;
|
|
2614
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2648
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && sl(e, n, t[n]);
|
|
2615
2649
|
return e;
|
|
2616
2650
|
}
|
|
2617
2651
|
function Co(e, t) {
|
|
2618
2652
|
if (!t) return e;
|
|
2619
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2653
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && sl(e, n, t[n]);
|
|
2620
2654
|
return e;
|
|
2621
2655
|
}
|
|
2622
2656
|
function Io(e, t) {
|
|
@@ -2626,10 +2660,10 @@
|
|
|
2626
2660
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
2627
2661
|
}
|
|
2628
2662
|
function Lo(e, t, n) {
|
|
2629
|
-
|
|
2663
|
+
sl(e, t, n);
|
|
2630
2664
|
}
|
|
2631
2665
|
function Uo(e, t, n) {
|
|
2632
|
-
|
|
2666
|
+
sl(e, t, n);
|
|
2633
2667
|
}
|
|
2634
2668
|
function Fo(e, t) {
|
|
2635
2669
|
e.push(t);
|
|
@@ -2641,54 +2675,57 @@
|
|
|
2641
2675
|
e.splice(t, 1);
|
|
2642
2676
|
}
|
|
2643
2677
|
function Vo(e) {
|
|
2644
|
-
return
|
|
2678
|
+
return Bo(e) ? Object.keys(e).length : 0;
|
|
2645
2679
|
}
|
|
2646
2680
|
function Wo(e) {
|
|
2647
|
-
return
|
|
2681
|
+
return Yo(e) ? e.length : 0;
|
|
2648
2682
|
}
|
|
2649
2683
|
function xo(e) {
|
|
2650
|
-
return
|
|
2684
|
+
return Bo(e) ? Object.keys(e).length : Yo(e) ? e.length : Jo(e) && e.length > 0 ? 1 : 0;
|
|
2651
2685
|
}
|
|
2652
2686
|
function Ko(e) {
|
|
2653
|
-
return
|
|
2687
|
+
return 0 === xo(e);
|
|
2654
2688
|
}
|
|
2655
2689
|
function Bo(e) {
|
|
2656
|
-
return Array.isArray(e);
|
|
2690
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
2657
2691
|
}
|
|
2658
2692
|
function Yo(e) {
|
|
2659
|
-
return
|
|
2693
|
+
return Array.isArray(e);
|
|
2660
2694
|
}
|
|
2661
2695
|
function Jo(e) {
|
|
2696
|
+
return "string" == typeof e;
|
|
2697
|
+
}
|
|
2698
|
+
function qo(e) {
|
|
2662
2699
|
return "number" == typeof e && Number.isFinite(e);
|
|
2663
2700
|
}
|
|
2664
2701
|
function Ho(e) {
|
|
2665
2702
|
return "boolean" == typeof e;
|
|
2666
2703
|
}
|
|
2667
|
-
function qo(e) {
|
|
2668
|
-
return null == e;
|
|
2669
|
-
}
|
|
2670
2704
|
function zo(e) {
|
|
2671
|
-
return
|
|
2705
|
+
return null == e;
|
|
2672
2706
|
}
|
|
2673
2707
|
function Qo(e) {
|
|
2674
|
-
return
|
|
2708
|
+
return "function" == typeof e;
|
|
2675
2709
|
}
|
|
2676
2710
|
function Xo(e) {
|
|
2677
|
-
return
|
|
2711
|
+
return e instanceof I;
|
|
2678
2712
|
}
|
|
2679
2713
|
function Zo(e) {
|
|
2680
|
-
return Jo(e)
|
|
2714
|
+
return !Jo(e) || 0 === e.length;
|
|
2681
2715
|
}
|
|
2682
|
-
function el(e
|
|
2683
|
-
return e
|
|
2716
|
+
function el(e) {
|
|
2717
|
+
return qo(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
2684
2718
|
}
|
|
2685
2719
|
function tl(e, t) {
|
|
2720
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
2721
|
+
}
|
|
2722
|
+
function nl(e, t) {
|
|
2686
2723
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2687
2724
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
2688
2725
|
}
|
|
2689
|
-
function
|
|
2690
|
-
if (
|
|
2691
|
-
if (
|
|
2726
|
+
function rl(e, t) {
|
|
2727
|
+
if (Bo(e) || Bo(t) || Yo(e) || Yo(t)) return 0;
|
|
2728
|
+
if (qo(e) || qo(t)) {
|
|
2692
2729
|
let n = Number(e), r = Number(t);
|
|
2693
2730
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
2694
2731
|
}
|
|
@@ -2696,20 +2733,20 @@
|
|
|
2696
2733
|
let n = Number(e), r = Number(t);
|
|
2697
2734
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2698
2735
|
}
|
|
2699
|
-
return
|
|
2736
|
+
return tl(String(e), String(t));
|
|
2700
2737
|
}
|
|
2701
|
-
function
|
|
2702
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
2738
|
+
function ol(e, t) {
|
|
2739
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) ol(e, n);
|
|
2703
2740
|
else "string" == typeof t && delete e[t];
|
|
2704
2741
|
else for (const n of Object.keys(t)) delete e[n];
|
|
2705
2742
|
}
|
|
2706
|
-
function
|
|
2743
|
+
function ll(e, t) {
|
|
2707
2744
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
2708
2745
|
}
|
|
2709
|
-
function
|
|
2746
|
+
function il(e, t) {
|
|
2710
2747
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
2711
2748
|
}
|
|
2712
|
-
function
|
|
2749
|
+
function sl(e, t, n) {
|
|
2713
2750
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
2714
2751
|
value: n,
|
|
2715
2752
|
writable: !0,
|
|
@@ -2717,81 +2754,81 @@
|
|
|
2717
2754
|
configurable: !0
|
|
2718
2755
|
}) : e[t] = n;
|
|
2719
2756
|
}
|
|
2720
|
-
function
|
|
2757
|
+
function al(e, t) {
|
|
2721
2758
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
2722
2759
|
const n = Number(t);
|
|
2723
2760
|
return n >= e.length ? -1 : n;
|
|
2724
2761
|
}
|
|
2725
|
-
function
|
|
2726
|
-
e && !
|
|
2762
|
+
function ul(e, t, n, r) {
|
|
2763
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2727
2764
|
const o = e ? `${kt(e)}: ` : "";
|
|
2728
|
-
if (!
|
|
2729
|
-
if (!
|
|
2765
|
+
if (!Bo(t) && !Yo(t)) return void ir(`${o}kw must be list or dict: '${String(n)}'`);
|
|
2766
|
+
if (!Jo(n)) return void ir(`${o}path must be a string: ${String(n)}`);
|
|
2730
2767
|
let l = n.split("`"), i = l.length;
|
|
2731
2768
|
for (let e = 0; e < i; e++) {
|
|
2732
|
-
if (
|
|
2733
|
-
const i =
|
|
2769
|
+
if (Yo(t)) {
|
|
2770
|
+
const i = al(t, l[e]);
|
|
2734
2771
|
if (i < 0) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2735
2772
|
l[e] = String(i);
|
|
2736
2773
|
}
|
|
2737
|
-
if (
|
|
2774
|
+
if (il(t, l[e])) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2738
2775
|
if (e === i - 1) break;
|
|
2739
2776
|
if (null == (t = t[l[e]])) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2740
|
-
if (!
|
|
2777
|
+
if (!Bo(t) && !Yo(t)) return void ir(`${o}kw must be list or dict: '${n}'`);
|
|
2741
2778
|
}
|
|
2742
2779
|
let s = t[l[i - 1]];
|
|
2743
2780
|
return void 0 === s && r && ir(`${o}path not found: '${n}'`), s;
|
|
2744
2781
|
}
|
|
2745
|
-
function
|
|
2746
|
-
e && !
|
|
2782
|
+
function _l(e, t, n) {
|
|
2783
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2747
2784
|
const r = e ? kt(e) + ": " : "";
|
|
2748
|
-
if (!
|
|
2785
|
+
if (!Jo(n)) return ir(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
2749
2786
|
let [o, l] = function(e, t) {
|
|
2750
2787
|
let n = e.lastIndexOf(t);
|
|
2751
2788
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
2752
2789
|
}(n, "`"), i = t;
|
|
2753
|
-
if (
|
|
2754
|
-
else if (i =
|
|
2755
|
-
return
|
|
2790
|
+
if (Zo(l)) l = n;
|
|
2791
|
+
else if (i = ul(e, t, o, !0), void 0 === i) return -1;
|
|
2792
|
+
return Yo(i) ? (ir(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : Bo(i) && Object.prototype.hasOwnProperty.call(i, l) ? (delete i[l], 0) : (ir(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
2756
2793
|
}
|
|
2757
|
-
function
|
|
2758
|
-
e && !
|
|
2759
|
-
let l =
|
|
2794
|
+
function cl(e, t, n, r, o) {
|
|
2795
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2796
|
+
let l = ul(e, t, n, !1);
|
|
2760
2797
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
2761
2798
|
if (void 0 === l) {
|
|
2762
2799
|
if (s && t) {
|
|
2763
2800
|
let o = Boolean(r);
|
|
2764
|
-
return
|
|
2801
|
+
return ml(e, t, n, o), o;
|
|
2765
2802
|
}
|
|
2766
2803
|
return i && (ir(`path not found: '${n}'`), $o(t)), Boolean(r);
|
|
2767
2804
|
}
|
|
2768
2805
|
let _;
|
|
2769
2806
|
if (Ho(l)) _ = l;
|
|
2770
|
-
else if (u &&
|
|
2771
|
-
else if (u &&
|
|
2807
|
+
else if (u && qo(l)) _ = 0 !== l;
|
|
2808
|
+
else if (u && Jo(l)) _ = "true" === l.toLowerCase() || "false" !== l.toLowerCase() && 0 !== (parseInt(l, 10) || 0);
|
|
2772
2809
|
else {
|
|
2773
2810
|
if (!u || null !== l) return u ? (ir(`${e ? kt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $o(t), !1) : (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), $o(t), Boolean(r));
|
|
2774
2811
|
_ = !1;
|
|
2775
2812
|
}
|
|
2776
|
-
return a &&
|
|
2813
|
+
return a && _l(e, t, n), _;
|
|
2777
2814
|
}
|
|
2778
|
-
function
|
|
2779
|
-
e && !
|
|
2780
|
-
let l =
|
|
2815
|
+
function fl(e, t, n, r, o) {
|
|
2816
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2817
|
+
let l = ul(e, t, n, !1);
|
|
2781
2818
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
2782
2819
|
if (void 0 === l) {
|
|
2783
2820
|
if (s && t) {
|
|
2784
2821
|
let o = parseInt(r);
|
|
2785
|
-
return
|
|
2822
|
+
return ml(e, t, n, o), o;
|
|
2786
2823
|
}
|
|
2787
2824
|
return i && (ir(`path not found: '${n}'`), $o(t)), parseInt(r);
|
|
2788
2825
|
}
|
|
2789
2826
|
let _;
|
|
2790
|
-
if (
|
|
2827
|
+
if (qo(l)) _ = Math.trunc(l);
|
|
2791
2828
|
else {
|
|
2792
2829
|
if (!u) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a json integer: '${n}'`), $o(t), parseInt(r);
|
|
2793
2830
|
if (Ho(l)) _ = l ? 1 : 0;
|
|
2794
|
-
else if (
|
|
2831
|
+
else if (Jo(l)) _ = function(e) {
|
|
2795
2832
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
2796
2833
|
if (!t) return 0;
|
|
2797
2834
|
let n, r = t[2];
|
|
@@ -2802,120 +2839,120 @@
|
|
|
2802
2839
|
_ = 0;
|
|
2803
2840
|
}
|
|
2804
2841
|
}
|
|
2805
|
-
return a &&
|
|
2842
|
+
return a && _l(e, t, n), _;
|
|
2806
2843
|
}
|
|
2807
|
-
function
|
|
2808
|
-
e && !
|
|
2809
|
-
let l =
|
|
2844
|
+
function gl(e, t, n, r, o) {
|
|
2845
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2846
|
+
let l = ul(e, t, n, !1);
|
|
2810
2847
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2811
|
-
return void 0 === l ? s && t ? (
|
|
2812
|
-
let n =
|
|
2848
|
+
return void 0 === l ? s && t ? (ml(e, t, n, Jo(r) ? r : null), r) : (i && !function(e, t) {
|
|
2849
|
+
let n = Jo(t) ? t.split("`") : [], r = e;
|
|
2813
2850
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2814
|
-
if (!
|
|
2851
|
+
if (!Bo(r) && !Yo(r)) return !1;
|
|
2815
2852
|
r = r[n[e]];
|
|
2816
2853
|
}
|
|
2817
|
-
return !(!
|
|
2818
|
-
}(t, n) && (ir(`path not found: '${n}'`), $o(t)), r) :
|
|
2854
|
+
return !(!Bo(r) && !Yo(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2855
|
+
}(t, n) && (ir(`path not found: '${n}'`), $o(t)), r) : Jo(l) ? (a && _l(e, t, n), l) : (null !== l && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json str: '${n}'`), $o(t)), r);
|
|
2819
2856
|
}
|
|
2820
|
-
function
|
|
2821
|
-
e && !
|
|
2822
|
-
let l =
|
|
2857
|
+
function dl(e, t, n, r, o) {
|
|
2858
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2859
|
+
let l = ul(e, t, n, !1);
|
|
2823
2860
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2824
2861
|
if (void 0 === l) {
|
|
2825
2862
|
if (s) {
|
|
2826
2863
|
let o = r;
|
|
2827
|
-
return
|
|
2864
|
+
return ml(e, t, n, o), o;
|
|
2828
2865
|
}
|
|
2829
2866
|
return i && (ir(`path not found: '${n}'`), $o(t)), r;
|
|
2830
2867
|
}
|
|
2831
|
-
return a &&
|
|
2868
|
+
return a && _l(e, t, n), l;
|
|
2832
2869
|
}
|
|
2833
|
-
function
|
|
2834
|
-
e && !
|
|
2835
|
-
let l =
|
|
2870
|
+
function bl(e, t, n, r, o) {
|
|
2871
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2872
|
+
let l = ul(e, t, n, !1);
|
|
2836
2873
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2837
|
-
return void 0 === l ? s &&
|
|
2874
|
+
return void 0 === l ? s && Bo(r) && t ? (ml(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), $o(t)), r) : Bo(l) ? (a && _l(e, t, n), l) : s && null === l && Bo(r) ? (ml(e, t, n, r), r) : s && null === l ? (i && (ir(`path not found: '${n}'`), $o(t)), r) : ((i || s) && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (s ? ", cannot create" : "")), $o(t)), r);
|
|
2838
2875
|
}
|
|
2839
|
-
function
|
|
2840
|
-
e && !
|
|
2841
|
-
let l =
|
|
2876
|
+
function pl(e, t, n, r, o) {
|
|
2877
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2878
|
+
let l = ul(e, t, n, !1);
|
|
2842
2879
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2843
2880
|
if (void 0 === l) {
|
|
2844
2881
|
if (s) {
|
|
2845
2882
|
let o = r;
|
|
2846
|
-
return
|
|
2883
|
+
return ml(e, t, n, o), o;
|
|
2847
2884
|
}
|
|
2848
2885
|
return i && (ir(`path not found: '${n}'`), $o(t)), r;
|
|
2849
2886
|
}
|
|
2850
|
-
return a &&
|
|
2887
|
+
return a && _l(e, t, n), l;
|
|
2851
2888
|
}
|
|
2852
|
-
function
|
|
2853
|
-
if (e && !
|
|
2854
|
-
if (!
|
|
2889
|
+
function ml(e, t, n, r) {
|
|
2890
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !Bo(t)) return ir("kw is not an object"), -1;
|
|
2891
|
+
if (!Jo(n)) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2855
2892
|
if ("" === n) return ir((e ? kt(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2856
2893
|
if (n.split("`").includes("")) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
2857
2894
|
let o = n.split("`"), l = o.length;
|
|
2858
2895
|
for (let i = 0; i < l; i++) {
|
|
2859
2896
|
let s = o[i];
|
|
2860
|
-
if (
|
|
2861
|
-
const r =
|
|
2897
|
+
if (Yo(t)) {
|
|
2898
|
+
const r = al(t, s);
|
|
2862
2899
|
if (r < 0) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not an index of its list: '${n}'`), -1;
|
|
2863
2900
|
s = String(r);
|
|
2864
2901
|
}
|
|
2865
|
-
if (i === l - 1)
|
|
2902
|
+
if (i === l - 1) sl(t, s, r);
|
|
2866
2903
|
else {
|
|
2867
|
-
let r =
|
|
2868
|
-
if (void 0 === r)
|
|
2869
|
-
else if (!
|
|
2904
|
+
let r = il(t, s) ? void 0 : t[s];
|
|
2905
|
+
if (void 0 === r) sl(t, s, {});
|
|
2906
|
+
else if (!Bo(r) && !Yo(r)) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not a dict or a list: '${n}'`), -1;
|
|
2870
2907
|
t = t[s];
|
|
2871
2908
|
}
|
|
2872
2909
|
}
|
|
2873
2910
|
return 0;
|
|
2874
2911
|
}
|
|
2875
|
-
function
|
|
2876
|
-
if (e && !
|
|
2877
|
-
let l =
|
|
2912
|
+
function hl(e, t, n, r, o) {
|
|
2913
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !Bo(t)) return ir("kw is not an object"), -1;
|
|
2914
|
+
let l = ul(e, t, n, !1);
|
|
2878
2915
|
if (void 0 === l) {
|
|
2879
|
-
if (!
|
|
2916
|
+
if (!Jo(n) || function(e, t) {
|
|
2880
2917
|
let n = t.split("`"), r = e;
|
|
2881
2918
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2882
|
-
if (
|
|
2883
|
-
const t =
|
|
2919
|
+
if (Yo(r)) {
|
|
2920
|
+
const t = al(r, n[e]);
|
|
2884
2921
|
if (t < 0) return !1;
|
|
2885
2922
|
r = r[t];
|
|
2886
2923
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
2887
2924
|
if (null == r) return !1;
|
|
2888
|
-
if (!
|
|
2925
|
+
if (!Bo(r) && !Yo(r)) return !0;
|
|
2889
2926
|
}
|
|
2890
2927
|
return !1;
|
|
2891
2928
|
}(t, n)) return -1;
|
|
2892
|
-
if (l = {},
|
|
2929
|
+
if (l = {}, ml(e, t, n, l) < 0) return -1;
|
|
2893
2930
|
}
|
|
2894
|
-
return
|
|
2931
|
+
return Bo(l) ? (sl(l, r, o), 0) : (ir(`subdict is not an object: '${n}'`), -1);
|
|
2895
2932
|
}
|
|
2896
|
-
function
|
|
2933
|
+
function yl(e, t, r) {
|
|
2897
2934
|
let o = "", l = !1;
|
|
2898
|
-
if (
|
|
2935
|
+
if (Yo(t)) {
|
|
2899
2936
|
l = !1;
|
|
2900
2937
|
for (let i = 0; i < t.length; i++) {
|
|
2901
2938
|
let s = t[i];
|
|
2902
|
-
if (o =
|
|
2939
|
+
if (o = Zo(r) ? n("%s", r) : n("%s`%d", r, i), l = yl(e, s, o), l) break;
|
|
2903
2940
|
}
|
|
2904
|
-
} else if (
|
|
2941
|
+
} else if (Bo(t)) {
|
|
2905
2942
|
l = !0;
|
|
2906
2943
|
let i = Object.keys(t);
|
|
2907
2944
|
for (let s = 0; s < i.length; s++) {
|
|
2908
2945
|
let a = i[s], u = t[a];
|
|
2909
|
-
if (o =
|
|
2910
|
-
if (l =
|
|
2946
|
+
if (o = Zo(r) ? n("%s", a) : n("%s`%s", r, a), Yo(u) || Bo(u)) {
|
|
2947
|
+
if (l = yl(e, u, o), !l) break;
|
|
2911
2948
|
continue;
|
|
2912
2949
|
}
|
|
2913
|
-
let _ =
|
|
2950
|
+
let _ = pl(0, e, o, void 0, 0);
|
|
2914
2951
|
if (void 0 === _ && (_ = Io(e, o)), void 0 === _) {
|
|
2915
2952
|
l = !1;
|
|
2916
2953
|
break;
|
|
2917
2954
|
}
|
|
2918
|
-
if (0 !==
|
|
2955
|
+
if (0 !== rl(_, u)) {
|
|
2919
2956
|
l = !1;
|
|
2920
2957
|
break;
|
|
2921
2958
|
}
|
|
@@ -2923,34 +2960,34 @@
|
|
|
2923
2960
|
}
|
|
2924
2961
|
return l;
|
|
2925
2962
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return 0 === xo(t) ||
|
|
2963
|
+
function vl(e, t) {
|
|
2964
|
+
return 0 === xo(t) || yl(e, t, "");
|
|
2928
2965
|
}
|
|
2929
|
-
function
|
|
2930
|
-
e && !
|
|
2966
|
+
function El(e, t, n, r) {
|
|
2967
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2931
2968
|
let o = {};
|
|
2932
|
-
if (
|
|
2969
|
+
if (Jo(n) && !Zo(n)) {
|
|
2933
2970
|
let l = n;
|
|
2934
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
2935
|
-
} else if (
|
|
2971
|
+
Object.prototype.hasOwnProperty.call(t, l) ? sl(o, l, t[l]) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2972
|
+
} else if (Bo(n) && Vo(n) > 0) for (let l of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, l) ? sl(o, l, t[l]) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2936
2973
|
else {
|
|
2937
|
-
if (!(
|
|
2974
|
+
if (!(Yo(n) && Wo(n) > 0)) return t;
|
|
2938
2975
|
for (let l = 0; l < n.length; l++) {
|
|
2939
2976
|
let i = n[l];
|
|
2940
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2977
|
+
Object.prototype.hasOwnProperty.call(t, i) ? sl(o, i, t[i]) : r && ir(`${kt(e)}: key not found: ${i}`);
|
|
2941
2978
|
}
|
|
2942
2979
|
}
|
|
2943
2980
|
return o;
|
|
2944
2981
|
}
|
|
2945
|
-
function
|
|
2982
|
+
function Tl(e, t, n, r) {
|
|
2946
2983
|
let o = {};
|
|
2947
|
-
if (!
|
|
2948
|
-
if (Do(o, t),
|
|
2984
|
+
if (!Bo(t)) return o;
|
|
2985
|
+
if (Do(o, t), Jo(n) && !Zo(n)) {
|
|
2949
2986
|
let l = n;
|
|
2950
2987
|
Object.prototype.hasOwnProperty.call(t, l) ? Po(o, l) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2951
|
-
} else if (
|
|
2988
|
+
} else if (Bo(n) && Vo(n) > 0) for (let l of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, l) ? Po(o, l) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2952
2989
|
else {
|
|
2953
|
-
if (!(
|
|
2990
|
+
if (!(Yo(n) && Wo(n) > 0)) return {};
|
|
2954
2991
|
for (let l = 0; l < n.length; l++) {
|
|
2955
2992
|
let i = n[l];
|
|
2956
2993
|
Object.prototype.hasOwnProperty.call(t, i) ? Po(o, i) : r && ir(`${kt(e)}: key not found: ${i}`);
|
|
@@ -2958,7 +2995,7 @@
|
|
|
2958
2995
|
}
|
|
2959
2996
|
return o;
|
|
2960
2997
|
}
|
|
2961
|
-
function
|
|
2998
|
+
function jl() {
|
|
2962
2999
|
if ("undefined" == typeof window) return null;
|
|
2963
3000
|
let e;
|
|
2964
3001
|
try {
|
|
@@ -2975,39 +3012,47 @@
|
|
|
2975
3012
|
}
|
|
2976
3013
|
return e || null;
|
|
2977
3014
|
}
|
|
2978
|
-
var
|
|
2979
|
-
function
|
|
2980
|
-
|
|
3015
|
+
var Ol = /* @__PURE__ */ new Set();
|
|
3016
|
+
function Sl(e, t) {
|
|
3017
|
+
Ol.has(e) || (Ol.add(e), sr(t));
|
|
2981
3018
|
}
|
|
2982
|
-
function
|
|
2983
|
-
const r =
|
|
3019
|
+
function wl(e, t, n = !1) {
|
|
3020
|
+
const r = jl();
|
|
2984
3021
|
if (!r) return t;
|
|
2985
3022
|
const o = `kw_get_local_storage_value(): localStorage key "${e}"`;
|
|
2986
3023
|
let l;
|
|
2987
3024
|
try {
|
|
2988
3025
|
l = r.getItem(e);
|
|
2989
3026
|
} catch (n) {
|
|
2990
|
-
return
|
|
3027
|
+
return Sl(e, `${o} cannot be read (storage blocked?): the default is used`), t;
|
|
2991
3028
|
}
|
|
2992
|
-
let i = null;
|
|
3029
|
+
let i = !0, s = null;
|
|
2993
3030
|
if (null !== l) try {
|
|
2994
|
-
|
|
3031
|
+
s = JSON.parse(l);
|
|
2995
3032
|
} catch (t) {
|
|
2996
|
-
|
|
3033
|
+
s = null;
|
|
2997
3034
|
try {
|
|
2998
|
-
r.removeItem(e), sr(`${o} does not hold json: removed, the default is used`)
|
|
3035
|
+
r.removeItem(e), sr(`${o} does not hold json: removed, the default is used`);
|
|
2999
3036
|
} catch (t) {
|
|
3000
|
-
|
|
3037
|
+
i = !1, Sl(e, `${o} does not hold json and cannot be removed: the default is used`);
|
|
3001
3038
|
}
|
|
3002
|
-
l = void 0;
|
|
3003
3039
|
}
|
|
3004
|
-
|
|
3040
|
+
if (null === s && (s = t, n)) {
|
|
3041
|
+
const n = Fe(t);
|
|
3042
|
+
if (void 0 === n) ir(`${o}: cannot write the default: a value with no json text`);
|
|
3043
|
+
else try {
|
|
3044
|
+
r.setItem(e, n);
|
|
3045
|
+
} catch (t) {
|
|
3046
|
+
i = !1, Sl(e, `${o} cannot be written (storage full or blocked?): the default is used, not kept`);
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
return i && Ol.delete(e), s;
|
|
3005
3050
|
}
|
|
3006
|
-
function
|
|
3051
|
+
function Nl(e, t) {
|
|
3007
3052
|
if (!e) return ir(`kw_set_local_storage_value(): invalid key: key=${e}`), -1;
|
|
3008
3053
|
const n = Fe(t);
|
|
3009
3054
|
if (void 0 === n) return ir(`kw_set_local_storage_value(): cannot save "${e}": a value with no json text`), -1;
|
|
3010
|
-
const r =
|
|
3055
|
+
const r = jl();
|
|
3011
3056
|
if (!r) return 0;
|
|
3012
3057
|
try {
|
|
3013
3058
|
return r.setItem(e, n), 0;
|
|
@@ -3015,8 +3060,8 @@
|
|
|
3015
3060
|
return ir(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
3016
3061
|
}
|
|
3017
3062
|
}
|
|
3018
|
-
function
|
|
3019
|
-
const t =
|
|
3063
|
+
function $l(e) {
|
|
3064
|
+
const t = jl();
|
|
3020
3065
|
if (t) if (e) try {
|
|
3021
3066
|
t.removeItem(e);
|
|
3022
3067
|
} catch (t) {
|
|
@@ -3024,45 +3069,45 @@
|
|
|
3024
3069
|
}
|
|
3025
3070
|
else ir(`kw_remove_local_storage_value(): invalid key: key=${e}`);
|
|
3026
3071
|
}
|
|
3027
|
-
function
|
|
3028
|
-
if (
|
|
3029
|
-
if (
|
|
3072
|
+
function Al(e, t) {
|
|
3073
|
+
if (zo(e) || zo(t)) return !0;
|
|
3074
|
+
if (Yo(e)) {
|
|
3030
3075
|
if (0 === e.length) return !0;
|
|
3031
3076
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
3032
|
-
} else if (
|
|
3077
|
+
} else if (Bo(e)) {
|
|
3033
3078
|
if (0 === Object.keys(e).length) return !0;
|
|
3034
3079
|
for (let n in e) if (n === t) return !0;
|
|
3035
|
-
} else if (
|
|
3080
|
+
} else if (Jo(e) && e === t) return !0;
|
|
3036
3081
|
return !1;
|
|
3037
3082
|
}
|
|
3038
|
-
function
|
|
3039
|
-
if (e && !
|
|
3040
|
-
o || (o =
|
|
3083
|
+
function Rl(e, t, n, r, o) {
|
|
3084
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
3085
|
+
o || (o = vl);
|
|
3041
3086
|
let l = [];
|
|
3042
|
-
if (
|
|
3087
|
+
if (Yo(t)) for (let i = 0; i < t.length; i++) {
|
|
3043
3088
|
let s, a = t[i];
|
|
3044
|
-
if (
|
|
3089
|
+
if (Bo(a)) s = gl(e, a, "id", "", 0);
|
|
3045
3090
|
else {
|
|
3046
|
-
if (!
|
|
3091
|
+
if (!Jo(a)) continue;
|
|
3047
3092
|
s = a;
|
|
3048
3093
|
}
|
|
3049
|
-
|
|
3094
|
+
Al(n, s) && o(a, r) && l.push(a);
|
|
3050
3095
|
}
|
|
3051
3096
|
else {
|
|
3052
|
-
if (!
|
|
3097
|
+
if (!Bo(t)) return ir("kw_collect() BAD kw parameter"), null;
|
|
3053
3098
|
for (let e of Object.keys(t)) {
|
|
3054
3099
|
let i = t[e];
|
|
3055
|
-
|
|
3100
|
+
Al(n, e) && o(i, r) && l.push(i);
|
|
3056
3101
|
}
|
|
3057
3102
|
}
|
|
3058
3103
|
return l;
|
|
3059
3104
|
}
|
|
3060
|
-
function
|
|
3105
|
+
function Dl(e, t) {
|
|
3061
3106
|
if (!e) return -1;
|
|
3062
3107
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
3063
3108
|
return -1;
|
|
3064
3109
|
}
|
|
3065
|
-
function
|
|
3110
|
+
function kl(e, t, n) {
|
|
3066
3111
|
if (!e || !t) return ir("ERROR: str_in_list() list or str empty"), !1;
|
|
3067
3112
|
let r = e.length;
|
|
3068
3113
|
if (n) {
|
|
@@ -3074,7 +3119,7 @@
|
|
|
3074
3119
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
3075
3120
|
return !1;
|
|
3076
3121
|
}
|
|
3077
|
-
function
|
|
3122
|
+
function Cl(e, t) {
|
|
3078
3123
|
try {
|
|
3079
3124
|
let n = e.__md_iev__;
|
|
3080
3125
|
if (n) return n[t];
|
|
@@ -3082,35 +3127,35 @@
|
|
|
3082
3127
|
return;
|
|
3083
3128
|
}
|
|
3084
3129
|
}
|
|
3085
|
-
function
|
|
3130
|
+
function Il(e, t, n) {
|
|
3086
3131
|
let r = e.__md_iev__;
|
|
3087
3132
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
3088
3133
|
}
|
|
3089
|
-
function
|
|
3090
|
-
if (!
|
|
3134
|
+
function Pl(e, t, n, r) {
|
|
3135
|
+
if (!Xo(e)) return ir("gobj is not a GObj"), null;
|
|
3091
3136
|
if (!t) return;
|
|
3092
|
-
let o =
|
|
3093
|
-
o || (o = [],
|
|
3137
|
+
let o = Cl(t, n);
|
|
3138
|
+
o || (o = [], Il(t, n, o));
|
|
3094
3139
|
try {
|
|
3095
|
-
|
|
3140
|
+
Yo(o) && o.unshift(r);
|
|
3096
3141
|
} catch (e) {
|
|
3097
3142
|
ir(e);
|
|
3098
3143
|
}
|
|
3099
3144
|
}
|
|
3100
|
-
function
|
|
3101
|
-
if (!
|
|
3102
|
-
if (!
|
|
3103
|
-
let o =
|
|
3145
|
+
function Ll(e, t, n, r) {
|
|
3146
|
+
if (!Xo(e)) return ir("gobj is not a GObj"), null;
|
|
3147
|
+
if (!Bo(t)) return ir("kw is not a dict"), null;
|
|
3148
|
+
let o = Cl(t, n);
|
|
3104
3149
|
return o ? 0 === o.length ? (r && ir(`stack empty: ${n}`), null) : o[0] : (r && ir(`stack NOT FOUND: ${n}`), null);
|
|
3105
3150
|
}
|
|
3106
|
-
function
|
|
3107
|
-
return
|
|
3151
|
+
function Ul(e, t, n) {
|
|
3152
|
+
return Zo(n) ? _l(e, t, "__md_iev__`__msg_type__") : hl(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
3108
3153
|
}
|
|
3109
|
-
function
|
|
3110
|
-
return
|
|
3154
|
+
function Fl(e, t) {
|
|
3155
|
+
return gl(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
3111
3156
|
}
|
|
3112
|
-
function
|
|
3113
|
-
void 0 !== n &&
|
|
3157
|
+
function Ml(e, t, n) {
|
|
3158
|
+
void 0 !== n && Jo(n) || (n = "");
|
|
3114
3159
|
for (let r of Object.keys(e)) {
|
|
3115
3160
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
3116
3161
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -3119,10 +3164,10 @@
|
|
|
3119
3164
|
r,
|
|
3120
3165
|
e[r],
|
|
3121
3166
|
n
|
|
3122
|
-
]),
|
|
3167
|
+
]), Bo(e[r]) && Ml(e[r], t, n), n = n.slice(0, -o.length);
|
|
3123
3168
|
}
|
|
3124
3169
|
}
|
|
3125
|
-
function
|
|
3170
|
+
function Gl(e, t, n, r) {
|
|
3126
3171
|
if (!e) return null;
|
|
3127
3172
|
let o, l = e.length;
|
|
3128
3173
|
for (o = 0; o < l; o++) {
|
|
@@ -3130,15 +3175,15 @@
|
|
|
3130
3175
|
if (l) {
|
|
3131
3176
|
let e = l.id;
|
|
3132
3177
|
if (e && e === n) return l;
|
|
3133
|
-
if (r &&
|
|
3134
|
-
let e =
|
|
3178
|
+
if (r && ll(l, t)) {
|
|
3179
|
+
let e = Gl(l[t], t, n, r);
|
|
3135
3180
|
if (e) return e;
|
|
3136
3181
|
}
|
|
3137
3182
|
}
|
|
3138
3183
|
}
|
|
3139
3184
|
return null;
|
|
3140
3185
|
}
|
|
3141
|
-
function
|
|
3186
|
+
function Vl(e) {
|
|
3142
3187
|
function t(e) {
|
|
3143
3188
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
3144
3189
|
switch (t.length % 4) {
|
|
@@ -3169,10 +3214,10 @@
|
|
|
3169
3214
|
signature: t(n[2])
|
|
3170
3215
|
};
|
|
3171
3216
|
}
|
|
3172
|
-
function
|
|
3217
|
+
function Wl(e) {
|
|
3173
3218
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3174
3219
|
}
|
|
3175
|
-
var
|
|
3220
|
+
var xl = class {
|
|
3176
3221
|
constructor(e) {
|
|
3177
3222
|
this.html = e, Object.freeze(this);
|
|
3178
3223
|
}
|
|
@@ -3180,15 +3225,15 @@
|
|
|
3180
3225
|
return this.html;
|
|
3181
3226
|
}
|
|
3182
3227
|
};
|
|
3183
|
-
function xl(e) {
|
|
3184
|
-
return e instanceof Wl;
|
|
3185
|
-
}
|
|
3186
3228
|
function Kl(e) {
|
|
3229
|
+
return e instanceof xl;
|
|
3230
|
+
}
|
|
3231
|
+
function Bl(e) {
|
|
3187
3232
|
const t = document.createElement("template");
|
|
3188
3233
|
return t.innerHTML = e.html.trim(), t.content;
|
|
3189
3234
|
}
|
|
3190
|
-
var
|
|
3191
|
-
function
|
|
3235
|
+
var Yl = !1, Jl = /* @__PURE__ */ new Set();
|
|
3236
|
+
function ql(e) {
|
|
3192
3237
|
const t = document.createElement("template");
|
|
3193
3238
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
3194
3239
|
}
|
|
@@ -3196,41 +3241,52 @@
|
|
|
3196
3241
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), o = e.getTimezoneOffset();
|
|
3197
3242
|
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
3198
3243
|
}
|
|
3199
|
-
function
|
|
3244
|
+
function zl(e, t) {
|
|
3200
3245
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
3201
3246
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
3202
3247
|
return -1;
|
|
3203
3248
|
}
|
|
3204
|
-
function
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3249
|
+
function Ql() {
|
|
3250
|
+
const e = "undefined" != typeof window && window.crypto || globalThis.crypto;
|
|
3251
|
+
if (e && "function" == typeof e.randomUUID) return e.randomUUID();
|
|
3252
|
+
const t = /* @__PURE__ */ new Uint8Array(16);
|
|
3253
|
+
if (e && "function" == typeof e.getRandomValues) e.getRandomValues(t);
|
|
3254
|
+
else for (let e = 0; e < t.length; e++) t[e] = Math.floor(256 * Math.random());
|
|
3255
|
+
t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128;
|
|
3256
|
+
const n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
3257
|
+
return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
|
|
3258
|
+
}
|
|
3259
|
+
var Xl = null;
|
|
3260
|
+
function Zl() {
|
|
3261
|
+
if (Xl) return Xl;
|
|
3262
|
+
const e = jl();
|
|
3263
|
+
if (!e) return Xl = Ql();
|
|
3264
|
+
let t = null;
|
|
3265
|
+
try {
|
|
3266
|
+
t = e.getItem("host_uuid");
|
|
3267
|
+
} catch (e) {
|
|
3268
|
+
return Sl("host_uuid", "node_uuid(): localStorage cannot be read (storage blocked?): a uuid of this page only"), Xl = Ql();
|
|
3269
|
+
}
|
|
3270
|
+
if (!t) {
|
|
3271
|
+
t = Ql();
|
|
3208
3272
|
try {
|
|
3209
|
-
e
|
|
3210
|
-
} catch (
|
|
3211
|
-
|
|
3212
|
-
}
|
|
3213
|
-
if (!e && window.crypto?.randomUUID) {
|
|
3214
|
-
e = window.crypto.randomUUID();
|
|
3215
|
-
try {
|
|
3216
|
-
t.setItem("host_uuid", e);
|
|
3217
|
-
} catch (e) {
|
|
3218
|
-
Ol("host_uuid", "node_uuid(): localStorage cannot be written (storage full or blocked?): a uuid of this page only");
|
|
3219
|
-
}
|
|
3273
|
+
e.setItem("host_uuid", t);
|
|
3274
|
+
} catch (e) {
|
|
3275
|
+
Sl("host_uuid", "node_uuid(): localStorage cannot be written (storage full or blocked?): a uuid of this page only");
|
|
3220
3276
|
}
|
|
3221
|
-
}
|
|
3222
|
-
return
|
|
3277
|
+
}
|
|
3278
|
+
return Xl = t;
|
|
3223
3279
|
}
|
|
3224
|
-
function
|
|
3280
|
+
function ei(e) {
|
|
3225
3281
|
let t = null;
|
|
3226
3282
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
3227
3283
|
}
|
|
3228
|
-
var
|
|
3229
|
-
function
|
|
3284
|
+
var ti = 256, ni = 1e5;
|
|
3285
|
+
function ri(e) {
|
|
3230
3286
|
const t = String(e).replace(/`/g, "``");
|
|
3231
3287
|
return "[" === t[0] ? "[" + t : t;
|
|
3232
3288
|
}
|
|
3233
|
-
function
|
|
3289
|
+
function oi(e) {
|
|
3234
3290
|
if ("string" != typeof e) return null;
|
|
3235
3291
|
let t = [], n = "";
|
|
3236
3292
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -3251,14 +3307,14 @@
|
|
|
3251
3307
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
3252
3308
|
});
|
|
3253
3309
|
}
|
|
3254
|
-
function
|
|
3310
|
+
function li(e, t) {
|
|
3255
3311
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
3256
3312
|
}
|
|
3257
|
-
function
|
|
3313
|
+
function ii(e) {
|
|
3258
3314
|
return "persistent-attrs-" + kt(e);
|
|
3259
3315
|
}
|
|
3260
|
-
function
|
|
3261
|
-
if (
|
|
3316
|
+
function si(e, t) {
|
|
3317
|
+
if (Jo(t)) {
|
|
3262
3318
|
if (-1 === t.indexOf("^")) {
|
|
3263
3319
|
let n, r, o = e.fkey;
|
|
3264
3320
|
if (1 !== Vo(o)) return ir("bad fkey 1"), ir(e), ir(t), null;
|
|
@@ -3281,13 +3337,13 @@
|
|
|
3281
3337
|
};
|
|
3282
3338
|
}
|
|
3283
3339
|
}
|
|
3284
|
-
return
|
|
3340
|
+
return Bo(t) ? {
|
|
3285
3341
|
topic_name: t.topic_name,
|
|
3286
3342
|
id: t.id,
|
|
3287
3343
|
hook_name: t.hook_name
|
|
3288
3344
|
} : (ir("bad fkey 3"), ir(e), ir(t), null);
|
|
3289
3345
|
}
|
|
3290
|
-
var
|
|
3346
|
+
var ai = [
|
|
3291
3347
|
"string",
|
|
3292
3348
|
"integer",
|
|
3293
3349
|
"object",
|
|
@@ -3297,7 +3353,7 @@
|
|
|
3297
3353
|
"real",
|
|
3298
3354
|
"boolean",
|
|
3299
3355
|
"blob"
|
|
3300
|
-
],
|
|
3356
|
+
], ui = [
|
|
3301
3357
|
"persistent",
|
|
3302
3358
|
"required",
|
|
3303
3359
|
"notnull",
|
|
@@ -3309,7 +3365,7 @@
|
|
|
3309
3365
|
"stats",
|
|
3310
3366
|
"rstats",
|
|
3311
3367
|
"pstats"
|
|
3312
|
-
],
|
|
3368
|
+
], _i = [
|
|
3313
3369
|
"hook",
|
|
3314
3370
|
"fkey",
|
|
3315
3371
|
"enum",
|
|
@@ -3338,7 +3394,7 @@
|
|
|
3338
3394
|
"coordinates",
|
|
3339
3395
|
"gbuffer"
|
|
3340
3396
|
];
|
|
3341
|
-
function
|
|
3397
|
+
function ci(e) {
|
|
3342
3398
|
let t = {
|
|
3343
3399
|
name: e.id,
|
|
3344
3400
|
header: e.header,
|
|
@@ -3357,7 +3413,7 @@
|
|
|
3357
3413
|
if (!e.flag) return t;
|
|
3358
3414
|
for (let n = 0; n < e.flag.length; n++) {
|
|
3359
3415
|
let r = e.flag[n];
|
|
3360
|
-
if (
|
|
3416
|
+
if (kl(_i, r)) {
|
|
3361
3417
|
switch (r) {
|
|
3362
3418
|
case "enum":
|
|
3363
3419
|
t.enum_list = e.enum;
|
|
@@ -3371,7 +3427,7 @@
|
|
|
3371
3427
|
case "file": t.is_file = !0;
|
|
3372
3428
|
}
|
|
3373
3429
|
t.type = r;
|
|
3374
|
-
} else if (
|
|
3430
|
+
} else if (kl(ui, r)) switch (r) {
|
|
3375
3431
|
case "writable":
|
|
3376
3432
|
t.is_writable = !0;
|
|
3377
3433
|
break;
|
|
@@ -3384,23 +3440,23 @@
|
|
|
3384
3440
|
}
|
|
3385
3441
|
return t.is_file && (t.type = "file"), t;
|
|
3386
3442
|
}
|
|
3387
|
-
var
|
|
3443
|
+
var fi = [
|
|
3388
3444
|
k(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
3389
3445
|
k(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
3390
3446
|
k(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
3391
3447
|
D()
|
|
3392
|
-
],
|
|
3448
|
+
], gi = {
|
|
3393
3449
|
periodic: !1,
|
|
3394
3450
|
msec: 0,
|
|
3395
3451
|
timer_id: -1
|
|
3396
|
-
},
|
|
3397
|
-
function
|
|
3452
|
+
}, di = null;
|
|
3453
|
+
function bi(e, t, n, r) {
|
|
3398
3454
|
let o = e.priv, l = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
3399
3455
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
3400
3456
|
jn(e, "EV_TIMEOUT", {}, e);
|
|
3401
3457
|
}, o.msec) : o.timer_id = -1, Ln(e, l, {}), o.periodic || -1 !== o.timer_id || Tt(e) && mt(e), 0;
|
|
3402
3458
|
}
|
|
3403
|
-
var
|
|
3459
|
+
var pi = {
|
|
3404
3460
|
mt_create: function(e) {
|
|
3405
3461
|
let t = e.priv, n = nn(e, "subscriber");
|
|
3406
3462
|
n ? kn(e, null, {}, n) : Lt(e) && (n = It(e), kn(e, null, {}, n)), t.periodic = Zt(e, "periodic"), t.msec = en(e, "msec");
|
|
@@ -3424,19 +3480,19 @@
|
|
|
3424
3480
|
},
|
|
3425
3481
|
mt_destroy: function(e) {}
|
|
3426
3482
|
};
|
|
3427
|
-
function
|
|
3483
|
+
function mi(e) {
|
|
3428
3484
|
return "number" == typeof e && Number.isFinite(e) ? Math.round(e) : e;
|
|
3429
3485
|
}
|
|
3430
|
-
function
|
|
3431
|
-
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !1), void un(e, "msec",
|
|
3486
|
+
function hi(e, t) {
|
|
3487
|
+
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !1), void un(e, "msec", mi(t))) : (ir("not GObj TYPE"), -1);
|
|
3432
3488
|
}
|
|
3433
|
-
function
|
|
3434
|
-
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !0), void un(e, "msec",
|
|
3489
|
+
function yi(e, t) {
|
|
3490
|
+
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !0), void un(e, "msec", mi(t))) : (ir("not GObj TYPE"), -1);
|
|
3435
3491
|
}
|
|
3436
|
-
function
|
|
3492
|
+
function vi(e) {
|
|
3437
3493
|
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : void un(e, "msec", -1) : (ir("not GObj TYPE"), -1);
|
|
3438
3494
|
}
|
|
3439
|
-
var
|
|
3495
|
+
var Ei = [
|
|
3440
3496
|
k(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
3441
3497
|
k(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
3442
3498
|
k(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -3456,60 +3512,60 @@
|
|
|
3456
3512
|
k(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
3457
3513
|
k(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
3458
3514
|
D()
|
|
3459
|
-
],
|
|
3460
|
-
function
|
|
3515
|
+
], Ti = { gobj_timer: null }, ji = null;
|
|
3516
|
+
function Oi(e, t, n, r) {
|
|
3461
3517
|
let o = Qt(e, t);
|
|
3462
|
-
return
|
|
3518
|
+
return Bo(o) || (o = {}), o[n] = r, rn(e, t, o), it(e, t);
|
|
3463
3519
|
}
|
|
3464
|
-
var
|
|
3465
|
-
function
|
|
3520
|
+
var Si = -2147483648, wi = 2147483647;
|
|
3521
|
+
function Ni(e) {
|
|
3466
3522
|
if (!0 === e || !1 === e) return e;
|
|
3467
|
-
if ("number" == typeof e) return !Number.isInteger(e) || e <
|
|
3523
|
+
if ("number" == typeof e) return !Number.isInteger(e) || e < Si || e > wi ? null : 0 !== e;
|
|
3468
3524
|
if ("string" != typeof e || "" === e) return null;
|
|
3469
3525
|
let t = e.toLowerCase();
|
|
3470
3526
|
if ("set" === t) return !0;
|
|
3471
3527
|
if ("reset" === t) return !1;
|
|
3472
3528
|
if (/^-?(0|[1-9][0-9]*)$/.test(e)) {
|
|
3473
3529
|
let t = Number(e);
|
|
3474
|
-
return t <
|
|
3530
|
+
return t < Si || t > wi ? null : 0 !== t;
|
|
3475
3531
|
}
|
|
3476
3532
|
return "true" === t || "yes" === t || "on" === t || "false" !== t && "no" !== t && "off" !== t && null;
|
|
3477
3533
|
}
|
|
3478
|
-
function
|
|
3534
|
+
function $i() {
|
|
3479
3535
|
return `${$t()}^${Nt()}`;
|
|
3480
3536
|
}
|
|
3481
|
-
function
|
|
3537
|
+
function Ai(e, t, n, r) {
|
|
3482
3538
|
return Ln(e, t, n), 0;
|
|
3483
3539
|
}
|
|
3484
|
-
var
|
|
3540
|
+
var Ri = {
|
|
3485
3541
|
mt_create: function(e) {
|
|
3486
3542
|
let t = e.priv;
|
|
3487
|
-
_n(e, "start_date", Hl()), _n(e, "node_uuid",
|
|
3543
|
+
_n(e, "start_date", Hl()), _n(e, "node_uuid", Zl()), e.priv.gobj_timer = _t(Rt(e), "C_TIMER", {}, e), t.periodic_timeout = Qt(e, "periodic_timeout"), function(e) {
|
|
3488
3544
|
let t = Qt(e, "trace_levels");
|
|
3489
|
-
if (!
|
|
3545
|
+
if (!Bo(t)) return 0;
|
|
3490
3546
|
let n = t.__global_trace__;
|
|
3491
|
-
if (
|
|
3547
|
+
if (Yo(n)) {
|
|
3492
3548
|
ae(4294967295, !1);
|
|
3493
3549
|
for (let e of n) ie(e, !0);
|
|
3494
3550
|
}
|
|
3495
3551
|
for (const [n, r] of Object.entries(t)) {
|
|
3496
3552
|
let t = et(n);
|
|
3497
|
-
if (t) if (
|
|
3553
|
+
if (t) if (Yo(r)) {
|
|
3498
3554
|
be(t, null, !1);
|
|
3499
3555
|
for (let e of r) be(t, e, !0);
|
|
3500
3556
|
} else ir(`${Rt(e)}: trace_levels of ${n} MUST be a list`);
|
|
3501
3557
|
}
|
|
3502
3558
|
}(e), function(e) {
|
|
3503
3559
|
let t = Qt(e, "no_trace_levels");
|
|
3504
|
-
if (!
|
|
3560
|
+
if (!Bo(t)) return 0;
|
|
3505
3561
|
let n = t.__global_no_trace__;
|
|
3506
|
-
if (
|
|
3562
|
+
if (Yo(n)) {
|
|
3507
3563
|
ue(4294967295, !1);
|
|
3508
3564
|
for (let e of n) se(e, !0);
|
|
3509
3565
|
}
|
|
3510
3566
|
for (const [n, r] of Object.entries(t)) {
|
|
3511
3567
|
let t = et(n);
|
|
3512
|
-
if (t) if (
|
|
3568
|
+
if (t) if (Yo(r)) {
|
|
3513
3569
|
pe(t, null, !1);
|
|
3514
3570
|
for (let e of r) pe(t, e, !0);
|
|
3515
3571
|
} else ir(`${Rt(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
@@ -3518,10 +3574,10 @@
|
|
|
3518
3574
|
},
|
|
3519
3575
|
mt_writing: function(e, t) {},
|
|
3520
3576
|
mt_start: function(e) {
|
|
3521
|
-
return
|
|
3577
|
+
return yi(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
3522
3578
|
},
|
|
3523
3579
|
mt_stop: function(e) {
|
|
3524
|
-
return
|
|
3580
|
+
return vi(e.priv.gobj_timer), yt(e), 0;
|
|
3525
3581
|
},
|
|
3526
3582
|
mt_destroy: function(e) {},
|
|
3527
3583
|
mt_play: function(e) {
|
|
@@ -3538,24 +3594,24 @@
|
|
|
3538
3594
|
case "get-global-no-trace": return o(0, 0, null, null, ce());
|
|
3539
3595
|
case "set-global-trace":
|
|
3540
3596
|
case "set-global-no-trace": {
|
|
3541
|
-
let r = "set-global-no-trace" === t, l = n.level, i =
|
|
3542
|
-
return l ? null === i ? o(0, -1, `${
|
|
3597
|
+
let r = "set-global-no-trace" === t, l = n.level, i = Ni(n.set);
|
|
3598
|
+
return l ? null === i ? o(0, -1, `${$i()}: bitmask set or re-set?`, null, null) : (r ? se(l, i) : ie(l, i)) < 0 ? o(0, -1, `${$i()}: global trace level not found: ${l}`, null, null) : r ? (Oi(e, "no_trace_levels", "__global_no_trace__", ce()), o(0, 0, null, null, ce())) : (Oi(e, "trace_levels", "__global_trace__", _e()), o(0, 0, null, null, _e())) : o(0, -1, `${$i()}: what level?`, null, null);
|
|
3543
3599
|
}
|
|
3544
3600
|
case "get-gclass-trace":
|
|
3545
3601
|
case "get-gclass-no-trace":
|
|
3546
3602
|
case "set-gclass-trace":
|
|
3547
3603
|
case "set-gclass-no-trace": {
|
|
3548
3604
|
let r = t.indexOf("no-trace") >= 0, l = n.gclass_name || n.gclass || "", i = et(l);
|
|
3549
|
-
if (!i) return o(0, -1, `${
|
|
3605
|
+
if (!i) return o(0, -1, `${$i()}: what gclass is '${l}'?`, null, null);
|
|
3550
3606
|
if (0 === t.indexOf("get-")) return o(0, 0, null, null, r ? de(i) : fe(i));
|
|
3551
|
-
let s = n.level, a =
|
|
3552
|
-
return s ? null === a ? o(0, -1, `${
|
|
3607
|
+
let s = n.level, a = Ni(n.set);
|
|
3608
|
+
return s ? null === a ? o(0, -1, `${$i()}: bitmask set or re-set?`, null, null) : (r ? pe(i, s, a) : be(i, s, a)) < 0 ? o(0, -1, `${$i()}: trace level of ${l} not found: ${s}`, null, null) : r ? (Oi(e, "no_trace_levels", l, de(i)), o(0, 0, null, null, de(i))) : (Oi(e, "trace_levels", l, ge(i)), o(0, 0, null, null, fe(i))) : o(0, -1, `${$i()}: what level?`, null, null);
|
|
3553
3609
|
}
|
|
3554
|
-
default: return o(0, -1, `${
|
|
3610
|
+
default: return o(0, -1, `${$i()}: command not available: ${t}`, null, null);
|
|
3555
3611
|
}
|
|
3556
3612
|
}
|
|
3557
3613
|
};
|
|
3558
|
-
var
|
|
3614
|
+
var Di = "ievent_gate_stack", ki = [
|
|
3559
3615
|
k(E.DTP_STRING, "wanted_yuno_role", A.SDF_RD, "", "wanted yuno role"),
|
|
3560
3616
|
k(E.DTP_STRING, "wanted_yuno_name", A.SDF_RD, "", "wanted yuno name"),
|
|
3561
3617
|
k(E.DTP_STRING, "wanted_yuno_service", A.SDF_RD, "", "wanted yuno service"),
|
|
@@ -3567,20 +3623,20 @@
|
|
|
3567
3623
|
k(E.DTP_STRING, "cert_pem", A.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
3568
3624
|
k(E.DTP_JSON, "extra_info", A.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
3569
3625
|
k(E.DTP_LIST, "required_services", A.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
3570
|
-
k(E.DTP_INTEGER, "timeout_retry", A.SDF_RD, "5000", "
|
|
3626
|
+
k(E.DTP_INTEGER, "timeout_retry", A.SDF_RD, "5000", "Base of the first reconnect delay (ms, ±20% jitter), at least 1000. It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
3571
3627
|
k(E.DTP_INTEGER, "timeout_retry_max", A.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
3572
3628
|
k(E.DTP_INTEGER, "timeout_idack", A.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3573
3629
|
k(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3574
3630
|
D()
|
|
3575
|
-
],
|
|
3631
|
+
], Ci = [
|
|
3576
3632
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3577
3633
|
["ievents2", "Trace inter-events with full kw"],
|
|
3578
3634
|
["identity-card", "Trace identity_card messages"]
|
|
3579
3635
|
];
|
|
3580
|
-
function
|
|
3636
|
+
function Ii(e) {
|
|
3581
3637
|
return !!(3 & X(e));
|
|
3582
3638
|
}
|
|
3583
|
-
var
|
|
3639
|
+
var Pi = {
|
|
3584
3640
|
url: null,
|
|
3585
3641
|
remote_yuno_name: null,
|
|
3586
3642
|
remote_yuno_role: null,
|
|
@@ -3593,8 +3649,8 @@
|
|
|
3593
3649
|
retry_ms_before_session: 0,
|
|
3594
3650
|
session_since: 0,
|
|
3595
3651
|
retry_floor_warned: !1
|
|
3596
|
-
},
|
|
3597
|
-
function
|
|
3652
|
+
}, Li = null;
|
|
3653
|
+
function Ui(e) {
|
|
3598
3654
|
e.priv.websocket && ir("Websocket ALREADY setup");
|
|
3599
3655
|
const t = tn(e, "url");
|
|
3600
3656
|
ar(`====> Starting WebSocket to '${t}' (${kt(e)})`);
|
|
@@ -3609,7 +3665,7 @@
|
|
|
3609
3665
|
code: 1006,
|
|
3610
3666
|
reason: r.message,
|
|
3611
3667
|
was_clean: !1
|
|
3612
|
-
}, e) < 0 &&
|
|
3668
|
+
}, e) < 0 && hi(e.priv.gobj_timer, Zi(e)), null;
|
|
3613
3669
|
}
|
|
3614
3670
|
return r ? (r.onopen = () => {
|
|
3615
3671
|
n !== e.priv.ws_seq || Ut(e) || jn(e, "EV_ON_OPEN", {
|
|
@@ -3631,7 +3687,7 @@
|
|
|
3631
3687
|
}, e));
|
|
3632
3688
|
}, r) : (ir(`${kt(e)}: Failed to initialize WebSocket.`), null);
|
|
3633
3689
|
}
|
|
3634
|
-
function
|
|
3690
|
+
function Fi(e, t = 1e3, n = "") {
|
|
3635
3691
|
let r = e.priv, o = r.websocket;
|
|
3636
3692
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
3637
3693
|
ar(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -3642,12 +3698,12 @@
|
|
|
3642
3698
|
}
|
|
3643
3699
|
} else sr("WebSocket is already closed or in the process of closing.");
|
|
3644
3700
|
}
|
|
3645
|
-
function
|
|
3701
|
+
function Mi(e, t) {
|
|
3646
3702
|
let n = e.priv;
|
|
3647
|
-
"ST_SESSION" === fn(e) && (performance.now() - n.session_since <
|
|
3703
|
+
"ST_SESSION" === fn(e) && (performance.now() - n.session_since < Xi(e).max && (n.retry_ms = n.retry_ms_before_session), n.retry_ms_before_session = 0), Fi(e, 4002, t);
|
|
3648
3704
|
}
|
|
3649
|
-
var
|
|
3650
|
-
function
|
|
3705
|
+
var Gi = 128;
|
|
3706
|
+
function Vi(e, t) {
|
|
3651
3707
|
let n = String(e), r = To(n);
|
|
3652
3708
|
if (null !== r && (n = r), n.length > t) {
|
|
3653
3709
|
let e = t, r = n.charCodeAt(e);
|
|
@@ -3655,7 +3711,7 @@
|
|
|
3655
3711
|
}
|
|
3656
3712
|
return n;
|
|
3657
3713
|
}
|
|
3658
|
-
function
|
|
3714
|
+
function Wi(e, t, n) {
|
|
3659
3715
|
let r = Hl();
|
|
3660
3716
|
try {
|
|
3661
3717
|
ar("\n" + r + " " + t + "\n"), $o(n);
|
|
@@ -3663,17 +3719,17 @@
|
|
|
3663
3719
|
ar("ERROR in trace_inter_event: " + e);
|
|
3664
3720
|
}
|
|
3665
3721
|
}
|
|
3666
|
-
var
|
|
3722
|
+
var xi = class {
|
|
3667
3723
|
constructor(e, t) {
|
|
3668
3724
|
this.event = e, this.kw = t || {};
|
|
3669
3725
|
}
|
|
3670
3726
|
};
|
|
3671
|
-
function
|
|
3727
|
+
function Ki(e, t, n, r) {
|
|
3672
3728
|
return function(e, t) {
|
|
3673
3729
|
let n = e.priv, r = JSON.stringify(t);
|
|
3674
|
-
if (
|
|
3730
|
+
if (Ii(e)) {
|
|
3675
3731
|
let n = tn(e, "url"), o = Rt(wt()) + " ==> " + n, l = Qt(wt(), "trace_ievent_callback");
|
|
3676
|
-
l ? l(o, t, 1, r.length) :
|
|
3732
|
+
l ? l(o, t, 1, r.length) : Wi(0, o, t);
|
|
3677
3733
|
}
|
|
3678
3734
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return sr(`${kt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3679
3735
|
try {
|
|
@@ -3683,21 +3739,21 @@
|
|
|
3683
3739
|
}
|
|
3684
3740
|
return 0;
|
|
3685
3741
|
}(e, function(e, t) {
|
|
3686
|
-
return
|
|
3742
|
+
return Zo(e) ? (ir("iev_create() event NULL"), null) : new xi(e, t);
|
|
3687
3743
|
}(t, n));
|
|
3688
3744
|
}
|
|
3689
|
-
function
|
|
3690
|
-
return
|
|
3745
|
+
function Bi(e, t, n) {
|
|
3746
|
+
return Zo(n) && (n = tn(e, "wanted_yuno_service")), {
|
|
3691
3747
|
dst_yuno: tn(e, "wanted_yuno_name"),
|
|
3692
3748
|
dst_role: tn(e, "wanted_yuno_role"),
|
|
3693
3749
|
dst_service: n,
|
|
3694
3750
|
src_yuno: Nt(),
|
|
3695
3751
|
src_role: $t(),
|
|
3696
3752
|
src_service: t,
|
|
3697
|
-
host:
|
|
3753
|
+
host: Zl()
|
|
3698
3754
|
};
|
|
3699
3755
|
}
|
|
3700
|
-
function
|
|
3756
|
+
function Yi(e) {
|
|
3701
3757
|
let t = e.priv, n = St(wt()), r = tn(wt(), "yuno_version"), o = tn(wt(), "yuno_release"), l = tn(wt(), "yuno_tag"), s = Qt(e, "required_services");
|
|
3702
3758
|
s && s.length || (s = Qt(wt(), "required_services"));
|
|
3703
3759
|
let a = {
|
|
@@ -3715,32 +3771,32 @@
|
|
|
3715
3771
|
username: tn(wt(), "__username__"),
|
|
3716
3772
|
launch_id: 0,
|
|
3717
3773
|
yuno_startdate: tn(wt(), "start_date"),
|
|
3718
|
-
id:
|
|
3774
|
+
id: Zl(),
|
|
3719
3775
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3720
3776
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3721
3777
|
required_services: s
|
|
3722
3778
|
};
|
|
3723
|
-
return
|
|
3779
|
+
return Pl(e, a, Di, Bi(e, Rt(It(e)), null)), Ul(e, a, "__identity__"), hi(t.gobj_timer, en(e, "timeout_idack")), Ki(e, "EV_IDENTITY_CARD", a);
|
|
3724
3780
|
}
|
|
3725
|
-
function
|
|
3726
|
-
if (
|
|
3781
|
+
function Ji(e, t) {
|
|
3782
|
+
if (Zo(t.event)) return -1;
|
|
3727
3783
|
let n = {}, r = t.__global__, o = t.__config__, l = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
3728
3784
|
o && (n.__config__ = o), r && (n.__global__ = r), l && (n.__filter__ = l);
|
|
3729
|
-
return
|
|
3785
|
+
return Pl(e, n, Di, Bi(e, Rt(s), i)), Ul(e, n, "__subscribing__"), Ki(e, t.event, n);
|
|
3730
3786
|
}
|
|
3731
|
-
function
|
|
3787
|
+
function qi(e, t, n, r) {
|
|
3732
3788
|
let o = e.priv;
|
|
3733
|
-
return Tt(e) && (o.websocket =
|
|
3789
|
+
return Tt(e) && (o.websocket = Ui(e)), 0;
|
|
3734
3790
|
}
|
|
3735
|
-
function
|
|
3736
|
-
return ar("Websocket opened: " + e.priv.url),
|
|
3791
|
+
function Hi(e, t, n, r) {
|
|
3792
|
+
return ar("Websocket opened: " + e.priv.url), Yi(e), 0;
|
|
3737
3793
|
}
|
|
3738
|
-
function
|
|
3794
|
+
function zi(e, t, n, r) {
|
|
3739
3795
|
let o = e.priv, l = n.url;
|
|
3740
3796
|
if (void 0 !== n.ws_seq && n.ws_seq !== o.ws_seq) return 0;
|
|
3741
3797
|
Xn();
|
|
3742
|
-
const i =
|
|
3743
|
-
return
|
|
3798
|
+
const i = Vi(void 0 === n.reason ? "" : n.reason, 256);
|
|
3799
|
+
return Ii(e) && ur(`${kt(e)}: WebSocket closed ${l} (Code: ${n.code}, Reason: "${i}", Clean: ${n.was_clean})`), o.websocket && (o.websocket.onopen = null, o.websocket.onmessage = null, o.websocket.onerror = null, o.websocket.onclose = null, o.websocket = null), o.inform_on_close ? (o.inform_on_close = !1, (!n.was_clean || 1e3 !== n.code && 1001 !== n.code) && Tt(e) && sr(`${kt(e)}: session closed ${l} (Code: ${n.code}, Reason: "${i}", Clean: ${n.was_clean})`), Ln(e, "EV_ON_CLOSE", {
|
|
3744
3800
|
url: l,
|
|
3745
3801
|
remote_yuno_name: o.remote_yuno_name,
|
|
3746
3802
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -3756,33 +3812,33 @@
|
|
|
3756
3812
|
code: n.code,
|
|
3757
3813
|
reason: i,
|
|
3758
3814
|
was_clean: n.was_clean
|
|
3759
|
-
})), Tt(e) &&
|
|
3815
|
+
})), Tt(e) && hi(o.gobj_timer, Zi(e)), 0;
|
|
3760
3816
|
}
|
|
3761
|
-
var
|
|
3762
|
-
function
|
|
3817
|
+
var Qi = 1e3;
|
|
3818
|
+
function Xi(e) {
|
|
3763
3819
|
let t = e.priv, n = en(e, "timeout_retry"), r = en(e, "timeout_retry_max");
|
|
3764
|
-
return n >=
|
|
3820
|
+
return n >= Qi || (t.retry_floor_warned || (t.retry_floor_warned = !0, sr(`${kt(e)}: timeout_retry ${n} ms is below ${Qi} ms: ${Qi} ms is used`)), n = Qi), r >= n || (r = n), {
|
|
3765
3821
|
base: n,
|
|
3766
3822
|
max: r
|
|
3767
3823
|
};
|
|
3768
3824
|
}
|
|
3769
|
-
function
|
|
3825
|
+
function Zi(e) {
|
|
3770
3826
|
let t = e.priv;
|
|
3771
|
-
const { base: n, max: r } =
|
|
3827
|
+
const { base: n, max: r } = Xi(e);
|
|
3772
3828
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
3773
3829
|
let o = .2 * t.retry_ms, l = t.retry_ms - o + 2 * Math.random() * o;
|
|
3774
3830
|
return Math.max(1, Math.round(l));
|
|
3775
3831
|
}
|
|
3776
|
-
function
|
|
3777
|
-
return
|
|
3832
|
+
function es(e, t, n, r) {
|
|
3833
|
+
return Yi(e), 0;
|
|
3778
3834
|
}
|
|
3779
|
-
function
|
|
3835
|
+
function ts(e, t, n, r) {
|
|
3780
3836
|
let o = e.priv;
|
|
3781
|
-
|
|
3782
|
-
let l =
|
|
3837
|
+
vi(o.gobj_timer);
|
|
3838
|
+
let l = Ll(e, n, Di, !0), i = gl(e, l, "src_yuno", ""), s = gl(e, l, "src_role", ""), a = gl(e, l, "src_service", "");
|
|
3783
3839
|
_n(e, "remote_yuno_name", i), _n(e, "remote_yuno_role", s), _n(e, "remote_yuno_service", a);
|
|
3784
|
-
let u =
|
|
3785
|
-
if (u < 0)
|
|
3840
|
+
let u = fl(e, n, "result", -1, 0), _ = gl(e, n, "comment", "", 0), c = gl(e, n, "username", "", 0), f = pl(e, n, "services_roles", {});
|
|
3841
|
+
if (u < 0) Fi(e), Ln(e, "EV_ON_ID_NAK", {
|
|
3786
3842
|
url: tn(e, "url"),
|
|
3787
3843
|
result: u,
|
|
3788
3844
|
comment: _,
|
|
@@ -3799,11 +3855,11 @@
|
|
|
3799
3855
|
services_roles: f
|
|
3800
3856
|
})), o.inside_on_open = !1, function(e) {
|
|
3801
3857
|
let t = In(e, null, null, null);
|
|
3802
|
-
for (let n = 0; n < t.length; n++)
|
|
3858
|
+
for (let n = 0; n < t.length; n++) Ji(e, t[n]);
|
|
3803
3859
|
}(e);
|
|
3804
3860
|
return 0;
|
|
3805
3861
|
}
|
|
3806
|
-
function
|
|
3862
|
+
function ns(e, t, n, r) {
|
|
3807
3863
|
let o = e.priv.url, l = function(e, t) {
|
|
3808
3864
|
let n;
|
|
3809
3865
|
try {
|
|
@@ -3822,49 +3878,49 @@
|
|
|
3822
3878
|
kw: o || {}
|
|
3823
3879
|
} : (sr(`${kt(e)}: parsing inter_event: kw not a json object`), null) : (sr(`${kt(e)}: parsing inter_kw: no kw`), null);
|
|
3824
3880
|
}(e, n.data);
|
|
3825
|
-
if (!l) return sr(`${kt(e)}: frame dropped from ${o}: ${
|
|
3826
|
-
if (
|
|
3881
|
+
if (!l) return sr(`${kt(e)}: frame dropped from ${o}: ${Vi(n.data, 256)}`), -1;
|
|
3882
|
+
if (Ii(e)) {
|
|
3827
3883
|
let e = Rt(wt()) + " <== " + o, t = n.data.length, r = Qt(wt(), "trace_ievent_callback");
|
|
3828
|
-
r ? r(e, l, 2, t) :
|
|
3884
|
+
r ? r(e, l, 2, t) : Wi(0, e, l);
|
|
3829
3885
|
}
|
|
3830
3886
|
let i = l.event, s = l.kw;
|
|
3831
3887
|
if ("ST_SESSION" !== fn(e)) {
|
|
3832
3888
|
if ("ev_identity_card_ack" === String(i).toLowerCase()) {
|
|
3833
3889
|
if (!(jn(e, "EV_IDENTITY_CARD_ACK", s, e) < 0)) return 0;
|
|
3834
|
-
} else sr(`${kt(e)}: event UNKNOWN in not-session state ${
|
|
3835
|
-
return
|
|
3890
|
+
} else sr(`${kt(e)}: event UNKNOWN in not-session state ${Vi(i, Gi)}`);
|
|
3891
|
+
return Mi(e, "event out of session"), -1;
|
|
3836
3892
|
}
|
|
3837
3893
|
l = null;
|
|
3838
|
-
let a =
|
|
3839
|
-
if (!
|
|
3840
|
-
let c =
|
|
3841
|
-
if (!
|
|
3842
|
-
let f =
|
|
3843
|
-
if ("__subscribing__" === a) return sr(`${kt(e)}: subscription event ignored, I'm client (service: ${
|
|
3844
|
-
if ("__unsubscribing__" === a) return sr(`${kt(e)}: unsubscription event ignored, I'm client (service: ${
|
|
3894
|
+
let a = Fl(e, s), u = Ll(e, s, Di), _ = gl(e, u, "dst_role", "");
|
|
3895
|
+
if (!Zo(_) && _.toLowerCase() !== String($t()).toLowerCase()) return sr(`${kt(e)}: It's not my role, dst_role: ${Vi(_, Gi)}, my_role: ${$t()}, event: ${Vi(i, Gi)}`), Mi(e, "not my role"), -1;
|
|
3896
|
+
let c = gl(e, u, "dst_yuno", "");
|
|
3897
|
+
if (!Zo(c) && c.toLowerCase() !== String(Nt()).toLowerCase()) return sr(`${kt(e)}: It's not my name, dst_yuno: ${Vi(c, Gi)}, my_name: ${Nt()}, event: ${Vi(i, Gi)}`), Mi(e, "not my name"), -1;
|
|
3898
|
+
let f = gl(e, u, "dst_service", "");
|
|
3899
|
+
if ("__subscribing__" === a) return sr(`${kt(e)}: subscription event ignored, I'm client (service: ${Vi(f, Gi)}, event: ${Vi(i, Gi)})`), -1;
|
|
3900
|
+
if ("__unsubscribing__" === a) return sr(`${kt(e)}: unsubscription event ignored, I'm client (service: ${Vi(f, Gi)}, event: ${Vi(i, Gi)})`), -1;
|
|
3845
3901
|
const g = Sn(i, 0, !1);
|
|
3846
3902
|
if (g && dn(e, g.event_name, 0)) {
|
|
3847
3903
|
const t = g.event_name;
|
|
3848
|
-
return dn(e, t, F.EVF_PUBLIC_EVENT) && "EV_IDENTITY_CARD_ACK" !== t ? (jn(e, t, s, e), 0) : (sr(`${kt(e)}: event of the transport itself, or out of its place, DROPPED: ev '${
|
|
3904
|
+
return dn(e, t, F.EVF_PUBLIC_EVENT) && "EV_IDENTITY_CARD_ACK" !== t ? (jn(e, t, s, e), 0) : (sr(`${kt(e)}: event of the transport itself, or out of its place, DROPPED: ev '${Vi(i, Gi)}'`), -1);
|
|
3849
3905
|
}
|
|
3850
|
-
if (!
|
|
3906
|
+
if (!Zo(f)) {
|
|
3851
3907
|
let t = nt(f, !1);
|
|
3852
|
-
return t ? dn(t, i, F.EVF_PUBLIC_EVENT) ? (jn(t, i, s, e), 0) : (sr(`${kt(e)}: Service found but no event or not public, DROPPED: service '${kt(t)}', ev '${
|
|
3908
|
+
return t ? dn(t, i, F.EVF_PUBLIC_EVENT) ? (jn(t, i, s, e), 0) : (sr(`${kt(e)}: Service found but no event or not public, DROPPED: service '${kt(t)}', ev '${Vi(i, Gi)}'`), -1) : (sr(`${kt(e)}: event for a service that is gone, DROPPED: service '${Vi(f, Gi)}', ev '${Vi(i, Gi)}'`), 0);
|
|
3853
3909
|
}
|
|
3854
3910
|
let d = Sn(i, F.EVF_PUBLIC_EVENT, !1);
|
|
3855
|
-
return d ? (Ln(e, d.event_name, s), 0) : (sr(`${kt(e)}: event that no gclass declares public, DROPPED: ev '${
|
|
3911
|
+
return d ? (Ln(e, d.event_name, s), 0) : (sr(`${kt(e)}: event that no gclass declares public, DROPPED: ev '${Vi(i, Gi)}'`), -1);
|
|
3856
3912
|
}
|
|
3857
|
-
function
|
|
3913
|
+
function rs(e, t, n, r) {
|
|
3858
3914
|
const o = n && "string" == typeof n[r] ? n[r] : "", l = n && "string" == typeof n.service ? n.service : "";
|
|
3859
|
-
return sr(`${kt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${
|
|
3915
|
+
return sr(`${kt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${Vi(o, Gi)}', service '${Vi(l, Gi)}'`), -1;
|
|
3860
3916
|
}
|
|
3861
|
-
function
|
|
3862
|
-
return
|
|
3917
|
+
function os(e, t, n, r) {
|
|
3918
|
+
return rs(e, t, n, "__stats__");
|
|
3863
3919
|
}
|
|
3864
|
-
function
|
|
3865
|
-
return
|
|
3920
|
+
function ls(e, t, n, r) {
|
|
3921
|
+
return rs(e, t, n, "__command__");
|
|
3866
3922
|
}
|
|
3867
|
-
var
|
|
3923
|
+
var is = {
|
|
3868
3924
|
mt_create: function(e) {
|
|
3869
3925
|
let t = e.priv;
|
|
3870
3926
|
t.gobj_timer = _t(Rt(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = tn(e, "url"), t.remote_yuno_name = tn(e, "remote_yuno_name"), t.remote_yuno_role = tn(e, "remote_yuno_role"), t.remote_yuno_service = tn(e, "remote_yuno_service"), _n(e, "wanted_yuno_name", t.remote_yuno_name), _n(e, "wanted_yuno_role", t.remote_yuno_role), _n(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -3894,52 +3950,52 @@
|
|
|
3894
3950
|
code: 1e3,
|
|
3895
3951
|
reason: "restarted",
|
|
3896
3952
|
was_clean: !0
|
|
3897
|
-
}, e),
|
|
3953
|
+
}, e), vi(t.gobj_timer)), t.websocket = Ui(e), 0;
|
|
3898
3954
|
},
|
|
3899
3955
|
mt_stop: function(e) {
|
|
3900
3956
|
let t = e.priv;
|
|
3901
|
-
return
|
|
3957
|
+
return vi(t.gobj_timer), t.websocket && Fi(e), 0;
|
|
3902
3958
|
},
|
|
3903
3959
|
mt_destroy: function(e) {},
|
|
3904
3960
|
mt_stats: function(e, t, n, r) {
|
|
3905
3961
|
if ("ST_SESSION" !== fn(e)) return ir("Not in session"), null;
|
|
3906
3962
|
n || (n = {});
|
|
3907
|
-
let o =
|
|
3908
|
-
return l || (l = {}),
|
|
3963
|
+
let o = Bi(e, Rt(r), gl(e, n, "service", null, 0)), l = pl(e, n, "__md_stats__", null, Un.KW_EXTRACT);
|
|
3964
|
+
return l || (l = {}), Pl(e, n, "stats_stack", {
|
|
3909
3965
|
stats: t,
|
|
3910
3966
|
kw: l
|
|
3911
|
-
}),
|
|
3967
|
+
}), Pl(e, n, Di, o), n.__stats__ = t, Ul(e, n, "__stats__"), Ki(e, "EV_MT_STATS", n, r), null;
|
|
3912
3968
|
},
|
|
3913
3969
|
mt_command_parser: function(e, t, n, r) {
|
|
3914
3970
|
if ("ST_SESSION" !== fn(e)) return ir("Not in session"), null;
|
|
3915
3971
|
n || (n = {});
|
|
3916
|
-
let o =
|
|
3917
|
-
return l || (l = {}),
|
|
3972
|
+
let o = Bi(e, Rt(r), gl(e, n, "service", "", 0)), l = pl(e, n, "__md_command__", null, Un.KW_EXTRACT);
|
|
3973
|
+
return l || (l = {}), Pl(e, n, "command_stack", {
|
|
3918
3974
|
command: t,
|
|
3919
3975
|
kw: l
|
|
3920
|
-
}),
|
|
3976
|
+
}), Pl(e, n, Di, o), n.__command__ = t, Ul(e, n, "__command__"), Ki(e, "EV_MT_COMMAND", n, r), null;
|
|
3921
3977
|
},
|
|
3922
3978
|
mt_inject_event: function(e, t, n, r) {
|
|
3923
3979
|
if ("ST_SESSION" !== fn(e)) return window.console.error("Not in session"), -1;
|
|
3924
|
-
if (n = Do({},
|
|
3980
|
+
if (n = Do({}, Bo(n) ? n : {}), Bo(n.__md_iev__) && (n.__md_iev__ = Ao(n.__md_iev__)), Ll(e, n, Di));
|
|
3925
3981
|
else {
|
|
3926
|
-
let o =
|
|
3927
|
-
Po(n, "__service__"),
|
|
3982
|
+
let o = Bi(e, Rt(r), gl(e, n, "__service__", 0, 0));
|
|
3983
|
+
Po(n, "__service__"), Pl(e, n, "__message__", t), Pl(e, n, Di, o);
|
|
3928
3984
|
}
|
|
3929
|
-
return
|
|
3985
|
+
return Ul(e, n, "__message__"), Ki(e, t, n, r);
|
|
3930
3986
|
},
|
|
3931
3987
|
mt_subscription_added: function(e, t) {
|
|
3932
3988
|
let n = e.priv;
|
|
3933
|
-
return "ST_SESSION" === fn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3989
|
+
return "ST_SESSION" === fn(e) && n.websocket ? n.inside_on_open ? 0 : Ji(e, t) : 0;
|
|
3934
3990
|
},
|
|
3935
3991
|
mt_subscription_deleted: function(e, t) {
|
|
3936
3992
|
let n = e.priv;
|
|
3937
3993
|
if ("ST_SESSION" !== fn(e) || !n.websocket) return 0;
|
|
3938
3994
|
if (n.inside_on_open) return 0;
|
|
3939
|
-
if (
|
|
3995
|
+
if (Zo(t.event)) return 0;
|
|
3940
3996
|
let r = {}, o = t.__global__, l = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3941
3997
|
l && (r.__config__ = l), o && (r.__global__ = o), i && (r.__filter__ = i);
|
|
3942
|
-
return
|
|
3998
|
+
return Pl(e, r, Di, Bi(e, Rt(a), s)), Ul(e, r, "__unsubscribing__"), Ki(e, t.event, r, e);
|
|
3943
3999
|
}
|
|
3944
4000
|
};
|
|
3945
4001
|
e.GObj = I, e.SDATA = k, e.SDATAAUTHZ = (e, t, n, r, o, l) => new R(e, t, n, null, l, r, null, 0, null, o, null), e.SDATACM = (e, t, n, r, o, l) => new R(e, t, 0, null, l, n, null, 0, o, r, null), e.SDATACM2 = (e, t, n, r, o, l, i) => new R(e, t, n, null, i, r, null, 0, l, o, null), e.SDATADF = (e, t, n, r, o, l) => new R(e, t, n, null, l, null, r, o), e.SDATAPM = (e, t, n, r, o) => new R(e, t, n, r, o), e.SDATAPM0 = (e, t, n, r, o) => new R(e, t, n, null, o, null, null, 0, null, null, r), e.SDATA_END = D, e.SDataDesc = R, e.YUNETA_VERSION = i, Object.defineProperty(e, "__yuno__", {
|
|
@@ -3953,7 +4009,7 @@
|
|
|
3953
4009
|
return t;
|
|
3954
4010
|
}, e.build_stats_response = l, e.clean_name = function(e) {
|
|
3955
4011
|
return e.replace(/[?# ^:]/g, "_");
|
|
3956
|
-
}, e.clear_timeout =
|
|
4012
|
+
}, e.clear_timeout = vi, e.cmp_two_simple_json = rl, e.command_parameter_from_json = ke, e.command_parameter_from_text = function(e, t) {
|
|
3957
4013
|
const n = De(e, t, !1);
|
|
3958
4014
|
return void 0 !== n.value || n.refused || (n.refused = je), n;
|
|
3959
4015
|
}, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
@@ -3965,46 +4021,46 @@
|
|
|
3965
4021
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
3966
4022
|
s.style.cssText = t;
|
|
3967
4023
|
} else "style" === e ? s.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (a = o[e], s.setAttribute("data-i18n", a)) : s.setAttribute(e, o[e]);
|
|
3968
|
-
if (
|
|
3969
|
-
else if (
|
|
4024
|
+
if (Kl(l)) s.appendChild(Bl(l));
|
|
4025
|
+
else if (Jo(l)) if (l = l.trim(), l.length > 0 && "<" === l[0] && !Yl) s.appendChild(ql(l));
|
|
3970
4026
|
else if (l.length > 0 && "<" === l[0] && function(e) {
|
|
3971
|
-
if (
|
|
4027
|
+
if (Jl.size >= 100) return;
|
|
3972
4028
|
const t = e.slice(0, 80);
|
|
3973
|
-
|
|
4029
|
+
Jl.has(t) || (Jl.add(t), sr(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
3974
4030
|
}(l), n && a) s.textContent = n(a) || l;
|
|
3975
4031
|
else s.textContent = l;
|
|
3976
|
-
else if (
|
|
3977
|
-
if (l.length > 0) if (
|
|
3978
|
-
else for (let t of l) Array.isArray(t) ? t.length > 0 && s.appendChild(e(t, n)) : t instanceof Node ? s.appendChild(t) :
|
|
4032
|
+
else if (Yo(l)) {
|
|
4033
|
+
if (l.length > 0) if (Jo(l[0])) s.appendChild(e(l, n));
|
|
4034
|
+
else for (let t of l) Array.isArray(t) ? t.length > 0 && s.appendChild(e(t, n)) : t instanceof Node ? s.appendChild(t) : Kl(t) ? s.appendChild(Bl(t)) : Jo(t) ? s.appendChild(document.createTextNode(t)) : null != t && !1 !== t && ir("createElement2: child ignored, type " + typeof t);
|
|
3979
4035
|
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? s.appendChild(l) : null != l && (ir("content ignored"), _r(l));
|
|
3980
4036
|
if (i && "object" == typeof i) for (const e of Object.keys(i)) s.addEventListener(e, i[e]);
|
|
3981
4037
|
return s;
|
|
3982
|
-
}, e.createOneHtml =
|
|
4038
|
+
}, e.createOneHtml = ql, e.create_json_record = function(e, t) {
|
|
3983
4039
|
let n = Ao(e);
|
|
3984
4040
|
return ko(n, t), n;
|
|
3985
4041
|
}, e.create_template_record = function(e, t) {
|
|
3986
4042
|
let n = {};
|
|
3987
4043
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
3988
4044
|
let o;
|
|
3989
|
-
|
|
3990
|
-
let l =
|
|
4045
|
+
Bo(r) && (o = r.default);
|
|
4046
|
+
let l = pl(null, t, e, o);
|
|
3991
4047
|
Lo(n, e, l);
|
|
3992
4048
|
}), n;
|
|
3993
4049
|
}, e.current_timestamp = Hl, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
3994
|
-
let n =
|
|
3995
|
-
return n &&
|
|
4050
|
+
let n = wl(ii(e), null, !1), r = {};
|
|
4051
|
+
return n && Bo(n) && (r = El(e, n, t, !1)), r;
|
|
3996
4052
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
3997
|
-
let n = Xt(e, A.SDF_PERSIST), r =
|
|
3998
|
-
if (r &&
|
|
3999
|
-
let o =
|
|
4000
|
-
o =
|
|
4053
|
+
let n = Xt(e, A.SDF_PERSIST), r = wl(ii(e), null, !1);
|
|
4054
|
+
if (r && Bo(r)) {
|
|
4055
|
+
let o = El(e, r, t, !1);
|
|
4056
|
+
o = El(e, o, n, !1), sn(e, o, A.SDF_PERSIST);
|
|
4001
4057
|
}
|
|
4002
4058
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
4003
|
-
let n =
|
|
4004
|
-
0 === Vo(n) ?
|
|
4059
|
+
let n = Tl(e, wl(ii(e), null, !1), t, !1);
|
|
4060
|
+
0 === Vo(n) ? $l(ii(e)) : Nl(ii(e), n);
|
|
4005
4061
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
4006
|
-
let n =
|
|
4007
|
-
return r &&
|
|
4062
|
+
let n = El(e, Xt(e, A.SDF_PERSIST), t, !1), r = wl(ii(e), null, !1);
|
|
4063
|
+
return r && Bo(r) && Co(n, r), Nl(ii(e), n);
|
|
4008
4064
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
4009
4065
|
let r = null, o = null, l = null;
|
|
4010
4066
|
const i = (...i) => {
|
|
@@ -4026,22 +4082,20 @@
|
|
|
4026
4082
|
const t = {};
|
|
4027
4083
|
for (const n of e) Do(t, structuredClone(n));
|
|
4028
4084
|
return t;
|
|
4029
|
-
}, e.empty_json = function(e) {
|
|
4030
|
-
return 0 === xo(e);
|
|
4031
|
-
}, e.empty_string = Xo, e.escapeHtml = Vl, e.event_flag_t = F, e.flat2json = function(e) {
|
|
4085
|
+
}, e.empty_json = Ko, e.empty_string = Zo, e.escapeHtml = Wl, e.event_flag_t = F, e.flat2json = function(e) {
|
|
4032
4086
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
4033
4087
|
let t = null;
|
|
4034
4088
|
for (const n of Object.keys(e)) {
|
|
4035
|
-
const r =
|
|
4089
|
+
const r = oi(n);
|
|
4036
4090
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
4037
|
-
if (r.length >
|
|
4091
|
+
if (r.length > ti) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
4038
4092
|
const o = "number" == typeof r[0];
|
|
4039
4093
|
if (null === t) t = o ? [] : {};
|
|
4040
4094
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
4041
4095
|
let l = t;
|
|
4042
4096
|
for (let t = 0; t < r.length; t++) {
|
|
4043
4097
|
const o = r[t], i = "number" == typeof o, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
4044
|
-
if (i && o >
|
|
4098
|
+
if (i && o > ni) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
4045
4099
|
if (i !== Array.isArray(l)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(l) ? "array" : "object"}`);
|
|
4046
4100
|
if (s) {
|
|
4047
4101
|
if (Array.isArray(l)) {
|
|
@@ -4049,7 +4103,7 @@
|
|
|
4049
4103
|
l[o] = e[n];
|
|
4050
4104
|
} else {
|
|
4051
4105
|
if (Object.prototype.hasOwnProperty.call(l, o)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
4052
|
-
|
|
4106
|
+
sl(l, o, e[n]);
|
|
4053
4107
|
}
|
|
4054
4108
|
break;
|
|
4055
4109
|
}
|
|
@@ -4057,7 +4111,7 @@
|
|
|
4057
4111
|
if (Array.isArray(l)) {
|
|
4058
4112
|
for (; l.length <= o;) l.push(null);
|
|
4059
4113
|
u = l[o], null == u && (u = a ? [] : {}, l[o] = u);
|
|
4060
|
-
} else u =
|
|
4114
|
+
} else u = il(l, o) ? void 0 : l[o], void 0 === u && (u = a ? [] : {}, sl(l, o, u));
|
|
4061
4115
|
if (null === u || "object" != typeof u) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
4062
4116
|
if (a !== Array.isArray(u)) throw new Error(`flat2json: '${n}' needs a ${a ? "array" : "object"} where the tree already has a ${Array.isArray(u) ? "array" : "object"}`);
|
|
4063
4117
|
l = u;
|
|
@@ -4068,11 +4122,11 @@
|
|
|
4068
4122
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
4069
4123
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
4070
4124
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
4071
|
-
for (const n of Object.keys(t.added || {}))
|
|
4125
|
+
for (const n of Object.keys(t.added || {})) sl(e, n, t.added[n]);
|
|
4072
4126
|
for (const n of Object.keys(t.changed || {})) {
|
|
4073
4127
|
const r = t.changed[n];
|
|
4074
4128
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
4075
|
-
|
|
4129
|
+
sl(e, n, r.to);
|
|
4076
4130
|
}
|
|
4077
4131
|
return e;
|
|
4078
4132
|
}, e.flat_diff = function(e, t) {
|
|
@@ -4081,15 +4135,15 @@
|
|
|
4081
4135
|
removed: {},
|
|
4082
4136
|
changed: {}
|
|
4083
4137
|
};
|
|
4084
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
4138
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? li(n[e], r[e]) || sl(o.changed, e, {
|
|
4085
4139
|
from: n[e],
|
|
4086
4140
|
to: r[e]
|
|
4087
|
-
}) :
|
|
4088
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
4141
|
+
}) : sl(o.removed, e, n[e]);
|
|
4142
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || sl(o.added, e, r[e]);
|
|
4089
4143
|
return o;
|
|
4090
4144
|
}, e.flat_key_join = function(e) {
|
|
4091
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
4092
|
-
}, e.flat_key_split =
|
|
4145
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : ri(e)).join("`") : "";
|
|
4146
|
+
}, e.flat_key_split = oi, e.gclass_add_ev_action = He, e.gclass_add_event_type = Qe, e.gclass_add_state = qe, e.gclass_check_fsm = Ze, e.gclass_create = Ke, e.gclass_event_type = Xe, e.gclass_find_by_name = et, e.gclass_flag_t = P, e.gclass_unregister = Be, e.getPositionRelativeToBody = function(e) {
|
|
4093
4147
|
if (!e) return {
|
|
4094
4148
|
top: 0,
|
|
4095
4149
|
left: 0,
|
|
@@ -4108,14 +4162,14 @@
|
|
|
4108
4162
|
right: n + s + r,
|
|
4109
4163
|
bottom: t + i + o
|
|
4110
4164
|
};
|
|
4111
|
-
}, e.get_function_name =
|
|
4165
|
+
}, e.get_function_name = ei, e.get_now = function() {
|
|
4112
4166
|
return Math.floor(Date.now() / 1e3);
|
|
4113
4167
|
}, e.gobj_bottom_gobj = Ft, e.gobj_change_parent = function(e, t) {
|
|
4114
4168
|
return Ut(e) ? (ir("gobj NULL or DESTROYED"), null) : t instanceof I ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (lt(e.parent, e), e.parent = null), ot(t, e), t.gclass.gmt.mt_child_added && (ee(e) && ar(n("👦👦🔵 child_added(%s): %s", Ct(t), kt(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (ir(`${kt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
4115
4169
|
}, e.gobj_change_state = cn, e.gobj_command = function(e, t, r, l) {
|
|
4116
4170
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
4117
4171
|
if (function(e) {
|
|
4118
|
-
return
|
|
4172
|
+
return H > 1 || !!e && !!(X(e) & B.TRACE_COMMANDS);
|
|
4119
4173
|
}(e) || oe(e, null) && !le(l, null)) {
|
|
4120
4174
|
let o = To(t);
|
|
4121
4175
|
K(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Tt(e) ? "" : "!!", kt(e), null !== o ? o : t, kt(l))), re(e) && $o(r);
|
|
@@ -4131,26 +4185,26 @@
|
|
|
4131
4185
|
return ut(e, t, n, r, L.gobj_flag_volatil);
|
|
4132
4186
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
4133
4187
|
return ut(e, t, n, null, L.gobj_flag_yuno);
|
|
4134
|
-
}, e.gobj_current_state = fn, e.gobj_default_service = tt, e.gobj_deliver_posted_events = yn, e.gobj_destroy = ct, e.gobj_find_child =
|
|
4135
|
-
if (
|
|
4188
|
+
}, e.gobj_current_state = fn, e.gobj_default_service = tt, e.gobj_deliver_posted_events = yn, e.gobj_destroy = ct, e.gobj_find_child = qt, e.gobj_find_event_type = Sn, e.gobj_find_gobj = function(e, t) {
|
|
4189
|
+
if (Zo(t)) return null;
|
|
4136
4190
|
const n = t.toLowerCase();
|
|
4137
|
-
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p :
|
|
4191
|
+
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : Ht(p, t);
|
|
4138
4192
|
}, e.gobj_find_service = nt, e.gobj_find_subscribings = Pn, e.gobj_find_subscriptions = In, e.gobj_flag_t = L, e.gobj_full_name = Ct, e.gobj_gclass_name = Dt, e.gobj_get_gclass_trace_level = fe, e.gobj_get_gclass_trace_level2 = ge, e.gobj_get_gclass_trace_no_level = de, e.gobj_get_global_trace_level = _e, e.gobj_get_global_trace_no_level = ce, e.gobj_global_trace_level = function() {
|
|
4139
4193
|
return J;
|
|
4140
4194
|
}, e.gobj_global_trace_no_level = function() {
|
|
4141
|
-
return
|
|
4195
|
+
return q;
|
|
4142
4196
|
}, e.gobj_has_attr = zt, e.gobj_has_event = dn, e.gobj_has_output_event = bn, e.gobj_hsdata = Ve, e.gobj_is_destroying = Ut, e.gobj_is_playing = St, e.gobj_is_pure_child = Lt, e.gobj_is_running = Tt, e.gobj_is_service = Ot, e.gobj_is_volatil = Pt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
4143
4197
|
return _ ? _(e, t) : null;
|
|
4144
4198
|
}, e.gobj_list_subscriptions = function(e) {
|
|
4145
4199
|
let t = In(e, null, null, null);
|
|
4146
4200
|
for (let n = 0; n < t.length; n++) {
|
|
4147
|
-
let r = t[n], o =
|
|
4148
|
-
Uo(r, "s_event",
|
|
4201
|
+
let r = t[n], o = dl(e, r, "publisher", null, Un.KW_REQUIRED), l = dl(e, r, "subscriber", null, Un.KW_REQUIRED);
|
|
4202
|
+
Uo(r, "s_event", gl(e, r, "event", "", Un.KW_REQUIRED)), Uo(r, "s_publisher", kt(o)), Uo(r, "s_subscriber", kt(l));
|
|
4149
4203
|
}
|
|
4150
4204
|
let n = Pn(e, 0, null, 0);
|
|
4151
4205
|
for (let t = 0; t < n.length; t++) {
|
|
4152
|
-
let r = n[t], o =
|
|
4153
|
-
Uo(r, "s_event",
|
|
4206
|
+
let r = n[t], o = dl(e, r, "publisher", null, Un.KW_REQUIRED), l = dl(e, r, "subscriber", null, Un.KW_REQUIRED);
|
|
4207
|
+
Uo(r, "s_event", gl(e, r, "event", "", Un.KW_REQUIRED)), Uo(r, "s_publisher", kt(o)), Uo(r, "s_subscriber", kt(l));
|
|
4154
4208
|
}
|
|
4155
4209
|
return {
|
|
4156
4210
|
subscriptions: t,
|
|
@@ -4197,16 +4251,16 @@
|
|
|
4197
4251
|
let r = e.gclass.attrs_table;
|
|
4198
4252
|
for (let o = 0; o < r.length; o++) {
|
|
4199
4253
|
const l = r[o];
|
|
4200
|
-
l.name && (n && l.flag & n || (-1 === t || l.flag & t) && (he(e, e.jn_attrs, l),
|
|
4254
|
+
l.name && (n && l.flag & n || (-1 === t || l.flag & t) && (he(e, e.jn_attrs, l), Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l.name) && (e.priv[l.name] = e.jn_attrs[l.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l.name)));
|
|
4201
4255
|
}
|
|
4202
4256
|
return 0;
|
|
4203
4257
|
}(e, A.SDF_VOLATIL, 0);
|
|
4204
|
-
}, e.gobj_save_persistent_attrs = it, e.gobj_search_path =
|
|
4258
|
+
}, e.gobj_save_persistent_attrs = it, e.gobj_search_path = Ht, e.gobj_send_event = jn, e.gobj_services = function() {
|
|
4205
4259
|
let e = [];
|
|
4206
4260
|
for (const t of Object.keys(b)) Mo(e, t);
|
|
4207
4261
|
return e;
|
|
4208
4262
|
}, e.gobj_set_bottom_gobj = Mt, e.gobj_set_deep_trace = function(e) {
|
|
4209
|
-
return
|
|
4263
|
+
return H = Number(e) || 0, 0;
|
|
4210
4264
|
}, e.gobj_set_gclass_no_trace = pe, e.gobj_set_gclass_trace = be, e.gobj_set_global_no_trace = se, e.gobj_set_global_no_trace2 = ue, e.gobj_set_global_trace = ie, e.gobj_set_global_trace2 = ae, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
4211
4265
|
if (!e) return ir("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
4212
4266
|
const r = Q(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
@@ -4247,7 +4301,7 @@
|
|
|
4247
4301
|
]);
|
|
4248
4302
|
if (Object.keys(n).forEach((n) => {
|
|
4249
4303
|
o.has(n) || ir(`${kt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
4250
|
-
}),
|
|
4304
|
+
}), Zo(t)) t = "";
|
|
4251
4305
|
else if (!(bn(e, t, F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ev ${t}`), 0;
|
|
4252
4306
|
let l = Nn(n, t), i = An(e.dl_subscriptions, e, t, l.renamed_event, l.kw, r), s = 0, a = 0, u = 0;
|
|
4253
4307
|
for (let t = 0; t < i.length; t++) {
|
|
@@ -4256,75 +4310,75 @@
|
|
|
4256
4310
|
}
|
|
4257
4311
|
return a ? sr(`${kt(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${a})`) : s || u || (sr(`${kt(e)}: No subscription found`), $o(n, "No subscription found")), 0;
|
|
4258
4312
|
}, e.gobj_unsubscribe_list = Cn, e.gobj_walk_gobj_children = Vt, e.gobj_walk_gobj_children_tree = Wt, e.gobj_write_attr = rn, e.gobj_write_attrs = sn, e.gobj_write_bool_attr = an, e.gobj_write_integer_attr = un, e.gobj_write_str_attr = _n, e.gobj_yuno = wt, e.gobj_yuno_id = At, e.gobj_yuno_name = Nt, e.gobj_yuno_role = $t, e.html_markup = function(e) {
|
|
4259
|
-
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new
|
|
4260
|
-
}, e.id_index_in_obj_list =
|
|
4313
|
+
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new xl("")) : new xl(e);
|
|
4314
|
+
}, e.id_index_in_obj_list = Dl, e.index_in_list = zl, e.is_array = Yo, e.is_boolean = Ho, e.is_date = function(e) {
|
|
4261
4315
|
return e instanceof Date && !isNaN(e);
|
|
4262
|
-
}, e.is_function =
|
|
4263
|
-
if (!
|
|
4316
|
+
}, e.is_function = Qo, e.is_gobj = Xo, e.is_html_markup = Kl, e.is_metadata_key = function(e) {
|
|
4317
|
+
if (!Jo(e)) return !1;
|
|
4264
4318
|
let t = 0;
|
|
4265
4319
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4266
4320
|
return 2 === t;
|
|
4267
|
-
}, e.is_null =
|
|
4268
|
-
if (!
|
|
4321
|
+
}, e.is_null = zo, e.is_number = qo, e.is_object = Bo, e.is_private_key = function(e) {
|
|
4322
|
+
if (!Jo(e)) return !1;
|
|
4269
4323
|
let t = 0;
|
|
4270
4324
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4271
4325
|
return 1 === t;
|
|
4272
4326
|
}, e.is_pure_number = function(e) {
|
|
4273
|
-
if (
|
|
4274
|
-
if (!
|
|
4327
|
+
if (qo(e)) return !0;
|
|
4328
|
+
if (!Jo(e)) return !1;
|
|
4275
4329
|
const t = Number(e);
|
|
4276
4330
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
4277
4331
|
}, e.is_secret_name = function(e) {
|
|
4278
4332
|
return "string" == typeof e && vr(e, 0, e.length, !0, !0);
|
|
4279
|
-
}, e.is_string =
|
|
4280
|
-
let o =
|
|
4333
|
+
}, e.is_string = Jo, e.jdb_delete = function(e, t, n, r) {
|
|
4334
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4281
4335
|
if (!o) return ir("jdb_delete: topic not found: " + t), null;
|
|
4282
|
-
if (!
|
|
4283
|
-
if (!
|
|
4336
|
+
if (!Bo(r) || Zo(r.id)) return ir(`jdb_delete: record without id: ${Zn(r)}`), null;
|
|
4337
|
+
if (!Jo(n)) return ir(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
4284
4338
|
if ("" !== n && n.split("`").includes("")) return ir(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
4285
4339
|
let l, i = n.split("`"), s = o;
|
|
4286
|
-
for (; (l = i.shift()) && !
|
|
4340
|
+
for (; (l = i.shift()) && !Zo(l) && s;) Bo(s) && (s = pl(null, s, e.hook, null, 0)), s = Gl(s, null, l, !1);
|
|
4287
4341
|
if (!s || 0 !== i.length) return ir(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
4288
|
-
let a =
|
|
4342
|
+
let a = Yo(s) ? s : pl(null, s, e.hook, null, 0), u = Dl(a, r.id);
|
|
4289
4343
|
return u < 0 ? (ir(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), o);
|
|
4290
4344
|
}, e.jdb_get = function(e, t, n, r) {
|
|
4291
|
-
let o =
|
|
4292
|
-
return o ? (void 0 === r && (r = !0),
|
|
4345
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4346
|
+
return o ? (void 0 === r && (r = !0), Gl(o, e.hook, n, r)) : (ir("jdb_get: topic not found: " + t), null);
|
|
4293
4347
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
4294
|
-
let r =
|
|
4348
|
+
let r = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4295
4349
|
return r ? n < r.length ? r[n] : {} : (ir("jdb_get_by_idx: topic not found: " + t), null);
|
|
4296
4350
|
}, e.jdb_get_topic = function(e, t) {
|
|
4297
|
-
let n =
|
|
4351
|
+
let n = pl(null, e, "topics", null, 0);
|
|
4298
4352
|
if (!n) return ir("jdb topics section not found"), ur(e), null;
|
|
4299
|
-
return
|
|
4353
|
+
return pl(null, n, t, null, 0) || (ir("jdb topic not found: " + t), ur(n), null);
|
|
4300
4354
|
}, e.jdb_init = function(e, t, n) {
|
|
4301
4355
|
n && (e = Ao(e));
|
|
4302
|
-
let r =
|
|
4303
|
-
|
|
4304
|
-
let o =
|
|
4305
|
-
return
|
|
4306
|
-
"__" === t.substring(0, 2) ||
|
|
4356
|
+
let r = pl(null, e, "type", [], Un.KW_CREATE);
|
|
4357
|
+
gl(null, e, "hook", "data", Un.KW_CREATE);
|
|
4358
|
+
let o = pl(null, e, "schema", {}, Un.KW_CREATE), l = pl(null, e, "topics", {}, Un.KW_CREATE);
|
|
4359
|
+
return Ml(o, function(e, t, n, o) {
|
|
4360
|
+
"__" === t.substring(0, 2) || Bo(n) || pl(null, l, o, Ao(r), Un.KW_CREATE);
|
|
4307
4361
|
}, t), e;
|
|
4308
4362
|
}, e.jdb_update = function(e, t, n, r) {
|
|
4309
|
-
let o =
|
|
4363
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4310
4364
|
if (!o) return ir("jdb_update: topic not found: " + t), null;
|
|
4311
|
-
if (!
|
|
4312
|
-
if (!
|
|
4365
|
+
if (!Bo(r) || Zo(r.id)) return ir(`jdb_update: record without id: ${Zn(r)}`), null;
|
|
4366
|
+
if (!Jo(n)) return ir(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
4313
4367
|
if ("" !== n && n.split("`").includes("")) return ir(`jdb_update: empty segment in path: '${n}'`), null;
|
|
4314
4368
|
let l, i, s = n.split("`"), a = o;
|
|
4315
|
-
for (; (l = s.shift()) && !
|
|
4369
|
+
for (; (l = s.shift()) && !Zo(l) && a;) Bo(a) && (a = pl(null, a, e.hook, null, 0)), a = Gl(a, null, l, !1);
|
|
4316
4370
|
if (!a || 0 !== s.length) return ir(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
4317
|
-
if (
|
|
4371
|
+
if (Yo(a)) i = a;
|
|
4318
4372
|
else {
|
|
4319
4373
|
if (a.id === r.id) return Do(a, r), o;
|
|
4320
|
-
if (i =
|
|
4321
|
-
else if (!
|
|
4374
|
+
if (i = pl(null, a, e.hook, null, 0), null == i) i = [], Lo(a, e.hook, i);
|
|
4375
|
+
else if (!Yo(i)) return ir(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
4322
4376
|
}
|
|
4323
|
-
let u =
|
|
4377
|
+
let u = Gl(i, e.hook, r.id, !1);
|
|
4324
4378
|
return u ? Do(u, r) : i.push(r), o;
|
|
4325
4379
|
}, e.json2flat = function(e) {
|
|
4326
4380
|
const t = {}, n = (e, r, o) => {
|
|
4327
|
-
if (o >
|
|
4381
|
+
if (o > ti) throw new Error("json2flat: deeper than 256");
|
|
4328
4382
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
4329
4383
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
4330
4384
|
const l = `[${t}]`;
|
|
@@ -4334,20 +4388,20 @@
|
|
|
4334
4388
|
const t = Object.keys(e);
|
|
4335
4389
|
if (t.length > 0) {
|
|
4336
4390
|
for (const l of t) {
|
|
4337
|
-
const t =
|
|
4391
|
+
const t = ri(l);
|
|
4338
4392
|
n(e[l], 0 === o ? t : r + "`" + t, o + 1);
|
|
4339
4393
|
}
|
|
4340
4394
|
return;
|
|
4341
4395
|
}
|
|
4342
4396
|
}
|
|
4343
|
-
0 !== o &&
|
|
4397
|
+
0 !== o && sl(t, r, e);
|
|
4344
4398
|
};
|
|
4345
4399
|
return null == e || n(e, "", 0), t;
|
|
4346
4400
|
}, e.json_array_append = Fo, e.json_array_append_new = Mo, e.json_array_extend = function(e, t) {
|
|
4347
4401
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
4348
4402
|
}, e.json_array_remove = Go, e.json_array_size = Wo, e.json_deep_copy = Ao, e.json_is_identical = Ro, e.json_mask_secrets = No, e.json_object_del = Po, e.json_object_get = Io, e.json_object_set = Lo, e.json_object_set_new = Uo, e.json_object_size = Vo, e.json_object_update = Do, e.json_object_update_existing = ko, e.json_object_update_missing = Co, e.json_size = xo, e.json_text_of = Fe, e.jwt2json = function(e, t) {
|
|
4349
4403
|
try {
|
|
4350
|
-
let n =
|
|
4404
|
+
let n = Vl(e);
|
|
4351
4405
|
switch (t) {
|
|
4352
4406
|
case "header": return JSON.parse(n.header);
|
|
4353
4407
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -4356,98 +4410,98 @@
|
|
|
4356
4410
|
} catch (e) {
|
|
4357
4411
|
return null;
|
|
4358
4412
|
}
|
|
4359
|
-
}, e.jwtDecode =
|
|
4360
|
-
if (e && !
|
|
4361
|
-
r || (r =
|
|
4413
|
+
}, e.jwtDecode = Vl, e.kw_clone_by_keys = El, e.kw_clone_by_not_keys = Tl, e.kw_collect = function(e, t, n, r) {
|
|
4414
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
4415
|
+
r || (r = vl);
|
|
4362
4416
|
let o = [];
|
|
4363
|
-
if (
|
|
4417
|
+
if (Yo(t)) for (let e = 0; e < t.length; e++) {
|
|
4364
4418
|
let l = t[e];
|
|
4365
4419
|
r(l, n) && o.push(l);
|
|
4366
4420
|
}
|
|
4367
4421
|
else {
|
|
4368
|
-
if (!
|
|
4422
|
+
if (!Bo(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
4369
4423
|
r(t, n) && o.push(t);
|
|
4370
4424
|
}
|
|
4371
4425
|
return o;
|
|
4372
|
-
}, e.kw_delete =
|
|
4373
|
-
if (!n || !
|
|
4426
|
+
}, e.kw_delete = _l, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
4427
|
+
if (!n || !Yo(t)) return r && ir("item NULL or kw_list is not a list"), -1;
|
|
4374
4428
|
for (let e = 0; e < t.length; e++) if (Ro(n, t[e])) return e;
|
|
4375
4429
|
return r && ir("item not found in this list"), -1;
|
|
4376
|
-
}, e.kw_find_path =
|
|
4377
|
-
e && !
|
|
4378
|
-
let l =
|
|
4430
|
+
}, e.kw_find_path = ul, e.kw_flag_t = Un, e.kw_get_bool = cl, e.kw_get_dict = bl, e.kw_get_dict_value = pl, e.kw_get_int = fl, e.kw_get_list = function(e, t, n, r, o) {
|
|
4431
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4432
|
+
let l = ul(e, t, n, !1);
|
|
4379
4433
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
4380
|
-
return void 0 === l ? s &&
|
|
4381
|
-
}, e.kw_get_local_storage_value =
|
|
4382
|
-
e && !
|
|
4383
|
-
let l =
|
|
4434
|
+
return void 0 === l ? s && Yo(r) && t ? (ml(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), $o(t)), r) : Yo(l) ? (a && _l(e, t, n), l) : s && null === l && Yo(r) ? (ml(e, t, n, r), r) : s && null === l ? (i && (ir(`path not found: '${n}'`), $o(t)), r) : ((i || s) && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json list: '${n}'` + (s ? ", cannot create" : "")), $o(t)), r);
|
|
4435
|
+
}, e.kw_get_local_storage_value = wl, e.kw_get_pointer = dl, e.kw_get_real = function(e, t, n, r, o) {
|
|
4436
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4437
|
+
let l = ul(e, t, n, !1);
|
|
4384
4438
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
4385
4439
|
if (void 0 === l) {
|
|
4386
4440
|
if (s && t) {
|
|
4387
4441
|
let o = Number(r);
|
|
4388
|
-
return
|
|
4442
|
+
return ml(e, t, n, o), o;
|
|
4389
4443
|
}
|
|
4390
4444
|
return i && (ir(`path not found: '${n}'`), $o(t)), Number(r);
|
|
4391
4445
|
}
|
|
4392
4446
|
let _;
|
|
4393
|
-
if (
|
|
4447
|
+
if (qo(l)) _ = l;
|
|
4394
4448
|
else {
|
|
4395
4449
|
if (!u) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a json real: '${n}'`), $o(t), Number(r);
|
|
4396
4450
|
if (Ho(l)) _ = l ? 1 : 0;
|
|
4397
|
-
else if (
|
|
4451
|
+
else if (Jo(l)) _ = parseFloat(l), Number.isNaN(_) && (_ = 0);
|
|
4398
4452
|
else {
|
|
4399
4453
|
if (null !== l) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $o(t), 0;
|
|
4400
4454
|
_ = 0;
|
|
4401
4455
|
}
|
|
4402
4456
|
}
|
|
4403
|
-
return a &&
|
|
4404
|
-
}, e.kw_get_str =
|
|
4405
|
-
if (e && !
|
|
4406
|
-
r || (r =
|
|
4457
|
+
return a && _l(e, t, n), _;
|
|
4458
|
+
}, e.kw_get_str = gl, e.kw_has_key = ll, e.kw_match_simple = vl, e.kw_pop = ol, e.kw_remove_local_storage_value = $l, e.kw_select = function(e, t, n, r) {
|
|
4459
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
4460
|
+
r || (r = vl);
|
|
4407
4461
|
let o = [];
|
|
4408
|
-
if (
|
|
4462
|
+
if (Yo(t)) for (let e = 0; e < t.length; e++) {
|
|
4409
4463
|
let l = t[e];
|
|
4410
4464
|
r(l, n) && o.push(Ao(l));
|
|
4411
4465
|
}
|
|
4412
4466
|
else {
|
|
4413
|
-
if (!
|
|
4467
|
+
if (!Bo(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
4414
4468
|
r(t, n) && o.push(Ao(t));
|
|
4415
4469
|
}
|
|
4416
4470
|
return o;
|
|
4417
|
-
}, e.kw_set_dict_value =
|
|
4418
|
-
e && !
|
|
4419
|
-
let l =
|
|
4471
|
+
}, e.kw_set_dict_value = ml, e.kw_set_local_storage_value = Nl, e.kw_set_subdict_value = hl, e.kwid_collect = Rl, e.kwid_find_one_record = function(e, t, n, r, o) {
|
|
4472
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4473
|
+
let l = Rl(e, t, n, r, o);
|
|
4420
4474
|
return l && 0 !== l.length ? l[0] : null;
|
|
4421
4475
|
}, e.kwid_get_ids = function(e, t) {
|
|
4422
|
-
if (e && !
|
|
4476
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return [];
|
|
4423
4477
|
let n = [];
|
|
4424
|
-
if (
|
|
4425
|
-
else if (
|
|
4426
|
-
else
|
|
4427
|
-
if (
|
|
4428
|
-
else if (
|
|
4429
|
-
let r =
|
|
4478
|
+
if (Jo(t)) n.push(t);
|
|
4479
|
+
else if (Bo(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
4480
|
+
else Yo(t) && t.forEach(function(t) {
|
|
4481
|
+
if (Jo(t)) Zo(t) || n.push(t);
|
|
4482
|
+
else if (Bo(t)) {
|
|
4483
|
+
let r = gl(e, t, "id", 0, 0);
|
|
4430
4484
|
r && n.push(r);
|
|
4431
4485
|
}
|
|
4432
4486
|
});
|
|
4433
4487
|
return n;
|
|
4434
|
-
}, e.kwid_match_id =
|
|
4435
|
-
e && !
|
|
4488
|
+
}, e.kwid_match_id = Al, e.kwid_new_dict = function(e, t, n) {
|
|
4489
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4436
4490
|
let r = {};
|
|
4437
|
-
if (
|
|
4438
|
-
else if (
|
|
4439
|
-
let o = t[n], l =
|
|
4440
|
-
|
|
4491
|
+
if (Zo(n) || (t = ul(e, t, n)), Bo(t)) r = t;
|
|
4492
|
+
else if (Yo(t)) for (let n = 0; n < t.length; n++) {
|
|
4493
|
+
let o = t[n], l = gl(e, o, "id", "", Un.KW_REQUIRED);
|
|
4494
|
+
Zo(l) || sl(r, l, o);
|
|
4441
4495
|
}
|
|
4442
4496
|
else ir(`${kt(e)} kwid_new_dict: data type unknown`);
|
|
4443
4497
|
return r;
|
|
4444
4498
|
}, e.kwid_new_list = function(e, t, n) {
|
|
4445
|
-
if (e && !
|
|
4446
|
-
if (
|
|
4499
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), Zo(n) || (t = ul(e, t, n)), Yo(t)) return t;
|
|
4500
|
+
if (Bo(t)) {
|
|
4447
4501
|
let n = [];
|
|
4448
4502
|
for (let r of Object.keys(t)) {
|
|
4449
4503
|
let o = t[r];
|
|
4450
|
-
|
|
4504
|
+
Bo(o) ? (o.id = r, n.push(o)) : ir(`${kt(e)} kwid_new_list: not a record: '${r}'`);
|
|
4451
4505
|
}
|
|
4452
4506
|
return n;
|
|
4453
4507
|
}
|
|
@@ -4455,16 +4509,16 @@
|
|
|
4455
4509
|
}, e.list2options = function(e, t, n) {
|
|
4456
4510
|
t = t || "id", n = n || "value";
|
|
4457
4511
|
let r = [];
|
|
4458
|
-
if (
|
|
4512
|
+
if (Yo(e)) for (let o = 0; o < e.length; o++) {
|
|
4459
4513
|
let l = e[o];
|
|
4460
|
-
if (
|
|
4514
|
+
if (Jo(l)) r.push({
|
|
4461
4515
|
id: e[o],
|
|
4462
4516
|
value: e[o]
|
|
4463
4517
|
});
|
|
4464
|
-
else if (
|
|
4518
|
+
else if (Bo(l)) {
|
|
4465
4519
|
let e = {};
|
|
4466
|
-
if (
|
|
4467
|
-
if (!
|
|
4520
|
+
if (ll(l, t)) {
|
|
4521
|
+
if (!ll(l, n)) {
|
|
4468
4522
|
if (!(xo(l) > 0)) {
|
|
4469
4523
|
ir("list2options(): object without field value: " + n);
|
|
4470
4524
|
continue;
|
|
@@ -4482,7 +4536,7 @@
|
|
|
4482
4536
|
r.push(e);
|
|
4483
4537
|
} else ir("list2options(): case1 not implemented");
|
|
4484
4538
|
}
|
|
4485
|
-
else if (
|
|
4539
|
+
else if (Bo(e)) for (let t of Object.keys(e)) r.push({
|
|
4486
4540
|
id: t,
|
|
4487
4541
|
value: t
|
|
4488
4542
|
});
|
|
@@ -4501,11 +4555,11 @@
|
|
|
4501
4555
|
}, r.send();
|
|
4502
4556
|
}, e.log_debug = ar, e.log_error = ir, e.log_info = function(e, ...t) {
|
|
4503
4557
|
let n = nr(e, ...t), r = Hl();
|
|
4504
|
-
Vn &&
|
|
4505
|
-
}, e.log_warning = sr, e.mask_secrets_inline = To, e.msg_iev_get_msg_type =
|
|
4558
|
+
Vn && qn("info", n) && rr(Vn, "%c" + r + " INFO: " + String(n), "color:cyan"), zn("info", n, r);
|
|
4559
|
+
}, e.log_warning = sr, e.mask_secrets_inline = To, e.msg_iev_get_msg_type = Fl, e.msg_iev_get_stack = Ll, e.msg_iev_push_stack = Pl, e.msg_iev_read_key = Cl, e.msg_iev_set_msg_type = Ul, e.msg_iev_write_key = Il, e.node_uuid = Zl, e.parseBoolean = el, e.parseSVG = function(e) {
|
|
4506
4560
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
4507
4561
|
}, e.refresh_language = function(e, t) {
|
|
4508
|
-
if (!
|
|
4562
|
+
if (!Qo(t)) return void ir("You must supply a translation function");
|
|
4509
4563
|
e || (e = document);
|
|
4510
4564
|
const n = (t) => {
|
|
4511
4565
|
let n = [];
|
|
@@ -4529,22 +4583,22 @@
|
|
|
4529
4583
|
});
|
|
4530
4584
|
}, e.register_c_ievent_cli = function() {
|
|
4531
4585
|
return function(e) {
|
|
4532
|
-
if (
|
|
4586
|
+
if (Li) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4533
4587
|
const t = [
|
|
4534
4588
|
["ST_DISCONNECTED", [
|
|
4535
4589
|
[
|
|
4536
4590
|
"EV_ON_OPEN",
|
|
4537
|
-
|
|
4591
|
+
Hi,
|
|
4538
4592
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
4539
4593
|
],
|
|
4540
4594
|
[
|
|
4541
4595
|
"EV_ON_CLOSE",
|
|
4542
|
-
|
|
4596
|
+
zi,
|
|
4543
4597
|
null
|
|
4544
4598
|
],
|
|
4545
4599
|
[
|
|
4546
4600
|
"EV_TIMEOUT",
|
|
4547
|
-
|
|
4601
|
+
qi,
|
|
4548
4602
|
null
|
|
4549
4603
|
],
|
|
4550
4604
|
[
|
|
@@ -4556,22 +4610,22 @@
|
|
|
4556
4610
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
4557
4611
|
[
|
|
4558
4612
|
"EV_ON_MESSAGE",
|
|
4559
|
-
|
|
4613
|
+
ns,
|
|
4560
4614
|
null
|
|
4561
4615
|
],
|
|
4562
4616
|
[
|
|
4563
4617
|
"EV_IDENTITY_CARD_ACK",
|
|
4564
|
-
|
|
4618
|
+
ts,
|
|
4565
4619
|
null
|
|
4566
4620
|
],
|
|
4567
4621
|
[
|
|
4568
4622
|
"EV_ON_CLOSE",
|
|
4569
|
-
|
|
4623
|
+
zi,
|
|
4570
4624
|
"ST_DISCONNECTED"
|
|
4571
4625
|
],
|
|
4572
4626
|
[
|
|
4573
4627
|
"EV_TIMEOUT",
|
|
4574
|
-
|
|
4628
|
+
es,
|
|
4575
4629
|
null
|
|
4576
4630
|
],
|
|
4577
4631
|
[
|
|
@@ -4583,22 +4637,22 @@
|
|
|
4583
4637
|
["ST_SESSION", [
|
|
4584
4638
|
[
|
|
4585
4639
|
"EV_ON_MESSAGE",
|
|
4586
|
-
|
|
4640
|
+
ns,
|
|
4587
4641
|
null
|
|
4588
4642
|
],
|
|
4589
4643
|
[
|
|
4590
4644
|
"EV_MT_STATS",
|
|
4591
|
-
|
|
4645
|
+
os,
|
|
4592
4646
|
null
|
|
4593
4647
|
],
|
|
4594
4648
|
[
|
|
4595
4649
|
"EV_MT_COMMAND",
|
|
4596
|
-
|
|
4650
|
+
ls,
|
|
4597
4651
|
null
|
|
4598
4652
|
],
|
|
4599
4653
|
[
|
|
4600
4654
|
"EV_ON_CLOSE",
|
|
4601
|
-
|
|
4655
|
+
zi,
|
|
4602
4656
|
"ST_DISCONNECTED"
|
|
4603
4657
|
],
|
|
4604
4658
|
[
|
|
@@ -4609,7 +4663,7 @@
|
|
|
4609
4663
|
]],
|
|
4610
4664
|
[null, null]
|
|
4611
4665
|
];
|
|
4612
|
-
return (
|
|
4666
|
+
return (Li = Ke(e, [
|
|
4613
4667
|
["EV_ON_MESSAGE", F.EVF_OUTPUT_EVENT],
|
|
4614
4668
|
["EV_IDENTITY_CARD_ACK", F.EVF_PUBLIC_EVENT],
|
|
4615
4669
|
["EV_ON_ID_NAK", F.EVF_OUTPUT_EVENT],
|
|
@@ -4620,36 +4674,36 @@
|
|
|
4620
4674
|
["EV_ON_OPEN_ERROR", F.EVF_OUTPUT_EVENT | F.EVF_NO_WARN_SUBS],
|
|
4621
4675
|
["EV_TIMEOUT", 0],
|
|
4622
4676
|
[null, 0]
|
|
4623
|
-
], t,
|
|
4677
|
+
], t, is, 0, ki, Pi, 0, 0, Ci, P.gcflag_no_check_output_events)) ? 0 : -1;
|
|
4624
4678
|
}("C_IEVENT_CLI");
|
|
4625
4679
|
}, e.register_c_timer = function() {
|
|
4626
4680
|
return function(e) {
|
|
4627
|
-
if (
|
|
4681
|
+
if (di) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4628
4682
|
const t = [["ST_IDLE", [[
|
|
4629
4683
|
"EV_TIMEOUT",
|
|
4630
|
-
|
|
4684
|
+
bi,
|
|
4631
4685
|
null
|
|
4632
4686
|
]]]];
|
|
4633
|
-
return (
|
|
4687
|
+
return (di = Ke(e, [
|
|
4634
4688
|
["EV_TIMEOUT", F.EVF_OUTPUT_EVENT],
|
|
4635
4689
|
["EV_TIMEOUT_PERIODIC", F.EVF_OUTPUT_EVENT],
|
|
4636
4690
|
[0, 0]
|
|
4637
|
-
], t,
|
|
4691
|
+
], t, pi, 0, fi, gi, 0, 0, 0, P.gcflag_manual_start)) ? 0 : -1;
|
|
4638
4692
|
}("C_TIMER");
|
|
4639
4693
|
}, e.register_c_yuno = function() {
|
|
4640
4694
|
return function(e) {
|
|
4641
|
-
if (
|
|
4695
|
+
if (ji) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4642
4696
|
const t = [["ST_IDLE", [[
|
|
4643
4697
|
"EV_TIMEOUT_PERIODIC",
|
|
4644
|
-
|
|
4698
|
+
Ai,
|
|
4645
4699
|
null
|
|
4646
4700
|
]]]];
|
|
4647
|
-
return (
|
|
4701
|
+
return (ji = Ke(e, [["EV_TIMEOUT_PERIODIC", F.EVF_OUTPUT_EVENT | F.EVF_NO_WARN_SUBS], [0, 0]], t, Ri, 0, Ei, Ti, 0, 0, 0, 0)) ? 0 : -1;
|
|
4648
4702
|
}("C_YUNO");
|
|
4649
4703
|
}, e.safeSrc = function(e) {
|
|
4650
4704
|
if (!e) return "";
|
|
4651
4705
|
const t = String(e).trim();
|
|
4652
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
4706
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Wl(t);
|
|
4653
4707
|
}, e.sdata_flag_t = A, e.send_http_json_post = function(e, t, n) {
|
|
4654
4708
|
let r = new XMLHttpRequest();
|
|
4655
4709
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -4673,16 +4727,16 @@
|
|
|
4673
4727
|
}
|
|
4674
4728
|
} else xn = e;
|
|
4675
4729
|
}, e.set_remote_log_functions = Xn, e.set_strings_are_text = function(e) {
|
|
4676
|
-
|
|
4677
|
-
}, e.set_timeout =
|
|
4678
|
-
return
|
|
4730
|
+
Yl = !!e;
|
|
4731
|
+
}, e.set_timeout = hi, e.set_timeout_periodic = yi, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = kl, e.strcasecmp = nl, e.strcmp = tl, e.strings_are_text = function() {
|
|
4732
|
+
return Yl;
|
|
4679
4733
|
}, e.strncmp = function(e, t, n) {
|
|
4680
4734
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
4681
4735
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
4682
4736
|
}, e.strs_in_list = function(e, t, n) {
|
|
4683
4737
|
if (!e) return ir("ERROR: strs_in_list() list empty"), !1;
|
|
4684
4738
|
if (!t) return ir("ERROR: strs_in_list() str empty"), !1;
|
|
4685
|
-
for (let r = 0; r < t.length; r++) if (
|
|
4739
|
+
for (let r = 0; r < t.length; r++) if (kl(e, t[r], n)) return !0;
|
|
4686
4740
|
return !1;
|
|
4687
4741
|
}, e.strstr = function(e, t, n) {
|
|
4688
4742
|
var r;
|
|
@@ -4701,13 +4755,13 @@
|
|
|
4701
4755
|
placeholder: void 0,
|
|
4702
4756
|
fkey: null
|
|
4703
4757
|
};
|
|
4704
|
-
if (
|
|
4758
|
+
if (Jo(t)) {
|
|
4705
4759
|
let e = t.split(".");
|
|
4706
4760
|
for (let t = 0; t < e.length; t++) {
|
|
4707
4761
|
let r = e[t];
|
|
4708
|
-
if (
|
|
4709
|
-
else if (
|
|
4710
|
-
else if (
|
|
4762
|
+
if (kl(ai, r)) n.real_type || (n.real_type = r);
|
|
4763
|
+
else if (kl(_i, r)) n.type || (n.type = r);
|
|
4764
|
+
else if (kl(ui, r)) switch (r) {
|
|
4711
4765
|
case "writable":
|
|
4712
4766
|
n.is_writable = !0;
|
|
4713
4767
|
break;
|
|
@@ -4719,7 +4773,7 @@
|
|
|
4719
4773
|
}
|
|
4720
4774
|
}
|
|
4721
4775
|
n.real_type || (n.real_type = "string");
|
|
4722
|
-
} else
|
|
4776
|
+
} else Bo(t) ? (n = ci(t), n.name || (n.name = e), n.header || (n.header = e)) : Yo(t) && (n.real_type = "array", n.enum_list = t);
|
|
4723
4777
|
return n.type || (n.type = n.real_type), n;
|
|
4724
4778
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
4725
4779
|
const n = e, r = performance.now();
|
|
@@ -4731,8 +4785,8 @@
|
|
|
4731
4785
|
total: a
|
|
4732
4786
|
};
|
|
4733
4787
|
} };
|
|
4734
|
-
}, e.trace_json = _r, e.trace_json_masked = $o, e.trace_level_t = B, e.trace_msg = ur, e.treedb_decoder_fkey =
|
|
4735
|
-
if (
|
|
4788
|
+
}, e.trace_json = _r, e.trace_json_masked = $o, e.trace_level_t = B, e.trace_msg = ur, e.treedb_decoder_fkey = si, e.treedb_decoder_hook = function(e, t) {
|
|
4789
|
+
if (Jo(t)) {
|
|
4736
4790
|
if (-1 === t.indexOf("^")) {
|
|
4737
4791
|
let n, r = e.hook;
|
|
4738
4792
|
if (1 !== Vo(r)) return ir("bad hook 1"), ir(e), ir(t), null;
|
|
@@ -4753,17 +4807,17 @@
|
|
|
4753
4807
|
};
|
|
4754
4808
|
}
|
|
4755
4809
|
}
|
|
4756
|
-
return
|
|
4810
|
+
return Bo(t) ? {
|
|
4757
4811
|
topic_name: t.topic_name,
|
|
4758
4812
|
id: t.id
|
|
4759
4813
|
} : (ir("bad hook 3"), ir(e), ir(t), null);
|
|
4760
4814
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
4761
|
-
let n =
|
|
4815
|
+
let n = si(e, t);
|
|
4762
4816
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
4763
|
-
}, e.treedb_get_field_desc =
|
|
4764
|
-
if (
|
|
4817
|
+
}, e.treedb_get_field_desc = ci, e.treedb_hook_data_size = function(e) {
|
|
4818
|
+
if (Yo(e) && 1 === xo(e)) {
|
|
4765
4819
|
let t = e[0];
|
|
4766
|
-
return
|
|
4820
|
+
return ll(t, "size") ? t.size : 1;
|
|
4767
4821
|
}
|
|
4768
4822
|
return xo(e);
|
|
4769
4823
|
}, e.vsprintf = function(e, t) {
|