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