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