@yuneta/gobj-js 7.13.3 → 7.13.5
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 +32 -8
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +866 -858
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +32 -9
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +901 -893
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +32 -8
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +866 -858
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +32 -8
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +866 -858
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.cjs.min.js
CHANGED
|
@@ -175,7 +175,7 @@ var h = class {
|
|
|
175
175
|
}
|
|
176
176
|
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, o) {
|
|
178
|
-
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 =
|
|
178
|
+
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 = Qt(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
180
|
}, O = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
@@ -221,7 +221,7 @@ var h = class {
|
|
|
221
221
|
};
|
|
222
222
|
var I = 0;
|
|
223
223
|
function $(e) {
|
|
224
|
-
|
|
224
|
+
gn(e) && (e = JSON.stringify(e)), qt(" ".repeat(Math.max(1, 2 * m)) + String(e));
|
|
225
225
|
}
|
|
226
226
|
var C = Object.freeze({
|
|
227
227
|
TRACE_MACHINE: 65536,
|
|
@@ -317,7 +317,7 @@ var C = Object.freeze({
|
|
|
317
317
|
]
|
|
318
318
|
], P = 0, U = 0, F = 0;
|
|
319
319
|
function G(e, t) {
|
|
320
|
-
if (
|
|
320
|
+
if (yn(e)) return 268369920;
|
|
321
321
|
if (/^[0-9]+$/.test(String(e))) {
|
|
322
322
|
const t = Number(e);
|
|
323
323
|
if (t) return t;
|
|
@@ -325,7 +325,7 @@ function G(e, t) {
|
|
|
325
325
|
return function(e) {
|
|
326
326
|
for (const [t, n] of L) if (t === e) return n;
|
|
327
327
|
return 0;
|
|
328
|
-
}(String(e)) || (
|
|
328
|
+
}(String(e)) || (Bt(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
329
329
|
}
|
|
330
330
|
function V(e) {
|
|
331
331
|
if (F) return 4294967295;
|
|
@@ -339,11 +339,11 @@ function M(e) {
|
|
|
339
339
|
function W() {
|
|
340
340
|
if (!d || !d.jn_attrs) return 0;
|
|
341
341
|
let e = 0;
|
|
342
|
-
if (
|
|
343
|
-
const t = Number(
|
|
342
|
+
if (rt(d, "tracing")) {
|
|
343
|
+
const t = Number(ot(d, "tracing")) || 0;
|
|
344
344
|
t >= 1 && (e |= C.TRACE_MACHINE), t >= 2 && (e |= C.TRACE_EV_KW);
|
|
345
345
|
}
|
|
346
|
-
return
|
|
346
|
+
return rt(d, "trace_timer") && ot(d, "trace_timer") && (e |= C.TRACE_TIMER), rt(d, "trace_creation") && ot(d, "trace_creation") && (e |= C.TRACE_CREATE_DELETE), rt(d, "trace_start_stop") && ot(d, "trace_start_stop") && (e |= C.TRACE_START_STOP), e;
|
|
347
347
|
}
|
|
348
348
|
function K(e) {
|
|
349
349
|
return (V(e) | W()) & C.TRACE_CREATE_DELETE;
|
|
@@ -365,7 +365,7 @@ function J(e, t) {
|
|
|
365
365
|
}
|
|
366
366
|
function q(e, t) {
|
|
367
367
|
let n = {};
|
|
368
|
-
if (!
|
|
368
|
+
if (!pn(t)) return Bt("sdata_desc MUST be an array"), zt(t), n;
|
|
369
369
|
for (let r = 0; r < t.length; r++) {
|
|
370
370
|
const o = t[r];
|
|
371
371
|
o.name && H(e, n, o);
|
|
@@ -379,133 +379,133 @@ function H(e, t, n) {
|
|
|
379
379
|
r = String(o);
|
|
380
380
|
break;
|
|
381
381
|
case E.DTP_BOOLEAN:
|
|
382
|
-
r =
|
|
382
|
+
r = vn(o);
|
|
383
383
|
break;
|
|
384
384
|
case E.DTP_INTEGER:
|
|
385
|
-
r = parseInt(o), isNaN(r) &&
|
|
385
|
+
r = parseInt(o), isNaN(r) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
386
386
|
break;
|
|
387
387
|
case E.DTP_REAL:
|
|
388
|
-
r = Number(o), isNaN(r) &&
|
|
388
|
+
r = Number(o), isNaN(r) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
389
389
|
break;
|
|
390
390
|
case E.DTP_LIST:
|
|
391
|
-
if (
|
|
391
|
+
if (dn(o)) try {
|
|
392
392
|
r = JSON.parse(o);
|
|
393
393
|
} catch (e) {
|
|
394
|
-
|
|
394
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
395
395
|
}
|
|
396
396
|
else r = o;
|
|
397
|
-
|
|
397
|
+
pn(r) || (r = []);
|
|
398
398
|
break;
|
|
399
399
|
case E.DTP_DICT:
|
|
400
|
-
if (
|
|
400
|
+
if (dn(o)) try {
|
|
401
401
|
r = JSON.parse(o);
|
|
402
402
|
} catch (e) {
|
|
403
|
-
|
|
403
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
404
404
|
}
|
|
405
405
|
else r = o;
|
|
406
|
-
|
|
406
|
+
gn(r) || (r = {});
|
|
407
407
|
break;
|
|
408
408
|
case E.DTP_JSON:
|
|
409
|
-
if (
|
|
409
|
+
if (dn(o)) try {
|
|
410
410
|
r = JSON.parse(o);
|
|
411
411
|
} catch (e) {
|
|
412
|
-
|
|
412
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
413
413
|
}
|
|
414
414
|
else r = o;
|
|
415
415
|
break;
|
|
416
416
|
case E.DTP_POINTER: r = o;
|
|
417
417
|
}
|
|
418
|
-
return void 0 === r && (
|
|
418
|
+
return void 0 === r && (Bt(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
419
419
|
}
|
|
420
420
|
function z(e, t, n, r) {
|
|
421
421
|
let o;
|
|
422
422
|
switch (n.type) {
|
|
423
423
|
case E.DTP_STRING:
|
|
424
424
|
if (null == r) o = "";
|
|
425
|
-
else if (
|
|
425
|
+
else if (dn(r)) o = String(r);
|
|
426
426
|
else {
|
|
427
427
|
let e = JSON.stringify(r);
|
|
428
428
|
e && (o = String(e));
|
|
429
429
|
}
|
|
430
430
|
break;
|
|
431
431
|
case E.DTP_BOOLEAN:
|
|
432
|
-
o =
|
|
432
|
+
o = vn(r);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_INTEGER:
|
|
435
|
-
o = parseInt(r), isNaN(o) &&
|
|
435
|
+
o = parseInt(r), isNaN(o) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_REAL:
|
|
438
|
-
o = Number(r), isNaN(o) &&
|
|
438
|
+
o = Number(r), isNaN(o) && Bt(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
440
|
case E.DTP_LIST:
|
|
441
|
-
if (
|
|
441
|
+
if (dn(r)) try {
|
|
442
442
|
o = JSON.parse(r);
|
|
443
443
|
} catch (e) {
|
|
444
|
-
|
|
444
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
445
445
|
}
|
|
446
446
|
else o = r;
|
|
447
|
-
if (!
|
|
447
|
+
if (!pn(o)) return Bt(`attr must be an array: ${n.name}`), -1;
|
|
448
448
|
break;
|
|
449
449
|
case E.DTP_DICT:
|
|
450
|
-
if (
|
|
450
|
+
if (dn(r)) try {
|
|
451
451
|
o = JSON.parse(r);
|
|
452
452
|
} catch (e) {
|
|
453
|
-
|
|
453
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
454
454
|
}
|
|
455
455
|
else o = r;
|
|
456
|
-
if (!
|
|
456
|
+
if (!gn(o)) return Bt(`attr must be an object: ${n.name}`), -1;
|
|
457
457
|
break;
|
|
458
458
|
case E.DTP_JSON:
|
|
459
|
-
if (
|
|
459
|
+
if (dn(r)) try {
|
|
460
460
|
o = JSON.parse(r);
|
|
461
461
|
} catch (e) {
|
|
462
|
-
|
|
462
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
463
463
|
}
|
|
464
464
|
else o = r;
|
|
465
|
-
if (!
|
|
465
|
+
if (!pn(o) && !gn(o)) return Bt(`attr must be a json dict/list: ${n.name}`), -1;
|
|
466
466
|
break;
|
|
467
467
|
case E.DTP_POINTER: o = r;
|
|
468
468
|
}
|
|
469
|
-
return void 0 === o &&
|
|
469
|
+
return void 0 === o && Bt(`${Fe(e)}: attr undefined: ${n.name}`), t[n.name] = o, gn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = o), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
470
470
|
}
|
|
471
471
|
function Q(e) {
|
|
472
472
|
return e.jn_attrs;
|
|
473
473
|
}
|
|
474
474
|
function X(e, t, n) {
|
|
475
|
-
return
|
|
475
|
+
return rt(e, t) ? Q(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n && Bt(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`), null);
|
|
476
476
|
}
|
|
477
477
|
function Z(e, t, n) {
|
|
478
|
-
if (!(e && e instanceof j)) return n &&
|
|
478
|
+
if (!(e && e instanceof j)) return n && Bt("gclass NULL"), null;
|
|
479
479
|
if (!t) return e.attrs_table;
|
|
480
480
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
481
481
|
const r = e.attrs_table[n];
|
|
482
482
|
if (r.name && r.name === t) return r;
|
|
483
483
|
}
|
|
484
|
-
return n &&
|
|
484
|
+
return n && Bt(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
485
485
|
}
|
|
486
486
|
function ee(e, t, n, r, o, s, i, l, _, a, u) {
|
|
487
|
-
if (
|
|
488
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
489
|
-
if (ue(e)) return
|
|
487
|
+
if (yn(e)) return Bt("gclass_name EMPTY"), null;
|
|
488
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Bt(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
489
|
+
if (ue(e)) return Bt(`GClass ALREADY exists: ${e}`), null;
|
|
490
490
|
let c = new j(e, r, o, s, i, l, _, a, u);
|
|
491
491
|
(function(e, t) {
|
|
492
|
-
e && e instanceof j ? t ? g[t] ?
|
|
492
|
+
e && e instanceof j ? t ? g[t] ? Bt(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : Bt("gclass_name undefined") : Bt("gclass undefined");
|
|
493
493
|
})(c, e);
|
|
494
494
|
const f = n.length;
|
|
495
495
|
for (let e = 0; e < f; e++) {
|
|
496
496
|
let t = n[e][0], r = n[e][1];
|
|
497
|
-
if (
|
|
497
|
+
if (yn(t)) continue;
|
|
498
498
|
if (oe(c, t) < 0) return te(c), null;
|
|
499
499
|
const o = r.length;
|
|
500
500
|
for (let e = 0; e < o; e++) {
|
|
501
501
|
let n = r[e][0], o = r[e][1], s = r[e][2];
|
|
502
|
-
|
|
502
|
+
yn(n) || se(c, t, n, o, s);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
for (let e = 0; e < t.length; e++) {
|
|
506
506
|
let n = t[e][0], r = t[e][1];
|
|
507
|
-
if (!
|
|
508
|
-
if (_e(c, n)) return
|
|
507
|
+
if (!yn(n)) {
|
|
508
|
+
if (_e(c, n)) return Bt(`SMachine: event repeated in input_events: ${n}`), te(c), null;
|
|
509
509
|
le(c, n, r);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
@@ -517,13 +517,13 @@ function ee(e, t, n, r, o, s, i, l, _, a, u) {
|
|
|
517
517
|
}
|
|
518
518
|
function te(e) {
|
|
519
519
|
let t;
|
|
520
|
-
if (
|
|
520
|
+
if (dn(e)) t = e;
|
|
521
521
|
else {
|
|
522
|
-
if (!(e instanceof j)) return
|
|
522
|
+
if (!(e instanceof j)) return Bt("Cannot unregister gclass, type unknown"), -1;
|
|
523
523
|
t = e.gclass_name;
|
|
524
524
|
}
|
|
525
525
|
let n = g[t];
|
|
526
|
-
return n ? n.instances > 0 ? (
|
|
526
|
+
return n ? n.instances > 0 ? (Bt(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete g[t], 0) : (Bt(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
527
527
|
}
|
|
528
528
|
function ne(e, t) {
|
|
529
529
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -542,22 +542,22 @@ function re(e, t) {
|
|
|
542
542
|
return null;
|
|
543
543
|
}
|
|
544
544
|
function oe(e, t) {
|
|
545
|
-
return e instanceof j ? ne(e, t) ? (
|
|
545
|
+
return e instanceof j ? ne(e, t) ? (Bt(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (Bt("Cannot add state, typeof not GClass"), -1);
|
|
546
546
|
}
|
|
547
547
|
function se(e, t, n, r, o) {
|
|
548
|
-
if (!(e instanceof j)) return
|
|
549
|
-
if (
|
|
548
|
+
if (!(e instanceof j)) return Bt("Cannot add state, typeof not GClass"), -1;
|
|
549
|
+
if (yn(t)) return Bt("state_name EMPTY"), -1;
|
|
550
550
|
let s = ne(e, t);
|
|
551
|
-
return s ? re(s, n) ? (
|
|
551
|
+
return s ? re(s, n) ? (Bt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new x(n, r, o)), 0) : (Bt(`state not found: ${t}`), -1);
|
|
552
552
|
}
|
|
553
553
|
function ie(e, t, n) {
|
|
554
|
-
|
|
554
|
+
yn(t) || e.push(new k(t, n));
|
|
555
555
|
}
|
|
556
556
|
function le(e, t, n) {
|
|
557
|
-
return e instanceof j ? ie(e.dl_events, t, n) : (
|
|
557
|
+
return e instanceof j ? ie(e.dl_events, t, n) : (Bt("Cannot add state, typeof not GClass"), -1);
|
|
558
558
|
}
|
|
559
559
|
function _e(e, t) {
|
|
560
|
-
if (!(e instanceof j)) return
|
|
560
|
+
if (!(e instanceof j)) return Bt("Cannot add state, typeof not GClass"), 0;
|
|
561
561
|
const n = e.dl_events.length, r = e.dl_events;
|
|
562
562
|
for (let e = 0; e < n; e++) {
|
|
563
563
|
let n = r[e];
|
|
@@ -566,25 +566,25 @@ function _e(e, t) {
|
|
|
566
566
|
return null;
|
|
567
567
|
}
|
|
568
568
|
function ae(e) {
|
|
569
|
-
if (!(e instanceof j)) return
|
|
569
|
+
if (!(e instanceof j)) return Bt("Cannot add state, typeof not GClass"), -1;
|
|
570
570
|
let t = 0;
|
|
571
|
-
|
|
571
|
+
cn(e.dl_states) || (Bt(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
572
572
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
573
573
|
let r = e.dl_states[n];
|
|
574
|
-
if (!
|
|
574
|
+
if (!yn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
575
575
|
let o = r.dl_actions[n];
|
|
576
|
-
|
|
576
|
+
yn(o.event_name) || (_e(e, o.event_name) || (Bt(`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 && (ne(e, o.next_state) || (Bt(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
580
580
|
let r = e.dl_events[n];
|
|
581
|
-
if (!
|
|
581
|
+
if (!yn(r.event_name) && (bn(r.event_flag) || (Bt(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & w.EVF_OUTPUT_EVENT))) {
|
|
582
582
|
let n = !1;
|
|
583
583
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
584
584
|
let o = e.dl_states[t];
|
|
585
|
-
|
|
585
|
+
yn(o.state_name) || re(o, r.event_name) && (n = !0);
|
|
586
586
|
}
|
|
587
|
-
n || (
|
|
587
|
+
n || (Bt(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
return t;
|
|
@@ -594,62 +594,62 @@ function ue(e, t) {
|
|
|
594
594
|
try {
|
|
595
595
|
n = g[e];
|
|
596
596
|
} catch (e) {}
|
|
597
|
-
return n || (t &&
|
|
597
|
+
return n || (t && Bt(`gclass not found: ${e}`), null);
|
|
598
598
|
}
|
|
599
599
|
function ce() {
|
|
600
600
|
return !b || b.obflag & R.obflag_destroyed ? null : b;
|
|
601
601
|
}
|
|
602
602
|
function fe(e, t) {
|
|
603
603
|
e = e.toLowerCase();
|
|
604
|
-
return p[e] || (t &&
|
|
604
|
+
return p[e] || (t && Bt(`gobj service not found: ${e}`), null);
|
|
605
605
|
}
|
|
606
606
|
function ge(e) {
|
|
607
607
|
let t = Pe(e);
|
|
608
|
-
return t = t.toLowerCase(), p[t] &&
|
|
608
|
+
return t = t.toLowerCase(), p[t] && Bt(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), p[t] = e, 0;
|
|
609
609
|
}
|
|
610
610
|
function pe(e, t) {
|
|
611
|
-
t.parent &&
|
|
611
|
+
t.parent && Bt(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
612
612
|
}
|
|
613
613
|
function de(e, t) {
|
|
614
|
-
let n =
|
|
615
|
-
n >= 0 && (
|
|
614
|
+
let n = lr(e.dl_children, t);
|
|
615
|
+
n >= 0 && (an(e.dl_children, n), t.parent = null);
|
|
616
616
|
}
|
|
617
617
|
function be(e, t) {
|
|
618
|
-
"__json_config_variables__" !== t &&
|
|
618
|
+
"__json_config_variables__" !== t && Bt(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`);
|
|
619
619
|
}
|
|
620
620
|
function me(e, t, n) {
|
|
621
621
|
let r = t;
|
|
622
622
|
(function(e, t, n, r, o) {
|
|
623
|
-
if (!e || !t) return
|
|
623
|
+
if (!e || !t) return Bt("hsdata or kw NULL"), -1;
|
|
624
624
|
let s = 0;
|
|
625
625
|
for (const [i, l] of Object.entries(t)) {
|
|
626
626
|
const t = Z(o.gclass, i, !1);
|
|
627
|
-
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED &&
|
|
627
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && Jt(`${Fe(o)}: Deprecated attribute used in gobj creation: ${i}`), s += z(o, e, t, l)) : r && (r(o, i), s--);
|
|
628
628
|
}
|
|
629
629
|
return s;
|
|
630
|
-
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (
|
|
630
|
+
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (Bt(`${Fe(e)} json2data() FAILED`), zt(r));
|
|
631
631
|
}
|
|
632
632
|
function Ee(e, n, r, o, s) {
|
|
633
633
|
if (s & N.gobj_flag_yuno) {
|
|
634
|
-
if (d) return
|
|
634
|
+
if (d) return Bt("__yuno__ already created"), null;
|
|
635
635
|
s |= N.gobj_flag_service;
|
|
636
636
|
} else {
|
|
637
|
-
if (!o) return
|
|
638
|
-
if (!("string" == typeof o || o instanceof S)) return
|
|
639
|
-
if (
|
|
637
|
+
if (!o) return Bt("gobj NEEDS a parent!"), null;
|
|
638
|
+
if (!("string" == typeof o || o instanceof S)) return Bt(`BAD TYPE of parent: ${o}`), null;
|
|
639
|
+
if (dn(o) && !(o = fe(o))) return Jt(`parent service not found: ${o}`), null;
|
|
640
640
|
}
|
|
641
|
-
if (s & N.gobj_flag_service && fe(e, !1)) return
|
|
641
|
+
if (s & N.gobj_flag_service && fe(e, !1)) return Bt(`service ALREADY registered: ${n}^${e}`), null;
|
|
642
642
|
if (s & N.gobj_flag_default_service) {
|
|
643
|
-
if (b) return
|
|
643
|
+
if (b) return Bt(`default service ALREADY registered: ${n}^${e}`), null;
|
|
644
644
|
s |= N.gobj_flag_service;
|
|
645
645
|
}
|
|
646
|
-
if (
|
|
646
|
+
if (yn(n)) return Bt("gclass_name must be a string"), null;
|
|
647
647
|
let l = ue(n, !1);
|
|
648
|
-
if (!l) return
|
|
649
|
-
if (!
|
|
650
|
-
if (!
|
|
651
|
-
if (e.includes("`")) return
|
|
652
|
-
if (e.includes("^")) return
|
|
648
|
+
if (!l) return Bt(`GClass not registered: ${n}^${e}`), null;
|
|
649
|
+
if (!dn(e)) return Bt(`gobj_name must be a string: ${n}`), null;
|
|
650
|
+
if (!yn(e)) {
|
|
651
|
+
if (e.includes("`")) return Bt(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
652
|
+
if (e.includes("^")) return Bt(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
653
653
|
}
|
|
654
654
|
let _ = new S(e, l, r, o, s);
|
|
655
655
|
_.jn_attrs = q(_, l.attrs_table);
|
|
@@ -661,19 +661,19 @@ function Te(e, t, n, r) {
|
|
|
661
661
|
return Ee(e, t, n, r, N.gobj_flag_pure_child);
|
|
662
662
|
}
|
|
663
663
|
function he(e) {
|
|
664
|
-
if (Ke(e)) return void
|
|
665
|
-
e.__refs__ > 0 &&
|
|
666
|
-
if (0 ===
|
|
667
|
-
for (let t of
|
|
668
|
-
|
|
664
|
+
if (Ke(e)) return void Bt("gobj NULL or DESTROYED");
|
|
665
|
+
e.__refs__ > 0 && Bt(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Bt(`Destroying a PLAYING gobj: ${Ge(e)}`), we(e)), e.running && (Bt(`Destroying a RUNNING gobj: ${Ge(e)}`), Se(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
666
|
+
if (0 === Tt.length) return;
|
|
667
|
+
for (let t of Tt) t.src === e && (t.src = null);
|
|
668
|
+
Tt = Tt.filter((t) => t.dst !== e);
|
|
669
669
|
}(e);
|
|
670
670
|
let n = K(e);
|
|
671
671
|
n && $(t("💔💔⏩ destroying: %s", Ge(e)));
|
|
672
672
|
let r = Ve(e);
|
|
673
673
|
r && r.gclass.gmt.mt_child_removed && (n && $(t("👦👦🔴 child_removed(%s): %s", Ge(r), Fe(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
674
674
|
let t = Pe(e);
|
|
675
|
-
t = t.toLowerCase(), p[t] ? delete p[t] :
|
|
676
|
-
}(e),
|
|
675
|
+
t = t.toLowerCase(), p[t] ? delete p[t] : Bt(`"service NOT found in register": ${t}`);
|
|
676
|
+
}(e), xt(e, e.dl_subscriptions, !0), xt(e, e.dl_subscribings, !0), r && (de(r, e), Me(e) && (Ye(r) !== e || Ke(r) || Be(r, null))), function(e) {
|
|
677
677
|
let t = e.dl_children.slice();
|
|
678
678
|
for (let e = 0; e < t.length; e++) {
|
|
679
679
|
let n = t[e];
|
|
@@ -682,9 +682,9 @@ function he(e) {
|
|
|
682
682
|
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && $(t("💔💔⏪ destroyed: %s", Ge(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
683
683
|
}
|
|
684
684
|
function ye(e) {
|
|
685
|
-
if (Ke(e)) return
|
|
686
|
-
if (e.running) return
|
|
687
|
-
if (e.disabled) return
|
|
685
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
686
|
+
if (e.running) return Bt(`${Fe(e)}: GObj ALREADY RUNNING`), -1;
|
|
687
|
+
if (e.disabled) return Bt(`${Fe(e)}: GObj DISABLED`), -1;
|
|
688
688
|
Y(e) && $(t("⏺ ⏺ start: %s", Ge(e))), e.running = !0;
|
|
689
689
|
let n = 0;
|
|
690
690
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
@@ -696,9 +696,9 @@ function je(e, t, n) {
|
|
|
696
696
|
return e.gclass.gclass_flag & O.gcflag_manual_start || xe(e) ? 1 : (De(e) || ye(e), 0);
|
|
697
697
|
}
|
|
698
698
|
function Se(e) {
|
|
699
|
-
if (Ke(e)) return
|
|
700
|
-
if (!e.running) return
|
|
701
|
-
e.playing && (
|
|
699
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
700
|
+
if (!e.running) return Bt(`${Fe(e)}: GObj NOT RUNNING`), -1;
|
|
701
|
+
e.playing && (Jt(`${Fe(e)}: GObj stopping without previous pause`), we(e)), Y(e) && $(t("⏹ ⏹ stop: %s", Ge(e))), e.running = !1;
|
|
702
702
|
let n = 0;
|
|
703
703
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
704
704
|
}
|
|
@@ -706,22 +706,22 @@ function Oe(e, t, n) {
|
|
|
706
706
|
return De(e) && Se(e), 0;
|
|
707
707
|
}
|
|
708
708
|
function Ne(e) {
|
|
709
|
-
return Ke(e) ? (
|
|
709
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST, Oe, 0, 0);
|
|
710
710
|
}
|
|
711
711
|
function Re(e) {
|
|
712
|
-
if (Ke(e)) return
|
|
713
|
-
if (e.playing) return
|
|
714
|
-
if (e.disabled) return
|
|
712
|
+
if (Ke(e)) return Bt(`gobj NULL or DESTROYED: ${Fe(e)}`), -1;
|
|
713
|
+
if (e.playing) return Bt(`${Fe(e)}: GObj ALREADY PLAYING`), -1;
|
|
714
|
+
if (e.disabled) return Bt(`${Fe(e)}: GObj DISABLED`), -1;
|
|
715
715
|
if (!De(e)) {
|
|
716
|
-
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return
|
|
717
|
-
|
|
716
|
+
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return Bt(`${Fe(e)}: Cannot play, start not done`), -1;
|
|
717
|
+
Jt(`${Fe(e)}: GObj playing without previous start`), ye(e);
|
|
718
718
|
}
|
|
719
719
|
Y(e) && $(t("⏯ ⏯ play: %s", Ge(e))), e.playing = !0;
|
|
720
720
|
let n = 0;
|
|
721
|
-
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), n < 0 && (e.playing = !1)), n;
|
|
721
|
+
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
722
722
|
}
|
|
723
723
|
function we(e) {
|
|
724
|
-
return Ke(e) ? (
|
|
724
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : e.playing ? (Y(e) && $(t("⏸ ⏸ pause: %s", Ge(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (Bt(`${Fe(e)}: GObj NOT PLAYING`), -1);
|
|
725
725
|
}
|
|
726
726
|
function De(e) {
|
|
727
727
|
return !Ke(e) && e.running;
|
|
@@ -744,92 +744,95 @@ function $e() {
|
|
|
744
744
|
}
|
|
745
745
|
function Ce() {
|
|
746
746
|
let e = Ie();
|
|
747
|
-
return e ?
|
|
747
|
+
return e ? _t(e, "yuno_role") : "";
|
|
748
748
|
}
|
|
749
749
|
function Le() {
|
|
750
750
|
let e = Ie();
|
|
751
|
-
return e ?
|
|
751
|
+
return e ? _t(e, "yuno_id") : "";
|
|
752
752
|
}
|
|
753
753
|
function Pe(e) {
|
|
754
|
-
return
|
|
754
|
+
return hn(e) ? e.gobj_name : (Bt("gobj bad type"), null);
|
|
755
755
|
}
|
|
756
756
|
function Ue(e) {
|
|
757
|
-
return
|
|
757
|
+
return hn(e) ? e.gclass.gclass_name : (Bt("gobj NULL of bad type"), null);
|
|
758
758
|
}
|
|
759
759
|
function Fe(e) {
|
|
760
|
-
return
|
|
760
|
+
return hn(e) ? e.gclass.gclass_name + "^" + Pe(e) : (Bt("gobj bad type"), null);
|
|
761
761
|
}
|
|
762
762
|
function Ge(e) {
|
|
763
|
-
if (!
|
|
763
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
764
764
|
let t = Fe(e), n = Ve(e);
|
|
765
765
|
for (; n;) t = Fe(n) + "`" + t, n = Ve(n);
|
|
766
766
|
return t;
|
|
767
767
|
}
|
|
768
768
|
function Ve(e) {
|
|
769
|
-
return
|
|
769
|
+
return hn(e) ? e.parent : (Bt("gobj NULL of bad type"), null);
|
|
770
770
|
}
|
|
771
771
|
function Me(e) {
|
|
772
|
-
return
|
|
772
|
+
return hn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (Bt("gobj NULL of bad type"), null);
|
|
773
773
|
}
|
|
774
774
|
function We(e) {
|
|
775
|
-
return
|
|
775
|
+
return hn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (Bt("gobj NULL of bad type"), null);
|
|
776
776
|
}
|
|
777
777
|
function Ke(e) {
|
|
778
|
-
return !
|
|
778
|
+
return !hn(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
779
779
|
}
|
|
780
780
|
function Ye(e) {
|
|
781
|
-
return
|
|
781
|
+
return hn(e) ? e.bottom_gobj : (Bt("gobj NULL of bad type"), null);
|
|
782
782
|
}
|
|
783
783
|
function Be(e, t) {
|
|
784
|
-
if (!
|
|
785
|
-
e.bottom_gobj &&
|
|
784
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
785
|
+
e.bottom_gobj && Jt(`${Fe(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
786
786
|
}
|
|
787
787
|
function Je(e, t, n) {
|
|
788
|
-
return
|
|
788
|
+
return hn(e) ? t ? Z(e.gclass, t, n) : e.gclass.attrs_table : (Bt("gobj NULL of bad type"), null);
|
|
789
789
|
}
|
|
790
790
|
function qe(e, t, n, r, o) {
|
|
791
|
-
return Ke(e) ? (
|
|
791
|
+
return Ke(e) ? (Bt("gobj NULL, destroying, or bad type"), 0) : Qe(e.dl_children, t, n, r, o);
|
|
792
792
|
}
|
|
793
793
|
function He(e, t, n, r, o) {
|
|
794
|
-
return Ke(e) ? (
|
|
794
|
+
return Ke(e) ? (Bt("gobj NULL, destroying, or bad type"), 0) : Ze(e.dl_children, t, n, r, o);
|
|
795
795
|
}
|
|
796
|
-
function ze(e
|
|
796
|
+
function ze(e) {
|
|
797
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || Bt(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
798
|
+
}
|
|
799
|
+
function Qe(e, t, n, r, o) {
|
|
797
800
|
let s, i = [...e];
|
|
798
801
|
if (t & D.WALK_LAST2FIRST) for (let e = i.length; e > 0; e--) {
|
|
799
802
|
s = i[e - 1];
|
|
800
|
-
let t = n(s, r, o);
|
|
803
|
+
let t = ze(n(s, r, o));
|
|
801
804
|
if (t < 0) return t;
|
|
802
805
|
}
|
|
803
806
|
else for (let e = 0; e < i.length; e++) {
|
|
804
807
|
s = i[e];
|
|
805
|
-
let t = n(s, r, o);
|
|
808
|
+
let t = ze(n(s, r, o));
|
|
806
809
|
if (t < 0) return t;
|
|
807
810
|
}
|
|
808
811
|
return 0;
|
|
809
812
|
}
|
|
810
|
-
function
|
|
811
|
-
let s, i =
|
|
813
|
+
function Xe(e, t, n, r, o) {
|
|
814
|
+
let s, i = Qe(e, t, n, r, o);
|
|
812
815
|
if (i < 0) return i;
|
|
813
816
|
if (t & D.WALK_LAST2FIRST) {
|
|
814
|
-
for (let l = e.length; l > 0; l--) if (s = e[l - 1], i =
|
|
815
|
-
} else for (let l = 0; l < e.length; l++) if (s = e[l], i =
|
|
817
|
+
for (let l = e.length; l > 0; l--) if (s = e[l - 1], i = Xe([...s.dl_children], t, n, r, o), i < 0) return i;
|
|
818
|
+
} else for (let l = 0; l < e.length; l++) if (s = e[l], i = Xe([...s.dl_children], t, n, r, o), i < 0) return i;
|
|
816
819
|
return i;
|
|
817
820
|
}
|
|
818
|
-
function
|
|
819
|
-
if (t & D.WALK_BYLEVEL) return
|
|
821
|
+
function Ze(e, t, n, r, o) {
|
|
822
|
+
if (t & D.WALK_BYLEVEL) return Xe(e, t, n, r, o);
|
|
820
823
|
let s, i;
|
|
821
824
|
if (t & D.WALK_BOTTOM2TOP) for (let l = e.length; l > 0; l--) {
|
|
822
|
-
if (i = e[l - 1], s =
|
|
823
|
-
if (s = n(i, r, o), s < 0) return s;
|
|
825
|
+
if (i = e[l - 1], s = Ze([...i.dl_children], t, n, r, o), s < 0) return s;
|
|
826
|
+
if (s = ze(n(i, r, o)), s < 0) return s;
|
|
824
827
|
}
|
|
825
828
|
else for (let l = 0; l < e.length; l++) {
|
|
826
|
-
if (i = e[l], s = n(i, r, o), s < 0) return s;
|
|
827
|
-
if (0 === s && (s =
|
|
829
|
+
if (i = e[l], s = ze(n(i, r, o)), s < 0) return s;
|
|
830
|
+
if (0 === s && (s = Ze([...i.dl_children], t, n, r, o), s < 0)) return s;
|
|
828
831
|
}
|
|
829
832
|
return 0;
|
|
830
833
|
}
|
|
831
|
-
function
|
|
832
|
-
if (!
|
|
834
|
+
function et(e, t) {
|
|
835
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), !1;
|
|
833
836
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
834
837
|
t.__disabled__;
|
|
835
838
|
let s = t.__state__;
|
|
@@ -839,21 +842,21 @@ function Ze(e, t) {
|
|
|
839
842
|
let t = o.length;
|
|
840
843
|
if (o !== Pe(e).substring(0, t)) return !1;
|
|
841
844
|
}
|
|
842
|
-
if (s && s !==
|
|
845
|
+
if (s && s !== dt(e)) return !1;
|
|
843
846
|
let i = e.jn_attrs;
|
|
844
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n &&
|
|
847
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && rt(e, n) && i[n] !== t[n]) return !1;
|
|
845
848
|
return !0;
|
|
846
849
|
}
|
|
847
|
-
function
|
|
848
|
-
if (Ke(e)) return
|
|
850
|
+
function tt(e, t) {
|
|
851
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
849
852
|
const n = e.dl_children;
|
|
850
853
|
for (let e = 0; e < n.length; e++) {
|
|
851
854
|
const r = n[e];
|
|
852
|
-
if (
|
|
855
|
+
if (et(r, t)) return r;
|
|
853
856
|
}
|
|
854
857
|
return null;
|
|
855
858
|
}
|
|
856
|
-
function
|
|
859
|
+
function nt(e, t) {
|
|
857
860
|
if (!t) return null;
|
|
858
861
|
let n = t.split("`");
|
|
859
862
|
if (!function(e, t) {
|
|
@@ -869,56 +872,56 @@ function tt(e, t) {
|
|
|
869
872
|
if (1 === n.length) return e;
|
|
870
873
|
let r = n[1].split("^"), o = {};
|
|
871
874
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
872
|
-
let s =
|
|
873
|
-
return s ? (n.splice(0, 1), n = n.join("`"),
|
|
875
|
+
let s = tt(e, o);
|
|
876
|
+
return s ? (n.splice(0, 1), n = n.join("`"), nt(s, n)) : null;
|
|
874
877
|
}
|
|
875
|
-
function
|
|
876
|
-
return !
|
|
878
|
+
function rt(e, t) {
|
|
879
|
+
return !yn(t) && !!Z(e.gclass, t, !1);
|
|
877
880
|
}
|
|
878
|
-
function
|
|
881
|
+
function ot(e, t, n) {
|
|
879
882
|
let r = e.jn_attrs;
|
|
880
883
|
if (t in r && r.hasOwnProperty(t)) {
|
|
881
884
|
let n = r[t];
|
|
882
885
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
883
886
|
}
|
|
884
|
-
return
|
|
887
|
+
return Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
885
888
|
}
|
|
886
|
-
function
|
|
889
|
+
function st(e, t, n) {
|
|
887
890
|
let r = {}, o = e.gclass.attrs_table;
|
|
888
891
|
for (let n = 0; n < o.length; n++) {
|
|
889
892
|
const s = o[n];
|
|
890
893
|
if (s.name && (-1 === t || s.flag & t)) {
|
|
891
894
|
let t;
|
|
892
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
895
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = nn(e.jn_attrs, s.name) : (t = e.gclass.gmt.mt_reading(e, s.name), void 0 === t && (t = nn(e.jn_attrs, s.name))), on(r, s.name, t);
|
|
893
896
|
}
|
|
894
897
|
}
|
|
895
898
|
return r;
|
|
896
899
|
}
|
|
897
|
-
function
|
|
900
|
+
function it(e, t) {
|
|
898
901
|
if (t) {
|
|
899
|
-
if (0 ===
|
|
900
|
-
if (0 ===
|
|
901
|
-
if (0 ===
|
|
902
|
-
if (0 ===
|
|
902
|
+
if (0 === Sn(t, "__disabled__")) return xe(e);
|
|
903
|
+
if (0 === Sn(t, "__running__")) return De(e);
|
|
904
|
+
if (0 === Sn(t, "__playing__")) return ke(e);
|
|
905
|
+
if (0 === Sn(t, "__service__")) return Ae(e);
|
|
903
906
|
}
|
|
904
907
|
let n = X(e, t, !1);
|
|
905
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
906
|
-
}
|
|
907
|
-
function it(e, t) {
|
|
908
|
-
t && jn(t, "__trace_level__");
|
|
909
|
-
let n = X(e, t, !1);
|
|
910
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? tn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Yt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
908
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
911
909
|
}
|
|
912
910
|
function lt(e, t) {
|
|
913
|
-
|
|
911
|
+
t && Sn(t, "__trace_level__");
|
|
914
912
|
let n = X(e, t, !1);
|
|
915
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
913
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
916
914
|
}
|
|
917
915
|
function _t(e, t) {
|
|
916
|
+
if (t && 0 === Sn(t, "__state__")) return dt(e);
|
|
917
|
+
let n = X(e, t, !1);
|
|
918
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
919
|
+
}
|
|
920
|
+
function at(e, t) {
|
|
918
921
|
let n = X(e, t, !1);
|
|
919
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
922
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
920
923
|
}
|
|
921
|
-
function
|
|
924
|
+
function ut(e, t, n, r) {
|
|
922
925
|
let o = Q(e), s = 0;
|
|
923
926
|
for (const [r, i] of Object.entries(t)) {
|
|
924
927
|
let t = Je(e, r, !0);
|
|
@@ -926,34 +929,34 @@ function at(e, t, n, r) {
|
|
|
926
929
|
}
|
|
927
930
|
return s;
|
|
928
931
|
}
|
|
929
|
-
function ut(e, t, n) {
|
|
930
|
-
let r = X(e, t, !1);
|
|
931
|
-
return r ? (r[t] = yn(n), fn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Yt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
932
|
-
}
|
|
933
932
|
function ct(e, t, n) {
|
|
934
933
|
let r = X(e, t, !1);
|
|
935
|
-
return r ? (r[t] =
|
|
934
|
+
return r ? (r[t] = vn(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
936
935
|
}
|
|
937
936
|
function ft(e, t, n) {
|
|
938
937
|
let r = X(e, t, !1);
|
|
939
|
-
return r ? (r[t] =
|
|
938
|
+
return r ? (r[t] = parseInt(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
939
|
+
}
|
|
940
|
+
function gt(e, t, n) {
|
|
941
|
+
let r = X(e, t, !1);
|
|
942
|
+
return r ? (r[t] = String(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
940
943
|
}
|
|
941
|
-
function
|
|
942
|
-
if (Ke(e)) return
|
|
944
|
+
function pt(e, n) {
|
|
945
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
943
946
|
if (e.current_state.state_name === n) return !1;
|
|
944
947
|
let r = ne(e.gclass, n);
|
|
945
|
-
if (!r) return
|
|
948
|
+
if (!r) return Bt(`${Fe(e)}: state unknown, state ${n}`), !1;
|
|
946
949
|
e.last_state = e.current_state, e.current_state = r;
|
|
947
950
|
let o = B(e, "EV_STATE_CHANGED"), s = !!function(e) {
|
|
948
951
|
return V(e) & C.TRACE_STATES;
|
|
949
952
|
}(e);
|
|
950
|
-
return (o || s) && $(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ue(e), Pe(e),
|
|
953
|
+
return (o || s) && $(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ue(e), Pe(e), dt(e), e.last_state.state_name)), !0;
|
|
951
954
|
}
|
|
952
|
-
function
|
|
953
|
-
return
|
|
955
|
+
function dt(e) {
|
|
956
|
+
return hn(e) ? e.current_state.state_name : (Bt("hgobj NULL"), "");
|
|
954
957
|
}
|
|
955
|
-
function
|
|
956
|
-
if (!
|
|
958
|
+
function bt(e, t, n) {
|
|
959
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
957
960
|
let r = _e(e.gclass, t);
|
|
958
961
|
if (r) return r;
|
|
959
962
|
if (n) {
|
|
@@ -965,51 +968,51 @@ function dt(e, t, n) {
|
|
|
965
968
|
}
|
|
966
969
|
return null;
|
|
967
970
|
}
|
|
968
|
-
function
|
|
969
|
-
let r =
|
|
971
|
+
function mt(e, t, n) {
|
|
972
|
+
let r = bt(e, t, !1);
|
|
970
973
|
return !!r && !(n && !(r.event_flag & n));
|
|
971
974
|
}
|
|
972
|
-
function
|
|
973
|
-
let r =
|
|
975
|
+
function Et(e, t, n) {
|
|
976
|
+
let r = bt(e, t, !1);
|
|
974
977
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & w.EVF_OUTPUT_EVENT);
|
|
975
978
|
}
|
|
976
|
-
var
|
|
977
|
-
function
|
|
978
|
-
|
|
979
|
-
let e =
|
|
980
|
-
|
|
979
|
+
var Tt = [], ht = !1;
|
|
980
|
+
function yt() {
|
|
981
|
+
ht = !1;
|
|
982
|
+
let e = Tt;
|
|
983
|
+
Tt = [];
|
|
981
984
|
let t = 0;
|
|
982
|
-
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (
|
|
983
|
-
return
|
|
985
|
+
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (vt(n.dst, n.event, n.kw, n.src), t++);
|
|
986
|
+
return Tt.length > 0 && !ht && (ht = !0, setTimeout(yt, 0)), t;
|
|
984
987
|
}
|
|
985
|
-
function
|
|
986
|
-
if (!(e && e instanceof S)) return
|
|
987
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
988
|
+
function vt(e, n, r, o) {
|
|
989
|
+
if (!(e && e instanceof S)) return Bt("gobj dst NULL"), -1;
|
|
990
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return Bt("gobj dst DESTROYED"), -1;
|
|
988
991
|
let s = e.current_state;
|
|
989
|
-
if (!s) return
|
|
992
|
+
if (!s) return Bt(`${Fe(e)}: current_state NULL`), -1;
|
|
990
993
|
let i = B(e, n) && !J(o, n);
|
|
991
994
|
m++;
|
|
992
995
|
let l = re(s, n);
|
|
993
|
-
if (!l) return e.gclass.gmt.mt_inject_event ? (m--, i && ($(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && i > 1 &&
|
|
996
|
+
if (!l) return e.gclass.gmt.mt_inject_event ? (m--, i && ($(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && i > 1 && un(r) && zt(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (i && $(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Ue(o), Pe(o))), Bt(`📛📛 Event NOT DEFINED in state 📛📛: ${Fe(e)}, ${s.state_name}, ${n}`), m--, -1);
|
|
994
997
|
if (i) {
|
|
995
998
|
if (1 === I) $(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Fe(e), s.state_name, o && !o.running ? "!!" : "", Fe(o)));
|
|
996
999
|
else {
|
|
997
1000
|
let r = "";
|
|
998
|
-
l.action && (r =
|
|
1001
|
+
l.action && (r = ar(l.action)), $(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, "", n || "", "", r, o && !o.running ? "!!" : "", Ue(o), Pe(o)));
|
|
999
1002
|
}
|
|
1000
|
-
r && (V(e) | W()) & C.TRACE_EV_KW &&
|
|
1003
|
+
r && (V(e) | W()) & C.TRACE_EV_KW && un(r) && zt(r);
|
|
1001
1004
|
}
|
|
1002
|
-
l.next_state &&
|
|
1005
|
+
l.next_state && pt(e, l.next_state);
|
|
1003
1006
|
let _ = -1;
|
|
1004
1007
|
try {
|
|
1005
1008
|
l.action && (_ = l.action(e, n, r, o));
|
|
1006
1009
|
} finally {}
|
|
1007
|
-
return !i || 1 === I || e.obflag & R.obflag_destroyed || $(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, n || "",
|
|
1010
|
+
return !i || 1 === I || e.obflag & R.obflag_destroyed || $(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, n || "", bn(_) ? _ : 0)), m--, _;
|
|
1008
1011
|
}
|
|
1009
|
-
var
|
|
1012
|
+
var jt = Object.freeze({
|
|
1010
1013
|
__hard_subscription__: 1,
|
|
1011
1014
|
__own_event__: 2
|
|
1012
|
-
}),
|
|
1015
|
+
}), St = [
|
|
1013
1016
|
v(E.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1014
1017
|
v(E.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1015
1018
|
v(E.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1022,48 +1025,48 @@ var vt = Object.freeze({
|
|
|
1022
1025
|
v(E.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1023
1026
|
y()
|
|
1024
1027
|
];
|
|
1025
|
-
function
|
|
1026
|
-
let s =
|
|
1027
|
-
if (t && t !==
|
|
1028
|
-
let t =
|
|
1029
|
-
|
|
1028
|
+
function Ot(e, t, n, r, o) {
|
|
1029
|
+
let s = $n(t, r, "__config__", null), i = $n(t, r, "__global__", null), l = $n(t, r, "__local__", null), _ = Cn(t, r, "__filter__", null), a = !0;
|
|
1030
|
+
if (t && t !== In(null, e, "publisher", null) && (a = !1), o && o !== In(null, e, "subscriber", null) && (a = !1), n && n !== kn(null, e, "event", "") && (a = !1), fn(s) > 0) {
|
|
1031
|
+
let t = $n(null, e, "__config__", null);
|
|
1032
|
+
fn(t) > 0 && Xt(t, s) || (a = !1);
|
|
1030
1033
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
let t =
|
|
1033
|
-
|
|
1034
|
+
if (fn(i) > 0) {
|
|
1035
|
+
let t = $n(null, e, "__global__", null);
|
|
1036
|
+
fn(t) > 0 && Xt(t, i) || (a = !1);
|
|
1034
1037
|
}
|
|
1035
|
-
if (
|
|
1036
|
-
let t =
|
|
1037
|
-
|
|
1038
|
+
if (fn(l) > 0) {
|
|
1039
|
+
let t = $n(null, e, "__local__", null);
|
|
1040
|
+
fn(t) > 0 && Xt(t, l) || (a = !1);
|
|
1038
1041
|
}
|
|
1039
|
-
if (
|
|
1040
|
-
let t =
|
|
1041
|
-
|
|
1042
|
+
if (fn(_) > 0) {
|
|
1043
|
+
let t = Cn(null, e, "__filter__", null);
|
|
1044
|
+
fn(t) > 0 && Xt(t, _) || (a = !1);
|
|
1042
1045
|
}
|
|
1043
1046
|
return a;
|
|
1044
1047
|
}
|
|
1045
|
-
function
|
|
1048
|
+
function Nt(e, t, n, r, o) {
|
|
1046
1049
|
let s = [];
|
|
1047
1050
|
for (let i = 0; i < e.length; i++) {
|
|
1048
1051
|
let l = e[i];
|
|
1049
|
-
|
|
1052
|
+
Ot(l, t, n, r, o) && ln(s, l);
|
|
1050
1053
|
}
|
|
1051
1054
|
return s;
|
|
1052
1055
|
}
|
|
1053
|
-
function
|
|
1054
|
-
for (let s = 0; s < e.length; s++) if (
|
|
1056
|
+
function Rt(e, t, n, r, o) {
|
|
1057
|
+
for (let s = 0; s < e.length; s++) if (Ot(e[s], t, n, r, o)) return s;
|
|
1055
1058
|
return -1;
|
|
1056
1059
|
}
|
|
1057
|
-
function Rt(e, n, r, o) {
|
|
1058
|
-
let s = kn(e, n, "publisher", null, It.KW_REQUIRED), i = kn(e, n, "subscriber", null, It.KW_REQUIRED), l = An(e, n, "event", "", It.KW_REQUIRED);
|
|
1059
|
-
if (!!(xn(e, n, "subs_flag", null, It.KW_REQUIRED) & vt.__hard_subscription__) && !r) return -1;
|
|
1060
|
-
d && st(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", l || "", Fe(s), Fe(i))), Ht(n)), s.obflag & R.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1061
|
-
let _ = Nt(s.dl_subscriptions, s, l, n, i);
|
|
1062
|
-
return _ >= 0 ? _n(s.dl_subscriptions, _) : (Yt(`${Fe(e)}: subscription in publisher not found`), Ht(n)), _ = Nt(i.dl_subscribings, s, l, n, i), _ >= 0 ? _n(i.dl_subscribings, _) : (Yt(`${Fe(e)}: subscription in subscriber not found`), Ht(n)), 0;
|
|
1063
|
-
}
|
|
1064
1060
|
function wt(e, n, r, o) {
|
|
1065
|
-
|
|
1066
|
-
if (
|
|
1061
|
+
let s = In(e, n, "publisher", null, $t.KW_REQUIRED), i = In(e, n, "subscriber", null, $t.KW_REQUIRED), l = kn(e, n, "event", "", $t.KW_REQUIRED);
|
|
1062
|
+
if (!!(An(e, n, "subs_flag", null, $t.KW_REQUIRED) & jt.__hard_subscription__) && !r) return -1;
|
|
1063
|
+
d && it(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", l || "", Fe(s), Fe(i))), zt(n)), s.obflag & R.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1064
|
+
let _ = Rt(s.dl_subscriptions, s, l, n, i);
|
|
1065
|
+
return _ >= 0 ? an(s.dl_subscriptions, _) : (Bt(`${Fe(e)}: subscription in publisher not found`), zt(n)), _ = Rt(i.dl_subscribings, s, l, n, i), _ >= 0 ? an(i.dl_subscribings, _) : (Bt(`${Fe(e)}: subscription in subscriber not found`), zt(n)), 0;
|
|
1066
|
+
}
|
|
1067
|
+
function Dt(e, n, r, o) {
|
|
1068
|
+
if (null == r && (r = {}), !e) return Bt(`publisher NULL: ev ${n}`), 0;
|
|
1069
|
+
if (!o) return Bt(`subscriber NULL: ev ${n}`), 0;
|
|
1067
1070
|
const s = /* @__PURE__ */ new Set([
|
|
1068
1071
|
"__config__",
|
|
1069
1072
|
"__global__",
|
|
@@ -1072,52 +1075,57 @@ function wt(e, n, r, o) {
|
|
|
1072
1075
|
"__service__"
|
|
1073
1076
|
]);
|
|
1074
1077
|
if (Object.keys(r).forEach((t) => {
|
|
1075
|
-
s.has(t) ||
|
|
1076
|
-
}),
|
|
1077
|
-
else if (!(
|
|
1078
|
-
let i =
|
|
1079
|
-
|
|
1078
|
+
s.has(t) || Bt(`${Fe(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1079
|
+
}), yn(n)) n = "";
|
|
1080
|
+
else if (!(Et(e, n, w.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Fe(e)}, ${n}`), 0;
|
|
1081
|
+
let i = Nt(e.dl_subscriptions, e, n, r, o);
|
|
1082
|
+
cn(i) > 0 && (Bt(`${Fe(e)}: ${cn(i)} subscription(s) REPEATED, will be deleted and override`), zt(i, "subscription REPEATED"), xt(e, i, !1));
|
|
1080
1083
|
let l = function(e, t, n, r) {
|
|
1081
|
-
let o = q(e,
|
|
1082
|
-
|
|
1084
|
+
let o = q(e, St);
|
|
1085
|
+
sn(o, "event", t), sn(o, "subscriber", r), sn(o, "publisher", e);
|
|
1083
1086
|
let s = 0;
|
|
1084
1087
|
if (n) {
|
|
1085
|
-
let t =
|
|
1086
|
-
if (
|
|
1087
|
-
let n =
|
|
1088
|
-
if (
|
|
1089
|
-
let t =
|
|
1090
|
-
|
|
1088
|
+
let t = $n(e, n, "__config__", null), r = $n(e, n, "__global__", null), i = $n(e, n, "__local__", null), l = Cn(e, n, "__filter__", null), _ = kn(e, n, "__service__", "");
|
|
1089
|
+
if (fn(r) > 0 && sn(o, "__global__", Qt(r)), fn(t) > 0) {
|
|
1090
|
+
let n = Qt(t);
|
|
1091
|
+
if (sn(o, "__config__", n), Rn(n, "__hard_subscription__")) {
|
|
1092
|
+
let t = xn(e, n, "__hard_subscription__", !1);
|
|
1093
|
+
rn(n, "__hard_subscription__"), t && (s |= jt.__hard_subscription__);
|
|
1091
1094
|
}
|
|
1092
|
-
if (
|
|
1093
|
-
let t =
|
|
1094
|
-
|
|
1095
|
+
if (Rn(n, "__own_event__")) {
|
|
1096
|
+
let t = xn(e, n, "__own_event__", !1);
|
|
1097
|
+
rn(n, "__own_event__"), t && (s |= jt.__own_event__);
|
|
1095
1098
|
}
|
|
1096
1099
|
}
|
|
1097
|
-
|
|
1100
|
+
fn(i) > 0 && sn(o, "__local__", Qt(i)), fn(l) > 0 && sn(o, "__filter__", Qt(l)), yn(_) || sn(o, "__service__", _);
|
|
1098
1101
|
}
|
|
1099
|
-
return
|
|
1102
|
+
return sn(o, "subs_flag", s), o;
|
|
1100
1103
|
}(e, n, r, o);
|
|
1101
|
-
|
|
1104
|
+
if (!l) return Bt(`${Fe(e)}: _create_subscription() FAILED`), 0;
|
|
1105
|
+
if (ln(e.dl_subscriptions, l), ln(o.dl_subscribings, l), d && it(d, "trace_subscriptions") && ($(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Fe(e), Fe(o))), r && zt(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1106
|
+
let t = e.gclass.gmt.mt_subscription_added(e, l);
|
|
1107
|
+
(t < 0 || !1 === t) && (wt(e, l, !0, !0), l = 0);
|
|
1108
|
+
}
|
|
1109
|
+
return l;
|
|
1102
1110
|
}
|
|
1103
|
-
function
|
|
1111
|
+
function xt(e, t, n) {
|
|
1104
1112
|
let r = [...t];
|
|
1105
|
-
for (let t = 0; t < r.length; t++)
|
|
1113
|
+
for (let t = 0; t < r.length; t++) wt(e, r[t], n, !1);
|
|
1106
1114
|
return 0;
|
|
1107
1115
|
}
|
|
1108
|
-
function xt(e, t, n, r) {
|
|
1109
|
-
return null == n && (n = {}), Ot(e.dl_subscriptions, e, t, n, r);
|
|
1110
|
-
}
|
|
1111
1116
|
function At(e, t, n, r) {
|
|
1112
|
-
return
|
|
1113
|
-
}
|
|
1114
|
-
function kt(e, n, r) {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
if (
|
|
1119
|
-
|
|
1120
|
-
|
|
1117
|
+
return null == n && (n = {}), Nt(e.dl_subscriptions, e, t, n, r);
|
|
1118
|
+
}
|
|
1119
|
+
function kt(e, t, n, r) {
|
|
1120
|
+
return Nt(e.dl_subscribings, r, t, n, e);
|
|
1121
|
+
}
|
|
1122
|
+
function It(e, n, r) {
|
|
1123
|
+
if (gn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
1124
|
+
if (yn(n)) return Bt(`${Fe(e)}: event EMPTY`), -1;
|
|
1125
|
+
let o = bt(e, n, !0);
|
|
1126
|
+
if (!(o && o.event_flag & (w.EVF_SYSTEM_EVENT | w.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Fe(e)}, ev ${n}`), -1;
|
|
1127
|
+
let s = d && it(d, "trace_subscriptions");
|
|
1128
|
+
if (s && ($(t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, "", n || "", "")), zt(r)), e.gclass.gmt.mt_publish_event) {
|
|
1121
1129
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1122
1130
|
if (t <= 0) return t;
|
|
1123
1131
|
}
|
|
@@ -1127,30 +1135,30 @@ function kt(e, n, r) {
|
|
|
1127
1135
|
if (e.gclass.gmt.mt_publication_pre_filter) {
|
|
1128
1136
|
let t = e.gclass.gmt.mt_publication_pre_filter(e, a, n, r);
|
|
1129
1137
|
if (t < 0) break;
|
|
1130
|
-
if (
|
|
1138
|
+
if (!t) continue;
|
|
1131
1139
|
}
|
|
1132
|
-
let u =
|
|
1140
|
+
let u = In(e, a, "subscriber", null, $t.KW_REQUIRED);
|
|
1133
1141
|
if (!u || Ke(u)) continue;
|
|
1134
|
-
let c =
|
|
1135
|
-
if (
|
|
1136
|
-
|
|
1137
|
-
let o =
|
|
1138
|
-
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) :
|
|
1142
|
+
let c = An(e, a, "subs_flag", 0, $t.KW_REQUIRED), f = kn(e, a, "event", "", $t.KW_REQUIRED);
|
|
1143
|
+
if (yn(f) || 0 === Sn(f, n)) {
|
|
1144
|
+
$n(e, a, "__config__", null, 0);
|
|
1145
|
+
let o = $n(e, a, "__global__", null, 0), i = $n(e, a, "__local__", null, 0), f = Cn(e, a, "__filter__", null, 0), g = r, p = 1;
|
|
1146
|
+
if (e.gclass.gmt.mt_publication_filter ? p = e.gclass.gmt.mt_publication_filter(e, n, g, u) : fn(f) > 0 && (p = Fn(g, f) ? 1 : 0, s && ($(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", p ? "👍" : "👎", n || "", Fe(u), Fe(e))), zt(f))), p < 0) break;
|
|
1139
1147
|
if (!p) continue;
|
|
1140
|
-
let d =
|
|
1141
|
-
if (d && d.event_flag & w.EVF_SYSTEM_EVENT && !
|
|
1142
|
-
i &&
|
|
1143
|
-
let b =
|
|
1144
|
-
if (b < 0 && c &
|
|
1148
|
+
let d = bt(u, n, !0);
|
|
1149
|
+
if (d && d.event_flag & w.EVF_SYSTEM_EVENT && !mt(u, d.event_name, 0)) continue;
|
|
1150
|
+
i && Nn(g, i), o && Zt(g, o), s && ($(t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Fe(u), dt(u), n || "", e && !e.running ? "!!" : "", Fe(e))), zt(g));
|
|
1151
|
+
let b = vt(u, n, g, e);
|
|
1152
|
+
if (b < 0 && c & jt.__own_event__) {
|
|
1145
1153
|
l = -1;
|
|
1146
1154
|
break;
|
|
1147
1155
|
}
|
|
1148
1156
|
if (_ += b, l++, Ke(e)) break;
|
|
1149
1157
|
}
|
|
1150
1158
|
}
|
|
1151
|
-
return l || o && o.event_flag & w.EVF_NO_WARN_SUBS ||
|
|
1159
|
+
return l || o && o.event_flag & w.EVF_NO_WARN_SUBS || Jt(`${Fe(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1152
1160
|
}
|
|
1153
|
-
var
|
|
1161
|
+
var $t = Object.freeze({
|
|
1154
1162
|
KW_REQUIRED: 1,
|
|
1155
1163
|
KW_CREATE: 2,
|
|
1156
1164
|
KW_WILD_NUMBER: 4,
|
|
@@ -1170,23 +1178,23 @@ Object.freeze({
|
|
|
1170
1178
|
JSON_FALSE: 7,
|
|
1171
1179
|
JSON_NULL: 8
|
|
1172
1180
|
});
|
|
1173
|
-
var
|
|
1174
|
-
var
|
|
1175
|
-
var
|
|
1176
|
-
function
|
|
1177
|
-
if (
|
|
1178
|
-
|
|
1181
|
+
var Ct = "undefined" != typeof window ? window.console : console, Lt = Ct.error, Pt = Ct.warn, Ut = Ct.info, Ft = Ct.debug, Gt = null;
|
|
1182
|
+
var Vt = !0;
|
|
1183
|
+
var Mt = !1;
|
|
1184
|
+
function Wt(e, t, n) {
|
|
1185
|
+
if (Gt && !Mt) {
|
|
1186
|
+
Mt = !0;
|
|
1179
1187
|
try {
|
|
1180
|
-
|
|
1188
|
+
Gt(e, t, n);
|
|
1181
1189
|
} catch (e) {} finally {
|
|
1182
|
-
|
|
1190
|
+
Mt = !1;
|
|
1183
1191
|
}
|
|
1184
1192
|
}
|
|
1185
1193
|
}
|
|
1186
|
-
function Wt(e) {
|
|
1187
|
-
e ? (Ct = e, Lt = e) : (Ct = $t.error, Lt = $t.warn);
|
|
1188
|
-
}
|
|
1189
1194
|
function Kt(e) {
|
|
1195
|
+
e ? (Lt = e, Pt = e) : (Lt = Ct.error, Pt = Ct.warn);
|
|
1196
|
+
}
|
|
1197
|
+
function Yt(e) {
|
|
1190
1198
|
const t = Array.prototype.slice.call(arguments);
|
|
1191
1199
|
let n = "";
|
|
1192
1200
|
if ("string" == typeof e) {
|
|
@@ -1208,36 +1216,36 @@ function Kt(e) {
|
|
|
1208
1216
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1209
1217
|
return n;
|
|
1210
1218
|
}
|
|
1211
|
-
function Yt(e) {
|
|
1212
|
-
let t = Kt(e), n = sr();
|
|
1213
|
-
Ct && (Ct === $t.error ? Gt && Ct("%c" + n + " ERROR: " + String(t), "color:red") : (Gt && $t.error("%c" + n + " ERROR: " + String(t), "color:red"), Ct(`${n} ERROR: ${String(t)}`))), Mt("error", t, n);
|
|
1214
|
-
}
|
|
1215
1219
|
function Bt(e) {
|
|
1216
|
-
let t =
|
|
1217
|
-
Lt && (Lt ===
|
|
1220
|
+
let t = Yt(e), n = ir();
|
|
1221
|
+
Lt && (Lt === Ct.error ? Vt && Lt("%c" + n + " ERROR: " + String(t), "color:red") : (Vt && Ct.error("%c" + n + " ERROR: " + String(t), "color:red"), Lt(`${n} ERROR: ${String(t)}`))), Wt("error", t, n);
|
|
1218
1222
|
}
|
|
1219
1223
|
function Jt(e) {
|
|
1220
|
-
let t =
|
|
1221
|
-
|
|
1224
|
+
let t = Yt(e), n = ir();
|
|
1225
|
+
Pt && (Pt === Ct.warn ? Vt && Pt("%c" + n + " WARNING: " + String(t), "color:yellow") : (Vt && Ct.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Pt(`${n} WARNING: ${String(t)}`))), Wt("warning", t, n);
|
|
1222
1226
|
}
|
|
1223
1227
|
function qt(e) {
|
|
1224
|
-
let t =
|
|
1225
|
-
|
|
1228
|
+
let t = Yt(e), n = ir();
|
|
1229
|
+
Ft && Vt && Ft("%c" + n + " DEBUG: " + String(t), "color:silver"), Wt("debug", t, n);
|
|
1230
|
+
}
|
|
1231
|
+
function Ht(e) {
|
|
1232
|
+
let t = Yt(e), n = ir();
|
|
1233
|
+
Ft && Vt && Ft("%c" + n + " MSG: " + String(t), "color:cyan"), Wt("msg", t, n);
|
|
1226
1234
|
}
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1235
|
+
function zt(e, t) {
|
|
1236
|
+
Vt && (t && window.console.warn("=====> " + t), window.console.dir(e)), Wt("json", e, ir());
|
|
1229
1237
|
}
|
|
1230
|
-
function
|
|
1238
|
+
function Qt(e) {
|
|
1231
1239
|
return structuredClone(e);
|
|
1232
1240
|
}
|
|
1233
|
-
function
|
|
1241
|
+
function Xt(e, t) {
|
|
1234
1242
|
if (e === t) return !0;
|
|
1235
1243
|
if (null === e || null === t) return e === t;
|
|
1236
1244
|
if (typeof e != typeof t) return !1;
|
|
1237
1245
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1238
1246
|
if (Array.isArray(e)) {
|
|
1239
1247
|
if (e.length !== t.length) return !1;
|
|
1240
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1248
|
+
for (let n = 0; n < e.length; n++) if (!Xt(e[n], t[n])) return !1;
|
|
1241
1249
|
return !0;
|
|
1242
1250
|
}
|
|
1243
1251
|
if ("object" == typeof e) {
|
|
@@ -1245,211 +1253,211 @@ function Qt(e, t) {
|
|
|
1245
1253
|
if (n.length !== r.length) return !1;
|
|
1246
1254
|
for (let o = 0; o < n.length; o++) {
|
|
1247
1255
|
if (n[o] !== r[o]) return !1;
|
|
1248
|
-
if (!
|
|
1256
|
+
if (!Xt(e[n[o]], t[r[o]])) return !1;
|
|
1249
1257
|
}
|
|
1250
1258
|
return !0;
|
|
1251
1259
|
}
|
|
1252
1260
|
return e === t;
|
|
1253
1261
|
}
|
|
1254
|
-
function
|
|
1262
|
+
function Zt(e, t) {
|
|
1255
1263
|
if (!t) return e;
|
|
1256
1264
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1257
1265
|
return e;
|
|
1258
1266
|
}
|
|
1259
|
-
function
|
|
1267
|
+
function en(e, t) {
|
|
1260
1268
|
if (!t) return e;
|
|
1261
1269
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1262
1270
|
return e;
|
|
1263
1271
|
}
|
|
1264
|
-
function
|
|
1272
|
+
function tn(e, t) {
|
|
1265
1273
|
if (!t) return e;
|
|
1266
1274
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1267
1275
|
return e;
|
|
1268
1276
|
}
|
|
1269
|
-
function
|
|
1277
|
+
function nn(e, t) {
|
|
1270
1278
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1271
1279
|
}
|
|
1272
|
-
function
|
|
1280
|
+
function rn(e, t) {
|
|
1273
1281
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1274
1282
|
}
|
|
1275
|
-
function rn(e, t, n) {
|
|
1276
|
-
e[t] = n;
|
|
1277
|
-
}
|
|
1278
1283
|
function on(e, t, n) {
|
|
1279
1284
|
e[t] = n;
|
|
1280
1285
|
}
|
|
1281
|
-
function sn(e, t) {
|
|
1282
|
-
e
|
|
1286
|
+
function sn(e, t, n) {
|
|
1287
|
+
e[t] = n;
|
|
1283
1288
|
}
|
|
1284
1289
|
function ln(e, t) {
|
|
1285
1290
|
e.push(t);
|
|
1286
1291
|
}
|
|
1287
1292
|
function _n(e, t) {
|
|
1288
|
-
e.
|
|
1293
|
+
e.push(t);
|
|
1289
1294
|
}
|
|
1290
|
-
function an(e) {
|
|
1291
|
-
|
|
1295
|
+
function an(e, t) {
|
|
1296
|
+
e.splice(t, 1);
|
|
1292
1297
|
}
|
|
1293
1298
|
function un(e) {
|
|
1294
|
-
return gn(e) ? e.length : 0;
|
|
1299
|
+
return gn(e) ? Object.keys(e).length : 0;
|
|
1295
1300
|
}
|
|
1296
1301
|
function cn(e) {
|
|
1297
|
-
return
|
|
1302
|
+
return pn(e) ? e.length : 0;
|
|
1298
1303
|
}
|
|
1299
1304
|
function fn(e) {
|
|
1300
|
-
return
|
|
1305
|
+
return gn(e) ? Object.keys(e).length : pn(e) ? e.length : dn(e) && e.length > 0 ? 1 : 0;
|
|
1301
1306
|
}
|
|
1302
1307
|
function gn(e) {
|
|
1303
|
-
return Array.isArray(e);
|
|
1308
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1304
1309
|
}
|
|
1305
1310
|
function pn(e) {
|
|
1306
|
-
return
|
|
1311
|
+
return Array.isArray(e);
|
|
1307
1312
|
}
|
|
1308
1313
|
function dn(e) {
|
|
1309
|
-
return "
|
|
1314
|
+
return "string" == typeof e;
|
|
1310
1315
|
}
|
|
1311
1316
|
function bn(e) {
|
|
1312
|
-
return "
|
|
1317
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1313
1318
|
}
|
|
1314
1319
|
function mn(e) {
|
|
1315
|
-
return
|
|
1320
|
+
return "boolean" == typeof e;
|
|
1316
1321
|
}
|
|
1317
1322
|
function En(e) {
|
|
1318
|
-
return
|
|
1323
|
+
return null == e;
|
|
1319
1324
|
}
|
|
1320
1325
|
function Tn(e) {
|
|
1321
|
-
return
|
|
1326
|
+
return "function" == typeof e;
|
|
1322
1327
|
}
|
|
1323
1328
|
function hn(e) {
|
|
1324
|
-
return
|
|
1329
|
+
return e instanceof S;
|
|
1325
1330
|
}
|
|
1326
1331
|
function yn(e) {
|
|
1327
|
-
return dn(e)
|
|
1332
|
+
return !dn(e) || 0 === e.length;
|
|
1328
1333
|
}
|
|
1329
|
-
function vn(e
|
|
1330
|
-
return e
|
|
1334
|
+
function vn(e) {
|
|
1335
|
+
return bn(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1331
1336
|
}
|
|
1332
1337
|
function jn(e, t) {
|
|
1338
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1339
|
+
}
|
|
1340
|
+
function Sn(e, t) {
|
|
1333
1341
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1334
1342
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1335
1343
|
}
|
|
1336
|
-
function
|
|
1337
|
-
if (
|
|
1338
|
-
if (
|
|
1344
|
+
function On(e, t) {
|
|
1345
|
+
if (gn(e) || gn(t) || pn(e) || pn(t)) return 0;
|
|
1346
|
+
if (bn(e) || bn(t)) {
|
|
1339
1347
|
let n = Number(e), r = Number(t);
|
|
1340
1348
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1341
1349
|
}
|
|
1342
|
-
if (
|
|
1350
|
+
if (mn(e) || mn(t)) {
|
|
1343
1351
|
let n = Number(e), r = Number(t);
|
|
1344
1352
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1345
1353
|
}
|
|
1346
|
-
return
|
|
1354
|
+
return jn(String(e), String(t));
|
|
1347
1355
|
}
|
|
1348
|
-
function
|
|
1349
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1356
|
+
function Nn(e, t) {
|
|
1357
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Nn(e, n);
|
|
1350
1358
|
else "string" == typeof t && delete e[t];
|
|
1351
1359
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1352
1360
|
}
|
|
1353
|
-
function
|
|
1361
|
+
function Rn(e, t) {
|
|
1354
1362
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1355
1363
|
}
|
|
1356
|
-
function
|
|
1357
|
-
if (e && !
|
|
1358
|
-
if (!
|
|
1364
|
+
function wn(e, t, n, r) {
|
|
1365
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t) && !pn(t)) return Bt(`${Fe(e)}: kw must be list or dict`), 0;
|
|
1366
|
+
if (!dn(n)) return Bt(`${Fe(e)}: path must be a string: ${String(n)}`), 0;
|
|
1359
1367
|
let o = n.split("`");
|
|
1360
1368
|
if (o.length <= 1) return t[n];
|
|
1361
1369
|
let s = o.length;
|
|
1362
|
-
for (let i = 0; i < s; i++) if (void 0 === (t = t[o[i]])) return void (r &&
|
|
1370
|
+
for (let i = 0; i < s; i++) if (void 0 === (t = t[o[i]])) return void (r && Bt(`${Fe(e)}: path not found: ${String(n)}`));
|
|
1363
1371
|
return t;
|
|
1364
1372
|
}
|
|
1365
|
-
function
|
|
1366
|
-
e && !
|
|
1373
|
+
function Dn(e, t, n) {
|
|
1374
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1367
1375
|
let [r, o] = function(e, t) {
|
|
1368
1376
|
let n = e.lastIndexOf(t);
|
|
1369
1377
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1370
1378
|
}(n, "`");
|
|
1371
|
-
return
|
|
1379
|
+
return yn(o) ? rn(t, n) : rn(wn(e, t, r, !0), o), 0;
|
|
1372
1380
|
}
|
|
1373
|
-
function
|
|
1374
|
-
e && !
|
|
1375
|
-
let s =
|
|
1376
|
-
const i = o && o &
|
|
1381
|
+
function xn(e, t, n, r, o) {
|
|
1382
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1383
|
+
let s = wn(e, t, n, !1);
|
|
1384
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1377
1385
|
if (void 0 === s) {
|
|
1378
1386
|
if (l) {
|
|
1379
1387
|
let o = Boolean(r);
|
|
1380
|
-
return
|
|
1388
|
+
return Ln(e, t, n, o), o;
|
|
1381
1389
|
}
|
|
1382
|
-
return i && (
|
|
1390
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Boolean(r);
|
|
1383
1391
|
}
|
|
1384
|
-
return _ &&
|
|
1392
|
+
return _ && Dn(e, t, n), Boolean(s);
|
|
1385
1393
|
}
|
|
1386
|
-
function
|
|
1387
|
-
e && !
|
|
1388
|
-
let s =
|
|
1389
|
-
const i = o && o &
|
|
1394
|
+
function An(e, t, n, r, o) {
|
|
1395
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1396
|
+
let s = wn(e, t, n, !1);
|
|
1397
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1390
1398
|
if (void 0 === s) {
|
|
1391
1399
|
if (l) {
|
|
1392
1400
|
let o = parseInt(r);
|
|
1393
|
-
return
|
|
1401
|
+
return Ln(e, t, n, o), o;
|
|
1394
1402
|
}
|
|
1395
|
-
return i && (
|
|
1403
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), parseInt(r);
|
|
1396
1404
|
}
|
|
1397
|
-
return _ &&
|
|
1405
|
+
return _ && Dn(e, t, n), bn(s) ? parseInt(s) : (i && (Bt(`path value MUST BE a number: ${n}`), Ht(t)), parseInt(r));
|
|
1398
1406
|
}
|
|
1399
|
-
function
|
|
1400
|
-
e && !
|
|
1401
|
-
let s =
|
|
1402
|
-
const i = o && o &
|
|
1407
|
+
function kn(e, t, n, r, o) {
|
|
1408
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1409
|
+
let s = wn(e, t, n, !1);
|
|
1410
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1403
1411
|
if (void 0 === s) {
|
|
1404
1412
|
if (l) {
|
|
1405
1413
|
let o = String(r);
|
|
1406
|
-
return
|
|
1414
|
+
return Ln(e, t, n, o), o;
|
|
1407
1415
|
}
|
|
1408
|
-
return i && (
|
|
1416
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), String(r);
|
|
1409
1417
|
}
|
|
1410
|
-
return _ &&
|
|
1418
|
+
return _ && Dn(e, t, n), dn(s) ? String(s) : (i && (Bt(`${Fe(e)}: path value MUST BE a string: ${n}`), Ht(t)), String(r));
|
|
1411
1419
|
}
|
|
1412
|
-
function
|
|
1413
|
-
e && !
|
|
1414
|
-
let s =
|
|
1415
|
-
const i = o && o &
|
|
1420
|
+
function In(e, t, n, r, o) {
|
|
1421
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1422
|
+
let s = wn(e, t, n, !1);
|
|
1423
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1416
1424
|
if (void 0 === s) {
|
|
1417
1425
|
if (l) {
|
|
1418
1426
|
let o = r;
|
|
1419
|
-
return
|
|
1427
|
+
return Ln(e, t, n, o), o;
|
|
1420
1428
|
}
|
|
1421
|
-
return i && (
|
|
1429
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), r;
|
|
1422
1430
|
}
|
|
1423
|
-
return _ &&
|
|
1431
|
+
return _ && Dn(e, t, n), s;
|
|
1424
1432
|
}
|
|
1425
|
-
function
|
|
1426
|
-
e && !
|
|
1427
|
-
let s =
|
|
1428
|
-
const i = o && o &
|
|
1433
|
+
function $n(e, t, n, r, o) {
|
|
1434
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1435
|
+
let s = wn(e, t, n, !1);
|
|
1436
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1429
1437
|
if (void 0 === s) {
|
|
1430
1438
|
if (l) {
|
|
1431
1439
|
let o = Object(r);
|
|
1432
|
-
return
|
|
1440
|
+
return Ln(e, t, n, o), o;
|
|
1433
1441
|
}
|
|
1434
|
-
return i && (
|
|
1442
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Object(r);
|
|
1435
1443
|
}
|
|
1436
|
-
return _ &&
|
|
1444
|
+
return _ && Dn(e, t, n), gn(s) ? Object(s) : (i && (Bt(`path value MUST BE a dict: ${n}`), Ht(t)), Object(r));
|
|
1437
1445
|
}
|
|
1438
|
-
function
|
|
1439
|
-
e && !
|
|
1440
|
-
let s =
|
|
1441
|
-
const i = o && o &
|
|
1446
|
+
function Cn(e, t, n, r, o) {
|
|
1447
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1448
|
+
let s = wn(e, t, n, !1);
|
|
1449
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1442
1450
|
if (void 0 === s) {
|
|
1443
1451
|
if (l) {
|
|
1444
1452
|
let o = r;
|
|
1445
|
-
return
|
|
1453
|
+
return Ln(e, t, n, o), o;
|
|
1446
1454
|
}
|
|
1447
|
-
return i && (
|
|
1455
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), r;
|
|
1448
1456
|
}
|
|
1449
|
-
return _ &&
|
|
1457
|
+
return _ && Dn(e, t, n), s;
|
|
1450
1458
|
}
|
|
1451
|
-
function
|
|
1452
|
-
if (e && !
|
|
1459
|
+
function Ln(e, t, n, r) {
|
|
1460
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t)) return Bt("kw is not an object"), -1;
|
|
1453
1461
|
let o = n.split("`");
|
|
1454
1462
|
if (o.length <= 1) return t[n] = r, 0;
|
|
1455
1463
|
let s = o.length;
|
|
@@ -1459,34 +1467,34 @@ function Cn(e, t, n, r) {
|
|
|
1459
1467
|
}
|
|
1460
1468
|
return 0;
|
|
1461
1469
|
}
|
|
1462
|
-
function
|
|
1463
|
-
if (e && !
|
|
1464
|
-
let s =
|
|
1465
|
-
return
|
|
1470
|
+
function Pn(e, t, n, r, o) {
|
|
1471
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t)) return Bt("kw is not an object"), -1;
|
|
1472
|
+
let s = $n(e, t, n, {}, !0);
|
|
1473
|
+
return gn(s) ? (s[r] = o, 0) : (Bt("subdict is not an object"), -1);
|
|
1466
1474
|
}
|
|
1467
|
-
function
|
|
1475
|
+
function Un(e, n, r) {
|
|
1468
1476
|
let o = "", s = !1;
|
|
1469
|
-
if (
|
|
1477
|
+
if (pn(n)) {
|
|
1470
1478
|
s = !1;
|
|
1471
1479
|
for (let i = 0; i < n.length; i++) {
|
|
1472
1480
|
let l = n[i];
|
|
1473
|
-
if (o =
|
|
1481
|
+
if (o = yn(r) ? t("%s", r) : t("%s`%d", r, i), s = Un(e, l, o), s) break;
|
|
1474
1482
|
}
|
|
1475
|
-
} else if (
|
|
1483
|
+
} else if (gn(n)) {
|
|
1476
1484
|
s = !0;
|
|
1477
1485
|
let i = Object.keys(n);
|
|
1478
1486
|
for (let l = 0; l < i.length; l++) {
|
|
1479
1487
|
let _ = i[l], a = n[_];
|
|
1480
|
-
if (o =
|
|
1481
|
-
if (s =
|
|
1488
|
+
if (o = yn(r) ? t("%s", _) : t("%s`%s", r, _), pn(a) || gn(a)) {
|
|
1489
|
+
if (s = Un(e, a, o), !s) break;
|
|
1482
1490
|
continue;
|
|
1483
1491
|
}
|
|
1484
|
-
let u =
|
|
1485
|
-
if (u || (u =
|
|
1492
|
+
let u = Cn(0, e, o, 0, 0);
|
|
1493
|
+
if (u || (u = nn(e, o)), !u) {
|
|
1486
1494
|
s = !1;
|
|
1487
1495
|
break;
|
|
1488
1496
|
}
|
|
1489
|
-
if (0 !==
|
|
1497
|
+
if (0 !== On(u, a)) {
|
|
1490
1498
|
s = !1;
|
|
1491
1499
|
break;
|
|
1492
1500
|
}
|
|
@@ -1494,58 +1502,58 @@ function Pn(e, n, r) {
|
|
|
1494
1502
|
}
|
|
1495
1503
|
return s;
|
|
1496
1504
|
}
|
|
1497
|
-
function
|
|
1498
|
-
return 0 ===
|
|
1505
|
+
function Fn(e, t) {
|
|
1506
|
+
return 0 === fn(t) || Un(e, t, "");
|
|
1499
1507
|
}
|
|
1500
|
-
function
|
|
1501
|
-
e && !
|
|
1508
|
+
function Gn(e, t, n, r) {
|
|
1509
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1502
1510
|
let o = {};
|
|
1503
|
-
if (
|
|
1511
|
+
if (dn(n) && !yn(n)) {
|
|
1504
1512
|
let s = n;
|
|
1505
|
-
t.hasOwnProperty(s) ? o[s] = t[s] : r &&
|
|
1506
|
-
} else if (
|
|
1513
|
+
t.hasOwnProperty(s) ? o[s] = t[s] : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1514
|
+
} else if (gn(n) && un(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1507
1515
|
else {
|
|
1508
|
-
if (!(
|
|
1516
|
+
if (!(pn(n) && cn(n) > 0)) return t;
|
|
1509
1517
|
for (let s = 0; s < n.length; s++) {
|
|
1510
1518
|
let i = n[s];
|
|
1511
|
-
t.hasOwnProperty(i) ? o[i] = t[i] : r &&
|
|
1519
|
+
t.hasOwnProperty(i) ? o[i] = t[i] : r && Bt(`${Fe(e)}: key not found: ${i}`);
|
|
1512
1520
|
}
|
|
1513
1521
|
}
|
|
1514
1522
|
return o;
|
|
1515
1523
|
}
|
|
1516
|
-
function
|
|
1524
|
+
function Vn(e, t, n, r) {
|
|
1517
1525
|
let o = {};
|
|
1518
|
-
if (
|
|
1526
|
+
if (Zt(o, t), dn(n) && !yn(n)) {
|
|
1519
1527
|
let s = n;
|
|
1520
|
-
|
|
1521
|
-
} else if (
|
|
1528
|
+
Cn(e, t, s, 0, 0) ? rn(o, s) : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1529
|
+
} else if (gn(n) && un(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? rn(o, s) : r && Bt(`${Fe(e)}: key not found: ${s}`);
|
|
1522
1530
|
else {
|
|
1523
|
-
if (!(
|
|
1531
|
+
if (!(pn(n) && cn(n) > 0)) return {};
|
|
1524
1532
|
for (let s = 0; s < n.length; s++) {
|
|
1525
1533
|
let i = n[s];
|
|
1526
|
-
t.hasOwnProperty(i) ?
|
|
1534
|
+
t.hasOwnProperty(i) ? rn(o, i) : r && Bt(`${Fe(e)}: key not found: ${i}`);
|
|
1527
1535
|
}
|
|
1528
1536
|
}
|
|
1529
1537
|
return o;
|
|
1530
1538
|
}
|
|
1531
|
-
function
|
|
1539
|
+
function Mn(e, t, n = !1) {
|
|
1532
1540
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1533
1541
|
let r = window.localStorage.getItem(e);
|
|
1534
|
-
return null === r ? (n &&
|
|
1542
|
+
return null === r ? (n && Wn(e, t), t) : JSON.parse(r);
|
|
1535
1543
|
} catch (n) {
|
|
1536
1544
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1537
1545
|
}
|
|
1538
1546
|
}
|
|
1539
|
-
function
|
|
1547
|
+
function Wn(e, t) {
|
|
1540
1548
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1541
|
-
if (!e || void 0 === t) return
|
|
1549
|
+
if (!e || void 0 === t) return Bt(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1542
1550
|
try {
|
|
1543
1551
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1544
1552
|
} catch (t) {
|
|
1545
|
-
return
|
|
1553
|
+
return Bt(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1546
1554
|
}
|
|
1547
1555
|
}
|
|
1548
|
-
function
|
|
1556
|
+
function Kn(e) {
|
|
1549
1557
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1550
1558
|
window.localStorage.removeItem(e);
|
|
1551
1559
|
} catch (t) {
|
|
@@ -1553,46 +1561,46 @@ function Wn(e) {
|
|
|
1553
1561
|
}
|
|
1554
1562
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1555
1563
|
}
|
|
1556
|
-
function
|
|
1557
|
-
if (
|
|
1558
|
-
if (
|
|
1564
|
+
function Yn(e, t) {
|
|
1565
|
+
if (En(e) || En(t)) return !0;
|
|
1566
|
+
if (pn(e)) {
|
|
1559
1567
|
if (0 === e.length) return !0;
|
|
1560
1568
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1561
|
-
} else if (
|
|
1569
|
+
} else if (gn(e)) {
|
|
1562
1570
|
if (0 === Object.keys(e).length) return !0;
|
|
1563
1571
|
for (let n in e) if (n === t) return !0;
|
|
1564
|
-
} else if (
|
|
1572
|
+
} else if (dn(e) && e === t) return !0;
|
|
1565
1573
|
return !1;
|
|
1566
1574
|
}
|
|
1567
|
-
function
|
|
1568
|
-
if (e && !
|
|
1569
|
-
o || (o =
|
|
1575
|
+
function Bn(e, t, n, r, o) {
|
|
1576
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
1577
|
+
o || (o = Fn);
|
|
1570
1578
|
let s = [];
|
|
1571
|
-
if (
|
|
1579
|
+
if (pn(t)) for (let i = 0; i < t.length; i++) {
|
|
1572
1580
|
let l, _ = t[i];
|
|
1573
|
-
if (
|
|
1581
|
+
if (gn(_)) l = kn(e, _, "id", "", 0);
|
|
1574
1582
|
else {
|
|
1575
|
-
if (!
|
|
1583
|
+
if (!dn(_)) continue;
|
|
1576
1584
|
l = _;
|
|
1577
1585
|
}
|
|
1578
|
-
|
|
1586
|
+
Yn(n, l) && o(_, r) && s.push(_);
|
|
1579
1587
|
}
|
|
1580
1588
|
else {
|
|
1581
|
-
if (!
|
|
1589
|
+
if (!gn(t)) return Bt("kw_collect() BAD kw parameter"), null;
|
|
1582
1590
|
for (let e of Object.keys(t)) {
|
|
1583
1591
|
let i = t[e];
|
|
1584
|
-
|
|
1592
|
+
Yn(n, e) && o(i, r) && s.push(i);
|
|
1585
1593
|
}
|
|
1586
1594
|
}
|
|
1587
1595
|
return s;
|
|
1588
1596
|
}
|
|
1589
|
-
function
|
|
1597
|
+
function Jn(e, t) {
|
|
1590
1598
|
if (!e) return -1;
|
|
1591
1599
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1592
1600
|
return -1;
|
|
1593
1601
|
}
|
|
1594
|
-
function
|
|
1595
|
-
if (!e || !t) return
|
|
1602
|
+
function qn(e, t, n) {
|
|
1603
|
+
if (!e || !t) return Bt("ERROR: str_in_list() list or str empty"), !1;
|
|
1596
1604
|
let r = e.length;
|
|
1597
1605
|
if (n) {
|
|
1598
1606
|
t = t.toLowerCase();
|
|
@@ -1603,7 +1611,7 @@ function Jn(e, t, n) {
|
|
|
1603
1611
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1604
1612
|
return !1;
|
|
1605
1613
|
}
|
|
1606
|
-
function
|
|
1614
|
+
function Hn(e, t) {
|
|
1607
1615
|
try {
|
|
1608
1616
|
let n = e.__md_iev__;
|
|
1609
1617
|
if (n) return n[t];
|
|
@@ -1611,35 +1619,35 @@ function qn(e, t) {
|
|
|
1611
1619
|
return;
|
|
1612
1620
|
}
|
|
1613
1621
|
}
|
|
1614
|
-
function
|
|
1622
|
+
function zn(e, t, n) {
|
|
1615
1623
|
let r = e.__md_iev__;
|
|
1616
1624
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1617
1625
|
}
|
|
1618
|
-
function
|
|
1619
|
-
if (!
|
|
1626
|
+
function Qn(e, t, n, r) {
|
|
1627
|
+
if (!hn(e)) return Bt("gobj is not a GObj"), null;
|
|
1620
1628
|
if (!t) return;
|
|
1621
|
-
let o =
|
|
1622
|
-
o || (o = [],
|
|
1629
|
+
let o = Hn(t, n);
|
|
1630
|
+
o || (o = [], zn(t, n, o));
|
|
1623
1631
|
try {
|
|
1624
|
-
|
|
1632
|
+
pn(o) && o.unshift(r);
|
|
1625
1633
|
} catch (e) {
|
|
1626
|
-
|
|
1634
|
+
Bt(e);
|
|
1627
1635
|
}
|
|
1628
1636
|
}
|
|
1629
|
-
function
|
|
1630
|
-
if (!
|
|
1631
|
-
if (!
|
|
1632
|
-
let o =
|
|
1633
|
-
return o ? 0 === o.length ? (r &&
|
|
1637
|
+
function Xn(e, t, n, r) {
|
|
1638
|
+
if (!hn(e)) return Bt("gobj is not a GObj"), null;
|
|
1639
|
+
if (!gn(t)) return Bt("kw is not a dict"), null;
|
|
1640
|
+
let o = Hn(t, n);
|
|
1641
|
+
return o ? 0 === o.length ? (r && Bt(`stack empty: ${n}`), null) : o[0] : (r && Bt(`stack NOT FOUND: ${n}`), null);
|
|
1634
1642
|
}
|
|
1635
|
-
function
|
|
1636
|
-
return
|
|
1643
|
+
function Zn(e, t, n) {
|
|
1644
|
+
return yn(n) ? Dn(e, t, "__md_iev__`__msg_type__") : Pn(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1637
1645
|
}
|
|
1638
|
-
function
|
|
1639
|
-
return
|
|
1646
|
+
function er(e, t) {
|
|
1647
|
+
return kn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1640
1648
|
}
|
|
1641
|
-
function
|
|
1642
|
-
void 0 !== n &&
|
|
1649
|
+
function tr(e, t, n) {
|
|
1650
|
+
void 0 !== n && dn(n) || (n = "");
|
|
1643
1651
|
for (let r of Object.keys(e)) {
|
|
1644
1652
|
if (!e.hasOwnProperty(r)) continue;
|
|
1645
1653
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -1648,10 +1656,10 @@ function er(e, t, n) {
|
|
|
1648
1656
|
r,
|
|
1649
1657
|
e[r],
|
|
1650
1658
|
n
|
|
1651
|
-
]),
|
|
1659
|
+
]), gn(e[r]) && tr(e[r], t, n), n = n.slice(0, -o.length);
|
|
1652
1660
|
}
|
|
1653
1661
|
}
|
|
1654
|
-
function
|
|
1662
|
+
function nr(e, t, n, r) {
|
|
1655
1663
|
if (!e) return null;
|
|
1656
1664
|
let o, s = e.length;
|
|
1657
1665
|
for (o = 0; o < s; o++) {
|
|
@@ -1659,15 +1667,15 @@ function tr(e, t, n, r) {
|
|
|
1659
1667
|
if (s) {
|
|
1660
1668
|
let e = s.id;
|
|
1661
1669
|
if (e && e === n) return s;
|
|
1662
|
-
if (r &&
|
|
1663
|
-
let e =
|
|
1670
|
+
if (r && Rn(s, t)) {
|
|
1671
|
+
let e = nr(s[t], t, n, r);
|
|
1664
1672
|
if (e) return e;
|
|
1665
1673
|
}
|
|
1666
1674
|
}
|
|
1667
1675
|
}
|
|
1668
1676
|
return null;
|
|
1669
1677
|
}
|
|
1670
|
-
function
|
|
1678
|
+
function rr(e) {
|
|
1671
1679
|
function t(e) {
|
|
1672
1680
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1673
1681
|
switch (t.length % 4) {
|
|
@@ -1698,38 +1706,38 @@ function nr(e) {
|
|
|
1698
1706
|
signature: t(n[2])
|
|
1699
1707
|
};
|
|
1700
1708
|
}
|
|
1701
|
-
function
|
|
1709
|
+
function or(e) {
|
|
1702
1710
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1703
1711
|
}
|
|
1704
|
-
function
|
|
1712
|
+
function sr(e) {
|
|
1705
1713
|
const t = document.createElement("template");
|
|
1706
1714
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1707
1715
|
}
|
|
1708
|
-
function
|
|
1716
|
+
function ir() {
|
|
1709
1717
|
const e = /* @__PURE__ */ new Date(), t = e.toISOString().slice(0, 19), n = String(e.getMilliseconds()).padStart(3, "0"), r = e.getTimezoneOffset();
|
|
1710
1718
|
return `${t}.${n}${r > 0 ? "-" : "+"}${String(Math.abs(r) / 60).padStart(2, "0")}${String(Math.abs(r) % 60).padStart(2, "0")}`;
|
|
1711
1719
|
}
|
|
1712
|
-
function
|
|
1720
|
+
function lr(e, t) {
|
|
1713
1721
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
1714
1722
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
1715
1723
|
return -1;
|
|
1716
1724
|
}
|
|
1717
|
-
function
|
|
1725
|
+
function _r() {
|
|
1718
1726
|
let e = "";
|
|
1719
1727
|
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;
|
|
1720
1728
|
}
|
|
1721
|
-
function
|
|
1729
|
+
function ar(e) {
|
|
1722
1730
|
let t = null;
|
|
1723
1731
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1724
1732
|
}
|
|
1725
|
-
function
|
|
1733
|
+
function ur(e) {
|
|
1726
1734
|
return "persistent-attrs-" + Fe(e);
|
|
1727
1735
|
}
|
|
1728
|
-
function
|
|
1729
|
-
if (
|
|
1736
|
+
function cr(e, t) {
|
|
1737
|
+
if (dn(t)) {
|
|
1730
1738
|
if (-1 === t.indexOf("^")) {
|
|
1731
1739
|
let n, r, o = e.fkey;
|
|
1732
|
-
if (1 !==
|
|
1740
|
+
if (1 !== un(o)) return Bt("bad fkey 1"), Bt(e), Bt(t), null;
|
|
1733
1741
|
for (const e of Object.keys(o)) {
|
|
1734
1742
|
n = e, r = o[e];
|
|
1735
1743
|
break;
|
|
@@ -1742,20 +1750,20 @@ function ur(e, t) {
|
|
|
1742
1750
|
}
|
|
1743
1751
|
{
|
|
1744
1752
|
let n = t.split("^");
|
|
1745
|
-
return 3 !== n.length ? (
|
|
1753
|
+
return 3 !== n.length ? (Bt("bad fkey 2"), Bt(e), Bt(t), null) : {
|
|
1746
1754
|
topic_name: n[0],
|
|
1747
1755
|
id: n[1],
|
|
1748
1756
|
hook_name: n[2]
|
|
1749
1757
|
};
|
|
1750
1758
|
}
|
|
1751
1759
|
}
|
|
1752
|
-
return
|
|
1760
|
+
return gn(t) ? {
|
|
1753
1761
|
topic_name: t.topic_name,
|
|
1754
1762
|
id: t.id,
|
|
1755
1763
|
hook_name: t.hook_name
|
|
1756
|
-
} : (
|
|
1764
|
+
} : (Bt("bad fkey 3"), Bt(e), Bt(t), null);
|
|
1757
1765
|
}
|
|
1758
|
-
var
|
|
1766
|
+
var fr = [
|
|
1759
1767
|
"string",
|
|
1760
1768
|
"integer",
|
|
1761
1769
|
"object",
|
|
@@ -1765,7 +1773,7 @@ var cr = [
|
|
|
1765
1773
|
"real",
|
|
1766
1774
|
"boolean",
|
|
1767
1775
|
"blob"
|
|
1768
|
-
],
|
|
1776
|
+
], gr = [
|
|
1769
1777
|
"persistent",
|
|
1770
1778
|
"required",
|
|
1771
1779
|
"notnull",
|
|
@@ -1777,7 +1785,7 @@ var cr = [
|
|
|
1777
1785
|
"stats",
|
|
1778
1786
|
"rstats",
|
|
1779
1787
|
"pstats"
|
|
1780
|
-
],
|
|
1788
|
+
], pr = [
|
|
1781
1789
|
"hook",
|
|
1782
1790
|
"fkey",
|
|
1783
1791
|
"enum",
|
|
@@ -1804,7 +1812,7 @@ var cr = [
|
|
|
1804
1812
|
"coordinates",
|
|
1805
1813
|
"gbuffer"
|
|
1806
1814
|
];
|
|
1807
|
-
function
|
|
1815
|
+
function dr(e) {
|
|
1808
1816
|
let t = {
|
|
1809
1817
|
name: e.id,
|
|
1810
1818
|
header: e.header,
|
|
@@ -1822,7 +1830,7 @@ function pr(e) {
|
|
|
1822
1830
|
if (!e.flag) return t;
|
|
1823
1831
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1824
1832
|
let r = e.flag[n];
|
|
1825
|
-
if (
|
|
1833
|
+
if (qn(pr, r)) {
|
|
1826
1834
|
switch (r) {
|
|
1827
1835
|
case "enum":
|
|
1828
1836
|
t.enum_list = e.enum;
|
|
@@ -1833,7 +1841,7 @@ function pr(e) {
|
|
|
1833
1841
|
case "table": t.enum_list = e.table;
|
|
1834
1842
|
}
|
|
1835
1843
|
t.type = r;
|
|
1836
|
-
} else if (
|
|
1844
|
+
} else if (qn(gr, r)) switch (r) {
|
|
1837
1845
|
case "writable":
|
|
1838
1846
|
t.is_writable = !0;
|
|
1839
1847
|
break;
|
|
@@ -1846,36 +1854,36 @@ function pr(e) {
|
|
|
1846
1854
|
}
|
|
1847
1855
|
return t;
|
|
1848
1856
|
}
|
|
1849
|
-
var
|
|
1857
|
+
var br = [
|
|
1850
1858
|
v(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1851
1859
|
v(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1852
1860
|
v(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1853
1861
|
y()
|
|
1854
|
-
],
|
|
1862
|
+
], mr = {
|
|
1855
1863
|
periodic: !1,
|
|
1856
1864
|
msec: 0,
|
|
1857
1865
|
timer_id: -1
|
|
1858
|
-
},
|
|
1859
|
-
function
|
|
1866
|
+
}, Er = null;
|
|
1867
|
+
function Tr(e, t, n, r) {
|
|
1860
1868
|
let o = e.priv, s = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1861
1869
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1862
|
-
|
|
1863
|
-
}, o.msec) : o.timer_id = -1, We(e) ?
|
|
1870
|
+
vt(e, "EV_TIMEOUT", {}, e);
|
|
1871
|
+
}, o.msec) : o.timer_id = -1, We(e) ? vt(Ve(e), s, {}, e) : It(e, s, {}), o.periodic || -1 !== o.timer_id || De(e) && Se(e), 0;
|
|
1864
1872
|
}
|
|
1865
|
-
var
|
|
1873
|
+
var hr = {
|
|
1866
1874
|
mt_create: function(e) {
|
|
1867
1875
|
let t = e.priv;
|
|
1868
|
-
const n =
|
|
1869
|
-
n &&
|
|
1876
|
+
const n = at(e, "subscriber");
|
|
1877
|
+
n && Dt(e, null, {}, n), t.periodic = it(e, "periodic"), t.msec = lt(e, "msec");
|
|
1870
1878
|
},
|
|
1871
1879
|
mt_writing: function(e, t) {
|
|
1872
1880
|
let n = e.priv;
|
|
1873
1881
|
switch (t) {
|
|
1874
1882
|
case "periodic":
|
|
1875
|
-
n.periodic =
|
|
1883
|
+
n.periodic = it(e, "periodic");
|
|
1876
1884
|
break;
|
|
1877
|
-
case "msec": n.msec =
|
|
1878
|
-
|
|
1885
|
+
case "msec": n.msec = lt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1886
|
+
vt(e, "EV_TIMEOUT", {}, e);
|
|
1879
1887
|
}, n.msec)), n.msec > 0 ? De(e) || ye(e) : De(e) && Se(e);
|
|
1880
1888
|
}
|
|
1881
1889
|
},
|
|
@@ -1883,20 +1891,20 @@ var Tr = {
|
|
|
1883
1891
|
return 0;
|
|
1884
1892
|
},
|
|
1885
1893
|
mt_stop: function(e) {
|
|
1886
|
-
return
|
|
1894
|
+
return ft(e, "msec", -1), 0;
|
|
1887
1895
|
},
|
|
1888
1896
|
mt_destroy: function(e) {}
|
|
1889
1897
|
};
|
|
1890
|
-
function hr(e, t) {
|
|
1891
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Yt("not C_TIMER GObj"), -1) : (ut(e, "periodic", !1), void ct(e, "msec", t)) : (Yt("not GObj TYPE"), -1);
|
|
1892
|
-
}
|
|
1893
1898
|
function yr(e, t) {
|
|
1894
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1899
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Bt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !1), void ft(e, "msec", t)) : (Bt("not GObj TYPE"), -1);
|
|
1895
1900
|
}
|
|
1896
|
-
function vr(e) {
|
|
1897
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1901
|
+
function vr(e, t) {
|
|
1902
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Bt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !0), void ft(e, "msec", t)) : (Bt("not GObj TYPE"), -1);
|
|
1898
1903
|
}
|
|
1899
|
-
|
|
1904
|
+
function jr(e) {
|
|
1905
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Bt("not C_TIMER GObj"), -1) : void ft(e, "msec", -1) : (Bt("not GObj TYPE"), -1);
|
|
1906
|
+
}
|
|
1907
|
+
var Sr = [
|
|
1900
1908
|
v(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
1901
1909
|
v(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
1902
1910
|
v(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -1922,21 +1930,21 @@ var jr = [
|
|
|
1922
1930
|
v(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1923
1931
|
v(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1924
1932
|
y()
|
|
1925
|
-
],
|
|
1926
|
-
function
|
|
1927
|
-
return
|
|
1933
|
+
], Or = { gobj_timer: null }, Nr = null;
|
|
1934
|
+
function Rr(e, t, n, r) {
|
|
1935
|
+
return It(e, t, n), 0;
|
|
1928
1936
|
}
|
|
1929
|
-
var
|
|
1937
|
+
var wr = {
|
|
1930
1938
|
mt_create: function(e) {
|
|
1931
1939
|
let t = e.priv;
|
|
1932
|
-
|
|
1940
|
+
gt(e, "start_date", ir()), gt(e, "node_uuid", _r()), e.priv.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.periodic_timeout = ot(e, "periodic_timeout");
|
|
1933
1941
|
},
|
|
1934
1942
|
mt_writing: function(e, t) {},
|
|
1935
1943
|
mt_start: function(e) {
|
|
1936
|
-
return
|
|
1944
|
+
return vr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
1937
1945
|
},
|
|
1938
1946
|
mt_stop: function(e) {
|
|
1939
|
-
return
|
|
1947
|
+
return jr(e.priv.gobj_timer), Ne(e), 0;
|
|
1940
1948
|
},
|
|
1941
1949
|
mt_destroy: function(e) {},
|
|
1942
1950
|
mt_play: function(e) {
|
|
@@ -1947,7 +1955,7 @@ var Rr = {
|
|
|
1947
1955
|
return we(ce()), 0;
|
|
1948
1956
|
}
|
|
1949
1957
|
};
|
|
1950
|
-
var
|
|
1958
|
+
var Dr = "ievent_gate_stack", xr = [
|
|
1951
1959
|
v(E.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
1952
1960
|
v(E.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
1953
1961
|
v(E.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
@@ -1964,7 +1972,7 @@ var wr = "ievent_gate_stack", Dr = [
|
|
|
1964
1972
|
v(E.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
1965
1973
|
v(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
1966
1974
|
y()
|
|
1967
|
-
],
|
|
1975
|
+
], Ar = {
|
|
1968
1976
|
url: null,
|
|
1969
1977
|
remote_yuno_name: null,
|
|
1970
1978
|
remote_yuno_role: null,
|
|
@@ -1974,87 +1982,87 @@ var wr = "ievent_gate_stack", Dr = [
|
|
|
1974
1982
|
websocket: null,
|
|
1975
1983
|
inside_on_open: !1,
|
|
1976
1984
|
retry_ms: 0
|
|
1977
|
-
},
|
|
1978
|
-
function
|
|
1979
|
-
e.priv.websocket &&
|
|
1980
|
-
const t =
|
|
1985
|
+
}, kr = null;
|
|
1986
|
+
function Ir(e) {
|
|
1987
|
+
e.priv.websocket && Bt("Websocket ALREADY setup");
|
|
1988
|
+
const t = _t(e, "url");
|
|
1981
1989
|
let n;
|
|
1982
|
-
|
|
1990
|
+
qt(`====> Starting WebSocket to '${t}' (${Fe(e)})`);
|
|
1983
1991
|
try {
|
|
1984
1992
|
n = new WebSocket(t);
|
|
1985
1993
|
} catch (n) {
|
|
1986
|
-
return
|
|
1994
|
+
return Bt(`${Fe(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
1987
1995
|
}
|
|
1988
1996
|
return n ? (n.onopen = () => {
|
|
1989
|
-
|
|
1997
|
+
vt(e, "EV_ON_OPEN", { url: t }, e);
|
|
1990
1998
|
}, n.onmessage = (n) => {
|
|
1991
|
-
|
|
1999
|
+
vt(e, "EV_ON_MESSAGE", {
|
|
1992
2000
|
url: t,
|
|
1993
2001
|
data: n.data
|
|
1994
2002
|
}, e);
|
|
1995
2003
|
}, n.onclose = (n) => {
|
|
1996
|
-
Ke(e) || (
|
|
2004
|
+
Ke(e) || (it(Ie(), "browser_beforeunload") ? Jt("Close websocket by unload page") : vt(e, "EV_ON_CLOSE", {
|
|
1997
2005
|
url: t,
|
|
1998
2006
|
e: n
|
|
1999
2007
|
}, e));
|
|
2000
|
-
}, n) : (
|
|
2008
|
+
}, n) : (Bt(`${Fe(e)}: Failed to initialize WebSocket.`), null);
|
|
2001
2009
|
}
|
|
2002
|
-
function
|
|
2010
|
+
function $r(e, t = 1e3, n = "") {
|
|
2003
2011
|
let r = e.priv, o = r.websocket;
|
|
2004
2012
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
2005
|
-
|
|
2013
|
+
qt(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2006
2014
|
try {
|
|
2007
2015
|
o.close(t, n);
|
|
2008
2016
|
} catch (e) {
|
|
2009
|
-
|
|
2017
|
+
Bt("Error closing WebSocket:", e.message);
|
|
2010
2018
|
}
|
|
2011
|
-
} else
|
|
2019
|
+
} else Jt("WebSocket is already closed or in the process of closing.");
|
|
2012
2020
|
}
|
|
2013
|
-
function
|
|
2014
|
-
let r =
|
|
2021
|
+
function Cr(e, t, n) {
|
|
2022
|
+
let r = ir();
|
|
2015
2023
|
try {
|
|
2016
|
-
|
|
2024
|
+
qt("\n" + r + " " + t + "\n"), zt(n);
|
|
2017
2025
|
} catch (e) {
|
|
2018
|
-
|
|
2026
|
+
qt("ERROR in trace_inter_event: " + e);
|
|
2019
2027
|
}
|
|
2020
2028
|
}
|
|
2021
|
-
var
|
|
2029
|
+
var Lr = class {
|
|
2022
2030
|
constructor(e, t) {
|
|
2023
2031
|
this.event = e, this.kw = t || {};
|
|
2024
2032
|
}
|
|
2025
2033
|
};
|
|
2026
|
-
function
|
|
2034
|
+
function Pr(e, t, n, r) {
|
|
2027
2035
|
return function(e, t) {
|
|
2028
2036
|
let n = e.priv, r = JSON.stringify(t);
|
|
2029
|
-
if (
|
|
2030
|
-
let n =
|
|
2031
|
-
s ? s(o, t, 1, r.length) :
|
|
2037
|
+
if (it(Ie(), "trace_inter_event")) {
|
|
2038
|
+
let n = _t(e, "url"), o = Pe(Ie()) + " ==> " + n, s = ot(Ie(), "trace_ievent_callback");
|
|
2039
|
+
s ? s(o, t, 1, r.length) : Cr(0, o, t);
|
|
2032
2040
|
}
|
|
2033
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2041
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Jt(`${Fe(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2034
2042
|
try {
|
|
2035
2043
|
n.websocket.send(r);
|
|
2036
2044
|
} catch (t) {
|
|
2037
|
-
|
|
2045
|
+
Bt(`${Fe(e)}: send_iev(): ${t}`);
|
|
2038
2046
|
}
|
|
2039
2047
|
return 0;
|
|
2040
2048
|
}(e, function(e, t) {
|
|
2041
|
-
return
|
|
2049
|
+
return yn(e) ? (Bt("iev_create() event NULL"), null) : new Lr(e, t);
|
|
2042
2050
|
}(t, n));
|
|
2043
2051
|
}
|
|
2044
|
-
function
|
|
2045
|
-
return
|
|
2046
|
-
dst_yuno:
|
|
2047
|
-
dst_role:
|
|
2052
|
+
function Ur(e, t, n) {
|
|
2053
|
+
return yn(n) && (n = _t(e, "wanted_yuno_service")), {
|
|
2054
|
+
dst_yuno: _t(e, "wanted_yuno_name"),
|
|
2055
|
+
dst_role: _t(e, "wanted_yuno_role"),
|
|
2048
2056
|
dst_service: n,
|
|
2049
2057
|
src_yuno: $e(),
|
|
2050
2058
|
src_role: Ce(),
|
|
2051
2059
|
src_service: t,
|
|
2052
|
-
host:
|
|
2060
|
+
host: _r()
|
|
2053
2061
|
};
|
|
2054
2062
|
}
|
|
2055
|
-
function
|
|
2056
|
-
let t = e.priv, n = ke(Ie()), r =
|
|
2057
|
-
l && l.length || (l =
|
|
2063
|
+
function Fr(e) {
|
|
2064
|
+
let t = e.priv, n = ke(Ie()), r = _t(Ie(), "yuno_version"), o = _t(Ie(), "yuno_release"), i = _t(Ie(), "yuno_tag"), l = ot(e, "required_services");
|
|
2065
|
+
l && l.length || (l = ot(Ie(), "required_services"));
|
|
2058
2066
|
let _ = {
|
|
2059
2067
|
yuno_role: Ce(),
|
|
2060
2068
|
yuno_id: Le(),
|
|
@@ -2066,38 +2074,38 @@ function Ur(e) {
|
|
|
2066
2074
|
playing: n,
|
|
2067
2075
|
pid: 0,
|
|
2068
2076
|
watcher_pid: 0,
|
|
2069
|
-
jwt:
|
|
2070
|
-
username:
|
|
2077
|
+
jwt: _t(e, "jwt"),
|
|
2078
|
+
username: _t(Ie(), "__username__"),
|
|
2071
2079
|
launch_id: 0,
|
|
2072
|
-
yuno_startdate:
|
|
2073
|
-
id:
|
|
2080
|
+
yuno_startdate: _t(Ie(), "start_date"),
|
|
2081
|
+
id: _r(),
|
|
2074
2082
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2075
2083
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2076
2084
|
required_services: l
|
|
2077
2085
|
};
|
|
2078
|
-
return
|
|
2086
|
+
return Qn(e, _, Dr, Ur(e, Pe(Ve(e)), null)), Zn(e, _, "__identity__"), yr(t.gobj_timer, lt(e, "timeout_idack")), Pr(e, "EV_IDENTITY_CARD", _);
|
|
2079
2087
|
}
|
|
2080
|
-
function
|
|
2081
|
-
if (
|
|
2088
|
+
function Gr(e, t) {
|
|
2089
|
+
if (yn(t.event)) return -1;
|
|
2082
2090
|
let n = {}, r = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, l = t.subscriber;
|
|
2083
2091
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2084
|
-
return
|
|
2085
|
-
}
|
|
2086
|
-
function Gr(e, t, n, r) {
|
|
2087
|
-
let o = e.priv;
|
|
2088
|
-
return De(e) && (o.websocket = kr(e)), 0;
|
|
2092
|
+
return Qn(e, n, Dr, Ur(e, Pe(l), i)), Zn(e, n, "__subscribing__"), Pr(e, t.event, n);
|
|
2089
2093
|
}
|
|
2090
2094
|
function Vr(e, t, n, r) {
|
|
2091
|
-
|
|
2095
|
+
let o = e.priv;
|
|
2096
|
+
return De(e) && (o.websocket = Ir(e)), 0;
|
|
2092
2097
|
}
|
|
2093
2098
|
function Mr(e, t, n, r) {
|
|
2099
|
+
return qt("Websocket opened: " + e.priv.url), Fr(e), 0;
|
|
2100
|
+
}
|
|
2101
|
+
function Wr(e, t, n, r) {
|
|
2094
2102
|
let o = e.priv, s = n.e, i = n.url;
|
|
2095
|
-
return
|
|
2103
|
+
return Kt(), Jt(`${Fe(e)}: WebSocket closed ${i} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), 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, It(e, "EV_ON_CLOSE", {
|
|
2096
2104
|
url: i,
|
|
2097
2105
|
remote_yuno_name: o.remote_yuno_name,
|
|
2098
2106
|
remote_yuno_role: o.remote_yuno_role,
|
|
2099
2107
|
remote_yuno_service: o.remote_yuno_service
|
|
2100
|
-
})) : (
|
|
2108
|
+
})) : (Jt(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${i} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), It(e, "EV_ON_OPEN_ERROR", {
|
|
2101
2109
|
url: i,
|
|
2102
2110
|
remote_yuno_name: o.remote_yuno_name,
|
|
2103
2111
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -2105,27 +2113,27 @@ function Mr(e, t, n, r) {
|
|
|
2105
2113
|
code: s.code,
|
|
2106
2114
|
reason: s.reason,
|
|
2107
2115
|
was_clean: s.wasClean
|
|
2108
|
-
})), De(e) &&
|
|
2109
|
-
let t = e.priv, n =
|
|
2116
|
+
})), De(e) && yr(o.gobj_timer, function(e) {
|
|
2117
|
+
let t = e.priv, n = lt(e, "timeout_retry"), r = lt(e, "timeout_retry_max");
|
|
2110
2118
|
r < n && (r = n);
|
|
2111
2119
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2112
2120
|
let o = .2 * t.retry_ms, s = t.retry_ms - o + 2 * Math.random() * o;
|
|
2113
2121
|
return Math.max(1, Math.round(s));
|
|
2114
2122
|
}(e)), 0;
|
|
2115
2123
|
}
|
|
2116
|
-
function Wr(e, t, n, r) {
|
|
2117
|
-
return Ur(e), 0;
|
|
2118
|
-
}
|
|
2119
2124
|
function Kr(e, t, n, r) {
|
|
2125
|
+
return Fr(e), 0;
|
|
2126
|
+
}
|
|
2127
|
+
function Yr(e, t, n, r) {
|
|
2120
2128
|
let o = e.priv;
|
|
2121
|
-
|
|
2122
|
-
let s =
|
|
2123
|
-
|
|
2124
|
-
let a =
|
|
2129
|
+
jr(o.gobj_timer);
|
|
2130
|
+
let s = Xn(e, n, Dr, !0), i = kn(e, s, "src_yuno", ""), l = kn(e, s, "src_role", ""), _ = kn(e, s, "src_service", "");
|
|
2131
|
+
gt(e, "remote_yuno_name", i), gt(e, "remote_yuno_role", l), gt(e, "remote_yuno_service", _);
|
|
2132
|
+
let a = An(e, n, "result", -1, 0), u = kn(e, n, "comment", "", 0), c = kn(e, n, "username", "", 0), f = Cn(e, n, "services_roles", {});
|
|
2125
2133
|
if (a < 0) {
|
|
2126
|
-
|
|
2134
|
+
$r(e);
|
|
2127
2135
|
let t = {
|
|
2128
|
-
url:
|
|
2136
|
+
url: _t(e, "url"),
|
|
2129
2137
|
result: a,
|
|
2130
2138
|
comment: u,
|
|
2131
2139
|
username: c,
|
|
@@ -2133,9 +2141,9 @@ function Kr(e, t, n, r) {
|
|
|
2133
2141
|
remote_yuno_role: l,
|
|
2134
2142
|
remote_yuno_service: _
|
|
2135
2143
|
};
|
|
2136
|
-
We(e) ?
|
|
2144
|
+
We(e) ? vt(Ve(e), "EV_ON_ID_NAK", t, e) : It(e, "EV_ON_ID_NAK", t);
|
|
2137
2145
|
} else {
|
|
2138
|
-
if (
|
|
2146
|
+
if (pt(e, "ST_SESSION"), o.inside_on_open = !0, o.retry_ms = 0, !o.inform_on_close) {
|
|
2139
2147
|
o.inform_on_close = !0;
|
|
2140
2148
|
let t = {
|
|
2141
2149
|
username: c,
|
|
@@ -2144,134 +2152,134 @@ function Kr(e, t, n, r) {
|
|
|
2144
2152
|
remote_yuno_service: _,
|
|
2145
2153
|
services_roles: f
|
|
2146
2154
|
};
|
|
2147
|
-
We(e) ?
|
|
2155
|
+
We(e) ? vt(Ve(e), "EV_ON_OPEN", t, e) : It(e, "EV_ON_OPEN", t);
|
|
2148
2156
|
}
|
|
2149
2157
|
o.inside_on_open = !1, function(e) {
|
|
2150
|
-
let t =
|
|
2151
|
-
for (let n = 0; n < t.length; n++)
|
|
2158
|
+
let t = At(e, null, null, null);
|
|
2159
|
+
for (let n = 0; n < t.length; n++) Gr(e, t[n]);
|
|
2152
2160
|
}(e);
|
|
2153
2161
|
}
|
|
2154
2162
|
return 0;
|
|
2155
2163
|
}
|
|
2156
|
-
function
|
|
2164
|
+
function Br(e, t, n, r) {
|
|
2157
2165
|
let o = e.priv.url, s = function(e, t) {
|
|
2158
2166
|
let n;
|
|
2159
2167
|
try {
|
|
2160
2168
|
n = JSON.parse(t);
|
|
2161
2169
|
} catch (e) {
|
|
2162
|
-
return
|
|
2170
|
+
return Bt("parsing inter_event json: " + e), null;
|
|
2163
2171
|
}
|
|
2164
|
-
if (!(n instanceof Object)) return
|
|
2172
|
+
if (!(n instanceof Object)) return Bt("parsing inter_event: websocket data not a json object"), null;
|
|
2165
2173
|
let r = n.event;
|
|
2166
|
-
if (!r) return
|
|
2167
|
-
if ("string" != typeof r) return
|
|
2174
|
+
if (!r) return Bt("parsing inter_event: no event"), null;
|
|
2175
|
+
if ("string" != typeof r) return Bt("parsing inter_event: event not a string"), null;
|
|
2168
2176
|
let o = n.kw;
|
|
2169
2177
|
return o ? o instanceof Object ? {
|
|
2170
2178
|
event: r,
|
|
2171
2179
|
kw: o || {}
|
|
2172
|
-
} : (
|
|
2180
|
+
} : (Bt("parsing inter_event: kw not a json object"), null) : (Bt("parsing inter_kw: no kw"), null);
|
|
2173
2181
|
}(0, n.data);
|
|
2174
|
-
if (
|
|
2175
|
-
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r =
|
|
2176
|
-
r ? r(e, s, 2, t) :
|
|
2182
|
+
if (it(Ie(), "trace_inter_event")) {
|
|
2183
|
+
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r = ot(Ie(), "trace_ievent_callback");
|
|
2184
|
+
r ? r(e, s, 2, t) : Cr(0, e, s);
|
|
2177
2185
|
}
|
|
2178
2186
|
let i = s.event, l = s.kw;
|
|
2179
|
-
if ("ST_SESSION" !==
|
|
2180
|
-
if (
|
|
2181
|
-
if (
|
|
2182
|
-
} else
|
|
2183
|
-
return
|
|
2187
|
+
if ("ST_SESSION" !== dt(e)) {
|
|
2188
|
+
if (mt(e, i, w.EVF_PUBLIC_EVENT)) {
|
|
2189
|
+
if (!(vt(e, i, l, e) < 0)) return 0;
|
|
2190
|
+
} else Bt(`${Fe(e)}: event UNKNOWN in not-session state ${i}`);
|
|
2191
|
+
return $r(e), -1;
|
|
2184
2192
|
}
|
|
2185
2193
|
s = null;
|
|
2186
|
-
let _ =
|
|
2187
|
-
if (u.toLowerCase() !== Ce().toLowerCase()) return
|
|
2188
|
-
let c =
|
|
2194
|
+
let _ = er(e, l), a = Xn(e, l, Dr), u = kn(e, a, "dst_role", "");
|
|
2195
|
+
if (u.toLowerCase() !== Ce().toLowerCase()) return Bt(`"It's not my role, dst_role: ${u}, my_role: ${Ce()}`), 0;
|
|
2196
|
+
let c = kn(e, a, "dst_service", "");
|
|
2189
2197
|
if ("__subscribing__" === _) return -1;
|
|
2190
2198
|
if ("__unsubscribing__" === _) return -1;
|
|
2191
|
-
if (
|
|
2199
|
+
if (mt(e, i, w.EVF_PUBLIC_EVENT)) return vt(e, i, l, e), 0;
|
|
2192
2200
|
let f = fe(c, !0);
|
|
2193
2201
|
if (f) {
|
|
2194
|
-
if (!
|
|
2195
|
-
|
|
2196
|
-
} else We(e) ?
|
|
2202
|
+
if (!mt(f, i, w.EVF_PUBLIC_EVENT)) return Bt(`${Fe(e)}: Service found but no event or not public, service '${Fe(f)}', ev '${i}'`), -1;
|
|
2203
|
+
vt(f, i, l, e);
|
|
2204
|
+
} else We(e) ? vt(Ve(e), i, l, e) : It(e, i, l);
|
|
2197
2205
|
return 0;
|
|
2198
2206
|
}
|
|
2199
|
-
function
|
|
2207
|
+
function Jr(e, t, n, r) {
|
|
2200
2208
|
return 0;
|
|
2201
2209
|
}
|
|
2202
|
-
function
|
|
2210
|
+
function qr(e, t, n, r) {
|
|
2203
2211
|
return 0;
|
|
2204
2212
|
}
|
|
2205
|
-
var
|
|
2213
|
+
var Hr = {
|
|
2206
2214
|
mt_create: function(e) {
|
|
2207
2215
|
let t = e.priv;
|
|
2208
|
-
t.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.url =
|
|
2209
|
-
const n =
|
|
2210
|
-
n &&
|
|
2216
|
+
t.gobj_timer = Te(Pe(e), "C_TIMER", {}, e), t.url = _t(e, "url"), t.remote_yuno_name = _t(e, "remote_yuno_name"), t.remote_yuno_role = _t(e, "remote_yuno_role"), t.remote_yuno_service = _t(e, "remote_yuno_service"), gt(e, "wanted_yuno_name", t.remote_yuno_name), gt(e, "wanted_yuno_role", t.remote_yuno_role), gt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2217
|
+
const n = at(e, "subscriber");
|
|
2218
|
+
n && Dt(e, null, {}, n);
|
|
2211
2219
|
},
|
|
2212
2220
|
mt_writing: function(e, t) {
|
|
2213
2221
|
let n = e.priv;
|
|
2214
2222
|
switch (t) {
|
|
2215
2223
|
case "url":
|
|
2216
|
-
n.url =
|
|
2224
|
+
n.url = _t(e, "url");
|
|
2217
2225
|
break;
|
|
2218
2226
|
case "remote_yuno_name":
|
|
2219
|
-
n.remote_yuno_name =
|
|
2227
|
+
n.remote_yuno_name = _t(e, "remote_yuno_name");
|
|
2220
2228
|
break;
|
|
2221
2229
|
case "remote_yuno_role":
|
|
2222
|
-
n.remote_yuno_role =
|
|
2230
|
+
n.remote_yuno_role = _t(e, "remote_yuno_role");
|
|
2223
2231
|
break;
|
|
2224
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
2232
|
+
case "remote_yuno_service": n.remote_yuno_service = _t(e, "remote_yuno_service");
|
|
2225
2233
|
}
|
|
2226
2234
|
},
|
|
2227
2235
|
mt_start: function(e) {
|
|
2228
2236
|
let t = e.priv;
|
|
2229
|
-
return t.retry_ms = 0, t.websocket =
|
|
2237
|
+
return t.retry_ms = 0, t.websocket = Ir(e), 0;
|
|
2230
2238
|
},
|
|
2231
2239
|
mt_stop: function(e) {
|
|
2232
2240
|
let t = e.priv;
|
|
2233
|
-
return
|
|
2241
|
+
return jr(t.gobj_timer), t.websocket && $r(e), 0;
|
|
2234
2242
|
},
|
|
2235
2243
|
mt_destroy: function(e) {},
|
|
2236
2244
|
mt_stats: function(e, t, n, r) {
|
|
2237
|
-
if ("ST_SESSION" !==
|
|
2245
|
+
if ("ST_SESSION" !== dt(e)) return Bt("Not in session"), null;
|
|
2238
2246
|
n || (n = {});
|
|
2239
|
-
let o =
|
|
2240
|
-
return s || (s = {}),
|
|
2247
|
+
let o = Ur(e, Pe(r), kn(e, n, "service", null, 0)), s = Cn(e, n, "__md_stats__", null, $t.KW_EXTRACT);
|
|
2248
|
+
return s || (s = {}), Qn(e, n, "stats_stack", {
|
|
2241
2249
|
stats: t,
|
|
2242
2250
|
kw: s
|
|
2243
|
-
}),
|
|
2251
|
+
}), Qn(e, n, Dr, o), n.__stats__ = t, Zn(e, n, "__stats__"), Pr(e, "EV_MT_STATS", n, r), null;
|
|
2244
2252
|
},
|
|
2245
2253
|
mt_command_parser: function(e, t, n, r) {
|
|
2246
|
-
if ("ST_SESSION" !==
|
|
2254
|
+
if ("ST_SESSION" !== dt(e)) return Bt("Not in session"), null;
|
|
2247
2255
|
n || (n = {});
|
|
2248
|
-
let o =
|
|
2249
|
-
return s || (s = {}),
|
|
2256
|
+
let o = Ur(e, Pe(r), kn(e, n, "service", "", 0)), s = Cn(e, n, "__md_command__", null, $t.KW_EXTRACT);
|
|
2257
|
+
return s || (s = {}), Qn(e, n, "command_stack", {
|
|
2250
2258
|
command: t,
|
|
2251
2259
|
kw: s
|
|
2252
|
-
}),
|
|
2260
|
+
}), Qn(e, n, Dr, o), n.__command__ = t, Zn(e, n, "__command__"), Pr(e, "EV_MT_COMMAND", n, r), null;
|
|
2253
2261
|
},
|
|
2254
2262
|
mt_inject_event: function(e, t, n, r) {
|
|
2255
|
-
if ("ST_SESSION" !==
|
|
2256
|
-
if (n || (n = {}),
|
|
2263
|
+
if ("ST_SESSION" !== dt(e)) return window.console.error("Not in session"), -1;
|
|
2264
|
+
if (n || (n = {}), Xn(e, n, Dr));
|
|
2257
2265
|
else {
|
|
2258
|
-
let o =
|
|
2259
|
-
|
|
2266
|
+
let o = Ur(e, Pe(r), kn(e, n, "__service__", 0, 0));
|
|
2267
|
+
rn(n, "__service__"), Qn(e, n, "__message__", t), Qn(e, n, Dr, o);
|
|
2260
2268
|
}
|
|
2261
|
-
return
|
|
2269
|
+
return Zn(e, n, "__message__"), Pr(e, t, n, r);
|
|
2262
2270
|
},
|
|
2263
2271
|
mt_subscription_added: function(e, t) {
|
|
2264
2272
|
let n = e.priv;
|
|
2265
|
-
return "ST_SESSION" ===
|
|
2273
|
+
return "ST_SESSION" === dt(e) && n.websocket ? n.inside_on_open ? 0 : Gr(e, t) : 0;
|
|
2266
2274
|
},
|
|
2267
2275
|
mt_subscription_deleted: function(e, t) {
|
|
2268
2276
|
let n = e.priv;
|
|
2269
|
-
if ("ST_SESSION" !==
|
|
2277
|
+
if ("ST_SESSION" !== dt(e) || !n.websocket) return 0;
|
|
2270
2278
|
if (n.inside_on_open) return 0;
|
|
2271
|
-
if (
|
|
2279
|
+
if (yn(t.event)) return 0;
|
|
2272
2280
|
let r = {}, o = t.__global__, s = t.__config__, i = t.__filter__, l = t.__service__, _ = t.subscriber;
|
|
2273
2281
|
s && (r.__config__ = s), o && (r.__global__ = o), i && (r.__filter__ = i);
|
|
2274
|
-
return
|
|
2282
|
+
return Qn(e, r, Dr, Ur(e, Pe(_), l)), Zn(e, r, "__unsubscribing__"), Pr(e, t.event, r, e);
|
|
2275
2283
|
}
|
|
2276
2284
|
};
|
|
2277
2285
|
exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) => new h(e, t, n, null, s, r, null, 0, null, o, null), exports.SDATACM = (e, t, n, r, o, s) => new h(e, t, 0, null, s, n, null, 0, o, r, null), exports.SDATACM2 = (e, t, n, r, o, s, i) => new h(e, t, n, null, i, r, null, 0, s, o, null), exports.SDATADF = (e, t, n, r, o, s) => new h(e, t, n, null, s, null, r, o), exports.SDATAPM = (e, t, n, r, o) => new h(e, t, n, r, o), exports.SDATAPM0 = (e, t, n, r, o) => new h(e, t, n, null, o, null, null, 0, null, null, r), exports.SDATA_END = y, exports.SDataDesc = h, exports.YUNETA_VERSION = s, Object.defineProperty(exports, "__yuno__", {
|
|
@@ -2285,50 +2293,50 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2285
2293
|
return t;
|
|
2286
2294
|
}, exports.build_stats_response = o, exports.clean_name = function(e) {
|
|
2287
2295
|
return e.replace(/[?# ^:]/g, "_");
|
|
2288
|
-
}, exports.clear_timeout =
|
|
2296
|
+
}, exports.clear_timeout = jr, exports.cmp_two_simple_json = On, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2289
2297
|
let [r, o, s, i] = t;
|
|
2290
|
-
if (!r) return void
|
|
2298
|
+
if (!r) return void Bt("Tag must be a valid HTML element.");
|
|
2291
2299
|
let l = document.createElement(r), _ = "";
|
|
2292
2300
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2293
2301
|
let t = "";
|
|
2294
2302
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2295
2303
|
l.style.cssText = t;
|
|
2296
2304
|
} else "style" === e ? l.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (_ = o[e], l.setAttribute("data-i18n", _)) : l.setAttribute(e, o[e]);
|
|
2297
|
-
if (
|
|
2305
|
+
if (dn(s)) if (s = s.trim(), s.length > 0 && "<" === s[0]) l.appendChild(sr(s));
|
|
2298
2306
|
else if (n && _) l.textContent = n(_) || s;
|
|
2299
2307
|
else l.textContent = s;
|
|
2300
|
-
else if (
|
|
2301
|
-
if (s.length > 0) if (
|
|
2308
|
+
else if (pn(s)) {
|
|
2309
|
+
if (s.length > 0) if (dn(s[0])) l.appendChild(e(s, n));
|
|
2302
2310
|
else for (let t of s) Array.isArray(t) && t.length > 0 ? l.appendChild(e(t, n)) : t instanceof HTMLElement && l.appendChild(t);
|
|
2303
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? l.appendChild(s) : null != s && (
|
|
2311
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? l.appendChild(s) : null != s && (Bt("content ignored"), zt(s));
|
|
2304
2312
|
if (i && "object" == typeof i) for (const e of Object.keys(i)) l.addEventListener(e, i[e]);
|
|
2305
2313
|
return l;
|
|
2306
|
-
}, exports.createOneHtml =
|
|
2307
|
-
let n =
|
|
2308
|
-
return
|
|
2314
|
+
}, exports.createOneHtml = sr, exports.create_json_record = function(e, t) {
|
|
2315
|
+
let n = Qt(e);
|
|
2316
|
+
return en(n, t), n;
|
|
2309
2317
|
}, exports.create_template_record = function(e, t) {
|
|
2310
2318
|
let n = {};
|
|
2311
2319
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2312
2320
|
let o;
|
|
2313
|
-
|
|
2314
|
-
let s =
|
|
2321
|
+
gn(r) && (o = r.default);
|
|
2322
|
+
let s = Cn(null, t, e, o);
|
|
2315
2323
|
n[e] = s;
|
|
2316
2324
|
}), n;
|
|
2317
|
-
}, exports.current_timestamp =
|
|
2318
|
-
let n =
|
|
2319
|
-
return n &&
|
|
2325
|
+
}, exports.current_timestamp = ir, exports.data_type_t = E, exports.db_list_persistent_attrs = function(e, t) {
|
|
2326
|
+
let n = Mn(ur(e), null, !1), r = {};
|
|
2327
|
+
return n && gn(n) && (r = Gn(e, n, t, !1)), r;
|
|
2320
2328
|
}, exports.db_load_persistent_attrs = function(e, t) {
|
|
2321
|
-
let n =
|
|
2322
|
-
if (r &&
|
|
2323
|
-
let o =
|
|
2324
|
-
o =
|
|
2329
|
+
let n = st(e, T.SDF_PERSIST), r = Mn(ur(e), null, !1);
|
|
2330
|
+
if (r && gn(r)) {
|
|
2331
|
+
let o = Gn(e, r, t, !1);
|
|
2332
|
+
o = Gn(e, o, n, !1), ut(e, o, T.SDF_PERSIST);
|
|
2325
2333
|
}
|
|
2326
2334
|
}, exports.db_remove_persistent_attrs = function(e, t) {
|
|
2327
|
-
let n =
|
|
2328
|
-
0 ===
|
|
2335
|
+
let n = Vn(e, Mn(ur(e), null, !1), t, !1);
|
|
2336
|
+
0 === un(n) ? Kn(ur(e)) : Wn(ur(e), n);
|
|
2329
2337
|
}, exports.db_save_persistent_attrs = function(e, t) {
|
|
2330
|
-
let n =
|
|
2331
|
-
return r &&
|
|
2338
|
+
let n = Gn(e, st(e, T.SDF_PERSIST), t, !1), r = Mn(ur(e), null, !1);
|
|
2339
|
+
return r && gn(r) && tn(n, r), Wn(ur(e), n);
|
|
2332
2340
|
}, exports.debounce = function(e, t = 0, n = !1) {
|
|
2333
2341
|
let r = null, o = null, s = null;
|
|
2334
2342
|
const i = (...i) => {
|
|
@@ -2353,7 +2361,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2353
2361
|
Object.assign(t, e);
|
|
2354
2362
|
}
|
|
2355
2363
|
return t;
|
|
2356
|
-
}, exports.empty_string =
|
|
2364
|
+
}, exports.empty_string = yn, exports.escapeHtml = or, exports.event_flag_t = w, exports.gclass_add_ev_action = se, exports.gclass_add_event_type = le, exports.gclass_add_state = oe, exports.gclass_check_fsm = ae, exports.gclass_create = ee, exports.gclass_event_type = _e, exports.gclass_find_by_name = ue, exports.gclass_flag_t = O, exports.gclass_unregister = te, exports.getPositionRelativeToBody = function(e) {
|
|
2357
2365
|
if (!e) return {
|
|
2358
2366
|
top: 0,
|
|
2359
2367
|
left: 0,
|
|
@@ -2372,14 +2380,14 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2372
2380
|
right: n + l + r,
|
|
2373
2381
|
bottom: t + i + o
|
|
2374
2382
|
};
|
|
2375
|
-
}, exports.get_function_name =
|
|
2383
|
+
}, exports.get_function_name = ar, exports.get_now = function() {
|
|
2376
2384
|
return Math.floor(Date.now() / 1e3);
|
|
2377
2385
|
}, exports.gobj_bottom_gobj = Ye, exports.gobj_change_parent = function(e, n) {
|
|
2378
|
-
return Ke(e) ? (
|
|
2379
|
-
}, exports.gobj_change_state =
|
|
2380
|
-
if (Ke(e)) return
|
|
2381
|
-
let i = d &&
|
|
2382
|
-
return i && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", De(e) ? "" : "!!", Fe(e), n, Fe(s))), i > 1 &&
|
|
2386
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), null) : n instanceof S ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (de(e.parent, e), e.parent = null), pe(n, e), n.mt_child_added && (K(e) && qt(t("👦👦🔵 child_added(%s): %s", Ge(n), Fe(e))), n.mt_child_added(n, e)), 0) : (Bt(`${Fe(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2387
|
+
}, exports.gobj_change_state = pt, exports.gobj_command = function(e, n, o, s) {
|
|
2388
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
2389
|
+
let i = d && lt(d, "tracing");
|
|
2390
|
+
return i && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", De(e) ? "" : "!!", Fe(e), n, Fe(s))), i > 1 && zt(o)), 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", Fe(e)), 0, 0) : r(0, -1, t("%s: command table not available", Fe(e)), 0, 0);
|
|
2383
2391
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
2384
2392
|
return Ee(e, t, n, r, 0);
|
|
2385
2393
|
}, exports.gobj_create2 = Ee, exports.gobj_create_default_service = function(e, t, n, r) {
|
|
@@ -2390,41 +2398,41 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2390
2398
|
return Ee(e, t, n, r, N.gobj_flag_volatil);
|
|
2391
2399
|
}, exports.gobj_create_yuno = function(e, t, n) {
|
|
2392
2400
|
return Ee(e, t, n, null, N.gobj_flag_yuno);
|
|
2393
|
-
}, exports.gobj_current_state =
|
|
2394
|
-
if (
|
|
2401
|
+
}, exports.gobj_current_state = dt, exports.gobj_default_service = ce, exports.gobj_deliver_posted_events = yt, exports.gobj_destroy = he, exports.gobj_find_child = tt, exports.gobj_find_gobj = function(e, t) {
|
|
2402
|
+
if (yn(t)) return null;
|
|
2395
2403
|
const n = t.toLowerCase();
|
|
2396
|
-
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d :
|
|
2397
|
-
}, exports.gobj_find_service = fe, exports.gobj_find_subscribings =
|
|
2404
|
+
return "__default_service__" === n ? b : "__yuno__" === n || "__root__" === n ? d : nt(d, t);
|
|
2405
|
+
}, exports.gobj_find_service = fe, exports.gobj_find_subscribings = kt, exports.gobj_find_subscriptions = At, exports.gobj_flag_t = N, exports.gobj_full_name = Ge, exports.gobj_gclass_name = Ue, exports.gobj_global_trace_level = function() {
|
|
2398
2406
|
return P;
|
|
2399
|
-
}, exports.gobj_has_attr =
|
|
2407
|
+
}, exports.gobj_has_attr = rt, exports.gobj_has_event = mt, exports.gobj_has_output_event = Et, exports.gobj_hsdata = Q, exports.gobj_is_destroying = Ke, exports.gobj_is_playing = ke, exports.gobj_is_pure_child = We, exports.gobj_is_running = De, exports.gobj_is_service = Ae, exports.gobj_is_volatil = Me, exports.gobj_list_persistent_attrs = function(e, t) {
|
|
2400
2408
|
return a ? a(e, t) : null;
|
|
2401
2409
|
}, exports.gobj_list_subscriptions = function(e) {
|
|
2402
|
-
let t =
|
|
2410
|
+
let t = At(e, null, null, null);
|
|
2403
2411
|
for (let n = 0; n < t.length; n++) {
|
|
2404
|
-
let r = t[n], o =
|
|
2405
|
-
|
|
2412
|
+
let r = t[n], o = In(e, r, "publisher", null, $t.KW_REQUIRED), s = In(e, r, "subscriber", null, $t.KW_REQUIRED);
|
|
2413
|
+
sn(r, "s_event", kn(e, r, "event", "", $t.KW_REQUIRED)), sn(r, "s_publisher", Fe(o)), sn(r, "s_subscriber", Fe(s));
|
|
2406
2414
|
}
|
|
2407
|
-
let n =
|
|
2415
|
+
let n = kt(e, 0, null, 0);
|
|
2408
2416
|
for (let t = 0; t < n.length; t++) {
|
|
2409
|
-
let r = n[t], o =
|
|
2410
|
-
|
|
2417
|
+
let r = n[t], o = In(e, r, "publisher", null, $t.KW_REQUIRED), s = In(e, r, "subscriber", null, $t.KW_REQUIRED);
|
|
2418
|
+
sn(r, "s_event", kn(e, r, "event", "", $t.KW_REQUIRED)), sn(r, "s_publisher", Fe(o)), sn(r, "s_subscriber", Fe(s));
|
|
2411
2419
|
}
|
|
2412
2420
|
return {
|
|
2413
2421
|
subscriptions: t,
|
|
2414
2422
|
subscribings: n,
|
|
2415
|
-
"total subscriptions":
|
|
2416
|
-
total_subscribings:
|
|
2423
|
+
"total subscriptions": cn(t),
|
|
2424
|
+
total_subscribings: cn(n)
|
|
2417
2425
|
};
|
|
2418
2426
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
2419
|
-
return Ae(e) ? i ? i(e, t) : -1 : (
|
|
2427
|
+
return Ae(e) ? i ? i(e, t) : -1 : (Bt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2420
2428
|
}, exports.gobj_match_children = function(e, t) {
|
|
2421
|
-
if (Ke(e)) return
|
|
2429
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
2422
2430
|
t = t || {};
|
|
2423
2431
|
let n = [];
|
|
2424
2432
|
const r = e.dl_children;
|
|
2425
2433
|
for (let e = 0; e < r.length; e++) {
|
|
2426
2434
|
const o = r[e];
|
|
2427
|
-
|
|
2435
|
+
et(o, t) && n.push(o);
|
|
2428
2436
|
}
|
|
2429
2437
|
return n;
|
|
2430
2438
|
}, exports.gobj_match_children_tree = function(e, t) {
|
|
@@ -2434,20 +2442,20 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2434
2442
|
let o = r.dl_children;
|
|
2435
2443
|
for (let r = 0; r < o.length; r++) {
|
|
2436
2444
|
let s = o[r];
|
|
2437
|
-
|
|
2445
|
+
et(s, t) && n.push(s), e(n, s);
|
|
2438
2446
|
}
|
|
2439
2447
|
}(n, e), n;
|
|
2440
|
-
}, exports.gobj_match_gobj =
|
|
2441
|
-
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (
|
|
2448
|
+
}, exports.gobj_match_gobj = et, exports.gobj_name = Pe, exports.gobj_parent = Ve, exports.gobj_pause = we, exports.gobj_play = Re, exports.gobj_post_event = function(e, n, r, o) {
|
|
2449
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (Bt(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : yn(n) ? (Bt("gobj_post_event(): event EMPTY"), -1) : mt(e, n, 0) ? Tt.length >= 1e4 ? (Bt(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2442
2450
|
dst: e,
|
|
2443
2451
|
event: n,
|
|
2444
2452
|
kw: r,
|
|
2445
2453
|
src: o
|
|
2446
|
-
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n,
|
|
2454
|
+
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n, Tt.length)), ht || (ht = !0, setTimeout(yt, 0)), 0) : (Bt(`gobj_post_event(): event NOT DEFINED in gclass ${Ue(e)}, event ${n}`), -1) : (Bt(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
2447
2455
|
}, exports.gobj_posted_events_size = function() {
|
|
2448
|
-
return
|
|
2449
|
-
}, exports.gobj_publish_event =
|
|
2450
|
-
return Ae(e) ? _ ? _(e, t) : -1 : (
|
|
2456
|
+
return Tt.length;
|
|
2457
|
+
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr = it, exports.gobj_read_integer_attr = lt, exports.gobj_read_pointer_attr = at, exports.gobj_read_str_attr = _t, exports.gobj_remove_persistent_attrs = function(e, t) {
|
|
2458
|
+
return Ae(e) ? _ ? _(e, t) : -1 : (Bt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2451
2459
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
2452
2460
|
return L.map(([e, t, n]) => ({
|
|
2453
2461
|
name: e,
|
|
@@ -2457,33 +2465,33 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2457
2465
|
}));
|
|
2458
2466
|
}, exports.gobj_reset_volatil_attrs = function(e) {
|
|
2459
2467
|
return function(e, t, n) {
|
|
2460
|
-
if (Ke(e)) return
|
|
2468
|
+
if (Ke(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
2461
2469
|
let r = e.gclass.attrs_table;
|
|
2462
2470
|
for (let o = 0; o < r.length; o++) {
|
|
2463
2471
|
const s = r[o];
|
|
2464
2472
|
if (s.name && !(n && s.flag & n) && (-1 === t || s.flag & t)) {
|
|
2465
2473
|
const t = H(e, e.jn_attrs, s);
|
|
2466
|
-
|
|
2474
|
+
gn(e.priv) && e.priv.hasOwnProperty(s.name) && (e.priv[s.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, s.name);
|
|
2467
2475
|
}
|
|
2468
2476
|
}
|
|
2469
2477
|
return 0;
|
|
2470
2478
|
}(e, T.SDF_VOLATIL, 0);
|
|
2471
2479
|
}, exports.gobj_save_persistent_attrs = function(e, t) {
|
|
2472
|
-
return Ae(e) ? l ? l(e, t) : -1 : (
|
|
2473
|
-
}, exports.gobj_search_path =
|
|
2480
|
+
return Ae(e) ? l ? l(e, t) : -1 : (Bt(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2481
|
+
}, exports.gobj_search_path = nt, exports.gobj_send_event = vt, exports.gobj_services = function() {
|
|
2474
2482
|
let e = [];
|
|
2475
|
-
for (const t of Object.keys(p))
|
|
2483
|
+
for (const t of Object.keys(p)) _n(e, t);
|
|
2476
2484
|
return e;
|
|
2477
2485
|
}, exports.gobj_set_bottom_gobj = Be, exports.gobj_set_deep_trace = function(e) {
|
|
2478
2486
|
return F = Number(e) || 0, 0;
|
|
2479
2487
|
}, exports.gobj_set_gclass_no_trace = function(e, t, n) {
|
|
2480
|
-
const r =
|
|
2481
|
-
if (!r) return
|
|
2488
|
+
const r = dn(e) ? ue(e) : e;
|
|
2489
|
+
if (!r) return Bt(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2482
2490
|
const o = G(t, "gobj_set_gclass_no_trace");
|
|
2483
2491
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
2484
2492
|
}, exports.gobj_set_gclass_trace = function(e, t, n) {
|
|
2485
|
-
const r =
|
|
2486
|
-
if (!r) return
|
|
2493
|
+
const r = dn(e) ? ue(e) : e;
|
|
2494
|
+
if (!r) return Bt(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2487
2495
|
const o = G(t, "gobj_set_gclass_trace");
|
|
2488
2496
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
2489
2497
|
}, exports.gobj_set_global_no_trace = function(e, t) {
|
|
@@ -2493,19 +2501,19 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2493
2501
|
const n = G(e, "gobj_set_global_trace");
|
|
2494
2502
|
return n ? (t ? P |= n : P &= ~n, 0) : -1;
|
|
2495
2503
|
}, exports.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2496
|
-
if (!e) return
|
|
2504
|
+
if (!e) return Bt("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2497
2505
|
const r = G(t, "gobj_set_gobj_no_trace");
|
|
2498
2506
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2499
2507
|
}, exports.gobj_set_gobj_trace = function(e, t, n) {
|
|
2500
|
-
if (!e) return
|
|
2508
|
+
if (!e) return Bt("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2501
2509
|
const r = G(t, "gobj_set_gobj_trace");
|
|
2502
2510
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2503
2511
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
2504
2512
|
I = 1 === Number(e) ? 1 : 0;
|
|
2505
2513
|
}, exports.gobj_short_name = Fe, exports.gobj_start = ye, exports.gobj_start_children = function(e) {
|
|
2506
|
-
return Ke(e) ? (
|
|
2514
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : qe(e, D.WALK_FIRST2LAST, ve, 0, 0);
|
|
2507
2515
|
}, exports.gobj_start_tree = function(e) {
|
|
2508
|
-
return Ke(e) ? (
|
|
2516
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag & O.gcflag_manual_start || e.disabled ? 0 : (e.running || ye(e), He(e, D.WALK_TOP2BOTTOM, je, 0, 0)));
|
|
2509
2517
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
2510
2518
|
i = t, l = n, _ = r, a = o, u = s, c = g;
|
|
2511
2519
|
const p = [["EV_STATE_CHANGED", w.EVF_SYSTEM_EVENT | w.EVF_OUTPUT_EVENT | w.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -2515,14 +2523,14 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2515
2523
|
}
|
|
2516
2524
|
return 0;
|
|
2517
2525
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
2518
|
-
return Ke(e) ? (
|
|
2526
|
+
return Ke(e) ? (Bt("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", Fe(e)), 0, 0);
|
|
2519
2527
|
}, exports.gobj_stop = Se, exports.gobj_stop_children = Ne, exports.gobj_stop_tree = function(e) {
|
|
2520
|
-
return Ke(e) ? (
|
|
2521
|
-
}, exports.gobj_subscribe_event =
|
|
2528
|
+
return Ke(e) ? (Bt("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Ge(e))), De(e) && Se(e), He(e, D.WALK_TOP2BOTTOM, Oe, 0, 0));
|
|
2529
|
+
}, exports.gobj_subscribe_event = Dt, exports.gobj_trace_level = V, exports.gobj_trace_machine_format = function() {
|
|
2522
2530
|
return I;
|
|
2523
2531
|
}, exports.gobj_trace_no_level = M, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2524
|
-
if (null == n && (n = {}), !e) return
|
|
2525
|
-
if (!r) return
|
|
2532
|
+
if (null == n && (n = {}), !e) return Bt(`publisher NULL: ev ${t}`), 0;
|
|
2533
|
+
if (!r) return Bt(`subscriber NULL: ev ${t}`), 0;
|
|
2526
2534
|
const o = /* @__PURE__ */ new Set([
|
|
2527
2535
|
"__config__",
|
|
2528
2536
|
"__global__",
|
|
@@ -2531,102 +2539,102 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2531
2539
|
"__service__"
|
|
2532
2540
|
]);
|
|
2533
2541
|
if (Object.keys(n).forEach((n) => {
|
|
2534
|
-
o.has(n) ||
|
|
2535
|
-
}),
|
|
2536
|
-
else if (!(
|
|
2537
|
-
let s =
|
|
2542
|
+
o.has(n) || Bt(`${Fe(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2543
|
+
}), yn(t)) t = "";
|
|
2544
|
+
else if (!(Et(e, t, w.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Fe(e)}, ev ${t}`), 0;
|
|
2545
|
+
let s = Nt(e.dl_subscriptions, e, t, n, r), i = 0;
|
|
2538
2546
|
for (let t = 0; t < s.length; t++) {
|
|
2539
2547
|
let n = s[t];
|
|
2540
|
-
|
|
2548
|
+
wt(e, n, !1, !1), i++;
|
|
2541
2549
|
}
|
|
2542
|
-
return i || (
|
|
2543
|
-
}, exports.gobj_unsubscribe_list =
|
|
2544
|
-
if (!
|
|
2550
|
+
return i || (Jt(`${Fe(e)}: No subscription found`), zt(n, "No subscription found")), 0;
|
|
2551
|
+
}, exports.gobj_unsubscribe_list = xt, exports.gobj_walk_gobj_children = qe, exports.gobj_walk_gobj_children_tree = He, exports.gobj_write_attr = function(e, n, r, o) {
|
|
2552
|
+
if (!dn(n)) return Bt(t("gobj_write_attr(%s): path must be a string", Fe(e))), -1;
|
|
2545
2553
|
let s, i = e.jn_attrs, l = n.split("`");
|
|
2546
2554
|
if (l.length <= 1) {
|
|
2547
2555
|
let o = n;
|
|
2548
|
-
return o in i && i.hasOwnProperty(o) ? (i[o] = r,
|
|
2556
|
+
return o in i && i.hasOwnProperty(o) ? (i[o] = r, gn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (Bt(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), o)), -1);
|
|
2549
2557
|
}
|
|
2550
2558
|
let _ = l.length;
|
|
2551
2559
|
for (let t = 0; t < _; t++) {
|
|
2552
2560
|
s = l[t];
|
|
2553
|
-
let n =
|
|
2561
|
+
let n = tt(e, { __gobj_name__: s });
|
|
2554
2562
|
if (n && t < _ - 1) {
|
|
2555
2563
|
e = n;
|
|
2556
2564
|
continue;
|
|
2557
2565
|
}
|
|
2558
2566
|
let o = e.jn_attrs;
|
|
2559
|
-
if (s in o && o.hasOwnProperty(s)) return o[s] = r,
|
|
2567
|
+
if (s in o && o.hasOwnProperty(s)) return o[s] = r, gn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.mt_writing && e.mt_writing(e, s), 0;
|
|
2560
2568
|
break;
|
|
2561
2569
|
}
|
|
2562
|
-
return
|
|
2563
|
-
}, exports.gobj_write_attrs =
|
|
2570
|
+
return Bt(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), s)), -1;
|
|
2571
|
+
}, exports.gobj_write_attrs = ut, exports.gobj_write_bool_attr = ct, exports.gobj_write_integer_attr = ft, exports.gobj_write_str_attr = gt, exports.gobj_yuno = Ie, exports.gobj_yuno_id = Le, exports.gobj_yuno_name = $e, exports.gobj_yuno_role = Ce, exports.id_index_in_obj_list = Jn, exports.index_in_list = lr, exports.is_array = pn, exports.is_boolean = mn, exports.is_date = function(e) {
|
|
2564
2572
|
return e instanceof Date && !isNaN(e);
|
|
2565
|
-
}, exports.is_function =
|
|
2566
|
-
if (!
|
|
2573
|
+
}, exports.is_function = Tn, exports.is_gobj = hn, exports.is_metadata_key = function(e) {
|
|
2574
|
+
if (!dn(e)) return !1;
|
|
2567
2575
|
let t;
|
|
2568
2576
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2569
2577
|
return 2 === t;
|
|
2570
|
-
}, exports.is_null =
|
|
2571
|
-
if (!
|
|
2578
|
+
}, exports.is_null = En, exports.is_number = bn, exports.is_object = gn, exports.is_private_key = function(e) {
|
|
2579
|
+
if (!dn(e)) return !1;
|
|
2572
2580
|
let t;
|
|
2573
2581
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2574
2582
|
return 1 === t;
|
|
2575
2583
|
}, exports.is_pure_number = function(e) {
|
|
2576
|
-
if (
|
|
2577
|
-
if (!
|
|
2584
|
+
if (bn(e)) return !0;
|
|
2585
|
+
if (!dn(e)) return !1;
|
|
2578
2586
|
const t = Number(e);
|
|
2579
2587
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2580
|
-
}, exports.is_string =
|
|
2581
|
-
let o =
|
|
2582
|
-
if (!o) return
|
|
2583
|
-
if (
|
|
2588
|
+
}, exports.is_string = dn, exports.jdb_delete = function(e, t, n, r) {
|
|
2589
|
+
let o = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2590
|
+
if (!o) return Bt("jdb_delete: topic not found: " + t), null;
|
|
2591
|
+
if (yn(r.id)) return Bt("jdb_delete: record without id: " + r), Ht(r), null;
|
|
2584
2592
|
let s, i = n.split("`"), l = o;
|
|
2585
|
-
for (; (s = i.shift()) && !
|
|
2586
|
-
if (0 === i.length && l) if (
|
|
2587
|
-
let e =
|
|
2593
|
+
for (; (s = i.shift()) && !yn(s) && l;) gn(l) && (l = Cn(null, l, e.hook, null, 0)), l = nr(l, null, s, !1);
|
|
2594
|
+
if (0 === i.length && l) if (pn(l)) {
|
|
2595
|
+
let e = Jn(l, r.id);
|
|
2588
2596
|
e >= 0 && l.splice(e, 1);
|
|
2589
2597
|
} else {
|
|
2590
|
-
let t =
|
|
2598
|
+
let t = Cn(null, l, e.hook, null, 0), n = Jn(t, r.id);
|
|
2591
2599
|
n >= 0 && t.splice(n, 1);
|
|
2592
2600
|
}
|
|
2593
2601
|
return o;
|
|
2594
2602
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
2595
|
-
let o =
|
|
2596
|
-
return o ? (void 0 === r && (r = !0),
|
|
2603
|
+
let o = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2604
|
+
return o ? (void 0 === r && (r = !0), nr(o, e.hook, n, r)) : (Bt("jdb_get: topic not found: " + t), null);
|
|
2597
2605
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
2598
|
-
let r =
|
|
2599
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2606
|
+
let r = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2607
|
+
return r ? n < r.length ? r[n] : {} : (Bt("jdb_get_by_idx: topic not found: " + t), null);
|
|
2600
2608
|
}, exports.jdb_get_topic = function(e, t) {
|
|
2601
|
-
let n =
|
|
2602
|
-
if (!n) return
|
|
2603
|
-
return
|
|
2609
|
+
let n = Cn(null, e, "topics", null, 0);
|
|
2610
|
+
if (!n) return Bt("jdb topics section not found"), Ht(e), null;
|
|
2611
|
+
return Cn(null, n, t, null, 0) || (Bt("jdb topic not found: " + t), Ht(n), null);
|
|
2604
2612
|
}, exports.jdb_init = function(e, t, n) {
|
|
2605
|
-
n && (e =
|
|
2606
|
-
let r =
|
|
2607
|
-
|
|
2608
|
-
let o =
|
|
2609
|
-
return
|
|
2610
|
-
"__" !== t.substring(0, 2) &&
|
|
2613
|
+
n && (e = Qt(e));
|
|
2614
|
+
let r = Cn(null, e, "type", [], 1);
|
|
2615
|
+
kn(null, e, "hook", "data", 1);
|
|
2616
|
+
let o = Cn(null, e, "schema", {}, 1), s = Cn(null, e, "topics", {}, 1);
|
|
2617
|
+
return tr(o, function(e, t, n, o) {
|
|
2618
|
+
"__" !== t.substring(0, 2) && Cn(null, s, o, Qt(r), 1);
|
|
2611
2619
|
}, t), e;
|
|
2612
2620
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
2613
|
-
let o =
|
|
2614
|
-
if (!o) return
|
|
2615
|
-
if (
|
|
2621
|
+
let o = Cn(null, Cn(null, e, "topics", null, 0), t, null, 0);
|
|
2622
|
+
if (!o) return Bt("jdb_update: topic not found: " + t), null;
|
|
2623
|
+
if (yn(r.id)) return Bt("jdb_update: record without id: " + r), Ht(r), null;
|
|
2616
2624
|
let s, i = n.split("`"), l = o;
|
|
2617
|
-
for (; (s = i.shift()) && !
|
|
2618
|
-
if (0 === i.length && l) if (
|
|
2625
|
+
for (; (s = i.shift()) && !yn(s) && l;) gn(l) && (l = Cn(null, l, e.hook, [], 1)), l = nr(l, null, s, !1);
|
|
2626
|
+
if (0 === i.length && l) if (pn(l)) l.push(r);
|
|
2619
2627
|
else if (l.id === r.id) Object.assign(l, r);
|
|
2620
2628
|
else {
|
|
2621
|
-
let t =
|
|
2629
|
+
let t = Cn(null, l, e.hook, [], 1), n = nr(t, e.hook, r.id, !1);
|
|
2622
2630
|
n ? Object.assign(n, r) : t.push(r);
|
|
2623
2631
|
}
|
|
2624
2632
|
return o;
|
|
2625
|
-
}, exports.json_array_append =
|
|
2633
|
+
}, exports.json_array_append = ln, exports.json_array_append_new = _n, exports.json_array_extend = function(e, t) {
|
|
2626
2634
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2627
|
-
}, exports.json_array_remove =
|
|
2635
|
+
}, exports.json_array_remove = an, exports.json_array_size = cn, exports.json_deep_copy = Qt, exports.json_is_identical = Xt, exports.json_object_del = rn, exports.json_object_get = nn, exports.json_object_set = on, exports.json_object_set_new = sn, exports.json_object_size = un, exports.json_object_update = Zt, exports.json_object_update_existing = en, exports.json_object_update_missing = tn, exports.json_size = fn, exports.jwt2json = function(e, t) {
|
|
2628
2636
|
try {
|
|
2629
|
-
let n =
|
|
2637
|
+
let n = rr(e);
|
|
2630
2638
|
switch (t) {
|
|
2631
2639
|
case "header": return JSON.parse(n.header);
|
|
2632
2640
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2635,122 +2643,122 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2635
2643
|
} catch (e) {
|
|
2636
2644
|
return null;
|
|
2637
2645
|
}
|
|
2638
|
-
}, exports.jwtDecode =
|
|
2639
|
-
if (e && !
|
|
2640
|
-
r || (r =
|
|
2646
|
+
}, exports.jwtDecode = rr, exports.kw_clone_by_keys = Gn, exports.kw_clone_by_not_keys = Vn, exports.kw_collect = function(e, t, n, r) {
|
|
2647
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
2648
|
+
r || (r = Fn);
|
|
2641
2649
|
let o = [];
|
|
2642
|
-
if (
|
|
2650
|
+
if (pn(t)) for (let e = 0; e < t.length; e++) {
|
|
2643
2651
|
let s = t[e];
|
|
2644
2652
|
r(s, n) && o.push(s);
|
|
2645
2653
|
}
|
|
2646
2654
|
else {
|
|
2647
|
-
if (!
|
|
2655
|
+
if (!gn(t)) return Bt("kw_select() BAD kw parameter"), null;
|
|
2648
2656
|
r(t, n) && o.push(t);
|
|
2649
2657
|
}
|
|
2650
2658
|
return o;
|
|
2651
|
-
}, exports.kw_delete =
|
|
2652
|
-
if (!n || !
|
|
2653
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2654
|
-
return r &&
|
|
2655
|
-
}, exports.kw_find_path =
|
|
2656
|
-
e && !
|
|
2657
|
-
let s =
|
|
2658
|
-
const i = o && o &
|
|
2659
|
+
}, exports.kw_delete = Dn, exports.kw_find_json_in_list = function(e, t, n, r) {
|
|
2660
|
+
if (!n || !pn(t)) return r && Bt("item NULL or kw_list is not a list"), -1;
|
|
2661
|
+
for (let e = 0; e < t.length; e++) if (Xt(n, t[e])) return e;
|
|
2662
|
+
return r && Bt("item not found in this list"), -1;
|
|
2663
|
+
}, exports.kw_find_path = wn, exports.kw_flag_t = $t, exports.kw_get_bool = xn, exports.kw_get_dict = $n, exports.kw_get_dict_value = Cn, exports.kw_get_int = An, exports.kw_get_list = function(e, t, n, r, o) {
|
|
2664
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2665
|
+
let s = wn(e, t, n, !1);
|
|
2666
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2659
2667
|
if (void 0 === s) {
|
|
2660
2668
|
if (l) {
|
|
2661
2669
|
let o = Array(r);
|
|
2662
|
-
return
|
|
2670
|
+
return Ln(e, t, n, o), o;
|
|
2663
2671
|
}
|
|
2664
|
-
return i && (
|
|
2672
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Array(r);
|
|
2665
2673
|
}
|
|
2666
|
-
return _ &&
|
|
2667
|
-
}, exports.kw_get_local_storage_value =
|
|
2668
|
-
e && !
|
|
2669
|
-
let s =
|
|
2670
|
-
const i = o && o &
|
|
2674
|
+
return _ && Dn(e, t, n), pn(s) ? Array(s) : (i && (Bt(`path value MUST BE an array: ${n}`), Ht(t)), Array(r));
|
|
2675
|
+
}, exports.kw_get_local_storage_value = Mn, exports.kw_get_pointer = In, exports.kw_get_real = function(e, t, n, r, o) {
|
|
2676
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2677
|
+
let s = wn(e, t, n, !1);
|
|
2678
|
+
const i = o && o & $t.KW_REQUIRED, l = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2671
2679
|
if (void 0 === s) {
|
|
2672
2680
|
if (l) {
|
|
2673
2681
|
let o = Number(r);
|
|
2674
|
-
return
|
|
2682
|
+
return Ln(e, t, n, o), o;
|
|
2675
2683
|
}
|
|
2676
|
-
return i && (
|
|
2684
|
+
return i && (Bt(`path not found: '${n}'`), zt(t)), Number(r);
|
|
2677
2685
|
}
|
|
2678
|
-
return _ &&
|
|
2679
|
-
}, exports.kw_get_str =
|
|
2680
|
-
if (e && !
|
|
2681
|
-
r || (r =
|
|
2686
|
+
return _ && Dn(e, t, n), bn(s) ? Number(s) : (i && (Bt(`path value MUST BE a number: ${n}`), Ht(t)), Number(r));
|
|
2687
|
+
}, exports.kw_get_str = kn, exports.kw_has_key = Rn, exports.kw_match_simple = Fn, exports.kw_pop = Nn, exports.kw_remove_local_storage_value = Kn, exports.kw_select = function(e, t, n, r) {
|
|
2688
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
2689
|
+
r || (r = Fn);
|
|
2682
2690
|
let o = [];
|
|
2683
|
-
if (
|
|
2691
|
+
if (pn(t)) for (let e = 0; e < t.length; e++) {
|
|
2684
2692
|
let s = t[e];
|
|
2685
|
-
r(s, n) && o.push(
|
|
2693
|
+
r(s, n) && o.push(Qt(s));
|
|
2686
2694
|
}
|
|
2687
2695
|
else {
|
|
2688
|
-
if (!
|
|
2689
|
-
r(t, n) && o.push(
|
|
2696
|
+
if (!gn(t)) return Bt("kw_select() BAD kw parameter"), null;
|
|
2697
|
+
r(t, n) && o.push(Qt(t));
|
|
2690
2698
|
}
|
|
2691
2699
|
return o;
|
|
2692
|
-
}, exports.kw_set_dict_value =
|
|
2693
|
-
e && !
|
|
2694
|
-
let s =
|
|
2700
|
+
}, exports.kw_set_dict_value = Ln, exports.kw_set_local_storage_value = Wn, exports.kw_set_subdict_value = Pn, exports.kwid_collect = Bn, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2701
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2702
|
+
let s = Bn(e, t, n, r, o);
|
|
2695
2703
|
return s.length > 0 ? s[0] : null;
|
|
2696
2704
|
}, exports.kwid_get_ids = function(e, t) {
|
|
2697
|
-
if (e && !
|
|
2705
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return [];
|
|
2698
2706
|
let n = [];
|
|
2699
|
-
if (
|
|
2700
|
-
else if (
|
|
2701
|
-
else
|
|
2702
|
-
if (
|
|
2703
|
-
else if (
|
|
2704
|
-
let r =
|
|
2707
|
+
if (dn(t)) n.push(t);
|
|
2708
|
+
else if (gn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2709
|
+
else pn(t) && t.forEach(function(t) {
|
|
2710
|
+
if (dn(t)) yn(t) || n.push(t);
|
|
2711
|
+
else if (gn(t)) {
|
|
2712
|
+
let r = kn(e, t, "id", 0, 0);
|
|
2705
2713
|
r && n.push(r);
|
|
2706
2714
|
}
|
|
2707
2715
|
});
|
|
2708
2716
|
return n;
|
|
2709
|
-
}, exports.kwid_match_id =
|
|
2710
|
-
e && !
|
|
2717
|
+
}, exports.kwid_match_id = Yn, exports.kwid_new_dict = function(e, t, n) {
|
|
2718
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2711
2719
|
let r = {};
|
|
2712
|
-
if (
|
|
2713
|
-
else if (
|
|
2714
|
-
let o = t[n], s =
|
|
2715
|
-
|
|
2720
|
+
if (yn(n) || (t = wn(e, t, n)), gn(t)) r = t;
|
|
2721
|
+
else if (pn(t)) for (let n = 0; n < t.length; n++) {
|
|
2722
|
+
let o = t[n], s = kn(e, o, "id", "", 0);
|
|
2723
|
+
yn(s) || (r[s] = o);
|
|
2716
2724
|
}
|
|
2717
|
-
else
|
|
2725
|
+
else Bt(`${Fe(e)} kwid_new_dict: data type unknown`);
|
|
2718
2726
|
return r;
|
|
2719
2727
|
}, exports.list2options = function(e, t, n) {
|
|
2720
2728
|
t = t || "id", n = n || "value";
|
|
2721
2729
|
let r = [];
|
|
2722
|
-
if (
|
|
2730
|
+
if (pn(e)) for (let o = 0; o < e.length; o++) {
|
|
2723
2731
|
let s = e[o];
|
|
2724
|
-
if (
|
|
2732
|
+
if (dn(s)) r.push({
|
|
2725
2733
|
id: e[o],
|
|
2726
2734
|
value: e[o]
|
|
2727
2735
|
});
|
|
2728
|
-
else if (
|
|
2736
|
+
else if (gn(s)) {
|
|
2729
2737
|
let e = {};
|
|
2730
|
-
if (
|
|
2731
|
-
if (!
|
|
2732
|
-
if (!(
|
|
2733
|
-
|
|
2738
|
+
if (Rn(s, t)) {
|
|
2739
|
+
if (!Rn(s, n)) {
|
|
2740
|
+
if (!(fn(s) > 0)) {
|
|
2741
|
+
Bt("list2options(): object without field value: " + n);
|
|
2734
2742
|
continue;
|
|
2735
2743
|
}
|
|
2736
2744
|
n = Object.keys(s)[0];
|
|
2737
2745
|
}
|
|
2738
2746
|
e.id = s[t], e.value = s[n];
|
|
2739
2747
|
} else {
|
|
2740
|
-
if (!(
|
|
2741
|
-
|
|
2748
|
+
if (!(fn(s) > 0)) {
|
|
2749
|
+
Bt("list2options(): object without field id: " + t);
|
|
2742
2750
|
continue;
|
|
2743
2751
|
}
|
|
2744
2752
|
t = Object.keys(s)[0], e.id = t, e.value = s[t];
|
|
2745
2753
|
}
|
|
2746
2754
|
r.push(e);
|
|
2747
|
-
} else
|
|
2755
|
+
} else Bt("list2options(): case1 not implemented");
|
|
2748
2756
|
}
|
|
2749
|
-
else if (
|
|
2757
|
+
else if (gn(e)) for (let t of Object.keys(e)) r.push({
|
|
2750
2758
|
id: t,
|
|
2751
2759
|
value: t
|
|
2752
2760
|
});
|
|
2753
|
-
else
|
|
2761
|
+
else Bt("list2options(): case2 not implemented");
|
|
2754
2762
|
return r;
|
|
2755
2763
|
}, exports.load_json_file = function(e, t, n) {
|
|
2756
2764
|
let r = new XMLHttpRequest();
|
|
@@ -2758,18 +2766,18 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2758
2766
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2759
2767
|
t(JSON.parse(r.responseText));
|
|
2760
2768
|
} catch (e) {
|
|
2761
|
-
n && (
|
|
2769
|
+
n && (Bt(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2762
2770
|
}
|
|
2763
2771
|
else n && n(r.status);
|
|
2764
2772
|
var e;
|
|
2765
2773
|
}, r.send();
|
|
2766
|
-
}, exports.log_debug =
|
|
2767
|
-
let t =
|
|
2768
|
-
|
|
2769
|
-
}, exports.log_warning =
|
|
2774
|
+
}, exports.log_debug = qt, exports.log_error = Bt, exports.log_info = function(e) {
|
|
2775
|
+
let t = Yt(e), n = ir();
|
|
2776
|
+
Ut && Vt && Ut("%c" + n + " INFO: " + String(t), "color:cyan"), Wt("info", t, n);
|
|
2777
|
+
}, exports.log_warning = Jt, exports.msg_iev_get_msg_type = er, exports.msg_iev_get_stack = Xn, exports.msg_iev_push_stack = Qn, exports.msg_iev_read_key = Hn, exports.msg_iev_set_msg_type = Zn, exports.msg_iev_write_key = zn, exports.node_uuid = _r, exports.parseBoolean = vn, exports.parseSVG = function(e) {
|
|
2770
2778
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2771
2779
|
}, exports.refresh_language = function(e, t) {
|
|
2772
|
-
|
|
2780
|
+
Tn(t) ? (e || (e = document), e.querySelectorAll("[data-i18n]").forEach(function(e) {
|
|
2773
2781
|
let n = e.getAttribute("data-i18n");
|
|
2774
2782
|
for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
|
|
2775
2783
|
n || (n = r.nodeValue), r.nodeValue = t(n);
|
|
@@ -2784,25 +2792,25 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2784
2792
|
}), e.querySelectorAll("[data-i18n-placeholder]").forEach(function(e) {
|
|
2785
2793
|
let n = e.getAttribute("data-i18n-placeholder");
|
|
2786
2794
|
n && e.setAttribute("placeholder", t(n));
|
|
2787
|
-
})) :
|
|
2795
|
+
})) : Bt("You must supply a translation function");
|
|
2788
2796
|
}, exports.register_c_ievent_cli = function() {
|
|
2789
2797
|
return function(e) {
|
|
2790
|
-
if (
|
|
2798
|
+
if (kr) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2791
2799
|
const t = [
|
|
2792
2800
|
["ST_DISCONNECTED", [
|
|
2793
2801
|
[
|
|
2794
2802
|
"EV_ON_OPEN",
|
|
2795
|
-
|
|
2803
|
+
Mr,
|
|
2796
2804
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2797
2805
|
],
|
|
2798
2806
|
[
|
|
2799
2807
|
"EV_ON_CLOSE",
|
|
2800
|
-
|
|
2808
|
+
Wr,
|
|
2801
2809
|
null
|
|
2802
2810
|
],
|
|
2803
2811
|
[
|
|
2804
2812
|
"EV_TIMEOUT",
|
|
2805
|
-
|
|
2813
|
+
Vr,
|
|
2806
2814
|
null
|
|
2807
2815
|
],
|
|
2808
2816
|
[
|
|
@@ -2814,22 +2822,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2814
2822
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
2815
2823
|
[
|
|
2816
2824
|
"EV_ON_MESSAGE",
|
|
2817
|
-
|
|
2825
|
+
Br,
|
|
2818
2826
|
null
|
|
2819
2827
|
],
|
|
2820
2828
|
[
|
|
2821
2829
|
"EV_IDENTITY_CARD_ACK",
|
|
2822
|
-
|
|
2830
|
+
Yr,
|
|
2823
2831
|
null
|
|
2824
2832
|
],
|
|
2825
2833
|
[
|
|
2826
2834
|
"EV_ON_CLOSE",
|
|
2827
|
-
|
|
2835
|
+
Wr,
|
|
2828
2836
|
"ST_DISCONNECTED"
|
|
2829
2837
|
],
|
|
2830
2838
|
[
|
|
2831
2839
|
"EV_TIMEOUT",
|
|
2832
|
-
|
|
2840
|
+
Kr,
|
|
2833
2841
|
null
|
|
2834
2842
|
],
|
|
2835
2843
|
[
|
|
@@ -2841,22 +2849,22 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2841
2849
|
["ST_SESSION", [
|
|
2842
2850
|
[
|
|
2843
2851
|
"EV_ON_MESSAGE",
|
|
2844
|
-
|
|
2852
|
+
Br,
|
|
2845
2853
|
null
|
|
2846
2854
|
],
|
|
2847
2855
|
[
|
|
2848
2856
|
"EV_MT_STATS",
|
|
2849
|
-
|
|
2857
|
+
Jr,
|
|
2850
2858
|
null
|
|
2851
2859
|
],
|
|
2852
2860
|
[
|
|
2853
2861
|
"EV_MT_COMMAND",
|
|
2854
|
-
|
|
2862
|
+
qr,
|
|
2855
2863
|
null
|
|
2856
2864
|
],
|
|
2857
2865
|
[
|
|
2858
2866
|
"EV_ON_CLOSE",
|
|
2859
|
-
|
|
2867
|
+
Wr,
|
|
2860
2868
|
"ST_DISCONNECTED"
|
|
2861
2869
|
],
|
|
2862
2870
|
[
|
|
@@ -2867,7 +2875,7 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2867
2875
|
]],
|
|
2868
2876
|
[null, null]
|
|
2869
2877
|
];
|
|
2870
|
-
return (
|
|
2878
|
+
return (kr = ee(e, [
|
|
2871
2879
|
["EV_ON_MESSAGE", w.EVF_OUTPUT_EVENT],
|
|
2872
2880
|
["EV_IDENTITY_CARD_ACK", w.EVF_PUBLIC_EVENT],
|
|
2873
2881
|
["EV_ON_ID_NAK", w.EVF_PUBLIC_EVENT | w.EVF_OUTPUT_EVENT],
|
|
@@ -2878,52 +2886,52 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2878
2886
|
["EV_ON_OPEN_ERROR", w.EVF_OUTPUT_EVENT | w.EVF_NO_WARN_SUBS],
|
|
2879
2887
|
["EV_TIMEOUT", 0],
|
|
2880
2888
|
[null, 0]
|
|
2881
|
-
], t,
|
|
2889
|
+
], t, Hr, 0, xr, Ar, 0, 0, 0, O.gcflag_no_check_output_events)) ? 0 : -1;
|
|
2882
2890
|
}("C_IEVENT_CLI");
|
|
2883
2891
|
}, exports.register_c_timer = function() {
|
|
2884
2892
|
return function(e) {
|
|
2885
|
-
if (
|
|
2893
|
+
if (Er) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2886
2894
|
const t = [["ST_IDLE", [[
|
|
2887
2895
|
"EV_TIMEOUT",
|
|
2888
|
-
|
|
2896
|
+
Tr,
|
|
2889
2897
|
null
|
|
2890
2898
|
]]]];
|
|
2891
|
-
return (
|
|
2899
|
+
return (Er = ee(e, [
|
|
2892
2900
|
["EV_TIMEOUT", w.EVF_OUTPUT_EVENT],
|
|
2893
2901
|
["EV_TIMEOUT_PERIODIC", w.EVF_OUTPUT_EVENT],
|
|
2894
2902
|
[0, 0]
|
|
2895
|
-
], t,
|
|
2903
|
+
], t, hr, 0, br, mr, 0, 0, 0, O.gcflag_manual_start)) ? 0 : -1;
|
|
2896
2904
|
}("C_TIMER");
|
|
2897
2905
|
}, exports.register_c_yuno = function() {
|
|
2898
2906
|
return function(e) {
|
|
2899
|
-
if (
|
|
2907
|
+
if (Nr) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2900
2908
|
const t = [["ST_IDLE", [[
|
|
2901
2909
|
"EV_TIMEOUT_PERIODIC",
|
|
2902
|
-
|
|
2910
|
+
Rr,
|
|
2903
2911
|
null
|
|
2904
2912
|
]]]];
|
|
2905
|
-
return (
|
|
2913
|
+
return (Nr = ee(e, [["EV_TIMEOUT_PERIODIC", w.EVF_OUTPUT_EVENT | w.EVF_NO_WARN_SUBS], [0, 0]], t, wr, 0, Sr, Or, 0, 0, 0, 0)) ? 0 : -1;
|
|
2906
2914
|
}("C_YUNO");
|
|
2907
2915
|
}, exports.safeSrc = function(e) {
|
|
2908
2916
|
if (!e) return "";
|
|
2909
2917
|
const t = String(e).trim();
|
|
2910
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2918
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : or(t);
|
|
2911
2919
|
}, exports.sdata_flag_t = T, exports.send_http_json_post = function(e, t, n) {
|
|
2912
2920
|
let r = new XMLHttpRequest();
|
|
2913
2921
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2914
2922
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2915
2923
|
}, r.send(t);
|
|
2916
2924
|
}, exports.set_console_log_enabled = function(e) {
|
|
2917
|
-
|
|
2925
|
+
Vt = !!e;
|
|
2918
2926
|
}, exports.set_log_callback = function(e) {
|
|
2919
|
-
|
|
2920
|
-
}, exports.set_remote_log_functions =
|
|
2927
|
+
Gt = "function" == typeof e ? e : null;
|
|
2928
|
+
}, exports.set_remote_log_functions = Kt, exports.set_timeout = yr, exports.set_timeout_periodic = vr, exports.sprintf = t, exports.stats_parser = function(e, t, n, r) {}, exports.str_in_list = qn, exports.strcasecmp = Sn, exports.strcmp = jn, exports.strncmp = function(e, t, n) {
|
|
2921
2929
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
2922
2930
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
2923
2931
|
}, exports.strs_in_list = function(e, t, n) {
|
|
2924
|
-
if (!e) return
|
|
2925
|
-
if (!t) return
|
|
2926
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2932
|
+
if (!e) return Bt("ERROR: strs_in_list() list empty"), !1;
|
|
2933
|
+
if (!t) return Bt("ERROR: strs_in_list() str empty"), !1;
|
|
2934
|
+
for (let r = 0; r < t.length; r++) if (qn(e, t[r], n)) return !0;
|
|
2927
2935
|
return !1;
|
|
2928
2936
|
}, exports.strstr = function(e, t, n) {
|
|
2929
2937
|
var r;
|
|
@@ -2942,13 +2950,13 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2942
2950
|
placeholder: void 0,
|
|
2943
2951
|
fkey: null
|
|
2944
2952
|
};
|
|
2945
|
-
if (
|
|
2953
|
+
if (dn(t)) {
|
|
2946
2954
|
let e = t.split(".");
|
|
2947
2955
|
for (let t = 0; t < e.length; t++) {
|
|
2948
2956
|
let r = e[t];
|
|
2949
|
-
if (
|
|
2950
|
-
else if (
|
|
2951
|
-
else if (
|
|
2957
|
+
if (qn(fr, r)) n.real_type || (n.real_type = r);
|
|
2958
|
+
else if (qn(pr, r)) n.type || (n.type = r);
|
|
2959
|
+
else if (qn(gr, r)) switch (r) {
|
|
2952
2960
|
case "writable":
|
|
2953
2961
|
n.is_writable = !0;
|
|
2954
2962
|
break;
|
|
@@ -2960,23 +2968,23 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2960
2968
|
}
|
|
2961
2969
|
}
|
|
2962
2970
|
n.real_type || (n.real_type = "string");
|
|
2963
|
-
} else
|
|
2971
|
+
} else gn(t) ? (n = dr(t), n.name || (n.name = e), n.header || (n.header = e)) : pn(t) && (n.real_type = "array", n.enum_list = t);
|
|
2964
2972
|
return n.type || (n.type = n.real_type), n;
|
|
2965
2973
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
2966
2974
|
const n = e, r = performance.now();
|
|
2967
2975
|
let o = r;
|
|
2968
|
-
return t &&
|
|
2976
|
+
return t && Jt(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
2969
2977
|
const i = performance.now(), l = (i - o) / 1e3, _ = (i - r) / 1e3;
|
|
2970
|
-
return t &&
|
|
2978
|
+
return t && Jt(`--\x3e ${n} ${e} - partial: ${l} sec, total: ${_} sec, ${s}`), o = i, {
|
|
2971
2979
|
partial: l,
|
|
2972
2980
|
total: _
|
|
2973
2981
|
};
|
|
2974
2982
|
} };
|
|
2975
|
-
}, exports.trace_json =
|
|
2976
|
-
if (
|
|
2983
|
+
}, exports.trace_json = zt, exports.trace_level_t = C, exports.trace_msg = Ht, exports.treedb_decoder_fkey = cr, exports.treedb_decoder_hook = function(e, t) {
|
|
2984
|
+
if (dn(t)) {
|
|
2977
2985
|
if (-1 === t.indexOf("^")) {
|
|
2978
2986
|
let n, r = e.hook;
|
|
2979
|
-
if (1 !==
|
|
2987
|
+
if (1 !== un(r)) return Bt("bad hook 1"), Bt(e), Bt(t), null;
|
|
2980
2988
|
for (let e of Object.keys(r)) {
|
|
2981
2989
|
n = e, r[e];
|
|
2982
2990
|
break;
|
|
@@ -2988,27 +2996,27 @@ exports.GObj = S, exports.SDATA = v, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2988
2996
|
}
|
|
2989
2997
|
{
|
|
2990
2998
|
let n = t.split("^");
|
|
2991
|
-
return 2 !== n.length ? (
|
|
2999
|
+
return 2 !== n.length ? (Bt("bad hook 2"), Bt(e), Bt(t), null) : {
|
|
2992
3000
|
topic_name: n[0],
|
|
2993
3001
|
id: n[1]
|
|
2994
3002
|
};
|
|
2995
3003
|
}
|
|
2996
3004
|
}
|
|
2997
|
-
return
|
|
3005
|
+
return gn(t) ? {
|
|
2998
3006
|
topic_name: t.topic_name,
|
|
2999
3007
|
id: t.id
|
|
3000
|
-
} : (
|
|
3008
|
+
} : (Bt("bad hook 3"), Bt(e), Bt(t), null);
|
|
3001
3009
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3002
|
-
let n =
|
|
3010
|
+
let n = cr(e, t);
|
|
3003
3011
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3004
|
-
}, exports.treedb_get_field_desc =
|
|
3005
|
-
if (
|
|
3012
|
+
}, exports.treedb_get_field_desc = dr, exports.treedb_hook_data_size = function(e) {
|
|
3013
|
+
if (pn(e) && 1 === fn(e)) {
|
|
3006
3014
|
let t = e[0];
|
|
3007
|
-
return
|
|
3015
|
+
return Rn(t, "size") ? t.size : 1;
|
|
3008
3016
|
}
|
|
3009
|
-
return
|
|
3017
|
+
return fn(e);
|
|
3010
3018
|
}, exports.vsprintf = function(e, n) {
|
|
3011
3019
|
return t.apply(null, [e].concat(n || []));
|
|
3012
|
-
};
|
|
3020
|
+
}, exports.walk_type_t = D;
|
|
3013
3021
|
|
|
3014
3022
|
//# sourceMappingURL=gobj-js.cjs.min.js.map
|