@yuneta/gobj-js 7.26.16 → 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 +28 -17
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +877 -871
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +28 -17
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +915 -909
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +28 -17
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +877 -871
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +28 -17
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +877 -871
- 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
|
|
@@ -1401,13 +1396,15 @@ function hn(e) {
|
|
|
1401
1396
|
if ("string" == typeof e) {
|
|
1402
1397
|
if (1 === t.length) return e;
|
|
1403
1398
|
let r = 1;
|
|
1404
|
-
n = e.replace(/%[
|
|
1399
|
+
n = e.replace(/%[sdifoOj%]/g, (e) => {
|
|
1400
|
+
if ("%%" === e) return "%";
|
|
1405
1401
|
const n = t[r++];
|
|
1406
1402
|
switch (e) {
|
|
1407
1403
|
case "%s": return bn(n);
|
|
1408
1404
|
case "%d":
|
|
1409
|
-
case "%i": return mn(parseInt, n);
|
|
1410
|
-
case "%f": return mn(parseFloat, n);
|
|
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);
|
|
1411
1408
|
case "%o":
|
|
1412
1409
|
case "%O": return "object" == typeof n ? dn(n) : bn(n);
|
|
1413
1410
|
default: return e;
|
|
@@ -1419,25 +1416,34 @@ function hn(e) {
|
|
|
1419
1416
|
return n;
|
|
1420
1417
|
}
|
|
1421
1418
|
function yn(e, ...t) {
|
|
1422
|
-
|
|
1423
|
-
|
|
1419
|
+
try {
|
|
1420
|
+
e(...t);
|
|
1421
|
+
} catch (e) {
|
|
1422
|
+
try {
|
|
1423
|
+
Zt.error("a log function threw:", e);
|
|
1424
|
+
} catch (e) {}
|
|
1425
|
+
}
|
|
1424
1426
|
}
|
|
1425
1427
|
function En(e, ...t) {
|
|
1426
|
-
let n = hn(e, ...t), r =
|
|
1427
|
-
|
|
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);
|
|
1428
1430
|
}
|
|
1429
1431
|
function Tn(e, ...t) {
|
|
1430
|
-
let n = hn(e, ...t), r =
|
|
1431
|
-
|
|
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);
|
|
1432
1434
|
}
|
|
1433
1435
|
function vn(e, ...t) {
|
|
1434
|
-
let n = hn(e, ...t), r =
|
|
1435
|
-
rn && un("
|
|
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);
|
|
1438
|
+
}
|
|
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);
|
|
1436
1442
|
}
|
|
1437
|
-
function
|
|
1438
|
-
un("json", t) && (t && Zt.warn
|
|
1443
|
+
function On(e, t) {
|
|
1444
|
+
un("json", t) && (t && yn(Zt.warn, "=====> " + bn(t)), yn(Zt.dir, e)), fn("json", e, no());
|
|
1439
1445
|
}
|
|
1440
|
-
var
|
|
1446
|
+
var Sn = [
|
|
1441
1447
|
"passw",
|
|
1442
1448
|
"pwd",
|
|
1443
1449
|
"passphrase",
|
|
@@ -1449,12 +1455,12 @@ var On = [
|
|
|
1449
1455
|
"cookie",
|
|
1450
1456
|
"credential",
|
|
1451
1457
|
"salt"
|
|
1452
|
-
],
|
|
1458
|
+
], wn = [
|
|
1453
1459
|
"apikey",
|
|
1454
1460
|
"sessionid",
|
|
1455
1461
|
"sessionkey",
|
|
1456
1462
|
"authdata"
|
|
1457
|
-
],
|
|
1463
|
+
], Nn = /* @__PURE__ */ new Set([
|
|
1458
1464
|
"endpoint",
|
|
1459
1465
|
"url",
|
|
1460
1466
|
"uri",
|
|
@@ -1478,25 +1484,25 @@ var On = [
|
|
|
1478
1484
|
"expires",
|
|
1479
1485
|
"mode"
|
|
1480
1486
|
]);
|
|
1481
|
-
function
|
|
1487
|
+
function $n(e) {
|
|
1482
1488
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1483
1489
|
let t = e.toLowerCase(), n = !1;
|
|
1484
|
-
for (const e of
|
|
1490
|
+
for (const e of Sn) if (t.indexOf(e) >= 0) {
|
|
1485
1491
|
n = !0;
|
|
1486
1492
|
break;
|
|
1487
1493
|
}
|
|
1488
1494
|
if (!n) {
|
|
1489
1495
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1490
|
-
for (const t of
|
|
1496
|
+
for (const t of wn) if (e.indexOf(t) >= 0) {
|
|
1491
1497
|
n = !0;
|
|
1492
1498
|
break;
|
|
1493
1499
|
}
|
|
1494
1500
|
}
|
|
1495
1501
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1496
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1502
|
+
for (const e of t.split(/[_\-. \t]/)) if (Nn.has(e)) return !1;
|
|
1497
1503
|
return !0;
|
|
1498
1504
|
}
|
|
1499
|
-
function
|
|
1505
|
+
function Rn(e, t, n) {
|
|
1500
1506
|
const r = (e) => " " === e || " " === e, o = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1501
1507
|
let s = t;
|
|
1502
1508
|
for (;;) {
|
|
@@ -1512,12 +1518,12 @@ function $n(e, t, n) {
|
|
|
1512
1518
|
s = t;
|
|
1513
1519
|
}
|
|
1514
1520
|
}
|
|
1515
|
-
var
|
|
1516
|
-
function
|
|
1521
|
+
var xn = 128, Dn = 4194304, kn = "<not shown: too large to mask>";
|
|
1522
|
+
function An(e) {
|
|
1517
1523
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1518
|
-
if (e.length >
|
|
1524
|
+
if (e.length > Dn) return kn;
|
|
1519
1525
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1520
|
-
for (; null !== (t = r.exec(e));)
|
|
1526
|
+
for (; null !== (t = r.exec(e));) $n(t[2].slice(-128)) && (n = !0);
|
|
1521
1527
|
let o = [], s = 0, l = !1, i = "", _ = 0, a = 0;
|
|
1522
1528
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1523
1529
|
for (; a < e.length;) {
|
|
@@ -1530,8 +1536,8 @@ function kn(e) {
|
|
|
1530
1536
|
a++;
|
|
1531
1537
|
continue;
|
|
1532
1538
|
}
|
|
1533
|
-
let r = e.substring(Math.max(_, a -
|
|
1534
|
-
if (_ = a + 1, !(
|
|
1539
|
+
let r = e.substring(Math.max(_, a - xn), a);
|
|
1540
|
+
if (_ = a + 1, !($n(r) || n && "value" === r.toLowerCase())) {
|
|
1535
1541
|
a++;
|
|
1536
1542
|
continue;
|
|
1537
1543
|
}
|
|
@@ -1540,18 +1546,18 @@ function kn(e) {
|
|
|
1540
1546
|
if (f) {
|
|
1541
1547
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1542
1548
|
e[c] === f && c++;
|
|
1543
|
-
} else c =
|
|
1549
|
+
} else c = Rn(e, a, i);
|
|
1544
1550
|
c > a && (o.push(e.substring(s, a)), o.push("********"), s = c, l = !0), a = c, _ = a;
|
|
1545
1551
|
}
|
|
1546
1552
|
return l ? (o.push(e.substring(s)), o.join("")) : null;
|
|
1547
1553
|
}
|
|
1548
|
-
var
|
|
1549
|
-
var
|
|
1550
|
-
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) {
|
|
1551
1557
|
if ("string" == typeof e) {
|
|
1552
|
-
if (e.length > r.left) return r.left = 0,
|
|
1558
|
+
if (e.length > r.left) return r.left = 0, kn;
|
|
1553
1559
|
r.left -= e.length;
|
|
1554
|
-
let t =
|
|
1560
|
+
let t = An(e);
|
|
1555
1561
|
return null !== t ? t : e;
|
|
1556
1562
|
}
|
|
1557
1563
|
let o = Array.isArray(e);
|
|
@@ -1560,13 +1566,13 @@ function Ln(e, t, n, r) {
|
|
|
1560
1566
|
let t = Object.getPrototypeOf(e);
|
|
1561
1567
|
return t === Object.prototype || null === t;
|
|
1562
1568
|
}(e)) return e;
|
|
1563
|
-
if (r.left <= 0) return
|
|
1569
|
+
if (r.left <= 0) return kn;
|
|
1564
1570
|
if (t.has(e)) {
|
|
1565
1571
|
let n = t.get(e);
|
|
1566
|
-
return n ===
|
|
1572
|
+
return n === Ln ? "<cycle>" : n;
|
|
1567
1573
|
}
|
|
1568
|
-
if (n >=
|
|
1569
|
-
r.left -= 1, t.set(e,
|
|
1574
|
+
if (n >= In) return "<deeper not shown>";
|
|
1575
|
+
r.left -= 1, t.set(e, Ln);
|
|
1570
1576
|
let s, l = !1, i = !1;
|
|
1571
1577
|
if (o) {
|
|
1572
1578
|
s = [];
|
|
@@ -1576,13 +1582,13 @@ function Ln(e, t, n, r) {
|
|
|
1576
1582
|
break;
|
|
1577
1583
|
}
|
|
1578
1584
|
r.left -= 1;
|
|
1579
|
-
let _ =
|
|
1585
|
+
let _ = Pn(e[o], t, n + 1, r);
|
|
1580
1586
|
_ !== e[o] && (l = !0), s.push(_);
|
|
1581
1587
|
}
|
|
1582
|
-
i && s.push(
|
|
1588
|
+
i && s.push(kn);
|
|
1583
1589
|
} else {
|
|
1584
1590
|
s = Object.create(Object.getPrototypeOf(e));
|
|
1585
|
-
let o = "string" == typeof e.attribute &&
|
|
1591
|
+
let o = "string" == typeof e.attribute && $n(e.attribute.slice(-128));
|
|
1586
1592
|
for (const _ in e) {
|
|
1587
1593
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1588
1594
|
if (r.left <= 0) {
|
|
@@ -1591,33 +1597,33 @@ function Ln(e, t, n, r) {
|
|
|
1591
1597
|
}
|
|
1592
1598
|
r.left -= 1 + _.length;
|
|
1593
1599
|
let a, u = e[_];
|
|
1594
|
-
a = (
|
|
1600
|
+
a = ($n(_.slice(-128)) || o && "value" === _) && null != u && "" !== u ? "********" : Pn(u, t, n + 1, r), a !== u && (l = !0), mr(s, _, a);
|
|
1595
1601
|
}
|
|
1596
|
-
i && (s["<more>"] =
|
|
1602
|
+
i && (s["<more>"] = kn);
|
|
1597
1603
|
}
|
|
1598
1604
|
return l || i || (s = e), t.set(e, s), s;
|
|
1599
1605
|
}
|
|
1600
|
-
function
|
|
1606
|
+
function Un(e) {
|
|
1601
1607
|
try {
|
|
1602
|
-
return
|
|
1608
|
+
return Pn(e, /* @__PURE__ */ new WeakMap(), 0, { left: Dn });
|
|
1603
1609
|
} catch (e) {
|
|
1604
|
-
return
|
|
1610
|
+
return Cn;
|
|
1605
1611
|
}
|
|
1606
1612
|
}
|
|
1607
|
-
function
|
|
1608
|
-
|
|
1613
|
+
function Fn(e, t) {
|
|
1614
|
+
On(Un(e), t);
|
|
1609
1615
|
}
|
|
1610
|
-
function
|
|
1616
|
+
function Vn(e) {
|
|
1611
1617
|
return structuredClone(e);
|
|
1612
1618
|
}
|
|
1613
|
-
function
|
|
1619
|
+
function Gn(e, t) {
|
|
1614
1620
|
if (e === t) return !0;
|
|
1615
1621
|
if (null === e || null === t) return e === t;
|
|
1616
1622
|
if (typeof e != typeof t) return !1;
|
|
1617
1623
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1618
1624
|
if (Array.isArray(e)) {
|
|
1619
1625
|
if (e.length !== t.length) return !1;
|
|
1620
|
-
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;
|
|
1621
1627
|
return !0;
|
|
1622
1628
|
}
|
|
1623
1629
|
if ("object" == typeof e) {
|
|
@@ -1625,118 +1631,118 @@ function Vn(e, t) {
|
|
|
1625
1631
|
if (n.length !== r.length) return !1;
|
|
1626
1632
|
for (let o = 0; o < n.length; o++) {
|
|
1627
1633
|
if (n[o] !== r[o]) return !1;
|
|
1628
|
-
if (!
|
|
1634
|
+
if (!Gn(e[n[o]], t[r[o]])) return !1;
|
|
1629
1635
|
}
|
|
1630
1636
|
return !0;
|
|
1631
1637
|
}
|
|
1632
1638
|
return e === t;
|
|
1633
1639
|
}
|
|
1634
|
-
function Gn(e, t) {
|
|
1635
|
-
if (!t) return e;
|
|
1636
|
-
for (let n of Object.keys(t)) br(e, n, t[n]);
|
|
1637
|
-
return e;
|
|
1638
|
-
}
|
|
1639
1640
|
function Mn(e, t) {
|
|
1640
1641
|
if (!t) return e;
|
|
1641
|
-
for (let n
|
|
1642
|
+
for (let n of Object.keys(t)) mr(e, n, t[n]);
|
|
1642
1643
|
return e;
|
|
1643
1644
|
}
|
|
1644
1645
|
function Wn(e, t) {
|
|
1645
1646
|
if (!t) return e;
|
|
1646
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) &&
|
|
1647
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && mr(e, n, t[n]);
|
|
1647
1648
|
return e;
|
|
1648
1649
|
}
|
|
1649
1650
|
function Kn(e, t) {
|
|
1650
|
-
if (
|
|
1651
|
+
if (!t) return e;
|
|
1652
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && mr(e, n, t[n]);
|
|
1653
|
+
return e;
|
|
1651
1654
|
}
|
|
1652
1655
|
function Yn(e, t) {
|
|
1653
|
-
e && Object.prototype.hasOwnProperty.call(e, t)
|
|
1656
|
+
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1654
1657
|
}
|
|
1655
|
-
function Bn(e, t
|
|
1656
|
-
|
|
1658
|
+
function Bn(e, t) {
|
|
1659
|
+
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1657
1660
|
}
|
|
1658
1661
|
function Jn(e, t, n) {
|
|
1659
|
-
|
|
1662
|
+
mr(e, t, n);
|
|
1660
1663
|
}
|
|
1661
|
-
function qn(e, t) {
|
|
1662
|
-
e
|
|
1664
|
+
function qn(e, t, n) {
|
|
1665
|
+
mr(e, t, n);
|
|
1663
1666
|
}
|
|
1664
1667
|
function Hn(e, t) {
|
|
1665
1668
|
e.push(t);
|
|
1666
1669
|
}
|
|
1667
1670
|
function zn(e, t) {
|
|
1668
|
-
e.
|
|
1671
|
+
e.push(t);
|
|
1669
1672
|
}
|
|
1670
|
-
function Qn(e) {
|
|
1671
|
-
|
|
1673
|
+
function Qn(e, t) {
|
|
1674
|
+
e.splice(t, 1);
|
|
1672
1675
|
}
|
|
1673
1676
|
function Xn(e) {
|
|
1674
|
-
return tr(e) ? e.length : 0;
|
|
1677
|
+
return tr(e) ? Object.keys(e).length : 0;
|
|
1675
1678
|
}
|
|
1676
1679
|
function Zn(e) {
|
|
1677
|
-
return
|
|
1680
|
+
return nr(e) ? e.length : 0;
|
|
1678
1681
|
}
|
|
1679
1682
|
function er(e) {
|
|
1680
|
-
return
|
|
1683
|
+
return tr(e) ? Object.keys(e).length : nr(e) ? e.length : rr(e) && e.length > 0 ? 1 : 0;
|
|
1681
1684
|
}
|
|
1682
1685
|
function tr(e) {
|
|
1683
|
-
return Array.isArray(e);
|
|
1686
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1684
1687
|
}
|
|
1685
1688
|
function nr(e) {
|
|
1686
|
-
return
|
|
1689
|
+
return Array.isArray(e);
|
|
1687
1690
|
}
|
|
1688
1691
|
function rr(e) {
|
|
1689
|
-
return "
|
|
1692
|
+
return "string" == typeof e;
|
|
1690
1693
|
}
|
|
1691
1694
|
function or(e) {
|
|
1692
|
-
return "
|
|
1695
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1693
1696
|
}
|
|
1694
1697
|
function sr(e) {
|
|
1695
|
-
return
|
|
1698
|
+
return "boolean" == typeof e;
|
|
1696
1699
|
}
|
|
1697
1700
|
function lr(e) {
|
|
1698
|
-
return
|
|
1701
|
+
return null == e;
|
|
1699
1702
|
}
|
|
1700
1703
|
function ir(e) {
|
|
1701
|
-
return
|
|
1704
|
+
return "function" == typeof e;
|
|
1702
1705
|
}
|
|
1703
1706
|
function _r(e) {
|
|
1704
|
-
return
|
|
1707
|
+
return e instanceof O;
|
|
1705
1708
|
}
|
|
1706
1709
|
function ar(e) {
|
|
1707
|
-
return rr(e)
|
|
1710
|
+
return !rr(e) || 0 === e.length;
|
|
1708
1711
|
}
|
|
1709
|
-
function ur(e
|
|
1710
|
-
return e
|
|
1712
|
+
function ur(e) {
|
|
1713
|
+
return or(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1711
1714
|
}
|
|
1712
1715
|
function cr(e, t) {
|
|
1716
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1717
|
+
}
|
|
1718
|
+
function fr(e, t) {
|
|
1713
1719
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1714
1720
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1715
1721
|
}
|
|
1716
|
-
function
|
|
1717
|
-
if (
|
|
1718
|
-
if (
|
|
1722
|
+
function gr(e, t) {
|
|
1723
|
+
if (tr(e) || tr(t) || nr(e) || nr(t)) return 0;
|
|
1724
|
+
if (or(e) || or(t)) {
|
|
1719
1725
|
let n = Number(e), r = Number(t);
|
|
1720
1726
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1721
1727
|
}
|
|
1722
|
-
if (
|
|
1728
|
+
if (sr(e) || sr(t)) {
|
|
1723
1729
|
let n = Number(e), r = Number(t);
|
|
1724
1730
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1725
1731
|
}
|
|
1726
|
-
return
|
|
1732
|
+
return cr(String(e), String(t));
|
|
1727
1733
|
}
|
|
1728
|
-
function
|
|
1729
|
-
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);
|
|
1730
1736
|
else "string" == typeof t && delete e[t];
|
|
1731
1737
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1732
1738
|
}
|
|
1733
|
-
function
|
|
1739
|
+
function dr(e, t) {
|
|
1734
1740
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1735
1741
|
}
|
|
1736
|
-
function
|
|
1742
|
+
function br(e, t) {
|
|
1737
1743
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1738
1744
|
}
|
|
1739
|
-
function
|
|
1745
|
+
function mr(e, t, n) {
|
|
1740
1746
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1741
1747
|
value: n,
|
|
1742
1748
|
writable: !0,
|
|
@@ -1744,205 +1750,205 @@ function br(e, t, n) {
|
|
|
1744
1750
|
configurable: !0
|
|
1745
1751
|
}) : e[t] = n;
|
|
1746
1752
|
}
|
|
1747
|
-
function
|
|
1753
|
+
function hr(e, t) {
|
|
1748
1754
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
1749
1755
|
const n = Number(t);
|
|
1750
1756
|
return n >= e.length ? -1 : n;
|
|
1751
1757
|
}
|
|
1752
|
-
function
|
|
1753
|
-
e && !
|
|
1758
|
+
function yr(e, t, n, r) {
|
|
1759
|
+
e && !_r(e) && En("GObj bad instanceof");
|
|
1754
1760
|
const o = e ? `${Ze(e)}: ` : "";
|
|
1755
|
-
if (!
|
|
1756
|
-
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)}`);
|
|
1757
1763
|
let s = n.split("`"), l = s.length;
|
|
1758
1764
|
for (let e = 0; e < l; e++) {
|
|
1759
|
-
if (
|
|
1760
|
-
const l =
|
|
1761
|
-
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}'`));
|
|
1762
1768
|
s[e] = String(l);
|
|
1763
1769
|
}
|
|
1764
|
-
if (
|
|
1770
|
+
if (br(t, s[e])) return void (r && En(`${o}path not found: '${n}'`));
|
|
1765
1771
|
if (e === l - 1) break;
|
|
1766
|
-
if (null == (t = t[s[e]])) return void (r &&
|
|
1767
|
-
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}'`);
|
|
1768
1774
|
}
|
|
1769
1775
|
let i = t[s[l - 1]];
|
|
1770
|
-
return void 0 === i && r &&
|
|
1776
|
+
return void 0 === i && r && En(`${o}path not found: '${n}'`), i;
|
|
1771
1777
|
}
|
|
1772
|
-
function
|
|
1773
|
-
e && !
|
|
1778
|
+
function Er(e, t, n) {
|
|
1779
|
+
e && !_r(e) && En("GObj bad instanceof");
|
|
1774
1780
|
const r = e ? Ze(e) + ": " : "";
|
|
1775
|
-
if (!
|
|
1781
|
+
if (!rr(n)) return En(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
1776
1782
|
let [o, s] = function(e, t) {
|
|
1777
1783
|
let n = e.lastIndexOf(t);
|
|
1778
1784
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1779
1785
|
}(n, "`"), l = t;
|
|
1780
|
-
if (
|
|
1781
|
-
else if (l =
|
|
1782
|
-
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);
|
|
1783
1789
|
}
|
|
1784
|
-
function
|
|
1785
|
-
e && !
|
|
1786
|
-
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);
|
|
1787
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;
|
|
1788
1794
|
if (void 0 === s) {
|
|
1789
1795
|
if (i && t) {
|
|
1790
1796
|
let o = Boolean(r);
|
|
1791
|
-
return
|
|
1797
|
+
return Nr(e, t, n, o), o;
|
|
1792
1798
|
}
|
|
1793
|
-
return l && (
|
|
1799
|
+
return l && (En(`path not found: '${n}'`), Fn(t)), Boolean(r);
|
|
1794
1800
|
}
|
|
1795
1801
|
let u;
|
|
1796
|
-
if (
|
|
1797
|
-
else if (a &&
|
|
1798
|
-
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);
|
|
1799
1805
|
else {
|
|
1800
|
-
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));
|
|
1801
1807
|
u = !1;
|
|
1802
1808
|
}
|
|
1803
|
-
return _ &&
|
|
1809
|
+
return _ && Er(e, t, n), u;
|
|
1804
1810
|
}
|
|
1805
|
-
function
|
|
1806
|
-
e && !
|
|
1807
|
-
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);
|
|
1808
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;
|
|
1809
1815
|
if (void 0 === s) {
|
|
1810
1816
|
if (i && t) {
|
|
1811
1817
|
let o = parseInt(r);
|
|
1812
|
-
return
|
|
1818
|
+
return Nr(e, t, n, o), o;
|
|
1813
1819
|
}
|
|
1814
|
-
return l && (
|
|
1820
|
+
return l && (En(`path not found: '${n}'`), Fn(t)), parseInt(r);
|
|
1815
1821
|
}
|
|
1816
1822
|
let u;
|
|
1817
|
-
if (
|
|
1823
|
+
if (or(s)) u = Math.trunc(s);
|
|
1818
1824
|
else {
|
|
1819
|
-
if (!a) return
|
|
1820
|
-
if (
|
|
1821
|
-
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) {
|
|
1822
1828
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1823
1829
|
if (!t) return 0;
|
|
1824
1830
|
let n, r = t[2];
|
|
1825
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;
|
|
1826
1832
|
}(s);
|
|
1827
1833
|
else {
|
|
1828
|
-
if (null !== s) return
|
|
1834
|
+
if (null !== s) return En(`${e ? Ze(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Fn(t), 0;
|
|
1829
1835
|
u = 0;
|
|
1830
1836
|
}
|
|
1831
1837
|
}
|
|
1832
|
-
return _ &&
|
|
1838
|
+
return _ && Er(e, t, n), u;
|
|
1833
1839
|
}
|
|
1834
|
-
function
|
|
1835
|
-
e && !
|
|
1836
|
-
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);
|
|
1837
1843
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1838
|
-
return void 0 === s ? i && t ? (
|
|
1839
|
-
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;
|
|
1840
1846
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1841
|
-
if (!
|
|
1847
|
+
if (!tr(r) && !nr(r)) return !1;
|
|
1842
1848
|
r = r[n[e]];
|
|
1843
1849
|
}
|
|
1844
|
-
return !(!
|
|
1845
|
-
}(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);
|
|
1846
1852
|
}
|
|
1847
|
-
function
|
|
1848
|
-
e && !
|
|
1849
|
-
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);
|
|
1850
1856
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1851
1857
|
if (void 0 === s) {
|
|
1852
1858
|
if (i) {
|
|
1853
1859
|
let o = r;
|
|
1854
|
-
return
|
|
1860
|
+
return Nr(e, t, n, o), o;
|
|
1855
1861
|
}
|
|
1856
|
-
return l && (
|
|
1862
|
+
return l && (En(`path not found: '${n}'`), Fn(t)), r;
|
|
1857
1863
|
}
|
|
1858
|
-
return _ &&
|
|
1864
|
+
return _ && Er(e, t, n), s;
|
|
1859
1865
|
}
|
|
1860
|
-
function
|
|
1861
|
-
e && !
|
|
1862
|
-
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);
|
|
1863
1869
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1864
|
-
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);
|
|
1865
1871
|
}
|
|
1866
|
-
function
|
|
1867
|
-
e && !
|
|
1868
|
-
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);
|
|
1869
1875
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
1870
1876
|
if (void 0 === s) {
|
|
1871
1877
|
if (i) {
|
|
1872
1878
|
let o = r;
|
|
1873
|
-
return
|
|
1879
|
+
return Nr(e, t, n, o), o;
|
|
1874
1880
|
}
|
|
1875
|
-
return l && (
|
|
1881
|
+
return l && (En(`path not found: '${n}'`), Fn(t)), r;
|
|
1876
1882
|
}
|
|
1877
|
-
return _ &&
|
|
1883
|
+
return _ && Er(e, t, n), s;
|
|
1878
1884
|
}
|
|
1879
|
-
function
|
|
1880
|
-
if (e && !
|
|
1881
|
-
if (!
|
|
1882
|
-
if ("" === n) return
|
|
1883
|
-
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;
|
|
1884
1890
|
let o = n.split("`"), s = o.length;
|
|
1885
1891
|
for (let l = 0; l < s; l++) {
|
|
1886
1892
|
let i = o[l];
|
|
1887
|
-
if (
|
|
1888
|
-
const r =
|
|
1889
|
-
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;
|
|
1890
1896
|
i = String(r);
|
|
1891
1897
|
}
|
|
1892
|
-
if (l === s - 1)
|
|
1898
|
+
if (l === s - 1) mr(t, i, r);
|
|
1893
1899
|
else {
|
|
1894
|
-
let r =
|
|
1895
|
-
if (void 0 === r)
|
|
1896
|
-
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;
|
|
1897
1903
|
t = t[i];
|
|
1898
1904
|
}
|
|
1899
1905
|
}
|
|
1900
1906
|
return 0;
|
|
1901
1907
|
}
|
|
1902
|
-
function
|
|
1903
|
-
if (e && !
|
|
1904
|
-
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);
|
|
1905
1911
|
if (void 0 === s) {
|
|
1906
|
-
if (!
|
|
1912
|
+
if (!rr(n) || function(e, t) {
|
|
1907
1913
|
let n = t.split("`"), r = e;
|
|
1908
1914
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1909
|
-
if (
|
|
1910
|
-
const t =
|
|
1915
|
+
if (nr(r)) {
|
|
1916
|
+
const t = hr(r, n[e]);
|
|
1911
1917
|
if (t < 0) return !1;
|
|
1912
1918
|
r = r[t];
|
|
1913
1919
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
1914
1920
|
if (null == r) return !1;
|
|
1915
|
-
if (!
|
|
1921
|
+
if (!tr(r) && !nr(r)) return !0;
|
|
1916
1922
|
}
|
|
1917
1923
|
return !1;
|
|
1918
1924
|
}(t, n)) return -1;
|
|
1919
|
-
if (s = {},
|
|
1925
|
+
if (s = {}, Nr(e, t, n, s) < 0) return -1;
|
|
1920
1926
|
}
|
|
1921
|
-
return
|
|
1927
|
+
return tr(s) ? (mr(s, r, o), 0) : (En(`subdict is not an object: '${n}'`), -1);
|
|
1922
1928
|
}
|
|
1923
|
-
function
|
|
1929
|
+
function Rr(e, n, r) {
|
|
1924
1930
|
let o = "", s = !1;
|
|
1925
|
-
if (
|
|
1931
|
+
if (nr(n)) {
|
|
1926
1932
|
s = !1;
|
|
1927
1933
|
for (let l = 0; l < n.length; l++) {
|
|
1928
1934
|
let i = n[l];
|
|
1929
|
-
if (o =
|
|
1935
|
+
if (o = ar(r) ? t("%s", r) : t("%s`%d", r, l), s = Rr(e, i, o), s) break;
|
|
1930
1936
|
}
|
|
1931
|
-
} else if (
|
|
1937
|
+
} else if (tr(n)) {
|
|
1932
1938
|
s = !0;
|
|
1933
1939
|
let l = Object.keys(n);
|
|
1934
1940
|
for (let i = 0; i < l.length; i++) {
|
|
1935
1941
|
let _ = l[i], a = n[_];
|
|
1936
|
-
if (o =
|
|
1937
|
-
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;
|
|
1938
1944
|
continue;
|
|
1939
1945
|
}
|
|
1940
|
-
let u =
|
|
1941
|
-
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) {
|
|
1942
1948
|
s = !1;
|
|
1943
1949
|
break;
|
|
1944
1950
|
}
|
|
1945
|
-
if (0 !==
|
|
1951
|
+
if (0 !== gr(u, a)) {
|
|
1946
1952
|
s = !1;
|
|
1947
1953
|
break;
|
|
1948
1954
|
}
|
|
@@ -1950,59 +1956,59 @@ function $r(e, n, r) {
|
|
|
1950
1956
|
}
|
|
1951
1957
|
return s;
|
|
1952
1958
|
}
|
|
1953
|
-
function
|
|
1954
|
-
return 0 ===
|
|
1959
|
+
function xr(e, t) {
|
|
1960
|
+
return 0 === er(t) || Rr(e, t, "");
|
|
1955
1961
|
}
|
|
1956
|
-
function
|
|
1957
|
-
e && !
|
|
1962
|
+
function Dr(e, t, n, r) {
|
|
1963
|
+
e && !_r(e) && En("GObj bad instanceof");
|
|
1958
1964
|
let o = {};
|
|
1959
|
-
if (
|
|
1965
|
+
if (rr(n) && !ar(n)) {
|
|
1960
1966
|
let s = n;
|
|
1961
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1962
|
-
} 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}`);
|
|
1963
1969
|
else {
|
|
1964
|
-
if (!(
|
|
1970
|
+
if (!(nr(n) && Zn(n) > 0)) return t;
|
|
1965
1971
|
for (let s = 0; s < n.length; s++) {
|
|
1966
1972
|
let l = n[s];
|
|
1967
|
-
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}`);
|
|
1968
1974
|
}
|
|
1969
1975
|
}
|
|
1970
1976
|
return o;
|
|
1971
1977
|
}
|
|
1972
|
-
function
|
|
1978
|
+
function kr(e, t, n, r) {
|
|
1973
1979
|
let o = {};
|
|
1974
|
-
if (!
|
|
1975
|
-
if (
|
|
1980
|
+
if (!tr(t)) return o;
|
|
1981
|
+
if (Mn(o, t), rr(n) && !ar(n)) {
|
|
1976
1982
|
let s = n;
|
|
1977
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1978
|
-
} 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}`);
|
|
1979
1985
|
else {
|
|
1980
|
-
if (!(
|
|
1986
|
+
if (!(nr(n) && Zn(n) > 0)) return {};
|
|
1981
1987
|
for (let s = 0; s < n.length; s++) {
|
|
1982
1988
|
let l = n[s];
|
|
1983
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
1989
|
+
Object.prototype.hasOwnProperty.call(t, l) ? Bn(o, l) : r && En(`${Ze(e)}: key not found: ${l}`);
|
|
1984
1990
|
}
|
|
1985
1991
|
}
|
|
1986
1992
|
return o;
|
|
1987
1993
|
}
|
|
1988
|
-
function
|
|
1994
|
+
function Ar(e, t, n = !1) {
|
|
1989
1995
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1990
1996
|
let r = window.localStorage.getItem(e);
|
|
1991
|
-
return null === r ? (n &&
|
|
1997
|
+
return null === r ? (n && Ir(e, t), t) : JSON.parse(r);
|
|
1992
1998
|
} catch (n) {
|
|
1993
1999
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1994
2000
|
}
|
|
1995
2001
|
}
|
|
1996
|
-
function
|
|
2002
|
+
function Ir(e, t) {
|
|
1997
2003
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1998
|
-
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;
|
|
1999
2005
|
try {
|
|
2000
2006
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
2001
2007
|
} catch (t) {
|
|
2002
|
-
return
|
|
2008
|
+
return En(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
2003
2009
|
}
|
|
2004
2010
|
}
|
|
2005
|
-
function
|
|
2011
|
+
function Cr(e) {
|
|
2006
2012
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
2007
2013
|
window.localStorage.removeItem(e);
|
|
2008
2014
|
} catch (t) {
|
|
@@ -2010,46 +2016,46 @@ function Ir(e) {
|
|
|
2010
2016
|
}
|
|
2011
2017
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2012
2018
|
}
|
|
2013
|
-
function
|
|
2014
|
-
if (
|
|
2015
|
-
if (
|
|
2019
|
+
function Lr(e, t) {
|
|
2020
|
+
if (lr(e) || lr(t)) return !0;
|
|
2021
|
+
if (nr(e)) {
|
|
2016
2022
|
if (0 === e.length) return !0;
|
|
2017
2023
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2018
|
-
} else if (
|
|
2024
|
+
} else if (tr(e)) {
|
|
2019
2025
|
if (0 === Object.keys(e).length) return !0;
|
|
2020
2026
|
for (let n in e) if (n === t) return !0;
|
|
2021
|
-
} else if (
|
|
2027
|
+
} else if (rr(e) && e === t) return !0;
|
|
2022
2028
|
return !1;
|
|
2023
2029
|
}
|
|
2024
|
-
function
|
|
2025
|
-
if (e && !
|
|
2026
|
-
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);
|
|
2027
2033
|
let s = [];
|
|
2028
|
-
if (
|
|
2034
|
+
if (nr(t)) for (let l = 0; l < t.length; l++) {
|
|
2029
2035
|
let i, _ = t[l];
|
|
2030
|
-
if (
|
|
2036
|
+
if (tr(_)) i = jr(e, _, "id", "", 0);
|
|
2031
2037
|
else {
|
|
2032
|
-
if (!
|
|
2038
|
+
if (!rr(_)) continue;
|
|
2033
2039
|
i = _;
|
|
2034
2040
|
}
|
|
2035
|
-
|
|
2041
|
+
Lr(n, i) && o(_, r) && s.push(_);
|
|
2036
2042
|
}
|
|
2037
2043
|
else {
|
|
2038
|
-
if (!
|
|
2044
|
+
if (!tr(t)) return En("kw_collect() BAD kw parameter"), null;
|
|
2039
2045
|
for (let e of Object.keys(t)) {
|
|
2040
2046
|
let l = t[e];
|
|
2041
|
-
|
|
2047
|
+
Lr(n, e) && o(l, r) && s.push(l);
|
|
2042
2048
|
}
|
|
2043
2049
|
}
|
|
2044
2050
|
return s;
|
|
2045
2051
|
}
|
|
2046
|
-
function
|
|
2052
|
+
function Ur(e, t) {
|
|
2047
2053
|
if (!e) return -1;
|
|
2048
2054
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2049
2055
|
return -1;
|
|
2050
2056
|
}
|
|
2051
|
-
function
|
|
2052
|
-
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;
|
|
2053
2059
|
let r = e.length;
|
|
2054
2060
|
if (n) {
|
|
2055
2061
|
t = t.toLowerCase();
|
|
@@ -2060,7 +2066,7 @@ function Ur(e, t, n) {
|
|
|
2060
2066
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2061
2067
|
return !1;
|
|
2062
2068
|
}
|
|
2063
|
-
function
|
|
2069
|
+
function Vr(e, t) {
|
|
2064
2070
|
try {
|
|
2065
2071
|
let n = e.__md_iev__;
|
|
2066
2072
|
if (n) return n[t];
|
|
@@ -2068,35 +2074,35 @@ function Fr(e, t) {
|
|
|
2068
2074
|
return;
|
|
2069
2075
|
}
|
|
2070
2076
|
}
|
|
2071
|
-
function
|
|
2077
|
+
function Gr(e, t, n) {
|
|
2072
2078
|
let r = e.__md_iev__;
|
|
2073
2079
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2074
2080
|
}
|
|
2075
|
-
function
|
|
2076
|
-
if (!
|
|
2081
|
+
function Mr(e, t, n, r) {
|
|
2082
|
+
if (!_r(e)) return En("gobj is not a GObj"), null;
|
|
2077
2083
|
if (!t) return;
|
|
2078
|
-
let o =
|
|
2079
|
-
o || (o = [],
|
|
2084
|
+
let o = Vr(t, n);
|
|
2085
|
+
o || (o = [], Gr(t, n, o));
|
|
2080
2086
|
try {
|
|
2081
|
-
|
|
2087
|
+
nr(o) && o.unshift(r);
|
|
2082
2088
|
} catch (e) {
|
|
2083
|
-
|
|
2089
|
+
En(e);
|
|
2084
2090
|
}
|
|
2085
2091
|
}
|
|
2086
|
-
function
|
|
2087
|
-
if (!
|
|
2088
|
-
if (!
|
|
2089
|
-
let o =
|
|
2090
|
-
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);
|
|
2091
2097
|
}
|
|
2092
|
-
function
|
|
2093
|
-
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;
|
|
2094
2100
|
}
|
|
2095
|
-
function
|
|
2096
|
-
return
|
|
2101
|
+
function Yr(e, t) {
|
|
2102
|
+
return jr(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2097
2103
|
}
|
|
2098
|
-
function
|
|
2099
|
-
void 0 !== n &&
|
|
2104
|
+
function Br(e, t, n) {
|
|
2105
|
+
void 0 !== n && rr(n) || (n = "");
|
|
2100
2106
|
for (let r of Object.keys(e)) {
|
|
2101
2107
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2102
2108
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -2105,10 +2111,10 @@ function Yr(e, t, n) {
|
|
|
2105
2111
|
r,
|
|
2106
2112
|
e[r],
|
|
2107
2113
|
n
|
|
2108
|
-
]),
|
|
2114
|
+
]), tr(e[r]) && Br(e[r], t, n), n = n.slice(0, -o.length);
|
|
2109
2115
|
}
|
|
2110
2116
|
}
|
|
2111
|
-
function
|
|
2117
|
+
function Jr(e, t, n, r) {
|
|
2112
2118
|
if (!e) return null;
|
|
2113
2119
|
let o, s = e.length;
|
|
2114
2120
|
for (o = 0; o < s; o++) {
|
|
@@ -2116,15 +2122,15 @@ function Br(e, t, n, r) {
|
|
|
2116
2122
|
if (s) {
|
|
2117
2123
|
let e = s.id;
|
|
2118
2124
|
if (e && e === n) return s;
|
|
2119
|
-
if (r &&
|
|
2120
|
-
let e =
|
|
2125
|
+
if (r && dr(s, t)) {
|
|
2126
|
+
let e = Jr(s[t], t, n, r);
|
|
2121
2127
|
if (e) return e;
|
|
2122
2128
|
}
|
|
2123
2129
|
}
|
|
2124
2130
|
}
|
|
2125
2131
|
return null;
|
|
2126
2132
|
}
|
|
2127
|
-
function
|
|
2133
|
+
function qr(e) {
|
|
2128
2134
|
function t(e) {
|
|
2129
2135
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2130
2136
|
switch (t.length % 4) {
|
|
@@ -2155,10 +2161,10 @@ function Jr(e) {
|
|
|
2155
2161
|
signature: t(n[2])
|
|
2156
2162
|
};
|
|
2157
2163
|
}
|
|
2158
|
-
function
|
|
2164
|
+
function Hr(e) {
|
|
2159
2165
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2160
2166
|
}
|
|
2161
|
-
var
|
|
2167
|
+
var zr = class {
|
|
2162
2168
|
constructor(e) {
|
|
2163
2169
|
this.html = e, Object.freeze(this);
|
|
2164
2170
|
}
|
|
@@ -2166,41 +2172,41 @@ var Hr = class {
|
|
|
2166
2172
|
return this.html;
|
|
2167
2173
|
}
|
|
2168
2174
|
};
|
|
2169
|
-
function zr(e) {
|
|
2170
|
-
return e instanceof Hr;
|
|
2171
|
-
}
|
|
2172
2175
|
function Qr(e) {
|
|
2176
|
+
return e instanceof zr;
|
|
2177
|
+
}
|
|
2178
|
+
function Xr(e) {
|
|
2173
2179
|
const t = document.createElement("template");
|
|
2174
2180
|
return t.innerHTML = e.html.trim(), t.content;
|
|
2175
2181
|
}
|
|
2176
|
-
var
|
|
2177
|
-
function
|
|
2182
|
+
var Zr = !1, eo = /* @__PURE__ */ new Set();
|
|
2183
|
+
function to(e) {
|
|
2178
2184
|
const t = document.createElement("template");
|
|
2179
2185
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2180
2186
|
}
|
|
2181
|
-
function
|
|
2187
|
+
function no(e) {
|
|
2182
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();
|
|
2183
2189
|
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
2184
2190
|
}
|
|
2185
|
-
function
|
|
2191
|
+
function ro(e, t) {
|
|
2186
2192
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2187
2193
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2188
2194
|
return -1;
|
|
2189
2195
|
}
|
|
2190
|
-
function
|
|
2196
|
+
function oo() {
|
|
2191
2197
|
let e = "";
|
|
2192
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;
|
|
2193
2199
|
}
|
|
2194
|
-
function
|
|
2200
|
+
function so(e) {
|
|
2195
2201
|
let t = null;
|
|
2196
2202
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2197
2203
|
}
|
|
2198
|
-
var
|
|
2199
|
-
function
|
|
2204
|
+
var lo = 256, io = 1e5;
|
|
2205
|
+
function _o(e) {
|
|
2200
2206
|
const t = String(e).replace(/`/g, "``");
|
|
2201
2207
|
return "[" === t[0] ? "[" + t : t;
|
|
2202
2208
|
}
|
|
2203
|
-
function
|
|
2209
|
+
function ao(e) {
|
|
2204
2210
|
if ("string" != typeof e) return null;
|
|
2205
2211
|
let t = [], n = "";
|
|
2206
2212
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2221,17 +2227,17 @@ function _o(e) {
|
|
|
2221
2227
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2222
2228
|
});
|
|
2223
2229
|
}
|
|
2224
|
-
function
|
|
2230
|
+
function uo(e, t) {
|
|
2225
2231
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2226
2232
|
}
|
|
2227
|
-
function
|
|
2233
|
+
function co(e) {
|
|
2228
2234
|
return "persistent-attrs-" + Ze(e);
|
|
2229
2235
|
}
|
|
2230
|
-
function
|
|
2231
|
-
if (
|
|
2236
|
+
function fo(e, t) {
|
|
2237
|
+
if (rr(t)) {
|
|
2232
2238
|
if (-1 === t.indexOf("^")) {
|
|
2233
2239
|
let n, r, o = e.fkey;
|
|
2234
|
-
if (1 !==
|
|
2240
|
+
if (1 !== Xn(o)) return En("bad fkey 1"), En(e), En(t), null;
|
|
2235
2241
|
for (const e of Object.keys(o)) {
|
|
2236
2242
|
n = e, r = o[e];
|
|
2237
2243
|
break;
|
|
@@ -2244,20 +2250,20 @@ function co(e, t) {
|
|
|
2244
2250
|
}
|
|
2245
2251
|
{
|
|
2246
2252
|
let n = t.split("^");
|
|
2247
|
-
return 3 !== n.length ? (
|
|
2253
|
+
return 3 !== n.length ? (En("bad fkey 2"), En(e), En(t), null) : {
|
|
2248
2254
|
topic_name: n[0],
|
|
2249
2255
|
id: n[1],
|
|
2250
2256
|
hook_name: n[2]
|
|
2251
2257
|
};
|
|
2252
2258
|
}
|
|
2253
2259
|
}
|
|
2254
|
-
return
|
|
2260
|
+
return tr(t) ? {
|
|
2255
2261
|
topic_name: t.topic_name,
|
|
2256
2262
|
id: t.id,
|
|
2257
2263
|
hook_name: t.hook_name
|
|
2258
|
-
} : (
|
|
2264
|
+
} : (En("bad fkey 3"), En(e), En(t), null);
|
|
2259
2265
|
}
|
|
2260
|
-
var
|
|
2266
|
+
var go = [
|
|
2261
2267
|
"string",
|
|
2262
2268
|
"integer",
|
|
2263
2269
|
"object",
|
|
@@ -2267,7 +2273,7 @@ var fo = [
|
|
|
2267
2273
|
"real",
|
|
2268
2274
|
"boolean",
|
|
2269
2275
|
"blob"
|
|
2270
|
-
],
|
|
2276
|
+
], po = [
|
|
2271
2277
|
"persistent",
|
|
2272
2278
|
"required",
|
|
2273
2279
|
"notnull",
|
|
@@ -2279,7 +2285,7 @@ var fo = [
|
|
|
2279
2285
|
"stats",
|
|
2280
2286
|
"rstats",
|
|
2281
2287
|
"pstats"
|
|
2282
|
-
],
|
|
2288
|
+
], bo = [
|
|
2283
2289
|
"hook",
|
|
2284
2290
|
"fkey",
|
|
2285
2291
|
"enum",
|
|
@@ -2308,7 +2314,7 @@ var fo = [
|
|
|
2308
2314
|
"coordinates",
|
|
2309
2315
|
"gbuffer"
|
|
2310
2316
|
];
|
|
2311
|
-
function
|
|
2317
|
+
function mo(e) {
|
|
2312
2318
|
let t = {
|
|
2313
2319
|
name: e.id,
|
|
2314
2320
|
header: e.header,
|
|
@@ -2327,7 +2333,7 @@ function bo(e) {
|
|
|
2327
2333
|
if (!e.flag) return t;
|
|
2328
2334
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2329
2335
|
let r = e.flag[n];
|
|
2330
|
-
if (
|
|
2336
|
+
if (Fr(bo, r)) {
|
|
2331
2337
|
switch (r) {
|
|
2332
2338
|
case "enum":
|
|
2333
2339
|
t.enum_list = e.enum;
|
|
@@ -2341,7 +2347,7 @@ function bo(e) {
|
|
|
2341
2347
|
case "file": t.is_file = !0;
|
|
2342
2348
|
}
|
|
2343
2349
|
t.type = r;
|
|
2344
|
-
} else if (
|
|
2350
|
+
} else if (Fr(po, r)) switch (r) {
|
|
2345
2351
|
case "writable":
|
|
2346
2352
|
t.is_writable = !0;
|
|
2347
2353
|
break;
|
|
@@ -2354,23 +2360,23 @@ function bo(e) {
|
|
|
2354
2360
|
}
|
|
2355
2361
|
return t.is_file && (t.type = "file"), t;
|
|
2356
2362
|
}
|
|
2357
|
-
var
|
|
2363
|
+
var ho = [
|
|
2358
2364
|
v(h.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2359
2365
|
v(h.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2360
2366
|
v(h.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2361
2367
|
T()
|
|
2362
|
-
],
|
|
2368
|
+
], yo = {
|
|
2363
2369
|
periodic: !1,
|
|
2364
2370
|
msec: 0,
|
|
2365
2371
|
timer_id: -1
|
|
2366
|
-
},
|
|
2367
|
-
function
|
|
2372
|
+
}, Eo = null;
|
|
2373
|
+
function To(e, t, n, r) {
|
|
2368
2374
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2369
2375
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
2370
2376
|
Ut(e, "EV_TIMEOUT", {}, e);
|
|
2371
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;
|
|
2372
2378
|
}
|
|
2373
|
-
var
|
|
2379
|
+
var vo = {
|
|
2374
2380
|
mt_create: function(e) {
|
|
2375
2381
|
let t = e.priv;
|
|
2376
2382
|
const n = jt(e, "subscriber");
|
|
@@ -2395,16 +2401,16 @@ var To = {
|
|
|
2395
2401
|
},
|
|
2396
2402
|
mt_destroy: function(e) {}
|
|
2397
2403
|
};
|
|
2398
|
-
function vo(e, t) {
|
|
2399
|
-
return e instanceof O ? "C_TIMER" !== Xe(e) ? (yn("not C_TIMER GObj"), -1) : (wt(e, "periodic", !1), void Nt(e, "msec", t)) : (yn("not GObj TYPE"), -1);
|
|
2400
|
-
}
|
|
2401
2404
|
function jo(e, t) {
|
|
2402
|
-
return e instanceof O ? "C_TIMER" !== Xe(e) ? (
|
|
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);
|
|
2406
|
+
}
|
|
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);
|
|
2403
2409
|
}
|
|
2404
|
-
function
|
|
2405
|
-
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);
|
|
2406
2412
|
}
|
|
2407
|
-
var
|
|
2413
|
+
var wo = [
|
|
2408
2414
|
v(h.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2409
2415
|
v(h.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2410
2416
|
v(h.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2424,63 +2430,63 @@ var So = [
|
|
|
2424
2430
|
v(h.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2425
2431
|
v(h.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2426
2432
|
T()
|
|
2427
|
-
],
|
|
2428
|
-
function
|
|
2433
|
+
], No = { gobj_timer: null }, $o = null;
|
|
2434
|
+
function Ro(e, t, n, r) {
|
|
2429
2435
|
let o = ht(e, t);
|
|
2430
|
-
return
|
|
2436
|
+
return tr(o) || (o = {}), o[n] = r, Ot(e, t, o), Re(e, t);
|
|
2431
2437
|
}
|
|
2432
|
-
function
|
|
2438
|
+
function xo(e) {
|
|
2433
2439
|
if (!0 === e || !1 === e) return e;
|
|
2434
2440
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2435
2441
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2436
2442
|
}
|
|
2437
|
-
function
|
|
2443
|
+
function Do() {
|
|
2438
2444
|
return `${He()}^${qe()}`;
|
|
2439
2445
|
}
|
|
2440
|
-
function
|
|
2446
|
+
function ko(e, t, n, r) {
|
|
2441
2447
|
return Qt(e, t, n), 0;
|
|
2442
2448
|
}
|
|
2443
|
-
var
|
|
2449
|
+
var Ao = {
|
|
2444
2450
|
mt_create: function(e) {
|
|
2445
2451
|
let t = e.priv;
|
|
2446
|
-
$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) {
|
|
2447
2453
|
let t = ht(e, "trace_levels");
|
|
2448
|
-
if (!
|
|
2454
|
+
if (!tr(t)) return 0;
|
|
2449
2455
|
let n = t.__global_trace__;
|
|
2450
|
-
if (
|
|
2456
|
+
if (nr(n)) {
|
|
2451
2457
|
X(4294967295, !1);
|
|
2452
2458
|
for (let e of n) z(e, !0);
|
|
2453
2459
|
}
|
|
2454
2460
|
for (const [n, r] of Object.entries(t)) {
|
|
2455
2461
|
let t = je(n);
|
|
2456
|
-
if (t) if (
|
|
2462
|
+
if (t) if (nr(r)) {
|
|
2457
2463
|
se(t, null, !1);
|
|
2458
2464
|
for (let e of r) se(t, e, !0);
|
|
2459
|
-
} else
|
|
2465
|
+
} else En(`${Qe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2460
2466
|
}
|
|
2461
2467
|
}(e), function(e) {
|
|
2462
2468
|
let t = ht(e, "no_trace_levels");
|
|
2463
|
-
if (!
|
|
2469
|
+
if (!tr(t)) return 0;
|
|
2464
2470
|
let n = t.__global_no_trace__;
|
|
2465
|
-
if (
|
|
2471
|
+
if (nr(n)) {
|
|
2466
2472
|
Z(4294967295, !1);
|
|
2467
2473
|
for (let e of n) Q(e, !0);
|
|
2468
2474
|
}
|
|
2469
2475
|
for (const [n, r] of Object.entries(t)) {
|
|
2470
2476
|
let t = je(n);
|
|
2471
|
-
if (t) if (
|
|
2477
|
+
if (t) if (nr(r)) {
|
|
2472
2478
|
le(t, null, !1);
|
|
2473
2479
|
for (let e of r) le(t, e, !0);
|
|
2474
|
-
} else
|
|
2480
|
+
} else En(`${Qe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2475
2481
|
}
|
|
2476
2482
|
}(e);
|
|
2477
2483
|
},
|
|
2478
2484
|
mt_writing: function(e, t) {},
|
|
2479
2485
|
mt_start: function(e) {
|
|
2480
|
-
return
|
|
2486
|
+
return Oo(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2481
2487
|
},
|
|
2482
2488
|
mt_stop: function(e) {
|
|
2483
|
-
return
|
|
2489
|
+
return So(e.priv.gobj_timer), Ve(e), 0;
|
|
2484
2490
|
},
|
|
2485
2491
|
mt_destroy: function(e) {},
|
|
2486
2492
|
mt_play: function(e) {
|
|
@@ -2497,24 +2503,24 @@ var ko = {
|
|
|
2497
2503
|
case "get-global-no-trace": return r(0, 0, null, null, te());
|
|
2498
2504
|
case "set-global-trace":
|
|
2499
2505
|
case "set-global-no-trace": {
|
|
2500
|
-
let o = "set-global-no-trace" === t, s = n.level, l =
|
|
2501
|
-
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);
|
|
2502
2508
|
}
|
|
2503
2509
|
case "get-gclass-trace":
|
|
2504
2510
|
case "get-gclass-no-trace":
|
|
2505
2511
|
case "set-gclass-trace":
|
|
2506
2512
|
case "set-gclass-no-trace": {
|
|
2507
2513
|
let o = t.indexOf("no-trace") >= 0, s = n.gclass_name || n.gclass || "", l = je(s);
|
|
2508
|
-
if (!l) return r(0, -1, `${
|
|
2514
|
+
if (!l) return r(0, -1, `${Do()}: what gclass is '${s}'?`, null, null);
|
|
2509
2515
|
if (0 === t.indexOf("get-")) return r(0, 0, null, null, o ? oe(l) : ne(l));
|
|
2510
|
-
let i = n.level, _ =
|
|
2511
|
-
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);
|
|
2512
2518
|
}
|
|
2513
|
-
default: return r(0, -1, `${
|
|
2519
|
+
default: return r(0, -1, `${Do()}: command not available: ${t}`, null, null);
|
|
2514
2520
|
}
|
|
2515
2521
|
}
|
|
2516
2522
|
};
|
|
2517
|
-
var
|
|
2523
|
+
var Io = "ievent_gate_stack", Co = [
|
|
2518
2524
|
v(h.DTP_STRING, "wanted_yuno_role", y.SDF_RD, "", "wanted yuno role"),
|
|
2519
2525
|
v(h.DTP_STRING, "wanted_yuno_name", y.SDF_RD, "", "wanted yuno name"),
|
|
2520
2526
|
v(h.DTP_STRING, "wanted_yuno_service", y.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2531,15 +2537,15 @@ var Ao = "ievent_gate_stack", Io = [
|
|
|
2531
2537
|
v(h.DTP_INTEGER, "timeout_idack", y.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2532
2538
|
v(h.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2533
2539
|
T()
|
|
2534
|
-
],
|
|
2540
|
+
], Lo = [
|
|
2535
2541
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2536
2542
|
["ievents2", "Trace inter-events with full kw"],
|
|
2537
2543
|
["identity-card", "Trace identity_card messages"]
|
|
2538
2544
|
];
|
|
2539
|
-
function
|
|
2545
|
+
function Po(e) {
|
|
2540
2546
|
return !!(3 & M(e));
|
|
2541
2547
|
}
|
|
2542
|
-
var
|
|
2548
|
+
var Uo = {
|
|
2543
2549
|
url: null,
|
|
2544
2550
|
remote_yuno_name: null,
|
|
2545
2551
|
remote_yuno_role: null,
|
|
@@ -2549,23 +2555,23 @@ var Po = {
|
|
|
2549
2555
|
websocket: null,
|
|
2550
2556
|
inside_on_open: !1,
|
|
2551
2557
|
retry_ms: 0
|
|
2552
|
-
},
|
|
2553
|
-
function
|
|
2554
|
-
e.priv.websocket &&
|
|
2558
|
+
}, Fo = null;
|
|
2559
|
+
function Vo(e) {
|
|
2560
|
+
e.priv.websocket && En("Websocket ALREADY setup");
|
|
2555
2561
|
const t = vt(e, "url");
|
|
2556
|
-
|
|
2562
|
+
vn(`====> Starting WebSocket to '${t}' (${Ze(e)})`);
|
|
2557
2563
|
const n = ++e.priv.ws_seq;
|
|
2558
2564
|
let r;
|
|
2559
2565
|
try {
|
|
2560
2566
|
r = new WebSocket(t);
|
|
2561
2567
|
} catch (r) {
|
|
2562
|
-
return
|
|
2568
|
+
return En(`${Ze(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), Lt(e, "EV_ON_CLOSE", {
|
|
2563
2569
|
url: t,
|
|
2564
2570
|
ws_seq: n,
|
|
2565
2571
|
code: 1006,
|
|
2566
2572
|
reason: r.message,
|
|
2567
2573
|
was_clean: !1
|
|
2568
|
-
}, e) < 0 &&
|
|
2574
|
+
}, e) < 0 && jo(e.priv.gobj_timer, Qo(e)), null;
|
|
2569
2575
|
}
|
|
2570
2576
|
return r ? (r.onopen = () => {
|
|
2571
2577
|
n !== e.priv.ws_seq || ot(e) || Ut(e, "EV_ON_OPEN", {
|
|
@@ -2578,69 +2584,69 @@ function Fo(e) {
|
|
|
2578
2584
|
data: r.data
|
|
2579
2585
|
}, e);
|
|
2580
2586
|
}, r.onclose = (r) => {
|
|
2581
|
-
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", {
|
|
2582
2588
|
url: t,
|
|
2583
2589
|
ws_seq: n,
|
|
2584
2590
|
code: r.code,
|
|
2585
2591
|
reason: r.reason,
|
|
2586
2592
|
was_clean: r.wasClean
|
|
2587
2593
|
}, e));
|
|
2588
|
-
}, r) : (
|
|
2594
|
+
}, r) : (En(`${Ze(e)}: Failed to initialize WebSocket.`), null);
|
|
2589
2595
|
}
|
|
2590
|
-
function
|
|
2596
|
+
function Go(e, t = 1e3, n = "") {
|
|
2591
2597
|
let r = e.priv, o = r.websocket;
|
|
2592
2598
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
2593
|
-
|
|
2599
|
+
vn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2594
2600
|
try {
|
|
2595
2601
|
o.close(t, n);
|
|
2596
2602
|
} catch (t) {
|
|
2597
|
-
|
|
2603
|
+
En(`${Ze(e)}: Error closing WebSocket: ${t.message}`);
|
|
2598
2604
|
}
|
|
2599
|
-
} else
|
|
2605
|
+
} else Tn("WebSocket is already closed or in the process of closing.");
|
|
2600
2606
|
}
|
|
2601
|
-
function
|
|
2602
|
-
let r =
|
|
2607
|
+
function Mo(e, t, n) {
|
|
2608
|
+
let r = no();
|
|
2603
2609
|
try {
|
|
2604
|
-
|
|
2610
|
+
vn("\n" + r + " " + t + "\n"), Fn(n);
|
|
2605
2611
|
} catch (e) {
|
|
2606
|
-
|
|
2612
|
+
vn("ERROR in trace_inter_event: " + e);
|
|
2607
2613
|
}
|
|
2608
2614
|
}
|
|
2609
|
-
var
|
|
2615
|
+
var Wo = class {
|
|
2610
2616
|
constructor(e, t) {
|
|
2611
2617
|
this.event = e, this.kw = t || {};
|
|
2612
2618
|
}
|
|
2613
2619
|
};
|
|
2614
|
-
function
|
|
2620
|
+
function Ko(e, t, n, r) {
|
|
2615
2621
|
return function(e, t) {
|
|
2616
2622
|
let n = e.priv, r = JSON.stringify(t);
|
|
2617
|
-
if (
|
|
2623
|
+
if (Po(e)) {
|
|
2618
2624
|
let n = vt(e, "url"), o = Qe(Je()) + " ==> " + n, s = ht(Je(), "trace_ievent_callback");
|
|
2619
|
-
s ? s(o, t, 1, r.length) :
|
|
2625
|
+
s ? s(o, t, 1, r.length) : Mo(0, o, t);
|
|
2620
2626
|
}
|
|
2621
|
-
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;
|
|
2622
2628
|
try {
|
|
2623
2629
|
n.websocket.send(r);
|
|
2624
2630
|
} catch (t) {
|
|
2625
|
-
|
|
2631
|
+
En(`${Ze(e)}: send_iev(): ${t}`);
|
|
2626
2632
|
}
|
|
2627
2633
|
return 0;
|
|
2628
2634
|
}(e, function(e, t) {
|
|
2629
|
-
return
|
|
2635
|
+
return ar(e) ? (En("iev_create() event NULL"), null) : new Wo(e, t);
|
|
2630
2636
|
}(t, n));
|
|
2631
2637
|
}
|
|
2632
|
-
function
|
|
2633
|
-
return
|
|
2638
|
+
function Yo(e, t, n) {
|
|
2639
|
+
return ar(n) && (n = vt(e, "wanted_yuno_service")), {
|
|
2634
2640
|
dst_yuno: vt(e, "wanted_yuno_name"),
|
|
2635
2641
|
dst_role: vt(e, "wanted_yuno_role"),
|
|
2636
2642
|
dst_service: n,
|
|
2637
2643
|
src_yuno: qe(),
|
|
2638
2644
|
src_role: He(),
|
|
2639
2645
|
src_service: t,
|
|
2640
|
-
host:
|
|
2646
|
+
host: oo()
|
|
2641
2647
|
};
|
|
2642
2648
|
}
|
|
2643
|
-
function
|
|
2649
|
+
function Bo(e) {
|
|
2644
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");
|
|
2645
2651
|
i && i.length || (i = ht(Je(), "required_services"));
|
|
2646
2652
|
let _ = {
|
|
@@ -2658,34 +2664,34 @@ function Yo(e) {
|
|
|
2658
2664
|
username: vt(Je(), "__username__"),
|
|
2659
2665
|
launch_id: 0,
|
|
2660
2666
|
yuno_startdate: vt(Je(), "start_date"),
|
|
2661
|
-
id:
|
|
2667
|
+
id: oo(),
|
|
2662
2668
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2663
2669
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2664
2670
|
required_services: i
|
|
2665
2671
|
};
|
|
2666
|
-
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", _);
|
|
2667
2673
|
}
|
|
2668
|
-
function
|
|
2669
|
-
if (
|
|
2674
|
+
function Jo(e, t) {
|
|
2675
|
+
if (ar(t.event)) return -1;
|
|
2670
2676
|
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, l = t.__service__, i = t.subscriber;
|
|
2671
2677
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2672
|
-
return
|
|
2673
|
-
}
|
|
2674
|
-
function Jo(e, t, n, r) {
|
|
2675
|
-
let o = e.priv;
|
|
2676
|
-
return We(e) && (o.websocket = Fo(e)), 0;
|
|
2678
|
+
return Mr(e, n, Io, Yo(e, Qe(i), l)), Kr(e, n, "__subscribing__"), Ko(e, t.event, n);
|
|
2677
2679
|
}
|
|
2678
2680
|
function qo(e, t, n, r) {
|
|
2679
|
-
|
|
2681
|
+
let o = e.priv;
|
|
2682
|
+
return We(e) && (o.websocket = Vo(e)), 0;
|
|
2680
2683
|
}
|
|
2681
2684
|
function Ho(e, t, n, r) {
|
|
2685
|
+
return vn("Websocket opened: " + e.priv.url), Bo(e), 0;
|
|
2686
|
+
}
|
|
2687
|
+
function zo(e, t, n, r) {
|
|
2682
2688
|
let o = e.priv, s = n.url;
|
|
2683
|
-
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", {
|
|
2684
2690
|
url: s,
|
|
2685
2691
|
remote_yuno_name: o.remote_yuno_name,
|
|
2686
2692
|
remote_yuno_role: o.remote_yuno_role,
|
|
2687
2693
|
remote_yuno_service: o.remote_yuno_service
|
|
2688
|
-
})) : 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", {
|
|
2689
2695
|
url: s,
|
|
2690
2696
|
remote_yuno_name: o.remote_yuno_name,
|
|
2691
2697
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -2693,25 +2699,25 @@ function Ho(e, t, n, r) {
|
|
|
2693
2699
|
code: n.code,
|
|
2694
2700
|
reason: n.reason,
|
|
2695
2701
|
was_clean: n.was_clean
|
|
2696
|
-
})), We(e) &&
|
|
2702
|
+
})), We(e) && jo(o.gobj_timer, Qo(e))), 0;
|
|
2697
2703
|
}
|
|
2698
|
-
function
|
|
2704
|
+
function Qo(e) {
|
|
2699
2705
|
let t = e.priv, n = Tt(e, "timeout_retry"), r = Tt(e, "timeout_retry_max");
|
|
2700
2706
|
r < n && (r = n), t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2701
2707
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
2702
2708
|
return Math.max(1, Math.round(s));
|
|
2703
2709
|
}
|
|
2704
|
-
function Qo(e, t, n, r) {
|
|
2705
|
-
return Yo(e), 0;
|
|
2706
|
-
}
|
|
2707
2710
|
function Xo(e, t, n, r) {
|
|
2711
|
+
return Bo(e), 0;
|
|
2712
|
+
}
|
|
2713
|
+
function Zo(e, t, n, r) {
|
|
2708
2714
|
let o = e.priv;
|
|
2709
|
-
|
|
2710
|
-
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", "");
|
|
2711
2717
|
$t(e, "remote_yuno_name", l), $t(e, "remote_yuno_role", i), $t(e, "remote_yuno_service", _);
|
|
2712
|
-
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", {});
|
|
2713
2719
|
if (a < 0) {
|
|
2714
|
-
|
|
2720
|
+
Go(e);
|
|
2715
2721
|
let t = {
|
|
2716
2722
|
url: vt(e, "url"),
|
|
2717
2723
|
result: a,
|
|
@@ -2736,61 +2742,61 @@ function Xo(e, t, n, r) {
|
|
|
2736
2742
|
}
|
|
2737
2743
|
o.inside_on_open = !1, function(e) {
|
|
2738
2744
|
let t = Ht(e, null, null, null);
|
|
2739
|
-
for (let n = 0; n < t.length; n++)
|
|
2745
|
+
for (let n = 0; n < t.length; n++) Jo(e, t[n]);
|
|
2740
2746
|
}(e);
|
|
2741
2747
|
}
|
|
2742
2748
|
return 0;
|
|
2743
2749
|
}
|
|
2744
|
-
function
|
|
2750
|
+
function es(e, t, n, r) {
|
|
2745
2751
|
let o = e.priv.url, s = function(e, t) {
|
|
2746
2752
|
let n;
|
|
2747
2753
|
try {
|
|
2748
2754
|
n = JSON.parse(t);
|
|
2749
2755
|
} catch (t) {
|
|
2750
|
-
return
|
|
2756
|
+
return Tn(`${Ze(e)}: parsing inter_event json: ${t}`), null;
|
|
2751
2757
|
}
|
|
2752
|
-
if (!(n instanceof Object)) return
|
|
2758
|
+
if (!(n instanceof Object)) return Tn(`${Ze(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2753
2759
|
let r = n.event;
|
|
2754
|
-
if (!r) return
|
|
2755
|
-
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;
|
|
2756
2762
|
let o = n.kw;
|
|
2757
2763
|
return o ? o instanceof Object ? {
|
|
2758
2764
|
event: r,
|
|
2759
2765
|
kw: o || {}
|
|
2760
|
-
} : (
|
|
2766
|
+
} : (Tn(`${Ze(e)}: parsing inter_event: kw not a json object`), null) : (Tn(`${Ze(e)}: parsing inter_kw: no kw`), null);
|
|
2761
2767
|
}(e, n.data);
|
|
2762
|
-
if (!s) return
|
|
2763
|
-
if (
|
|
2768
|
+
if (!s) return Tn(`${Ze(e)}: frame dropped from ${o}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2769
|
+
if (Po(e)) {
|
|
2764
2770
|
let e = Qe(Je()) + " <== " + o, t = n.data.length, r = ht(Je(), "trace_ievent_callback");
|
|
2765
|
-
r ? r(e, s, 2, t) :
|
|
2771
|
+
r ? r(e, s, 2, t) : Mo(0, e, s);
|
|
2766
2772
|
}
|
|
2767
2773
|
let l = s.event, i = s.kw;
|
|
2768
2774
|
if ("ST_SESSION" !== xt(e)) {
|
|
2769
2775
|
if (kt(e, l, $.EVF_PUBLIC_EVENT)) {
|
|
2770
2776
|
if (!(Ut(e, l, i, e) < 0)) return 0;
|
|
2771
|
-
} else
|
|
2772
|
-
return
|
|
2777
|
+
} else En(`${Ze(e)}: event UNKNOWN in not-session state ${l}`);
|
|
2778
|
+
return Go(e), -1;
|
|
2773
2779
|
}
|
|
2774
2780
|
s = null;
|
|
2775
|
-
let _ =
|
|
2776
|
-
if (u.toLowerCase() !== He().toLowerCase()) return
|
|
2777
|
-
let c =
|
|
2778
|
-
if ("__subscribing__" === _) return
|
|
2779
|
-
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;
|
|
2780
2786
|
if (kt(e, l, $.EVF_PUBLIC_EVENT)) return Ut(e, l, i, e), 0;
|
|
2781
|
-
if (!
|
|
2787
|
+
if (!ar(c)) {
|
|
2782
2788
|
let t = Se(c, !1);
|
|
2783
|
-
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);
|
|
2784
2790
|
}
|
|
2785
2791
|
return rt(e) ? Ut(tt(e), l, i, e) : Qt(e, l, i), 0;
|
|
2786
2792
|
}
|
|
2787
|
-
function
|
|
2793
|
+
function ts(e, t, n, r) {
|
|
2788
2794
|
return 0;
|
|
2789
2795
|
}
|
|
2790
|
-
function
|
|
2796
|
+
function ns(e, t, n, r) {
|
|
2791
2797
|
return 0;
|
|
2792
2798
|
}
|
|
2793
|
-
var
|
|
2799
|
+
var rs = {
|
|
2794
2800
|
mt_create: function(e) {
|
|
2795
2801
|
let t = e.priv;
|
|
2796
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);
|
|
@@ -2820,52 +2826,52 @@ var ns = {
|
|
|
2820
2826
|
code: 1e3,
|
|
2821
2827
|
reason: "restarted",
|
|
2822
2828
|
was_clean: !0
|
|
2823
|
-
}, e),
|
|
2829
|
+
}, e), So(t.gobj_timer)), t.websocket = Vo(e), 0;
|
|
2824
2830
|
},
|
|
2825
2831
|
mt_stop: function(e) {
|
|
2826
2832
|
let t = e.priv;
|
|
2827
|
-
return
|
|
2833
|
+
return So(t.gobj_timer), t.websocket && Go(e), 0;
|
|
2828
2834
|
},
|
|
2829
2835
|
mt_destroy: function(e) {},
|
|
2830
2836
|
mt_stats: function(e, t, n, r) {
|
|
2831
|
-
if ("ST_SESSION" !== xt(e)) return
|
|
2837
|
+
if ("ST_SESSION" !== xt(e)) return En("Not in session"), null;
|
|
2832
2838
|
n || (n = {});
|
|
2833
|
-
let o =
|
|
2834
|
-
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", {
|
|
2835
2841
|
stats: t,
|
|
2836
2842
|
kw: s
|
|
2837
|
-
}),
|
|
2843
|
+
}), Mr(e, n, Io, o), n.__stats__ = t, Kr(e, n, "__stats__"), Ko(e, "EV_MT_STATS", n, r), null;
|
|
2838
2844
|
},
|
|
2839
2845
|
mt_command_parser: function(e, t, n, r) {
|
|
2840
|
-
if ("ST_SESSION" !== xt(e)) return
|
|
2846
|
+
if ("ST_SESSION" !== xt(e)) return En("Not in session"), null;
|
|
2841
2847
|
n || (n = {});
|
|
2842
|
-
let o =
|
|
2843
|
-
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", {
|
|
2844
2850
|
command: t,
|
|
2845
2851
|
kw: s
|
|
2846
|
-
}),
|
|
2852
|
+
}), Mr(e, n, Io, o), n.__command__ = t, Kr(e, n, "__command__"), Ko(e, "EV_MT_COMMAND", n, r), null;
|
|
2847
2853
|
},
|
|
2848
2854
|
mt_inject_event: function(e, t, n, r) {
|
|
2849
2855
|
if ("ST_SESSION" !== xt(e)) return window.console.error("Not in session"), -1;
|
|
2850
|
-
if (n =
|
|
2856
|
+
if (n = Mn({}, tr(n) ? n : {}), tr(n.__md_iev__) && (n.__md_iev__ = Vn(n.__md_iev__)), Wr(e, n, Io));
|
|
2851
2857
|
else {
|
|
2852
|
-
let o =
|
|
2853
|
-
|
|
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);
|
|
2854
2860
|
}
|
|
2855
|
-
return
|
|
2861
|
+
return Kr(e, n, "__message__"), Ko(e, t, n, r);
|
|
2856
2862
|
},
|
|
2857
2863
|
mt_subscription_added: function(e, t) {
|
|
2858
2864
|
let n = e.priv;
|
|
2859
|
-
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;
|
|
2860
2866
|
},
|
|
2861
2867
|
mt_subscription_deleted: function(e, t) {
|
|
2862
2868
|
let n = e.priv;
|
|
2863
2869
|
if ("ST_SESSION" !== xt(e) || !n.websocket) return 0;
|
|
2864
2870
|
if (n.inside_on_open) return 0;
|
|
2865
|
-
if (
|
|
2871
|
+
if (ar(t.event)) return 0;
|
|
2866
2872
|
let r = {}, o = t.__global__, s = t.__config__, l = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2867
2873
|
s && (r.__config__ = s), o && (r.__global__ = o), l && (r.__filter__ = l);
|
|
2868
|
-
return
|
|
2874
|
+
return Mr(e, r, Io, Yo(e, Qe(_), i)), Kr(e, r, "__unsubscribing__"), Ko(e, t.event, r, e);
|
|
2869
2875
|
}
|
|
2870
2876
|
};
|
|
2871
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__", {
|
|
@@ -2879,55 +2885,55 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2879
2885
|
return t;
|
|
2880
2886
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2881
2887
|
return e.replace(/[?# ^:]/g, "_");
|
|
2882
|
-
}, 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) {
|
|
2883
2889
|
let [r, o, s, l] = t;
|
|
2884
|
-
if (!r) return void
|
|
2890
|
+
if (!r) return void En("Tag must be a valid HTML element.");
|
|
2885
2891
|
let i = document.createElement(r), _ = "";
|
|
2886
2892
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2887
2893
|
let t = "";
|
|
2888
2894
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2889
2895
|
i.style.cssText = t;
|
|
2890
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]);
|
|
2891
|
-
if (
|
|
2892
|
-
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));
|
|
2893
2899
|
else if (s.length > 0 && "<" === s[0] && function(e) {
|
|
2894
|
-
if (
|
|
2900
|
+
if (eo.size >= 100) return;
|
|
2895
2901
|
const t = e.slice(0, 80);
|
|
2896
|
-
|
|
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)}`));
|
|
2897
2903
|
}(s), n && _) i.textContent = n(_) || s;
|
|
2898
2904
|
else i.textContent = s;
|
|
2899
|
-
else if (
|
|
2900
|
-
if (s.length > 0) if (
|
|
2901
|
-
else for (let t of s) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) :
|
|
2902
|
-
} 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));
|
|
2903
2909
|
if (l && "object" == typeof l) for (const e of Object.keys(l)) i.addEventListener(e, l[e]);
|
|
2904
2910
|
return i;
|
|
2905
|
-
}, exports.createOneHtml =
|
|
2906
|
-
let n =
|
|
2907
|
-
return
|
|
2911
|
+
}, exports.createOneHtml = to, exports.create_json_record = function(e, t) {
|
|
2912
|
+
let n = Vn(e);
|
|
2913
|
+
return Wn(n, t), n;
|
|
2908
2914
|
}, exports.create_template_record = function(e, t) {
|
|
2909
2915
|
let n = {};
|
|
2910
2916
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2911
2917
|
let o;
|
|
2912
|
-
|
|
2913
|
-
let s =
|
|
2914
|
-
|
|
2918
|
+
tr(r) && (o = r.default);
|
|
2919
|
+
let s = wr(null, t, e, o);
|
|
2920
|
+
Jn(n, e, s);
|
|
2915
2921
|
}), n;
|
|
2916
|
-
}, exports.current_timestamp =
|
|
2917
|
-
let n =
|
|
2918
|
-
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;
|
|
2919
2925
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
2920
|
-
let n = yt(e, y.SDF_PERSIST), r =
|
|
2921
|
-
if (r &&
|
|
2922
|
-
let o =
|
|
2923
|
-
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);
|
|
2924
2930
|
}
|
|
2925
2931
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
2926
|
-
let n =
|
|
2927
|
-
0 ===
|
|
2932
|
+
let n = kr(e, Ar(co(e), null, !1), t, !1);
|
|
2933
|
+
0 === Xn(n) ? Cr(co(e)) : Ir(co(e), n);
|
|
2928
2934
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
2929
|
-
let n =
|
|
2930
|
-
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);
|
|
2931
2937
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2932
2938
|
let r = null, o = null, s = null;
|
|
2933
2939
|
const l = (...l) => {
|
|
@@ -2947,24 +2953,24 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2947
2953
|
return !1;
|
|
2948
2954
|
}, exports.duplicate_objects = function(...e) {
|
|
2949
2955
|
const t = {};
|
|
2950
|
-
for (const n of e)
|
|
2956
|
+
for (const n of e) Mn(t, structuredClone(n));
|
|
2951
2957
|
return t;
|
|
2952
2958
|
}, exports.empty_json = function(e) {
|
|
2953
|
-
return 0 ===
|
|
2954
|
-
}, exports.empty_string =
|
|
2959
|
+
return 0 === er(e);
|
|
2960
|
+
}, exports.empty_string = ar, exports.escapeHtml = Hr, exports.event_flag_t = $, exports.flat2json = function(e) {
|
|
2955
2961
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2956
2962
|
let t = null;
|
|
2957
2963
|
for (const n of Object.keys(e)) {
|
|
2958
|
-
const r =
|
|
2964
|
+
const r = ao(n);
|
|
2959
2965
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2960
|
-
if (r.length >
|
|
2966
|
+
if (r.length > lo) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2961
2967
|
const o = "number" == typeof r[0];
|
|
2962
2968
|
if (null === t) t = o ? [] : {};
|
|
2963
2969
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2964
2970
|
let s = t;
|
|
2965
2971
|
for (let t = 0; t < r.length; t++) {
|
|
2966
2972
|
const o = r[t], l = "number" == typeof o, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2967
|
-
if (l && o >
|
|
2973
|
+
if (l && o > io) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
2968
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"}`);
|
|
2969
2975
|
if (i) {
|
|
2970
2976
|
if (Array.isArray(s)) {
|
|
@@ -2972,7 +2978,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2972
2978
|
s[o] = e[n];
|
|
2973
2979
|
} else {
|
|
2974
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`);
|
|
2975
|
-
|
|
2981
|
+
mr(s, o, e[n]);
|
|
2976
2982
|
}
|
|
2977
2983
|
break;
|
|
2978
2984
|
}
|
|
@@ -2980,7 +2986,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2980
2986
|
if (Array.isArray(s)) {
|
|
2981
2987
|
for (; s.length <= o;) s.push(null);
|
|
2982
2988
|
a = s[o], null == a && (a = _ ? [] : {}, s[o] = a);
|
|
2983
|
-
} else a =
|
|
2989
|
+
} else a = br(s, o) ? void 0 : s[o], void 0 === a && (a = _ ? [] : {}, mr(s, o, a));
|
|
2984
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`);
|
|
2985
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"}`);
|
|
2986
2992
|
s = a;
|
|
@@ -2991,11 +2997,11 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2991
2997
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2992
2998
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2993
2999
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2994
|
-
for (const n of Object.keys(t.added || {}))
|
|
3000
|
+
for (const n of Object.keys(t.added || {})) mr(e, n, t.added[n]);
|
|
2995
3001
|
for (const n of Object.keys(t.changed || {})) {
|
|
2996
3002
|
const r = t.changed[n];
|
|
2997
3003
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2998
|
-
|
|
3004
|
+
mr(e, n, r.to);
|
|
2999
3005
|
}
|
|
3000
3006
|
return e;
|
|
3001
3007
|
}, exports.flat_diff = function(e, t) {
|
|
@@ -3004,15 +3010,15 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3004
3010
|
removed: {},
|
|
3005
3011
|
changed: {}
|
|
3006
3012
|
};
|
|
3007
|
-
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, {
|
|
3008
3014
|
from: n[e],
|
|
3009
3015
|
to: r[e]
|
|
3010
|
-
}) :
|
|
3011
|
-
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]);
|
|
3012
3018
|
return o;
|
|
3013
3019
|
}, exports.flat_key_join = function(e) {
|
|
3014
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
3015
|
-
}, 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) {
|
|
3016
3022
|
if (!e) return {
|
|
3017
3023
|
top: 0,
|
|
3018
3024
|
left: 0,
|
|
@@ -3031,17 +3037,17 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3031
3037
|
right: n + i + r,
|
|
3032
3038
|
bottom: t + l + o
|
|
3033
3039
|
};
|
|
3034
|
-
}, exports.get_function_name =
|
|
3040
|
+
}, exports.get_function_name = so, exports.get_now = function() {
|
|
3035
3041
|
return Math.floor(Date.now() / 1e3);
|
|
3036
3042
|
}, exports.gobj_bottom_gobj = st, exports.gobj_change_parent = function(e, n) {
|
|
3037
|
-
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);
|
|
3038
3044
|
}, exports.gobj_change_state = Rt, exports.gobj_command = function(e, n, o, s) {
|
|
3039
|
-
if (ot(e)) return
|
|
3045
|
+
if (ot(e)) return En("gobj NULL or DESTROYED"), -1;
|
|
3040
3046
|
if (function(e) {
|
|
3041
3047
|
return F > 1 || !!e && !!(M(e) & C.TRACE_COMMANDS);
|
|
3042
3048
|
}(e) || q(e, null) && !H(s, null)) {
|
|
3043
|
-
let r =
|
|
3044
|
-
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);
|
|
3045
3051
|
}
|
|
3046
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);
|
|
3047
3053
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
@@ -3055,7 +3061,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3055
3061
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
3056
3062
|
return ke(e, t, n, null, w.gobj_flag_yuno);
|
|
3057
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) {
|
|
3058
|
-
if (
|
|
3064
|
+
if (ar(t)) return null;
|
|
3059
3065
|
const n = t.toLowerCase();
|
|
3060
3066
|
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d : bt(d, t);
|
|
3061
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() {
|
|
@@ -3067,24 +3073,24 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3067
3073
|
}, exports.gobj_list_subscriptions = function(e) {
|
|
3068
3074
|
let t = Ht(e, null, null, null);
|
|
3069
3075
|
for (let n = 0; n < t.length; n++) {
|
|
3070
|
-
let r = t[n], o =
|
|
3071
|
-
|
|
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));
|
|
3072
3078
|
}
|
|
3073
3079
|
let n = zt(e, 0, null, 0);
|
|
3074
3080
|
for (let t = 0; t < n.length; t++) {
|
|
3075
|
-
let r = n[t], o =
|
|
3076
|
-
|
|
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));
|
|
3077
3083
|
}
|
|
3078
3084
|
return {
|
|
3079
3085
|
subscriptions: t,
|
|
3080
3086
|
subscribings: n,
|
|
3081
|
-
"total subscriptions":
|
|
3082
|
-
total_subscribings:
|
|
3087
|
+
"total subscriptions": Zn(t),
|
|
3088
|
+
total_subscribings: Zn(n)
|
|
3083
3089
|
};
|
|
3084
3090
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
3085
|
-
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);
|
|
3086
3092
|
}, exports.gobj_match_children = function(e, t) {
|
|
3087
|
-
if (ot(e)) return
|
|
3093
|
+
if (ot(e)) return En("gobj NULL or DESTROYED"), null;
|
|
3088
3094
|
t = t || {};
|
|
3089
3095
|
let n = [];
|
|
3090
3096
|
const r = e.dl_children;
|
|
@@ -3106,7 +3112,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3106
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() {
|
|
3107
3113
|
return It.length;
|
|
3108
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) {
|
|
3109
|
-
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);
|
|
3110
3116
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
3111
3117
|
return L.map(([e, t, n]) => ({
|
|
3112
3118
|
name: e,
|
|
@@ -3116,34 +3122,34 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3116
3122
|
}));
|
|
3117
3123
|
}, exports.gobj_reset_volatil_attrs = function(e) {
|
|
3118
3124
|
return function(e, t, n) {
|
|
3119
|
-
if (ot(e)) return
|
|
3125
|
+
if (ot(e)) return En("gobj NULL or DESTROYED"), -1;
|
|
3120
3126
|
let r = e.gclass.attrs_table;
|
|
3121
3127
|
for (let o = 0; o < r.length; o++) {
|
|
3122
3128
|
const s = r[o];
|
|
3123
|
-
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)));
|
|
3124
3130
|
}
|
|
3125
3131
|
return 0;
|
|
3126
3132
|
}(e, y.SDF_VOLATIL, 0);
|
|
3127
3133
|
}, exports.gobj_save_persistent_attrs = Re, exports.gobj_search_path = bt, exports.gobj_send_event = Ut, exports.gobj_services = function() {
|
|
3128
3134
|
let e = [];
|
|
3129
|
-
for (const t of Object.keys(p))
|
|
3135
|
+
for (const t of Object.keys(p)) zn(e, t);
|
|
3130
3136
|
return e;
|
|
3131
3137
|
}, exports.gobj_set_bottom_gobj = lt, exports.gobj_set_deep_trace = function(e) {
|
|
3132
3138
|
return F = Number(e) || 0, 0;
|
|
3133
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) {
|
|
3134
|
-
if (!e) return
|
|
3140
|
+
if (!e) return En("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
3135
3141
|
const r = G(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3136
3142
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3137
3143
|
}, exports.gobj_set_gobj_trace = function(e, t, n) {
|
|
3138
|
-
if (!e) return
|
|
3144
|
+
if (!e) return En("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3139
3145
|
const r = G(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3140
3146
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3141
3147
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
3142
3148
|
A = 1 === Number(e) ? 1 : 0;
|
|
3143
3149
|
}, exports.gobj_short_name = Ze, exports.gobj_start = Ce, exports.gobj_start_children = function(e) {
|
|
3144
|
-
return ot(e) ? (
|
|
3150
|
+
return ot(e) ? (En("gobj NULL or DESTROYED"), -1) : _t(e, R.WALK_FIRST2LAST, Le, 0, 0);
|
|
3145
3151
|
}, exports.gobj_start_tree = function(e) {
|
|
3146
|
-
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)));
|
|
3147
3153
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
3148
3154
|
l = t, i = n, _ = r, a = o, u = s, c = g;
|
|
3149
3155
|
const p = [["EV_STATE_CHANGED", $.EVF_SYSTEM_EVENT | $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -3153,14 +3159,14 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3153
3159
|
}
|
|
3154
3160
|
return 0;
|
|
3155
3161
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
3156
|
-
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);
|
|
3157
3163
|
}, exports.gobj_stop = Ue, exports.gobj_stop_children = Ve, exports.gobj_stop_tree = function(e) {
|
|
3158
|
-
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));
|
|
3159
3165
|
}, exports.gobj_subscribe_event = Jt, exports.gobj_trace_level = M, exports.gobj_trace_machine_format = function() {
|
|
3160
3166
|
return A;
|
|
3161
3167
|
}, exports.gobj_trace_no_level = W, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3162
|
-
if (null == n && (n = {}), !e) return
|
|
3163
|
-
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;
|
|
3164
3170
|
const o = /* @__PURE__ */ new Set([
|
|
3165
3171
|
"__config__",
|
|
3166
3172
|
"__global__",
|
|
@@ -3169,83 +3175,83 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3169
3175
|
"__service__"
|
|
3170
3176
|
]);
|
|
3171
3177
|
if (Object.keys(n).forEach((n) => {
|
|
3172
|
-
o.has(n) ||
|
|
3173
|
-
}),
|
|
3174
|
-
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;
|
|
3175
3181
|
let s = Mt(n, t), l = Kt(e.dl_subscriptions, e, t, s.renamed_event, s.kw, r), i = 0, _ = 0, a = 0;
|
|
3176
3182
|
for (let t = 0; t < l.length; t++) {
|
|
3177
3183
|
let n = l[t], r = Bt(e, n, !1, !1);
|
|
3178
3184
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3179
3185
|
}
|
|
3180
|
-
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;
|
|
3181
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) {
|
|
3182
|
-
return "string" != typeof e ? (
|
|
3183
|
-
}, 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) {
|
|
3184
3190
|
return e instanceof Date && !isNaN(e);
|
|
3185
|
-
}, exports.is_function =
|
|
3186
|
-
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;
|
|
3187
3193
|
let t = 0;
|
|
3188
3194
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3189
3195
|
return 2 === t;
|
|
3190
|
-
}, exports.is_null =
|
|
3191
|
-
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;
|
|
3192
3198
|
let t = 0;
|
|
3193
3199
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3194
3200
|
return 1 === t;
|
|
3195
3201
|
}, exports.is_pure_number = function(e) {
|
|
3196
|
-
if (
|
|
3197
|
-
if (!
|
|
3202
|
+
if (or(e)) return !0;
|
|
3203
|
+
if (!rr(e)) return !1;
|
|
3198
3204
|
const t = Number(e);
|
|
3199
3205
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3200
|
-
}, exports.is_secret_name =
|
|
3201
|
-
let o =
|
|
3202
|
-
if (!o) return
|
|
3203
|
-
if (!
|
|
3204
|
-
if (!
|
|
3205
|
-
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;
|
|
3206
3212
|
let s, l = n.split("`"), i = o;
|
|
3207
|
-
for (; (s = l.shift()) && !
|
|
3208
|
-
if (!i || 0 !== l.length) return
|
|
3209
|
-
let _ =
|
|
3210
|
-
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);
|
|
3211
3217
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
3212
|
-
let o =
|
|
3213
|
-
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);
|
|
3214
3220
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
3215
|
-
let r =
|
|
3216
|
-
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);
|
|
3217
3223
|
}, exports.jdb_get_topic = function(e, t) {
|
|
3218
|
-
let n =
|
|
3219
|
-
if (!n) return
|
|
3220
|
-
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);
|
|
3221
3227
|
}, exports.jdb_init = function(e, t, n) {
|
|
3222
|
-
n && (e =
|
|
3223
|
-
let r =
|
|
3224
|
-
|
|
3225
|
-
let o =
|
|
3226
|
-
return
|
|
3227
|
-
"__" === 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);
|
|
3228
3234
|
}, t), e;
|
|
3229
3235
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
3230
|
-
let o =
|
|
3231
|
-
if (!o) return
|
|
3232
|
-
if (!
|
|
3233
|
-
if (!
|
|
3234
|
-
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;
|
|
3235
3241
|
let s, l, i = n.split("`"), _ = o;
|
|
3236
|
-
for (; (s = i.shift()) && !
|
|
3237
|
-
if (!_ || 0 !== i.length) return
|
|
3238
|
-
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 = _;
|
|
3239
3245
|
else {
|
|
3240
|
-
if (_.id === r.id) return
|
|
3241
|
-
if (l =
|
|
3242
|
-
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;
|
|
3243
3249
|
}
|
|
3244
|
-
let a =
|
|
3245
|
-
return a ?
|
|
3250
|
+
let a = Jr(l, e.hook, r.id, !1);
|
|
3251
|
+
return a ? Mn(a, r) : l.push(r), o;
|
|
3246
3252
|
}, exports.json2flat = function(e) {
|
|
3247
3253
|
const t = {}, n = (e, r, o) => {
|
|
3248
|
-
if (o >
|
|
3254
|
+
if (o > lo) throw new Error("json2flat: deeper than 256");
|
|
3249
3255
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3250
3256
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3251
3257
|
const s = `[${t}]`;
|
|
@@ -3255,20 +3261,20 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3255
3261
|
const t = Object.keys(e);
|
|
3256
3262
|
if (t.length > 0) {
|
|
3257
3263
|
for (const s of t) {
|
|
3258
|
-
const t =
|
|
3264
|
+
const t = _o(s);
|
|
3259
3265
|
n(e[s], 0 === o ? t : r + "`" + t, o + 1);
|
|
3260
3266
|
}
|
|
3261
3267
|
return;
|
|
3262
3268
|
}
|
|
3263
3269
|
}
|
|
3264
|
-
0 !== o &&
|
|
3270
|
+
0 !== o && mr(t, r, e);
|
|
3265
3271
|
};
|
|
3266
3272
|
return null == e || n(e, "", 0), t;
|
|
3267
|
-
}, exports.json_array_append =
|
|
3273
|
+
}, exports.json_array_append = Hn, exports.json_array_append_new = zn, exports.json_array_extend = function(e, t) {
|
|
3268
3274
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3269
|
-
}, 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) {
|
|
3270
3276
|
try {
|
|
3271
|
-
let n =
|
|
3277
|
+
let n = qr(e);
|
|
3272
3278
|
switch (t) {
|
|
3273
3279
|
case "header": return JSON.parse(n.header);
|
|
3274
3280
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3277,137 +3283,137 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3277
3283
|
} catch (e) {
|
|
3278
3284
|
return null;
|
|
3279
3285
|
}
|
|
3280
|
-
}, exports.jwtDecode =
|
|
3281
|
-
if (e && !
|
|
3282
|
-
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);
|
|
3283
3289
|
let o = [];
|
|
3284
|
-
if (
|
|
3290
|
+
if (nr(t)) for (let e = 0; e < t.length; e++) {
|
|
3285
3291
|
let s = t[e];
|
|
3286
3292
|
r(s, n) && o.push(s);
|
|
3287
3293
|
}
|
|
3288
3294
|
else {
|
|
3289
|
-
if (!
|
|
3295
|
+
if (!tr(t)) return En("kw_select() BAD kw parameter"), null;
|
|
3290
3296
|
r(t, n) && o.push(t);
|
|
3291
3297
|
}
|
|
3292
3298
|
return o;
|
|
3293
|
-
}, exports.kw_delete =
|
|
3294
|
-
if (!n || !
|
|
3295
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3296
|
-
return r &&
|
|
3297
|
-
}, exports.kw_find_path =
|
|
3298
|
-
e && !
|
|
3299
|
-
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);
|
|
3300
3306
|
const l = o && o & Xt.KW_REQUIRED, i = o && o & Xt.KW_CREATE, _ = o && o & Xt.KW_EXTRACT;
|
|
3301
|
-
return void 0 === s ? i &&
|
|
3302
|
-
}, exports.kw_get_local_storage_value =
|
|
3303
|
-
e && !
|
|
3304
|
-
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);
|
|
3305
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;
|
|
3306
3312
|
if (void 0 === s) {
|
|
3307
3313
|
if (i && t) {
|
|
3308
3314
|
let o = Number(r);
|
|
3309
|
-
return
|
|
3315
|
+
return Nr(e, t, n, o), o;
|
|
3310
3316
|
}
|
|
3311
|
-
return l && (
|
|
3317
|
+
return l && (En(`path not found: '${n}'`), Fn(t)), Number(r);
|
|
3312
3318
|
}
|
|
3313
3319
|
let u;
|
|
3314
|
-
if (
|
|
3320
|
+
if (or(s)) u = s;
|
|
3315
3321
|
else {
|
|
3316
|
-
if (!a) return
|
|
3317
|
-
if (
|
|
3318
|
-
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);
|
|
3319
3325
|
else {
|
|
3320
|
-
if (null !== s) return
|
|
3326
|
+
if (null !== s) return En(`${e ? Ze(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Fn(t), 0;
|
|
3321
3327
|
u = 0;
|
|
3322
3328
|
}
|
|
3323
3329
|
}
|
|
3324
|
-
return _ &&
|
|
3325
|
-
}, exports.kw_get_str =
|
|
3326
|
-
if (e && !
|
|
3327
|
-
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);
|
|
3328
3334
|
let o = [];
|
|
3329
|
-
if (
|
|
3335
|
+
if (nr(t)) for (let e = 0; e < t.length; e++) {
|
|
3330
3336
|
let s = t[e];
|
|
3331
|
-
r(s, n) && o.push(
|
|
3337
|
+
r(s, n) && o.push(Vn(s));
|
|
3332
3338
|
}
|
|
3333
3339
|
else {
|
|
3334
|
-
if (!
|
|
3335
|
-
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));
|
|
3336
3342
|
}
|
|
3337
3343
|
return o;
|
|
3338
|
-
}, exports.kw_set_dict_value =
|
|
3339
|
-
e && !
|
|
3340
|
-
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);
|
|
3341
3347
|
return s && 0 !== s.length ? s[0] : null;
|
|
3342
3348
|
}, exports.kwid_get_ids = function(e, t) {
|
|
3343
|
-
if (e && !
|
|
3349
|
+
if (e && !_r(e) && En("GObj bad instanceof"), !t) return [];
|
|
3344
3350
|
let n = [];
|
|
3345
|
-
if (
|
|
3346
|
-
else if (
|
|
3347
|
-
else
|
|
3348
|
-
if (
|
|
3349
|
-
else if (
|
|
3350
|
-
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);
|
|
3351
3357
|
r && n.push(r);
|
|
3352
3358
|
}
|
|
3353
3359
|
});
|
|
3354
3360
|
return n;
|
|
3355
|
-
}, exports.kwid_match_id =
|
|
3356
|
-
e && !
|
|
3361
|
+
}, exports.kwid_match_id = Lr, exports.kwid_new_dict = function(e, t, n) {
|
|
3362
|
+
e && !_r(e) && En("GObj bad instanceof");
|
|
3357
3363
|
let r = {};
|
|
3358
|
-
if (
|
|
3359
|
-
else if (
|
|
3360
|
-
let o = t[n], s =
|
|
3361
|
-
|
|
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);
|
|
3362
3368
|
}
|
|
3363
|
-
else
|
|
3369
|
+
else En(`${Ze(e)} kwid_new_dict: data type unknown`);
|
|
3364
3370
|
return r;
|
|
3365
3371
|
}, exports.kwid_new_list = function(e, t, n) {
|
|
3366
|
-
if (e && !
|
|
3367
|
-
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)) {
|
|
3368
3374
|
let n = [];
|
|
3369
3375
|
for (let r of Object.keys(t)) {
|
|
3370
3376
|
let o = t[r];
|
|
3371
|
-
|
|
3377
|
+
tr(o) ? (o.id = r, n.push(o)) : En(`${Ze(e)} kwid_new_list: not a record: '${r}'`);
|
|
3372
3378
|
}
|
|
3373
3379
|
return n;
|
|
3374
3380
|
}
|
|
3375
|
-
return
|
|
3381
|
+
return En(`${Ze(e)} kwid_new_list: wrong type for list`), [];
|
|
3376
3382
|
}, exports.list2options = function(e, t, n) {
|
|
3377
3383
|
t = t || "id", n = n || "value";
|
|
3378
3384
|
let r = [];
|
|
3379
|
-
if (
|
|
3385
|
+
if (nr(e)) for (let o = 0; o < e.length; o++) {
|
|
3380
3386
|
let s = e[o];
|
|
3381
|
-
if (
|
|
3387
|
+
if (rr(s)) r.push({
|
|
3382
3388
|
id: e[o],
|
|
3383
3389
|
value: e[o]
|
|
3384
3390
|
});
|
|
3385
|
-
else if (
|
|
3391
|
+
else if (tr(s)) {
|
|
3386
3392
|
let e = {};
|
|
3387
|
-
if (
|
|
3388
|
-
if (!
|
|
3389
|
-
if (!(
|
|
3390
|
-
|
|
3393
|
+
if (dr(s, t)) {
|
|
3394
|
+
if (!dr(s, n)) {
|
|
3395
|
+
if (!(er(s) > 0)) {
|
|
3396
|
+
En("list2options(): object without field value: " + n);
|
|
3391
3397
|
continue;
|
|
3392
3398
|
}
|
|
3393
3399
|
n = Object.keys(s)[0];
|
|
3394
3400
|
}
|
|
3395
3401
|
e.id = s[t], e.value = s[n];
|
|
3396
3402
|
} else {
|
|
3397
|
-
if (!(
|
|
3398
|
-
|
|
3403
|
+
if (!(er(s) > 0)) {
|
|
3404
|
+
En("list2options(): object without field id: " + t);
|
|
3399
3405
|
continue;
|
|
3400
3406
|
}
|
|
3401
3407
|
t = Object.keys(s)[0], e.id = t, e.value = s[t];
|
|
3402
3408
|
}
|
|
3403
3409
|
r.push(e);
|
|
3404
|
-
} else
|
|
3410
|
+
} else En("list2options(): case1 not implemented");
|
|
3405
3411
|
}
|
|
3406
|
-
else if (
|
|
3412
|
+
else if (tr(e)) for (let t of Object.keys(e)) r.push({
|
|
3407
3413
|
id: t,
|
|
3408
3414
|
value: t
|
|
3409
3415
|
});
|
|
3410
|
-
else
|
|
3416
|
+
else En("list2options(): case2 not implemented");
|
|
3411
3417
|
return r;
|
|
3412
3418
|
}, exports.load_json_file = function(e, t, n) {
|
|
3413
3419
|
let r = new XMLHttpRequest();
|
|
@@ -3415,18 +3421,18 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3415
3421
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3416
3422
|
t(JSON.parse(r.responseText));
|
|
3417
3423
|
} catch (e) {
|
|
3418
|
-
n && (
|
|
3424
|
+
n && (En(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3419
3425
|
}
|
|
3420
3426
|
else n && n(r.status);
|
|
3421
3427
|
var e;
|
|
3422
3428
|
}, r.send();
|
|
3423
|
-
}, exports.log_debug =
|
|
3424
|
-
let n = hn(e, ...t), r =
|
|
3425
|
-
nn && un("info", n) && nn
|
|
3426
|
-
}, 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) {
|
|
3427
3433
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3428
3434
|
}, exports.refresh_language = function(e, t) {
|
|
3429
|
-
if (!
|
|
3435
|
+
if (!ir(t)) return void En("You must supply a translation function");
|
|
3430
3436
|
e || (e = document);
|
|
3431
3437
|
const n = (t) => {
|
|
3432
3438
|
let n = [];
|
|
@@ -3450,22 +3456,22 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3450
3456
|
});
|
|
3451
3457
|
}, exports.register_c_ievent_cli = function() {
|
|
3452
3458
|
return function(e) {
|
|
3453
|
-
if (
|
|
3459
|
+
if (Fo) return En(`GClass ALREADY created: ${e}`), -1;
|
|
3454
3460
|
const t = [
|
|
3455
3461
|
["ST_DISCONNECTED", [
|
|
3456
3462
|
[
|
|
3457
3463
|
"EV_ON_OPEN",
|
|
3458
|
-
|
|
3464
|
+
Ho,
|
|
3459
3465
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3460
3466
|
],
|
|
3461
3467
|
[
|
|
3462
3468
|
"EV_ON_CLOSE",
|
|
3463
|
-
|
|
3469
|
+
zo,
|
|
3464
3470
|
null
|
|
3465
3471
|
],
|
|
3466
3472
|
[
|
|
3467
3473
|
"EV_TIMEOUT",
|
|
3468
|
-
|
|
3474
|
+
qo,
|
|
3469
3475
|
null
|
|
3470
3476
|
],
|
|
3471
3477
|
[
|
|
@@ -3477,22 +3483,22 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3477
3483
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3478
3484
|
[
|
|
3479
3485
|
"EV_ON_MESSAGE",
|
|
3480
|
-
|
|
3486
|
+
es,
|
|
3481
3487
|
null
|
|
3482
3488
|
],
|
|
3483
3489
|
[
|
|
3484
3490
|
"EV_IDENTITY_CARD_ACK",
|
|
3485
|
-
|
|
3491
|
+
Zo,
|
|
3486
3492
|
null
|
|
3487
3493
|
],
|
|
3488
3494
|
[
|
|
3489
3495
|
"EV_ON_CLOSE",
|
|
3490
|
-
|
|
3496
|
+
zo,
|
|
3491
3497
|
"ST_DISCONNECTED"
|
|
3492
3498
|
],
|
|
3493
3499
|
[
|
|
3494
3500
|
"EV_TIMEOUT",
|
|
3495
|
-
|
|
3501
|
+
Xo,
|
|
3496
3502
|
null
|
|
3497
3503
|
],
|
|
3498
3504
|
[
|
|
@@ -3504,22 +3510,22 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3504
3510
|
["ST_SESSION", [
|
|
3505
3511
|
[
|
|
3506
3512
|
"EV_ON_MESSAGE",
|
|
3507
|
-
|
|
3513
|
+
es,
|
|
3508
3514
|
null
|
|
3509
3515
|
],
|
|
3510
3516
|
[
|
|
3511
3517
|
"EV_MT_STATS",
|
|
3512
|
-
|
|
3518
|
+
ts,
|
|
3513
3519
|
null
|
|
3514
3520
|
],
|
|
3515
3521
|
[
|
|
3516
3522
|
"EV_MT_COMMAND",
|
|
3517
|
-
|
|
3523
|
+
ns,
|
|
3518
3524
|
null
|
|
3519
3525
|
],
|
|
3520
3526
|
[
|
|
3521
3527
|
"EV_ON_CLOSE",
|
|
3522
|
-
|
|
3528
|
+
zo,
|
|
3523
3529
|
"ST_DISCONNECTED"
|
|
3524
3530
|
],
|
|
3525
3531
|
[
|
|
@@ -3530,7 +3536,7 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3530
3536
|
]],
|
|
3531
3537
|
[null, null]
|
|
3532
3538
|
];
|
|
3533
|
-
return (
|
|
3539
|
+
return (Fo = ge(e, [
|
|
3534
3540
|
["EV_ON_MESSAGE", $.EVF_OUTPUT_EVENT],
|
|
3535
3541
|
["EV_IDENTITY_CARD_ACK", $.EVF_PUBLIC_EVENT],
|
|
3536
3542
|
["EV_ON_ID_NAK", $.EVF_PUBLIC_EVENT | $.EVF_OUTPUT_EVENT],
|
|
@@ -3541,36 +3547,36 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3541
3547
|
["EV_ON_OPEN_ERROR", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3542
3548
|
["EV_TIMEOUT", 0],
|
|
3543
3549
|
[null, 0]
|
|
3544
|
-
], t,
|
|
3550
|
+
], t, rs, 0, Co, Uo, 0, 0, Lo, S.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3545
3551
|
}("C_IEVENT_CLI");
|
|
3546
3552
|
}, exports.register_c_timer = function() {
|
|
3547
3553
|
return function(e) {
|
|
3548
|
-
if (
|
|
3554
|
+
if (Eo) return En(`GClass ALREADY created: ${e}`), -1;
|
|
3549
3555
|
const t = [["ST_IDLE", [[
|
|
3550
3556
|
"EV_TIMEOUT",
|
|
3551
|
-
|
|
3557
|
+
To,
|
|
3552
3558
|
null
|
|
3553
3559
|
]]]];
|
|
3554
|
-
return (
|
|
3560
|
+
return (Eo = ge(e, [
|
|
3555
3561
|
["EV_TIMEOUT", $.EVF_OUTPUT_EVENT],
|
|
3556
3562
|
["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT],
|
|
3557
3563
|
[0, 0]
|
|
3558
|
-
], t,
|
|
3564
|
+
], t, vo, 0, ho, yo, 0, 0, 0, S.gcflag_manual_start)) ? 0 : -1;
|
|
3559
3565
|
}("C_TIMER");
|
|
3560
3566
|
}, exports.register_c_yuno = function() {
|
|
3561
3567
|
return function(e) {
|
|
3562
|
-
if (
|
|
3568
|
+
if ($o) return En(`GClass ALREADY created: ${e}`), -1;
|
|
3563
3569
|
const t = [["ST_IDLE", [[
|
|
3564
3570
|
"EV_TIMEOUT_PERIODIC",
|
|
3565
|
-
|
|
3571
|
+
ko,
|
|
3566
3572
|
null
|
|
3567
3573
|
]]]];
|
|
3568
|
-
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;
|
|
3569
3575
|
}("C_YUNO");
|
|
3570
3576
|
}, exports.safeSrc = function(e) {
|
|
3571
3577
|
if (!e) return "";
|
|
3572
3578
|
const t = String(e).trim();
|
|
3573
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3579
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Hr(t);
|
|
3574
3580
|
}, exports.sdata_flag_t = y, exports.send_http_json_post = function(e, t, n) {
|
|
3575
3581
|
let r = new XMLHttpRequest();
|
|
3576
3582
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -3594,16 +3600,16 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3594
3600
|
}
|
|
3595
3601
|
} else on = e;
|
|
3596
3602
|
}, exports.set_remote_log_functions = pn, exports.set_strings_are_text = function(e) {
|
|
3597
|
-
|
|
3598
|
-
}, exports.set_timeout =
|
|
3599
|
-
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;
|
|
3600
3606
|
}, exports.strncmp = function(e, t, n) {
|
|
3601
3607
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
3602
3608
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
3603
3609
|
}, exports.strs_in_list = function(e, t, n) {
|
|
3604
|
-
if (!e) return
|
|
3605
|
-
if (!t) return
|
|
3606
|
-
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;
|
|
3607
3613
|
return !1;
|
|
3608
3614
|
}, exports.strstr = function(e, t, n) {
|
|
3609
3615
|
var r;
|
|
@@ -3622,13 +3628,13 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3622
3628
|
placeholder: void 0,
|
|
3623
3629
|
fkey: null
|
|
3624
3630
|
};
|
|
3625
|
-
if (
|
|
3631
|
+
if (rr(t)) {
|
|
3626
3632
|
let e = t.split(".");
|
|
3627
3633
|
for (let t = 0; t < e.length; t++) {
|
|
3628
3634
|
let r = e[t];
|
|
3629
|
-
if (
|
|
3630
|
-
else if (
|
|
3631
|
-
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) {
|
|
3632
3638
|
case "writable":
|
|
3633
3639
|
n.is_writable = !0;
|
|
3634
3640
|
break;
|
|
@@ -3640,23 +3646,23 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3640
3646
|
}
|
|
3641
3647
|
}
|
|
3642
3648
|
n.real_type || (n.real_type = "string");
|
|
3643
|
-
} 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);
|
|
3644
3650
|
return n.type || (n.type = n.real_type), n;
|
|
3645
3651
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3646
3652
|
const n = e, r = performance.now();
|
|
3647
3653
|
let o = r;
|
|
3648
|
-
return t &&
|
|
3654
|
+
return t && Tn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
3649
3655
|
const l = performance.now(), i = (l - o) / 1e3, _ = (l - r) / 1e3;
|
|
3650
|
-
return t &&
|
|
3656
|
+
return t && Tn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${s}`), o = l, {
|
|
3651
3657
|
partial: i,
|
|
3652
3658
|
total: _
|
|
3653
3659
|
};
|
|
3654
3660
|
} };
|
|
3655
|
-
}, exports.trace_json =
|
|
3656
|
-
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)) {
|
|
3657
3663
|
if (-1 === t.indexOf("^")) {
|
|
3658
3664
|
let n, r = e.hook;
|
|
3659
|
-
if (1 !==
|
|
3665
|
+
if (1 !== Xn(r)) return En("bad hook 1"), En(e), En(t), null;
|
|
3660
3666
|
for (let e of Object.keys(r)) {
|
|
3661
3667
|
n = e, r[e];
|
|
3662
3668
|
break;
|
|
@@ -3668,25 +3674,25 @@ exports.GObj = O, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3668
3674
|
}
|
|
3669
3675
|
{
|
|
3670
3676
|
let n = t.split("^");
|
|
3671
|
-
return 2 !== n.length ? (
|
|
3677
|
+
return 2 !== n.length ? (En("bad hook 2"), En(e), En(t), null) : {
|
|
3672
3678
|
topic_name: n[0],
|
|
3673
3679
|
id: n[1]
|
|
3674
3680
|
};
|
|
3675
3681
|
}
|
|
3676
3682
|
}
|
|
3677
|
-
return
|
|
3683
|
+
return tr(t) ? {
|
|
3678
3684
|
topic_name: t.topic_name,
|
|
3679
3685
|
id: t.id
|
|
3680
|
-
} : (
|
|
3686
|
+
} : (En("bad hook 3"), En(e), En(t), null);
|
|
3681
3687
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3682
|
-
let n =
|
|
3688
|
+
let n = fo(e, t);
|
|
3683
3689
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3684
|
-
}, exports.treedb_get_field_desc =
|
|
3685
|
-
if (
|
|
3690
|
+
}, exports.treedb_get_field_desc = mo, exports.treedb_hook_data_size = function(e) {
|
|
3691
|
+
if (nr(e) && 1 === er(e)) {
|
|
3686
3692
|
let t = e[0];
|
|
3687
|
-
return
|
|
3693
|
+
return dr(t, "size") ? t.size : 1;
|
|
3688
3694
|
}
|
|
3689
|
-
return
|
|
3695
|
+
return er(e);
|
|
3690
3696
|
}, exports.vsprintf = function(e, n) {
|
|
3691
3697
|
return t.apply(null, [e].concat(n || []));
|
|
3692
3698
|
}, exports.walk_type_t = R;
|