@yuneta/gobj-js 7.25.9 → 7.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -24
- package/dist/gobj-js.cjs.js +176 -72
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +916 -862
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +176 -72
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1032 -978
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +176 -72
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +923 -869
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +176 -72
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +923 -869
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +2 -2
package/dist/gobj-js.iife.min.js
CHANGED
|
@@ -117,7 +117,7 @@ var gobjJs = function(e) {
|
|
|
117
117
|
function l(e, t, n, r, l) {
|
|
118
118
|
return {
|
|
119
119
|
result: t,
|
|
120
|
-
comment: n ||
|
|
120
|
+
comment: n || "",
|
|
121
121
|
schema: r || {},
|
|
122
122
|
data: l || []
|
|
123
123
|
};
|
|
@@ -130,7 +130,7 @@ var gobjJs = function(e) {
|
|
|
130
130
|
data: l || []
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b =
|
|
133
|
+
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = Object.create(null), p = null, m = null, h = 0, E = Object.freeze({
|
|
134
134
|
DTP_STRING: 1,
|
|
135
135
|
DTP_BOOLEAN: 2,
|
|
136
136
|
DTP_INTEGER: 3,
|
|
@@ -175,7 +175,7 @@ var gobjJs = function(e) {
|
|
|
175
175
|
}
|
|
176
176
|
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, l) {
|
|
178
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
178
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = Un(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
180
|
}, w = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
@@ -221,7 +221,7 @@ var gobjJs = function(e) {
|
|
|
221
221
|
};
|
|
222
222
|
var C = 1;
|
|
223
223
|
function L(e) {
|
|
224
|
-
|
|
224
|
+
Xn(e) && (e = JSON.stringify(e)), En(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
225
225
|
}
|
|
226
226
|
var P = Object.freeze({
|
|
227
227
|
TRACE_MACHINE: 65536,
|
|
@@ -323,7 +323,7 @@ var gobjJs = function(e) {
|
|
|
323
323
|
return n;
|
|
324
324
|
}
|
|
325
325
|
function W(e, t, n) {
|
|
326
|
-
if (
|
|
326
|
+
if (sr(e)) return void 0 === n ? 268369920 : 65535;
|
|
327
327
|
if (/^[0-9]+$/.test(String(e))) {
|
|
328
328
|
const t = Number(e);
|
|
329
329
|
if (t) return t;
|
|
@@ -334,7 +334,7 @@ var gobjJs = function(e) {
|
|
|
334
334
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
335
335
|
}
|
|
336
336
|
return 0;
|
|
337
|
-
}(String(e), n) || (
|
|
337
|
+
}(String(e), n) || (mn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
338
338
|
}
|
|
339
339
|
function x(e) {
|
|
340
340
|
if (G) return 4294967295;
|
|
@@ -354,16 +354,16 @@ var gobjJs = function(e) {
|
|
|
354
354
|
function J(e) {
|
|
355
355
|
return x(e) & P.TRACE_START_STOP;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function q(e) {
|
|
358
358
|
return x(e) & P.TRACE_EV_KW;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function H(e, t) {
|
|
361
361
|
if (G > 1) return !0;
|
|
362
362
|
if (!e) return !1;
|
|
363
363
|
const n = x(e);
|
|
364
364
|
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function z(e, t) {
|
|
367
367
|
if (G > 1) return !1;
|
|
368
368
|
if (!e) return !0;
|
|
369
369
|
const n = K(e);
|
|
@@ -390,32 +390,32 @@ var gobjJs = function(e) {
|
|
|
390
390
|
return M(V, null);
|
|
391
391
|
}
|
|
392
392
|
function re(e) {
|
|
393
|
-
const t =
|
|
394
|
-
return t ? M(t.trace_level | F, t.s_user_trace_level) : (
|
|
393
|
+
const t = er(e) ? Oe(e) : e;
|
|
394
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (mn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
395
395
|
}
|
|
396
396
|
function le(e) {
|
|
397
|
-
const t =
|
|
398
|
-
return t ? M(t.trace_level, t.s_user_trace_level) : (
|
|
397
|
+
const t = er(e) ? Oe(e) : e;
|
|
398
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (mn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
399
399
|
}
|
|
400
400
|
function oe(e) {
|
|
401
|
-
const t =
|
|
402
|
-
return t ? M(t.no_trace_level, t.s_user_trace_level) : (
|
|
401
|
+
const t = er(e) ? Oe(e) : e;
|
|
402
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (mn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
403
403
|
}
|
|
404
404
|
function se(e, t, n) {
|
|
405
|
-
const r =
|
|
406
|
-
if (!r) return
|
|
405
|
+
const r = er(e) ? Oe(e) : e;
|
|
406
|
+
if (!r) return mn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
407
407
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
408
408
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
409
409
|
}
|
|
410
410
|
function ie(e, t, n) {
|
|
411
|
-
const r =
|
|
412
|
-
if (!r) return
|
|
411
|
+
const r = er(e) ? Oe(e) : e;
|
|
412
|
+
if (!r) return mn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
413
413
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
414
414
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
415
415
|
}
|
|
416
416
|
function _e(e, t) {
|
|
417
417
|
let n = {};
|
|
418
|
-
if (!
|
|
418
|
+
if (!Zn(t)) return mn("sdata_desc MUST be an array"), Tn(t), n;
|
|
419
419
|
for (let r = 0; r < t.length; r++) {
|
|
420
420
|
const l = t[r];
|
|
421
421
|
l.name && ae(e, n, l);
|
|
@@ -429,133 +429,132 @@ var gobjJs = function(e) {
|
|
|
429
429
|
r = String(l);
|
|
430
430
|
break;
|
|
431
431
|
case E.DTP_BOOLEAN:
|
|
432
|
-
r =
|
|
432
|
+
r = ir(l);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_INTEGER:
|
|
435
|
-
r = parseInt(l), isNaN(r) &&
|
|
435
|
+
r = parseInt(l), isNaN(r) && mn(`${et(e)}: attr NaN: ${n.name}`);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_REAL:
|
|
438
|
-
r = Number(l), isNaN(r) &&
|
|
438
|
+
r = Number(l), isNaN(r) && mn(`${et(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
440
|
case E.DTP_LIST:
|
|
441
|
-
if (
|
|
441
|
+
if (er(l)) try {
|
|
442
442
|
r = JSON.parse(l);
|
|
443
443
|
} catch (e) {
|
|
444
|
-
|
|
444
|
+
mn(`JSON parse error: ${e.message}`);
|
|
445
445
|
}
|
|
446
446
|
else r = l;
|
|
447
|
-
|
|
447
|
+
Zn(r) || (r = []);
|
|
448
448
|
break;
|
|
449
449
|
case E.DTP_DICT:
|
|
450
|
-
if (
|
|
450
|
+
if (er(l)) try {
|
|
451
451
|
r = JSON.parse(l);
|
|
452
452
|
} catch (e) {
|
|
453
|
-
|
|
453
|
+
mn(`JSON parse error: ${e.message}`);
|
|
454
454
|
}
|
|
455
455
|
else r = l;
|
|
456
|
-
|
|
456
|
+
Xn(r) || (r = {});
|
|
457
457
|
break;
|
|
458
458
|
case E.DTP_JSON:
|
|
459
|
-
if (
|
|
459
|
+
if ("" === l || void 0 === l) r = null;
|
|
460
|
+
else if (er(l)) try {
|
|
460
461
|
r = JSON.parse(l);
|
|
461
462
|
} catch (e) {
|
|
462
|
-
|
|
463
|
+
mn(`JSON parse error: ${e.message}`);
|
|
463
464
|
}
|
|
464
465
|
else r = l;
|
|
465
466
|
break;
|
|
466
467
|
case E.DTP_POINTER: r = l;
|
|
467
468
|
}
|
|
468
|
-
return void 0 === r && (
|
|
469
|
+
return void 0 === r && (mn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
469
470
|
}
|
|
470
471
|
function ue(e, t, n, r) {
|
|
471
472
|
let l;
|
|
472
473
|
switch (n.type) {
|
|
473
474
|
case E.DTP_STRING:
|
|
474
475
|
if (null == r) l = "";
|
|
475
|
-
else if (
|
|
476
|
+
else if (er(r)) l = String(r);
|
|
476
477
|
else {
|
|
477
478
|
let e = JSON.stringify(r);
|
|
478
479
|
e && (l = String(e));
|
|
479
480
|
}
|
|
480
481
|
break;
|
|
481
482
|
case E.DTP_BOOLEAN:
|
|
482
|
-
l =
|
|
483
|
+
l = ir(r);
|
|
483
484
|
break;
|
|
484
485
|
case E.DTP_INTEGER:
|
|
485
|
-
l = parseInt(r), isNaN(l)
|
|
486
|
+
if (l = parseInt(r), isNaN(l)) return mn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
486
487
|
break;
|
|
487
488
|
case E.DTP_REAL:
|
|
488
|
-
l = Number(r), isNaN(l)
|
|
489
|
+
if (l = Number(r), isNaN(l)) return mn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
489
490
|
break;
|
|
490
491
|
case E.DTP_LIST:
|
|
491
|
-
if (
|
|
492
|
+
if (er(r)) try {
|
|
492
493
|
l = JSON.parse(r);
|
|
493
494
|
} catch (e) {
|
|
494
|
-
|
|
495
|
+
mn(`JSON parse error: ${e.message}`);
|
|
495
496
|
}
|
|
496
497
|
else l = r;
|
|
497
|
-
if (!
|
|
498
|
+
if (!Zn(l)) return mn(`attr must be an array: ${n.name}`), -1;
|
|
498
499
|
break;
|
|
499
500
|
case E.DTP_DICT:
|
|
500
|
-
if (
|
|
501
|
+
if (er(r)) try {
|
|
501
502
|
l = JSON.parse(r);
|
|
502
503
|
} catch (e) {
|
|
503
|
-
|
|
504
|
+
mn(`JSON parse error: ${e.message}`);
|
|
504
505
|
}
|
|
505
506
|
else l = r;
|
|
506
|
-
if (!
|
|
507
|
+
if (!Xn(l)) return mn(`attr must be an object: ${n.name}`), -1;
|
|
507
508
|
break;
|
|
508
509
|
case E.DTP_JSON:
|
|
509
|
-
if (
|
|
510
|
+
if (l = r, er(r)) try {
|
|
510
511
|
l = JSON.parse(r);
|
|
511
512
|
} catch (e) {
|
|
512
|
-
|
|
513
|
+
l = r;
|
|
513
514
|
}
|
|
514
|
-
else l = r;
|
|
515
|
-
if (!Xn(l) && !Qn(l)) return pn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
516
515
|
break;
|
|
517
516
|
case E.DTP_POINTER: l = r;
|
|
518
517
|
}
|
|
519
|
-
return void 0 === l &&
|
|
518
|
+
return void 0 === l && mn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, Xn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
520
519
|
}
|
|
521
520
|
function ce(e) {
|
|
522
521
|
return e.jn_attrs;
|
|
523
522
|
}
|
|
524
523
|
function fe(e, t, n) {
|
|
525
|
-
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n &&
|
|
524
|
+
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n && mn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`), null);
|
|
526
525
|
}
|
|
527
526
|
function ge(e, t, n) {
|
|
528
|
-
if (!(e && e instanceof O)) return n &&
|
|
527
|
+
if (!(e && e instanceof O)) return n && mn("gclass NULL"), null;
|
|
529
528
|
if (!t) return e.attrs_table;
|
|
530
529
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
531
530
|
const r = e.attrs_table[n];
|
|
532
531
|
if (r.name && r.name === t) return r;
|
|
533
532
|
}
|
|
534
|
-
return n &&
|
|
533
|
+
return n && mn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
535
534
|
}
|
|
536
535
|
function de(e, t, n, r, l, o, s, i, _, a, u) {
|
|
537
|
-
if (
|
|
538
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
539
|
-
if (Oe(e)) return
|
|
536
|
+
if (sr(e)) return mn("gclass_name EMPTY"), null;
|
|
537
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return mn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
538
|
+
if (Oe(e)) return mn(`GClass ALREADY exists: ${e}`), null;
|
|
540
539
|
let c = new O(e, r, l, o, s, i, _, a, u);
|
|
541
540
|
(function(e, t) {
|
|
542
|
-
e && e instanceof O ? t ? d[t] ?
|
|
541
|
+
e && e instanceof O ? t ? d[t] ? mn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : mn("gclass_name undefined") : mn("gclass undefined");
|
|
543
542
|
})(c, e);
|
|
544
543
|
const f = n.length;
|
|
545
544
|
for (let e = 0; e < f; e++) {
|
|
546
545
|
let t = n[e][0], r = n[e][1];
|
|
547
|
-
if (
|
|
546
|
+
if (sr(t)) continue;
|
|
548
547
|
if (he(c, t) < 0) return be(c), null;
|
|
549
548
|
const l = r.length;
|
|
550
549
|
for (let e = 0; e < l; e++) {
|
|
551
550
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
552
|
-
|
|
551
|
+
sr(n) || Ee(c, t, n, l, o);
|
|
553
552
|
}
|
|
554
553
|
}
|
|
555
554
|
for (let e = 0; e < t.length; e++) {
|
|
556
555
|
let n = t[e][0], r = t[e][1];
|
|
557
|
-
if (!
|
|
558
|
-
if (ve(c, n)) return
|
|
556
|
+
if (!sr(n)) {
|
|
557
|
+
if (ve(c, n)) return mn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
559
558
|
Te(c, n, r);
|
|
560
559
|
}
|
|
561
560
|
}
|
|
@@ -567,13 +566,13 @@ var gobjJs = function(e) {
|
|
|
567
566
|
}
|
|
568
567
|
function be(e) {
|
|
569
568
|
let t;
|
|
570
|
-
if (
|
|
569
|
+
if (er(e)) t = e;
|
|
571
570
|
else {
|
|
572
|
-
if (!(e instanceof O)) return
|
|
571
|
+
if (!(e instanceof O)) return mn("Cannot unregister gclass, type unknown"), -1;
|
|
573
572
|
t = e.gclass_name;
|
|
574
573
|
}
|
|
575
574
|
let n = d[t];
|
|
576
|
-
return n ? n.instances > 0 ? (
|
|
575
|
+
return n ? n.instances > 0 ? (mn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (mn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
577
576
|
}
|
|
578
577
|
function pe(e, t) {
|
|
579
578
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -592,22 +591,22 @@ var gobjJs = function(e) {
|
|
|
592
591
|
return null;
|
|
593
592
|
}
|
|
594
593
|
function he(e, t) {
|
|
595
|
-
return e instanceof O ? pe(e, t) ? (
|
|
594
|
+
return e instanceof O ? pe(e, t) ? (mn(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (mn("Cannot add state, typeof not GClass"), -1);
|
|
596
595
|
}
|
|
597
596
|
function Ee(e, t, n, r, l) {
|
|
598
|
-
if (!(e instanceof O)) return
|
|
599
|
-
if (
|
|
597
|
+
if (!(e instanceof O)) return mn("Cannot add state, typeof not GClass"), -1;
|
|
598
|
+
if (sr(t)) return mn("state_name EMPTY"), -1;
|
|
600
599
|
let o = pe(e, t);
|
|
601
|
-
return o ? me(o, n) ? (
|
|
600
|
+
return o ? me(o, n) ? (mn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (mn(`state not found: ${t}`), -1);
|
|
602
601
|
}
|
|
603
602
|
function ye(e, t, n) {
|
|
604
|
-
|
|
603
|
+
sr(t) || e.push(new I(t, n));
|
|
605
604
|
}
|
|
606
605
|
function Te(e, t, n) {
|
|
607
|
-
return e instanceof O ? ye(e.dl_events, t, n) : (
|
|
606
|
+
return e instanceof O ? ye(e.dl_events, t, n) : (mn("Cannot add state, typeof not GClass"), -1);
|
|
608
607
|
}
|
|
609
608
|
function ve(e, t) {
|
|
610
|
-
if (!(e instanceof O)) return
|
|
609
|
+
if (!(e instanceof O)) return mn("Cannot add state, typeof not GClass"), 0;
|
|
611
610
|
const n = e.dl_events.length, r = e.dl_events;
|
|
612
611
|
for (let e = 0; e < n; e++) {
|
|
613
612
|
let n = r[e];
|
|
@@ -616,25 +615,25 @@ var gobjJs = function(e) {
|
|
|
616
615
|
return null;
|
|
617
616
|
}
|
|
618
617
|
function je(e) {
|
|
619
|
-
if (!(e instanceof O)) return
|
|
618
|
+
if (!(e instanceof O)) return mn("Cannot add state, typeof not GClass"), -1;
|
|
620
619
|
let t = 0;
|
|
621
|
-
zn(e.dl_states) || (
|
|
620
|
+
zn(e.dl_states) || (mn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
622
621
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
623
622
|
let r = e.dl_states[n];
|
|
624
|
-
if (!
|
|
623
|
+
if (!sr(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
625
624
|
let l = r.dl_actions[n];
|
|
626
|
-
|
|
625
|
+
sr(l.event_name) || (ve(e, l.event_name) || (mn(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (pe(e, l.next_state) || (mn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
627
626
|
}
|
|
628
627
|
}
|
|
629
628
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
630
629
|
let r = e.dl_events[n];
|
|
631
|
-
if (!
|
|
630
|
+
if (!sr(r.event_name) && (tr(r.event_flag) || (mn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & D.EVF_OUTPUT_EVENT))) {
|
|
632
631
|
let n = !1;
|
|
633
632
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
634
633
|
let l = e.dl_states[t];
|
|
635
|
-
|
|
634
|
+
sr(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
636
635
|
}
|
|
637
|
-
n || (
|
|
636
|
+
n || (mn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
638
637
|
}
|
|
639
638
|
}
|
|
640
639
|
return t;
|
|
@@ -644,65 +643,69 @@ var gobjJs = function(e) {
|
|
|
644
643
|
try {
|
|
645
644
|
n = d[e];
|
|
646
645
|
} catch (e) {}
|
|
647
|
-
return n || (t &&
|
|
646
|
+
return n || (t && mn(`gclass not found: ${e}`), null);
|
|
648
647
|
}
|
|
649
648
|
function Se() {
|
|
650
649
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
651
650
|
}
|
|
652
651
|
function we(e, t) {
|
|
652
|
+
if (!er(e)) return mn(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
653
653
|
e = e.toLowerCase();
|
|
654
|
-
return b[e] || (t &&
|
|
654
|
+
return b[e] || (t && mn(`gobj service not found: ${e}`), null);
|
|
655
655
|
}
|
|
656
656
|
function Ne(e) {
|
|
657
657
|
let t = Xe(e);
|
|
658
|
-
return t = t.toLowerCase(), b[t] &&
|
|
658
|
+
return t = t.toLowerCase(), b[t] && mn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
659
659
|
}
|
|
660
660
|
function Re(e, t) {
|
|
661
|
-
t.parent &&
|
|
661
|
+
t.parent && mn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
662
662
|
}
|
|
663
663
|
function De(e, t) {
|
|
664
|
-
let n =
|
|
665
|
-
n >= 0 && (
|
|
664
|
+
let n = qr(e.dl_children, t);
|
|
665
|
+
n >= 0 && (qn(e.dl_children, n), t.parent = null);
|
|
666
666
|
}
|
|
667
667
|
function $e(e, t) {
|
|
668
|
-
return Be(e) ? _ ? _(e, t) : -1 : (
|
|
668
|
+
return Be(e) ? _ ? _(e, t) : -1 : (mn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
669
669
|
}
|
|
670
670
|
function ke(e, t) {
|
|
671
|
-
"__json_config_variables__" !== t &&
|
|
671
|
+
"__json_config_variables__" !== t && mn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`);
|
|
672
672
|
}
|
|
673
673
|
function Ae(e, t, n) {
|
|
674
674
|
let r = t;
|
|
675
675
|
(function(e, t, n, r, l) {
|
|
676
|
-
if (!e || !t) return
|
|
676
|
+
if (!e || !t) return mn("hsdata or kw NULL"), -1;
|
|
677
677
|
let o = 0;
|
|
678
678
|
for (const [s, i] of Object.entries(t)) {
|
|
679
679
|
const t = ge(l.gclass, s, !1);
|
|
680
|
-
t ? (-1 === n || t.flag & n) && (t.flag & y.SDF_DEPRECATED &&
|
|
680
|
+
t ? (-1 === n || t.flag & n) && (t.flag & y.SDF_DEPRECATED && hn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
681
681
|
}
|
|
682
682
|
return o;
|
|
683
|
-
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (
|
|
683
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (mn(`${et(e)} json2data() FAILED`), Pn(r));
|
|
684
684
|
}
|
|
685
685
|
function Ie(e, t, r, l, o) {
|
|
686
686
|
if (o & N.gobj_flag_yuno) {
|
|
687
|
-
if (p) return
|
|
687
|
+
if (p) return mn("__yuno__ already created"), null;
|
|
688
688
|
o |= N.gobj_flag_service;
|
|
689
689
|
} else {
|
|
690
|
-
if (!l) return
|
|
691
|
-
if (!("string" == typeof l || l instanceof S)) return
|
|
692
|
-
if (
|
|
690
|
+
if (!l) return mn("gobj NEEDS a parent!"), null;
|
|
691
|
+
if (!("string" == typeof l || l instanceof S)) return mn(`BAD TYPE of parent: ${l}`), null;
|
|
692
|
+
if (er(l)) {
|
|
693
|
+
const e = l;
|
|
694
|
+
if (!(l = we(e))) return hn(`parent service not found: ${e}`), null;
|
|
695
|
+
}
|
|
693
696
|
}
|
|
694
|
-
if (o & N.gobj_flag_service && we(e, !1)) return
|
|
697
|
+
if (o & N.gobj_flag_service && we(e, !1)) return mn(`service ALREADY registered: ${t}^${e}`), null;
|
|
695
698
|
if (o & N.gobj_flag_default_service) {
|
|
696
|
-
if (m) return
|
|
699
|
+
if (m) return mn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
697
700
|
o |= N.gobj_flag_service;
|
|
698
701
|
}
|
|
699
|
-
if (
|
|
702
|
+
if (sr(t)) return mn("gclass_name must be a string"), null;
|
|
700
703
|
let s = Oe(t, !1);
|
|
701
|
-
if (!s) return
|
|
702
|
-
if (!
|
|
703
|
-
if (!
|
|
704
|
-
if (e.includes("`")) return
|
|
705
|
-
if (e.includes("^")) return
|
|
704
|
+
if (!s) return mn(`GClass not registered: ${t}^${e}`), null;
|
|
705
|
+
if (!er(e)) return mn(`gobj_name must be a string: ${t}`), null;
|
|
706
|
+
if (!sr(e)) {
|
|
707
|
+
if (e.includes("`")) return mn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
708
|
+
if (e.includes("^")) return mn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
706
709
|
}
|
|
707
710
|
let _ = new S(e, s, r, l, o);
|
|
708
711
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
@@ -714,8 +717,8 @@ var gobjJs = function(e) {
|
|
|
714
717
|
return Ie(e, t, n, r, N.gobj_flag_pure_child);
|
|
715
718
|
}
|
|
716
719
|
function Le(e) {
|
|
717
|
-
if (ot(e)) return void
|
|
718
|
-
e.__refs__ > 0 &&
|
|
720
|
+
if (ot(e)) return void mn("gobj NULL or DESTROYED");
|
|
721
|
+
e.__refs__ > 0 && mn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (mn(`Destroying a PLAYING gobj: ${tt(e)}`), xe(e)), e.running && (mn(`Destroying a RUNNING gobj: ${tt(e)}`), Ve(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
719
722
|
if (0 === Lt.length) return;
|
|
720
723
|
for (let t of Lt) t.src === e && (t.src = null);
|
|
721
724
|
Lt = Lt.filter((t) => t.dst !== e);
|
|
@@ -725,8 +728,8 @@ var gobjJs = function(e) {
|
|
|
725
728
|
let r = nt(e);
|
|
726
729
|
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
727
730
|
let t = Xe(e);
|
|
728
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
729
|
-
}(e),
|
|
731
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : mn(`"service NOT found in register": ${t}`);
|
|
732
|
+
}(e), e === m && (m = null), qt(e, e.dl_subscriptions, !0), qt(e, e.dl_subscribings, !0), r && (De(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
730
733
|
let t = e.dl_children.slice();
|
|
731
734
|
for (let e = 0; e < t.length; e++) {
|
|
732
735
|
let n = t[e];
|
|
@@ -735,9 +738,9 @@ var gobjJs = function(e) {
|
|
|
735
738
|
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
736
739
|
}
|
|
737
740
|
function Pe(e) {
|
|
738
|
-
if (ot(e)) return
|
|
739
|
-
if (e.running) return
|
|
740
|
-
if (e.disabled) return
|
|
741
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), -1;
|
|
742
|
+
if (e.running) return mn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
743
|
+
if (e.disabled) return mn(`${et(e)}: GObj DISABLED`), -1;
|
|
741
744
|
J(e) && L(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
742
745
|
let t = 0;
|
|
743
746
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
@@ -749,9 +752,9 @@ var gobjJs = function(e) {
|
|
|
749
752
|
return e.gclass.gclass_flag & w.gcflag_manual_start || Ye(e) ? 1 : (Ke(e) || Pe(e), 0);
|
|
750
753
|
}
|
|
751
754
|
function Ve(e) {
|
|
752
|
-
if (ot(e)) return
|
|
753
|
-
if (!e.running) return
|
|
754
|
-
e.playing && (
|
|
755
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), -1;
|
|
756
|
+
if (!e.running) return mn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
757
|
+
e.playing && (hn(`${et(e)}: GObj stopping without previous pause`), xe(e)), J(e) && L(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
755
758
|
let t = 0;
|
|
756
759
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
757
760
|
}
|
|
@@ -759,22 +762,22 @@ var gobjJs = function(e) {
|
|
|
759
762
|
return Ke(e) && Ve(e), 0;
|
|
760
763
|
}
|
|
761
764
|
function Me(e) {
|
|
762
|
-
return ot(e) ? (
|
|
765
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), -1) : at(e, $.WALK_FIRST2LAST, Ge, 0, 0);
|
|
763
766
|
}
|
|
764
767
|
function We(e) {
|
|
765
|
-
if (ot(e)) return
|
|
766
|
-
if (e.playing) return
|
|
767
|
-
if (e.disabled) return
|
|
768
|
+
if (ot(e)) return mn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
769
|
+
if (e.playing) return mn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
770
|
+
if (e.disabled) return mn(`${et(e)}: GObj DISABLED`), -1;
|
|
768
771
|
if (!Ke(e)) {
|
|
769
|
-
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return
|
|
770
|
-
|
|
772
|
+
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return mn(`${et(e)}: Cannot play, start not done`), -1;
|
|
773
|
+
hn(`${et(e)}: GObj playing without previous start`), Pe(e);
|
|
771
774
|
}
|
|
772
775
|
J(e) && L(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
773
776
|
let t = 0;
|
|
774
777
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
775
778
|
}
|
|
776
779
|
function xe(e) {
|
|
777
|
-
return ot(e) ? (
|
|
780
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && L(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (mn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
778
781
|
}
|
|
779
782
|
function Ke(e) {
|
|
780
783
|
return !ot(e) && e.running;
|
|
@@ -788,66 +791,66 @@ var gobjJs = function(e) {
|
|
|
788
791
|
function Je(e) {
|
|
789
792
|
return !ot(e) && e.playing;
|
|
790
793
|
}
|
|
791
|
-
function
|
|
794
|
+
function qe() {
|
|
792
795
|
return !p || p.obflag & R.obflag_destroyed ? null : p;
|
|
793
796
|
}
|
|
794
|
-
function
|
|
795
|
-
let e =
|
|
797
|
+
function He() {
|
|
798
|
+
let e = qe();
|
|
796
799
|
return e ? Xe(e) : "";
|
|
797
800
|
}
|
|
798
|
-
function
|
|
799
|
-
let e =
|
|
801
|
+
function ze() {
|
|
802
|
+
let e = qe();
|
|
800
803
|
return e ? jt(e, "yuno_role") : "";
|
|
801
804
|
}
|
|
802
805
|
function Qe() {
|
|
803
|
-
let e =
|
|
806
|
+
let e = qe();
|
|
804
807
|
return e ? jt(e, "yuno_id") : "";
|
|
805
808
|
}
|
|
806
809
|
function Xe(e) {
|
|
807
|
-
return
|
|
810
|
+
return or(e) ? e.gobj_name : (mn("gobj bad type"), null);
|
|
808
811
|
}
|
|
809
812
|
function Ze(e) {
|
|
810
|
-
return
|
|
813
|
+
return or(e) ? e.gclass.gclass_name : (mn("gobj NULL of bad type"), null);
|
|
811
814
|
}
|
|
812
815
|
function et(e) {
|
|
813
|
-
return
|
|
816
|
+
return or(e) ? e.gclass.gclass_name + "^" + Xe(e) : (mn("gobj bad type"), null);
|
|
814
817
|
}
|
|
815
818
|
function tt(e) {
|
|
816
|
-
if (!
|
|
819
|
+
if (!or(e)) return mn("gobj NULL of bad type"), null;
|
|
817
820
|
let t = et(e), n = nt(e);
|
|
818
821
|
for (; n;) t = et(n) + "`" + t, n = nt(n);
|
|
819
822
|
return t;
|
|
820
823
|
}
|
|
821
824
|
function nt(e) {
|
|
822
|
-
return
|
|
825
|
+
return or(e) ? e.parent : (mn("gobj NULL of bad type"), null);
|
|
823
826
|
}
|
|
824
827
|
function rt(e) {
|
|
825
|
-
return
|
|
828
|
+
return or(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (mn("gobj NULL of bad type"), null);
|
|
826
829
|
}
|
|
827
830
|
function lt(e) {
|
|
828
|
-
return
|
|
831
|
+
return or(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (mn("gobj NULL of bad type"), null);
|
|
829
832
|
}
|
|
830
833
|
function ot(e) {
|
|
831
|
-
return !
|
|
834
|
+
return !or(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
832
835
|
}
|
|
833
836
|
function st(e) {
|
|
834
|
-
return
|
|
837
|
+
return or(e) ? e.bottom_gobj : (mn("gobj NULL of bad type"), null);
|
|
835
838
|
}
|
|
836
839
|
function it(e, t) {
|
|
837
|
-
if (!
|
|
838
|
-
e.bottom_gobj &&
|
|
840
|
+
if (!or(e)) return mn("gobj NULL of bad type"), null;
|
|
841
|
+
e.bottom_gobj && t && hn(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
839
842
|
}
|
|
840
843
|
function _t(e, t, n) {
|
|
841
|
-
return
|
|
844
|
+
return or(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (mn("gobj NULL of bad type"), null);
|
|
842
845
|
}
|
|
843
846
|
function at(e, t, n, r, l) {
|
|
844
|
-
return ot(e) ? (
|
|
847
|
+
return ot(e) ? (mn("gobj NULL, destroying, or bad type"), 0) : ft(e.dl_children, t, n, r, l);
|
|
845
848
|
}
|
|
846
849
|
function ut(e, t, n, r, l) {
|
|
847
|
-
return ot(e) ? (
|
|
850
|
+
return ot(e) ? (mn("gobj NULL, destroying, or bad type"), 0) : dt(e.dl_children, t, n, r, l);
|
|
848
851
|
}
|
|
849
852
|
function ct(e) {
|
|
850
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
853
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || mn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
851
854
|
}
|
|
852
855
|
function ft(e, t, n, r, l) {
|
|
853
856
|
let o, s = [...e];
|
|
@@ -885,7 +888,7 @@ var gobjJs = function(e) {
|
|
|
885
888
|
return 0;
|
|
886
889
|
}
|
|
887
890
|
function bt(e, t) {
|
|
888
|
-
if (!
|
|
891
|
+
if (!or(e)) return mn("gobj NULL of bad type"), !1;
|
|
889
892
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
890
893
|
t.__disabled__;
|
|
891
894
|
let o = t.__state__;
|
|
@@ -901,7 +904,7 @@ var gobjJs = function(e) {
|
|
|
901
904
|
return !0;
|
|
902
905
|
}
|
|
903
906
|
function pt(e, t) {
|
|
904
|
-
if (ot(e)) return
|
|
907
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), null;
|
|
905
908
|
const n = e.dl_children;
|
|
906
909
|
for (let e = 0; e < n.length; e++) {
|
|
907
910
|
const r = n[e];
|
|
@@ -929,7 +932,7 @@ var gobjJs = function(e) {
|
|
|
929
932
|
return o ? (n.splice(0, 1), n = n.join("`"), mt(o, n)) : null;
|
|
930
933
|
}
|
|
931
934
|
function ht(e, t) {
|
|
932
|
-
return !
|
|
935
|
+
return !sr(t) && !!ge(e.gclass, t, !1);
|
|
933
936
|
}
|
|
934
937
|
function Et(e, t, n) {
|
|
935
938
|
let r = e.jn_attrs;
|
|
@@ -937,7 +940,7 @@ var gobjJs = function(e) {
|
|
|
937
940
|
let n = r[t];
|
|
938
941
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
939
942
|
}
|
|
940
|
-
return
|
|
943
|
+
return mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
941
944
|
}
|
|
942
945
|
function yt(e, t, n) {
|
|
943
946
|
let r = {}, l = e.gclass.attrs_table;
|
|
@@ -945,41 +948,41 @@ var gobjJs = function(e) {
|
|
|
945
948
|
const o = l[n];
|
|
946
949
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
947
950
|
let t;
|
|
948
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
951
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = Wn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Wn(e.jn_attrs, o.name))), Kn(r, o.name, t);
|
|
949
952
|
}
|
|
950
953
|
}
|
|
951
954
|
return r;
|
|
952
955
|
}
|
|
953
956
|
function Tt(e, t) {
|
|
954
957
|
if (t) {
|
|
955
|
-
if (0 ===
|
|
956
|
-
if (0 ===
|
|
957
|
-
if (0 ===
|
|
958
|
-
if (0 ===
|
|
958
|
+
if (0 === ar(t, "__disabled__")) return Ye(e);
|
|
959
|
+
if (0 === ar(t, "__running__")) return Ke(e);
|
|
960
|
+
if (0 === ar(t, "__playing__")) return Je(e);
|
|
961
|
+
if (0 === ar(t, "__service__")) return Be(e);
|
|
959
962
|
}
|
|
960
963
|
let n = fe(e, t, !1);
|
|
961
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
964
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Wn(n, t) : e.gclass.gmt.mt_reading(e, t) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
962
965
|
}
|
|
963
966
|
function vt(e, t) {
|
|
964
|
-
t &&
|
|
967
|
+
t && ar(t, "__trace_level__");
|
|
965
968
|
let n = fe(e, t, !1);
|
|
966
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
969
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Wn(n, t) : e.gclass.gmt.mt_reading(e, t) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
967
970
|
}
|
|
968
971
|
function jt(e, t) {
|
|
969
|
-
if (t && 0 ===
|
|
972
|
+
if (t && 0 === ar(t, "__state__")) return kt(e);
|
|
970
973
|
let n = fe(e, t, !1);
|
|
971
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
974
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Wn(n, t) : e.gclass.gmt.mt_reading(e, t) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
972
975
|
}
|
|
973
976
|
function Ot(e, t) {
|
|
974
977
|
let n = fe(e, t, !1);
|
|
975
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
978
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Wn(n, t) : e.gclass.gmt.mt_reading(e, t) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
976
979
|
}
|
|
977
980
|
function St(e, t, r, l) {
|
|
978
|
-
if (!
|
|
981
|
+
if (!er(t)) return mn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
979
982
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
980
983
|
if (i.length <= 1) {
|
|
981
984
|
let l = t;
|
|
982
|
-
return l in s && s.hasOwnProperty(l) ? (s[l] = r,
|
|
985
|
+
return l in s && s.hasOwnProperty(l) ? (s[l] = r, Xn(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (mn(n("gobj_write_attr(%s): attr not found '%s'", et(e), l)), -1);
|
|
983
986
|
}
|
|
984
987
|
let _ = i.length;
|
|
985
988
|
for (let t = 0; t < _; t++) {
|
|
@@ -990,10 +993,10 @@ var gobjJs = function(e) {
|
|
|
990
993
|
continue;
|
|
991
994
|
}
|
|
992
995
|
let l = e.jn_attrs;
|
|
993
|
-
if (o in l && l.hasOwnProperty(o)) return l[o] = r,
|
|
996
|
+
if (o in l && l.hasOwnProperty(o)) return l[o] = r, Xn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
994
997
|
break;
|
|
995
998
|
}
|
|
996
|
-
return
|
|
999
|
+
return mn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
997
1000
|
}
|
|
998
1001
|
function wt(e, t, n, r) {
|
|
999
1002
|
let l = ce(e), o = 0;
|
|
@@ -1005,32 +1008,32 @@ var gobjJs = function(e) {
|
|
|
1005
1008
|
}
|
|
1006
1009
|
function Nt(e, t, n) {
|
|
1007
1010
|
let r = fe(e, t, !1);
|
|
1008
|
-
return r ? (r[t] =
|
|
1011
|
+
return r ? (r[t] = ir(n), Xn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1009
1012
|
}
|
|
1010
1013
|
function Rt(e, t, n) {
|
|
1011
1014
|
let r = fe(e, t, !1);
|
|
1012
|
-
return r ? (r[t] = parseInt(n),
|
|
1015
|
+
return r ? (r[t] = parseInt(n), Xn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1013
1016
|
}
|
|
1014
1017
|
function Dt(e, t, n) {
|
|
1015
1018
|
let r = fe(e, t, !1);
|
|
1016
|
-
return r ? (r[t] = String(n),
|
|
1019
|
+
return r ? (r[t] = String(n), Xn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (mn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1017
1020
|
}
|
|
1018
1021
|
function $t(e, t) {
|
|
1019
|
-
if (ot(e)) return
|
|
1022
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), null;
|
|
1020
1023
|
if (e.current_state.state_name === t) return !1;
|
|
1021
1024
|
let r = pe(e.gclass, t);
|
|
1022
|
-
if (!r) return
|
|
1025
|
+
if (!r) return mn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1023
1026
|
e.last_state = e.current_state, e.current_state = r;
|
|
1024
|
-
let l =
|
|
1027
|
+
let l = H(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1025
1028
|
return x(e) & P.TRACE_STATES;
|
|
1026
1029
|
}(e);
|
|
1027
1030
|
return (l || o) && (1 === C || L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
1028
1031
|
}
|
|
1029
1032
|
function kt(e) {
|
|
1030
|
-
return
|
|
1033
|
+
return or(e) ? e.current_state.state_name : (mn("hgobj NULL"), "");
|
|
1031
1034
|
}
|
|
1032
1035
|
function At(e, t, n) {
|
|
1033
|
-
if (!
|
|
1036
|
+
if (!or(e)) return mn("gobj NULL of bad type"), null;
|
|
1034
1037
|
let r = ve(e.gclass, t);
|
|
1035
1038
|
if (r) return r;
|
|
1036
1039
|
if (n) {
|
|
@@ -1056,32 +1059,50 @@ var gobjJs = function(e) {
|
|
|
1056
1059
|
let e = Lt;
|
|
1057
1060
|
Lt = [];
|
|
1058
1061
|
let t = 0;
|
|
1059
|
-
for (let n
|
|
1062
|
+
for (let n = 0; n < e.length; n++) {
|
|
1063
|
+
const r = e[n];
|
|
1064
|
+
if (!(r.dst.obflag & (R.obflag_destroyed | R.obflag_destroying))) {
|
|
1065
|
+
try {
|
|
1066
|
+
Ft(r.dst, r.event, r.kw, r.src);
|
|
1067
|
+
} catch (t) {
|
|
1068
|
+
throw (Lt = e.slice(n + 1).concat(Lt)).length > 0 && !Pt && (Pt = !0, setTimeout(Ut, 0)), t;
|
|
1069
|
+
}
|
|
1070
|
+
t++;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1060
1073
|
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(Ut, 0)), t;
|
|
1061
1074
|
}
|
|
1062
1075
|
function Ft(e, t, r, l) {
|
|
1063
|
-
if (!(e && e instanceof S)) return
|
|
1064
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
1076
|
+
if (!(e && e instanceof S)) return mn("gobj dst NULL"), -1;
|
|
1077
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return mn("gobj dst DESTROYED"), -1;
|
|
1065
1078
|
let o = e.current_state;
|
|
1066
|
-
if (!o) return
|
|
1067
|
-
let s =
|
|
1079
|
+
if (!o) return mn(`${et(e)}: current_state NULL`), -1;
|
|
1080
|
+
let s = H(e, t) && !z(l, t);
|
|
1068
1081
|
h++;
|
|
1069
1082
|
let i = me(o, t);
|
|
1070
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r &&
|
|
1083
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) && Hn(r) && Pn(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && L(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), mn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1071
1084
|
if (s) {
|
|
1072
1085
|
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1073
1086
|
else {
|
|
1074
1087
|
let r = "";
|
|
1075
|
-
i.action && (r =
|
|
1088
|
+
i.action && (r = zr(i.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1076
1089
|
}
|
|
1077
|
-
r &&
|
|
1090
|
+
r && q(e) && Hn(r) && Pn(r);
|
|
1078
1091
|
}
|
|
1079
1092
|
i.next_state && $t(e, i.next_state);
|
|
1080
1093
|
let _ = -1;
|
|
1081
1094
|
try {
|
|
1082
1095
|
i.action && (_ = i.action(e, t, r, l));
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1096
|
+
} catch (n) {
|
|
1097
|
+
if (h--, !n || !n.__gobj_logged__) {
|
|
1098
|
+
mn(`${et(e)}: action of ${t} in ${e.current_state.state_name} THREW: ${n && n.stack ? n.stack : n}`);
|
|
1099
|
+
try {
|
|
1100
|
+
n.__gobj_logged__ = !0;
|
|
1101
|
+
} catch (e) {}
|
|
1102
|
+
}
|
|
1103
|
+
throw n;
|
|
1104
|
+
}
|
|
1105
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", tr(_) ? _ : 0)), h--, _;
|
|
1085
1106
|
}
|
|
1086
1107
|
var Vt = Object.freeze({
|
|
1087
1108
|
__rename_event_name__: 1,
|
|
@@ -1114,35 +1135,35 @@ var gobjJs = function(e) {
|
|
|
1114
1135
|
];
|
|
1115
1136
|
function Wt(e, t) {
|
|
1116
1137
|
let n = e ? e.__config__ : null;
|
|
1117
|
-
if (!
|
|
1138
|
+
if (!Xn(n) || !fr(n, "__hard_subscription__") && !fr(n, "__own_event__") && !fr(n, "__rename_event_name__")) return {
|
|
1118
1139
|
kw: e,
|
|
1119
1140
|
renamed_event: ""
|
|
1120
1141
|
};
|
|
1121
1142
|
let r = Object.assign({}, e), l = Object.assign({}, n);
|
|
1122
1143
|
r.__config__ = l;
|
|
1123
|
-
let o = "", s = l.__rename_event_name__, i = "string" != typeof s ||
|
|
1124
|
-
return i && (o = i.event_name, delete l.__rename_event_name__, t &&
|
|
1144
|
+
let o = "", s = l.__rename_event_name__, i = "string" != typeof s || sr(s) ? null : Gt(s);
|
|
1145
|
+
return i && (o = i.event_name, delete l.__rename_event_name__, t && Qn(r.__global__) > 0 && (r.__global__ = Object.assign({}, r.__global__, { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1125
1146
|
kw: r,
|
|
1126
1147
|
renamed_event: o
|
|
1127
1148
|
};
|
|
1128
1149
|
}
|
|
1129
1150
|
function xt(e, t, n, r, l, o) {
|
|
1130
|
-
let s =
|
|
1131
|
-
if (t && t !==
|
|
1132
|
-
let t =
|
|
1133
|
-
|
|
1151
|
+
let s = Tr(t, l, "__config__", null), i = Tr(t, l, "__global__", null), _ = Tr(t, l, "__local__", null), a = vr(t, l, "__filter__", null), u = !0;
|
|
1152
|
+
if (t && t !== yr(null, e, "publisher", null) && (u = !1), o && o !== yr(null, e, "subscriber", null) && (u = !1), n && n !== Er(null, e, "event", "") && (u = !1), r && r !== Er(null, e, "renamed_event", "") && (u = !1), Qn(s) > 0) {
|
|
1153
|
+
let t = Tr(null, e, "__config__", null);
|
|
1154
|
+
Qn(t) > 0 && Fn(t, s) || (u = !1);
|
|
1134
1155
|
}
|
|
1135
|
-
if (
|
|
1136
|
-
let t =
|
|
1137
|
-
|
|
1156
|
+
if (Qn(i) > 0) {
|
|
1157
|
+
let t = Tr(null, e, "__global__", null);
|
|
1158
|
+
Qn(t) > 0 && Fn(t, i) || (u = !1);
|
|
1138
1159
|
}
|
|
1139
|
-
if (
|
|
1140
|
-
let t =
|
|
1141
|
-
|
|
1160
|
+
if (Qn(_) > 0) {
|
|
1161
|
+
let t = Tr(null, e, "__local__", null);
|
|
1162
|
+
Qn(t) > 0 && Fn(t, _) || (u = !1);
|
|
1142
1163
|
}
|
|
1143
|
-
if (
|
|
1144
|
-
let t =
|
|
1145
|
-
|
|
1164
|
+
if (Qn(a) > 0) {
|
|
1165
|
+
let t = vr(null, e, "__filter__", null);
|
|
1166
|
+
Qn(t) > 0 && Fn(t, a) || (u = !1);
|
|
1146
1167
|
}
|
|
1147
1168
|
return u;
|
|
1148
1169
|
}
|
|
@@ -1150,7 +1171,7 @@ var gobjJs = function(e) {
|
|
|
1150
1171
|
let s = [];
|
|
1151
1172
|
for (let i = 0; i < e.length; i++) {
|
|
1152
1173
|
let _ = e[i];
|
|
1153
|
-
xt(_, t, n, r, l, o) &&
|
|
1174
|
+
xt(_, t, n, r, l, o) && Bn(s, _);
|
|
1154
1175
|
}
|
|
1155
1176
|
return s;
|
|
1156
1177
|
}
|
|
@@ -1158,17 +1179,17 @@ var gobjJs = function(e) {
|
|
|
1158
1179
|
return e.indexOf(t);
|
|
1159
1180
|
}
|
|
1160
1181
|
function Bt(e, t, r, l) {
|
|
1161
|
-
let o =
|
|
1162
|
-
if (!!(
|
|
1182
|
+
let o = yr(e, t, "publisher", null, Xt.KW_REQUIRED), s = yr(e, t, "subscriber", null, Xt.KW_REQUIRED), i = Er(e, t, "event", "", Xt.KW_REQUIRED);
|
|
1183
|
+
if (!!(hr(e, t, "subs_flag", null, Xt.KW_REQUIRED) & Vt.__hard_subscription__) && !r) return -1;
|
|
1163
1184
|
let _ = B(s) || B(o);
|
|
1164
1185
|
if (Yt(o.dl_subscriptions, t) < 0) return _ && L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", i || "", et(o), et(s))), 1;
|
|
1165
|
-
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))),
|
|
1186
|
+
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), Tn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1166
1187
|
let a = Yt(o.dl_subscriptions, t);
|
|
1167
|
-
return a >= 0 ?
|
|
1188
|
+
return a >= 0 ? qn(o.dl_subscriptions, a) : (mn(`${et(e)}: subscription in publisher not found`), Tn(t)), a = Yt(s.dl_subscribings, t), a >= 0 ? qn(s.dl_subscribings, a) : (mn(`${et(e)}: subscription in subscriber not found`), Tn(t)), 0;
|
|
1168
1189
|
}
|
|
1169
1190
|
function Jt(e, t, r, l) {
|
|
1170
|
-
if (null == r && (r = {}), !e) return
|
|
1171
|
-
if (!l) return
|
|
1191
|
+
if (null == r && (r = {}), !e) return mn(`publisher NULL: ev ${t}`), 0;
|
|
1192
|
+
if (!l) return mn(`subscriber NULL: ev ${t}`), 0;
|
|
1172
1193
|
const o = /* @__PURE__ */ new Set([
|
|
1173
1194
|
"__config__",
|
|
1174
1195
|
"__global__",
|
|
@@ -1177,72 +1198,72 @@ var gobjJs = function(e) {
|
|
|
1177
1198
|
"__service__"
|
|
1178
1199
|
]);
|
|
1179
1200
|
if (Object.keys(r).forEach((n) => {
|
|
1180
|
-
o.has(n) ||
|
|
1181
|
-
}),
|
|
1182
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
1201
|
+
o.has(n) || mn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1202
|
+
}), sr(t)) t = "";
|
|
1203
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return mn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1183
1204
|
let s = Wt(r, t), i = Kt(e.dl_subscriptions, e, t, s.renamed_event, s.kw, l), _ = null;
|
|
1184
|
-
for (let t = 0; t < i.length; t++) if (
|
|
1205
|
+
for (let t = 0; t < i.length; t++) if (hr(e, i[t], "subs_flag", 0, Xt.KW_REQUIRED) & Vt.__hard_subscription__) {
|
|
1185
1206
|
_ = i[t];
|
|
1186
1207
|
break;
|
|
1187
1208
|
}
|
|
1188
|
-
if (_) return
|
|
1189
|
-
zn(i) > 0 && (
|
|
1209
|
+
if (_) return hn(`${et(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${t}, subscriber: ${et(l)})`), _;
|
|
1210
|
+
zn(i) > 0 && (mn(`${et(e)}: ${zn(i)} subscription(s) REPEATED, will be deleted and override`), Tn(i, "subscription REPEATED"), qt(e, i, !1));
|
|
1190
1211
|
let a = function(e, t, n, r) {
|
|
1191
1212
|
let l = _e(e, Mt);
|
|
1192
|
-
|
|
1213
|
+
Yn(l, "event", t), Yn(l, "subscriber", r), Yn(l, "publisher", e);
|
|
1193
1214
|
let o = 0;
|
|
1194
1215
|
if (n) {
|
|
1195
|
-
let r =
|
|
1196
|
-
if (
|
|
1197
|
-
let n =
|
|
1198
|
-
|
|
1199
|
-
let s =
|
|
1200
|
-
if (!
|
|
1216
|
+
let r = Tr(e, n, "__config__", null), s = Tr(e, n, "__global__", null), i = Tr(e, n, "__local__", null), _ = vr(e, n, "__filter__", null), a = Er(e, n, "__service__", "");
|
|
1217
|
+
if (Qn(s) > 0 && Yn(l, "__global__", Un(s)), Qn(r) > 0) {
|
|
1218
|
+
let n = Un(r);
|
|
1219
|
+
Yn(l, "__config__", n);
|
|
1220
|
+
let s = Er(e, n, "__rename_event_name__", "");
|
|
1221
|
+
if (!sr(s)) {
|
|
1201
1222
|
let r = Gt(s);
|
|
1202
1223
|
if (r) {
|
|
1203
|
-
|
|
1204
|
-
let s =
|
|
1205
|
-
|
|
1206
|
-
} else
|
|
1224
|
+
Yn(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= Vt.__rename_event_name__;
|
|
1225
|
+
let s = Tr(e, l, "__global__", null);
|
|
1226
|
+
Xn(s) || (s = {}, Yn(l, "__global__", s)), s.__original_event_name__ = t;
|
|
1227
|
+
} else mn(`${et(e)}: EVENT NOT FOUND (__rename_event_name__: ${s})`);
|
|
1207
1228
|
}
|
|
1208
|
-
if (
|
|
1209
|
-
let t =
|
|
1210
|
-
|
|
1229
|
+
if (fr(n, "__hard_subscription__")) {
|
|
1230
|
+
let t = mr(e, n, "__hard_subscription__", !1);
|
|
1231
|
+
xn(n, "__hard_subscription__"), t && (o |= Vt.__hard_subscription__);
|
|
1211
1232
|
}
|
|
1212
|
-
if (
|
|
1213
|
-
let t =
|
|
1214
|
-
|
|
1233
|
+
if (fr(n, "__own_event__")) {
|
|
1234
|
+
let t = mr(e, n, "__own_event__", !1);
|
|
1235
|
+
xn(n, "__own_event__"), t && (o |= Vt.__own_event__);
|
|
1215
1236
|
}
|
|
1216
1237
|
}
|
|
1217
|
-
|
|
1238
|
+
Qn(i) > 0 && Yn(l, "__local__", Un(i)), Qn(_) > 0 && Yn(l, "__filter__", Un(_)), sr(a) || Yn(l, "__service__", a);
|
|
1218
1239
|
}
|
|
1219
|
-
return
|
|
1240
|
+
return Yn(l, "subs_flag", o), l;
|
|
1220
1241
|
}(e, t, r, l);
|
|
1221
|
-
if (!a) return
|
|
1222
|
-
if (
|
|
1242
|
+
if (!a) return mn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1243
|
+
if (Bn(e.dl_subscriptions, a), Bn(l.dl_subscribings, a), (B(l) || B(e)) && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (q(l) || q(e)) && Pn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1223
1244
|
let t = e.gclass.gmt.mt_subscription_added(e, a);
|
|
1224
1245
|
(t < 0 || !1 === t) && (Bt(e, a, !0, !0), a = 0);
|
|
1225
1246
|
}
|
|
1226
1247
|
return a;
|
|
1227
1248
|
}
|
|
1228
|
-
function
|
|
1249
|
+
function qt(e, t, n) {
|
|
1229
1250
|
let r = [...t], l = 0;
|
|
1230
1251
|
for (let t = 0; t < r.length; t++) Bt(e, r[t], n, !1) > 0 && l++;
|
|
1231
|
-
return l &&
|
|
1252
|
+
return l && hn(`${et(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1232
1253
|
}
|
|
1233
|
-
function
|
|
1254
|
+
function Ht(e, t, n, r) {
|
|
1234
1255
|
return null == n && (n = {}), Kt(e.dl_subscriptions, e, t, null, n, r);
|
|
1235
1256
|
}
|
|
1236
|
-
function
|
|
1257
|
+
function zt(e, t, n, r) {
|
|
1237
1258
|
return Kt(e.dl_subscribings, r, t, null, n, e);
|
|
1238
1259
|
}
|
|
1239
1260
|
function Qt(e, t, r) {
|
|
1240
|
-
if (
|
|
1241
|
-
if (
|
|
1261
|
+
if (Xn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return mn("gobj NULL or DESTROYED"), -1;
|
|
1262
|
+
if (sr(t)) return mn(`${et(e)}: event EMPTY`), -1;
|
|
1242
1263
|
let l = At(e, t, !0);
|
|
1243
|
-
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
1244
|
-
let o = (B(e) ||
|
|
1245
|
-
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")),
|
|
1264
|
+
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return mn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1265
|
+
let o = (B(e) || H(e, t)) && !z(e, t);
|
|
1266
|
+
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) && Hn(r) && Pn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1246
1267
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1247
1268
|
if (n <= 0) return n;
|
|
1248
1269
|
}
|
|
@@ -1254,20 +1275,20 @@ var gobjJs = function(e) {
|
|
|
1254
1275
|
if (n < 0) break;
|
|
1255
1276
|
if (!n) continue;
|
|
1256
1277
|
}
|
|
1257
|
-
let u =
|
|
1278
|
+
let u = yr(e, a, "subscriber", null, Xt.KW_REQUIRED);
|
|
1258
1279
|
if (!u || ot(u)) continue;
|
|
1259
|
-
let c =
|
|
1260
|
-
if (
|
|
1261
|
-
|
|
1262
|
-
let l =
|
|
1263
|
-
|
|
1280
|
+
let c = hr(e, a, "subs_flag", 0, Xt.KW_REQUIRED), f = Er(e, a, "event", "", Xt.KW_REQUIRED);
|
|
1281
|
+
if (sr(f) || 0 === ar(f, t)) {
|
|
1282
|
+
Tr(e, a, "__config__", null, 0);
|
|
1283
|
+
let l = Tr(e, a, "__global__", null, 0), s = Tr(e, a, "__local__", null, 0), f = vr(e, a, "__filter__", null, 0), g = a.renamed_event;
|
|
1284
|
+
sr(g) && (g = t);
|
|
1264
1285
|
let d = 1;
|
|
1265
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) :
|
|
1286
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) : Qn(f) > 0 && (d = wr(r, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), Tn(f))), d < 0) break;
|
|
1266
1287
|
if (!d) continue;
|
|
1267
1288
|
let b = At(u, t, !0);
|
|
1268
1289
|
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1269
1290
|
let p = r;
|
|
1270
|
-
(
|
|
1291
|
+
(Qn(s) > 0 || Qn(l) > 0) && (p = Object.assign({}, r)), Qn(s) > 0 && cr(p, s), Qn(l) > 0 && Vn(p, Un(l)), o && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", g || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", g || "", e && !e.running ? "!!" : "", et(e))), q(e) && Hn(p) && Pn(p));
|
|
1271
1292
|
let m = Ft(u, g, p, e);
|
|
1272
1293
|
if (m < 0 && c & Vt.__own_event__) {
|
|
1273
1294
|
i = -1;
|
|
@@ -1276,7 +1297,7 @@ var gobjJs = function(e) {
|
|
|
1276
1297
|
if (_ += m, i++, ot(e)) break;
|
|
1277
1298
|
}
|
|
1278
1299
|
}
|
|
1279
|
-
return i || l && l.event_flag & D.EVF_NO_WARN_SUBS ||
|
|
1300
|
+
return i || l && l.event_flag & D.EVF_NO_WARN_SUBS || hn(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1280
1301
|
}
|
|
1281
1302
|
var Xt = Object.freeze({
|
|
1282
1303
|
KW_REQUIRED: 1,
|
|
@@ -1340,9 +1361,17 @@ var gobjJs = function(e) {
|
|
|
1340
1361
|
e ? (en = e, tn = e) : (en = Zt.error, tn = Zt.warn);
|
|
1341
1362
|
}
|
|
1342
1363
|
function bn(e) {
|
|
1364
|
+
try {
|
|
1365
|
+
return JSON.stringify(e);
|
|
1366
|
+
} catch (t) {
|
|
1367
|
+
return String(e);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
function pn(e) {
|
|
1343
1371
|
const t = Array.prototype.slice.call(arguments);
|
|
1344
1372
|
let n = "";
|
|
1345
1373
|
if ("string" == typeof e) {
|
|
1374
|
+
if (1 === t.length) return e;
|
|
1346
1375
|
let r = 1;
|
|
1347
1376
|
n = e.replace(/%[sdifoO]/g, (e) => {
|
|
1348
1377
|
const n = t[r++];
|
|
@@ -1352,35 +1381,35 @@ var gobjJs = function(e) {
|
|
|
1352
1381
|
case "%i": return parseInt(n);
|
|
1353
1382
|
case "%f": return parseFloat(n);
|
|
1354
1383
|
case "%o":
|
|
1355
|
-
case "%O": return "object" == typeof n ?
|
|
1384
|
+
case "%O": return "object" == typeof n ? bn(n) : String(n);
|
|
1356
1385
|
default: return e;
|
|
1357
1386
|
}
|
|
1358
1387
|
});
|
|
1359
|
-
const l = t.slice(r).map((e) => "object" == typeof e ?
|
|
1388
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? bn(e) : String(e));
|
|
1360
1389
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1361
|
-
} else n = t.map((e) => "object" == typeof e ?
|
|
1390
|
+
} else n = t.map((e) => "object" == typeof e ? bn(e) : String(e)).join(" ");
|
|
1362
1391
|
return n;
|
|
1363
1392
|
}
|
|
1364
|
-
function
|
|
1365
|
-
let
|
|
1366
|
-
en && (en === Zt.error ? un("error",
|
|
1393
|
+
function mn(e, ...t) {
|
|
1394
|
+
let n = pn(e, ...t), r = Jr();
|
|
1395
|
+
en && (en === Zt.error ? un("error", n) && en("%c" + r + " ERROR: " + String(n), "color:red") : (un("error", n) && Zt.error("%c" + r + " ERROR: " + String(n), "color:red"), en(`${r} ERROR: ${String(n)}`))), fn("error", n, r);
|
|
1367
1396
|
}
|
|
1368
|
-
function
|
|
1369
|
-
let
|
|
1370
|
-
tn && (tn === Zt.warn ? un("warning",
|
|
1397
|
+
function hn(e, ...t) {
|
|
1398
|
+
let n = pn(e, ...t), r = Jr();
|
|
1399
|
+
tn && (tn === Zt.warn ? un("warning", n) && tn("%c" + r + " WARNING: " + String(n), "color:yellow") : (un("warning", n) && Zt.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), tn(`${r} WARNING: ${String(n)}`))), fn("warning", n, r);
|
|
1371
1400
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let
|
|
1374
|
-
rn && un("debug",
|
|
1401
|
+
function En(e, ...t) {
|
|
1402
|
+
let n = pn(e, ...t), r = Jr();
|
|
1403
|
+
rn && un("debug", n) && rn("%c" + r + " DEBUG: " + String(n), "color:silver"), fn("debug", n, r);
|
|
1375
1404
|
}
|
|
1376
|
-
function
|
|
1377
|
-
let
|
|
1378
|
-
rn && un("msg",
|
|
1405
|
+
function yn(e, ...t) {
|
|
1406
|
+
let n = pn(e, ...t), r = Jr();
|
|
1407
|
+
rn && un("msg", n) && rn("%c" + r + " MSG: " + String(n), "color:cyan"), fn("msg", n, r);
|
|
1379
1408
|
}
|
|
1380
|
-
function
|
|
1381
|
-
un("json", t) && (t && Zt.warn("=====> " + t), Zt.dir(e)), fn("json", e,
|
|
1409
|
+
function Tn(e, t) {
|
|
1410
|
+
un("json", t) && (t && Zt.warn("=====> " + t), Zt.dir(e)), fn("json", e, Jr());
|
|
1382
1411
|
}
|
|
1383
|
-
var
|
|
1412
|
+
var vn = [
|
|
1384
1413
|
"passw",
|
|
1385
1414
|
"pwd",
|
|
1386
1415
|
"passphrase",
|
|
@@ -1392,12 +1421,12 @@ var gobjJs = function(e) {
|
|
|
1392
1421
|
"cookie",
|
|
1393
1422
|
"credential",
|
|
1394
1423
|
"salt"
|
|
1395
|
-
],
|
|
1424
|
+
], jn = [
|
|
1396
1425
|
"apikey",
|
|
1397
1426
|
"sessionid",
|
|
1398
1427
|
"sessionkey",
|
|
1399
1428
|
"authdata"
|
|
1400
|
-
],
|
|
1429
|
+
], On = /* @__PURE__ */ new Set([
|
|
1401
1430
|
"endpoint",
|
|
1402
1431
|
"url",
|
|
1403
1432
|
"uri",
|
|
@@ -1421,25 +1450,25 @@ var gobjJs = function(e) {
|
|
|
1421
1450
|
"expires",
|
|
1422
1451
|
"mode"
|
|
1423
1452
|
]);
|
|
1424
|
-
function
|
|
1453
|
+
function Sn(e) {
|
|
1425
1454
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1426
1455
|
let t = e.toLowerCase(), n = !1;
|
|
1427
|
-
for (const e of
|
|
1456
|
+
for (const e of vn) if (t.indexOf(e) >= 0) {
|
|
1428
1457
|
n = !0;
|
|
1429
1458
|
break;
|
|
1430
1459
|
}
|
|
1431
1460
|
if (!n) {
|
|
1432
1461
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1433
|
-
for (const t of
|
|
1462
|
+
for (const t of jn) if (e.indexOf(t) >= 0) {
|
|
1434
1463
|
n = !0;
|
|
1435
1464
|
break;
|
|
1436
1465
|
}
|
|
1437
1466
|
}
|
|
1438
1467
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1439
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1468
|
+
for (const e of t.split(/[_\-. \t]/)) if (On.has(e)) return !1;
|
|
1440
1469
|
return !0;
|
|
1441
1470
|
}
|
|
1442
|
-
function
|
|
1471
|
+
function wn(e, t, n) {
|
|
1443
1472
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1444
1473
|
let o = t;
|
|
1445
1474
|
for (;;) {
|
|
@@ -1455,12 +1484,12 @@ var gobjJs = function(e) {
|
|
|
1455
1484
|
o = t;
|
|
1456
1485
|
}
|
|
1457
1486
|
}
|
|
1458
|
-
var
|
|
1459
|
-
function
|
|
1487
|
+
var Nn = 128, Rn = 4194304, Dn = "<not shown: too large to mask>";
|
|
1488
|
+
function $n(e) {
|
|
1460
1489
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1461
|
-
if (e.length >
|
|
1490
|
+
if (e.length > Rn) return Dn;
|
|
1462
1491
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1463
|
-
for (; null !== (t = r.exec(e));)
|
|
1492
|
+
for (; null !== (t = r.exec(e));) Sn(t[2].slice(-128)) && (n = !0);
|
|
1464
1493
|
let l = [], o = 0, s = !1, i = "", _ = 0, a = 0;
|
|
1465
1494
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1466
1495
|
for (; a < e.length;) {
|
|
@@ -1473,8 +1502,8 @@ var gobjJs = function(e) {
|
|
|
1473
1502
|
a++;
|
|
1474
1503
|
continue;
|
|
1475
1504
|
}
|
|
1476
|
-
let r = e.substring(Math.max(_, a -
|
|
1477
|
-
if (_ = a + 1, !(
|
|
1505
|
+
let r = e.substring(Math.max(_, a - Nn), a);
|
|
1506
|
+
if (_ = a + 1, !(Sn(r) || n && "value" === r.toLowerCase())) {
|
|
1478
1507
|
a++;
|
|
1479
1508
|
continue;
|
|
1480
1509
|
}
|
|
@@ -1483,18 +1512,18 @@ var gobjJs = function(e) {
|
|
|
1483
1512
|
if (f) {
|
|
1484
1513
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1485
1514
|
e[c] === f && c++;
|
|
1486
|
-
} else c =
|
|
1515
|
+
} else c = wn(e, a, i);
|
|
1487
1516
|
c > a && (l.push(e.substring(o, a)), l.push("********"), o = c, s = !0), a = c, _ = a;
|
|
1488
1517
|
}
|
|
1489
1518
|
return s ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1490
1519
|
}
|
|
1491
|
-
var
|
|
1492
|
-
var
|
|
1493
|
-
function
|
|
1520
|
+
var kn = 64, An = "<not shown: the masking failed>";
|
|
1521
|
+
var In = Symbol("mask-in-progress");
|
|
1522
|
+
function Cn(e, t, n, r) {
|
|
1494
1523
|
if ("string" == typeof e) {
|
|
1495
|
-
if (e.length > r.left) return r.left = 0,
|
|
1524
|
+
if (e.length > r.left) return r.left = 0, Dn;
|
|
1496
1525
|
r.left -= e.length;
|
|
1497
|
-
let t =
|
|
1526
|
+
let t = $n(e);
|
|
1498
1527
|
return null !== t ? t : e;
|
|
1499
1528
|
}
|
|
1500
1529
|
let l = Array.isArray(e);
|
|
@@ -1503,13 +1532,13 @@ var gobjJs = function(e) {
|
|
|
1503
1532
|
let t = Object.getPrototypeOf(e);
|
|
1504
1533
|
return t === Object.prototype || null === t;
|
|
1505
1534
|
}(e)) return e;
|
|
1506
|
-
if (r.left <= 0) return
|
|
1535
|
+
if (r.left <= 0) return Dn;
|
|
1507
1536
|
if (t.has(e)) {
|
|
1508
1537
|
let n = t.get(e);
|
|
1509
|
-
return n ===
|
|
1538
|
+
return n === In ? "<cycle>" : n;
|
|
1510
1539
|
}
|
|
1511
|
-
if (n >=
|
|
1512
|
-
r.left -= 1, t.set(e,
|
|
1540
|
+
if (n >= kn) return "<deeper not shown>";
|
|
1541
|
+
r.left -= 1, t.set(e, In);
|
|
1513
1542
|
let o, s = !1, i = !1;
|
|
1514
1543
|
if (l) {
|
|
1515
1544
|
o = [];
|
|
@@ -1519,13 +1548,13 @@ var gobjJs = function(e) {
|
|
|
1519
1548
|
break;
|
|
1520
1549
|
}
|
|
1521
1550
|
r.left -= 1;
|
|
1522
|
-
let _ =
|
|
1551
|
+
let _ = Cn(e[l], t, n + 1, r);
|
|
1523
1552
|
_ !== e[l] && (s = !0), o.push(_);
|
|
1524
1553
|
}
|
|
1525
|
-
i && o.push(
|
|
1554
|
+
i && o.push(Dn);
|
|
1526
1555
|
} else {
|
|
1527
1556
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1528
|
-
let l = "string" == typeof e.attribute &&
|
|
1557
|
+
let l = "string" == typeof e.attribute && Sn(e.attribute.slice(-128));
|
|
1529
1558
|
for (const _ in e) {
|
|
1530
1559
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1531
1560
|
if (r.left <= 0) {
|
|
@@ -1534,33 +1563,33 @@ var gobjJs = function(e) {
|
|
|
1534
1563
|
}
|
|
1535
1564
|
r.left -= 1 + _.length;
|
|
1536
1565
|
let a, u = e[_];
|
|
1537
|
-
a = (
|
|
1566
|
+
a = (Sn(_.slice(-128)) || l && "value" === _) && null != u && "" !== u ? "********" : Cn(u, t, n + 1, r), a !== u && (s = !0), o[_] = a;
|
|
1538
1567
|
}
|
|
1539
|
-
i && (o["<more>"] =
|
|
1568
|
+
i && (o["<more>"] = Dn);
|
|
1540
1569
|
}
|
|
1541
1570
|
return s || i || (o = e), t.set(e, o), o;
|
|
1542
1571
|
}
|
|
1543
|
-
function
|
|
1572
|
+
function Ln(e) {
|
|
1544
1573
|
try {
|
|
1545
|
-
return
|
|
1574
|
+
return Cn(e, /* @__PURE__ */ new WeakMap(), 0, { left: Rn });
|
|
1546
1575
|
} catch (e) {
|
|
1547
|
-
return
|
|
1576
|
+
return An;
|
|
1548
1577
|
}
|
|
1549
1578
|
}
|
|
1550
|
-
function
|
|
1551
|
-
|
|
1579
|
+
function Pn(e, t) {
|
|
1580
|
+
Tn(Ln(e), t);
|
|
1552
1581
|
}
|
|
1553
|
-
function
|
|
1582
|
+
function Un(e) {
|
|
1554
1583
|
return structuredClone(e);
|
|
1555
1584
|
}
|
|
1556
|
-
function
|
|
1585
|
+
function Fn(e, t) {
|
|
1557
1586
|
if (e === t) return !0;
|
|
1558
1587
|
if (null === e || null === t) return e === t;
|
|
1559
1588
|
if (typeof e != typeof t) return !1;
|
|
1560
1589
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1561
1590
|
if (Array.isArray(e)) {
|
|
1562
1591
|
if (e.length !== t.length) return !1;
|
|
1563
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1592
|
+
for (let n = 0; n < e.length; n++) if (!Fn(e[n], t[n])) return !1;
|
|
1564
1593
|
return !0;
|
|
1565
1594
|
}
|
|
1566
1595
|
if ("object" == typeof e) {
|
|
@@ -1568,275 +1597,286 @@ var gobjJs = function(e) {
|
|
|
1568
1597
|
if (n.length !== r.length) return !1;
|
|
1569
1598
|
for (let l = 0; l < n.length; l++) {
|
|
1570
1599
|
if (n[l] !== r[l]) return !1;
|
|
1571
|
-
if (!
|
|
1600
|
+
if (!Fn(e[n[l]], t[r[l]])) return !1;
|
|
1572
1601
|
}
|
|
1573
1602
|
return !0;
|
|
1574
1603
|
}
|
|
1575
1604
|
return e === t;
|
|
1576
1605
|
}
|
|
1577
|
-
function
|
|
1606
|
+
function Vn(e, t) {
|
|
1578
1607
|
if (!t) return e;
|
|
1579
1608
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1580
1609
|
return e;
|
|
1581
1610
|
}
|
|
1582
|
-
function
|
|
1611
|
+
function Gn(e, t) {
|
|
1583
1612
|
if (!t) return e;
|
|
1584
1613
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1585
1614
|
return e;
|
|
1586
1615
|
}
|
|
1587
|
-
function
|
|
1616
|
+
function Mn(e, t) {
|
|
1588
1617
|
if (!t) return e;
|
|
1589
1618
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1590
1619
|
return e;
|
|
1591
1620
|
}
|
|
1592
|
-
function
|
|
1621
|
+
function Wn(e, t) {
|
|
1593
1622
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1594
1623
|
}
|
|
1595
|
-
function
|
|
1624
|
+
function xn(e, t) {
|
|
1596
1625
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1597
1626
|
}
|
|
1598
|
-
function xn(e, t, n) {
|
|
1599
|
-
e[t] = n;
|
|
1600
|
-
}
|
|
1601
1627
|
function Kn(e, t, n) {
|
|
1602
1628
|
e[t] = n;
|
|
1603
1629
|
}
|
|
1604
|
-
function Yn(e, t) {
|
|
1605
|
-
e
|
|
1630
|
+
function Yn(e, t, n) {
|
|
1631
|
+
e[t] = n;
|
|
1606
1632
|
}
|
|
1607
1633
|
function Bn(e, t) {
|
|
1608
1634
|
e.push(t);
|
|
1609
1635
|
}
|
|
1610
1636
|
function Jn(e, t) {
|
|
1637
|
+
e.push(t);
|
|
1638
|
+
}
|
|
1639
|
+
function qn(e, t) {
|
|
1611
1640
|
e.splice(t, 1);
|
|
1612
1641
|
}
|
|
1613
1642
|
function Hn(e) {
|
|
1614
|
-
return
|
|
1643
|
+
return Xn(e) ? Object.keys(e).length : 0;
|
|
1615
1644
|
}
|
|
1616
1645
|
function zn(e) {
|
|
1617
|
-
return
|
|
1618
|
-
}
|
|
1619
|
-
function qn(e) {
|
|
1620
|
-
return Qn(e) ? Object.keys(e).length : Xn(e) ? e.length : Zn(e) && e.length > 0 ? 1 : 0;
|
|
1646
|
+
return Zn(e) ? e.length : 0;
|
|
1621
1647
|
}
|
|
1622
1648
|
function Qn(e) {
|
|
1623
|
-
return
|
|
1649
|
+
return Xn(e) ? Object.keys(e).length : Zn(e) ? e.length : er(e) && e.length > 0 ? 1 : 0;
|
|
1624
1650
|
}
|
|
1625
1651
|
function Xn(e) {
|
|
1626
|
-
return Array.isArray(e);
|
|
1652
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1627
1653
|
}
|
|
1628
1654
|
function Zn(e) {
|
|
1629
|
-
return
|
|
1655
|
+
return Array.isArray(e);
|
|
1630
1656
|
}
|
|
1631
1657
|
function er(e) {
|
|
1632
|
-
return "
|
|
1658
|
+
return "string" == typeof e;
|
|
1633
1659
|
}
|
|
1634
1660
|
function tr(e) {
|
|
1635
|
-
return "
|
|
1661
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1636
1662
|
}
|
|
1637
1663
|
function nr(e) {
|
|
1638
|
-
return
|
|
1664
|
+
return "boolean" == typeof e;
|
|
1639
1665
|
}
|
|
1640
1666
|
function rr(e) {
|
|
1641
|
-
return
|
|
1667
|
+
return null == e;
|
|
1642
1668
|
}
|
|
1643
1669
|
function lr(e) {
|
|
1644
|
-
return
|
|
1670
|
+
return "function" == typeof e;
|
|
1645
1671
|
}
|
|
1646
1672
|
function or(e) {
|
|
1647
|
-
return
|
|
1673
|
+
return e instanceof S;
|
|
1648
1674
|
}
|
|
1649
1675
|
function sr(e) {
|
|
1650
|
-
return er(e)
|
|
1676
|
+
return !er(e) || 0 === e.length;
|
|
1651
1677
|
}
|
|
1652
|
-
function ir(e
|
|
1653
|
-
return e
|
|
1678
|
+
function ir(e) {
|
|
1679
|
+
return tr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1654
1680
|
}
|
|
1655
1681
|
function _r(e, t) {
|
|
1682
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1683
|
+
}
|
|
1684
|
+
function ar(e, t) {
|
|
1656
1685
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1657
1686
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1658
1687
|
}
|
|
1659
|
-
function
|
|
1660
|
-
if (
|
|
1661
|
-
if (
|
|
1688
|
+
function ur(e, t) {
|
|
1689
|
+
if (Xn(e) || Xn(t) || Zn(e) || Zn(t)) return 0;
|
|
1690
|
+
if (tr(e) || tr(t)) {
|
|
1662
1691
|
let n = Number(e), r = Number(t);
|
|
1663
|
-
return n > r ? 1 : n < r ? -1 : 0;
|
|
1692
|
+
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1664
1693
|
}
|
|
1665
|
-
if (
|
|
1694
|
+
if (nr(e) || nr(t)) {
|
|
1666
1695
|
let n = Number(e), r = Number(t);
|
|
1667
1696
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1668
1697
|
}
|
|
1669
|
-
return
|
|
1698
|
+
return _r(String(e), String(t));
|
|
1670
1699
|
}
|
|
1671
|
-
function
|
|
1672
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1700
|
+
function cr(e, t) {
|
|
1701
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) cr(e, n);
|
|
1673
1702
|
else "string" == typeof t && delete e[t];
|
|
1674
1703
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1675
1704
|
}
|
|
1676
|
-
function
|
|
1705
|
+
function fr(e, t) {
|
|
1677
1706
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1678
1707
|
}
|
|
1679
|
-
function
|
|
1680
|
-
|
|
1708
|
+
function gr(e, t) {
|
|
1709
|
+
return ("__proto__" === t || "constructor" === t || "prototype" === t) && !Object.prototype.hasOwnProperty.call(e, t);
|
|
1710
|
+
}
|
|
1711
|
+
function dr(e, t, n) {
|
|
1712
|
+
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1713
|
+
value: n,
|
|
1714
|
+
writable: !0,
|
|
1715
|
+
enumerable: !0,
|
|
1716
|
+
configurable: !0
|
|
1717
|
+
}) : e[t] = n;
|
|
1718
|
+
}
|
|
1719
|
+
function br(e, t, n, r) {
|
|
1720
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1681
1721
|
const l = e ? `${et(e)}: ` : "";
|
|
1682
|
-
if (!
|
|
1683
|
-
if (!
|
|
1722
|
+
if (!Xn(t) && !Zn(t)) return void mn(`${l}kw must be list or dict: '${String(n)}'`);
|
|
1723
|
+
if (!er(n)) return void mn(`${l}path must be a string: ${String(n)}`);
|
|
1684
1724
|
let o = n.split("`"), s = o.length;
|
|
1685
|
-
for (let e = 0; e < s
|
|
1686
|
-
if (
|
|
1687
|
-
if (
|
|
1725
|
+
for (let e = 0; e < s; e++) {
|
|
1726
|
+
if (gr(t, o[e])) return void (r && mn(`${l}path not found: '${n}'`));
|
|
1727
|
+
if (e === s - 1) break;
|
|
1728
|
+
if (null == (t = t[o[e]])) return void (r && mn(`${l}path not found: '${n}'`));
|
|
1729
|
+
if (!Xn(t) && !Zn(t)) return void mn(`${l}kw must be list or dict: '${n}'`);
|
|
1688
1730
|
}
|
|
1689
1731
|
let i = t[o[s - 1]];
|
|
1690
|
-
return void 0 === i && r &&
|
|
1732
|
+
return void 0 === i && r && mn(`${l}path not found: '${n}'`), i;
|
|
1691
1733
|
}
|
|
1692
|
-
function
|
|
1693
|
-
e && !
|
|
1734
|
+
function pr(e, t, n) {
|
|
1735
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1694
1736
|
let [r, l] = function(e, t) {
|
|
1695
1737
|
let n = e.lastIndexOf(t);
|
|
1696
1738
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1697
1739
|
}(n, "`");
|
|
1698
|
-
return
|
|
1740
|
+
return sr(l) ? xn(t, n) : xn(br(e, t, r, !0), l), 0;
|
|
1699
1741
|
}
|
|
1700
|
-
function
|
|
1701
|
-
e && !
|
|
1702
|
-
let o =
|
|
1742
|
+
function mr(e, t, n, r, l) {
|
|
1743
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1744
|
+
let o = br(e, t, n, !1);
|
|
1703
1745
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT, a = l && l & Xt.KW_WILD_NUMBER;
|
|
1704
1746
|
if (void 0 === o) {
|
|
1705
1747
|
if (i && t) {
|
|
1706
1748
|
let l = Boolean(r);
|
|
1707
|
-
return
|
|
1749
|
+
return jr(e, t, n, l), l;
|
|
1708
1750
|
}
|
|
1709
|
-
return s && (
|
|
1751
|
+
return s && (mn(`path not found: '${n}'`), Pn(t)), Boolean(r);
|
|
1710
1752
|
}
|
|
1711
1753
|
let u;
|
|
1712
|
-
if (
|
|
1713
|
-
else if (a &&
|
|
1714
|
-
else if (a &&
|
|
1754
|
+
if (nr(o)) u = o;
|
|
1755
|
+
else if (a && tr(o)) u = 0 !== o;
|
|
1756
|
+
else if (a && er(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
1715
1757
|
else {
|
|
1716
|
-
if (!a || null !== o) return a ? (
|
|
1758
|
+
if (!a || null !== o) return a ? (mn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Pn(t), !1) : (mn(`${e ? et(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), Pn(t), Boolean(r));
|
|
1717
1759
|
u = !1;
|
|
1718
1760
|
}
|
|
1719
|
-
return _ &&
|
|
1761
|
+
return _ && pr(e, t, n), u;
|
|
1720
1762
|
}
|
|
1721
|
-
function
|
|
1722
|
-
e && !
|
|
1723
|
-
let o =
|
|
1763
|
+
function hr(e, t, n, r, l) {
|
|
1764
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1765
|
+
let o = br(e, t, n, !1);
|
|
1724
1766
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT, a = l && l & Xt.KW_WILD_NUMBER;
|
|
1725
1767
|
if (void 0 === o) {
|
|
1726
1768
|
if (i && t) {
|
|
1727
1769
|
let l = parseInt(r);
|
|
1728
|
-
return
|
|
1770
|
+
return jr(e, t, n, l), l;
|
|
1729
1771
|
}
|
|
1730
|
-
return s && (
|
|
1772
|
+
return s && (mn(`path not found: '${n}'`), Pn(t)), parseInt(r);
|
|
1731
1773
|
}
|
|
1732
1774
|
let u;
|
|
1733
|
-
if (
|
|
1775
|
+
if (tr(o)) u = Math.trunc(o);
|
|
1734
1776
|
else {
|
|
1735
|
-
if (!a) return
|
|
1736
|
-
if (
|
|
1737
|
-
else if (
|
|
1777
|
+
if (!a) return mn(`${e ? et(e) + ": " : ""}path MUST BE a json integer: '${n}'`), Pn(t), parseInt(r);
|
|
1778
|
+
if (nr(o)) u = o ? 1 : 0;
|
|
1779
|
+
else if (er(o)) u = function(e) {
|
|
1738
1780
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1739
1781
|
if (!t) return 0;
|
|
1740
1782
|
let n, r = t[2];
|
|
1741
1783
|
return n = r.length > 1 && ("x" === r[1] || "X" === r[1]) ? parseInt(r.substring(2), 16) : "0" === r[0] ? parseInt(r, 8) : parseInt(r, 10), "-" === t[1] ? -n : n;
|
|
1742
1784
|
}(o);
|
|
1743
1785
|
else {
|
|
1744
|
-
if (null !== o) return
|
|
1786
|
+
if (null !== o) return mn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Pn(t), 0;
|
|
1745
1787
|
u = 0;
|
|
1746
1788
|
}
|
|
1747
1789
|
}
|
|
1748
|
-
return _ &&
|
|
1790
|
+
return _ && pr(e, t, n), u;
|
|
1749
1791
|
}
|
|
1750
|
-
function
|
|
1751
|
-
e && !
|
|
1752
|
-
let o =
|
|
1792
|
+
function Er(e, t, n, r, l) {
|
|
1793
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1794
|
+
let o = br(e, t, n, !1);
|
|
1753
1795
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
1754
|
-
return void 0 === o ? i && t ? (
|
|
1755
|
-
let n =
|
|
1796
|
+
return void 0 === o ? i && t ? (jr(e, t, n, er(r) ? r : null), r) : (s && !function(e, t) {
|
|
1797
|
+
let n = er(t) ? t.split("`") : [], r = e;
|
|
1756
1798
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1757
|
-
if (!
|
|
1799
|
+
if (!Xn(r) && !Zn(r)) return !1;
|
|
1758
1800
|
r = r[n[e]];
|
|
1759
1801
|
}
|
|
1760
|
-
return !(!
|
|
1761
|
-
}(t, n) && (
|
|
1802
|
+
return !(!Xn(r) && !Zn(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
1803
|
+
}(t, n) && (mn(`path not found: '${n}'`), Pn(t)), r) : er(o) ? (_ && pr(e, t, n), o) : (null !== o && (mn(`${e ? et(e) + ": " : ""}path MUST BE a json str: '${n}'`), Pn(t)), r);
|
|
1762
1804
|
}
|
|
1763
|
-
function
|
|
1764
|
-
e && !
|
|
1765
|
-
let o =
|
|
1805
|
+
function yr(e, t, n, r, l) {
|
|
1806
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1807
|
+
let o = br(e, t, n, !1);
|
|
1766
1808
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
1767
1809
|
if (void 0 === o) {
|
|
1768
1810
|
if (i) {
|
|
1769
1811
|
let l = r;
|
|
1770
|
-
return
|
|
1812
|
+
return jr(e, t, n, l), l;
|
|
1771
1813
|
}
|
|
1772
|
-
return s && (
|
|
1814
|
+
return s && (mn(`path not found: '${n}'`), Pn(t)), r;
|
|
1773
1815
|
}
|
|
1774
|
-
return _ &&
|
|
1816
|
+
return _ && pr(e, t, n), o;
|
|
1775
1817
|
}
|
|
1776
|
-
function
|
|
1777
|
-
e && !
|
|
1778
|
-
let o =
|
|
1818
|
+
function Tr(e, t, n, r, l) {
|
|
1819
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1820
|
+
let o = br(e, t, n, !1);
|
|
1779
1821
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
1780
|
-
return void 0 === o ? i &&
|
|
1822
|
+
return void 0 === o ? i && Xn(r) && t ? (jr(e, t, n, r), r) : (s && (mn(`path not found: '${n}'`), Pn(t)), r) : Xn(o) ? (_ && pr(e, t, n), o) : (s && (mn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'`), Pn(t)), r);
|
|
1781
1823
|
}
|
|
1782
|
-
function
|
|
1783
|
-
e && !
|
|
1784
|
-
let o =
|
|
1824
|
+
function vr(e, t, n, r, l) {
|
|
1825
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1826
|
+
let o = br(e, t, n, !1);
|
|
1785
1827
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
1786
1828
|
if (void 0 === o) {
|
|
1787
1829
|
if (i) {
|
|
1788
1830
|
let l = r;
|
|
1789
|
-
return
|
|
1831
|
+
return jr(e, t, n, l), l;
|
|
1790
1832
|
}
|
|
1791
|
-
return s && (
|
|
1833
|
+
return s && (mn(`path not found: '${n}'`), Pn(t)), r;
|
|
1792
1834
|
}
|
|
1793
|
-
return _ &&
|
|
1835
|
+
return _ && pr(e, t, n), o;
|
|
1794
1836
|
}
|
|
1795
|
-
function
|
|
1796
|
-
if (e && !
|
|
1797
|
-
let l = n.split("`");
|
|
1798
|
-
if (l.length <= 1) return t[n] = r, 0;
|
|
1799
|
-
let o = l.length;
|
|
1837
|
+
function jr(e, t, n, r) {
|
|
1838
|
+
if (e && !or(e) && mn("GObj bad instanceof"), !Xn(t)) return mn("kw is not an object"), -1;
|
|
1839
|
+
let l = n.split("`"), o = l.length;
|
|
1800
1840
|
for (let s = 0; s < o; s++) {
|
|
1801
1841
|
let i = l[s];
|
|
1802
|
-
if (s === o - 1) t
|
|
1842
|
+
if (s === o - 1) dr(t, i, r);
|
|
1803
1843
|
else {
|
|
1804
|
-
let r = t[i];
|
|
1805
|
-
if (void 0 === r) t
|
|
1806
|
-
else if (!
|
|
1844
|
+
let r = gr(t, i) ? void 0 : t[i];
|
|
1845
|
+
if (void 0 === r) dr(t, i, {});
|
|
1846
|
+
else if (!Xn(r) && !Zn(r)) return mn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not a dict or a list: '${n}'`), -1;
|
|
1807
1847
|
t = t[i];
|
|
1808
1848
|
}
|
|
1809
1849
|
}
|
|
1810
1850
|
return 0;
|
|
1811
1851
|
}
|
|
1812
|
-
function
|
|
1813
|
-
if (e && !
|
|
1814
|
-
let o =
|
|
1815
|
-
return
|
|
1852
|
+
function Or(e, t, n, r, l) {
|
|
1853
|
+
if (e && !or(e) && mn("GObj bad instanceof"), !Xn(t)) return mn("kw is not an object"), -1;
|
|
1854
|
+
let o = Tr(e, t, n, {}, Xt.KW_CREATE);
|
|
1855
|
+
return Xn(o) ? (o[r] = l, 0) : (mn("subdict is not an object"), -1);
|
|
1816
1856
|
}
|
|
1817
|
-
function
|
|
1857
|
+
function Sr(e, t, r) {
|
|
1818
1858
|
let l = "", o = !1;
|
|
1819
|
-
if (
|
|
1859
|
+
if (Zn(t)) {
|
|
1820
1860
|
o = !1;
|
|
1821
1861
|
for (let s = 0; s < t.length; s++) {
|
|
1822
1862
|
let i = t[s];
|
|
1823
|
-
if (l =
|
|
1863
|
+
if (l = sr(r) ? n("%s", r) : n("%s`%d", r, s), o = Sr(e, i, l), o) break;
|
|
1824
1864
|
}
|
|
1825
|
-
} else if (
|
|
1865
|
+
} else if (Xn(t)) {
|
|
1826
1866
|
o = !0;
|
|
1827
1867
|
let s = Object.keys(t);
|
|
1828
1868
|
for (let i = 0; i < s.length; i++) {
|
|
1829
1869
|
let _ = s[i], a = t[_];
|
|
1830
|
-
if (l =
|
|
1831
|
-
if (o =
|
|
1870
|
+
if (l = sr(r) ? n("%s", _) : n("%s`%s", r, _), Zn(a) || Xn(a)) {
|
|
1871
|
+
if (o = Sr(e, a, l), !o) break;
|
|
1832
1872
|
continue;
|
|
1833
1873
|
}
|
|
1834
|
-
let u =
|
|
1835
|
-
if (u
|
|
1874
|
+
let u = vr(0, e, l, void 0, 0);
|
|
1875
|
+
if (void 0 === u && (u = Wn(e, l)), void 0 === u) {
|
|
1836
1876
|
o = !1;
|
|
1837
1877
|
break;
|
|
1838
1878
|
}
|
|
1839
|
-
if (0 !==
|
|
1879
|
+
if (0 !== ur(u, a)) {
|
|
1840
1880
|
o = !1;
|
|
1841
1881
|
break;
|
|
1842
1882
|
}
|
|
@@ -1844,58 +1884,59 @@ var gobjJs = function(e) {
|
|
|
1844
1884
|
}
|
|
1845
1885
|
return o;
|
|
1846
1886
|
}
|
|
1847
|
-
function
|
|
1848
|
-
return 0 ===
|
|
1887
|
+
function wr(e, t) {
|
|
1888
|
+
return 0 === Qn(t) || Sr(e, t, "");
|
|
1849
1889
|
}
|
|
1850
|
-
function
|
|
1851
|
-
e && !
|
|
1890
|
+
function Nr(e, t, n, r) {
|
|
1891
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
1852
1892
|
let l = {};
|
|
1853
|
-
if (
|
|
1893
|
+
if (er(n) && !sr(n)) {
|
|
1854
1894
|
let o = n;
|
|
1855
|
-
t.hasOwnProperty(o) ? l[o] = t[o] : r &&
|
|
1856
|
-
} else if (
|
|
1895
|
+
t.hasOwnProperty(o) ? l[o] = t[o] : r && mn(`${et(e)}: key not found: ${o}`);
|
|
1896
|
+
} else if (Xn(n) && Hn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && mn(`${et(e)}: key not found: ${o}`);
|
|
1857
1897
|
else {
|
|
1858
|
-
if (!(
|
|
1898
|
+
if (!(Zn(n) && zn(n) > 0)) return t;
|
|
1859
1899
|
for (let o = 0; o < n.length; o++) {
|
|
1860
1900
|
let s = n[o];
|
|
1861
|
-
t.hasOwnProperty(s) ? l[s] = t[s] : r &&
|
|
1901
|
+
t.hasOwnProperty(s) ? l[s] = t[s] : r && mn(`${et(e)}: key not found: ${s}`);
|
|
1862
1902
|
}
|
|
1863
1903
|
}
|
|
1864
1904
|
return l;
|
|
1865
1905
|
}
|
|
1866
|
-
function
|
|
1906
|
+
function Rr(e, t, n, r) {
|
|
1867
1907
|
let l = {};
|
|
1868
|
-
if (
|
|
1908
|
+
if (!Xn(t)) return l;
|
|
1909
|
+
if (Vn(l, t), er(n) && !sr(n)) {
|
|
1869
1910
|
let o = n;
|
|
1870
|
-
|
|
1871
|
-
} else if (
|
|
1911
|
+
t.hasOwnProperty(o) ? xn(l, o) : r && mn(`${et(e)}: key not found: ${o}`);
|
|
1912
|
+
} else if (Xn(n) && Hn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? xn(l, o) : r && mn(`${et(e)}: key not found: ${o}`);
|
|
1872
1913
|
else {
|
|
1873
|
-
if (!(
|
|
1914
|
+
if (!(Zn(n) && zn(n) > 0)) return {};
|
|
1874
1915
|
for (let o = 0; o < n.length; o++) {
|
|
1875
1916
|
let s = n[o];
|
|
1876
|
-
t.hasOwnProperty(s) ?
|
|
1917
|
+
t.hasOwnProperty(s) ? xn(l, s) : r && mn(`${et(e)}: key not found: ${s}`);
|
|
1877
1918
|
}
|
|
1878
1919
|
}
|
|
1879
1920
|
return l;
|
|
1880
1921
|
}
|
|
1881
|
-
function
|
|
1922
|
+
function Dr(e, t, n = !1) {
|
|
1882
1923
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1883
1924
|
let r = window.localStorage.getItem(e);
|
|
1884
|
-
return null === r ? (n &&
|
|
1925
|
+
return null === r ? (n && $r(e, t), t) : JSON.parse(r);
|
|
1885
1926
|
} catch (n) {
|
|
1886
1927
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1887
1928
|
}
|
|
1888
1929
|
}
|
|
1889
|
-
function
|
|
1930
|
+
function $r(e, t) {
|
|
1890
1931
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1891
|
-
if (!e || void 0 === t) return
|
|
1932
|
+
if (!e || void 0 === t) return mn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1892
1933
|
try {
|
|
1893
1934
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1894
1935
|
} catch (t) {
|
|
1895
|
-
return
|
|
1936
|
+
return mn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1896
1937
|
}
|
|
1897
1938
|
}
|
|
1898
|
-
function
|
|
1939
|
+
function kr(e) {
|
|
1899
1940
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1900
1941
|
window.localStorage.removeItem(e);
|
|
1901
1942
|
} catch (t) {
|
|
@@ -1903,46 +1944,46 @@ var gobjJs = function(e) {
|
|
|
1903
1944
|
}
|
|
1904
1945
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1905
1946
|
}
|
|
1906
|
-
function
|
|
1907
|
-
if (
|
|
1908
|
-
if (
|
|
1947
|
+
function Ar(e, t) {
|
|
1948
|
+
if (rr(e) || rr(t)) return !0;
|
|
1949
|
+
if (Zn(e)) {
|
|
1909
1950
|
if (0 === e.length) return !0;
|
|
1910
1951
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1911
|
-
} else if (
|
|
1952
|
+
} else if (Xn(e)) {
|
|
1912
1953
|
if (0 === Object.keys(e).length) return !0;
|
|
1913
1954
|
for (let n in e) if (n === t) return !0;
|
|
1914
|
-
} else if (
|
|
1955
|
+
} else if (er(e) && e === t) return !0;
|
|
1915
1956
|
return !1;
|
|
1916
1957
|
}
|
|
1917
|
-
function
|
|
1918
|
-
if (e && !
|
|
1919
|
-
l || (l =
|
|
1958
|
+
function Ir(e, t, n, r, l) {
|
|
1959
|
+
if (e && !or(e) && mn("GObj bad instanceof"), !t) return null;
|
|
1960
|
+
l || (l = wr);
|
|
1920
1961
|
let o = [];
|
|
1921
|
-
if (
|
|
1962
|
+
if (Zn(t)) for (let s = 0; s < t.length; s++) {
|
|
1922
1963
|
let i, _ = t[s];
|
|
1923
|
-
if (
|
|
1964
|
+
if (Xn(_)) i = Er(e, _, "id", "", 0);
|
|
1924
1965
|
else {
|
|
1925
|
-
if (!
|
|
1966
|
+
if (!er(_)) continue;
|
|
1926
1967
|
i = _;
|
|
1927
1968
|
}
|
|
1928
|
-
|
|
1969
|
+
Ar(n, i) && l(_, r) && o.push(_);
|
|
1929
1970
|
}
|
|
1930
1971
|
else {
|
|
1931
|
-
if (!
|
|
1972
|
+
if (!Xn(t)) return mn("kw_collect() BAD kw parameter"), null;
|
|
1932
1973
|
for (let e of Object.keys(t)) {
|
|
1933
1974
|
let s = t[e];
|
|
1934
|
-
|
|
1975
|
+
Ar(n, e) && l(s, r) && o.push(s);
|
|
1935
1976
|
}
|
|
1936
1977
|
}
|
|
1937
1978
|
return o;
|
|
1938
1979
|
}
|
|
1939
|
-
function
|
|
1980
|
+
function Cr(e, t) {
|
|
1940
1981
|
if (!e) return -1;
|
|
1941
1982
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1942
1983
|
return -1;
|
|
1943
1984
|
}
|
|
1944
|
-
function
|
|
1945
|
-
if (!e || !t) return
|
|
1985
|
+
function Lr(e, t, n) {
|
|
1986
|
+
if (!e || !t) return mn("ERROR: str_in_list() list or str empty"), !1;
|
|
1946
1987
|
let r = e.length;
|
|
1947
1988
|
if (n) {
|
|
1948
1989
|
t = t.toLowerCase();
|
|
@@ -1953,7 +1994,7 @@ var gobjJs = function(e) {
|
|
|
1953
1994
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1954
1995
|
return !1;
|
|
1955
1996
|
}
|
|
1956
|
-
function
|
|
1997
|
+
function Pr(e, t) {
|
|
1957
1998
|
try {
|
|
1958
1999
|
let n = e.__md_iev__;
|
|
1959
2000
|
if (n) return n[t];
|
|
@@ -1961,35 +2002,35 @@ var gobjJs = function(e) {
|
|
|
1961
2002
|
return;
|
|
1962
2003
|
}
|
|
1963
2004
|
}
|
|
1964
|
-
function
|
|
2005
|
+
function Ur(e, t, n) {
|
|
1965
2006
|
let r = e.__md_iev__;
|
|
1966
2007
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1967
2008
|
}
|
|
1968
|
-
function
|
|
1969
|
-
if (!
|
|
2009
|
+
function Fr(e, t, n, r) {
|
|
2010
|
+
if (!or(e)) return mn("gobj is not a GObj"), null;
|
|
1970
2011
|
if (!t) return;
|
|
1971
|
-
let l =
|
|
1972
|
-
l || (l = [],
|
|
2012
|
+
let l = Pr(t, n);
|
|
2013
|
+
l || (l = [], Ur(t, n, l));
|
|
1973
2014
|
try {
|
|
1974
|
-
|
|
2015
|
+
Zn(l) && l.unshift(r);
|
|
1975
2016
|
} catch (e) {
|
|
1976
|
-
|
|
2017
|
+
mn(e);
|
|
1977
2018
|
}
|
|
1978
2019
|
}
|
|
1979
|
-
function
|
|
1980
|
-
if (!
|
|
1981
|
-
if (!
|
|
1982
|
-
let l =
|
|
1983
|
-
return l ? 0 === l.length ? (r &&
|
|
2020
|
+
function Vr(e, t, n, r) {
|
|
2021
|
+
if (!or(e)) return mn("gobj is not a GObj"), null;
|
|
2022
|
+
if (!Xn(t)) return mn("kw is not a dict"), null;
|
|
2023
|
+
let l = Pr(t, n);
|
|
2024
|
+
return l ? 0 === l.length ? (r && mn(`stack empty: ${n}`), null) : l[0] : (r && mn(`stack NOT FOUND: ${n}`), null);
|
|
1984
2025
|
}
|
|
1985
|
-
function
|
|
1986
|
-
return
|
|
2026
|
+
function Gr(e, t, n) {
|
|
2027
|
+
return sr(n) ? pr(e, t, "__md_iev__`__msg_type__") : Or(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1987
2028
|
}
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
2029
|
+
function Mr(e, t) {
|
|
2030
|
+
return Er(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1990
2031
|
}
|
|
1991
|
-
function
|
|
1992
|
-
void 0 !== n &&
|
|
2032
|
+
function Wr(e, t, n) {
|
|
2033
|
+
void 0 !== n && er(n) || (n = "");
|
|
1993
2034
|
for (let r of Object.keys(e)) {
|
|
1994
2035
|
if (!e.hasOwnProperty(r)) continue;
|
|
1995
2036
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -1998,10 +2039,10 @@ var gobjJs = function(e) {
|
|
|
1998
2039
|
r,
|
|
1999
2040
|
e[r],
|
|
2000
2041
|
n
|
|
2001
|
-
]),
|
|
2042
|
+
]), Xn(e[r]) && Wr(e[r], t, n), n = n.slice(0, -l.length);
|
|
2002
2043
|
}
|
|
2003
2044
|
}
|
|
2004
|
-
function
|
|
2045
|
+
function xr(e, t, n, r) {
|
|
2005
2046
|
if (!e) return null;
|
|
2006
2047
|
let l, o = e.length;
|
|
2007
2048
|
for (l = 0; l < o; l++) {
|
|
@@ -2009,15 +2050,15 @@ var gobjJs = function(e) {
|
|
|
2009
2050
|
if (o) {
|
|
2010
2051
|
let e = o.id;
|
|
2011
2052
|
if (e && e === n) return o;
|
|
2012
|
-
if (r &&
|
|
2013
|
-
let e =
|
|
2053
|
+
if (r && fr(o, t)) {
|
|
2054
|
+
let e = xr(o[t], t, n, r);
|
|
2014
2055
|
if (e) return e;
|
|
2015
2056
|
}
|
|
2016
2057
|
}
|
|
2017
2058
|
}
|
|
2018
2059
|
return null;
|
|
2019
2060
|
}
|
|
2020
|
-
function
|
|
2061
|
+
function Kr(e) {
|
|
2021
2062
|
function t(e) {
|
|
2022
2063
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2023
2064
|
switch (t.length % 4) {
|
|
@@ -2048,36 +2089,36 @@ var gobjJs = function(e) {
|
|
|
2048
2089
|
signature: t(n[2])
|
|
2049
2090
|
};
|
|
2050
2091
|
}
|
|
2051
|
-
function
|
|
2092
|
+
function Yr(e) {
|
|
2052
2093
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2053
2094
|
}
|
|
2054
|
-
function
|
|
2095
|
+
function Br(e) {
|
|
2055
2096
|
const t = document.createElement("template");
|
|
2056
2097
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2057
2098
|
}
|
|
2058
|
-
function
|
|
2099
|
+
function Jr(e) {
|
|
2059
2100
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2060
2101
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2061
2102
|
}
|
|
2062
|
-
function
|
|
2103
|
+
function qr(e, t) {
|
|
2063
2104
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2064
2105
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2065
2106
|
return -1;
|
|
2066
2107
|
}
|
|
2067
|
-
function
|
|
2108
|
+
function Hr() {
|
|
2068
2109
|
let e = "";
|
|
2069
2110
|
return "undefined" != typeof window && window.localStorage ? (e = window.localStorage.getItem("host_uuid"), !e && window.crypto?.randomUUID && (e = window.crypto.randomUUID(), window.localStorage.setItem("host_uuid", e))) : e = "undefined" != typeof globalThis && globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : "00000000-0000-0000-0000-000000000000", e;
|
|
2070
2111
|
}
|
|
2071
|
-
function
|
|
2112
|
+
function zr(e) {
|
|
2072
2113
|
let t = null;
|
|
2073
2114
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2074
2115
|
}
|
|
2075
|
-
var
|
|
2076
|
-
function
|
|
2116
|
+
var Qr = 256, Xr = 1e5;
|
|
2117
|
+
function Zr(e) {
|
|
2077
2118
|
const t = String(e).replace(/`/g, "``");
|
|
2078
2119
|
return "[" === t[0] ? "[" + t : t;
|
|
2079
2120
|
}
|
|
2080
|
-
function
|
|
2121
|
+
function el(e) {
|
|
2081
2122
|
if ("string" != typeof e) return null;
|
|
2082
2123
|
let t = [], n = "";
|
|
2083
2124
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2098,17 +2139,17 @@ var gobjJs = function(e) {
|
|
|
2098
2139
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2099
2140
|
});
|
|
2100
2141
|
}
|
|
2101
|
-
function
|
|
2142
|
+
function tl(e, t) {
|
|
2102
2143
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2103
2144
|
}
|
|
2104
|
-
function
|
|
2145
|
+
function nl(e) {
|
|
2105
2146
|
return "persistent-attrs-" + et(e);
|
|
2106
2147
|
}
|
|
2107
|
-
function
|
|
2108
|
-
if (
|
|
2148
|
+
function rl(e, t) {
|
|
2149
|
+
if (er(t)) {
|
|
2109
2150
|
if (-1 === t.indexOf("^")) {
|
|
2110
2151
|
let n, r, l = e.fkey;
|
|
2111
|
-
if (1 !== Hn(l)) return
|
|
2152
|
+
if (1 !== Hn(l)) return mn("bad fkey 1"), mn(e), mn(t), null;
|
|
2112
2153
|
for (const e of Object.keys(l)) {
|
|
2113
2154
|
n = e, r = l[e];
|
|
2114
2155
|
break;
|
|
@@ -2121,20 +2162,20 @@ var gobjJs = function(e) {
|
|
|
2121
2162
|
}
|
|
2122
2163
|
{
|
|
2123
2164
|
let n = t.split("^");
|
|
2124
|
-
return 3 !== n.length ? (
|
|
2165
|
+
return 3 !== n.length ? (mn("bad fkey 2"), mn(e), mn(t), null) : {
|
|
2125
2166
|
topic_name: n[0],
|
|
2126
2167
|
id: n[1],
|
|
2127
2168
|
hook_name: n[2]
|
|
2128
2169
|
};
|
|
2129
2170
|
}
|
|
2130
2171
|
}
|
|
2131
|
-
return
|
|
2172
|
+
return Xn(t) ? {
|
|
2132
2173
|
topic_name: t.topic_name,
|
|
2133
2174
|
id: t.id,
|
|
2134
2175
|
hook_name: t.hook_name
|
|
2135
|
-
} : (
|
|
2176
|
+
} : (mn("bad fkey 3"), mn(e), mn(t), null);
|
|
2136
2177
|
}
|
|
2137
|
-
var
|
|
2178
|
+
var ll = [
|
|
2138
2179
|
"string",
|
|
2139
2180
|
"integer",
|
|
2140
2181
|
"object",
|
|
@@ -2144,7 +2185,7 @@ var gobjJs = function(e) {
|
|
|
2144
2185
|
"real",
|
|
2145
2186
|
"boolean",
|
|
2146
2187
|
"blob"
|
|
2147
|
-
],
|
|
2188
|
+
], ol = [
|
|
2148
2189
|
"persistent",
|
|
2149
2190
|
"required",
|
|
2150
2191
|
"notnull",
|
|
@@ -2156,7 +2197,7 @@ var gobjJs = function(e) {
|
|
|
2156
2197
|
"stats",
|
|
2157
2198
|
"rstats",
|
|
2158
2199
|
"pstats"
|
|
2159
|
-
],
|
|
2200
|
+
], sl = [
|
|
2160
2201
|
"hook",
|
|
2161
2202
|
"fkey",
|
|
2162
2203
|
"enum",
|
|
@@ -2185,7 +2226,7 @@ var gobjJs = function(e) {
|
|
|
2185
2226
|
"coordinates",
|
|
2186
2227
|
"gbuffer"
|
|
2187
2228
|
];
|
|
2188
|
-
function
|
|
2229
|
+
function il(e) {
|
|
2189
2230
|
let t = {
|
|
2190
2231
|
name: e.id,
|
|
2191
2232
|
header: e.header,
|
|
@@ -2204,7 +2245,7 @@ var gobjJs = function(e) {
|
|
|
2204
2245
|
if (!e.flag) return t;
|
|
2205
2246
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2206
2247
|
let r = e.flag[n];
|
|
2207
|
-
if (
|
|
2248
|
+
if (Lr(sl, r)) {
|
|
2208
2249
|
switch (r) {
|
|
2209
2250
|
case "enum":
|
|
2210
2251
|
t.enum_list = e.enum;
|
|
@@ -2218,7 +2259,7 @@ var gobjJs = function(e) {
|
|
|
2218
2259
|
case "file": t.is_file = !0;
|
|
2219
2260
|
}
|
|
2220
2261
|
t.type = r;
|
|
2221
|
-
} else if (
|
|
2262
|
+
} else if (Lr(ol, r)) switch (r) {
|
|
2222
2263
|
case "writable":
|
|
2223
2264
|
t.is_writable = !0;
|
|
2224
2265
|
break;
|
|
@@ -2231,23 +2272,23 @@ var gobjJs = function(e) {
|
|
|
2231
2272
|
}
|
|
2232
2273
|
return t.is_file && (t.type = "file"), t;
|
|
2233
2274
|
}
|
|
2234
|
-
var
|
|
2275
|
+
var _l = [
|
|
2235
2276
|
j(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2236
2277
|
j(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2237
2278
|
j(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2238
2279
|
v()
|
|
2239
|
-
],
|
|
2280
|
+
], al = {
|
|
2240
2281
|
periodic: !1,
|
|
2241
2282
|
msec: 0,
|
|
2242
2283
|
timer_id: -1
|
|
2243
|
-
},
|
|
2244
|
-
function
|
|
2284
|
+
}, ul = null;
|
|
2285
|
+
function cl(e, t, n, r) {
|
|
2245
2286
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2246
2287
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2247
2288
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
2248
2289
|
}, l.msec) : l.timer_id = -1, lt(e) ? Ft(nt(e), o, {}, e) : Qt(e, o, {}), l.periodic || -1 !== l.timer_id || Ke(e) && Ve(e), 0;
|
|
2249
2290
|
}
|
|
2250
|
-
var
|
|
2291
|
+
var fl = {
|
|
2251
2292
|
mt_create: function(e) {
|
|
2252
2293
|
let t = e.priv;
|
|
2253
2294
|
const n = Ot(e, "subscriber");
|
|
@@ -2272,16 +2313,16 @@ var gobjJs = function(e) {
|
|
|
2272
2313
|
},
|
|
2273
2314
|
mt_destroy: function(e) {}
|
|
2274
2315
|
};
|
|
2275
|
-
function
|
|
2276
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2316
|
+
function gl(e, t) {
|
|
2317
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (mn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (mn("not GObj TYPE"), -1);
|
|
2277
2318
|
}
|
|
2278
|
-
function
|
|
2279
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2319
|
+
function dl(e, t) {
|
|
2320
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (mn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void Rt(e, "msec", t)) : (mn("not GObj TYPE"), -1);
|
|
2280
2321
|
}
|
|
2281
|
-
function
|
|
2282
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2322
|
+
function bl(e) {
|
|
2323
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (mn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (mn("not GObj TYPE"), -1);
|
|
2283
2324
|
}
|
|
2284
|
-
var
|
|
2325
|
+
var pl = [
|
|
2285
2326
|
j(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2286
2327
|
j(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2287
2328
|
j(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2301,71 +2342,72 @@ var gobjJs = function(e) {
|
|
|
2301
2342
|
j(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2302
2343
|
j(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2303
2344
|
v()
|
|
2304
|
-
],
|
|
2305
|
-
function
|
|
2345
|
+
], ml = { gobj_timer: null }, hl = null;
|
|
2346
|
+
function El(e, t, n, r) {
|
|
2306
2347
|
let l = Et(e, t);
|
|
2307
|
-
return
|
|
2348
|
+
return Xn(l) || (l = {}), l[n] = r, St(e, t, l), $e(e, t);
|
|
2308
2349
|
}
|
|
2309
|
-
function
|
|
2350
|
+
function yl(e) {
|
|
2310
2351
|
if (!0 === e || !1 === e) return e;
|
|
2311
2352
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2312
2353
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2313
2354
|
}
|
|
2314
|
-
function
|
|
2315
|
-
return `${
|
|
2355
|
+
function Tl() {
|
|
2356
|
+
return `${ze()}^${He()}`;
|
|
2316
2357
|
}
|
|
2317
|
-
function
|
|
2358
|
+
function vl(e, t, n, r) {
|
|
2318
2359
|
return Qt(e, t, n), 0;
|
|
2319
2360
|
}
|
|
2320
|
-
var
|
|
2361
|
+
var jl = {
|
|
2321
2362
|
mt_create: function(e) {
|
|
2322
2363
|
let t = e.priv;
|
|
2323
|
-
Dt(e, "start_date",
|
|
2364
|
+
Dt(e, "start_date", Jr()), Dt(e, "node_uuid", Hr()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = Et(e, "periodic_timeout"), function(e) {
|
|
2324
2365
|
let t = Et(e, "trace_levels");
|
|
2325
|
-
if (!
|
|
2366
|
+
if (!Xn(t)) return 0;
|
|
2326
2367
|
let n = t.__global_trace__;
|
|
2327
|
-
if (
|
|
2368
|
+
if (Zn(n)) {
|
|
2328
2369
|
Z(4294967295, !1);
|
|
2329
2370
|
for (let e of n) Q(e, !0);
|
|
2330
2371
|
}
|
|
2331
2372
|
for (const [n, r] of Object.entries(t)) {
|
|
2332
2373
|
let t = Oe(n);
|
|
2333
|
-
if (t) if (
|
|
2374
|
+
if (t) if (Zn(r)) {
|
|
2334
2375
|
se(t, null, !1);
|
|
2335
2376
|
for (let e of r) se(t, e, !0);
|
|
2336
|
-
} else
|
|
2377
|
+
} else mn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2337
2378
|
}
|
|
2338
2379
|
}(e), function(e) {
|
|
2339
2380
|
let t = Et(e, "no_trace_levels");
|
|
2340
|
-
if (!
|
|
2381
|
+
if (!Xn(t)) return 0;
|
|
2341
2382
|
let n = t.__global_no_trace__;
|
|
2342
|
-
if (
|
|
2383
|
+
if (Zn(n)) {
|
|
2343
2384
|
ee(4294967295, !1);
|
|
2344
2385
|
for (let e of n) X(e, !0);
|
|
2345
2386
|
}
|
|
2346
2387
|
for (const [n, r] of Object.entries(t)) {
|
|
2347
2388
|
let t = Oe(n);
|
|
2348
|
-
if (t) if (
|
|
2389
|
+
if (t) if (Zn(r)) {
|
|
2349
2390
|
ie(t, null, !1);
|
|
2350
2391
|
for (let e of r) ie(t, e, !0);
|
|
2351
|
-
} else
|
|
2392
|
+
} else mn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2352
2393
|
}
|
|
2353
2394
|
}(e);
|
|
2354
2395
|
},
|
|
2355
2396
|
mt_writing: function(e, t) {},
|
|
2356
2397
|
mt_start: function(e) {
|
|
2357
|
-
return
|
|
2398
|
+
return dl(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2358
2399
|
},
|
|
2359
2400
|
mt_stop: function(e) {
|
|
2360
|
-
return
|
|
2401
|
+
return bl(e.priv.gobj_timer), Me(e), 0;
|
|
2361
2402
|
},
|
|
2362
2403
|
mt_destroy: function(e) {},
|
|
2363
2404
|
mt_play: function(e) {
|
|
2364
2405
|
let t = Se();
|
|
2365
|
-
return Ke(t) || Pe(t), Je(t) || We(t), 0;
|
|
2406
|
+
return t ? (Ke(t) || Pe(t), Je(t) || We(t), 0) : 0;
|
|
2366
2407
|
},
|
|
2367
2408
|
mt_pause: function(e) {
|
|
2368
|
-
|
|
2409
|
+
let t = Se();
|
|
2410
|
+
return t && Je(t) && xe(t), 0;
|
|
2369
2411
|
},
|
|
2370
2412
|
mt_command_parser: function(e, t, n, r) {
|
|
2371
2413
|
switch (n = n || {}, t) {
|
|
@@ -2373,24 +2415,24 @@ var gobjJs = function(e) {
|
|
|
2373
2415
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2374
2416
|
case "set-global-trace":
|
|
2375
2417
|
case "set-global-no-trace": {
|
|
2376
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2377
|
-
return o ? null === s ? l(0, -1, `${
|
|
2418
|
+
let r = "set-global-no-trace" === t, o = n.level, s = yl(n.set);
|
|
2419
|
+
return o ? null === s ? l(0, -1, `${Tl()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${Tl()}: global trace level not found: ${o}`, null, null) : r ? (El(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (El(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${Tl()}: what level?`, null, null);
|
|
2378
2420
|
}
|
|
2379
2421
|
case "get-gclass-trace":
|
|
2380
2422
|
case "get-gclass-no-trace":
|
|
2381
2423
|
case "set-gclass-trace":
|
|
2382
2424
|
case "set-gclass-no-trace": {
|
|
2383
2425
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Oe(o);
|
|
2384
|
-
if (!s) return l(0, -1, `${
|
|
2426
|
+
if (!s) return l(0, -1, `${Tl()}: what gclass is '${o}'?`, null, null);
|
|
2385
2427
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2386
|
-
let i = n.level, _ =
|
|
2387
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2428
|
+
let i = n.level, _ = yl(n.set);
|
|
2429
|
+
return i ? null === _ ? l(0, -1, `${Tl()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${Tl()}: trace level of ${o} not found: ${i}`, null, null) : r ? (El(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (El(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${Tl()}: what level?`, null, null);
|
|
2388
2430
|
}
|
|
2389
|
-
default: return l(0, -1, `${
|
|
2431
|
+
default: return l(0, -1, `${Tl()}: command not available: ${t}`, null, null);
|
|
2390
2432
|
}
|
|
2391
2433
|
}
|
|
2392
2434
|
};
|
|
2393
|
-
var
|
|
2435
|
+
var Ol = "ievent_gate_stack", Sl = [
|
|
2394
2436
|
j(E.DTP_STRING, "wanted_yuno_role", y.SDF_RD, "", "wanted yuno role"),
|
|
2395
2437
|
j(E.DTP_STRING, "wanted_yuno_name", y.SDF_RD, "", "wanted yuno name"),
|
|
2396
2438
|
j(E.DTP_STRING, "wanted_yuno_service", y.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2407,15 +2449,15 @@ var gobjJs = function(e) {
|
|
|
2407
2449
|
j(E.DTP_INTEGER, "timeout_idack", y.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2408
2450
|
j(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2409
2451
|
v()
|
|
2410
|
-
],
|
|
2452
|
+
], wl = [
|
|
2411
2453
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2412
2454
|
["ievents2", "Trace inter-events with full kw"],
|
|
2413
2455
|
["identity-card", "Trace identity_card messages"]
|
|
2414
2456
|
];
|
|
2415
|
-
function
|
|
2457
|
+
function Nl(e) {
|
|
2416
2458
|
return !!(3 & x(e));
|
|
2417
2459
|
}
|
|
2418
|
-
var
|
|
2460
|
+
var Rl = {
|
|
2419
2461
|
url: null,
|
|
2420
2462
|
remote_yuno_name: null,
|
|
2421
2463
|
remote_yuno_role: null,
|
|
@@ -2425,91 +2467,99 @@ var gobjJs = function(e) {
|
|
|
2425
2467
|
websocket: null,
|
|
2426
2468
|
inside_on_open: !1,
|
|
2427
2469
|
retry_ms: 0
|
|
2428
|
-
},
|
|
2429
|
-
function
|
|
2430
|
-
e.priv.websocket &&
|
|
2470
|
+
}, Dl = null;
|
|
2471
|
+
function $l(e) {
|
|
2472
|
+
e.priv.websocket && mn("Websocket ALREADY setup");
|
|
2431
2473
|
const t = jt(e, "url");
|
|
2432
2474
|
let n;
|
|
2433
|
-
|
|
2475
|
+
En(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2434
2476
|
try {
|
|
2435
2477
|
n = new WebSocket(t);
|
|
2436
2478
|
} catch (n) {
|
|
2437
|
-
return
|
|
2479
|
+
return mn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2438
2480
|
}
|
|
2439
|
-
|
|
2440
|
-
|
|
2481
|
+
if (!n) return mn(`${et(e)}: Failed to initialize WebSocket.`), null;
|
|
2482
|
+
const r = ++e.priv.ws_seq;
|
|
2483
|
+
return n.onopen = () => {
|
|
2484
|
+
r !== e.priv.ws_seq || ot(e) || Ft(e, "EV_ON_OPEN", {
|
|
2485
|
+
url: t,
|
|
2486
|
+
ws_seq: r
|
|
2487
|
+
}, e);
|
|
2441
2488
|
}, n.onmessage = (n) => {
|
|
2442
|
-
Ft(e, "EV_ON_MESSAGE", {
|
|
2489
|
+
r !== e.priv.ws_seq || ot(e) || Ft(e, "EV_ON_MESSAGE", {
|
|
2443
2490
|
url: t,
|
|
2444
2491
|
data: n.data
|
|
2445
2492
|
}, e);
|
|
2446
2493
|
}, n.onclose = (n) => {
|
|
2447
|
-
ot(e) || (Tt(
|
|
2494
|
+
ot(e) || r === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ? hn("Close websocket by unload page") : Ft(e, "EV_ON_CLOSE", {
|
|
2448
2495
|
url: t,
|
|
2449
|
-
|
|
2496
|
+
ws_seq: r,
|
|
2497
|
+
code: n.code,
|
|
2498
|
+
reason: n.reason,
|
|
2499
|
+
was_clean: n.wasClean
|
|
2450
2500
|
}, e));
|
|
2451
|
-
}, n
|
|
2501
|
+
}, n;
|
|
2452
2502
|
}
|
|
2453
|
-
function
|
|
2503
|
+
function kl(e, t = 1e3, n = "") {
|
|
2454
2504
|
let r = e.priv, l = r.websocket;
|
|
2455
2505
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2456
|
-
|
|
2506
|
+
En(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2457
2507
|
try {
|
|
2458
2508
|
l.close(t, n);
|
|
2459
|
-
} catch (
|
|
2460
|
-
|
|
2509
|
+
} catch (t) {
|
|
2510
|
+
mn(`${et(e)}: Error closing WebSocket: ${t.message}`);
|
|
2461
2511
|
}
|
|
2462
|
-
} else
|
|
2512
|
+
} else hn("WebSocket is already closed or in the process of closing.");
|
|
2463
2513
|
}
|
|
2464
|
-
function
|
|
2465
|
-
let r =
|
|
2514
|
+
function Al(e, t, n) {
|
|
2515
|
+
let r = Jr();
|
|
2466
2516
|
try {
|
|
2467
|
-
|
|
2517
|
+
En("\n" + r + " " + t + "\n"), Pn(n);
|
|
2468
2518
|
} catch (e) {
|
|
2469
|
-
|
|
2519
|
+
En("ERROR in trace_inter_event: " + e);
|
|
2470
2520
|
}
|
|
2471
2521
|
}
|
|
2472
|
-
var
|
|
2522
|
+
var Il = class {
|
|
2473
2523
|
constructor(e, t) {
|
|
2474
2524
|
this.event = e, this.kw = t || {};
|
|
2475
2525
|
}
|
|
2476
2526
|
};
|
|
2477
|
-
function
|
|
2527
|
+
function Cl(e, t, n, r) {
|
|
2478
2528
|
return function(e, t) {
|
|
2479
2529
|
let n = e.priv, r = JSON.stringify(t);
|
|
2480
|
-
if (
|
|
2481
|
-
let n = jt(e, "url"), l = Xe(
|
|
2482
|
-
o ? o(l, t, 1, r.length) :
|
|
2530
|
+
if (Nl(e)) {
|
|
2531
|
+
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o = Et(qe(), "trace_ievent_callback");
|
|
2532
|
+
o ? o(l, t, 1, r.length) : Al(0, l, t);
|
|
2483
2533
|
}
|
|
2484
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2534
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return hn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2485
2535
|
try {
|
|
2486
2536
|
n.websocket.send(r);
|
|
2487
2537
|
} catch (t) {
|
|
2488
|
-
|
|
2538
|
+
mn(`${et(e)}: send_iev(): ${t}`);
|
|
2489
2539
|
}
|
|
2490
2540
|
return 0;
|
|
2491
2541
|
}(e, function(e, t) {
|
|
2492
|
-
return
|
|
2542
|
+
return sr(e) ? (mn("iev_create() event NULL"), null) : new Il(e, t);
|
|
2493
2543
|
}(t, n));
|
|
2494
2544
|
}
|
|
2495
|
-
function
|
|
2496
|
-
return
|
|
2545
|
+
function Ll(e, t, n) {
|
|
2546
|
+
return sr(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2497
2547
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2498
2548
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
2499
2549
|
dst_service: n,
|
|
2500
|
-
src_yuno:
|
|
2501
|
-
src_role:
|
|
2550
|
+
src_yuno: He(),
|
|
2551
|
+
src_role: ze(),
|
|
2502
2552
|
src_service: t,
|
|
2503
|
-
host:
|
|
2553
|
+
host: Hr()
|
|
2504
2554
|
};
|
|
2505
2555
|
}
|
|
2506
|
-
function
|
|
2507
|
-
let t = e.priv, n = Je(
|
|
2508
|
-
i && i.length || (i = Et(
|
|
2556
|
+
function Pl(e) {
|
|
2557
|
+
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i = Et(e, "required_services");
|
|
2558
|
+
i && i.length || (i = Et(qe(), "required_services"));
|
|
2509
2559
|
let _ = {
|
|
2510
|
-
yuno_role:
|
|
2560
|
+
yuno_role: ze(),
|
|
2511
2561
|
yuno_id: Qe(),
|
|
2512
|
-
yuno_name:
|
|
2562
|
+
yuno_name: He(),
|
|
2513
2563
|
yuno_tag: o,
|
|
2514
2564
|
yuno_version: r,
|
|
2515
2565
|
yuno_release: l,
|
|
@@ -2518,45 +2568,45 @@ var gobjJs = function(e) {
|
|
|
2518
2568
|
pid: 0,
|
|
2519
2569
|
watcher_pid: 0,
|
|
2520
2570
|
jwt: jt(e, "jwt"),
|
|
2521
|
-
username: jt(
|
|
2571
|
+
username: jt(qe(), "__username__"),
|
|
2522
2572
|
launch_id: 0,
|
|
2523
|
-
yuno_startdate: jt(
|
|
2524
|
-
id:
|
|
2573
|
+
yuno_startdate: jt(qe(), "start_date"),
|
|
2574
|
+
id: Hr(),
|
|
2525
2575
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2526
2576
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2527
2577
|
required_services: i
|
|
2528
2578
|
};
|
|
2529
|
-
return
|
|
2579
|
+
return Fr(e, _, Ol, Ll(e, Xe(nt(e)), null)), Gr(e, _, "__identity__"), gl(t.gobj_timer, vt(e, "timeout_idack")), Cl(e, "EV_IDENTITY_CARD", _);
|
|
2530
2580
|
}
|
|
2531
|
-
function
|
|
2532
|
-
if (
|
|
2581
|
+
function Ul(e, t) {
|
|
2582
|
+
if (sr(t.event)) return -1;
|
|
2533
2583
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2534
2584
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2535
|
-
return
|
|
2585
|
+
return Fr(e, n, Ol, Ll(e, Xe(i), s)), Gr(e, n, "__subscribing__"), Cl(e, t.event, n);
|
|
2536
2586
|
}
|
|
2537
|
-
function
|
|
2587
|
+
function Fl(e, t, n, r) {
|
|
2538
2588
|
let l = e.priv;
|
|
2539
|
-
return Ke(e) && (l.websocket =
|
|
2589
|
+
return Ke(e) && (l.websocket = $l(e)), 0;
|
|
2540
2590
|
}
|
|
2541
|
-
function
|
|
2542
|
-
return
|
|
2591
|
+
function Vl(e, t, n, r) {
|
|
2592
|
+
return En("Websocket opened: " + e.priv.url), Pl(e), 0;
|
|
2543
2593
|
}
|
|
2544
|
-
function
|
|
2545
|
-
let l = e.priv, o = n.
|
|
2546
|
-
return dn(),
|
|
2547
|
-
url:
|
|
2594
|
+
function Gl(e, t, n, r) {
|
|
2595
|
+
let l = e.priv, o = n.url;
|
|
2596
|
+
return dn(), hn(`${et(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Qt(e, "EV_ON_CLOSE", {
|
|
2597
|
+
url: o,
|
|
2548
2598
|
remote_yuno_name: l.remote_yuno_name,
|
|
2549
2599
|
remote_yuno_role: l.remote_yuno_role,
|
|
2550
2600
|
remote_yuno_service: l.remote_yuno_service
|
|
2551
|
-
})) : (
|
|
2552
|
-
url:
|
|
2601
|
+
})) : (hn(`${et(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Qt(e, "EV_ON_OPEN_ERROR", {
|
|
2602
|
+
url: o,
|
|
2553
2603
|
remote_yuno_name: l.remote_yuno_name,
|
|
2554
2604
|
remote_yuno_role: l.remote_yuno_role,
|
|
2555
2605
|
remote_yuno_service: l.remote_yuno_service,
|
|
2556
|
-
code:
|
|
2557
|
-
reason:
|
|
2558
|
-
was_clean:
|
|
2559
|
-
})), Ke(e) &&
|
|
2606
|
+
code: n.code,
|
|
2607
|
+
reason: n.reason,
|
|
2608
|
+
was_clean: n.was_clean
|
|
2609
|
+
})), Ke(e) && gl(l.gobj_timer, function(e) {
|
|
2560
2610
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2561
2611
|
r < n && (r = n);
|
|
2562
2612
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -2564,17 +2614,17 @@ var gobjJs = function(e) {
|
|
|
2564
2614
|
return Math.max(1, Math.round(o));
|
|
2565
2615
|
}(e)), 0;
|
|
2566
2616
|
}
|
|
2567
|
-
function
|
|
2568
|
-
return
|
|
2617
|
+
function Ml(e, t, n, r) {
|
|
2618
|
+
return Pl(e), 0;
|
|
2569
2619
|
}
|
|
2570
|
-
function
|
|
2620
|
+
function Wl(e, t, n, r) {
|
|
2571
2621
|
let l = e.priv;
|
|
2572
|
-
|
|
2573
|
-
let o =
|
|
2622
|
+
bl(l.gobj_timer);
|
|
2623
|
+
let o = Vr(e, n, Ol, !0), s = Er(e, o, "src_yuno", ""), i = Er(e, o, "src_role", ""), _ = Er(e, o, "src_service", "");
|
|
2574
2624
|
Dt(e, "remote_yuno_name", s), Dt(e, "remote_yuno_role", i), Dt(e, "remote_yuno_service", _);
|
|
2575
|
-
let a =
|
|
2625
|
+
let a = hr(e, n, "result", -1, 0), u = Er(e, n, "comment", "", 0), c = Er(e, n, "username", "", 0), f = vr(e, n, "services_roles", {});
|
|
2576
2626
|
if (a < 0) {
|
|
2577
|
-
|
|
2627
|
+
kl(e);
|
|
2578
2628
|
let t = {
|
|
2579
2629
|
url: jt(e, "url"),
|
|
2580
2630
|
result: a,
|
|
@@ -2598,64 +2648,65 @@ var gobjJs = function(e) {
|
|
|
2598
2648
|
lt(e) ? Ft(nt(e), "EV_ON_OPEN", t, e) : Qt(e, "EV_ON_OPEN", t);
|
|
2599
2649
|
}
|
|
2600
2650
|
l.inside_on_open = !1, function(e) {
|
|
2601
|
-
let t =
|
|
2602
|
-
for (let n = 0; n < t.length; n++)
|
|
2651
|
+
let t = Ht(e, null, null, null);
|
|
2652
|
+
for (let n = 0; n < t.length; n++) Ul(e, t[n]);
|
|
2603
2653
|
}(e);
|
|
2604
2654
|
}
|
|
2605
2655
|
return 0;
|
|
2606
2656
|
}
|
|
2607
|
-
function
|
|
2657
|
+
function xl(e, t, n, r) {
|
|
2608
2658
|
let l = e.priv.url, o = function(e, t) {
|
|
2609
2659
|
let n;
|
|
2610
2660
|
try {
|
|
2611
2661
|
n = JSON.parse(t);
|
|
2612
|
-
} catch (
|
|
2613
|
-
return
|
|
2662
|
+
} catch (t) {
|
|
2663
|
+
return hn(`${et(e)}: parsing inter_event json: ${t}`), null;
|
|
2614
2664
|
}
|
|
2615
|
-
if (!(n instanceof Object)) return
|
|
2665
|
+
if (!(n instanceof Object)) return hn(`${et(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2616
2666
|
let r = n.event;
|
|
2617
|
-
if (!r) return
|
|
2618
|
-
if ("string" != typeof r) return
|
|
2667
|
+
if (!r) return hn(`${et(e)}: parsing inter_event: no event`), null;
|
|
2668
|
+
if ("string" != typeof r) return hn(`${et(e)}: parsing inter_event: event not a string`), null;
|
|
2619
2669
|
let l = n.kw;
|
|
2620
2670
|
return l ? l instanceof Object ? {
|
|
2621
2671
|
event: r,
|
|
2622
2672
|
kw: l || {}
|
|
2623
|
-
} : (
|
|
2624
|
-
}(
|
|
2625
|
-
if (
|
|
2626
|
-
|
|
2627
|
-
|
|
2673
|
+
} : (hn(`${et(e)}: parsing inter_event: kw not a json object`), null) : (hn(`${et(e)}: parsing inter_kw: no kw`), null);
|
|
2674
|
+
}(e, n.data);
|
|
2675
|
+
if (!o) return hn(`${et(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2676
|
+
if (Nl(e)) {
|
|
2677
|
+
let e = Xe(qe()) + " <== " + l, t = n.data.length, r = Et(qe(), "trace_ievent_callback");
|
|
2678
|
+
r ? r(e, o, 2, t) : Al(0, e, o);
|
|
2628
2679
|
}
|
|
2629
2680
|
let s = o.event, i = o.kw;
|
|
2630
2681
|
if ("ST_SESSION" !== kt(e)) {
|
|
2631
2682
|
if (It(e, s, D.EVF_PUBLIC_EVENT)) {
|
|
2632
2683
|
if (!(Ft(e, s, i, e) < 0)) return 0;
|
|
2633
|
-
} else
|
|
2634
|
-
return
|
|
2684
|
+
} else mn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2685
|
+
return kl(e), -1;
|
|
2635
2686
|
}
|
|
2636
2687
|
o = null;
|
|
2637
|
-
let _ =
|
|
2638
|
-
if (u.toLowerCase() !==
|
|
2639
|
-
let c =
|
|
2640
|
-
if ("__subscribing__" === _) return -1;
|
|
2641
|
-
if ("__unsubscribing__" === _) return -1;
|
|
2688
|
+
let _ = Mr(e, i), a = Vr(e, i, Ol), u = Er(e, a, "dst_role", "");
|
|
2689
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return mn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2690
|
+
let c = Er(e, a, "dst_service", "");
|
|
2691
|
+
if ("__subscribing__" === _) return hn(`${et(e)}: subscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2692
|
+
if ("__unsubscribing__" === _) return hn(`${et(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2642
2693
|
if (It(e, s, D.EVF_PUBLIC_EVENT)) return Ft(e, s, i, e), 0;
|
|
2643
|
-
if (!
|
|
2694
|
+
if (!sr(c)) {
|
|
2644
2695
|
let t = we(c, !1);
|
|
2645
|
-
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (
|
|
2696
|
+
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (mn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (hn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2646
2697
|
}
|
|
2647
2698
|
return lt(e) ? Ft(nt(e), s, i, e) : Qt(e, s, i), 0;
|
|
2648
2699
|
}
|
|
2649
|
-
function
|
|
2700
|
+
function Kl(e, t, n, r) {
|
|
2650
2701
|
return 0;
|
|
2651
2702
|
}
|
|
2652
|
-
function
|
|
2703
|
+
function Yl(e, t, n, r) {
|
|
2653
2704
|
return 0;
|
|
2654
2705
|
}
|
|
2655
|
-
var
|
|
2706
|
+
var Bl = {
|
|
2656
2707
|
mt_create: function(e) {
|
|
2657
2708
|
let t = e.priv;
|
|
2658
|
-
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), Dt(e, "wanted_yuno_name", t.remote_yuno_name), Dt(e, "wanted_yuno_role", t.remote_yuno_role), Dt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2709
|
+
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), Dt(e, "wanted_yuno_name", t.remote_yuno_name), Dt(e, "wanted_yuno_role", t.remote_yuno_role), Dt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2659
2710
|
const n = Ot(e, "subscriber");
|
|
2660
2711
|
n && Jt(e, null, {}, n);
|
|
2661
2712
|
},
|
|
@@ -2676,52 +2727,58 @@ var gobjJs = function(e) {
|
|
|
2676
2727
|
},
|
|
2677
2728
|
mt_start: function(e) {
|
|
2678
2729
|
let t = e.priv;
|
|
2679
|
-
return t.retry_ms = 0,
|
|
2730
|
+
return t.retry_ms = 0, "ST_DISCONNECTED" !== kt(e) && (Ft(e, "EV_ON_CLOSE", {
|
|
2731
|
+
url: t.url,
|
|
2732
|
+
ws_seq: t.ws_seq,
|
|
2733
|
+
code: 1e3,
|
|
2734
|
+
reason: "restarted",
|
|
2735
|
+
was_clean: !0
|
|
2736
|
+
}, e), bl(t.gobj_timer)), t.websocket = $l(e), 0;
|
|
2680
2737
|
},
|
|
2681
2738
|
mt_stop: function(e) {
|
|
2682
2739
|
let t = e.priv;
|
|
2683
|
-
return
|
|
2740
|
+
return bl(t.gobj_timer), t.websocket && kl(e), 0;
|
|
2684
2741
|
},
|
|
2685
2742
|
mt_destroy: function(e) {},
|
|
2686
2743
|
mt_stats: function(e, t, n, r) {
|
|
2687
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2744
|
+
if ("ST_SESSION" !== kt(e)) return mn("Not in session"), null;
|
|
2688
2745
|
n || (n = {});
|
|
2689
|
-
let l =
|
|
2690
|
-
return o || (o = {}),
|
|
2746
|
+
let l = Ll(e, Xe(r), Er(e, n, "service", null, 0)), o = vr(e, n, "__md_stats__", null, Xt.KW_EXTRACT);
|
|
2747
|
+
return o || (o = {}), Fr(e, n, "stats_stack", {
|
|
2691
2748
|
stats: t,
|
|
2692
2749
|
kw: o
|
|
2693
|
-
}),
|
|
2750
|
+
}), Fr(e, n, Ol, l), n.__stats__ = t, Gr(e, n, "__stats__"), Cl(e, "EV_MT_STATS", n, r), null;
|
|
2694
2751
|
},
|
|
2695
2752
|
mt_command_parser: function(e, t, n, r) {
|
|
2696
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2753
|
+
if ("ST_SESSION" !== kt(e)) return mn("Not in session"), null;
|
|
2697
2754
|
n || (n = {});
|
|
2698
|
-
let l =
|
|
2699
|
-
return o || (o = {}),
|
|
2755
|
+
let l = Ll(e, Xe(r), Er(e, n, "service", "", 0)), o = vr(e, n, "__md_command__", null, Xt.KW_EXTRACT);
|
|
2756
|
+
return o || (o = {}), Fr(e, n, "command_stack", {
|
|
2700
2757
|
command: t,
|
|
2701
2758
|
kw: o
|
|
2702
|
-
}),
|
|
2759
|
+
}), Fr(e, n, Ol, l), n.__command__ = t, Gr(e, n, "__command__"), Cl(e, "EV_MT_COMMAND", n, r), null;
|
|
2703
2760
|
},
|
|
2704
2761
|
mt_inject_event: function(e, t, n, r) {
|
|
2705
2762
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2706
|
-
if (n = Object.assign({},
|
|
2763
|
+
if (n = Object.assign({}, Xn(n) ? n : {}), Xn(n.__md_iev__) && (n.__md_iev__ = Un(n.__md_iev__)), Vr(e, n, Ol));
|
|
2707
2764
|
else {
|
|
2708
|
-
let l =
|
|
2709
|
-
|
|
2765
|
+
let l = Ll(e, Xe(r), Er(e, n, "__service__", 0, 0));
|
|
2766
|
+
xn(n, "__service__"), Fr(e, n, "__message__", t), Fr(e, n, Ol, l);
|
|
2710
2767
|
}
|
|
2711
|
-
return
|
|
2768
|
+
return Gr(e, n, "__message__"), Cl(e, t, n, r);
|
|
2712
2769
|
},
|
|
2713
2770
|
mt_subscription_added: function(e, t) {
|
|
2714
2771
|
let n = e.priv;
|
|
2715
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2772
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : Ul(e, t) : 0;
|
|
2716
2773
|
},
|
|
2717
2774
|
mt_subscription_deleted: function(e, t) {
|
|
2718
2775
|
let n = e.priv;
|
|
2719
2776
|
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2720
2777
|
if (n.inside_on_open) return 0;
|
|
2721
|
-
if (
|
|
2778
|
+
if (sr(t.event)) return 0;
|
|
2722
2779
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2723
2780
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2724
|
-
return
|
|
2781
|
+
return Fr(e, r, Ol, Ll(e, Xe(_), i)), Gr(e, r, "__unsubscribing__"), Cl(e, t.event, r, e);
|
|
2725
2782
|
}
|
|
2726
2783
|
};
|
|
2727
2784
|
return e.GObj = S, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new T(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new T(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new T(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new T(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new T(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new T(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = T, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
@@ -2735,50 +2792,50 @@ var gobjJs = function(e) {
|
|
|
2735
2792
|
return t;
|
|
2736
2793
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2737
2794
|
return e.replace(/[?# ^:]/g, "_");
|
|
2738
|
-
}, e.clear_timeout =
|
|
2795
|
+
}, e.clear_timeout = bl, e.cmp_two_simple_json = ur, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2739
2796
|
let [r, l, o, s] = t;
|
|
2740
|
-
if (!r) return void
|
|
2797
|
+
if (!r) return void mn("Tag must be a valid HTML element.");
|
|
2741
2798
|
let i = document.createElement(r), _ = "";
|
|
2742
2799
|
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2743
2800
|
let t = "";
|
|
2744
2801
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2745
2802
|
i.style.cssText = t;
|
|
2746
2803
|
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2747
|
-
if (
|
|
2804
|
+
if (er(o)) if (o = o.trim(), o.length > 0 && "<" === o[0]) i.appendChild(Br(o));
|
|
2748
2805
|
else if (n && _) i.textContent = n(_) || o;
|
|
2749
2806
|
else i.textContent = o;
|
|
2750
|
-
else if (
|
|
2751
|
-
if (o.length > 0) if (
|
|
2807
|
+
else if (Zn(o)) {
|
|
2808
|
+
if (o.length > 0) if (er(o[0])) i.appendChild(e(o, n));
|
|
2752
2809
|
else for (let t of o) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2753
|
-
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (
|
|
2810
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (mn("content ignored"), Tn(o));
|
|
2754
2811
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2755
2812
|
return i;
|
|
2756
|
-
}, e.createOneHtml =
|
|
2757
|
-
let n =
|
|
2758
|
-
return
|
|
2813
|
+
}, e.createOneHtml = Br, e.create_json_record = function(e, t) {
|
|
2814
|
+
let n = Un(e);
|
|
2815
|
+
return Gn(n, t), n;
|
|
2759
2816
|
}, e.create_template_record = function(e, t) {
|
|
2760
2817
|
let n = {};
|
|
2761
2818
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2762
2819
|
let l;
|
|
2763
|
-
|
|
2764
|
-
let o =
|
|
2820
|
+
Xn(r) && (l = r.default);
|
|
2821
|
+
let o = vr(null, t, e, l);
|
|
2765
2822
|
n[e] = o;
|
|
2766
2823
|
}), n;
|
|
2767
|
-
}, e.current_timestamp =
|
|
2768
|
-
let n =
|
|
2769
|
-
return n &&
|
|
2824
|
+
}, e.current_timestamp = Jr, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
2825
|
+
let n = Dr(nl(e), null, !1), r = {};
|
|
2826
|
+
return n && Xn(n) && (r = Nr(e, n, t, !1)), r;
|
|
2770
2827
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2771
|
-
let n = yt(e, y.SDF_PERSIST), r =
|
|
2772
|
-
if (r &&
|
|
2773
|
-
let l =
|
|
2774
|
-
l =
|
|
2828
|
+
let n = yt(e, y.SDF_PERSIST), r = Dr(nl(e), null, !1);
|
|
2829
|
+
if (r && Xn(r)) {
|
|
2830
|
+
let l = Nr(e, r, t, !1);
|
|
2831
|
+
l = Nr(e, l, n, !1), wt(e, l, y.SDF_PERSIST);
|
|
2775
2832
|
}
|
|
2776
2833
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2777
|
-
let n =
|
|
2778
|
-
0 === Hn(n) ?
|
|
2834
|
+
let n = Rr(e, Dr(nl(e), null, !1), t, !1);
|
|
2835
|
+
0 === Hn(n) ? kr(nl(e)) : $r(nl(e), n);
|
|
2779
2836
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2780
|
-
let n =
|
|
2781
|
-
return r &&
|
|
2837
|
+
let n = Nr(e, yt(e, y.SDF_PERSIST), t, !1), r = Dr(nl(e), null, !1);
|
|
2838
|
+
return r && Xn(r) && Mn(n, r), $r(nl(e), n);
|
|
2782
2839
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2783
2840
|
let r = null, l = null, o = null;
|
|
2784
2841
|
const s = (...s) => {
|
|
@@ -2804,21 +2861,21 @@ var gobjJs = function(e) {
|
|
|
2804
2861
|
}
|
|
2805
2862
|
return t;
|
|
2806
2863
|
}, e.empty_json = function(e) {
|
|
2807
|
-
return 0 ===
|
|
2808
|
-
}, e.empty_string =
|
|
2864
|
+
return 0 === Qn(e);
|
|
2865
|
+
}, e.empty_string = sr, e.escapeHtml = Yr, e.event_flag_t = D, e.flat2json = function(e) {
|
|
2809
2866
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2810
2867
|
let t = null;
|
|
2811
2868
|
for (const n of Object.keys(e)) {
|
|
2812
|
-
const r =
|
|
2869
|
+
const r = el(n);
|
|
2813
2870
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2814
|
-
if (r.length >
|
|
2871
|
+
if (r.length > Qr) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2815
2872
|
const l = "number" == typeof r[0];
|
|
2816
2873
|
if (null === t) t = l ? [] : {};
|
|
2817
2874
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2818
2875
|
let o = t;
|
|
2819
2876
|
for (let t = 0; t < r.length; t++) {
|
|
2820
2877
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2821
|
-
if (s && l >
|
|
2878
|
+
if (s && l > Xr) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2822
2879
|
if (s !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${s ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2823
2880
|
if (i) {
|
|
2824
2881
|
if (Array.isArray(o)) {
|
|
@@ -2826,7 +2883,7 @@ var gobjJs = function(e) {
|
|
|
2826
2883
|
o[l] = e[n];
|
|
2827
2884
|
} else {
|
|
2828
2885
|
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2829
|
-
o
|
|
2886
|
+
dr(o, l, e[n]);
|
|
2830
2887
|
}
|
|
2831
2888
|
break;
|
|
2832
2889
|
}
|
|
@@ -2834,7 +2891,7 @@ var gobjJs = function(e) {
|
|
|
2834
2891
|
if (Array.isArray(o)) {
|
|
2835
2892
|
for (; o.length <= l;) o.push(null);
|
|
2836
2893
|
a = o[l], null == a && (a = _ ? [] : {}, o[l] = a);
|
|
2837
|
-
} else a = o[l], void 0 === a && (a = _ ? [] : {}, o
|
|
2894
|
+
} else a = gr(o, l) ? void 0 : o[l], void 0 === a && (a = _ ? [] : {}, dr(o, l, a));
|
|
2838
2895
|
if (null === a || "object" != typeof a) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2839
2896
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2840
2897
|
o = a;
|
|
@@ -2858,15 +2915,15 @@ var gobjJs = function(e) {
|
|
|
2858
2915
|
removed: {},
|
|
2859
2916
|
changed: {}
|
|
2860
2917
|
};
|
|
2861
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2918
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? tl(n[e], r[e]) || (l.changed[e] = {
|
|
2862
2919
|
from: n[e],
|
|
2863
2920
|
to: r[e]
|
|
2864
2921
|
}) : l.removed[e] = n[e];
|
|
2865
2922
|
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added[e] = r[e]);
|
|
2866
2923
|
return l;
|
|
2867
2924
|
}, e.flat_key_join = function(e) {
|
|
2868
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2869
|
-
}, e.flat_key_split =
|
|
2925
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Zr(e)).join("`") : "";
|
|
2926
|
+
}, e.flat_key_split = el, e.gclass_add_ev_action = Ee, e.gclass_add_event_type = Te, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Oe, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2870
2927
|
if (!e) return {
|
|
2871
2928
|
top: 0,
|
|
2872
2929
|
left: 0,
|
|
@@ -2885,17 +2942,17 @@ var gobjJs = function(e) {
|
|
|
2885
2942
|
right: n + i + r,
|
|
2886
2943
|
bottom: t + s + l
|
|
2887
2944
|
};
|
|
2888
|
-
}, e.get_function_name =
|
|
2945
|
+
}, e.get_function_name = zr, e.get_now = function() {
|
|
2889
2946
|
return Math.floor(Date.now() / 1e3);
|
|
2890
2947
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
2891
|
-
return ot(e) ? (
|
|
2948
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (De(e.parent, e), e.parent = null), Re(t, e), t.gclass.gmt.mt_child_added && (Y(e) && En(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (mn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2892
2949
|
}, e.gobj_change_state = $t, e.gobj_command = function(e, t, r, o) {
|
|
2893
|
-
if (ot(e)) return
|
|
2950
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), -1;
|
|
2894
2951
|
if (function(e) {
|
|
2895
2952
|
return G > 1 || !!e && !!(x(e) & P.TRACE_COMMANDS);
|
|
2896
|
-
}(e) ||
|
|
2897
|
-
let l =
|
|
2898
|
-
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))),
|
|
2953
|
+
}(e) || H(e, null) && !z(o, null)) {
|
|
2954
|
+
let l = $n(t);
|
|
2955
|
+
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) && Pn(r);
|
|
2899
2956
|
}
|
|
2900
2957
|
return e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0);
|
|
2901
2958
|
}, e.gobj_create = function(e, t, n, r) {
|
|
@@ -2909,25 +2966,25 @@ var gobjJs = function(e) {
|
|
|
2909
2966
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2910
2967
|
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
2911
2968
|
}, e.gobj_current_state = kt, e.gobj_default_service = Se, e.gobj_deliver_posted_events = Ut, e.gobj_destroy = Le, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
2912
|
-
if (
|
|
2969
|
+
if (sr(t)) return null;
|
|
2913
2970
|
const n = t.toLowerCase();
|
|
2914
2971
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2915
|
-
}, e.gobj_find_service = we, e.gobj_find_subscribings =
|
|
2972
|
+
}, e.gobj_find_service = we, e.gobj_find_subscribings = zt, e.gobj_find_subscriptions = Ht, e.gobj_flag_t = N, e.gobj_full_name = tt, e.gobj_gclass_name = Ze, e.gobj_get_gclass_trace_level = re, e.gobj_get_gclass_trace_level2 = le, e.gobj_get_gclass_trace_no_level = oe, e.gobj_get_global_trace_level = te, e.gobj_get_global_trace_no_level = ne, e.gobj_global_trace_level = function() {
|
|
2916
2973
|
return F;
|
|
2917
2974
|
}, e.gobj_global_trace_no_level = function() {
|
|
2918
2975
|
return V;
|
|
2919
2976
|
}, e.gobj_has_attr = ht, e.gobj_has_event = It, e.gobj_has_output_event = Ct, e.gobj_hsdata = ce, e.gobj_is_destroying = ot, e.gobj_is_playing = Je, e.gobj_is_pure_child = lt, e.gobj_is_running = Ke, e.gobj_is_service = Be, e.gobj_is_volatil = rt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2920
2977
|
return u ? u(e, t) : null;
|
|
2921
2978
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2922
|
-
let t =
|
|
2979
|
+
let t = Ht(e, null, null, null);
|
|
2923
2980
|
for (let n = 0; n < t.length; n++) {
|
|
2924
|
-
let r = t[n], l =
|
|
2925
|
-
|
|
2981
|
+
let r = t[n], l = yr(e, r, "publisher", null, Xt.KW_REQUIRED), o = yr(e, r, "subscriber", null, Xt.KW_REQUIRED);
|
|
2982
|
+
Yn(r, "s_event", Er(e, r, "event", "", Xt.KW_REQUIRED)), Yn(r, "s_publisher", et(l)), Yn(r, "s_subscriber", et(o));
|
|
2926
2983
|
}
|
|
2927
|
-
let n =
|
|
2984
|
+
let n = zt(e, 0, null, 0);
|
|
2928
2985
|
for (let t = 0; t < n.length; t++) {
|
|
2929
|
-
let r = n[t], l =
|
|
2930
|
-
|
|
2986
|
+
let r = n[t], l = yr(e, r, "publisher", null, Xt.KW_REQUIRED), o = yr(e, r, "subscriber", null, Xt.KW_REQUIRED);
|
|
2987
|
+
Yn(r, "s_event", Er(e, r, "event", "", Xt.KW_REQUIRED)), Yn(r, "s_publisher", et(l)), Yn(r, "s_subscriber", et(o));
|
|
2931
2988
|
}
|
|
2932
2989
|
return {
|
|
2933
2990
|
subscriptions: t,
|
|
@@ -2936,9 +2993,9 @@ var gobjJs = function(e) {
|
|
|
2936
2993
|
total_subscribings: zn(n)
|
|
2937
2994
|
};
|
|
2938
2995
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
2939
|
-
return Be(e) ? i ? i(e, t) : -1 : (
|
|
2996
|
+
return Be(e) ? i ? i(e, t) : -1 : (mn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2940
2997
|
}, e.gobj_match_children = function(e, t) {
|
|
2941
|
-
if (ot(e)) return
|
|
2998
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), null;
|
|
2942
2999
|
t = t || {};
|
|
2943
3000
|
let n = [];
|
|
2944
3001
|
const r = e.dl_children;
|
|
@@ -2958,16 +3015,16 @@ var gobjJs = function(e) {
|
|
|
2958
3015
|
}
|
|
2959
3016
|
}(n, e), n;
|
|
2960
3017
|
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = xe, e.gobj_play = We, e.gobj_post_event = function(e, t, r, l) {
|
|
2961
|
-
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (
|
|
3018
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (mn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : sr(t) ? (mn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (mn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
2962
3019
|
dst: e,
|
|
2963
3020
|
event: t,
|
|
2964
3021
|
kw: r,
|
|
2965
3022
|
src: l
|
|
2966
|
-
}),
|
|
3023
|
+
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ut, 0)), 0) : (mn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (mn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2967
3024
|
}, e.gobj_posted_events_size = function() {
|
|
2968
3025
|
return Lt.length;
|
|
2969
3026
|
}, e.gobj_publish_event = Qt, e.gobj_read_attr = Et, e.gobj_read_attrs = yt, e.gobj_read_bool_attr = Tt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = Ot, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
2970
|
-
return Be(e) ? a ? a(e, t) : -1 : (
|
|
3027
|
+
return Be(e) ? a ? a(e, t) : -1 : (mn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2971
3028
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
2972
3029
|
return U.map(([e, t, n]) => ({
|
|
2973
3030
|
name: e,
|
|
@@ -2977,37 +3034,34 @@ var gobjJs = function(e) {
|
|
|
2977
3034
|
}));
|
|
2978
3035
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
2979
3036
|
return function(e, t, n) {
|
|
2980
|
-
if (ot(e)) return
|
|
3037
|
+
if (ot(e)) return mn("gobj NULL or DESTROYED"), -1;
|
|
2981
3038
|
let r = e.gclass.attrs_table;
|
|
2982
3039
|
for (let l = 0; l < r.length; l++) {
|
|
2983
3040
|
const o = r[l];
|
|
2984
|
-
|
|
2985
|
-
const t = ae(e, e.jn_attrs, o);
|
|
2986
|
-
Qn(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name);
|
|
2987
|
-
}
|
|
3041
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o), Xn(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = e.jn_attrs[o.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name)));
|
|
2988
3042
|
}
|
|
2989
3043
|
return 0;
|
|
2990
3044
|
}(e, y.SDF_VOLATIL, 0);
|
|
2991
3045
|
}, e.gobj_save_persistent_attrs = $e, e.gobj_search_path = mt, e.gobj_send_event = Ft, e.gobj_services = function() {
|
|
2992
3046
|
let e = [];
|
|
2993
|
-
for (const t of Object.keys(b))
|
|
3047
|
+
for (const t of Object.keys(b)) Jn(e, t);
|
|
2994
3048
|
return e;
|
|
2995
3049
|
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
2996
3050
|
return G = Number(e) || 0, 0;
|
|
2997
3051
|
}, e.gobj_set_gclass_no_trace = ie, e.gobj_set_gclass_trace = se, e.gobj_set_global_no_trace = X, e.gobj_set_global_no_trace2 = ee, e.gobj_set_global_trace = Q, e.gobj_set_global_trace2 = Z, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2998
|
-
if (!e) return
|
|
3052
|
+
if (!e) return mn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2999
3053
|
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3000
3054
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3001
3055
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
3002
|
-
if (!e) return
|
|
3056
|
+
if (!e) return mn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3003
3057
|
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3004
3058
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3005
3059
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
3006
3060
|
C = 1 === Number(e) ? 1 : 0;
|
|
3007
3061
|
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
3008
|
-
return ot(e) ? (
|
|
3062
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), -1) : at(e, $.WALK_FIRST2LAST, Ue, 0, 0);
|
|
3009
3063
|
}, e.gobj_start_tree = function(e) {
|
|
3010
|
-
return ot(e) ? (
|
|
3064
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & w.gcflag_manual_start || e.disabled ? 0 : (e.running || Pe(e), ut(e, $.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
3011
3065
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
3012
3066
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
3013
3067
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -3017,14 +3071,14 @@ var gobjJs = function(e) {
|
|
|
3017
3071
|
}
|
|
3018
3072
|
return 0;
|
|
3019
3073
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
3020
|
-
return ot(e) ? (
|
|
3074
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
3021
3075
|
}, e.gobj_stop = Ve, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
3022
|
-
return ot(e) ? (
|
|
3076
|
+
return ot(e) ? (mn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), Ke(e) && Ve(e), ut(e, $.WALK_TOP2BOTTOM, Ge, 0, 0));
|
|
3023
3077
|
}, e.gobj_subscribe_event = Jt, e.gobj_trace_level = x, e.gobj_trace_machine_format = function() {
|
|
3024
3078
|
return C;
|
|
3025
3079
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3026
|
-
if (null == n && (n = {}), !e) return
|
|
3027
|
-
if (!r) return
|
|
3080
|
+
if (null == n && (n = {}), !e) return mn(`publisher NULL: ev ${t}`), 0;
|
|
3081
|
+
if (!r) return mn(`subscriber NULL: ev ${t}`), 0;
|
|
3028
3082
|
const l = /* @__PURE__ */ new Set([
|
|
3029
3083
|
"__config__",
|
|
3030
3084
|
"__global__",
|
|
@@ -3033,80 +3087,80 @@ var gobjJs = function(e) {
|
|
|
3033
3087
|
"__service__"
|
|
3034
3088
|
]);
|
|
3035
3089
|
if (Object.keys(n).forEach((n) => {
|
|
3036
|
-
l.has(n) ||
|
|
3037
|
-
}),
|
|
3038
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
3090
|
+
l.has(n) || mn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
3091
|
+
}), sr(t)) t = "";
|
|
3092
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return mn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
3039
3093
|
let o = Wt(n, t), s = Kt(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), i = 0, _ = 0, a = 0;
|
|
3040
3094
|
for (let t = 0; t < s.length; t++) {
|
|
3041
3095
|
let n = s[t], r = Bt(e, n, !1, !1);
|
|
3042
3096
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3043
3097
|
}
|
|
3044
|
-
return _ ?
|
|
3045
|
-
}, e.gobj_unsubscribe_list =
|
|
3098
|
+
return _ ? hn(`${et(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (hn(`${et(e)}: No subscription found`), Pn(n, "No subscription found")), 0;
|
|
3099
|
+
}, e.gobj_unsubscribe_list = qt, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = St, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = Dt, e.gobj_yuno = qe, e.gobj_yuno_id = Qe, e.gobj_yuno_name = He, e.gobj_yuno_role = ze, e.id_index_in_obj_list = Cr, e.index_in_list = qr, e.is_array = Zn, e.is_boolean = nr, e.is_date = function(e) {
|
|
3046
3100
|
return e instanceof Date && !isNaN(e);
|
|
3047
|
-
}, e.is_function =
|
|
3048
|
-
if (!
|
|
3101
|
+
}, e.is_function = lr, e.is_gobj = or, e.is_metadata_key = function(e) {
|
|
3102
|
+
if (!er(e)) return !1;
|
|
3049
3103
|
let t = 0;
|
|
3050
3104
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3051
3105
|
return 2 === t;
|
|
3052
|
-
}, e.is_null =
|
|
3053
|
-
if (!
|
|
3106
|
+
}, e.is_null = rr, e.is_number = tr, e.is_object = Xn, e.is_private_key = function(e) {
|
|
3107
|
+
if (!er(e)) return !1;
|
|
3054
3108
|
let t = 0;
|
|
3055
3109
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3056
3110
|
return 1 === t;
|
|
3057
3111
|
}, e.is_pure_number = function(e) {
|
|
3058
|
-
if (
|
|
3059
|
-
if (!
|
|
3112
|
+
if (tr(e)) return !0;
|
|
3113
|
+
if (!er(e)) return !1;
|
|
3060
3114
|
const t = Number(e);
|
|
3061
3115
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3062
|
-
}, e.is_secret_name =
|
|
3063
|
-
let l =
|
|
3064
|
-
if (!l) return
|
|
3065
|
-
if (
|
|
3116
|
+
}, e.is_secret_name = Sn, e.is_string = er, e.jdb_delete = function(e, t, n, r) {
|
|
3117
|
+
let l = vr(null, vr(null, e, "topics", null, 0), t, null, 0);
|
|
3118
|
+
if (!l) return mn("jdb_delete: topic not found: " + t), null;
|
|
3119
|
+
if (sr(r.id)) return mn("jdb_delete: record without id: " + r), yn(r), null;
|
|
3066
3120
|
let o, s = n.split("`"), i = l;
|
|
3067
|
-
for (; (o = s.shift()) && !
|
|
3068
|
-
if (0 === s.length && i) if (
|
|
3069
|
-
let e =
|
|
3121
|
+
for (; (o = s.shift()) && !sr(o) && i;) Xn(i) && (i = vr(null, i, e.hook, null, 0)), i = xr(i, null, o, !1);
|
|
3122
|
+
if (0 === s.length && i) if (Zn(i)) {
|
|
3123
|
+
let e = Cr(i, r.id);
|
|
3070
3124
|
e >= 0 && i.splice(e, 1);
|
|
3071
3125
|
} else {
|
|
3072
|
-
let t =
|
|
3126
|
+
let t = vr(null, i, e.hook, null, 0), n = Cr(t, r.id);
|
|
3073
3127
|
n >= 0 && t.splice(n, 1);
|
|
3074
3128
|
}
|
|
3075
3129
|
return l;
|
|
3076
3130
|
}, e.jdb_get = function(e, t, n, r) {
|
|
3077
|
-
let l =
|
|
3078
|
-
return l ? (void 0 === r && (r = !0),
|
|
3131
|
+
let l = vr(null, vr(null, e, "topics", null, 0), t, null, 0);
|
|
3132
|
+
return l ? (void 0 === r && (r = !0), xr(l, e.hook, n, r)) : (mn("jdb_get: topic not found: " + t), null);
|
|
3079
3133
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
3080
|
-
let r =
|
|
3081
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
3134
|
+
let r = vr(null, vr(null, e, "topics", null, 0), t, null, 0);
|
|
3135
|
+
return r ? n < r.length ? r[n] : {} : (mn("jdb_get_by_idx: topic not found: " + t), null);
|
|
3082
3136
|
}, e.jdb_get_topic = function(e, t) {
|
|
3083
|
-
let n =
|
|
3084
|
-
if (!n) return
|
|
3085
|
-
return
|
|
3137
|
+
let n = vr(null, e, "topics", null, 0);
|
|
3138
|
+
if (!n) return mn("jdb topics section not found"), yn(e), null;
|
|
3139
|
+
return vr(null, n, t, null, 0) || (mn("jdb topic not found: " + t), yn(n), null);
|
|
3086
3140
|
}, e.jdb_init = function(e, t, n) {
|
|
3087
|
-
n && (e =
|
|
3088
|
-
let r =
|
|
3089
|
-
|
|
3090
|
-
let l =
|
|
3091
|
-
return
|
|
3092
|
-
"__" !== t.substring(0, 2) &&
|
|
3141
|
+
n && (e = Un(e));
|
|
3142
|
+
let r = vr(null, e, "type", [], 1);
|
|
3143
|
+
Er(null, e, "hook", "data", 1);
|
|
3144
|
+
let l = vr(null, e, "schema", {}, 1), o = vr(null, e, "topics", {}, 1);
|
|
3145
|
+
return Wr(l, function(e, t, n, l) {
|
|
3146
|
+
"__" !== t.substring(0, 2) && vr(null, o, l, Un(r), 1);
|
|
3093
3147
|
}, t), e;
|
|
3094
3148
|
}, e.jdb_update = function(e, t, n, r) {
|
|
3095
|
-
let l =
|
|
3096
|
-
if (!l) return
|
|
3097
|
-
if (
|
|
3149
|
+
let l = vr(null, vr(null, e, "topics", null, 0), t, null, 0);
|
|
3150
|
+
if (!l) return mn("jdb_update: topic not found: " + t), null;
|
|
3151
|
+
if (sr(r.id)) return mn("jdb_update: record without id: " + r), yn(r), null;
|
|
3098
3152
|
let o, s = n.split("`"), i = l;
|
|
3099
|
-
for (; (o = s.shift()) && !
|
|
3100
|
-
if (0 === s.length && i) if (
|
|
3153
|
+
for (; (o = s.shift()) && !sr(o) && i;) Xn(i) && (i = vr(null, i, e.hook, [], 1)), i = xr(i, null, o, !1);
|
|
3154
|
+
if (0 === s.length && i) if (Zn(i)) i.push(r);
|
|
3101
3155
|
else if (i.id === r.id) Object.assign(i, r);
|
|
3102
3156
|
else {
|
|
3103
|
-
let t =
|
|
3157
|
+
let t = vr(null, i, e.hook, [], 1), n = xr(t, e.hook, r.id, !1);
|
|
3104
3158
|
n ? Object.assign(n, r) : t.push(r);
|
|
3105
3159
|
}
|
|
3106
3160
|
return l;
|
|
3107
3161
|
}, e.json2flat = function(e) {
|
|
3108
3162
|
const t = {}, n = (e, r, l) => {
|
|
3109
|
-
if (l >
|
|
3163
|
+
if (l > Qr) throw new Error("json2flat: deeper than 256");
|
|
3110
3164
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3111
3165
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3112
3166
|
const o = `[${t}]`;
|
|
@@ -3116,7 +3170,7 @@ var gobjJs = function(e) {
|
|
|
3116
3170
|
const t = Object.keys(e);
|
|
3117
3171
|
if (t.length > 0) {
|
|
3118
3172
|
for (const o of t) {
|
|
3119
|
-
const t =
|
|
3173
|
+
const t = Zr(o);
|
|
3120
3174
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
3121
3175
|
}
|
|
3122
3176
|
return;
|
|
@@ -3125,11 +3179,11 @@ var gobjJs = function(e) {
|
|
|
3125
3179
|
0 !== l && (t[r] = e);
|
|
3126
3180
|
};
|
|
3127
3181
|
return null == e || n(e, "", 0), t;
|
|
3128
|
-
}, e.json_array_append =
|
|
3182
|
+
}, e.json_array_append = Bn, e.json_array_append_new = Jn, e.json_array_extend = function(e, t) {
|
|
3129
3183
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3130
|
-
}, e.json_array_remove =
|
|
3184
|
+
}, e.json_array_remove = qn, e.json_array_size = zn, e.json_deep_copy = Un, e.json_is_identical = Fn, e.json_mask_secrets = Ln, e.json_object_del = xn, e.json_object_get = Wn, e.json_object_set = Kn, e.json_object_set_new = Yn, e.json_object_size = Hn, e.json_object_update = Vn, e.json_object_update_existing = Gn, e.json_object_update_missing = Mn, e.json_size = Qn, e.jwt2json = function(e, t) {
|
|
3131
3185
|
try {
|
|
3132
|
-
let n =
|
|
3186
|
+
let n = Kr(e);
|
|
3133
3187
|
switch (t) {
|
|
3134
3188
|
case "header": return JSON.parse(n.header);
|
|
3135
3189
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3138,137 +3192,137 @@ var gobjJs = function(e) {
|
|
|
3138
3192
|
} catch (e) {
|
|
3139
3193
|
return null;
|
|
3140
3194
|
}
|
|
3141
|
-
}, e.jwtDecode =
|
|
3142
|
-
if (e && !
|
|
3143
|
-
r || (r =
|
|
3195
|
+
}, e.jwtDecode = Kr, e.kw_clone_by_keys = Nr, e.kw_clone_by_not_keys = Rr, e.kw_collect = function(e, t, n, r) {
|
|
3196
|
+
if (e && !or(e) && mn("GObj bad instanceof"), !t) return null;
|
|
3197
|
+
r || (r = wr);
|
|
3144
3198
|
let l = [];
|
|
3145
|
-
if (
|
|
3199
|
+
if (Zn(t)) for (let e = 0; e < t.length; e++) {
|
|
3146
3200
|
let o = t[e];
|
|
3147
3201
|
r(o, n) && l.push(o);
|
|
3148
3202
|
}
|
|
3149
3203
|
else {
|
|
3150
|
-
if (!
|
|
3204
|
+
if (!Xn(t)) return mn("kw_select() BAD kw parameter"), null;
|
|
3151
3205
|
r(t, n) && l.push(t);
|
|
3152
3206
|
}
|
|
3153
3207
|
return l;
|
|
3154
|
-
}, e.kw_delete =
|
|
3155
|
-
if (!n || !
|
|
3156
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3157
|
-
return r &&
|
|
3158
|
-
}, e.kw_find_path =
|
|
3159
|
-
e && !
|
|
3160
|
-
let o =
|
|
3208
|
+
}, e.kw_delete = pr, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
3209
|
+
if (!n || !Zn(t)) return r && mn("item NULL or kw_list is not a list"), -1;
|
|
3210
|
+
for (let e = 0; e < t.length; e++) if (Fn(n, t[e])) return e;
|
|
3211
|
+
return r && mn("item not found in this list"), -1;
|
|
3212
|
+
}, e.kw_find_path = br, e.kw_flag_t = Xt, e.kw_get_bool = mr, e.kw_get_dict = Tr, e.kw_get_dict_value = vr, e.kw_get_int = hr, e.kw_get_list = function(e, t, n, r, l) {
|
|
3213
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
3214
|
+
let o = br(e, t, n, !1);
|
|
3161
3215
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
3162
|
-
return void 0 === o ? i &&
|
|
3163
|
-
}, e.kw_get_local_storage_value =
|
|
3164
|
-
e && !
|
|
3165
|
-
let o =
|
|
3216
|
+
return void 0 === o ? i && Zn(r) && t ? (jr(e, t, n, r), r) : (s && (mn(`path not found: '${n}'`), Pn(t)), r) : Zn(o) ? (_ && pr(e, t, n), o) : (s && (mn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'`), Pn(t)), r);
|
|
3217
|
+
}, e.kw_get_local_storage_value = Dr, e.kw_get_pointer = yr, e.kw_get_real = function(e, t, n, r, l) {
|
|
3218
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
3219
|
+
let o = br(e, t, n, !1);
|
|
3166
3220
|
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT, a = l && l & Xt.KW_WILD_NUMBER;
|
|
3167
3221
|
if (void 0 === o) {
|
|
3168
3222
|
if (i && t) {
|
|
3169
3223
|
let l = Number(r);
|
|
3170
|
-
return
|
|
3224
|
+
return jr(e, t, n, l), l;
|
|
3171
3225
|
}
|
|
3172
|
-
return s && (
|
|
3226
|
+
return s && (mn(`path not found: '${n}'`), Pn(t)), Number(r);
|
|
3173
3227
|
}
|
|
3174
3228
|
let u;
|
|
3175
|
-
if (
|
|
3229
|
+
if (tr(o)) u = o;
|
|
3176
3230
|
else {
|
|
3177
|
-
if (!a) return
|
|
3178
|
-
if (
|
|
3179
|
-
else if (
|
|
3231
|
+
if (!a) return mn(`${e ? et(e) + ": " : ""}path MUST BE a json real: '${n}'`), Pn(t), Number(r);
|
|
3232
|
+
if (nr(o)) u = o ? 1 : 0;
|
|
3233
|
+
else if (er(o)) u = parseFloat(o), Number.isNaN(u) && (u = 0);
|
|
3180
3234
|
else {
|
|
3181
|
-
if (null !== o) return
|
|
3235
|
+
if (null !== o) return mn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Pn(t), 0;
|
|
3182
3236
|
u = 0;
|
|
3183
3237
|
}
|
|
3184
3238
|
}
|
|
3185
|
-
return _ &&
|
|
3186
|
-
}, e.kw_get_str =
|
|
3187
|
-
if (e && !
|
|
3188
|
-
r || (r =
|
|
3239
|
+
return _ && pr(e, t, n), u;
|
|
3240
|
+
}, e.kw_get_str = Er, e.kw_has_key = fr, e.kw_match_simple = wr, e.kw_pop = cr, e.kw_remove_local_storage_value = kr, e.kw_select = function(e, t, n, r) {
|
|
3241
|
+
if (e && !or(e) && mn("GObj bad instanceof"), !t) return null;
|
|
3242
|
+
r || (r = wr);
|
|
3189
3243
|
let l = [];
|
|
3190
|
-
if (
|
|
3244
|
+
if (Zn(t)) for (let e = 0; e < t.length; e++) {
|
|
3191
3245
|
let o = t[e];
|
|
3192
|
-
r(o, n) && l.push(
|
|
3246
|
+
r(o, n) && l.push(Un(o));
|
|
3193
3247
|
}
|
|
3194
3248
|
else {
|
|
3195
|
-
if (!
|
|
3196
|
-
r(t, n) && l.push(
|
|
3249
|
+
if (!Xn(t)) return mn("kw_select() BAD kw parameter"), null;
|
|
3250
|
+
r(t, n) && l.push(Un(t));
|
|
3197
3251
|
}
|
|
3198
3252
|
return l;
|
|
3199
|
-
}, e.kw_set_dict_value =
|
|
3200
|
-
e && !
|
|
3201
|
-
let o =
|
|
3253
|
+
}, e.kw_set_dict_value = jr, e.kw_set_local_storage_value = $r, e.kw_set_subdict_value = Or, e.kwid_collect = Ir, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
3254
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
3255
|
+
let o = Ir(e, t, n, r, l);
|
|
3202
3256
|
return o && 0 !== o.length ? o[0] : null;
|
|
3203
3257
|
}, e.kwid_get_ids = function(e, t) {
|
|
3204
|
-
if (e && !
|
|
3258
|
+
if (e && !or(e) && mn("GObj bad instanceof"), !t) return [];
|
|
3205
3259
|
let n = [];
|
|
3206
|
-
if (
|
|
3207
|
-
else if (
|
|
3208
|
-
else
|
|
3209
|
-
if (
|
|
3210
|
-
else if (
|
|
3211
|
-
let r =
|
|
3260
|
+
if (er(t)) n.push(t);
|
|
3261
|
+
else if (Xn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
3262
|
+
else Zn(t) && t.forEach(function(t) {
|
|
3263
|
+
if (er(t)) sr(t) || n.push(t);
|
|
3264
|
+
else if (Xn(t)) {
|
|
3265
|
+
let r = Er(e, t, "id", 0, 0);
|
|
3212
3266
|
r && n.push(r);
|
|
3213
3267
|
}
|
|
3214
3268
|
});
|
|
3215
3269
|
return n;
|
|
3216
|
-
}, e.kwid_match_id =
|
|
3217
|
-
e && !
|
|
3270
|
+
}, e.kwid_match_id = Ar, e.kwid_new_dict = function(e, t, n) {
|
|
3271
|
+
e && !or(e) && mn("GObj bad instanceof");
|
|
3218
3272
|
let r = {};
|
|
3219
|
-
if (
|
|
3220
|
-
else if (
|
|
3221
|
-
let l = t[n], o =
|
|
3222
|
-
|
|
3273
|
+
if (sr(n) || (t = br(e, t, n)), Xn(t)) r = t;
|
|
3274
|
+
else if (Zn(t)) for (let n = 0; n < t.length; n++) {
|
|
3275
|
+
let l = t[n], o = Er(e, l, "id", "", Xt.KW_REQUIRED);
|
|
3276
|
+
sr(o) || (r[o] = l);
|
|
3223
3277
|
}
|
|
3224
|
-
else
|
|
3278
|
+
else mn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
3225
3279
|
return r;
|
|
3226
3280
|
}, e.kwid_new_list = function(e, t, n) {
|
|
3227
|
-
if (e && !
|
|
3228
|
-
if (
|
|
3281
|
+
if (e && !or(e) && mn("GObj bad instanceof"), sr(n) || (t = br(e, t, n)), Zn(t)) return t;
|
|
3282
|
+
if (Xn(t)) {
|
|
3229
3283
|
let n = [];
|
|
3230
3284
|
for (let r of Object.keys(t)) {
|
|
3231
3285
|
let l = t[r];
|
|
3232
|
-
|
|
3286
|
+
Xn(l) ? (l.id = r, n.push(l)) : mn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
3233
3287
|
}
|
|
3234
3288
|
return n;
|
|
3235
3289
|
}
|
|
3236
|
-
return
|
|
3290
|
+
return mn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
3237
3291
|
}, e.list2options = function(e, t, n) {
|
|
3238
3292
|
t = t || "id", n = n || "value";
|
|
3239
3293
|
let r = [];
|
|
3240
|
-
if (
|
|
3294
|
+
if (Zn(e)) for (let l = 0; l < e.length; l++) {
|
|
3241
3295
|
let o = e[l];
|
|
3242
|
-
if (
|
|
3296
|
+
if (er(o)) r.push({
|
|
3243
3297
|
id: e[l],
|
|
3244
3298
|
value: e[l]
|
|
3245
3299
|
});
|
|
3246
|
-
else if (
|
|
3300
|
+
else if (Xn(o)) {
|
|
3247
3301
|
let e = {};
|
|
3248
|
-
if (
|
|
3249
|
-
if (!
|
|
3250
|
-
if (!(
|
|
3251
|
-
|
|
3302
|
+
if (fr(o, t)) {
|
|
3303
|
+
if (!fr(o, n)) {
|
|
3304
|
+
if (!(Qn(o) > 0)) {
|
|
3305
|
+
mn("list2options(): object without field value: " + n);
|
|
3252
3306
|
continue;
|
|
3253
3307
|
}
|
|
3254
3308
|
n = Object.keys(o)[0];
|
|
3255
3309
|
}
|
|
3256
3310
|
e.id = o[t], e.value = o[n];
|
|
3257
3311
|
} else {
|
|
3258
|
-
if (!(
|
|
3259
|
-
|
|
3312
|
+
if (!(Qn(o) > 0)) {
|
|
3313
|
+
mn("list2options(): object without field id: " + t);
|
|
3260
3314
|
continue;
|
|
3261
3315
|
}
|
|
3262
3316
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
3263
3317
|
}
|
|
3264
3318
|
r.push(e);
|
|
3265
|
-
} else
|
|
3319
|
+
} else mn("list2options(): case1 not implemented");
|
|
3266
3320
|
}
|
|
3267
|
-
else if (
|
|
3321
|
+
else if (Xn(e)) for (let t of Object.keys(e)) r.push({
|
|
3268
3322
|
id: t,
|
|
3269
3323
|
value: t
|
|
3270
3324
|
});
|
|
3271
|
-
else
|
|
3325
|
+
else mn("list2options(): case2 not implemented");
|
|
3272
3326
|
return r;
|
|
3273
3327
|
}, e.load_json_file = function(e, t, n) {
|
|
3274
3328
|
let r = new XMLHttpRequest();
|
|
@@ -3276,18 +3330,18 @@ var gobjJs = function(e) {
|
|
|
3276
3330
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3277
3331
|
t(JSON.parse(r.responseText));
|
|
3278
3332
|
} catch (e) {
|
|
3279
|
-
n && (
|
|
3333
|
+
n && (mn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3280
3334
|
}
|
|
3281
3335
|
else n && n(r.status);
|
|
3282
3336
|
var e;
|
|
3283
3337
|
}, r.send();
|
|
3284
|
-
}, e.log_debug =
|
|
3285
|
-
let
|
|
3286
|
-
nn && un("info",
|
|
3287
|
-
}, e.log_warning =
|
|
3338
|
+
}, e.log_debug = En, e.log_error = mn, e.log_info = function(e, ...t) {
|
|
3339
|
+
let n = pn(e, ...t), r = Jr();
|
|
3340
|
+
nn && un("info", n) && nn("%c" + r + " INFO: " + String(n), "color:cyan"), fn("info", n, r);
|
|
3341
|
+
}, e.log_warning = hn, e.mask_secrets_inline = $n, e.msg_iev_get_msg_type = Mr, e.msg_iev_get_stack = Vr, e.msg_iev_push_stack = Fr, e.msg_iev_read_key = Pr, e.msg_iev_set_msg_type = Gr, e.msg_iev_write_key = Ur, e.node_uuid = Hr, e.parseBoolean = ir, e.parseSVG = function(e) {
|
|
3288
3342
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3289
3343
|
}, e.refresh_language = function(e, t) {
|
|
3290
|
-
if (!
|
|
3344
|
+
if (!lr(t)) return void mn("You must supply a translation function");
|
|
3291
3345
|
e || (e = document);
|
|
3292
3346
|
const n = (t) => {
|
|
3293
3347
|
let n = [];
|
|
@@ -3311,22 +3365,22 @@ var gobjJs = function(e) {
|
|
|
3311
3365
|
});
|
|
3312
3366
|
}, e.register_c_ievent_cli = function() {
|
|
3313
3367
|
return function(e) {
|
|
3314
|
-
if (
|
|
3368
|
+
if (Dl) return mn(`GClass ALREADY created: ${e}`), -1;
|
|
3315
3369
|
const t = [
|
|
3316
3370
|
["ST_DISCONNECTED", [
|
|
3317
3371
|
[
|
|
3318
3372
|
"EV_ON_OPEN",
|
|
3319
|
-
|
|
3373
|
+
Vl,
|
|
3320
3374
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3321
3375
|
],
|
|
3322
3376
|
[
|
|
3323
3377
|
"EV_ON_CLOSE",
|
|
3324
|
-
|
|
3378
|
+
Gl,
|
|
3325
3379
|
null
|
|
3326
3380
|
],
|
|
3327
3381
|
[
|
|
3328
3382
|
"EV_TIMEOUT",
|
|
3329
|
-
|
|
3383
|
+
Fl,
|
|
3330
3384
|
null
|
|
3331
3385
|
],
|
|
3332
3386
|
[
|
|
@@ -3338,22 +3392,22 @@ var gobjJs = function(e) {
|
|
|
3338
3392
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3339
3393
|
[
|
|
3340
3394
|
"EV_ON_MESSAGE",
|
|
3341
|
-
|
|
3395
|
+
xl,
|
|
3342
3396
|
null
|
|
3343
3397
|
],
|
|
3344
3398
|
[
|
|
3345
3399
|
"EV_IDENTITY_CARD_ACK",
|
|
3346
|
-
|
|
3400
|
+
Wl,
|
|
3347
3401
|
null
|
|
3348
3402
|
],
|
|
3349
3403
|
[
|
|
3350
3404
|
"EV_ON_CLOSE",
|
|
3351
|
-
|
|
3405
|
+
Gl,
|
|
3352
3406
|
"ST_DISCONNECTED"
|
|
3353
3407
|
],
|
|
3354
3408
|
[
|
|
3355
3409
|
"EV_TIMEOUT",
|
|
3356
|
-
|
|
3410
|
+
Ml,
|
|
3357
3411
|
null
|
|
3358
3412
|
],
|
|
3359
3413
|
[
|
|
@@ -3365,22 +3419,22 @@ var gobjJs = function(e) {
|
|
|
3365
3419
|
["ST_SESSION", [
|
|
3366
3420
|
[
|
|
3367
3421
|
"EV_ON_MESSAGE",
|
|
3368
|
-
|
|
3422
|
+
xl,
|
|
3369
3423
|
null
|
|
3370
3424
|
],
|
|
3371
3425
|
[
|
|
3372
3426
|
"EV_MT_STATS",
|
|
3373
|
-
|
|
3427
|
+
Kl,
|
|
3374
3428
|
null
|
|
3375
3429
|
],
|
|
3376
3430
|
[
|
|
3377
3431
|
"EV_MT_COMMAND",
|
|
3378
|
-
|
|
3432
|
+
Yl,
|
|
3379
3433
|
null
|
|
3380
3434
|
],
|
|
3381
3435
|
[
|
|
3382
3436
|
"EV_ON_CLOSE",
|
|
3383
|
-
|
|
3437
|
+
Gl,
|
|
3384
3438
|
"ST_DISCONNECTED"
|
|
3385
3439
|
],
|
|
3386
3440
|
[
|
|
@@ -3391,7 +3445,7 @@ var gobjJs = function(e) {
|
|
|
3391
3445
|
]],
|
|
3392
3446
|
[null, null]
|
|
3393
3447
|
];
|
|
3394
|
-
return (
|
|
3448
|
+
return (Dl = de(e, [
|
|
3395
3449
|
["EV_ON_MESSAGE", D.EVF_OUTPUT_EVENT],
|
|
3396
3450
|
["EV_IDENTITY_CARD_ACK", D.EVF_PUBLIC_EVENT],
|
|
3397
3451
|
["EV_ON_ID_NAK", D.EVF_PUBLIC_EVENT | D.EVF_OUTPUT_EVENT],
|
|
@@ -3402,36 +3456,36 @@ var gobjJs = function(e) {
|
|
|
3402
3456
|
["EV_ON_OPEN_ERROR", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS],
|
|
3403
3457
|
["EV_TIMEOUT", 0],
|
|
3404
3458
|
[null, 0]
|
|
3405
|
-
], t,
|
|
3459
|
+
], t, Bl, 0, Sl, Rl, 0, 0, wl, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3406
3460
|
}("C_IEVENT_CLI");
|
|
3407
3461
|
}, e.register_c_timer = function() {
|
|
3408
3462
|
return function(e) {
|
|
3409
|
-
if (
|
|
3463
|
+
if (ul) return mn(`GClass ALREADY created: ${e}`), -1;
|
|
3410
3464
|
const t = [["ST_IDLE", [[
|
|
3411
3465
|
"EV_TIMEOUT",
|
|
3412
|
-
|
|
3466
|
+
cl,
|
|
3413
3467
|
null
|
|
3414
3468
|
]]]];
|
|
3415
|
-
return (
|
|
3469
|
+
return (ul = de(e, [
|
|
3416
3470
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3417
3471
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3418
3472
|
[0, 0]
|
|
3419
|
-
], t,
|
|
3473
|
+
], t, fl, 0, _l, al, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3420
3474
|
}("C_TIMER");
|
|
3421
3475
|
}, e.register_c_yuno = function() {
|
|
3422
3476
|
return function(e) {
|
|
3423
|
-
if (
|
|
3477
|
+
if (hl) return mn(`GClass ALREADY created: ${e}`), -1;
|
|
3424
3478
|
const t = [["ST_IDLE", [[
|
|
3425
3479
|
"EV_TIMEOUT_PERIODIC",
|
|
3426
|
-
|
|
3480
|
+
vl,
|
|
3427
3481
|
null
|
|
3428
3482
|
]]]];
|
|
3429
|
-
return (
|
|
3483
|
+
return (hl = de(e, [["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]], t, jl, 0, pl, ml, 0, 0, 0, 0)) ? 0 : -1;
|
|
3430
3484
|
}("C_YUNO");
|
|
3431
3485
|
}, e.safeSrc = function(e) {
|
|
3432
3486
|
if (!e) return "";
|
|
3433
3487
|
const t = String(e).trim();
|
|
3434
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3488
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Yr(t);
|
|
3435
3489
|
}, e.sdata_flag_t = y, e.send_http_json_post = function(e, t, n) {
|
|
3436
3490
|
let r = new XMLHttpRequest();
|
|
3437
3491
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -3454,13 +3508,13 @@ var gobjJs = function(e) {
|
|
|
3454
3508
|
gn(e, r, n);
|
|
3455
3509
|
}
|
|
3456
3510
|
} else ln = e;
|
|
3457
|
-
}, e.set_remote_log_functions = dn, e.set_timeout =
|
|
3511
|
+
}, e.set_remote_log_functions = dn, e.set_timeout = gl, e.set_timeout_periodic = dl, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = Lr, e.strcasecmp = ar, e.strcmp = _r, e.strncmp = function(e, t, n) {
|
|
3458
3512
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3459
3513
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3460
3514
|
}, e.strs_in_list = function(e, t, n) {
|
|
3461
|
-
if (!e) return
|
|
3462
|
-
if (!t) return
|
|
3463
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3515
|
+
if (!e) return mn("ERROR: strs_in_list() list empty"), !1;
|
|
3516
|
+
if (!t) return mn("ERROR: strs_in_list() str empty"), !1;
|
|
3517
|
+
for (let r = 0; r < t.length; r++) if (Lr(e, t[r], n)) return !0;
|
|
3464
3518
|
return !1;
|
|
3465
3519
|
}, e.strstr = function(e, t, n) {
|
|
3466
3520
|
var r;
|
|
@@ -3479,13 +3533,13 @@ var gobjJs = function(e) {
|
|
|
3479
3533
|
placeholder: void 0,
|
|
3480
3534
|
fkey: null
|
|
3481
3535
|
};
|
|
3482
|
-
if (
|
|
3536
|
+
if (er(t)) {
|
|
3483
3537
|
let e = t.split(".");
|
|
3484
3538
|
for (let t = 0; t < e.length; t++) {
|
|
3485
3539
|
let r = e[t];
|
|
3486
|
-
if (
|
|
3487
|
-
else if (
|
|
3488
|
-
else if (
|
|
3540
|
+
if (Lr(ll, r)) n.real_type || (n.real_type = r);
|
|
3541
|
+
else if (Lr(sl, r)) n.type || (n.type = r);
|
|
3542
|
+
else if (Lr(ol, r)) switch (r) {
|
|
3489
3543
|
case "writable":
|
|
3490
3544
|
n.is_writable = !0;
|
|
3491
3545
|
break;
|
|
@@ -3497,23 +3551,23 @@ var gobjJs = function(e) {
|
|
|
3497
3551
|
}
|
|
3498
3552
|
}
|
|
3499
3553
|
n.real_type || (n.real_type = "string");
|
|
3500
|
-
} else
|
|
3554
|
+
} else Xn(t) ? (n = il(t), n.name || (n.name = e), n.header || (n.header = e)) : Zn(t) && (n.real_type = "array", n.enum_list = t);
|
|
3501
3555
|
return n.type || (n.type = n.real_type), n;
|
|
3502
3556
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3503
3557
|
const n = e, r = performance.now();
|
|
3504
3558
|
let l = r;
|
|
3505
|
-
return t &&
|
|
3559
|
+
return t && hn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3506
3560
|
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3507
|
-
return t &&
|
|
3561
|
+
return t && hn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3508
3562
|
partial: i,
|
|
3509
3563
|
total: _
|
|
3510
3564
|
};
|
|
3511
3565
|
} };
|
|
3512
|
-
}, e.trace_json =
|
|
3513
|
-
if (
|
|
3566
|
+
}, e.trace_json = Tn, e.trace_json_masked = Pn, e.trace_level_t = P, e.trace_msg = yn, e.treedb_decoder_fkey = rl, e.treedb_decoder_hook = function(e, t) {
|
|
3567
|
+
if (er(t)) {
|
|
3514
3568
|
if (-1 === t.indexOf("^")) {
|
|
3515
3569
|
let n, r = e.hook;
|
|
3516
|
-
if (1 !== Hn(r)) return
|
|
3570
|
+
if (1 !== Hn(r)) return mn("bad hook 1"), mn(e), mn(t), null;
|
|
3517
3571
|
for (let e of Object.keys(r)) {
|
|
3518
3572
|
n = e, r[e];
|
|
3519
3573
|
break;
|
|
@@ -3525,25 +3579,25 @@ var gobjJs = function(e) {
|
|
|
3525
3579
|
}
|
|
3526
3580
|
{
|
|
3527
3581
|
let n = t.split("^");
|
|
3528
|
-
return 2 !== n.length ? (
|
|
3582
|
+
return 2 !== n.length ? (mn("bad hook 2"), mn(e), mn(t), null) : {
|
|
3529
3583
|
topic_name: n[0],
|
|
3530
3584
|
id: n[1]
|
|
3531
3585
|
};
|
|
3532
3586
|
}
|
|
3533
3587
|
}
|
|
3534
|
-
return
|
|
3588
|
+
return Xn(t) ? {
|
|
3535
3589
|
topic_name: t.topic_name,
|
|
3536
3590
|
id: t.id
|
|
3537
|
-
} : (
|
|
3591
|
+
} : (mn("bad hook 3"), mn(e), mn(t), null);
|
|
3538
3592
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3539
|
-
let n =
|
|
3593
|
+
let n = rl(e, t);
|
|
3540
3594
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3541
|
-
}, e.treedb_get_field_desc =
|
|
3542
|
-
if (
|
|
3595
|
+
}, e.treedb_get_field_desc = il, e.treedb_hook_data_size = function(e) {
|
|
3596
|
+
if (Zn(e) && 1 === Qn(e)) {
|
|
3543
3597
|
let t = e[0];
|
|
3544
|
-
return
|
|
3598
|
+
return fr(t, "size") ? t.size : 1;
|
|
3545
3599
|
}
|
|
3546
|
-
return
|
|
3600
|
+
return Qn(e);
|
|
3547
3601
|
}, e.vsprintf = function(e, t) {
|
|
3548
3602
|
return n.apply(null, [e].concat(t || []));
|
|
3549
3603
|
}, e.walk_type_t = $, e;
|