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