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