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