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