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