@yuneta/gobj-js 7.26.15 → 7.26.17
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 +64 -25
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +903 -883
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +64 -25
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +943 -923
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +64 -25
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +903 -883
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +64 -25
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +903 -883
- 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 = Mn(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
|
+
nr(e) && (e = JSON.stringify(e)), jn(" ".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 (ur(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) || (Tn(`${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 = lr(e) ? Oe(e) : e;
|
|
396
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (Tn(`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 = lr(e) ? Oe(e) : e;
|
|
400
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (Tn(`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 = lr(e) ? Oe(e) : e;
|
|
404
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (Tn(`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 = lr(e) ? Oe(e) : e;
|
|
408
|
+
if (!r) return Tn(`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 = lr(e) ? Oe(e) : e;
|
|
414
|
+
if (!r) return Tn(`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 (!rr(t)) return Tn("sdata_desc MUST be an array"), Sn(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 = cr(l);
|
|
435
435
|
break;
|
|
436
436
|
case y.DTP_INTEGER:
|
|
437
|
-
r = parseInt(l), isNaN(r) &&
|
|
437
|
+
r = parseInt(l), isNaN(r) && Tn(`${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) && Tn(`${et(e)}: attr NaN: ${n.name}`);
|
|
441
441
|
break;
|
|
442
442
|
case y.DTP_LIST:
|
|
443
|
-
if (
|
|
443
|
+
if (lr(l)) try {
|
|
444
444
|
r = JSON.parse(l);
|
|
445
445
|
} catch (e) {
|
|
446
|
-
|
|
446
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
447
447
|
}
|
|
448
448
|
else r = l;
|
|
449
|
-
|
|
449
|
+
rr(r) || (r = []);
|
|
450
450
|
break;
|
|
451
451
|
case y.DTP_DICT:
|
|
452
|
-
if (
|
|
452
|
+
if (lr(l)) try {
|
|
453
453
|
r = JSON.parse(l);
|
|
454
454
|
} catch (e) {
|
|
455
|
-
|
|
455
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
456
456
|
}
|
|
457
457
|
else r = l;
|
|
458
|
-
|
|
458
|
+
nr(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 (lr(l)) try {
|
|
463
463
|
r = JSON.parse(l);
|
|
464
464
|
} catch (e) {
|
|
465
|
-
|
|
465
|
+
Tn(`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 && (Tn(`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 (lr(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 = cr(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 Tn(`${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 Tn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
492
492
|
break;
|
|
493
493
|
case y.DTP_LIST:
|
|
494
|
-
if (
|
|
494
|
+
if (lr(r)) try {
|
|
495
495
|
l = JSON.parse(r);
|
|
496
496
|
} catch (e) {
|
|
497
|
-
|
|
497
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
498
498
|
}
|
|
499
499
|
else l = r;
|
|
500
|
-
if (!
|
|
500
|
+
if (!rr(l)) return Tn(`attr must be an array: ${n.name}`), -1;
|
|
501
501
|
break;
|
|
502
502
|
case y.DTP_DICT:
|
|
503
|
-
if (
|
|
503
|
+
if (lr(r)) try {
|
|
504
504
|
l = JSON.parse(r);
|
|
505
505
|
} catch (e) {
|
|
506
|
-
|
|
506
|
+
Tn(`JSON parse error: ${e.message}`);
|
|
507
507
|
}
|
|
508
508
|
else l = r;
|
|
509
|
-
if (!
|
|
509
|
+
if (!nr(l)) return Tn(`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, lr(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 && Tn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, nr(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 && Tn(`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 && Tn("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 && Tn(`${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 (ur(e)) return Tn("gclass_name EMPTY"), null;
|
|
542
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Tn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
543
|
+
if (Oe(e)) return Tn(`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] ? Tn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : Tn("gclass_name undefined") : Tn("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 (ur(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
|
+
ur(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 (!ur(n)) {
|
|
562
|
+
if (ve(c, n)) return Tn(`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 (lr(e)) t = e;
|
|
575
575
|
else {
|
|
576
|
-
if (!(e instanceof O)) return
|
|
576
|
+
if (!(e instanceof O)) return Tn("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 ? (Tn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (Tn(`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) ? (Tn(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (Tn("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 Tn("Cannot add state, typeof not GClass"), -1;
|
|
603
|
+
if (ur(t)) return Tn("state_name EMPTY"), -1;
|
|
604
604
|
let o = pe(e, t);
|
|
605
|
-
return o ? me(o, n) ? (
|
|
605
|
+
return o ? me(o, n) ? (Tn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (Tn(`state not found: ${t}`), -1);
|
|
606
606
|
}
|
|
607
607
|
function Ee(e, t, n) {
|
|
608
|
-
|
|
608
|
+
ur(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) : (Tn("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 Tn("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 Tn("Cannot add state, typeof not GClass"), -1;
|
|
624
624
|
let t = 0;
|
|
625
|
-
|
|
625
|
+
er(e.dl_states) || (Tn(`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 (!ur(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
629
629
|
let l = r.dl_actions[n];
|
|
630
|
-
|
|
630
|
+
ur(l.event_name) || (ve(e, l.event_name) || (Tn(`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) || (Tn(`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 (!ur(r.event_name) && (or(r.event_flag) || (Tn(`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
|
+
ur(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
640
640
|
}
|
|
641
|
-
n || (
|
|
641
|
+
n || (Tn(`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 && Tn(`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 (!lr(e)) return Tn(`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 && Tn(`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] && Tn(`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 && Tn(`_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 = ll(e.dl_children, t);
|
|
670
|
+
n >= 0 && (Xn(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 : (Tn(`${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 && Tn(`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 Tn("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 && vn(`${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 && (Tn(`${et(e)} json2data() FAILED`), Gn(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 Tn("__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 Tn("gobj NEEDS a parent!"), null;
|
|
696
|
+
if (!("string" == typeof l || l instanceof S)) return Tn(`BAD TYPE of parent: ${l}`), null;
|
|
697
|
+
if (lr(l)) {
|
|
698
698
|
const e = l;
|
|
699
|
-
if (!(l = we(e))) return
|
|
699
|
+
if (!(l = we(e))) return vn(`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 Tn(`service ALREADY registered: ${t}^${e}`), null;
|
|
703
703
|
if (o & N.gobj_flag_default_service) {
|
|
704
|
-
if (m) return
|
|
704
|
+
if (m) return Tn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
705
705
|
o |= N.gobj_flag_service;
|
|
706
706
|
}
|
|
707
|
-
if (
|
|
707
|
+
if (ur(t)) return Tn("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 Tn(`GClass not registered: ${t}^${e}`), null;
|
|
710
|
+
if (!lr(e)) return Tn(`gobj_name must be a string: ${t}`), null;
|
|
711
|
+
if (!ur(e)) {
|
|
712
|
+
if (e.includes("`")) return Tn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
713
|
+
if (e.includes("^")) return Tn(`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 Tn("gobj NULL or DESTROYED");
|
|
726
|
+
e.__refs__ > 0 && Tn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Tn(`Destroying a PLAYING gobj: ${tt(e)}`), xe(e)), e.running && (Tn(`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] : Tn(`"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 Tn("gobj NULL or DESTROYED"), -1;
|
|
747
|
+
if (e.running) return Tn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
748
|
+
if (e.disabled) return Tn(`${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 Tn("gobj NULL or DESTROYED"), -1;
|
|
761
|
+
if (!e.running) return Tn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
762
|
+
e.playing && (vn(`${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) ? (Tn("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 Tn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
774
|
+
if (e.playing) return Tn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
775
|
+
if (e.disabled) return Tn(`${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 Tn(`${et(e)}: Cannot play, start not done`), -1;
|
|
778
|
+
vn(`${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) ? (Tn("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) : (Tn(`${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 ar(e) ? e.gobj_name : (Tn("gobj bad type"), null);
|
|
816
816
|
}
|
|
817
817
|
function Ze(e) {
|
|
818
|
-
return
|
|
818
|
+
return ar(e) ? e.gclass.gclass_name : (Tn("gobj NULL of bad type"), null);
|
|
819
819
|
}
|
|
820
820
|
function et(e) {
|
|
821
|
-
return
|
|
821
|
+
return ar(e) ? e.gclass.gclass_name + "^" + Xe(e) : (Tn("gobj bad type"), null);
|
|
822
822
|
}
|
|
823
823
|
function tt(e) {
|
|
824
|
-
if (!
|
|
824
|
+
if (!ar(e)) return Tn("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 ar(e) ? e.parent : (Tn("gobj NULL of bad type"), null);
|
|
831
831
|
}
|
|
832
832
|
function rt(e) {
|
|
833
|
-
return
|
|
833
|
+
return ar(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (Tn("gobj NULL of bad type"), null);
|
|
834
834
|
}
|
|
835
835
|
function lt(e) {
|
|
836
|
-
return
|
|
836
|
+
return ar(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (Tn("gobj NULL of bad type"), null);
|
|
837
837
|
}
|
|
838
838
|
function ot(e) {
|
|
839
|
-
return !
|
|
839
|
+
return !ar(e) || !!(e.obflag & ($.obflag_destroyed | $.obflag_destroying));
|
|
840
840
|
}
|
|
841
841
|
function st(e) {
|
|
842
|
-
return
|
|
842
|
+
return ar(e) ? e.bottom_gobj : (Tn("gobj NULL of bad type"), null);
|
|
843
843
|
}
|
|
844
844
|
function it(e, t) {
|
|
845
|
-
if (!
|
|
846
|
-
e.bottom_gobj && t &&
|
|
845
|
+
if (!ar(e)) return Tn("gobj NULL of bad type"), null;
|
|
846
|
+
e.bottom_gobj && t && vn(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
847
847
|
}
|
|
848
848
|
function _t(e, t, n) {
|
|
849
|
-
return
|
|
849
|
+
return ar(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (Tn("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) ? (Tn("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) ? (Tn("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 || Tn(`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 (!ar(e)) return Tn("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 Tn("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 !ur(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 Tn(`${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 = Bn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Bn(e.jn_attrs, o.name))), qn(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 === gr(t, "__disabled__")) return Ye(e);
|
|
964
|
+
if (0 === gr(t, "__running__")) return Ke(e);
|
|
965
|
+
if (0 === gr(t, "__playing__")) return Je(e);
|
|
966
|
+
if (0 === gr(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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
970
970
|
}
|
|
971
971
|
function vt(e, t) {
|
|
972
|
-
t &&
|
|
972
|
+
t && gr(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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${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 === gr(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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${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 ? Bn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Tn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
984
984
|
}
|
|
985
985
|
function St(e, t, r, l) {
|
|
986
|
-
if (!
|
|
986
|
+
if (!lr(t)) return Tn(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, nr(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) : (Tn(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, nr(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 Tn(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] = cr(n), nr(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) : (Tn(`${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), nr(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) : (Tn(`${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), nr(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) : (Tn(`${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 Tn("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 Tn(`${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 ar(e) ? e.current_state.state_name : (Tn("hgobj NULL"), "");
|
|
1039
1039
|
}
|
|
1040
1040
|
function At(e, t, n) {
|
|
1041
|
-
if (!
|
|
1041
|
+
if (!ar(e)) return Tn("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) ? (Tn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : ur(t) ? (Tn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (Tn(`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) : (Tn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (Tn(`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 Tn("gobj dst NULL"), -1;
|
|
1090
|
+
if (e.obflag & ($.obflag_destroyed | $.obflag_destroying)) return Tn("gobj dst DESTROYED"), -1;
|
|
1091
1091
|
let o = e.current_state;
|
|
1092
|
-
if (!o) return
|
|
1092
|
+
if (!o) return Tn(`${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) && Zn(r) && Gn(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))), Tn(`📛📛 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 = sl(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) && Zn(r) && Gn(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
|
+
Tn(`${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 || "", or(_) ? _ : 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 (!nr(n) || !pr(n, "__hard_subscription__") && !pr(n, "__own_event__") && !pr(n, "__rename_event_name__")) return {
|
|
1152
1152
|
kw: e,
|
|
1153
1153
|
renamed_event: ""
|
|
1154
1154
|
};
|
|
1155
|
-
let r =
|
|
1155
|
+
let r = xn({}, e), l = xn({}, 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 || ur(s) ? null : Mt(s);
|
|
1158
|
+
return i && (o = i.event_name, delete l.__rename_event_name__, t && tr(r.__global__) > 0 && (r.__global__ = xn(xn({}, 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 = wr(t, l, "__config__", null), i = wr(t, l, "__global__", null), _ = wr(t, l, "__local__", null), a = Nr(t, l, "__filter__", null), u = !0;
|
|
1165
|
+
if (t && t !== Sr(null, e, "publisher", null) && (u = !1), o && o !== Sr(null, e, "subscriber", null) && (u = !1), n && n !== Or(null, e, "event", "") && (u = !1), r && r !== Or(null, e, "renamed_event", "") && (u = !1), tr(s) > 0) {
|
|
1166
|
+
let t = wr(null, e, "__config__", null);
|
|
1167
|
+
tr(t) > 0 && Wn(t, s) || (u = !1);
|
|
1168
1168
|
}
|
|
1169
|
-
if (
|
|
1170
|
-
let t =
|
|
1171
|
-
|
|
1169
|
+
if (tr(i) > 0) {
|
|
1170
|
+
let t = wr(null, e, "__global__", null);
|
|
1171
|
+
tr(t) > 0 && Wn(t, i) || (u = !1);
|
|
1172
1172
|
}
|
|
1173
|
-
if (
|
|
1174
|
-
let t =
|
|
1175
|
-
|
|
1173
|
+
if (tr(_) > 0) {
|
|
1174
|
+
let t = wr(null, e, "__local__", null);
|
|
1175
|
+
tr(t) > 0 && Wn(t, _) || (u = !1);
|
|
1176
1176
|
}
|
|
1177
|
-
if (
|
|
1178
|
-
let t =
|
|
1179
|
-
|
|
1177
|
+
if (tr(a) > 0) {
|
|
1178
|
+
let t = Nr(null, e, "__filter__", null);
|
|
1179
|
+
tr(t) > 0 && Wn(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) && zn(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 = Sr(e, t, "publisher", null, Zt.KW_REQUIRED), s = Sr(e, t, "subscriber", null, Zt.KW_REQUIRED), i = Or(e, t, "event", "", Zt.KW_REQUIRED);
|
|
1196
|
+
if (!!(jr(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))), Sn(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 ? Xn(o.dl_subscriptions, a) : (Tn(`${et(e)}: subscription in publisher not found`), Sn(t)), a = Bt(s.dl_subscribings, t), a >= 0 ? Xn(s.dl_subscribings, a) : (Tn(`${et(e)}: subscription in subscriber not found`), Sn(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 Tn(`publisher NULL: ev ${t}`), 0;
|
|
1205
|
+
if (!l) return Tn(`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) || Tn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1215
|
+
}), ur(t)) t = "";
|
|
1216
|
+
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return Tn(`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 (jr(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 vn(`${et(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${t}, subscriber: ${et(l)})`), _;
|
|
1223
|
+
er(i) > 0 && (Tn(`${et(e)}: ${er(i)} subscription(s) REPEATED, will be deleted and override`), Sn(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
|
+
Hn(l, "event", t), Hn(l, "subscriber", r), Hn(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 = wr(e, n, "__config__", null), s = wr(e, n, "__global__", null), i = wr(e, n, "__local__", null), _ = Nr(e, n, "__filter__", null), a = Or(e, n, "__service__", "");
|
|
1230
|
+
if (tr(s) > 0 && Hn(l, "__global__", Mn(s)), tr(r) > 0) {
|
|
1231
|
+
let n = Mn(r);
|
|
1232
|
+
Hn(l, "__config__", n);
|
|
1233
|
+
let s = Or(e, n, "__rename_event_name__", "");
|
|
1234
|
+
if (!ur(s)) {
|
|
1235
1235
|
let r = Mt(s);
|
|
1236
1236
|
if (r) {
|
|
1237
|
-
|
|
1238
|
-
let s =
|
|
1239
|
-
|
|
1240
|
-
} else
|
|
1237
|
+
Hn(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= Gt.__rename_event_name__;
|
|
1238
|
+
let s = wr(e, l, "__global__", null);
|
|
1239
|
+
nr(s) || (s = {}, Hn(l, "__global__", s)), s.__original_event_name__ = t;
|
|
1240
|
+
} else Tn(`${et(e)}: EVENT NOT FOUND (__rename_event_name__: ${s})`);
|
|
1241
1241
|
}
|
|
1242
|
-
if (
|
|
1243
|
-
let t =
|
|
1244
|
-
|
|
1242
|
+
if (pr(n, "__hard_subscription__")) {
|
|
1243
|
+
let t = vr(e, n, "__hard_subscription__", !1);
|
|
1244
|
+
Jn(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1245
1245
|
}
|
|
1246
|
-
if (
|
|
1247
|
-
let t =
|
|
1248
|
-
|
|
1246
|
+
if (pr(n, "__own_event__")) {
|
|
1247
|
+
let t = vr(e, n, "__own_event__", !1);
|
|
1248
|
+
Jn(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
|
-
|
|
1251
|
+
tr(i) > 0 && Hn(l, "__local__", Mn(i)), tr(_) > 0 && Hn(l, "__filter__", Mn(_)), ur(a) || Hn(l, "__service__", a);
|
|
1252
1252
|
}
|
|
1253
|
-
return
|
|
1253
|
+
return Hn(l, "subs_flag", o), l;
|
|
1254
1254
|
}(e, t, r, l);
|
|
1255
|
-
if (!a) return
|
|
1256
|
-
if (
|
|
1255
|
+
if (!a) return Tn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1256
|
+
if (zn(e.dl_subscriptions, a), zn(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)) && Gn(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 && vn(`${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 (nr(r) || (r = {}), !e || e.obflag & ($.obflag_destroyed | $.obflag_destroying)) return Tn("gobj NULL or DESTROYED"), -1;
|
|
1275
|
+
if (ur(t)) return Tn(`${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 Tn(`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) && Zn(r) && Gn(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 = Sr(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 = jr(e, a, "subs_flag", 0, Zt.KW_REQUIRED), f = Or(e, a, "event", "", Zt.KW_REQUIRED);
|
|
1294
|
+
if (ur(f) || 0 === gr(f, t)) {
|
|
1295
|
+
wr(e, a, "__config__", null, 0);
|
|
1296
|
+
let l = wr(e, a, "__global__", null, 0), s = wr(e, a, "__local__", null, 0), f = Nr(e, a, "__filter__", null, 0), g = a.renamed_event;
|
|
1297
|
+
ur(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) : tr(f) > 0 && (d = kr(r, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), Sn(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
|
+
(tr(s) > 0 || tr(l) > 0) && (p = xn({}, r)), tr(s) > 0 && br(p, s), tr(l) > 0 && xn(p, Mn(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) && Zn(p) && Gn(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 || vn(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1314
1314
|
}
|
|
1315
1315
|
var Zt = Object.freeze({
|
|
1316
1316
|
KW_REQUIRED: 1,
|
|
@@ -1348,12 +1348,7 @@
|
|
|
1348
1348
|
function gn(e, t, n) {
|
|
1349
1349
|
fn || (function(e, t, n) {
|
|
1350
1350
|
let r = t;
|
|
1351
|
-
|
|
1352
|
-
r = JSON.stringify(t);
|
|
1353
|
-
} catch (e) {
|
|
1354
|
-
r = String(t);
|
|
1355
|
-
}
|
|
1356
|
-
_n.push([
|
|
1351
|
+
"json" === e && (r = pn(t)), _n.push([
|
|
1357
1352
|
e,
|
|
1358
1353
|
r,
|
|
1359
1354
|
n
|
|
@@ -1385,48 +1380,73 @@
|
|
|
1385
1380
|
}
|
|
1386
1381
|
}
|
|
1387
1382
|
function mn(e) {
|
|
1383
|
+
try {
|
|
1384
|
+
return String(e);
|
|
1385
|
+
} catch (t) {
|
|
1386
|
+
return pn(e);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
function hn(e, t) {
|
|
1390
|
+
try {
|
|
1391
|
+
return e(t);
|
|
1392
|
+
} catch (e) {
|
|
1393
|
+
return mn(t);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
function yn(e) {
|
|
1388
1397
|
const t = Array.prototype.slice.call(arguments);
|
|
1389
1398
|
let n = "";
|
|
1390
1399
|
if ("string" == typeof e) {
|
|
1391
1400
|
if (1 === t.length) return e;
|
|
1392
1401
|
let r = 1;
|
|
1393
|
-
n = e.replace(/%[
|
|
1402
|
+
n = e.replace(/%[sdifoOj%]/g, (e) => {
|
|
1403
|
+
if ("%%" === e) return "%";
|
|
1394
1404
|
const n = t[r++];
|
|
1395
1405
|
switch (e) {
|
|
1396
|
-
case "%s": return
|
|
1406
|
+
case "%s": return mn(n);
|
|
1397
1407
|
case "%d":
|
|
1398
|
-
case "%i": return parseInt
|
|
1399
|
-
case "%f": return parseFloat
|
|
1408
|
+
case "%i": return "bigint" == typeof n ? n.toString() : hn(parseInt, n);
|
|
1409
|
+
case "%f": return "bigint" == typeof n ? n.toString() : hn(parseFloat, n);
|
|
1410
|
+
case "%j": return pn(n);
|
|
1400
1411
|
case "%o":
|
|
1401
|
-
case "%O": return "object" == typeof n ? pn(n) :
|
|
1412
|
+
case "%O": return "object" == typeof n ? pn(n) : mn(n);
|
|
1402
1413
|
default: return e;
|
|
1403
1414
|
}
|
|
1404
1415
|
});
|
|
1405
|
-
const l = t.slice(r).map((e) => "object" == typeof e ? pn(e) :
|
|
1416
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? pn(e) : mn(e));
|
|
1406
1417
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1407
|
-
} else n = t.map((e) => "object" == typeof e ? pn(e) :
|
|
1418
|
+
} else n = t.map((e) => "object" == typeof e ? pn(e) : mn(e)).join(" ");
|
|
1408
1419
|
return n;
|
|
1409
1420
|
}
|
|
1410
|
-
function hn(e, ...t) {
|
|
1411
|
-
let n = mn(e, ...t), r = el();
|
|
1412
|
-
tn && (tn === en.error ? cn("error", n) && tn("%c" + r + " ERROR: " + String(n), "color:red") : (cn("error", n) && en.error("%c" + r + " ERROR: " + String(n), "color:red"), tn(`${r} ERROR: ${String(n)}`))), gn("error", n, r);
|
|
1413
|
-
}
|
|
1414
|
-
function yn(e, ...t) {
|
|
1415
|
-
let n = mn(e, ...t), r = el();
|
|
1416
|
-
nn && (nn === en.warn ? cn("warning", n) && nn("%c" + r + " WARNING: " + String(n), "color:yellow") : (cn("warning", n) && en.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), nn(`${r} WARNING: ${String(n)}`))), gn("warning", n, r);
|
|
1417
|
-
}
|
|
1418
1421
|
function En(e, ...t) {
|
|
1419
|
-
|
|
1420
|
-
|
|
1422
|
+
try {
|
|
1423
|
+
e(...t);
|
|
1424
|
+
} catch (e) {
|
|
1425
|
+
try {
|
|
1426
|
+
en.error("a log function threw:", e);
|
|
1427
|
+
} catch (e) {}
|
|
1428
|
+
}
|
|
1421
1429
|
}
|
|
1422
1430
|
function Tn(e, ...t) {
|
|
1423
|
-
let n =
|
|
1424
|
-
|
|
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
|
+
}
|
|
1434
|
+
function vn(e, ...t) {
|
|
1435
|
+
let n = yn(e, ...t), r = rl();
|
|
1436
|
+
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"), En(nn, `${r} WARNING: ${String(n)}`))), gn("warning", n, r);
|
|
1437
|
+
}
|
|
1438
|
+
function jn(e, ...t) {
|
|
1439
|
+
let n = yn(e, ...t), r = rl();
|
|
1440
|
+
ln && cn("debug", n) && En(ln, "%c" + r + " DEBUG: " + String(n), "color:silver"), gn("debug", n, r);
|
|
1425
1441
|
}
|
|
1426
|
-
function
|
|
1427
|
-
|
|
1442
|
+
function On(e, ...t) {
|
|
1443
|
+
let n = yn(e, ...t), r = rl();
|
|
1444
|
+
ln && cn("msg", n) && En(ln, "%c" + r + " MSG: " + String(n), "color:cyan"), gn("msg", n, r);
|
|
1428
1445
|
}
|
|
1429
|
-
|
|
1446
|
+
function Sn(e, t) {
|
|
1447
|
+
cn("json", t) && (t && En(en.warn, "=====> " + mn(t)), En(en.dir, e)), gn("json", e, rl());
|
|
1448
|
+
}
|
|
1449
|
+
var wn = [
|
|
1430
1450
|
"passw",
|
|
1431
1451
|
"pwd",
|
|
1432
1452
|
"passphrase",
|
|
@@ -1438,12 +1458,12 @@
|
|
|
1438
1458
|
"cookie",
|
|
1439
1459
|
"credential",
|
|
1440
1460
|
"salt"
|
|
1441
|
-
],
|
|
1461
|
+
], Nn = [
|
|
1442
1462
|
"apikey",
|
|
1443
1463
|
"sessionid",
|
|
1444
1464
|
"sessionkey",
|
|
1445
1465
|
"authdata"
|
|
1446
|
-
],
|
|
1466
|
+
], $n = /* @__PURE__ */ new Set([
|
|
1447
1467
|
"endpoint",
|
|
1448
1468
|
"url",
|
|
1449
1469
|
"uri",
|
|
@@ -1467,25 +1487,25 @@
|
|
|
1467
1487
|
"expires",
|
|
1468
1488
|
"mode"
|
|
1469
1489
|
]);
|
|
1470
|
-
function
|
|
1490
|
+
function Rn(e) {
|
|
1471
1491
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1472
1492
|
let t = e.toLowerCase(), n = !1;
|
|
1473
|
-
for (const e of
|
|
1493
|
+
for (const e of wn) if (t.indexOf(e) >= 0) {
|
|
1474
1494
|
n = !0;
|
|
1475
1495
|
break;
|
|
1476
1496
|
}
|
|
1477
1497
|
if (!n) {
|
|
1478
1498
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1479
|
-
for (const t of
|
|
1499
|
+
for (const t of Nn) if (e.indexOf(t) >= 0) {
|
|
1480
1500
|
n = !0;
|
|
1481
1501
|
break;
|
|
1482
1502
|
}
|
|
1483
1503
|
}
|
|
1484
1504
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1485
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1505
|
+
for (const e of t.split(/[_\-. \t]/)) if ($n.has(e)) return !1;
|
|
1486
1506
|
return !0;
|
|
1487
1507
|
}
|
|
1488
|
-
function
|
|
1508
|
+
function Dn(e, t, n) {
|
|
1489
1509
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1490
1510
|
let o = t;
|
|
1491
1511
|
for (;;) {
|
|
@@ -1501,12 +1521,12 @@
|
|
|
1501
1521
|
o = t;
|
|
1502
1522
|
}
|
|
1503
1523
|
}
|
|
1504
|
-
var
|
|
1505
|
-
function
|
|
1524
|
+
var kn = 128, An = 4194304, In = "<not shown: too large to mask>";
|
|
1525
|
+
function Cn(e) {
|
|
1506
1526
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1507
|
-
if (e.length >
|
|
1527
|
+
if (e.length > An) return In;
|
|
1508
1528
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1509
|
-
for (; null !== (t = r.exec(e));)
|
|
1529
|
+
for (; null !== (t = r.exec(e));) Rn(t[2].slice(-128)) && (n = !0);
|
|
1510
1530
|
let l = [], o = 0, s = !1, i = "", _ = 0, a = 0;
|
|
1511
1531
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1512
1532
|
for (; a < e.length;) {
|
|
@@ -1519,8 +1539,8 @@
|
|
|
1519
1539
|
a++;
|
|
1520
1540
|
continue;
|
|
1521
1541
|
}
|
|
1522
|
-
let r = e.substring(Math.max(_, a -
|
|
1523
|
-
if (_ = a + 1, !(
|
|
1542
|
+
let r = e.substring(Math.max(_, a - kn), a);
|
|
1543
|
+
if (_ = a + 1, !(Rn(r) || n && "value" === r.toLowerCase())) {
|
|
1524
1544
|
a++;
|
|
1525
1545
|
continue;
|
|
1526
1546
|
}
|
|
@@ -1529,18 +1549,18 @@
|
|
|
1529
1549
|
if (f) {
|
|
1530
1550
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1531
1551
|
e[c] === f && c++;
|
|
1532
|
-
} else c =
|
|
1552
|
+
} else c = Dn(e, a, i);
|
|
1533
1553
|
c > a && (l.push(e.substring(o, a)), l.push("********"), o = c, s = !0), a = c, _ = a;
|
|
1534
1554
|
}
|
|
1535
1555
|
return s ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1536
1556
|
}
|
|
1537
|
-
var
|
|
1538
|
-
var
|
|
1539
|
-
function
|
|
1557
|
+
var Ln = 64, Pn = "<not shown: the masking failed>";
|
|
1558
|
+
var Un = Symbol("mask-in-progress");
|
|
1559
|
+
function Fn(e, t, n, r) {
|
|
1540
1560
|
if ("string" == typeof e) {
|
|
1541
|
-
if (e.length > r.left) return r.left = 0,
|
|
1561
|
+
if (e.length > r.left) return r.left = 0, In;
|
|
1542
1562
|
r.left -= e.length;
|
|
1543
|
-
let t =
|
|
1563
|
+
let t = Cn(e);
|
|
1544
1564
|
return null !== t ? t : e;
|
|
1545
1565
|
}
|
|
1546
1566
|
let l = Array.isArray(e);
|
|
@@ -1549,13 +1569,13 @@
|
|
|
1549
1569
|
let t = Object.getPrototypeOf(e);
|
|
1550
1570
|
return t === Object.prototype || null === t;
|
|
1551
1571
|
}(e)) return e;
|
|
1552
|
-
if (r.left <= 0) return
|
|
1572
|
+
if (r.left <= 0) return In;
|
|
1553
1573
|
if (t.has(e)) {
|
|
1554
1574
|
let n = t.get(e);
|
|
1555
|
-
return n ===
|
|
1575
|
+
return n === Un ? "<cycle>" : n;
|
|
1556
1576
|
}
|
|
1557
|
-
if (n >=
|
|
1558
|
-
r.left -= 1, t.set(e,
|
|
1577
|
+
if (n >= Ln) return "<deeper not shown>";
|
|
1578
|
+
r.left -= 1, t.set(e, Un);
|
|
1559
1579
|
let o, s = !1, i = !1;
|
|
1560
1580
|
if (l) {
|
|
1561
1581
|
o = [];
|
|
@@ -1565,13 +1585,13 @@
|
|
|
1565
1585
|
break;
|
|
1566
1586
|
}
|
|
1567
1587
|
r.left -= 1;
|
|
1568
|
-
let _ =
|
|
1588
|
+
let _ = Fn(e[l], t, n + 1, r);
|
|
1569
1589
|
_ !== e[l] && (s = !0), o.push(_);
|
|
1570
1590
|
}
|
|
1571
|
-
i && o.push(
|
|
1591
|
+
i && o.push(In);
|
|
1572
1592
|
} else {
|
|
1573
1593
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1574
|
-
let l = "string" == typeof e.attribute &&
|
|
1594
|
+
let l = "string" == typeof e.attribute && Rn(e.attribute.slice(-128));
|
|
1575
1595
|
for (const _ in e) {
|
|
1576
1596
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1577
1597
|
if (r.left <= 0) {
|
|
@@ -1580,33 +1600,33 @@
|
|
|
1580
1600
|
}
|
|
1581
1601
|
r.left -= 1 + _.length;
|
|
1582
1602
|
let a, u = e[_];
|
|
1583
|
-
a = (
|
|
1603
|
+
a = (Rn(_.slice(-128)) || l && "value" === _) && null != u && "" !== u ? "********" : Fn(u, t, n + 1, r), a !== u && (s = !0), hr(o, _, a);
|
|
1584
1604
|
}
|
|
1585
|
-
i && (o["<more>"] =
|
|
1605
|
+
i && (o["<more>"] = In);
|
|
1586
1606
|
}
|
|
1587
1607
|
return s || i || (o = e), t.set(e, o), o;
|
|
1588
1608
|
}
|
|
1589
|
-
function
|
|
1609
|
+
function Vn(e) {
|
|
1590
1610
|
try {
|
|
1591
|
-
return
|
|
1611
|
+
return Fn(e, /* @__PURE__ */ new WeakMap(), 0, { left: An });
|
|
1592
1612
|
} catch (e) {
|
|
1593
|
-
return
|
|
1613
|
+
return Pn;
|
|
1594
1614
|
}
|
|
1595
1615
|
}
|
|
1596
|
-
function
|
|
1597
|
-
|
|
1616
|
+
function Gn(e, t) {
|
|
1617
|
+
Sn(Vn(e), t);
|
|
1598
1618
|
}
|
|
1599
|
-
function
|
|
1619
|
+
function Mn(e) {
|
|
1600
1620
|
return structuredClone(e);
|
|
1601
1621
|
}
|
|
1602
|
-
function
|
|
1622
|
+
function Wn(e, t) {
|
|
1603
1623
|
if (e === t) return !0;
|
|
1604
1624
|
if (null === e || null === t) return e === t;
|
|
1605
1625
|
if (typeof e != typeof t) return !1;
|
|
1606
1626
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1607
1627
|
if (Array.isArray(e)) {
|
|
1608
1628
|
if (e.length !== t.length) return !1;
|
|
1609
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1629
|
+
for (let n = 0; n < e.length; n++) if (!Wn(e[n], t[n])) return !1;
|
|
1610
1630
|
return !0;
|
|
1611
1631
|
}
|
|
1612
1632
|
if ("object" == typeof e) {
|
|
@@ -1614,118 +1634,118 @@
|
|
|
1614
1634
|
if (n.length !== r.length) return !1;
|
|
1615
1635
|
for (let l = 0; l < n.length; l++) {
|
|
1616
1636
|
if (n[l] !== r[l]) return !1;
|
|
1617
|
-
if (!
|
|
1637
|
+
if (!Wn(e[n[l]], t[r[l]])) return !1;
|
|
1618
1638
|
}
|
|
1619
1639
|
return !0;
|
|
1620
1640
|
}
|
|
1621
1641
|
return e === t;
|
|
1622
1642
|
}
|
|
1623
|
-
function
|
|
1643
|
+
function xn(e, t) {
|
|
1624
1644
|
if (!t) return e;
|
|
1625
|
-
for (let n of Object.keys(t))
|
|
1645
|
+
for (let n of Object.keys(t)) hr(e, n, t[n]);
|
|
1626
1646
|
return e;
|
|
1627
1647
|
}
|
|
1628
|
-
function
|
|
1648
|
+
function Kn(e, t) {
|
|
1629
1649
|
if (!t) return e;
|
|
1630
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
1650
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && hr(e, n, t[n]);
|
|
1631
1651
|
return e;
|
|
1632
1652
|
}
|
|
1633
|
-
function
|
|
1653
|
+
function Yn(e, t) {
|
|
1634
1654
|
if (!t) return e;
|
|
1635
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
1655
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && hr(e, n, t[n]);
|
|
1636
1656
|
return e;
|
|
1637
1657
|
}
|
|
1638
|
-
function
|
|
1658
|
+
function Bn(e, t) {
|
|
1639
1659
|
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1640
1660
|
}
|
|
1641
|
-
function
|
|
1661
|
+
function Jn(e, t) {
|
|
1642
1662
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1643
1663
|
}
|
|
1644
|
-
function
|
|
1645
|
-
|
|
1664
|
+
function qn(e, t, n) {
|
|
1665
|
+
hr(e, t, n);
|
|
1646
1666
|
}
|
|
1647
|
-
function
|
|
1648
|
-
|
|
1667
|
+
function Hn(e, t, n) {
|
|
1668
|
+
hr(e, t, n);
|
|
1649
1669
|
}
|
|
1650
|
-
function
|
|
1670
|
+
function zn(e, t) {
|
|
1651
1671
|
e.push(t);
|
|
1652
1672
|
}
|
|
1653
|
-
function
|
|
1673
|
+
function Qn(e, t) {
|
|
1654
1674
|
e.push(t);
|
|
1655
1675
|
}
|
|
1656
|
-
function
|
|
1676
|
+
function Xn(e, t) {
|
|
1657
1677
|
e.splice(t, 1);
|
|
1658
1678
|
}
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
1679
|
+
function Zn(e) {
|
|
1680
|
+
return nr(e) ? Object.keys(e).length : 0;
|
|
1661
1681
|
}
|
|
1662
|
-
function
|
|
1663
|
-
return
|
|
1682
|
+
function er(e) {
|
|
1683
|
+
return rr(e) ? e.length : 0;
|
|
1664
1684
|
}
|
|
1665
|
-
function
|
|
1666
|
-
return
|
|
1685
|
+
function tr(e) {
|
|
1686
|
+
return nr(e) ? Object.keys(e).length : rr(e) ? e.length : lr(e) && e.length > 0 ? 1 : 0;
|
|
1667
1687
|
}
|
|
1668
|
-
function
|
|
1688
|
+
function nr(e) {
|
|
1669
1689
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1670
1690
|
}
|
|
1671
|
-
function
|
|
1691
|
+
function rr(e) {
|
|
1672
1692
|
return Array.isArray(e);
|
|
1673
1693
|
}
|
|
1674
|
-
function
|
|
1694
|
+
function lr(e) {
|
|
1675
1695
|
return "string" == typeof e;
|
|
1676
1696
|
}
|
|
1677
|
-
function
|
|
1697
|
+
function or(e) {
|
|
1678
1698
|
return "number" == typeof e && Number.isFinite(e);
|
|
1679
1699
|
}
|
|
1680
|
-
function
|
|
1700
|
+
function sr(e) {
|
|
1681
1701
|
return "boolean" == typeof e;
|
|
1682
1702
|
}
|
|
1683
|
-
function
|
|
1703
|
+
function ir(e) {
|
|
1684
1704
|
return null == e;
|
|
1685
1705
|
}
|
|
1686
|
-
function
|
|
1706
|
+
function _r(e) {
|
|
1687
1707
|
return "function" == typeof e;
|
|
1688
1708
|
}
|
|
1689
|
-
function
|
|
1709
|
+
function ar(e) {
|
|
1690
1710
|
return e instanceof S;
|
|
1691
1711
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return !
|
|
1712
|
+
function ur(e) {
|
|
1713
|
+
return !lr(e) || 0 === e.length;
|
|
1694
1714
|
}
|
|
1695
|
-
function
|
|
1696
|
-
return
|
|
1715
|
+
function cr(e) {
|
|
1716
|
+
return or(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1697
1717
|
}
|
|
1698
|
-
function
|
|
1718
|
+
function fr(e, t) {
|
|
1699
1719
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1700
1720
|
}
|
|
1701
|
-
function
|
|
1721
|
+
function gr(e, t) {
|
|
1702
1722
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1703
1723
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1704
1724
|
}
|
|
1705
|
-
function
|
|
1706
|
-
if (
|
|
1707
|
-
if (
|
|
1725
|
+
function dr(e, t) {
|
|
1726
|
+
if (nr(e) || nr(t) || rr(e) || rr(t)) return 0;
|
|
1727
|
+
if (or(e) || or(t)) {
|
|
1708
1728
|
let n = Number(e), r = Number(t);
|
|
1709
1729
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1710
1730
|
}
|
|
1711
|
-
if (
|
|
1731
|
+
if (sr(e) || sr(t)) {
|
|
1712
1732
|
let n = Number(e), r = Number(t);
|
|
1713
1733
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1714
1734
|
}
|
|
1715
|
-
return
|
|
1735
|
+
return fr(String(e), String(t));
|
|
1716
1736
|
}
|
|
1717
|
-
function
|
|
1718
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1737
|
+
function br(e, t) {
|
|
1738
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) br(e, n);
|
|
1719
1739
|
else "string" == typeof t && delete e[t];
|
|
1720
1740
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1721
1741
|
}
|
|
1722
|
-
function
|
|
1742
|
+
function pr(e, t) {
|
|
1723
1743
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1724
1744
|
}
|
|
1725
|
-
function
|
|
1745
|
+
function mr(e, t) {
|
|
1726
1746
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1727
1747
|
}
|
|
1728
|
-
function
|
|
1748
|
+
function hr(e, t, n) {
|
|
1729
1749
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1730
1750
|
value: n,
|
|
1731
1751
|
writable: !0,
|
|
@@ -1733,205 +1753,205 @@
|
|
|
1733
1753
|
configurable: !0
|
|
1734
1754
|
}) : e[t] = n;
|
|
1735
1755
|
}
|
|
1736
|
-
function
|
|
1756
|
+
function yr(e, t) {
|
|
1737
1757
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
1738
1758
|
const n = Number(t);
|
|
1739
1759
|
return n >= e.length ? -1 : n;
|
|
1740
1760
|
}
|
|
1741
|
-
function
|
|
1742
|
-
e && !
|
|
1761
|
+
function Er(e, t, n, r) {
|
|
1762
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1743
1763
|
const l = e ? `${et(e)}: ` : "";
|
|
1744
|
-
if (!
|
|
1745
|
-
if (!
|
|
1764
|
+
if (!nr(t) && !rr(t)) return void Tn(`${l}kw must be list or dict: '${String(n)}'`);
|
|
1765
|
+
if (!lr(n)) return void Tn(`${l}path must be a string: ${String(n)}`);
|
|
1746
1766
|
let o = n.split("`"), s = o.length;
|
|
1747
1767
|
for (let e = 0; e < s; e++) {
|
|
1748
|
-
if (
|
|
1749
|
-
const s =
|
|
1750
|
-
if (s < 0) return void (r &&
|
|
1768
|
+
if (rr(t)) {
|
|
1769
|
+
const s = yr(t, o[e]);
|
|
1770
|
+
if (s < 0) return void (r && Tn(`${l}path not found: '${n}'`));
|
|
1751
1771
|
o[e] = String(s);
|
|
1752
1772
|
}
|
|
1753
|
-
if (
|
|
1773
|
+
if (mr(t, o[e])) return void (r && Tn(`${l}path not found: '${n}'`));
|
|
1754
1774
|
if (e === s - 1) break;
|
|
1755
|
-
if (null == (t = t[o[e]])) return void (r &&
|
|
1756
|
-
if (!
|
|
1775
|
+
if (null == (t = t[o[e]])) return void (r && Tn(`${l}path not found: '${n}'`));
|
|
1776
|
+
if (!nr(t) && !rr(t)) return void Tn(`${l}kw must be list or dict: '${n}'`);
|
|
1757
1777
|
}
|
|
1758
1778
|
let i = t[o[s - 1]];
|
|
1759
|
-
return void 0 === i && r &&
|
|
1779
|
+
return void 0 === i && r && Tn(`${l}path not found: '${n}'`), i;
|
|
1760
1780
|
}
|
|
1761
|
-
function
|
|
1762
|
-
e && !
|
|
1781
|
+
function Tr(e, t, n) {
|
|
1782
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1763
1783
|
const r = e ? et(e) + ": " : "";
|
|
1764
|
-
if (!
|
|
1784
|
+
if (!lr(n)) return Tn(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
1765
1785
|
let [l, o] = function(e, t) {
|
|
1766
1786
|
let n = e.lastIndexOf(t);
|
|
1767
1787
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1768
1788
|
}(n, "`"), s = t;
|
|
1769
|
-
if (
|
|
1770
|
-
else if (s =
|
|
1771
|
-
return
|
|
1789
|
+
if (ur(o)) o = n;
|
|
1790
|
+
else if (s = Er(e, t, l, !0), void 0 === s) return -1;
|
|
1791
|
+
return rr(s) ? (Tn(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : nr(s) && Object.prototype.hasOwnProperty.call(s, o) ? (delete s[o], 0) : (Tn(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
1772
1792
|
}
|
|
1773
|
-
function
|
|
1774
|
-
e && !
|
|
1775
|
-
let o =
|
|
1793
|
+
function vr(e, t, n, r, l) {
|
|
1794
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1795
|
+
let o = Er(e, t, n, !1);
|
|
1776
1796
|
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;
|
|
1777
1797
|
if (void 0 === o) {
|
|
1778
1798
|
if (i && t) {
|
|
1779
1799
|
let l = Boolean(r);
|
|
1780
|
-
return
|
|
1800
|
+
return $r(e, t, n, l), l;
|
|
1781
1801
|
}
|
|
1782
|
-
return s && (
|
|
1802
|
+
return s && (Tn(`path not found: '${n}'`), Gn(t)), Boolean(r);
|
|
1783
1803
|
}
|
|
1784
1804
|
let u;
|
|
1785
|
-
if (
|
|
1786
|
-
else if (a &&
|
|
1787
|
-
else if (a &&
|
|
1805
|
+
if (sr(o)) u = o;
|
|
1806
|
+
else if (a && or(o)) u = 0 !== o;
|
|
1807
|
+
else if (a && lr(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
1788
1808
|
else {
|
|
1789
|
-
if (!a || null !== o) return a ? (
|
|
1809
|
+
if (!a || null !== o) return a ? (Tn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Gn(t), !1) : (Tn(`${e ? et(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), Gn(t), Boolean(r));
|
|
1790
1810
|
u = !1;
|
|
1791
1811
|
}
|
|
1792
|
-
return _ &&
|
|
1812
|
+
return _ && Tr(e, t, n), u;
|
|
1793
1813
|
}
|
|
1794
|
-
function
|
|
1795
|
-
e && !
|
|
1796
|
-
let o =
|
|
1814
|
+
function jr(e, t, n, r, l) {
|
|
1815
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1816
|
+
let o = Er(e, t, n, !1);
|
|
1797
1817
|
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;
|
|
1798
1818
|
if (void 0 === o) {
|
|
1799
1819
|
if (i && t) {
|
|
1800
1820
|
let l = parseInt(r);
|
|
1801
|
-
return
|
|
1821
|
+
return $r(e, t, n, l), l;
|
|
1802
1822
|
}
|
|
1803
|
-
return s && (
|
|
1823
|
+
return s && (Tn(`path not found: '${n}'`), Gn(t)), parseInt(r);
|
|
1804
1824
|
}
|
|
1805
1825
|
let u;
|
|
1806
|
-
if (
|
|
1826
|
+
if (or(o)) u = Math.trunc(o);
|
|
1807
1827
|
else {
|
|
1808
|
-
if (!a) return
|
|
1809
|
-
if (
|
|
1810
|
-
else if (
|
|
1828
|
+
if (!a) return Tn(`${e ? et(e) + ": " : ""}path MUST BE a json integer: '${n}'`), Gn(t), parseInt(r);
|
|
1829
|
+
if (sr(o)) u = o ? 1 : 0;
|
|
1830
|
+
else if (lr(o)) u = function(e) {
|
|
1811
1831
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1812
1832
|
if (!t) return 0;
|
|
1813
1833
|
let n, r = t[2];
|
|
1814
1834
|
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;
|
|
1815
1835
|
}(o);
|
|
1816
1836
|
else {
|
|
1817
|
-
if (null !== o) return
|
|
1837
|
+
if (null !== o) return Tn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Gn(t), 0;
|
|
1818
1838
|
u = 0;
|
|
1819
1839
|
}
|
|
1820
1840
|
}
|
|
1821
|
-
return _ &&
|
|
1841
|
+
return _ && Tr(e, t, n), u;
|
|
1822
1842
|
}
|
|
1823
|
-
function
|
|
1824
|
-
e && !
|
|
1825
|
-
let o =
|
|
1843
|
+
function Or(e, t, n, r, l) {
|
|
1844
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1845
|
+
let o = Er(e, t, n, !1);
|
|
1826
1846
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1827
|
-
return void 0 === o ? i && t ? (
|
|
1828
|
-
let n =
|
|
1847
|
+
return void 0 === o ? i && t ? ($r(e, t, n, lr(r) ? r : null), r) : (s && !function(e, t) {
|
|
1848
|
+
let n = lr(t) ? t.split("`") : [], r = e;
|
|
1829
1849
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1830
|
-
if (!
|
|
1850
|
+
if (!nr(r) && !rr(r)) return !1;
|
|
1831
1851
|
r = r[n[e]];
|
|
1832
1852
|
}
|
|
1833
|
-
return !(!
|
|
1834
|
-
}(t, n) && (
|
|
1853
|
+
return !(!nr(r) && !rr(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
1854
|
+
}(t, n) && (Tn(`path not found: '${n}'`), Gn(t)), r) : lr(o) ? (_ && Tr(e, t, n), o) : (null !== o && (Tn(`${e ? et(e) + ": " : ""}path MUST BE a json str: '${n}'`), Gn(t)), r);
|
|
1835
1855
|
}
|
|
1836
|
-
function
|
|
1837
|
-
e && !
|
|
1838
|
-
let o =
|
|
1856
|
+
function Sr(e, t, n, r, l) {
|
|
1857
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1858
|
+
let o = Er(e, t, n, !1);
|
|
1839
1859
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1840
1860
|
if (void 0 === o) {
|
|
1841
1861
|
if (i) {
|
|
1842
1862
|
let l = r;
|
|
1843
|
-
return
|
|
1863
|
+
return $r(e, t, n, l), l;
|
|
1844
1864
|
}
|
|
1845
|
-
return s && (
|
|
1865
|
+
return s && (Tn(`path not found: '${n}'`), Gn(t)), r;
|
|
1846
1866
|
}
|
|
1847
|
-
return _ &&
|
|
1867
|
+
return _ && Tr(e, t, n), o;
|
|
1848
1868
|
}
|
|
1849
|
-
function
|
|
1850
|
-
e && !
|
|
1851
|
-
let o =
|
|
1869
|
+
function wr(e, t, n, r, l) {
|
|
1870
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1871
|
+
let o = Er(e, t, n, !1);
|
|
1852
1872
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1853
|
-
return void 0 === o ? i &&
|
|
1873
|
+
return void 0 === o ? i && nr(r) && t ? ($r(e, t, n, r), r) : (s && (Tn(`path not found: '${n}'`), Gn(t)), r) : nr(o) ? (_ && Tr(e, t, n), o) : i && null === o && nr(r) ? ($r(e, t, n, r), r) : i && null === o ? (s && (Tn(`path not found: '${n}'`), Gn(t)), r) : ((s || i) && (Tn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (i ? ", cannot create" : "")), Gn(t)), r);
|
|
1854
1874
|
}
|
|
1855
|
-
function
|
|
1856
|
-
e && !
|
|
1857
|
-
let o =
|
|
1875
|
+
function Nr(e, t, n, r, l) {
|
|
1876
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1877
|
+
let o = Er(e, t, n, !1);
|
|
1858
1878
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1859
1879
|
if (void 0 === o) {
|
|
1860
1880
|
if (i) {
|
|
1861
1881
|
let l = r;
|
|
1862
|
-
return
|
|
1882
|
+
return $r(e, t, n, l), l;
|
|
1863
1883
|
}
|
|
1864
|
-
return s && (
|
|
1884
|
+
return s && (Tn(`path not found: '${n}'`), Gn(t)), r;
|
|
1865
1885
|
}
|
|
1866
|
-
return _ &&
|
|
1886
|
+
return _ && Tr(e, t, n), o;
|
|
1867
1887
|
}
|
|
1868
|
-
function
|
|
1869
|
-
if (e && !
|
|
1870
|
-
if (!
|
|
1871
|
-
if ("" === n) return
|
|
1872
|
-
if (n.split("`").includes("")) return
|
|
1888
|
+
function $r(e, t, n, r) {
|
|
1889
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !nr(t)) return Tn("kw is not an object"), -1;
|
|
1890
|
+
if (!lr(n)) return Tn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
1891
|
+
if ("" === n) return Tn((e ? et(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
1892
|
+
if (n.split("`").includes("")) return Tn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
1873
1893
|
let l = n.split("`"), o = l.length;
|
|
1874
1894
|
for (let s = 0; s < o; s++) {
|
|
1875
1895
|
let i = l[s];
|
|
1876
|
-
if (
|
|
1877
|
-
const r =
|
|
1878
|
-
if (r < 0) return
|
|
1896
|
+
if (rr(t)) {
|
|
1897
|
+
const r = yr(t, i);
|
|
1898
|
+
if (r < 0) return Tn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not an index of its list: '${n}'`), -1;
|
|
1879
1899
|
i = String(r);
|
|
1880
1900
|
}
|
|
1881
|
-
if (s === o - 1)
|
|
1901
|
+
if (s === o - 1) hr(t, i, r);
|
|
1882
1902
|
else {
|
|
1883
|
-
let r =
|
|
1884
|
-
if (void 0 === r)
|
|
1885
|
-
else if (!
|
|
1903
|
+
let r = mr(t, i) ? void 0 : t[i];
|
|
1904
|
+
if (void 0 === r) hr(t, i, {});
|
|
1905
|
+
else if (!nr(r) && !rr(r)) return Tn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not a dict or a list: '${n}'`), -1;
|
|
1886
1906
|
t = t[i];
|
|
1887
1907
|
}
|
|
1888
1908
|
}
|
|
1889
1909
|
return 0;
|
|
1890
1910
|
}
|
|
1891
|
-
function
|
|
1892
|
-
if (e && !
|
|
1893
|
-
let o =
|
|
1911
|
+
function Rr(e, t, n, r, l) {
|
|
1912
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !nr(t)) return Tn("kw is not an object"), -1;
|
|
1913
|
+
let o = Er(e, t, n, !1);
|
|
1894
1914
|
if (void 0 === o) {
|
|
1895
|
-
if (!
|
|
1915
|
+
if (!lr(n) || function(e, t) {
|
|
1896
1916
|
let n = t.split("`"), r = e;
|
|
1897
1917
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1898
|
-
if (
|
|
1899
|
-
const t =
|
|
1918
|
+
if (rr(r)) {
|
|
1919
|
+
const t = yr(r, n[e]);
|
|
1900
1920
|
if (t < 0) return !1;
|
|
1901
1921
|
r = r[t];
|
|
1902
1922
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
1903
1923
|
if (null == r) return !1;
|
|
1904
|
-
if (!
|
|
1924
|
+
if (!nr(r) && !rr(r)) return !0;
|
|
1905
1925
|
}
|
|
1906
1926
|
return !1;
|
|
1907
1927
|
}(t, n)) return -1;
|
|
1908
|
-
if (o = {},
|
|
1928
|
+
if (o = {}, $r(e, t, n, o) < 0) return -1;
|
|
1909
1929
|
}
|
|
1910
|
-
return
|
|
1930
|
+
return nr(o) ? (hr(o, r, l), 0) : (Tn(`subdict is not an object: '${n}'`), -1);
|
|
1911
1931
|
}
|
|
1912
|
-
function
|
|
1932
|
+
function Dr(e, t, r) {
|
|
1913
1933
|
let l = "", o = !1;
|
|
1914
|
-
if (
|
|
1934
|
+
if (rr(t)) {
|
|
1915
1935
|
o = !1;
|
|
1916
1936
|
for (let s = 0; s < t.length; s++) {
|
|
1917
1937
|
let i = t[s];
|
|
1918
|
-
if (l =
|
|
1938
|
+
if (l = ur(r) ? n("%s", r) : n("%s`%d", r, s), o = Dr(e, i, l), o) break;
|
|
1919
1939
|
}
|
|
1920
|
-
} else if (
|
|
1940
|
+
} else if (nr(t)) {
|
|
1921
1941
|
o = !0;
|
|
1922
1942
|
let s = Object.keys(t);
|
|
1923
1943
|
for (let i = 0; i < s.length; i++) {
|
|
1924
1944
|
let _ = s[i], a = t[_];
|
|
1925
|
-
if (l =
|
|
1926
|
-
if (o =
|
|
1945
|
+
if (l = ur(r) ? n("%s", _) : n("%s`%s", r, _), rr(a) || nr(a)) {
|
|
1946
|
+
if (o = Dr(e, a, l), !o) break;
|
|
1927
1947
|
continue;
|
|
1928
1948
|
}
|
|
1929
|
-
let u =
|
|
1930
|
-
if (void 0 === u && (u =
|
|
1949
|
+
let u = Nr(0, e, l, void 0, 0);
|
|
1950
|
+
if (void 0 === u && (u = Bn(e, l)), void 0 === u) {
|
|
1931
1951
|
o = !1;
|
|
1932
1952
|
break;
|
|
1933
1953
|
}
|
|
1934
|
-
if (0 !==
|
|
1954
|
+
if (0 !== dr(u, a)) {
|
|
1935
1955
|
o = !1;
|
|
1936
1956
|
break;
|
|
1937
1957
|
}
|
|
@@ -1939,59 +1959,59 @@
|
|
|
1939
1959
|
}
|
|
1940
1960
|
return o;
|
|
1941
1961
|
}
|
|
1942
|
-
function
|
|
1943
|
-
return 0 ===
|
|
1962
|
+
function kr(e, t) {
|
|
1963
|
+
return 0 === tr(t) || Dr(e, t, "");
|
|
1944
1964
|
}
|
|
1945
|
-
function
|
|
1946
|
-
e && !
|
|
1965
|
+
function Ar(e, t, n, r) {
|
|
1966
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
1947
1967
|
let l = {};
|
|
1948
|
-
if (
|
|
1968
|
+
if (lr(n) && !ur(n)) {
|
|
1949
1969
|
let o = n;
|
|
1950
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1951
|
-
} else if (
|
|
1970
|
+
Object.prototype.hasOwnProperty.call(t, o) ? hr(l, o, t[o]) : r && Tn(`${et(e)}: key not found: ${o}`);
|
|
1971
|
+
} else if (nr(n) && Zn(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? hr(l, o, t[o]) : r && Tn(`${et(e)}: key not found: ${o}`);
|
|
1952
1972
|
else {
|
|
1953
|
-
if (!(
|
|
1973
|
+
if (!(rr(n) && er(n) > 0)) return t;
|
|
1954
1974
|
for (let o = 0; o < n.length; o++) {
|
|
1955
1975
|
let s = n[o];
|
|
1956
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1976
|
+
Object.prototype.hasOwnProperty.call(t, s) ? hr(l, s, t[s]) : r && Tn(`${et(e)}: key not found: ${s}`);
|
|
1957
1977
|
}
|
|
1958
1978
|
}
|
|
1959
1979
|
return l;
|
|
1960
1980
|
}
|
|
1961
|
-
function
|
|
1981
|
+
function Ir(e, t, n, r) {
|
|
1962
1982
|
let l = {};
|
|
1963
|
-
if (!
|
|
1964
|
-
if (
|
|
1983
|
+
if (!nr(t)) return l;
|
|
1984
|
+
if (xn(l, t), lr(n) && !ur(n)) {
|
|
1965
1985
|
let o = n;
|
|
1966
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1967
|
-
} else if (
|
|
1986
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Jn(l, o) : r && Tn(`${et(e)}: key not found: ${o}`);
|
|
1987
|
+
} else if (nr(n) && Zn(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Jn(l, o) : r && Tn(`${et(e)}: key not found: ${o}`);
|
|
1968
1988
|
else {
|
|
1969
|
-
if (!(
|
|
1989
|
+
if (!(rr(n) && er(n) > 0)) return {};
|
|
1970
1990
|
for (let o = 0; o < n.length; o++) {
|
|
1971
1991
|
let s = n[o];
|
|
1972
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1992
|
+
Object.prototype.hasOwnProperty.call(t, s) ? Jn(l, s) : r && Tn(`${et(e)}: key not found: ${s}`);
|
|
1973
1993
|
}
|
|
1974
1994
|
}
|
|
1975
1995
|
return l;
|
|
1976
1996
|
}
|
|
1977
|
-
function
|
|
1997
|
+
function Cr(e, t, n = !1) {
|
|
1978
1998
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1979
1999
|
let r = window.localStorage.getItem(e);
|
|
1980
|
-
return null === r ? (n &&
|
|
2000
|
+
return null === r ? (n && Lr(e, t), t) : JSON.parse(r);
|
|
1981
2001
|
} catch (n) {
|
|
1982
2002
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1983
2003
|
}
|
|
1984
2004
|
}
|
|
1985
|
-
function
|
|
2005
|
+
function Lr(e, t) {
|
|
1986
2006
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1987
|
-
if (!e || void 0 === t) return
|
|
2007
|
+
if (!e || void 0 === t) return Tn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1988
2008
|
try {
|
|
1989
2009
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1990
2010
|
} catch (t) {
|
|
1991
|
-
return
|
|
2011
|
+
return Tn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1992
2012
|
}
|
|
1993
2013
|
}
|
|
1994
|
-
function
|
|
2014
|
+
function Pr(e) {
|
|
1995
2015
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1996
2016
|
window.localStorage.removeItem(e);
|
|
1997
2017
|
} catch (t) {
|
|
@@ -1999,46 +2019,46 @@
|
|
|
1999
2019
|
}
|
|
2000
2020
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2001
2021
|
}
|
|
2002
|
-
function
|
|
2003
|
-
if (
|
|
2004
|
-
if (
|
|
2022
|
+
function Ur(e, t) {
|
|
2023
|
+
if (ir(e) || ir(t)) return !0;
|
|
2024
|
+
if (rr(e)) {
|
|
2005
2025
|
if (0 === e.length) return !0;
|
|
2006
2026
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2007
|
-
} else if (
|
|
2027
|
+
} else if (nr(e)) {
|
|
2008
2028
|
if (0 === Object.keys(e).length) return !0;
|
|
2009
2029
|
for (let n in e) if (n === t) return !0;
|
|
2010
|
-
} else if (
|
|
2030
|
+
} else if (lr(e) && e === t) return !0;
|
|
2011
2031
|
return !1;
|
|
2012
2032
|
}
|
|
2013
|
-
function
|
|
2014
|
-
if (e && !
|
|
2015
|
-
l || (l =
|
|
2033
|
+
function Fr(e, t, n, r, l) {
|
|
2034
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return null;
|
|
2035
|
+
l || (l = kr);
|
|
2016
2036
|
let o = [];
|
|
2017
|
-
if (
|
|
2037
|
+
if (rr(t)) for (let s = 0; s < t.length; s++) {
|
|
2018
2038
|
let i, _ = t[s];
|
|
2019
|
-
if (
|
|
2039
|
+
if (nr(_)) i = Or(e, _, "id", "", 0);
|
|
2020
2040
|
else {
|
|
2021
|
-
if (!
|
|
2041
|
+
if (!lr(_)) continue;
|
|
2022
2042
|
i = _;
|
|
2023
2043
|
}
|
|
2024
|
-
|
|
2044
|
+
Ur(n, i) && l(_, r) && o.push(_);
|
|
2025
2045
|
}
|
|
2026
2046
|
else {
|
|
2027
|
-
if (!
|
|
2047
|
+
if (!nr(t)) return Tn("kw_collect() BAD kw parameter"), null;
|
|
2028
2048
|
for (let e of Object.keys(t)) {
|
|
2029
2049
|
let s = t[e];
|
|
2030
|
-
|
|
2050
|
+
Ur(n, e) && l(s, r) && o.push(s);
|
|
2031
2051
|
}
|
|
2032
2052
|
}
|
|
2033
2053
|
return o;
|
|
2034
2054
|
}
|
|
2035
|
-
function
|
|
2055
|
+
function Vr(e, t) {
|
|
2036
2056
|
if (!e) return -1;
|
|
2037
2057
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2038
2058
|
return -1;
|
|
2039
2059
|
}
|
|
2040
|
-
function
|
|
2041
|
-
if (!e || !t) return
|
|
2060
|
+
function Gr(e, t, n) {
|
|
2061
|
+
if (!e || !t) return Tn("ERROR: str_in_list() list or str empty"), !1;
|
|
2042
2062
|
let r = e.length;
|
|
2043
2063
|
if (n) {
|
|
2044
2064
|
t = t.toLowerCase();
|
|
@@ -2049,7 +2069,7 @@
|
|
|
2049
2069
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2050
2070
|
return !1;
|
|
2051
2071
|
}
|
|
2052
|
-
function
|
|
2072
|
+
function Mr(e, t) {
|
|
2053
2073
|
try {
|
|
2054
2074
|
let n = e.__md_iev__;
|
|
2055
2075
|
if (n) return n[t];
|
|
@@ -2057,35 +2077,35 @@
|
|
|
2057
2077
|
return;
|
|
2058
2078
|
}
|
|
2059
2079
|
}
|
|
2060
|
-
function
|
|
2080
|
+
function Wr(e, t, n) {
|
|
2061
2081
|
let r = e.__md_iev__;
|
|
2062
2082
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2063
2083
|
}
|
|
2064
|
-
function
|
|
2065
|
-
if (!
|
|
2084
|
+
function xr(e, t, n, r) {
|
|
2085
|
+
if (!ar(e)) return Tn("gobj is not a GObj"), null;
|
|
2066
2086
|
if (!t) return;
|
|
2067
|
-
let l =
|
|
2068
|
-
l || (l = [],
|
|
2087
|
+
let l = Mr(t, n);
|
|
2088
|
+
l || (l = [], Wr(t, n, l));
|
|
2069
2089
|
try {
|
|
2070
|
-
|
|
2090
|
+
rr(l) && l.unshift(r);
|
|
2071
2091
|
} catch (e) {
|
|
2072
|
-
|
|
2092
|
+
Tn(e);
|
|
2073
2093
|
}
|
|
2074
2094
|
}
|
|
2075
|
-
function
|
|
2076
|
-
if (!
|
|
2077
|
-
if (!
|
|
2078
|
-
let l =
|
|
2079
|
-
return l ? 0 === l.length ? (r &&
|
|
2095
|
+
function Kr(e, t, n, r) {
|
|
2096
|
+
if (!ar(e)) return Tn("gobj is not a GObj"), null;
|
|
2097
|
+
if (!nr(t)) return Tn("kw is not a dict"), null;
|
|
2098
|
+
let l = Mr(t, n);
|
|
2099
|
+
return l ? 0 === l.length ? (r && Tn(`stack empty: ${n}`), null) : l[0] : (r && Tn(`stack NOT FOUND: ${n}`), null);
|
|
2080
2100
|
}
|
|
2081
|
-
function
|
|
2082
|
-
return
|
|
2101
|
+
function Yr(e, t, n) {
|
|
2102
|
+
return ur(n) ? Tr(e, t, "__md_iev__`__msg_type__") : Rr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2083
2103
|
}
|
|
2084
|
-
function
|
|
2085
|
-
return
|
|
2104
|
+
function Br(e, t) {
|
|
2105
|
+
return Or(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2086
2106
|
}
|
|
2087
|
-
function
|
|
2088
|
-
void 0 !== n &&
|
|
2107
|
+
function Jr(e, t, n) {
|
|
2108
|
+
void 0 !== n && lr(n) || (n = "");
|
|
2089
2109
|
for (let r of Object.keys(e)) {
|
|
2090
2110
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2091
2111
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2094,10 +2114,10 @@
|
|
|
2094
2114
|
r,
|
|
2095
2115
|
e[r],
|
|
2096
2116
|
n
|
|
2097
|
-
]),
|
|
2117
|
+
]), nr(e[r]) && Jr(e[r], t, n), n = n.slice(0, -l.length);
|
|
2098
2118
|
}
|
|
2099
2119
|
}
|
|
2100
|
-
function
|
|
2120
|
+
function qr(e, t, n, r) {
|
|
2101
2121
|
if (!e) return null;
|
|
2102
2122
|
let l, o = e.length;
|
|
2103
2123
|
for (l = 0; l < o; l++) {
|
|
@@ -2105,15 +2125,15 @@
|
|
|
2105
2125
|
if (o) {
|
|
2106
2126
|
let e = o.id;
|
|
2107
2127
|
if (e && e === n) return o;
|
|
2108
|
-
if (r &&
|
|
2109
|
-
let e =
|
|
2128
|
+
if (r && pr(o, t)) {
|
|
2129
|
+
let e = qr(o[t], t, n, r);
|
|
2110
2130
|
if (e) return e;
|
|
2111
2131
|
}
|
|
2112
2132
|
}
|
|
2113
2133
|
}
|
|
2114
2134
|
return null;
|
|
2115
2135
|
}
|
|
2116
|
-
function
|
|
2136
|
+
function Hr(e) {
|
|
2117
2137
|
function t(e) {
|
|
2118
2138
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2119
2139
|
switch (t.length % 4) {
|
|
@@ -2144,10 +2164,10 @@
|
|
|
2144
2164
|
signature: t(n[2])
|
|
2145
2165
|
};
|
|
2146
2166
|
}
|
|
2147
|
-
function
|
|
2167
|
+
function zr(e) {
|
|
2148
2168
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2149
2169
|
}
|
|
2150
|
-
var
|
|
2170
|
+
var Qr = class {
|
|
2151
2171
|
constructor(e) {
|
|
2152
2172
|
this.html = e, Object.freeze(this);
|
|
2153
2173
|
}
|
|
@@ -2155,41 +2175,41 @@
|
|
|
2155
2175
|
return this.html;
|
|
2156
2176
|
}
|
|
2157
2177
|
};
|
|
2158
|
-
function
|
|
2159
|
-
return e instanceof
|
|
2178
|
+
function Xr(e) {
|
|
2179
|
+
return e instanceof Qr;
|
|
2160
2180
|
}
|
|
2161
|
-
function
|
|
2181
|
+
function Zr(e) {
|
|
2162
2182
|
const t = document.createElement("template");
|
|
2163
2183
|
return t.innerHTML = e.html.trim(), t.content;
|
|
2164
2184
|
}
|
|
2165
|
-
var
|
|
2166
|
-
function
|
|
2185
|
+
var el = !1, tl = /* @__PURE__ */ new Set();
|
|
2186
|
+
function nl(e) {
|
|
2167
2187
|
const t = document.createElement("template");
|
|
2168
2188
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2169
2189
|
}
|
|
2170
|
-
function
|
|
2190
|
+
function rl(e) {
|
|
2171
2191
|
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();
|
|
2172
2192
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2173
2193
|
}
|
|
2174
|
-
function
|
|
2194
|
+
function ll(e, t) {
|
|
2175
2195
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2176
2196
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2177
2197
|
return -1;
|
|
2178
2198
|
}
|
|
2179
|
-
function
|
|
2199
|
+
function ol() {
|
|
2180
2200
|
let e = "";
|
|
2181
2201
|
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;
|
|
2182
2202
|
}
|
|
2183
|
-
function
|
|
2203
|
+
function sl(e) {
|
|
2184
2204
|
let t = null;
|
|
2185
2205
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2186
2206
|
}
|
|
2187
|
-
var
|
|
2188
|
-
function
|
|
2207
|
+
var il = 256, _l = 1e5;
|
|
2208
|
+
function al(e) {
|
|
2189
2209
|
const t = String(e).replace(/`/g, "``");
|
|
2190
2210
|
return "[" === t[0] ? "[" + t : t;
|
|
2191
2211
|
}
|
|
2192
|
-
function
|
|
2212
|
+
function ul(e) {
|
|
2193
2213
|
if ("string" != typeof e) return null;
|
|
2194
2214
|
let t = [], n = "";
|
|
2195
2215
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2210,17 +2230,17 @@
|
|
|
2210
2230
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2211
2231
|
});
|
|
2212
2232
|
}
|
|
2213
|
-
function
|
|
2233
|
+
function cl(e, t) {
|
|
2214
2234
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2215
2235
|
}
|
|
2216
|
-
function
|
|
2236
|
+
function fl(e) {
|
|
2217
2237
|
return "persistent-attrs-" + et(e);
|
|
2218
2238
|
}
|
|
2219
|
-
function
|
|
2220
|
-
if (
|
|
2239
|
+
function gl(e, t) {
|
|
2240
|
+
if (lr(t)) {
|
|
2221
2241
|
if (-1 === t.indexOf("^")) {
|
|
2222
2242
|
let n, r, l = e.fkey;
|
|
2223
|
-
if (1 !==
|
|
2243
|
+
if (1 !== Zn(l)) return Tn("bad fkey 1"), Tn(e), Tn(t), null;
|
|
2224
2244
|
for (const e of Object.keys(l)) {
|
|
2225
2245
|
n = e, r = l[e];
|
|
2226
2246
|
break;
|
|
@@ -2233,20 +2253,20 @@
|
|
|
2233
2253
|
}
|
|
2234
2254
|
{
|
|
2235
2255
|
let n = t.split("^");
|
|
2236
|
-
return 3 !== n.length ? (
|
|
2256
|
+
return 3 !== n.length ? (Tn("bad fkey 2"), Tn(e), Tn(t), null) : {
|
|
2237
2257
|
topic_name: n[0],
|
|
2238
2258
|
id: n[1],
|
|
2239
2259
|
hook_name: n[2]
|
|
2240
2260
|
};
|
|
2241
2261
|
}
|
|
2242
2262
|
}
|
|
2243
|
-
return
|
|
2263
|
+
return nr(t) ? {
|
|
2244
2264
|
topic_name: t.topic_name,
|
|
2245
2265
|
id: t.id,
|
|
2246
2266
|
hook_name: t.hook_name
|
|
2247
|
-
} : (
|
|
2267
|
+
} : (Tn("bad fkey 3"), Tn(e), Tn(t), null);
|
|
2248
2268
|
}
|
|
2249
|
-
var
|
|
2269
|
+
var dl = [
|
|
2250
2270
|
"string",
|
|
2251
2271
|
"integer",
|
|
2252
2272
|
"object",
|
|
@@ -2256,7 +2276,7 @@
|
|
|
2256
2276
|
"real",
|
|
2257
2277
|
"boolean",
|
|
2258
2278
|
"blob"
|
|
2259
|
-
],
|
|
2279
|
+
], bl = [
|
|
2260
2280
|
"persistent",
|
|
2261
2281
|
"required",
|
|
2262
2282
|
"notnull",
|
|
@@ -2268,7 +2288,7 @@
|
|
|
2268
2288
|
"stats",
|
|
2269
2289
|
"rstats",
|
|
2270
2290
|
"pstats"
|
|
2271
|
-
],
|
|
2291
|
+
], pl = [
|
|
2272
2292
|
"hook",
|
|
2273
2293
|
"fkey",
|
|
2274
2294
|
"enum",
|
|
@@ -2297,7 +2317,7 @@
|
|
|
2297
2317
|
"coordinates",
|
|
2298
2318
|
"gbuffer"
|
|
2299
2319
|
];
|
|
2300
|
-
function
|
|
2320
|
+
function ml(e) {
|
|
2301
2321
|
let t = {
|
|
2302
2322
|
name: e.id,
|
|
2303
2323
|
header: e.header,
|
|
@@ -2316,7 +2336,7 @@
|
|
|
2316
2336
|
if (!e.flag) return t;
|
|
2317
2337
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2318
2338
|
let r = e.flag[n];
|
|
2319
|
-
if (
|
|
2339
|
+
if (Gr(pl, r)) {
|
|
2320
2340
|
switch (r) {
|
|
2321
2341
|
case "enum":
|
|
2322
2342
|
t.enum_list = e.enum;
|
|
@@ -2330,7 +2350,7 @@
|
|
|
2330
2350
|
case "file": t.is_file = !0;
|
|
2331
2351
|
}
|
|
2332
2352
|
t.type = r;
|
|
2333
|
-
} else if (
|
|
2353
|
+
} else if (Gr(bl, r)) switch (r) {
|
|
2334
2354
|
case "writable":
|
|
2335
2355
|
t.is_writable = !0;
|
|
2336
2356
|
break;
|
|
@@ -2343,23 +2363,23 @@
|
|
|
2343
2363
|
}
|
|
2344
2364
|
return t.is_file && (t.type = "file"), t;
|
|
2345
2365
|
}
|
|
2346
|
-
var
|
|
2366
|
+
var hl = [
|
|
2347
2367
|
j(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2348
2368
|
j(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2349
2369
|
j(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2350
2370
|
v()
|
|
2351
|
-
],
|
|
2371
|
+
], yl = {
|
|
2352
2372
|
periodic: !1,
|
|
2353
2373
|
msec: 0,
|
|
2354
2374
|
timer_id: -1
|
|
2355
|
-
},
|
|
2356
|
-
function
|
|
2375
|
+
}, El = null;
|
|
2376
|
+
function Tl(e, t, n, r) {
|
|
2357
2377
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2358
2378
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2359
2379
|
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2360
2380
|
}, 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;
|
|
2361
2381
|
}
|
|
2362
|
-
var
|
|
2382
|
+
var vl = {
|
|
2363
2383
|
mt_create: function(e) {
|
|
2364
2384
|
let t = e.priv;
|
|
2365
2385
|
const n = Ot(e, "subscriber");
|
|
@@ -2384,16 +2404,16 @@
|
|
|
2384
2404
|
},
|
|
2385
2405
|
mt_destroy: function(e) {}
|
|
2386
2406
|
};
|
|
2387
|
-
function
|
|
2388
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2407
|
+
function jl(e, t) {
|
|
2408
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (Tn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void $t(e, "msec", t)) : (Tn("not GObj TYPE"), -1);
|
|
2389
2409
|
}
|
|
2390
|
-
function
|
|
2391
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2410
|
+
function Ol(e, t) {
|
|
2411
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (Tn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void $t(e, "msec", t)) : (Tn("not GObj TYPE"), -1);
|
|
2392
2412
|
}
|
|
2393
|
-
function
|
|
2394
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2413
|
+
function Sl(e) {
|
|
2414
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (Tn("not C_TIMER GObj"), -1) : void $t(e, "msec", -1) : (Tn("not GObj TYPE"), -1);
|
|
2395
2415
|
}
|
|
2396
|
-
var
|
|
2416
|
+
var wl = [
|
|
2397
2417
|
j(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2398
2418
|
j(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2399
2419
|
j(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2413,63 +2433,63 @@
|
|
|
2413
2433
|
j(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2414
2434
|
j(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2415
2435
|
v()
|
|
2416
|
-
],
|
|
2417
|
-
function
|
|
2436
|
+
], Nl = { gobj_timer: null }, $l = null;
|
|
2437
|
+
function Rl(e, t, n, r) {
|
|
2418
2438
|
let l = yt(e, t);
|
|
2419
|
-
return
|
|
2439
|
+
return nr(l) || (l = {}), l[n] = r, St(e, t, l), De(e, t);
|
|
2420
2440
|
}
|
|
2421
|
-
function
|
|
2441
|
+
function Dl(e) {
|
|
2422
2442
|
if (!0 === e || !1 === e) return e;
|
|
2423
2443
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2424
2444
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2425
2445
|
}
|
|
2426
|
-
function
|
|
2446
|
+
function kl() {
|
|
2427
2447
|
return `${ze()}^${He()}`;
|
|
2428
2448
|
}
|
|
2429
|
-
function
|
|
2449
|
+
function Al(e, t, n, r) {
|
|
2430
2450
|
return Xt(e, t, n), 0;
|
|
2431
2451
|
}
|
|
2432
|
-
var
|
|
2452
|
+
var Il = {
|
|
2433
2453
|
mt_create: function(e) {
|
|
2434
2454
|
let t = e.priv;
|
|
2435
|
-
Rt(e, "start_date",
|
|
2455
|
+
Rt(e, "start_date", rl()), Rt(e, "node_uuid", ol()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = yt(e, "periodic_timeout"), function(e) {
|
|
2436
2456
|
let t = yt(e, "trace_levels");
|
|
2437
|
-
if (!
|
|
2457
|
+
if (!nr(t)) return 0;
|
|
2438
2458
|
let n = t.__global_trace__;
|
|
2439
|
-
if (
|
|
2459
|
+
if (rr(n)) {
|
|
2440
2460
|
Z(4294967295, !1);
|
|
2441
2461
|
for (let e of n) Q(e, !0);
|
|
2442
2462
|
}
|
|
2443
2463
|
for (const [n, r] of Object.entries(t)) {
|
|
2444
2464
|
let t = Oe(n);
|
|
2445
|
-
if (t) if (
|
|
2465
|
+
if (t) if (rr(r)) {
|
|
2446
2466
|
se(t, null, !1);
|
|
2447
2467
|
for (let e of r) se(t, e, !0);
|
|
2448
|
-
} else
|
|
2468
|
+
} else Tn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2449
2469
|
}
|
|
2450
2470
|
}(e), function(e) {
|
|
2451
2471
|
let t = yt(e, "no_trace_levels");
|
|
2452
|
-
if (!
|
|
2472
|
+
if (!nr(t)) return 0;
|
|
2453
2473
|
let n = t.__global_no_trace__;
|
|
2454
|
-
if (
|
|
2474
|
+
if (rr(n)) {
|
|
2455
2475
|
ee(4294967295, !1);
|
|
2456
2476
|
for (let e of n) X(e, !0);
|
|
2457
2477
|
}
|
|
2458
2478
|
for (const [n, r] of Object.entries(t)) {
|
|
2459
2479
|
let t = Oe(n);
|
|
2460
|
-
if (t) if (
|
|
2480
|
+
if (t) if (rr(r)) {
|
|
2461
2481
|
ie(t, null, !1);
|
|
2462
2482
|
for (let e of r) ie(t, e, !0);
|
|
2463
|
-
} else
|
|
2483
|
+
} else Tn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2464
2484
|
}
|
|
2465
2485
|
}(e);
|
|
2466
2486
|
},
|
|
2467
2487
|
mt_writing: function(e, t) {},
|
|
2468
2488
|
mt_start: function(e) {
|
|
2469
|
-
return
|
|
2489
|
+
return Ol(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2470
2490
|
},
|
|
2471
2491
|
mt_stop: function(e) {
|
|
2472
|
-
return
|
|
2492
|
+
return Sl(e.priv.gobj_timer), Me(e), 0;
|
|
2473
2493
|
},
|
|
2474
2494
|
mt_destroy: function(e) {},
|
|
2475
2495
|
mt_play: function(e) {
|
|
@@ -2486,24 +2506,24 @@
|
|
|
2486
2506
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2487
2507
|
case "set-global-trace":
|
|
2488
2508
|
case "set-global-no-trace": {
|
|
2489
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2490
|
-
return o ? null === s ? l(0, -1, `${
|
|
2509
|
+
let r = "set-global-no-trace" === t, o = n.level, s = Dl(n.set);
|
|
2510
|
+
return o ? null === s ? l(0, -1, `${kl()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${kl()}: global trace level not found: ${o}`, null, null) : r ? (Rl(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (Rl(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${kl()}: what level?`, null, null);
|
|
2491
2511
|
}
|
|
2492
2512
|
case "get-gclass-trace":
|
|
2493
2513
|
case "get-gclass-no-trace":
|
|
2494
2514
|
case "set-gclass-trace":
|
|
2495
2515
|
case "set-gclass-no-trace": {
|
|
2496
2516
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Oe(o);
|
|
2497
|
-
if (!s) return l(0, -1, `${
|
|
2517
|
+
if (!s) return l(0, -1, `${kl()}: what gclass is '${o}'?`, null, null);
|
|
2498
2518
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2499
|
-
let i = n.level, _ =
|
|
2500
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2519
|
+
let i = n.level, _ = Dl(n.set);
|
|
2520
|
+
return i ? null === _ ? l(0, -1, `${kl()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${kl()}: trace level of ${o} not found: ${i}`, null, null) : r ? (Rl(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (Rl(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${kl()}: what level?`, null, null);
|
|
2501
2521
|
}
|
|
2502
|
-
default: return l(0, -1, `${
|
|
2522
|
+
default: return l(0, -1, `${kl()}: command not available: ${t}`, null, null);
|
|
2503
2523
|
}
|
|
2504
2524
|
}
|
|
2505
2525
|
};
|
|
2506
|
-
var
|
|
2526
|
+
var Cl = "ievent_gate_stack", Ll = [
|
|
2507
2527
|
j(y.DTP_STRING, "wanted_yuno_role", E.SDF_RD, "", "wanted yuno role"),
|
|
2508
2528
|
j(y.DTP_STRING, "wanted_yuno_name", E.SDF_RD, "", "wanted yuno name"),
|
|
2509
2529
|
j(y.DTP_STRING, "wanted_yuno_service", E.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2520,15 +2540,15 @@
|
|
|
2520
2540
|
j(y.DTP_INTEGER, "timeout_idack", E.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2521
2541
|
j(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2522
2542
|
v()
|
|
2523
|
-
],
|
|
2543
|
+
], Pl = [
|
|
2524
2544
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2525
2545
|
["ievents2", "Trace inter-events with full kw"],
|
|
2526
2546
|
["identity-card", "Trace identity_card messages"]
|
|
2527
2547
|
];
|
|
2528
|
-
function
|
|
2548
|
+
function Ul(e) {
|
|
2529
2549
|
return !!(3 & x(e));
|
|
2530
2550
|
}
|
|
2531
|
-
var
|
|
2551
|
+
var Fl = {
|
|
2532
2552
|
url: null,
|
|
2533
2553
|
remote_yuno_name: null,
|
|
2534
2554
|
remote_yuno_role: null,
|
|
@@ -2538,23 +2558,23 @@
|
|
|
2538
2558
|
websocket: null,
|
|
2539
2559
|
inside_on_open: !1,
|
|
2540
2560
|
retry_ms: 0
|
|
2541
|
-
},
|
|
2542
|
-
function
|
|
2543
|
-
e.priv.websocket &&
|
|
2561
|
+
}, Vl = null;
|
|
2562
|
+
function Gl(e) {
|
|
2563
|
+
e.priv.websocket && Tn("Websocket ALREADY setup");
|
|
2544
2564
|
const t = jt(e, "url");
|
|
2545
|
-
|
|
2565
|
+
jn(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2546
2566
|
const n = ++e.priv.ws_seq;
|
|
2547
2567
|
let r;
|
|
2548
2568
|
try {
|
|
2549
2569
|
r = new WebSocket(t);
|
|
2550
2570
|
} catch (r) {
|
|
2551
|
-
return
|
|
2571
|
+
return Tn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), Ut(e, "EV_ON_CLOSE", {
|
|
2552
2572
|
url: t,
|
|
2553
2573
|
ws_seq: n,
|
|
2554
2574
|
code: 1006,
|
|
2555
2575
|
reason: r.message,
|
|
2556
2576
|
was_clean: !1
|
|
2557
|
-
}, e) < 0 &&
|
|
2577
|
+
}, e) < 0 && jl(e.priv.gobj_timer, Ql(e)), null;
|
|
2558
2578
|
}
|
|
2559
2579
|
return r ? (r.onopen = () => {
|
|
2560
2580
|
n !== e.priv.ws_seq || ot(e) || Vt(e, "EV_ON_OPEN", {
|
|
@@ -2567,69 +2587,69 @@
|
|
|
2567
2587
|
data: r.data
|
|
2568
2588
|
}, e);
|
|
2569
2589
|
}, r.onclose = (r) => {
|
|
2570
|
-
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ?
|
|
2590
|
+
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ? vn("Close websocket by unload page") : Vt(e, "EV_ON_CLOSE", {
|
|
2571
2591
|
url: t,
|
|
2572
2592
|
ws_seq: n,
|
|
2573
2593
|
code: r.code,
|
|
2574
2594
|
reason: r.reason,
|
|
2575
2595
|
was_clean: r.wasClean
|
|
2576
2596
|
}, e));
|
|
2577
|
-
}, r) : (
|
|
2597
|
+
}, r) : (Tn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2578
2598
|
}
|
|
2579
|
-
function
|
|
2599
|
+
function Ml(e, t = 1e3, n = "") {
|
|
2580
2600
|
let r = e.priv, l = r.websocket;
|
|
2581
2601
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2582
|
-
|
|
2602
|
+
jn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2583
2603
|
try {
|
|
2584
2604
|
l.close(t, n);
|
|
2585
2605
|
} catch (t) {
|
|
2586
|
-
|
|
2606
|
+
Tn(`${et(e)}: Error closing WebSocket: ${t.message}`);
|
|
2587
2607
|
}
|
|
2588
|
-
} else
|
|
2608
|
+
} else vn("WebSocket is already closed or in the process of closing.");
|
|
2589
2609
|
}
|
|
2590
|
-
function
|
|
2591
|
-
let r =
|
|
2610
|
+
function Wl(e, t, n) {
|
|
2611
|
+
let r = rl();
|
|
2592
2612
|
try {
|
|
2593
|
-
|
|
2613
|
+
jn("\n" + r + " " + t + "\n"), Gn(n);
|
|
2594
2614
|
} catch (e) {
|
|
2595
|
-
|
|
2615
|
+
jn("ERROR in trace_inter_event: " + e);
|
|
2596
2616
|
}
|
|
2597
2617
|
}
|
|
2598
|
-
var
|
|
2618
|
+
var xl = class {
|
|
2599
2619
|
constructor(e, t) {
|
|
2600
2620
|
this.event = e, this.kw = t || {};
|
|
2601
2621
|
}
|
|
2602
2622
|
};
|
|
2603
|
-
function
|
|
2623
|
+
function Kl(e, t, n, r) {
|
|
2604
2624
|
return function(e, t) {
|
|
2605
2625
|
let n = e.priv, r = JSON.stringify(t);
|
|
2606
|
-
if (
|
|
2626
|
+
if (Ul(e)) {
|
|
2607
2627
|
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o = yt(qe(), "trace_ievent_callback");
|
|
2608
|
-
o ? o(l, t, 1, r.length) :
|
|
2628
|
+
o ? o(l, t, 1, r.length) : Wl(0, l, t);
|
|
2609
2629
|
}
|
|
2610
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2630
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return vn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2611
2631
|
try {
|
|
2612
2632
|
n.websocket.send(r);
|
|
2613
2633
|
} catch (t) {
|
|
2614
|
-
|
|
2634
|
+
Tn(`${et(e)}: send_iev(): ${t}`);
|
|
2615
2635
|
}
|
|
2616
2636
|
return 0;
|
|
2617
2637
|
}(e, function(e, t) {
|
|
2618
|
-
return
|
|
2638
|
+
return ur(e) ? (Tn("iev_create() event NULL"), null) : new xl(e, t);
|
|
2619
2639
|
}(t, n));
|
|
2620
2640
|
}
|
|
2621
|
-
function
|
|
2622
|
-
return
|
|
2641
|
+
function Yl(e, t, n) {
|
|
2642
|
+
return ur(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2623
2643
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2624
2644
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
2625
2645
|
dst_service: n,
|
|
2626
2646
|
src_yuno: He(),
|
|
2627
2647
|
src_role: ze(),
|
|
2628
2648
|
src_service: t,
|
|
2629
|
-
host:
|
|
2649
|
+
host: ol()
|
|
2630
2650
|
};
|
|
2631
2651
|
}
|
|
2632
|
-
function
|
|
2652
|
+
function Bl(e) {
|
|
2633
2653
|
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");
|
|
2634
2654
|
i && i.length || (i = yt(qe(), "required_services"));
|
|
2635
2655
|
let _ = {
|
|
@@ -2647,34 +2667,34 @@
|
|
|
2647
2667
|
username: jt(qe(), "__username__"),
|
|
2648
2668
|
launch_id: 0,
|
|
2649
2669
|
yuno_startdate: jt(qe(), "start_date"),
|
|
2650
|
-
id:
|
|
2670
|
+
id: ol(),
|
|
2651
2671
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2652
2672
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2653
2673
|
required_services: i
|
|
2654
2674
|
};
|
|
2655
|
-
return
|
|
2675
|
+
return xr(e, _, Cl, Yl(e, Xe(nt(e)), null)), Yr(e, _, "__identity__"), jl(t.gobj_timer, vt(e, "timeout_idack")), Kl(e, "EV_IDENTITY_CARD", _);
|
|
2656
2676
|
}
|
|
2657
|
-
function
|
|
2658
|
-
if (
|
|
2677
|
+
function Jl(e, t) {
|
|
2678
|
+
if (ur(t.event)) return -1;
|
|
2659
2679
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2660
2680
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2661
|
-
return
|
|
2681
|
+
return xr(e, n, Cl, Yl(e, Xe(i), s)), Yr(e, n, "__subscribing__"), Kl(e, t.event, n);
|
|
2662
2682
|
}
|
|
2663
|
-
function
|
|
2683
|
+
function ql(e, t, n, r) {
|
|
2664
2684
|
let l = e.priv;
|
|
2665
|
-
return Ke(e) && (l.websocket =
|
|
2685
|
+
return Ke(e) && (l.websocket = Gl(e)), 0;
|
|
2666
2686
|
}
|
|
2667
|
-
function
|
|
2668
|
-
return
|
|
2687
|
+
function Hl(e, t, n, r) {
|
|
2688
|
+
return jn("Websocket opened: " + e.priv.url), Bl(e), 0;
|
|
2669
2689
|
}
|
|
2670
|
-
function
|
|
2690
|
+
function zl(e, t, n, r) {
|
|
2671
2691
|
let l = e.priv, o = n.url;
|
|
2672
|
-
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(),
|
|
2692
|
+
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(), vn(`${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", {
|
|
2673
2693
|
url: o,
|
|
2674
2694
|
remote_yuno_name: l.remote_yuno_name,
|
|
2675
2695
|
remote_yuno_role: l.remote_yuno_role,
|
|
2676
2696
|
remote_yuno_service: l.remote_yuno_service
|
|
2677
|
-
})) : Ke(e) && (
|
|
2697
|
+
})) : Ke(e) && (vn(`${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", {
|
|
2678
2698
|
url: o,
|
|
2679
2699
|
remote_yuno_name: l.remote_yuno_name,
|
|
2680
2700
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -2682,25 +2702,25 @@
|
|
|
2682
2702
|
code: n.code,
|
|
2683
2703
|
reason: n.reason,
|
|
2684
2704
|
was_clean: n.was_clean
|
|
2685
|
-
})), Ke(e) &&
|
|
2705
|
+
})), Ke(e) && jl(l.gobj_timer, Ql(e))), 0;
|
|
2686
2706
|
}
|
|
2687
|
-
function
|
|
2707
|
+
function Ql(e) {
|
|
2688
2708
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2689
2709
|
r < n && (r = n), t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2690
2710
|
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
2691
2711
|
return Math.max(1, Math.round(o));
|
|
2692
2712
|
}
|
|
2693
|
-
function
|
|
2694
|
-
return
|
|
2713
|
+
function Xl(e, t, n, r) {
|
|
2714
|
+
return Bl(e), 0;
|
|
2695
2715
|
}
|
|
2696
|
-
function
|
|
2716
|
+
function Zl(e, t, n, r) {
|
|
2697
2717
|
let l = e.priv;
|
|
2698
|
-
|
|
2699
|
-
let o =
|
|
2718
|
+
Sl(l.gobj_timer);
|
|
2719
|
+
let o = Kr(e, n, Cl, !0), s = Or(e, o, "src_yuno", ""), i = Or(e, o, "src_role", ""), _ = Or(e, o, "src_service", "");
|
|
2700
2720
|
Rt(e, "remote_yuno_name", s), Rt(e, "remote_yuno_role", i), Rt(e, "remote_yuno_service", _);
|
|
2701
|
-
let a =
|
|
2721
|
+
let a = jr(e, n, "result", -1, 0), u = Or(e, n, "comment", "", 0), c = Or(e, n, "username", "", 0), f = Nr(e, n, "services_roles", {});
|
|
2702
2722
|
if (a < 0) {
|
|
2703
|
-
|
|
2723
|
+
Ml(e);
|
|
2704
2724
|
let t = {
|
|
2705
2725
|
url: jt(e, "url"),
|
|
2706
2726
|
result: a,
|
|
@@ -2725,61 +2745,61 @@
|
|
|
2725
2745
|
}
|
|
2726
2746
|
l.inside_on_open = !1, function(e) {
|
|
2727
2747
|
let t = zt(e, null, null, null);
|
|
2728
|
-
for (let n = 0; n < t.length; n++)
|
|
2748
|
+
for (let n = 0; n < t.length; n++) Jl(e, t[n]);
|
|
2729
2749
|
}(e);
|
|
2730
2750
|
}
|
|
2731
2751
|
return 0;
|
|
2732
2752
|
}
|
|
2733
|
-
function
|
|
2753
|
+
function eo(e, t, n, r) {
|
|
2734
2754
|
let l = e.priv.url, o = function(e, t) {
|
|
2735
2755
|
let n;
|
|
2736
2756
|
try {
|
|
2737
2757
|
n = JSON.parse(t);
|
|
2738
2758
|
} catch (t) {
|
|
2739
|
-
return
|
|
2759
|
+
return vn(`${et(e)}: parsing inter_event json: ${t}`), null;
|
|
2740
2760
|
}
|
|
2741
|
-
if (!(n instanceof Object)) return
|
|
2761
|
+
if (!(n instanceof Object)) return vn(`${et(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2742
2762
|
let r = n.event;
|
|
2743
|
-
if (!r) return
|
|
2744
|
-
if ("string" != typeof r) return
|
|
2763
|
+
if (!r) return vn(`${et(e)}: parsing inter_event: no event`), null;
|
|
2764
|
+
if ("string" != typeof r) return vn(`${et(e)}: parsing inter_event: event not a string`), null;
|
|
2745
2765
|
let l = n.kw;
|
|
2746
2766
|
return l ? l instanceof Object ? {
|
|
2747
2767
|
event: r,
|
|
2748
2768
|
kw: l || {}
|
|
2749
|
-
} : (
|
|
2769
|
+
} : (vn(`${et(e)}: parsing inter_event: kw not a json object`), null) : (vn(`${et(e)}: parsing inter_kw: no kw`), null);
|
|
2750
2770
|
}(e, n.data);
|
|
2751
|
-
if (!o) return
|
|
2752
|
-
if (
|
|
2771
|
+
if (!o) return vn(`${et(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2772
|
+
if (Ul(e)) {
|
|
2753
2773
|
let e = Xe(qe()) + " <== " + l, t = n.data.length, r = yt(qe(), "trace_ievent_callback");
|
|
2754
|
-
r ? r(e, o, 2, t) :
|
|
2774
|
+
r ? r(e, o, 2, t) : Wl(0, e, o);
|
|
2755
2775
|
}
|
|
2756
2776
|
let s = o.event, i = o.kw;
|
|
2757
2777
|
if ("ST_SESSION" !== kt(e)) {
|
|
2758
2778
|
if (It(e, s, R.EVF_PUBLIC_EVENT)) {
|
|
2759
2779
|
if (!(Vt(e, s, i, e) < 0)) return 0;
|
|
2760
|
-
} else
|
|
2761
|
-
return
|
|
2780
|
+
} else Tn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2781
|
+
return Ml(e), -1;
|
|
2762
2782
|
}
|
|
2763
2783
|
o = null;
|
|
2764
|
-
let _ =
|
|
2765
|
-
if (u.toLowerCase() !== ze().toLowerCase()) return
|
|
2766
|
-
let c =
|
|
2767
|
-
if ("__subscribing__" === _) return
|
|
2768
|
-
if ("__unsubscribing__" === _) return
|
|
2784
|
+
let _ = Br(e, i), a = Kr(e, i, Cl), u = Or(e, a, "dst_role", "");
|
|
2785
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return Tn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2786
|
+
let c = Or(e, a, "dst_service", "");
|
|
2787
|
+
if ("__subscribing__" === _) return vn(`${et(e)}: subscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2788
|
+
if ("__unsubscribing__" === _) return vn(`${et(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2769
2789
|
if (It(e, s, R.EVF_PUBLIC_EVENT)) return Vt(e, s, i, e), 0;
|
|
2770
|
-
if (!
|
|
2790
|
+
if (!ur(c)) {
|
|
2771
2791
|
let t = we(c, !1);
|
|
2772
|
-
return t ? It(t, s, R.EVF_PUBLIC_EVENT) ? (Vt(t, s, i, e), 0) : (
|
|
2792
|
+
return t ? It(t, s, R.EVF_PUBLIC_EVENT) ? (Vt(t, s, i, e), 0) : (Tn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (vn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2773
2793
|
}
|
|
2774
2794
|
return lt(e) ? Vt(nt(e), s, i, e) : Xt(e, s, i), 0;
|
|
2775
2795
|
}
|
|
2776
|
-
function
|
|
2796
|
+
function to(e, t, n, r) {
|
|
2777
2797
|
return 0;
|
|
2778
2798
|
}
|
|
2779
|
-
function
|
|
2799
|
+
function no(e, t, n, r) {
|
|
2780
2800
|
return 0;
|
|
2781
2801
|
}
|
|
2782
|
-
var
|
|
2802
|
+
var ro = {
|
|
2783
2803
|
mt_create: function(e) {
|
|
2784
2804
|
let t = e.priv;
|
|
2785
2805
|
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);
|
|
@@ -2809,52 +2829,52 @@
|
|
|
2809
2829
|
code: 1e3,
|
|
2810
2830
|
reason: "restarted",
|
|
2811
2831
|
was_clean: !0
|
|
2812
|
-
}, e),
|
|
2832
|
+
}, e), Sl(t.gobj_timer)), t.websocket = Gl(e), 0;
|
|
2813
2833
|
},
|
|
2814
2834
|
mt_stop: function(e) {
|
|
2815
2835
|
let t = e.priv;
|
|
2816
|
-
return
|
|
2836
|
+
return Sl(t.gobj_timer), t.websocket && Ml(e), 0;
|
|
2817
2837
|
},
|
|
2818
2838
|
mt_destroy: function(e) {},
|
|
2819
2839
|
mt_stats: function(e, t, n, r) {
|
|
2820
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2840
|
+
if ("ST_SESSION" !== kt(e)) return Tn("Not in session"), null;
|
|
2821
2841
|
n || (n = {});
|
|
2822
|
-
let l =
|
|
2823
|
-
return o || (o = {}),
|
|
2842
|
+
let l = Yl(e, Xe(r), Or(e, n, "service", null, 0)), o = Nr(e, n, "__md_stats__", null, Zt.KW_EXTRACT);
|
|
2843
|
+
return o || (o = {}), xr(e, n, "stats_stack", {
|
|
2824
2844
|
stats: t,
|
|
2825
2845
|
kw: o
|
|
2826
|
-
}),
|
|
2846
|
+
}), xr(e, n, Cl, l), n.__stats__ = t, Yr(e, n, "__stats__"), Kl(e, "EV_MT_STATS", n, r), null;
|
|
2827
2847
|
},
|
|
2828
2848
|
mt_command_parser: function(e, t, n, r) {
|
|
2829
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2849
|
+
if ("ST_SESSION" !== kt(e)) return Tn("Not in session"), null;
|
|
2830
2850
|
n || (n = {});
|
|
2831
|
-
let l =
|
|
2832
|
-
return o || (o = {}),
|
|
2851
|
+
let l = Yl(e, Xe(r), Or(e, n, "service", "", 0)), o = Nr(e, n, "__md_command__", null, Zt.KW_EXTRACT);
|
|
2852
|
+
return o || (o = {}), xr(e, n, "command_stack", {
|
|
2833
2853
|
command: t,
|
|
2834
2854
|
kw: o
|
|
2835
|
-
}),
|
|
2855
|
+
}), xr(e, n, Cl, l), n.__command__ = t, Yr(e, n, "__command__"), Kl(e, "EV_MT_COMMAND", n, r), null;
|
|
2836
2856
|
},
|
|
2837
2857
|
mt_inject_event: function(e, t, n, r) {
|
|
2838
2858
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2839
|
-
if (n =
|
|
2859
|
+
if (n = xn({}, nr(n) ? n : {}), nr(n.__md_iev__) && (n.__md_iev__ = Mn(n.__md_iev__)), Kr(e, n, Cl));
|
|
2840
2860
|
else {
|
|
2841
|
-
let l =
|
|
2842
|
-
|
|
2861
|
+
let l = Yl(e, Xe(r), Or(e, n, "__service__", 0, 0));
|
|
2862
|
+
Jn(n, "__service__"), xr(e, n, "__message__", t), xr(e, n, Cl, l);
|
|
2843
2863
|
}
|
|
2844
|
-
return
|
|
2864
|
+
return Yr(e, n, "__message__"), Kl(e, t, n, r);
|
|
2845
2865
|
},
|
|
2846
2866
|
mt_subscription_added: function(e, t) {
|
|
2847
2867
|
let n = e.priv;
|
|
2848
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2868
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : Jl(e, t) : 0;
|
|
2849
2869
|
},
|
|
2850
2870
|
mt_subscription_deleted: function(e, t) {
|
|
2851
2871
|
let n = e.priv;
|
|
2852
2872
|
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2853
2873
|
if (n.inside_on_open) return 0;
|
|
2854
|
-
if (
|
|
2874
|
+
if (ur(t.event)) return 0;
|
|
2855
2875
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2856
2876
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2857
|
-
return
|
|
2877
|
+
return xr(e, r, Cl, Yl(e, Xe(_), i)), Yr(e, r, "__unsubscribing__"), Kl(e, t.event, r, e);
|
|
2858
2878
|
}
|
|
2859
2879
|
};
|
|
2860
2880
|
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__", {
|
|
@@ -2868,55 +2888,55 @@
|
|
|
2868
2888
|
return t;
|
|
2869
2889
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2870
2890
|
return e.replace(/[?# ^:]/g, "_");
|
|
2871
|
-
}, e.clear_timeout =
|
|
2891
|
+
}, e.clear_timeout = Sl, e.cmp_two_simple_json = dr, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2872
2892
|
let [r, l, o, s] = t;
|
|
2873
|
-
if (!r) return void
|
|
2893
|
+
if (!r) return void Tn("Tag must be a valid HTML element.");
|
|
2874
2894
|
let i = document.createElement(r), _ = "";
|
|
2875
2895
|
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2876
2896
|
let t = "";
|
|
2877
2897
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2878
2898
|
i.style.cssText = t;
|
|
2879
2899
|
} 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]);
|
|
2880
|
-
if (
|
|
2881
|
-
else if (
|
|
2900
|
+
if (Xr(o)) i.appendChild(Zr(o));
|
|
2901
|
+
else if (lr(o)) if (o = o.trim(), o.length > 0 && "<" === o[0] && !el) i.appendChild(nl(o));
|
|
2882
2902
|
else if (o.length > 0 && "<" === o[0] && function(e) {
|
|
2883
|
-
if (
|
|
2903
|
+
if (tl.size >= 100) return;
|
|
2884
2904
|
const t = e.slice(0, 80);
|
|
2885
|
-
|
|
2905
|
+
tl.has(t) || (tl.add(t), vn(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2886
2906
|
}(o), n && _) i.textContent = n(_) || o;
|
|
2887
2907
|
else i.textContent = o;
|
|
2888
|
-
else if (
|
|
2889
|
-
if (o.length > 0) if (
|
|
2890
|
-
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) :
|
|
2891
|
-
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (
|
|
2908
|
+
else if (rr(o)) {
|
|
2909
|
+
if (o.length > 0) if (lr(o[0])) i.appendChild(e(o, n));
|
|
2910
|
+
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : Xr(t) ? i.appendChild(Zr(t)) : lr(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && Tn("createElement2: child ignored, type " + typeof t);
|
|
2911
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (Tn("content ignored"), Sn(o));
|
|
2892
2912
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2893
2913
|
return i;
|
|
2894
|
-
}, e.createOneHtml =
|
|
2895
|
-
let n =
|
|
2896
|
-
return
|
|
2914
|
+
}, e.createOneHtml = nl, e.create_json_record = function(e, t) {
|
|
2915
|
+
let n = Mn(e);
|
|
2916
|
+
return Kn(n, t), n;
|
|
2897
2917
|
}, e.create_template_record = function(e, t) {
|
|
2898
2918
|
let n = {};
|
|
2899
2919
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2900
2920
|
let l;
|
|
2901
|
-
|
|
2902
|
-
let o =
|
|
2903
|
-
|
|
2921
|
+
nr(r) && (l = r.default);
|
|
2922
|
+
let o = Nr(null, t, e, l);
|
|
2923
|
+
qn(n, e, o);
|
|
2904
2924
|
}), n;
|
|
2905
|
-
}, e.current_timestamp =
|
|
2906
|
-
let n =
|
|
2907
|
-
return n &&
|
|
2925
|
+
}, e.current_timestamp = rl, e.data_type_t = y, e.db_list_persistent_attrs = function(e, t) {
|
|
2926
|
+
let n = Cr(fl(e), null, !1), r = {};
|
|
2927
|
+
return n && nr(n) && (r = Ar(e, n, t, !1)), r;
|
|
2908
2928
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2909
|
-
let n = Et(e, E.SDF_PERSIST), r =
|
|
2910
|
-
if (r &&
|
|
2911
|
-
let l =
|
|
2912
|
-
l =
|
|
2929
|
+
let n = Et(e, E.SDF_PERSIST), r = Cr(fl(e), null, !1);
|
|
2930
|
+
if (r && nr(r)) {
|
|
2931
|
+
let l = Ar(e, r, t, !1);
|
|
2932
|
+
l = Ar(e, l, n, !1), wt(e, l, E.SDF_PERSIST);
|
|
2913
2933
|
}
|
|
2914
2934
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2915
|
-
let n =
|
|
2916
|
-
0 ===
|
|
2935
|
+
let n = Ir(e, Cr(fl(e), null, !1), t, !1);
|
|
2936
|
+
0 === Zn(n) ? Pr(fl(e)) : Lr(fl(e), n);
|
|
2917
2937
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2918
|
-
let n =
|
|
2919
|
-
return r &&
|
|
2938
|
+
let n = Ar(e, Et(e, E.SDF_PERSIST), t, !1), r = Cr(fl(e), null, !1);
|
|
2939
|
+
return r && nr(r) && Yn(n, r), Lr(fl(e), n);
|
|
2920
2940
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2921
2941
|
let r = null, l = null, o = null;
|
|
2922
2942
|
const s = (...s) => {
|
|
@@ -2936,24 +2956,24 @@
|
|
|
2936
2956
|
return !1;
|
|
2937
2957
|
}, e.duplicate_objects = function(...e) {
|
|
2938
2958
|
const t = {};
|
|
2939
|
-
for (const n of e)
|
|
2959
|
+
for (const n of e) xn(t, structuredClone(n));
|
|
2940
2960
|
return t;
|
|
2941
2961
|
}, e.empty_json = function(e) {
|
|
2942
|
-
return 0 ===
|
|
2943
|
-
}, e.empty_string =
|
|
2962
|
+
return 0 === tr(e);
|
|
2963
|
+
}, e.empty_string = ur, e.escapeHtml = zr, e.event_flag_t = R, e.flat2json = function(e) {
|
|
2944
2964
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2945
2965
|
let t = null;
|
|
2946
2966
|
for (const n of Object.keys(e)) {
|
|
2947
|
-
const r =
|
|
2967
|
+
const r = ul(n);
|
|
2948
2968
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2949
|
-
if (r.length >
|
|
2969
|
+
if (r.length > il) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2950
2970
|
const l = "number" == typeof r[0];
|
|
2951
2971
|
if (null === t) t = l ? [] : {};
|
|
2952
2972
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2953
2973
|
let o = t;
|
|
2954
2974
|
for (let t = 0; t < r.length; t++) {
|
|
2955
2975
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2956
|
-
if (s && l >
|
|
2976
|
+
if (s && l > _l) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2957
2977
|
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"}`);
|
|
2958
2978
|
if (i) {
|
|
2959
2979
|
if (Array.isArray(o)) {
|
|
@@ -2961,7 +2981,7 @@
|
|
|
2961
2981
|
o[l] = e[n];
|
|
2962
2982
|
} else {
|
|
2963
2983
|
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`);
|
|
2964
|
-
|
|
2984
|
+
hr(o, l, e[n]);
|
|
2965
2985
|
}
|
|
2966
2986
|
break;
|
|
2967
2987
|
}
|
|
@@ -2969,7 +2989,7 @@
|
|
|
2969
2989
|
if (Array.isArray(o)) {
|
|
2970
2990
|
for (; o.length <= l;) o.push(null);
|
|
2971
2991
|
a = o[l], null == a && (a = _ ? [] : {}, o[l] = a);
|
|
2972
|
-
} else a =
|
|
2992
|
+
} else a = mr(o, l) ? void 0 : o[l], void 0 === a && (a = _ ? [] : {}, hr(o, l, a));
|
|
2973
2993
|
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`);
|
|
2974
2994
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2975
2995
|
o = a;
|
|
@@ -2980,11 +3000,11 @@
|
|
|
2980
3000
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2981
3001
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2982
3002
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2983
|
-
for (const n of Object.keys(t.added || {}))
|
|
3003
|
+
for (const n of Object.keys(t.added || {})) hr(e, n, t.added[n]);
|
|
2984
3004
|
for (const n of Object.keys(t.changed || {})) {
|
|
2985
3005
|
const r = t.changed[n];
|
|
2986
3006
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2987
|
-
|
|
3007
|
+
hr(e, n, r.to);
|
|
2988
3008
|
}
|
|
2989
3009
|
return e;
|
|
2990
3010
|
}, e.flat_diff = function(e, t) {
|
|
@@ -2993,15 +3013,15 @@
|
|
|
2993
3013
|
removed: {},
|
|
2994
3014
|
changed: {}
|
|
2995
3015
|
};
|
|
2996
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
3016
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? cl(n[e], r[e]) || hr(l.changed, e, {
|
|
2997
3017
|
from: n[e],
|
|
2998
3018
|
to: r[e]
|
|
2999
|
-
}) :
|
|
3000
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
3019
|
+
}) : hr(l.removed, e, n[e]);
|
|
3020
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || hr(l.added, e, r[e]);
|
|
3001
3021
|
return l;
|
|
3002
3022
|
}, e.flat_key_join = function(e) {
|
|
3003
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
3004
|
-
}, e.flat_key_split =
|
|
3023
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : al(e)).join("`") : "";
|
|
3024
|
+
}, e.flat_key_split = ul, 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) {
|
|
3005
3025
|
if (!e) return {
|
|
3006
3026
|
top: 0,
|
|
3007
3027
|
left: 0,
|
|
@@ -3020,17 +3040,17 @@
|
|
|
3020
3040
|
right: n + i + r,
|
|
3021
3041
|
bottom: t + s + l
|
|
3022
3042
|
};
|
|
3023
|
-
}, e.get_function_name =
|
|
3043
|
+
}, e.get_function_name = sl, e.get_now = function() {
|
|
3024
3044
|
return Math.floor(Date.now() / 1e3);
|
|
3025
3045
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
3026
|
-
return ot(e) ? (
|
|
3046
|
+
return ot(e) ? (Tn("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) && jn(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (Tn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
3027
3047
|
}, e.gobj_change_state = Dt, e.gobj_command = function(e, t, r, o) {
|
|
3028
|
-
if (ot(e)) return
|
|
3048
|
+
if (ot(e)) return Tn("gobj NULL or DESTROYED"), -1;
|
|
3029
3049
|
if (function(e) {
|
|
3030
3050
|
return G > 1 || !!e && !!(x(e) & P.TRACE_COMMANDS);
|
|
3031
3051
|
}(e) || H(e, null) && !z(o, null)) {
|
|
3032
|
-
let l =
|
|
3033
|
-
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) &&
|
|
3052
|
+
let l = Cn(t);
|
|
3053
|
+
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) && Gn(r);
|
|
3034
3054
|
}
|
|
3035
3055
|
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);
|
|
3036
3056
|
}, e.gobj_create = function(e, t, n, r) {
|
|
@@ -3044,7 +3064,7 @@
|
|
|
3044
3064
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
3045
3065
|
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
3046
3066
|
}, 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) {
|
|
3047
|
-
if (
|
|
3067
|
+
if (ur(t)) return null;
|
|
3048
3068
|
const n = t.toLowerCase();
|
|
3049
3069
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
3050
3070
|
}, 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() {
|
|
@@ -3056,24 +3076,24 @@
|
|
|
3056
3076
|
}, e.gobj_list_subscriptions = function(e) {
|
|
3057
3077
|
let t = zt(e, null, null, null);
|
|
3058
3078
|
for (let n = 0; n < t.length; n++) {
|
|
3059
|
-
let r = t[n], l =
|
|
3060
|
-
|
|
3079
|
+
let r = t[n], l = Sr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Sr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3080
|
+
Hn(r, "s_event", Or(e, r, "event", "", Zt.KW_REQUIRED)), Hn(r, "s_publisher", et(l)), Hn(r, "s_subscriber", et(o));
|
|
3061
3081
|
}
|
|
3062
3082
|
let n = Qt(e, 0, null, 0);
|
|
3063
3083
|
for (let t = 0; t < n.length; t++) {
|
|
3064
|
-
let r = n[t], l =
|
|
3065
|
-
|
|
3084
|
+
let r = n[t], l = Sr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Sr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3085
|
+
Hn(r, "s_event", Or(e, r, "event", "", Zt.KW_REQUIRED)), Hn(r, "s_publisher", et(l)), Hn(r, "s_subscriber", et(o));
|
|
3066
3086
|
}
|
|
3067
3087
|
return {
|
|
3068
3088
|
subscriptions: t,
|
|
3069
3089
|
subscribings: n,
|
|
3070
|
-
"total subscriptions":
|
|
3071
|
-
total_subscribings:
|
|
3090
|
+
"total subscriptions": er(t),
|
|
3091
|
+
total_subscribings: er(n)
|
|
3072
3092
|
};
|
|
3073
3093
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
3074
|
-
return Be(e) ? i ? i(e, t) : -1 : (
|
|
3094
|
+
return Be(e) ? i ? i(e, t) : -1 : (Tn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3075
3095
|
}, e.gobj_match_children = function(e, t) {
|
|
3076
|
-
if (ot(e)) return
|
|
3096
|
+
if (ot(e)) return Tn("gobj NULL or DESTROYED"), null;
|
|
3077
3097
|
t = t || {};
|
|
3078
3098
|
let n = [];
|
|
3079
3099
|
const r = e.dl_children;
|
|
@@ -3095,7 +3115,7 @@
|
|
|
3095
3115
|
}, 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() {
|
|
3096
3116
|
return Lt.length;
|
|
3097
3117
|
}, 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) {
|
|
3098
|
-
return Be(e) ? a ? a(e, t) : -1 : (
|
|
3118
|
+
return Be(e) ? a ? a(e, t) : -1 : (Tn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3099
3119
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
3100
3120
|
return U.map(([e, t, n]) => ({
|
|
3101
3121
|
name: e,
|
|
@@ -3105,34 +3125,34 @@
|
|
|
3105
3125
|
}));
|
|
3106
3126
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
3107
3127
|
return function(e, t, n) {
|
|
3108
|
-
if (ot(e)) return
|
|
3128
|
+
if (ot(e)) return Tn("gobj NULL or DESTROYED"), -1;
|
|
3109
3129
|
let r = e.gclass.attrs_table;
|
|
3110
3130
|
for (let l = 0; l < r.length; l++) {
|
|
3111
3131
|
const o = r[l];
|
|
3112
|
-
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o),
|
|
3132
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o), nr(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)));
|
|
3113
3133
|
}
|
|
3114
3134
|
return 0;
|
|
3115
3135
|
}(e, E.SDF_VOLATIL, 0);
|
|
3116
3136
|
}, e.gobj_save_persistent_attrs = De, e.gobj_search_path = mt, e.gobj_send_event = Vt, e.gobj_services = function() {
|
|
3117
3137
|
let e = [];
|
|
3118
|
-
for (const t of Object.keys(b))
|
|
3138
|
+
for (const t of Object.keys(b)) Qn(e, t);
|
|
3119
3139
|
return e;
|
|
3120
3140
|
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
3121
3141
|
return G = Number(e) || 0, 0;
|
|
3122
3142
|
}, 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) {
|
|
3123
|
-
if (!e) return
|
|
3143
|
+
if (!e) return Tn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
3124
3144
|
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3125
3145
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3126
3146
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
3127
|
-
if (!e) return
|
|
3147
|
+
if (!e) return Tn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3128
3148
|
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3129
3149
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3130
3150
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
3131
3151
|
C = 1 === Number(e) ? 1 : 0;
|
|
3132
3152
|
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
3133
|
-
return ot(e) ? (
|
|
3153
|
+
return ot(e) ? (Tn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ue, 0, 0);
|
|
3134
3154
|
}, e.gobj_start_tree = function(e) {
|
|
3135
|
-
return ot(e) ? (
|
|
3155
|
+
return ot(e) ? (Tn("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)));
|
|
3136
3156
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
3137
3157
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
3138
3158
|
const d = [["EV_STATE_CHANGED", R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -3142,14 +3162,14 @@
|
|
|
3142
3162
|
}
|
|
3143
3163
|
return 0;
|
|
3144
3164
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
3145
|
-
return ot(e) ? (
|
|
3165
|
+
return ot(e) ? (Tn("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);
|
|
3146
3166
|
}, e.gobj_stop = Ve, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
3147
|
-
return ot(e) ? (
|
|
3167
|
+
return ot(e) ? (Tn("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));
|
|
3148
3168
|
}, e.gobj_subscribe_event = qt, e.gobj_trace_level = x, e.gobj_trace_machine_format = function() {
|
|
3149
3169
|
return C;
|
|
3150
3170
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3151
|
-
if (null == n && (n = {}), !e) return
|
|
3152
|
-
if (!r) return
|
|
3171
|
+
if (null == n && (n = {}), !e) return Tn(`publisher NULL: ev ${t}`), 0;
|
|
3172
|
+
if (!r) return Tn(`subscriber NULL: ev ${t}`), 0;
|
|
3153
3173
|
const l = /* @__PURE__ */ new Set([
|
|
3154
3174
|
"__config__",
|
|
3155
3175
|
"__global__",
|
|
@@ -3158,83 +3178,83 @@
|
|
|
3158
3178
|
"__service__"
|
|
3159
3179
|
]);
|
|
3160
3180
|
if (Object.keys(n).forEach((n) => {
|
|
3161
|
-
l.has(n) ||
|
|
3162
|
-
}),
|
|
3163
|
-
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
3181
|
+
l.has(n) || Tn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
3182
|
+
}), ur(t)) t = "";
|
|
3183
|
+
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return Tn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
3164
3184
|
let o = xt(n, t), s = Yt(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), i = 0, _ = 0, a = 0;
|
|
3165
3185
|
for (let t = 0; t < s.length; t++) {
|
|
3166
3186
|
let n = s[t], r = Jt(e, n, !1, !1);
|
|
3167
3187
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3168
3188
|
}
|
|
3169
|
-
return _ ?
|
|
3189
|
+
return _ ? vn(`${et(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (vn(`${et(e)}: No subscription found`), Gn(n, "No subscription found")), 0;
|
|
3170
3190
|
}, 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) {
|
|
3171
|
-
return "string" != typeof e ? (
|
|
3172
|
-
}, e.id_index_in_obj_list =
|
|
3191
|
+
return "string" != typeof e ? (Tn("html_markup: not a string, type " + typeof e), new Qr("")) : new Qr(e);
|
|
3192
|
+
}, e.id_index_in_obj_list = Vr, e.index_in_list = ll, e.is_array = rr, e.is_boolean = sr, e.is_date = function(e) {
|
|
3173
3193
|
return e instanceof Date && !isNaN(e);
|
|
3174
|
-
}, e.is_function =
|
|
3175
|
-
if (!
|
|
3194
|
+
}, e.is_function = _r, e.is_gobj = ar, e.is_html_markup = Xr, e.is_metadata_key = function(e) {
|
|
3195
|
+
if (!lr(e)) return !1;
|
|
3176
3196
|
let t = 0;
|
|
3177
3197
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3178
3198
|
return 2 === t;
|
|
3179
|
-
}, e.is_null =
|
|
3180
|
-
if (!
|
|
3199
|
+
}, e.is_null = ir, e.is_number = or, e.is_object = nr, e.is_private_key = function(e) {
|
|
3200
|
+
if (!lr(e)) return !1;
|
|
3181
3201
|
let t = 0;
|
|
3182
3202
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3183
3203
|
return 1 === t;
|
|
3184
3204
|
}, e.is_pure_number = function(e) {
|
|
3185
|
-
if (
|
|
3186
|
-
if (!
|
|
3205
|
+
if (or(e)) return !0;
|
|
3206
|
+
if (!lr(e)) return !1;
|
|
3187
3207
|
const t = Number(e);
|
|
3188
3208
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3189
|
-
}, e.is_secret_name =
|
|
3190
|
-
let l =
|
|
3191
|
-
if (!l) return
|
|
3192
|
-
if (!
|
|
3193
|
-
if (!
|
|
3194
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
3209
|
+
}, e.is_secret_name = Rn, e.is_string = lr, e.jdb_delete = function(e, t, n, r) {
|
|
3210
|
+
let l = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3211
|
+
if (!l) return Tn("jdb_delete: topic not found: " + t), null;
|
|
3212
|
+
if (!nr(r) || ur(r.id)) return Tn(`jdb_delete: record without id: ${pn(r)}`), null;
|
|
3213
|
+
if (!lr(n)) return Tn(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
3214
|
+
if ("" !== n && n.split("`").includes("")) return Tn(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
3195
3215
|
let o, s = n.split("`"), i = l;
|
|
3196
|
-
for (; (o = s.shift()) && !
|
|
3197
|
-
if (!i || 0 !== s.length) return
|
|
3198
|
-
let _ =
|
|
3199
|
-
return a < 0 ? (
|
|
3216
|
+
for (; (o = s.shift()) && !ur(o) && i;) nr(i) && (i = Nr(null, i, e.hook, null, 0)), i = qr(i, null, o, !1);
|
|
3217
|
+
if (!i || 0 !== s.length) return Tn(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
3218
|
+
let _ = rr(i) ? i : Nr(null, i, e.hook, null, 0), a = Vr(_, r.id);
|
|
3219
|
+
return a < 0 ? (Tn(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (_.splice(a, 1), l);
|
|
3200
3220
|
}, e.jdb_get = function(e, t, n, r) {
|
|
3201
|
-
let l =
|
|
3202
|
-
return l ? (void 0 === r && (r = !0),
|
|
3221
|
+
let l = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3222
|
+
return l ? (void 0 === r && (r = !0), qr(l, e.hook, n, r)) : (Tn("jdb_get: topic not found: " + t), null);
|
|
3203
3223
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
3204
|
-
let r =
|
|
3205
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
3224
|
+
let r = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3225
|
+
return r ? n < r.length ? r[n] : {} : (Tn("jdb_get_by_idx: topic not found: " + t), null);
|
|
3206
3226
|
}, e.jdb_get_topic = function(e, t) {
|
|
3207
|
-
let n =
|
|
3208
|
-
if (!n) return
|
|
3209
|
-
return
|
|
3227
|
+
let n = Nr(null, e, "topics", null, 0);
|
|
3228
|
+
if (!n) return Tn("jdb topics section not found"), On(e), null;
|
|
3229
|
+
return Nr(null, n, t, null, 0) || (Tn("jdb topic not found: " + t), On(n), null);
|
|
3210
3230
|
}, e.jdb_init = function(e, t, n) {
|
|
3211
|
-
n && (e =
|
|
3212
|
-
let r =
|
|
3213
|
-
|
|
3214
|
-
let l =
|
|
3215
|
-
return
|
|
3216
|
-
"__" === t.substring(0, 2) ||
|
|
3231
|
+
n && (e = Mn(e));
|
|
3232
|
+
let r = Nr(null, e, "type", [], Zt.KW_CREATE);
|
|
3233
|
+
Or(null, e, "hook", "data", Zt.KW_CREATE);
|
|
3234
|
+
let l = Nr(null, e, "schema", {}, Zt.KW_CREATE), o = Nr(null, e, "topics", {}, Zt.KW_CREATE);
|
|
3235
|
+
return Jr(l, function(e, t, n, l) {
|
|
3236
|
+
"__" === t.substring(0, 2) || nr(n) || Nr(null, o, l, Mn(r), Zt.KW_CREATE);
|
|
3217
3237
|
}, t), e;
|
|
3218
3238
|
}, e.jdb_update = function(e, t, n, r) {
|
|
3219
|
-
let l =
|
|
3220
|
-
if (!l) return
|
|
3221
|
-
if (!
|
|
3222
|
-
if (!
|
|
3223
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
3239
|
+
let l = Nr(null, Nr(null, e, "topics", null, 0), t, null, 0);
|
|
3240
|
+
if (!l) return Tn("jdb_update: topic not found: " + t), null;
|
|
3241
|
+
if (!nr(r) || ur(r.id)) return Tn(`jdb_update: record without id: ${pn(r)}`), null;
|
|
3242
|
+
if (!lr(n)) return Tn(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
3243
|
+
if ("" !== n && n.split("`").includes("")) return Tn(`jdb_update: empty segment in path: '${n}'`), null;
|
|
3224
3244
|
let o, s, i = n.split("`"), _ = l;
|
|
3225
|
-
for (; (o = i.shift()) && !
|
|
3226
|
-
if (!_ || 0 !== i.length) return
|
|
3227
|
-
if (
|
|
3245
|
+
for (; (o = i.shift()) && !ur(o) && _;) nr(_) && (_ = Nr(null, _, e.hook, null, 0)), _ = qr(_, null, o, !1);
|
|
3246
|
+
if (!_ || 0 !== i.length) return Tn(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
3247
|
+
if (rr(_)) s = _;
|
|
3228
3248
|
else {
|
|
3229
|
-
if (_.id === r.id) return
|
|
3230
|
-
if (s =
|
|
3231
|
-
else if (!
|
|
3249
|
+
if (_.id === r.id) return xn(_, r), l;
|
|
3250
|
+
if (s = Nr(null, _, e.hook, null, 0), null == s) s = [], qn(_, e.hook, s);
|
|
3251
|
+
else if (!rr(s)) return Tn(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
3232
3252
|
}
|
|
3233
|
-
let a =
|
|
3234
|
-
return a ?
|
|
3253
|
+
let a = qr(s, e.hook, r.id, !1);
|
|
3254
|
+
return a ? xn(a, r) : s.push(r), l;
|
|
3235
3255
|
}, e.json2flat = function(e) {
|
|
3236
3256
|
const t = {}, n = (e, r, l) => {
|
|
3237
|
-
if (l >
|
|
3257
|
+
if (l > il) throw new Error("json2flat: deeper than 256");
|
|
3238
3258
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3239
3259
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3240
3260
|
const o = `[${t}]`;
|
|
@@ -3244,20 +3264,20 @@
|
|
|
3244
3264
|
const t = Object.keys(e);
|
|
3245
3265
|
if (t.length > 0) {
|
|
3246
3266
|
for (const o of t) {
|
|
3247
|
-
const t =
|
|
3267
|
+
const t = al(o);
|
|
3248
3268
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
3249
3269
|
}
|
|
3250
3270
|
return;
|
|
3251
3271
|
}
|
|
3252
3272
|
}
|
|
3253
|
-
0 !== l &&
|
|
3273
|
+
0 !== l && hr(t, r, e);
|
|
3254
3274
|
};
|
|
3255
3275
|
return null == e || n(e, "", 0), t;
|
|
3256
|
-
}, e.json_array_append =
|
|
3276
|
+
}, e.json_array_append = zn, e.json_array_append_new = Qn, e.json_array_extend = function(e, t) {
|
|
3257
3277
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3258
|
-
}, e.json_array_remove =
|
|
3278
|
+
}, e.json_array_remove = Xn, e.json_array_size = er, e.json_deep_copy = Mn, e.json_is_identical = Wn, e.json_mask_secrets = Vn, e.json_object_del = Jn, e.json_object_get = Bn, e.json_object_set = qn, e.json_object_set_new = Hn, e.json_object_size = Zn, e.json_object_update = xn, e.json_object_update_existing = Kn, e.json_object_update_missing = Yn, e.json_size = tr, e.jwt2json = function(e, t) {
|
|
3259
3279
|
try {
|
|
3260
|
-
let n =
|
|
3280
|
+
let n = Hr(e);
|
|
3261
3281
|
switch (t) {
|
|
3262
3282
|
case "header": return JSON.parse(n.header);
|
|
3263
3283
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3266,137 +3286,137 @@
|
|
|
3266
3286
|
} catch (e) {
|
|
3267
3287
|
return null;
|
|
3268
3288
|
}
|
|
3269
|
-
}, e.jwtDecode =
|
|
3270
|
-
if (e && !
|
|
3271
|
-
r || (r =
|
|
3289
|
+
}, e.jwtDecode = Hr, e.kw_clone_by_keys = Ar, e.kw_clone_by_not_keys = Ir, e.kw_collect = function(e, t, n, r) {
|
|
3290
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return null;
|
|
3291
|
+
r || (r = kr);
|
|
3272
3292
|
let l = [];
|
|
3273
|
-
if (
|
|
3293
|
+
if (rr(t)) for (let e = 0; e < t.length; e++) {
|
|
3274
3294
|
let o = t[e];
|
|
3275
3295
|
r(o, n) && l.push(o);
|
|
3276
3296
|
}
|
|
3277
3297
|
else {
|
|
3278
|
-
if (!
|
|
3298
|
+
if (!nr(t)) return Tn("kw_select() BAD kw parameter"), null;
|
|
3279
3299
|
r(t, n) && l.push(t);
|
|
3280
3300
|
}
|
|
3281
3301
|
return l;
|
|
3282
|
-
}, e.kw_delete =
|
|
3283
|
-
if (!n || !
|
|
3284
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3285
|
-
return r &&
|
|
3286
|
-
}, e.kw_find_path =
|
|
3287
|
-
e && !
|
|
3288
|
-
let o =
|
|
3302
|
+
}, e.kw_delete = Tr, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
3303
|
+
if (!n || !rr(t)) return r && Tn("item NULL or kw_list is not a list"), -1;
|
|
3304
|
+
for (let e = 0; e < t.length; e++) if (Wn(n, t[e])) return e;
|
|
3305
|
+
return r && Tn("item not found in this list"), -1;
|
|
3306
|
+
}, e.kw_find_path = Er, e.kw_flag_t = Zt, e.kw_get_bool = vr, e.kw_get_dict = wr, e.kw_get_dict_value = Nr, e.kw_get_int = jr, e.kw_get_list = function(e, t, n, r, l) {
|
|
3307
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3308
|
+
let o = Er(e, t, n, !1);
|
|
3289
3309
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
3290
|
-
return void 0 === o ? i &&
|
|
3291
|
-
}, e.kw_get_local_storage_value =
|
|
3292
|
-
e && !
|
|
3293
|
-
let o =
|
|
3310
|
+
return void 0 === o ? i && rr(r) && t ? ($r(e, t, n, r), r) : (s && (Tn(`path not found: '${n}'`), Gn(t)), r) : rr(o) ? (_ && Tr(e, t, n), o) : i && null === o && rr(r) ? ($r(e, t, n, r), r) : i && null === o ? (s && (Tn(`path not found: '${n}'`), Gn(t)), r) : ((s || i) && (Tn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'` + (i ? ", cannot create" : "")), Gn(t)), r);
|
|
3311
|
+
}, e.kw_get_local_storage_value = Cr, e.kw_get_pointer = Sr, e.kw_get_real = function(e, t, n, r, l) {
|
|
3312
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3313
|
+
let o = Er(e, t, n, !1);
|
|
3294
3314
|
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;
|
|
3295
3315
|
if (void 0 === o) {
|
|
3296
3316
|
if (i && t) {
|
|
3297
3317
|
let l = Number(r);
|
|
3298
|
-
return
|
|
3318
|
+
return $r(e, t, n, l), l;
|
|
3299
3319
|
}
|
|
3300
|
-
return s && (
|
|
3320
|
+
return s && (Tn(`path not found: '${n}'`), Gn(t)), Number(r);
|
|
3301
3321
|
}
|
|
3302
3322
|
let u;
|
|
3303
|
-
if (
|
|
3323
|
+
if (or(o)) u = o;
|
|
3304
3324
|
else {
|
|
3305
|
-
if (!a) return
|
|
3306
|
-
if (
|
|
3307
|
-
else if (
|
|
3325
|
+
if (!a) return Tn(`${e ? et(e) + ": " : ""}path MUST BE a json real: '${n}'`), Gn(t), Number(r);
|
|
3326
|
+
if (sr(o)) u = o ? 1 : 0;
|
|
3327
|
+
else if (lr(o)) u = parseFloat(o), Number.isNaN(u) && (u = 0);
|
|
3308
3328
|
else {
|
|
3309
|
-
if (null !== o) return
|
|
3329
|
+
if (null !== o) return Tn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Gn(t), 0;
|
|
3310
3330
|
u = 0;
|
|
3311
3331
|
}
|
|
3312
3332
|
}
|
|
3313
|
-
return _ &&
|
|
3314
|
-
}, e.kw_get_str =
|
|
3315
|
-
if (e && !
|
|
3316
|
-
r || (r =
|
|
3333
|
+
return _ && Tr(e, t, n), u;
|
|
3334
|
+
}, e.kw_get_str = Or, e.kw_has_key = pr, e.kw_match_simple = kr, e.kw_pop = br, e.kw_remove_local_storage_value = Pr, e.kw_select = function(e, t, n, r) {
|
|
3335
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return null;
|
|
3336
|
+
r || (r = kr);
|
|
3317
3337
|
let l = [];
|
|
3318
|
-
if (
|
|
3338
|
+
if (rr(t)) for (let e = 0; e < t.length; e++) {
|
|
3319
3339
|
let o = t[e];
|
|
3320
|
-
r(o, n) && l.push(
|
|
3340
|
+
r(o, n) && l.push(Mn(o));
|
|
3321
3341
|
}
|
|
3322
3342
|
else {
|
|
3323
|
-
if (!
|
|
3324
|
-
r(t, n) && l.push(
|
|
3343
|
+
if (!nr(t)) return Tn("kw_select() BAD kw parameter"), null;
|
|
3344
|
+
r(t, n) && l.push(Mn(t));
|
|
3325
3345
|
}
|
|
3326
3346
|
return l;
|
|
3327
|
-
}, e.kw_set_dict_value =
|
|
3328
|
-
e && !
|
|
3329
|
-
let o =
|
|
3347
|
+
}, e.kw_set_dict_value = $r, e.kw_set_local_storage_value = Lr, e.kw_set_subdict_value = Rr, e.kwid_collect = Fr, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
3348
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3349
|
+
let o = Fr(e, t, n, r, l);
|
|
3330
3350
|
return o && 0 !== o.length ? o[0] : null;
|
|
3331
3351
|
}, e.kwid_get_ids = function(e, t) {
|
|
3332
|
-
if (e && !
|
|
3352
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), !t) return [];
|
|
3333
3353
|
let n = [];
|
|
3334
|
-
if (
|
|
3335
|
-
else if (
|
|
3336
|
-
else
|
|
3337
|
-
if (
|
|
3338
|
-
else if (
|
|
3339
|
-
let r =
|
|
3354
|
+
if (lr(t)) n.push(t);
|
|
3355
|
+
else if (nr(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
3356
|
+
else rr(t) && t.forEach(function(t) {
|
|
3357
|
+
if (lr(t)) ur(t) || n.push(t);
|
|
3358
|
+
else if (nr(t)) {
|
|
3359
|
+
let r = Or(e, t, "id", 0, 0);
|
|
3340
3360
|
r && n.push(r);
|
|
3341
3361
|
}
|
|
3342
3362
|
});
|
|
3343
3363
|
return n;
|
|
3344
|
-
}, e.kwid_match_id =
|
|
3345
|
-
e && !
|
|
3364
|
+
}, e.kwid_match_id = Ur, e.kwid_new_dict = function(e, t, n) {
|
|
3365
|
+
e && !ar(e) && Tn("GObj bad instanceof");
|
|
3346
3366
|
let r = {};
|
|
3347
|
-
if (
|
|
3348
|
-
else if (
|
|
3349
|
-
let l = t[n], o =
|
|
3350
|
-
|
|
3367
|
+
if (ur(n) || (t = Er(e, t, n)), nr(t)) r = t;
|
|
3368
|
+
else if (rr(t)) for (let n = 0; n < t.length; n++) {
|
|
3369
|
+
let l = t[n], o = Or(e, l, "id", "", Zt.KW_REQUIRED);
|
|
3370
|
+
ur(o) || hr(r, o, l);
|
|
3351
3371
|
}
|
|
3352
|
-
else
|
|
3372
|
+
else Tn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
3353
3373
|
return r;
|
|
3354
3374
|
}, e.kwid_new_list = function(e, t, n) {
|
|
3355
|
-
if (e && !
|
|
3356
|
-
if (
|
|
3375
|
+
if (e && !ar(e) && Tn("GObj bad instanceof"), ur(n) || (t = Er(e, t, n)), rr(t)) return t;
|
|
3376
|
+
if (nr(t)) {
|
|
3357
3377
|
let n = [];
|
|
3358
3378
|
for (let r of Object.keys(t)) {
|
|
3359
3379
|
let l = t[r];
|
|
3360
|
-
|
|
3380
|
+
nr(l) ? (l.id = r, n.push(l)) : Tn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
3361
3381
|
}
|
|
3362
3382
|
return n;
|
|
3363
3383
|
}
|
|
3364
|
-
return
|
|
3384
|
+
return Tn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
3365
3385
|
}, e.list2options = function(e, t, n) {
|
|
3366
3386
|
t = t || "id", n = n || "value";
|
|
3367
3387
|
let r = [];
|
|
3368
|
-
if (
|
|
3388
|
+
if (rr(e)) for (let l = 0; l < e.length; l++) {
|
|
3369
3389
|
let o = e[l];
|
|
3370
|
-
if (
|
|
3390
|
+
if (lr(o)) r.push({
|
|
3371
3391
|
id: e[l],
|
|
3372
3392
|
value: e[l]
|
|
3373
3393
|
});
|
|
3374
|
-
else if (
|
|
3394
|
+
else if (nr(o)) {
|
|
3375
3395
|
let e = {};
|
|
3376
|
-
if (
|
|
3377
|
-
if (!
|
|
3378
|
-
if (!(
|
|
3379
|
-
|
|
3396
|
+
if (pr(o, t)) {
|
|
3397
|
+
if (!pr(o, n)) {
|
|
3398
|
+
if (!(tr(o) > 0)) {
|
|
3399
|
+
Tn("list2options(): object without field value: " + n);
|
|
3380
3400
|
continue;
|
|
3381
3401
|
}
|
|
3382
3402
|
n = Object.keys(o)[0];
|
|
3383
3403
|
}
|
|
3384
3404
|
e.id = o[t], e.value = o[n];
|
|
3385
3405
|
} else {
|
|
3386
|
-
if (!(
|
|
3387
|
-
|
|
3406
|
+
if (!(tr(o) > 0)) {
|
|
3407
|
+
Tn("list2options(): object without field id: " + t);
|
|
3388
3408
|
continue;
|
|
3389
3409
|
}
|
|
3390
3410
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
3391
3411
|
}
|
|
3392
3412
|
r.push(e);
|
|
3393
|
-
} else
|
|
3413
|
+
} else Tn("list2options(): case1 not implemented");
|
|
3394
3414
|
}
|
|
3395
|
-
else if (
|
|
3415
|
+
else if (nr(e)) for (let t of Object.keys(e)) r.push({
|
|
3396
3416
|
id: t,
|
|
3397
3417
|
value: t
|
|
3398
3418
|
});
|
|
3399
|
-
else
|
|
3419
|
+
else Tn("list2options(): case2 not implemented");
|
|
3400
3420
|
return r;
|
|
3401
3421
|
}, e.load_json_file = function(e, t, n) {
|
|
3402
3422
|
let r = new XMLHttpRequest();
|
|
@@ -3404,18 +3424,18 @@
|
|
|
3404
3424
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3405
3425
|
t(JSON.parse(r.responseText));
|
|
3406
3426
|
} catch (e) {
|
|
3407
|
-
n && (
|
|
3427
|
+
n && (Tn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3408
3428
|
}
|
|
3409
3429
|
else n && n(r.status);
|
|
3410
3430
|
var e;
|
|
3411
3431
|
}, r.send();
|
|
3412
|
-
}, e.log_debug =
|
|
3413
|
-
let n =
|
|
3414
|
-
rn && cn("info", n) && rn
|
|
3415
|
-
}, e.log_warning =
|
|
3432
|
+
}, e.log_debug = jn, e.log_error = Tn, e.log_info = function(e, ...t) {
|
|
3433
|
+
let n = yn(e, ...t), r = rl();
|
|
3434
|
+
rn && cn("info", n) && En(rn, "%c" + r + " INFO: " + String(n), "color:cyan"), gn("info", n, r);
|
|
3435
|
+
}, e.log_warning = vn, e.mask_secrets_inline = Cn, e.msg_iev_get_msg_type = Br, e.msg_iev_get_stack = Kr, e.msg_iev_push_stack = xr, e.msg_iev_read_key = Mr, e.msg_iev_set_msg_type = Yr, e.msg_iev_write_key = Wr, e.node_uuid = ol, e.parseBoolean = cr, e.parseSVG = function(e) {
|
|
3416
3436
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3417
3437
|
}, e.refresh_language = function(e, t) {
|
|
3418
|
-
if (!
|
|
3438
|
+
if (!_r(t)) return void Tn("You must supply a translation function");
|
|
3419
3439
|
e || (e = document);
|
|
3420
3440
|
const n = (t) => {
|
|
3421
3441
|
let n = [];
|
|
@@ -3439,22 +3459,22 @@
|
|
|
3439
3459
|
});
|
|
3440
3460
|
}, e.register_c_ievent_cli = function() {
|
|
3441
3461
|
return function(e) {
|
|
3442
|
-
if (
|
|
3462
|
+
if (Vl) return Tn(`GClass ALREADY created: ${e}`), -1;
|
|
3443
3463
|
const t = [
|
|
3444
3464
|
["ST_DISCONNECTED", [
|
|
3445
3465
|
[
|
|
3446
3466
|
"EV_ON_OPEN",
|
|
3447
|
-
|
|
3467
|
+
Hl,
|
|
3448
3468
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3449
3469
|
],
|
|
3450
3470
|
[
|
|
3451
3471
|
"EV_ON_CLOSE",
|
|
3452
|
-
|
|
3472
|
+
zl,
|
|
3453
3473
|
null
|
|
3454
3474
|
],
|
|
3455
3475
|
[
|
|
3456
3476
|
"EV_TIMEOUT",
|
|
3457
|
-
|
|
3477
|
+
ql,
|
|
3458
3478
|
null
|
|
3459
3479
|
],
|
|
3460
3480
|
[
|
|
@@ -3466,22 +3486,22 @@
|
|
|
3466
3486
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3467
3487
|
[
|
|
3468
3488
|
"EV_ON_MESSAGE",
|
|
3469
|
-
|
|
3489
|
+
eo,
|
|
3470
3490
|
null
|
|
3471
3491
|
],
|
|
3472
3492
|
[
|
|
3473
3493
|
"EV_IDENTITY_CARD_ACK",
|
|
3474
|
-
|
|
3494
|
+
Zl,
|
|
3475
3495
|
null
|
|
3476
3496
|
],
|
|
3477
3497
|
[
|
|
3478
3498
|
"EV_ON_CLOSE",
|
|
3479
|
-
|
|
3499
|
+
zl,
|
|
3480
3500
|
"ST_DISCONNECTED"
|
|
3481
3501
|
],
|
|
3482
3502
|
[
|
|
3483
3503
|
"EV_TIMEOUT",
|
|
3484
|
-
|
|
3504
|
+
Xl,
|
|
3485
3505
|
null
|
|
3486
3506
|
],
|
|
3487
3507
|
[
|
|
@@ -3493,22 +3513,22 @@
|
|
|
3493
3513
|
["ST_SESSION", [
|
|
3494
3514
|
[
|
|
3495
3515
|
"EV_ON_MESSAGE",
|
|
3496
|
-
|
|
3516
|
+
eo,
|
|
3497
3517
|
null
|
|
3498
3518
|
],
|
|
3499
3519
|
[
|
|
3500
3520
|
"EV_MT_STATS",
|
|
3501
|
-
|
|
3521
|
+
to,
|
|
3502
3522
|
null
|
|
3503
3523
|
],
|
|
3504
3524
|
[
|
|
3505
3525
|
"EV_MT_COMMAND",
|
|
3506
|
-
|
|
3526
|
+
no,
|
|
3507
3527
|
null
|
|
3508
3528
|
],
|
|
3509
3529
|
[
|
|
3510
3530
|
"EV_ON_CLOSE",
|
|
3511
|
-
|
|
3531
|
+
zl,
|
|
3512
3532
|
"ST_DISCONNECTED"
|
|
3513
3533
|
],
|
|
3514
3534
|
[
|
|
@@ -3519,7 +3539,7 @@
|
|
|
3519
3539
|
]],
|
|
3520
3540
|
[null, null]
|
|
3521
3541
|
];
|
|
3522
|
-
return (
|
|
3542
|
+
return (Vl = de(e, [
|
|
3523
3543
|
["EV_ON_MESSAGE", R.EVF_OUTPUT_EVENT],
|
|
3524
3544
|
["EV_IDENTITY_CARD_ACK", R.EVF_PUBLIC_EVENT],
|
|
3525
3545
|
["EV_ON_ID_NAK", R.EVF_PUBLIC_EVENT | R.EVF_OUTPUT_EVENT],
|
|
@@ -3530,36 +3550,36 @@
|
|
|
3530
3550
|
["EV_ON_OPEN_ERROR", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
3531
3551
|
["EV_TIMEOUT", 0],
|
|
3532
3552
|
[null, 0]
|
|
3533
|
-
], t,
|
|
3553
|
+
], t, ro, 0, Ll, Fl, 0, 0, Pl, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3534
3554
|
}("C_IEVENT_CLI");
|
|
3535
3555
|
}, e.register_c_timer = function() {
|
|
3536
3556
|
return function(e) {
|
|
3537
|
-
if (
|
|
3557
|
+
if (El) return Tn(`GClass ALREADY created: ${e}`), -1;
|
|
3538
3558
|
const t = [["ST_IDLE", [[
|
|
3539
3559
|
"EV_TIMEOUT",
|
|
3540
|
-
|
|
3560
|
+
Tl,
|
|
3541
3561
|
null
|
|
3542
3562
|
]]]];
|
|
3543
|
-
return (
|
|
3563
|
+
return (El = de(e, [
|
|
3544
3564
|
["EV_TIMEOUT", R.EVF_OUTPUT_EVENT],
|
|
3545
3565
|
["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT],
|
|
3546
3566
|
[0, 0]
|
|
3547
|
-
], t,
|
|
3567
|
+
], t, vl, 0, hl, yl, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3548
3568
|
}("C_TIMER");
|
|
3549
3569
|
}, e.register_c_yuno = function() {
|
|
3550
3570
|
return function(e) {
|
|
3551
|
-
if (
|
|
3571
|
+
if ($l) return Tn(`GClass ALREADY created: ${e}`), -1;
|
|
3552
3572
|
const t = [["ST_IDLE", [[
|
|
3553
3573
|
"EV_TIMEOUT_PERIODIC",
|
|
3554
|
-
|
|
3574
|
+
Al,
|
|
3555
3575
|
null
|
|
3556
3576
|
]]]];
|
|
3557
|
-
return (
|
|
3577
|
+
return ($l = de(e, [["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]], t, Il, 0, wl, Nl, 0, 0, 0, 0)) ? 0 : -1;
|
|
3558
3578
|
}("C_YUNO");
|
|
3559
3579
|
}, e.safeSrc = function(e) {
|
|
3560
3580
|
if (!e) return "";
|
|
3561
3581
|
const t = String(e).trim();
|
|
3562
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3582
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : zr(t);
|
|
3563
3583
|
}, e.sdata_flag_t = E, e.send_http_json_post = function(e, t, n) {
|
|
3564
3584
|
let r = new XMLHttpRequest();
|
|
3565
3585
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -3583,16 +3603,16 @@
|
|
|
3583
3603
|
}
|
|
3584
3604
|
} else on = e;
|
|
3585
3605
|
}, e.set_remote_log_functions = bn, e.set_strings_are_text = function(e) {
|
|
3586
|
-
|
|
3587
|
-
}, e.set_timeout =
|
|
3588
|
-
return
|
|
3606
|
+
el = !!e;
|
|
3607
|
+
}, e.set_timeout = jl, e.set_timeout_periodic = Ol, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = Gr, e.strcasecmp = gr, e.strcmp = fr, e.strings_are_text = function() {
|
|
3608
|
+
return el;
|
|
3589
3609
|
}, e.strncmp = function(e, t, n) {
|
|
3590
3610
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3591
3611
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3592
3612
|
}, e.strs_in_list = function(e, t, n) {
|
|
3593
|
-
if (!e) return
|
|
3594
|
-
if (!t) return
|
|
3595
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3613
|
+
if (!e) return Tn("ERROR: strs_in_list() list empty"), !1;
|
|
3614
|
+
if (!t) return Tn("ERROR: strs_in_list() str empty"), !1;
|
|
3615
|
+
for (let r = 0; r < t.length; r++) if (Gr(e, t[r], n)) return !0;
|
|
3596
3616
|
return !1;
|
|
3597
3617
|
}, e.strstr = function(e, t, n) {
|
|
3598
3618
|
var r;
|
|
@@ -3611,13 +3631,13 @@
|
|
|
3611
3631
|
placeholder: void 0,
|
|
3612
3632
|
fkey: null
|
|
3613
3633
|
};
|
|
3614
|
-
if (
|
|
3634
|
+
if (lr(t)) {
|
|
3615
3635
|
let e = t.split(".");
|
|
3616
3636
|
for (let t = 0; t < e.length; t++) {
|
|
3617
3637
|
let r = e[t];
|
|
3618
|
-
if (
|
|
3619
|
-
else if (
|
|
3620
|
-
else if (
|
|
3638
|
+
if (Gr(dl, r)) n.real_type || (n.real_type = r);
|
|
3639
|
+
else if (Gr(pl, r)) n.type || (n.type = r);
|
|
3640
|
+
else if (Gr(bl, r)) switch (r) {
|
|
3621
3641
|
case "writable":
|
|
3622
3642
|
n.is_writable = !0;
|
|
3623
3643
|
break;
|
|
@@ -3629,23 +3649,23 @@
|
|
|
3629
3649
|
}
|
|
3630
3650
|
}
|
|
3631
3651
|
n.real_type || (n.real_type = "string");
|
|
3632
|
-
} else
|
|
3652
|
+
} else nr(t) ? (n = ml(t), n.name || (n.name = e), n.header || (n.header = e)) : rr(t) && (n.real_type = "array", n.enum_list = t);
|
|
3633
3653
|
return n.type || (n.type = n.real_type), n;
|
|
3634
3654
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3635
3655
|
const n = e, r = performance.now();
|
|
3636
3656
|
let l = r;
|
|
3637
|
-
return t &&
|
|
3657
|
+
return t && vn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3638
3658
|
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3639
|
-
return t &&
|
|
3659
|
+
return t && vn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3640
3660
|
partial: i,
|
|
3641
3661
|
total: _
|
|
3642
3662
|
};
|
|
3643
3663
|
} };
|
|
3644
|
-
}, e.trace_json =
|
|
3645
|
-
if (
|
|
3664
|
+
}, e.trace_json = Sn, e.trace_json_masked = Gn, e.trace_level_t = P, e.trace_msg = On, e.treedb_decoder_fkey = gl, e.treedb_decoder_hook = function(e, t) {
|
|
3665
|
+
if (lr(t)) {
|
|
3646
3666
|
if (-1 === t.indexOf("^")) {
|
|
3647
3667
|
let n, r = e.hook;
|
|
3648
|
-
if (1 !==
|
|
3668
|
+
if (1 !== Zn(r)) return Tn("bad hook 1"), Tn(e), Tn(t), null;
|
|
3649
3669
|
for (let e of Object.keys(r)) {
|
|
3650
3670
|
n = e, r[e];
|
|
3651
3671
|
break;
|
|
@@ -3657,25 +3677,25 @@
|
|
|
3657
3677
|
}
|
|
3658
3678
|
{
|
|
3659
3679
|
let n = t.split("^");
|
|
3660
|
-
return 2 !== n.length ? (
|
|
3680
|
+
return 2 !== n.length ? (Tn("bad hook 2"), Tn(e), Tn(t), null) : {
|
|
3661
3681
|
topic_name: n[0],
|
|
3662
3682
|
id: n[1]
|
|
3663
3683
|
};
|
|
3664
3684
|
}
|
|
3665
3685
|
}
|
|
3666
|
-
return
|
|
3686
|
+
return nr(t) ? {
|
|
3667
3687
|
topic_name: t.topic_name,
|
|
3668
3688
|
id: t.id
|
|
3669
|
-
} : (
|
|
3689
|
+
} : (Tn("bad hook 3"), Tn(e), Tn(t), null);
|
|
3670
3690
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3671
|
-
let n =
|
|
3691
|
+
let n = gl(e, t);
|
|
3672
3692
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3673
|
-
}, e.treedb_get_field_desc =
|
|
3674
|
-
if (
|
|
3693
|
+
}, e.treedb_get_field_desc = ml, e.treedb_hook_data_size = function(e) {
|
|
3694
|
+
if (rr(e) && 1 === tr(e)) {
|
|
3675
3695
|
let t = e[0];
|
|
3676
|
-
return
|
|
3696
|
+
return pr(t, "size") ? t.size : 1;
|
|
3677
3697
|
}
|
|
3678
|
-
return
|
|
3698
|
+
return tr(e);
|
|
3679
3699
|
}, e.vsprintf = function(e, t) {
|
|
3680
3700
|
return n.apply(null, [e].concat(t || []));
|
|
3681
3701
|
}, e.walk_type_t = D;
|