@yuneta/gobj-js 7.26.1 → 7.26.3
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 +129 -36
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +1013 -978
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +126 -37
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +394 -357
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +129 -36
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +1070 -1035
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +129 -36
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +1070 -1035
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +3 -3
package/dist/gobj-js.iife.min.js
CHANGED
|
@@ -130,7 +130,7 @@ var gobjJs = function(e) {
|
|
|
130
130
|
data: l || []
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = Object.create(null), p = null, m = null, h = 0,
|
|
133
|
+
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = Object.create(null), p = null, m = null, h = 0, y = Object.freeze({
|
|
134
134
|
DTP_STRING: 1,
|
|
135
135
|
DTP_BOOLEAN: 2,
|
|
136
136
|
DTP_INTEGER: 3,
|
|
@@ -140,8 +140,8 @@ var gobjJs = function(e) {
|
|
|
140
140
|
DTP_JSON: 7,
|
|
141
141
|
DTP_POINTER: 8
|
|
142
142
|
});
|
|
143
|
-
|
|
144
|
-
var
|
|
143
|
+
y.DTP_POINTER;
|
|
144
|
+
var E = Object.freeze({
|
|
145
145
|
SDF_NOTACCESS: 1,
|
|
146
146
|
SDF_RD: 2,
|
|
147
147
|
SDF_WR: 4,
|
|
@@ -164,7 +164,7 @@ var gobjJs = function(e) {
|
|
|
164
164
|
SDF_AUTHZ_S: 524288,
|
|
165
165
|
SDF_AUTHZ_RS: 1048576
|
|
166
166
|
});
|
|
167
|
-
|
|
167
|
+
E.SDF_RD, E.SDF_WR, E.SDF_STATS, E.SDF_PERSIST, E.SDF_VOLATIL, E.SDF_RSTATS, E.SDF_PSTATS, E.SDF_WR, E.SDF_PERSIST;
|
|
168
168
|
var T = class {
|
|
169
169
|
constructor(e, t, n = 0, r = null, l = "", o = null, s = null, i = 0, _ = null, a = null, u = null) {
|
|
170
170
|
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = s, this.fillspace = i, this.description = l, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
@@ -175,7 +175,7 @@ var gobjJs = function(e) {
|
|
|
175
175
|
}
|
|
176
176
|
}, S = class {
|
|
177
177
|
constructor(e, t, n, r, l) {
|
|
178
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
178
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 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 = Fn(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
179
179
|
}
|
|
180
180
|
}, w = Object.freeze({
|
|
181
181
|
gcflag_manual_start: 1,
|
|
@@ -195,12 +195,12 @@ var gobjJs = function(e) {
|
|
|
195
195
|
obflag_destroying: 1,
|
|
196
196
|
obflag_destroyed: 2,
|
|
197
197
|
obflag_created: 4
|
|
198
|
-
}),
|
|
198
|
+
}), $ = Object.freeze({
|
|
199
199
|
EVF_NO_WARN_SUBS: 1,
|
|
200
200
|
EVF_OUTPUT_EVENT: 2,
|
|
201
201
|
EVF_SYSTEM_EVENT: 4,
|
|
202
202
|
EVF_PUBLIC_EVENT: 8
|
|
203
|
-
}),
|
|
203
|
+
}), D = Object.freeze({
|
|
204
204
|
WALK_TOP2BOTTOM: 1,
|
|
205
205
|
WALK_BOTTOM2TOP: 2,
|
|
206
206
|
WALK_BYLEVEL: 4,
|
|
@@ -221,7 +221,7 @@ var gobjJs = function(e) {
|
|
|
221
221
|
};
|
|
222
222
|
var C = 1;
|
|
223
223
|
function L(e) {
|
|
224
|
-
|
|
224
|
+
Zn(e) && (e = JSON.stringify(e)), En(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
225
225
|
}
|
|
226
226
|
var P = Object.freeze({
|
|
227
227
|
TRACE_MACHINE: 65536,
|
|
@@ -323,7 +323,7 @@ var gobjJs = function(e) {
|
|
|
323
323
|
return n;
|
|
324
324
|
}
|
|
325
325
|
function W(e, t, n) {
|
|
326
|
-
if (
|
|
326
|
+
if (ir(e)) return void 0 === n ? 268369920 : 65535;
|
|
327
327
|
if (/^[0-9]+$/.test(String(e))) {
|
|
328
328
|
const t = Number(e);
|
|
329
329
|
if (t) return t;
|
|
@@ -334,7 +334,7 @@ var gobjJs = function(e) {
|
|
|
334
334
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
335
335
|
}
|
|
336
336
|
return 0;
|
|
337
|
-
}(String(e), n) || (
|
|
337
|
+
}(String(e), n) || (hn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
338
338
|
}
|
|
339
339
|
function x(e) {
|
|
340
340
|
if (G) return 4294967295;
|
|
@@ -390,32 +390,32 @@ var gobjJs = function(e) {
|
|
|
390
390
|
return M(V, null);
|
|
391
391
|
}
|
|
392
392
|
function re(e) {
|
|
393
|
-
const t =
|
|
394
|
-
return t ? M(t.trace_level | F, t.s_user_trace_level) : (
|
|
393
|
+
const t = tr(e) ? Oe(e) : e;
|
|
394
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (hn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
395
395
|
}
|
|
396
396
|
function le(e) {
|
|
397
|
-
const t =
|
|
398
|
-
return t ? M(t.trace_level, t.s_user_trace_level) : (
|
|
397
|
+
const t = tr(e) ? Oe(e) : e;
|
|
398
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (hn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
399
399
|
}
|
|
400
400
|
function oe(e) {
|
|
401
|
-
const t =
|
|
402
|
-
return t ? M(t.no_trace_level, t.s_user_trace_level) : (
|
|
401
|
+
const t = tr(e) ? Oe(e) : e;
|
|
402
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (hn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
403
403
|
}
|
|
404
404
|
function se(e, t, n) {
|
|
405
|
-
const r =
|
|
406
|
-
if (!r) return
|
|
405
|
+
const r = tr(e) ? Oe(e) : e;
|
|
406
|
+
if (!r) return hn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
407
407
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
408
408
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
409
409
|
}
|
|
410
410
|
function ie(e, t, n) {
|
|
411
|
-
const r =
|
|
412
|
-
if (!r) return
|
|
411
|
+
const r = tr(e) ? Oe(e) : e;
|
|
412
|
+
if (!r) return hn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
413
413
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
414
414
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
415
415
|
}
|
|
416
416
|
function _e(e, t) {
|
|
417
417
|
let n = {};
|
|
418
|
-
if (!
|
|
418
|
+
if (!er(t)) return hn("sdata_desc MUST be an array"), vn(t), n;
|
|
419
419
|
for (let r = 0; r < t.length; r++) {
|
|
420
420
|
const l = t[r];
|
|
421
421
|
l.name && ae(e, n, l);
|
|
@@ -425,89 +425,89 @@ var gobjJs = function(e) {
|
|
|
425
425
|
function ae(e, t, n) {
|
|
426
426
|
let r, l = n.default_value;
|
|
427
427
|
switch (n.type) {
|
|
428
|
-
case
|
|
428
|
+
case y.DTP_STRING:
|
|
429
429
|
r = String(l);
|
|
430
430
|
break;
|
|
431
|
-
case
|
|
432
|
-
r =
|
|
431
|
+
case y.DTP_BOOLEAN:
|
|
432
|
+
r = _r(l);
|
|
433
433
|
break;
|
|
434
|
-
case
|
|
435
|
-
r = parseInt(l), isNaN(r) &&
|
|
434
|
+
case y.DTP_INTEGER:
|
|
435
|
+
r = parseInt(l), isNaN(r) && hn(`${et(e)}: attr NaN: ${n.name}`);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
438
|
-
r = Number(l), isNaN(r) &&
|
|
437
|
+
case y.DTP_REAL:
|
|
438
|
+
r = Number(l), isNaN(r) && hn(`${et(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
|
-
case
|
|
441
|
-
if (
|
|
440
|
+
case y.DTP_LIST:
|
|
441
|
+
if (tr(l)) try {
|
|
442
442
|
r = JSON.parse(l);
|
|
443
443
|
} catch (e) {
|
|
444
|
-
|
|
444
|
+
hn(`JSON parse error: ${e.message}`);
|
|
445
445
|
}
|
|
446
446
|
else r = l;
|
|
447
|
-
|
|
447
|
+
er(r) || (r = []);
|
|
448
448
|
break;
|
|
449
|
-
case
|
|
450
|
-
if (
|
|
449
|
+
case y.DTP_DICT:
|
|
450
|
+
if (tr(l)) try {
|
|
451
451
|
r = JSON.parse(l);
|
|
452
452
|
} catch (e) {
|
|
453
|
-
|
|
453
|
+
hn(`JSON parse error: ${e.message}`);
|
|
454
454
|
}
|
|
455
455
|
else r = l;
|
|
456
|
-
|
|
456
|
+
Zn(r) || (r = {});
|
|
457
457
|
break;
|
|
458
|
-
case
|
|
458
|
+
case y.DTP_JSON:
|
|
459
459
|
if ("" === l || void 0 === l) r = null;
|
|
460
|
-
else if (
|
|
460
|
+
else if (tr(l)) try {
|
|
461
461
|
r = JSON.parse(l);
|
|
462
462
|
} catch (e) {
|
|
463
|
-
|
|
463
|
+
hn(`JSON parse error: ${e.message}`);
|
|
464
464
|
}
|
|
465
465
|
else r = l;
|
|
466
466
|
break;
|
|
467
|
-
case
|
|
467
|
+
case y.DTP_POINTER: r = l;
|
|
468
468
|
}
|
|
469
|
-
return void 0 === r && (
|
|
469
|
+
return void 0 === r && (hn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
470
470
|
}
|
|
471
471
|
function ue(e, t, n, r) {
|
|
472
472
|
let l;
|
|
473
473
|
switch (n.type) {
|
|
474
|
-
case
|
|
474
|
+
case y.DTP_STRING:
|
|
475
475
|
if (null == r) l = "";
|
|
476
|
-
else if (
|
|
476
|
+
else if (tr(r)) l = String(r);
|
|
477
477
|
else {
|
|
478
478
|
let e = JSON.stringify(r);
|
|
479
479
|
e && (l = String(e));
|
|
480
480
|
}
|
|
481
481
|
break;
|
|
482
|
-
case
|
|
483
|
-
l =
|
|
482
|
+
case y.DTP_BOOLEAN:
|
|
483
|
+
l = _r(r);
|
|
484
484
|
break;
|
|
485
|
-
case
|
|
486
|
-
if (l = parseInt(r), isNaN(l)) return
|
|
485
|
+
case y.DTP_INTEGER:
|
|
486
|
+
if (l = parseInt(r), isNaN(l)) return hn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
487
487
|
break;
|
|
488
|
-
case
|
|
489
|
-
if (l = Number(r), isNaN(l)) return
|
|
488
|
+
case y.DTP_REAL:
|
|
489
|
+
if (l = Number(r), isNaN(l)) return hn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
490
490
|
break;
|
|
491
|
-
case
|
|
492
|
-
if (
|
|
491
|
+
case y.DTP_LIST:
|
|
492
|
+
if (tr(r)) try {
|
|
493
493
|
l = JSON.parse(r);
|
|
494
494
|
} catch (e) {
|
|
495
|
-
|
|
495
|
+
hn(`JSON parse error: ${e.message}`);
|
|
496
496
|
}
|
|
497
497
|
else l = r;
|
|
498
|
-
if (!
|
|
498
|
+
if (!er(l)) return hn(`attr must be an array: ${n.name}`), -1;
|
|
499
499
|
break;
|
|
500
|
-
case
|
|
501
|
-
if (
|
|
500
|
+
case y.DTP_DICT:
|
|
501
|
+
if (tr(r)) try {
|
|
502
502
|
l = JSON.parse(r);
|
|
503
503
|
} catch (e) {
|
|
504
|
-
|
|
504
|
+
hn(`JSON parse error: ${e.message}`);
|
|
505
505
|
}
|
|
506
506
|
else l = r;
|
|
507
|
-
if (!
|
|
507
|
+
if (!Zn(l)) return hn(`attr must be an object: ${n.name}`), -1;
|
|
508
508
|
break;
|
|
509
|
-
case
|
|
510
|
-
if (l = r,
|
|
509
|
+
case y.DTP_JSON:
|
|
510
|
+
if (l = r, tr(r)) {
|
|
511
511
|
const e = r.trim();
|
|
512
512
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
513
513
|
l = JSON.parse(e);
|
|
@@ -516,48 +516,48 @@ var gobjJs = function(e) {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
break;
|
|
519
|
-
case
|
|
519
|
+
case y.DTP_POINTER: l = r;
|
|
520
520
|
}
|
|
521
|
-
return void 0 === l &&
|
|
521
|
+
return void 0 === l && hn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = l), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
522
522
|
}
|
|
523
523
|
function ce(e) {
|
|
524
524
|
return e.jn_attrs;
|
|
525
525
|
}
|
|
526
526
|
function fe(e, t, n) {
|
|
527
|
-
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n &&
|
|
527
|
+
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n && hn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`), null);
|
|
528
528
|
}
|
|
529
529
|
function ge(e, t, n) {
|
|
530
|
-
if (!(e && e instanceof O)) return n &&
|
|
530
|
+
if (!(e && e instanceof O)) return n && hn("gclass NULL"), null;
|
|
531
531
|
if (!t) return e.attrs_table;
|
|
532
532
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
533
533
|
const r = e.attrs_table[n];
|
|
534
534
|
if (r.name && r.name === t) return r;
|
|
535
535
|
}
|
|
536
|
-
return n &&
|
|
536
|
+
return n && hn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
537
537
|
}
|
|
538
538
|
function de(e, t, n, r, l, o, s, i, _, a, u) {
|
|
539
|
-
if (
|
|
540
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
541
|
-
if (Oe(e)) return
|
|
539
|
+
if (ir(e)) return hn("gclass_name EMPTY"), null;
|
|
540
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return hn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
541
|
+
if (Oe(e)) return hn(`GClass ALREADY exists: ${e}`), null;
|
|
542
542
|
let c = new O(e, r, l, o, s, i, _, a, u);
|
|
543
543
|
(function(e, t) {
|
|
544
|
-
e && e instanceof O ? t ? d[t] ?
|
|
544
|
+
e && e instanceof O ? t ? d[t] ? hn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : hn("gclass_name undefined") : hn("gclass undefined");
|
|
545
545
|
})(c, e);
|
|
546
546
|
const f = n.length;
|
|
547
547
|
for (let e = 0; e < f; e++) {
|
|
548
548
|
let t = n[e][0], r = n[e][1];
|
|
549
|
-
if (
|
|
549
|
+
if (ir(t)) continue;
|
|
550
550
|
if (he(c, t) < 0) return be(c), null;
|
|
551
551
|
const l = r.length;
|
|
552
552
|
for (let e = 0; e < l; e++) {
|
|
553
553
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
554
|
-
|
|
554
|
+
ir(n) || ye(c, t, n, l, o);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
for (let e = 0; e < t.length; e++) {
|
|
558
558
|
let n = t[e][0], r = t[e][1];
|
|
559
|
-
if (!
|
|
560
|
-
if (ve(c, n)) return
|
|
559
|
+
if (!ir(n)) {
|
|
560
|
+
if (ve(c, n)) return hn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
561
561
|
Te(c, n, r);
|
|
562
562
|
}
|
|
563
563
|
}
|
|
@@ -569,13 +569,13 @@ var gobjJs = function(e) {
|
|
|
569
569
|
}
|
|
570
570
|
function be(e) {
|
|
571
571
|
let t;
|
|
572
|
-
if (
|
|
572
|
+
if (tr(e)) t = e;
|
|
573
573
|
else {
|
|
574
|
-
if (!(e instanceof O)) return
|
|
574
|
+
if (!(e instanceof O)) return hn("Cannot unregister gclass, type unknown"), -1;
|
|
575
575
|
t = e.gclass_name;
|
|
576
576
|
}
|
|
577
577
|
let n = d[t];
|
|
578
|
-
return n ? n.instances > 0 ? (
|
|
578
|
+
return n ? n.instances > 0 ? (hn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (hn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
579
579
|
}
|
|
580
580
|
function pe(e, t) {
|
|
581
581
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -594,22 +594,22 @@ var gobjJs = function(e) {
|
|
|
594
594
|
return null;
|
|
595
595
|
}
|
|
596
596
|
function he(e, t) {
|
|
597
|
-
return e instanceof O ? pe(e, t) ? (
|
|
597
|
+
return e instanceof O ? pe(e, t) ? (hn(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (hn("Cannot add state, typeof not GClass"), -1);
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
if (!(e instanceof O)) return
|
|
601
|
-
if (
|
|
599
|
+
function ye(e, t, n, r, l) {
|
|
600
|
+
if (!(e instanceof O)) return hn("Cannot add state, typeof not GClass"), -1;
|
|
601
|
+
if (ir(t)) return hn("state_name EMPTY"), -1;
|
|
602
602
|
let o = pe(e, t);
|
|
603
|
-
return o ? me(o, n) ? (
|
|
603
|
+
return o ? me(o, n) ? (hn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (hn(`state not found: ${t}`), -1);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
605
|
+
function Ee(e, t, n) {
|
|
606
|
+
ir(t) || e.push(new I(t, n));
|
|
607
607
|
}
|
|
608
608
|
function Te(e, t, n) {
|
|
609
|
-
return e instanceof O ?
|
|
609
|
+
return e instanceof O ? Ee(e.dl_events, t, n) : (hn("Cannot add state, typeof not GClass"), -1);
|
|
610
610
|
}
|
|
611
611
|
function ve(e, t) {
|
|
612
|
-
if (!(e instanceof O)) return
|
|
612
|
+
if (!(e instanceof O)) return hn("Cannot add state, typeof not GClass"), 0;
|
|
613
613
|
const n = e.dl_events.length, r = e.dl_events;
|
|
614
614
|
for (let e = 0; e < n; e++) {
|
|
615
615
|
let n = r[e];
|
|
@@ -618,25 +618,25 @@ var gobjJs = function(e) {
|
|
|
618
618
|
return null;
|
|
619
619
|
}
|
|
620
620
|
function je(e) {
|
|
621
|
-
if (!(e instanceof O)) return
|
|
621
|
+
if (!(e instanceof O)) return hn("Cannot add state, typeof not GClass"), -1;
|
|
622
622
|
let t = 0;
|
|
623
|
-
|
|
623
|
+
Qn(e.dl_states) || (hn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
624
624
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
625
625
|
let r = e.dl_states[n];
|
|
626
|
-
if (!
|
|
626
|
+
if (!ir(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
627
627
|
let l = r.dl_actions[n];
|
|
628
|
-
|
|
628
|
+
ir(l.event_name) || (ve(e, l.event_name) || (hn(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (pe(e, l.next_state) || (hn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
632
632
|
let r = e.dl_events[n];
|
|
633
|
-
if (!
|
|
633
|
+
if (!ir(r.event_name) && (nr(r.event_flag) || (hn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & $.EVF_OUTPUT_EVENT))) {
|
|
634
634
|
let n = !1;
|
|
635
635
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
636
636
|
let l = e.dl_states[t];
|
|
637
|
-
|
|
637
|
+
ir(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
638
638
|
}
|
|
639
|
-
n || (
|
|
639
|
+
n || (hn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
return t;
|
|
@@ -646,69 +646,69 @@ var gobjJs = function(e) {
|
|
|
646
646
|
try {
|
|
647
647
|
n = d[e];
|
|
648
648
|
} catch (e) {}
|
|
649
|
-
return n || (t &&
|
|
649
|
+
return n || (t && hn(`gclass not found: ${e}`), null);
|
|
650
650
|
}
|
|
651
651
|
function Se() {
|
|
652
652
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
653
653
|
}
|
|
654
654
|
function we(e, t) {
|
|
655
|
-
if (!
|
|
655
|
+
if (!tr(e)) return hn(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
656
656
|
e = e.toLowerCase();
|
|
657
|
-
return b[e] || (t &&
|
|
657
|
+
return b[e] || (t && hn(`gobj service not found: ${e}`), null);
|
|
658
658
|
}
|
|
659
659
|
function Ne(e) {
|
|
660
660
|
let t = Xe(e);
|
|
661
|
-
return t = t.toLowerCase(), b[t] &&
|
|
661
|
+
return t = t.toLowerCase(), b[t] && hn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
662
662
|
}
|
|
663
663
|
function Re(e, t) {
|
|
664
|
-
t.parent &&
|
|
665
|
-
}
|
|
666
|
-
function De(e, t) {
|
|
667
|
-
let n = qr(e.dl_children, t);
|
|
668
|
-
n >= 0 && (qn(e.dl_children, n), t.parent = null);
|
|
664
|
+
t.parent && hn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
669
665
|
}
|
|
670
666
|
function $e(e, t) {
|
|
671
|
-
|
|
667
|
+
let n = el(e.dl_children, t);
|
|
668
|
+
n >= 0 && (Hn(e.dl_children, n), t.parent = null);
|
|
669
|
+
}
|
|
670
|
+
function De(e, t) {
|
|
671
|
+
return Be(e) ? _ ? _(e, t) : -1 : (hn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
672
672
|
}
|
|
673
673
|
function ke(e, t) {
|
|
674
|
-
"__json_config_variables__" !== t &&
|
|
674
|
+
"__json_config_variables__" !== t && hn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`);
|
|
675
675
|
}
|
|
676
676
|
function Ae(e, t, n) {
|
|
677
677
|
let r = t;
|
|
678
678
|
(function(e, t, n, r, l) {
|
|
679
|
-
if (!e || !t) return
|
|
679
|
+
if (!e || !t) return hn("hsdata or kw NULL"), -1;
|
|
680
680
|
let o = 0;
|
|
681
681
|
for (const [s, i] of Object.entries(t)) {
|
|
682
682
|
const t = ge(l.gclass, s, !1);
|
|
683
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
683
|
+
t ? (-1 === n || t.flag & n) && (t.flag & E.SDF_DEPRECATED && yn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
684
684
|
}
|
|
685
685
|
return o;
|
|
686
|
-
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (
|
|
686
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (hn(`${et(e)} json2data() FAILED`), Un(r));
|
|
687
687
|
}
|
|
688
688
|
function Ie(e, t, r, l, o) {
|
|
689
689
|
if (o & N.gobj_flag_yuno) {
|
|
690
|
-
if (p) return
|
|
690
|
+
if (p) return hn("__yuno__ already created"), null;
|
|
691
691
|
o |= N.gobj_flag_service;
|
|
692
692
|
} else {
|
|
693
|
-
if (!l) return
|
|
694
|
-
if (!("string" == typeof l || l instanceof S)) return
|
|
695
|
-
if (
|
|
693
|
+
if (!l) return hn("gobj NEEDS a parent!"), null;
|
|
694
|
+
if (!("string" == typeof l || l instanceof S)) return hn(`BAD TYPE of parent: ${l}`), null;
|
|
695
|
+
if (tr(l)) {
|
|
696
696
|
const e = l;
|
|
697
|
-
if (!(l = we(e))) return
|
|
697
|
+
if (!(l = we(e))) return yn(`parent service not found: ${e}`), null;
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
if (o & N.gobj_flag_service && we(e, !1)) return
|
|
700
|
+
if (o & N.gobj_flag_service && we(e, !1)) return hn(`service ALREADY registered: ${t}^${e}`), null;
|
|
701
701
|
if (o & N.gobj_flag_default_service) {
|
|
702
|
-
if (m) return
|
|
702
|
+
if (m) return hn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
703
703
|
o |= N.gobj_flag_service;
|
|
704
704
|
}
|
|
705
|
-
if (
|
|
705
|
+
if (ir(t)) return hn("gclass_name must be a string"), null;
|
|
706
706
|
let s = Oe(t, !1);
|
|
707
|
-
if (!s) return
|
|
708
|
-
if (!
|
|
709
|
-
if (!
|
|
710
|
-
if (e.includes("`")) return
|
|
711
|
-
if (e.includes("^")) return
|
|
707
|
+
if (!s) return hn(`GClass not registered: ${t}^${e}`), null;
|
|
708
|
+
if (!tr(e)) return hn(`gobj_name must be a string: ${t}`), null;
|
|
709
|
+
if (!ir(e)) {
|
|
710
|
+
if (e.includes("`")) return hn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
711
|
+
if (e.includes("^")) return hn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
712
712
|
}
|
|
713
713
|
let _ = new S(e, s, r, l, o);
|
|
714
714
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
@@ -720,8 +720,8 @@ var gobjJs = function(e) {
|
|
|
720
720
|
return Ie(e, t, n, r, N.gobj_flag_pure_child);
|
|
721
721
|
}
|
|
722
722
|
function Le(e) {
|
|
723
|
-
if (ot(e)) return void
|
|
724
|
-
e.__refs__ > 0 &&
|
|
723
|
+
if (ot(e)) return void hn("gobj NULL or DESTROYED");
|
|
724
|
+
e.__refs__ > 0 && hn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (hn(`Destroying a PLAYING gobj: ${tt(e)}`), xe(e)), e.running && (hn(`Destroying a RUNNING gobj: ${tt(e)}`), Ve(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
725
725
|
if (0 === Lt.length) return;
|
|
726
726
|
for (let t of Lt) t.src === e && (t.src = null);
|
|
727
727
|
Lt = Lt.filter((t) => t.dst !== e);
|
|
@@ -731,8 +731,8 @@ var gobjJs = function(e) {
|
|
|
731
731
|
let r = nt(e);
|
|
732
732
|
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
733
733
|
let t = Xe(e);
|
|
734
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
735
|
-
}(e), e === m && (m = null),
|
|
734
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : hn(`"service NOT found in register": ${t}`);
|
|
735
|
+
}(e), e === m && (m = null), Ht(e, e.dl_subscriptions, !0), Ht(e, e.dl_subscribings, !0), r && ($e(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
736
736
|
let t = e.dl_children.slice();
|
|
737
737
|
for (let e = 0; e < t.length; e++) {
|
|
738
738
|
let n = t[e];
|
|
@@ -741,9 +741,9 @@ var gobjJs = function(e) {
|
|
|
741
741
|
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
742
742
|
}
|
|
743
743
|
function Pe(e) {
|
|
744
|
-
if (ot(e)) return
|
|
745
|
-
if (e.running) return
|
|
746
|
-
if (e.disabled) return
|
|
744
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
745
|
+
if (e.running) return hn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
746
|
+
if (e.disabled) return hn(`${et(e)}: GObj DISABLED`), -1;
|
|
747
747
|
J(e) && L(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
748
748
|
let t = 0;
|
|
749
749
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
@@ -755,9 +755,9 @@ var gobjJs = function(e) {
|
|
|
755
755
|
return e.gclass.gclass_flag & w.gcflag_manual_start || Ye(e) ? 1 : (Ke(e) || Pe(e), 0);
|
|
756
756
|
}
|
|
757
757
|
function Ve(e) {
|
|
758
|
-
if (ot(e)) return
|
|
759
|
-
if (!e.running) return
|
|
760
|
-
e.playing && (
|
|
758
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
759
|
+
if (!e.running) return hn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
760
|
+
e.playing && (yn(`${et(e)}: GObj stopping without previous pause`), xe(e)), J(e) && L(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
761
761
|
let t = 0;
|
|
762
762
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
763
763
|
}
|
|
@@ -765,22 +765,22 @@ var gobjJs = function(e) {
|
|
|
765
765
|
return Ke(e) && Ve(e), 0;
|
|
766
766
|
}
|
|
767
767
|
function Me(e) {
|
|
768
|
-
return ot(e) ? (
|
|
768
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ge, 0, 0);
|
|
769
769
|
}
|
|
770
770
|
function We(e) {
|
|
771
|
-
if (ot(e)) return
|
|
772
|
-
if (e.playing) return
|
|
773
|
-
if (e.disabled) return
|
|
771
|
+
if (ot(e)) return hn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
772
|
+
if (e.playing) return hn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
773
|
+
if (e.disabled) return hn(`${et(e)}: GObj DISABLED`), -1;
|
|
774
774
|
if (!Ke(e)) {
|
|
775
|
-
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return
|
|
776
|
-
|
|
775
|
+
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return hn(`${et(e)}: Cannot play, start not done`), -1;
|
|
776
|
+
yn(`${et(e)}: GObj playing without previous start`), Pe(e);
|
|
777
777
|
}
|
|
778
778
|
J(e) && L(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
779
779
|
let t = 0;
|
|
780
780
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
781
781
|
}
|
|
782
782
|
function xe(e) {
|
|
783
|
-
return ot(e) ? (
|
|
783
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && L(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (hn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
784
784
|
}
|
|
785
785
|
function Ke(e) {
|
|
786
786
|
return !ot(e) && e.running;
|
|
@@ -810,54 +810,54 @@ var gobjJs = function(e) {
|
|
|
810
810
|
return e ? jt(e, "yuno_id") : "";
|
|
811
811
|
}
|
|
812
812
|
function Xe(e) {
|
|
813
|
-
return
|
|
813
|
+
return sr(e) ? e.gobj_name : (hn("gobj bad type"), null);
|
|
814
814
|
}
|
|
815
815
|
function Ze(e) {
|
|
816
|
-
return
|
|
816
|
+
return sr(e) ? e.gclass.gclass_name : (hn("gobj NULL of bad type"), null);
|
|
817
817
|
}
|
|
818
818
|
function et(e) {
|
|
819
|
-
return
|
|
819
|
+
return sr(e) ? e.gclass.gclass_name + "^" + Xe(e) : (hn("gobj bad type"), null);
|
|
820
820
|
}
|
|
821
821
|
function tt(e) {
|
|
822
|
-
if (!
|
|
822
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), null;
|
|
823
823
|
let t = et(e), n = nt(e);
|
|
824
824
|
for (; n;) t = et(n) + "`" + t, n = nt(n);
|
|
825
825
|
return t;
|
|
826
826
|
}
|
|
827
827
|
function nt(e) {
|
|
828
|
-
return
|
|
828
|
+
return sr(e) ? e.parent : (hn("gobj NULL of bad type"), null);
|
|
829
829
|
}
|
|
830
830
|
function rt(e) {
|
|
831
|
-
return
|
|
831
|
+
return sr(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (hn("gobj NULL of bad type"), null);
|
|
832
832
|
}
|
|
833
833
|
function lt(e) {
|
|
834
|
-
return
|
|
834
|
+
return sr(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (hn("gobj NULL of bad type"), null);
|
|
835
835
|
}
|
|
836
836
|
function ot(e) {
|
|
837
|
-
return !
|
|
837
|
+
return !sr(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
838
838
|
}
|
|
839
839
|
function st(e) {
|
|
840
|
-
return
|
|
840
|
+
return sr(e) ? e.bottom_gobj : (hn("gobj NULL of bad type"), null);
|
|
841
841
|
}
|
|
842
842
|
function it(e, t) {
|
|
843
|
-
if (!
|
|
844
|
-
e.bottom_gobj && t &&
|
|
843
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), null;
|
|
844
|
+
e.bottom_gobj && t && yn(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
845
845
|
}
|
|
846
846
|
function _t(e, t, n) {
|
|
847
|
-
return
|
|
847
|
+
return sr(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (hn("gobj NULL of bad type"), null);
|
|
848
848
|
}
|
|
849
849
|
function at(e, t, n, r, l) {
|
|
850
|
-
return ot(e) ? (
|
|
850
|
+
return ot(e) ? (hn("gobj NULL, destroying, or bad type"), 0) : ft(e.dl_children, t, n, r, l);
|
|
851
851
|
}
|
|
852
852
|
function ut(e, t, n, r, l) {
|
|
853
|
-
return ot(e) ? (
|
|
853
|
+
return ot(e) ? (hn("gobj NULL, destroying, or bad type"), 0) : dt(e.dl_children, t, n, r, l);
|
|
854
854
|
}
|
|
855
855
|
function ct(e) {
|
|
856
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
856
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || hn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
857
857
|
}
|
|
858
858
|
function ft(e, t, n, r, l) {
|
|
859
859
|
let o, s = [...e];
|
|
860
|
-
if (t &
|
|
860
|
+
if (t & D.WALK_LAST2FIRST) for (let e = s.length; e > 0; e--) {
|
|
861
861
|
o = s[e - 1];
|
|
862
862
|
let t = ct(n(o, r, l));
|
|
863
863
|
if (t < 0) return t;
|
|
@@ -872,15 +872,15 @@ var gobjJs = function(e) {
|
|
|
872
872
|
function gt(e, t, n, r, l) {
|
|
873
873
|
let o, s = ft(e, t, n, r, l);
|
|
874
874
|
if (s < 0) return s;
|
|
875
|
-
if (t &
|
|
875
|
+
if (t & D.WALK_LAST2FIRST) {
|
|
876
876
|
for (let i = e.length; i > 0; i--) if (o = e[i - 1], s = gt([...o.dl_children], t, n, r, l), s < 0) return s;
|
|
877
877
|
} else for (let i = 0; i < e.length; i++) if (o = e[i], s = gt([...o.dl_children], t, n, r, l), s < 0) return s;
|
|
878
878
|
return s;
|
|
879
879
|
}
|
|
880
880
|
function dt(e, t, n, r, l) {
|
|
881
|
-
if (t &
|
|
881
|
+
if (t & D.WALK_BYLEVEL) return gt(e, t, n, r, l);
|
|
882
882
|
let o, s;
|
|
883
|
-
if (t &
|
|
883
|
+
if (t & D.WALK_BOTTOM2TOP) for (let i = e.length; i > 0; i--) {
|
|
884
884
|
if (s = e[i - 1], o = dt([...s.dl_children], t, n, r, l), o < 0) return o;
|
|
885
885
|
if (o = ct(n(s, r, l)), o < 0) return o;
|
|
886
886
|
}
|
|
@@ -891,7 +891,7 @@ var gobjJs = function(e) {
|
|
|
891
891
|
return 0;
|
|
892
892
|
}
|
|
893
893
|
function bt(e, t) {
|
|
894
|
-
if (!
|
|
894
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), !1;
|
|
895
895
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
896
896
|
t.__disabled__;
|
|
897
897
|
let o = t.__state__;
|
|
@@ -907,7 +907,7 @@ var gobjJs = function(e) {
|
|
|
907
907
|
return !0;
|
|
908
908
|
}
|
|
909
909
|
function pt(e, t) {
|
|
910
|
-
if (ot(e)) return
|
|
910
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), null;
|
|
911
911
|
const n = e.dl_children;
|
|
912
912
|
for (let e = 0; e < n.length; e++) {
|
|
913
913
|
const r = n[e];
|
|
@@ -935,57 +935,57 @@ var gobjJs = function(e) {
|
|
|
935
935
|
return o ? (n.splice(0, 1), n = n.join("`"), mt(o, n)) : null;
|
|
936
936
|
}
|
|
937
937
|
function ht(e, t) {
|
|
938
|
-
return !
|
|
938
|
+
return !ir(t) && !!ge(e.gclass, t, !1);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function yt(e, t, n) {
|
|
941
941
|
let r = e.jn_attrs;
|
|
942
|
-
if (t in r &&
|
|
942
|
+
if (t in r && Object.prototype.hasOwnProperty.call(r, t)) {
|
|
943
943
|
let n = r[t];
|
|
944
944
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
945
945
|
}
|
|
946
|
-
return
|
|
946
|
+
return hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function Et(e, t, n) {
|
|
949
949
|
let r = {}, l = e.gclass.attrs_table;
|
|
950
950
|
for (let n = 0; n < l.length; n++) {
|
|
951
951
|
const o = l[n];
|
|
952
952
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
953
953
|
let t;
|
|
954
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
954
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = xn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = xn(e.jn_attrs, o.name))), Yn(r, o.name, t);
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
return r;
|
|
958
958
|
}
|
|
959
959
|
function Tt(e, t) {
|
|
960
960
|
if (t) {
|
|
961
|
-
if (0 ===
|
|
962
|
-
if (0 ===
|
|
963
|
-
if (0 ===
|
|
964
|
-
if (0 ===
|
|
961
|
+
if (0 === ur(t, "__disabled__")) return Ye(e);
|
|
962
|
+
if (0 === ur(t, "__running__")) return Ke(e);
|
|
963
|
+
if (0 === ur(t, "__playing__")) return Je(e);
|
|
964
|
+
if (0 === ur(t, "__service__")) return Be(e);
|
|
965
965
|
}
|
|
966
966
|
let n = fe(e, t, !1);
|
|
967
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
967
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
968
968
|
}
|
|
969
969
|
function vt(e, t) {
|
|
970
|
-
t &&
|
|
970
|
+
t && ur(t, "__trace_level__");
|
|
971
971
|
let n = fe(e, t, !1);
|
|
972
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
972
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
973
973
|
}
|
|
974
974
|
function jt(e, t) {
|
|
975
|
-
if (t && 0 ===
|
|
975
|
+
if (t && 0 === ur(t, "__state__")) return kt(e);
|
|
976
976
|
let n = fe(e, t, !1);
|
|
977
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
977
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
978
978
|
}
|
|
979
979
|
function Ot(e, t) {
|
|
980
980
|
let n = fe(e, t, !1);
|
|
981
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
981
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? xn(n, t) : e.gclass.gmt.mt_reading(e, t) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
982
982
|
}
|
|
983
983
|
function St(e, t, r, l) {
|
|
984
|
-
if (!
|
|
984
|
+
if (!tr(t)) return hn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
985
985
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
986
986
|
if (i.length <= 1) {
|
|
987
987
|
let l = t;
|
|
988
|
-
return l in s &&
|
|
988
|
+
return l in s && Object.prototype.hasOwnProperty.call(s, l) ? (s[l] = r, Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l) && (e.priv[l] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (hn(n("gobj_write_attr(%s): attr not found '%s'", et(e), l)), -1);
|
|
989
989
|
}
|
|
990
990
|
let _ = i.length;
|
|
991
991
|
for (let t = 0; t < _; t++) {
|
|
@@ -996,10 +996,10 @@ var gobjJs = function(e) {
|
|
|
996
996
|
continue;
|
|
997
997
|
}
|
|
998
998
|
let l = e.jn_attrs;
|
|
999
|
-
if (o in l &&
|
|
999
|
+
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r, Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
1000
1000
|
break;
|
|
1001
1001
|
}
|
|
1002
|
-
return
|
|
1002
|
+
return hn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
1003
1003
|
}
|
|
1004
1004
|
function wt(e, t, n, r) {
|
|
1005
1005
|
let l = ce(e), o = 0;
|
|
@@ -1011,21 +1011,21 @@ var gobjJs = function(e) {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
function Nt(e, t, n) {
|
|
1013
1013
|
let r = fe(e, t, !1);
|
|
1014
|
-
return r ? (r[t] =
|
|
1014
|
+
return r ? (r[t] = _r(n), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1015
1015
|
}
|
|
1016
1016
|
function Rt(e, t, n) {
|
|
1017
1017
|
let r = fe(e, t, !1);
|
|
1018
|
-
return r ? (r[t] = parseInt(n),
|
|
1018
|
+
return r ? (r[t] = parseInt(n), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function $t(e, t, n) {
|
|
1021
1021
|
let r = fe(e, t, !1);
|
|
1022
|
-
return r ? (r[t] = String(n),
|
|
1022
|
+
return r ? (r[t] = String(n), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (hn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1025
|
-
if (ot(e)) return
|
|
1024
|
+
function Dt(e, t) {
|
|
1025
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), null;
|
|
1026
1026
|
if (e.current_state.state_name === t) return !1;
|
|
1027
1027
|
let r = pe(e.gclass, t);
|
|
1028
|
-
if (!r) return
|
|
1028
|
+
if (!r) return hn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1029
1029
|
e.last_state = e.current_state, e.current_state = r;
|
|
1030
1030
|
let l = H(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1031
1031
|
return x(e) & P.TRACE_STATES;
|
|
@@ -1033,10 +1033,10 @@ var gobjJs = function(e) {
|
|
|
1033
1033
|
return (l || o) && (1 === C || L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
1034
1034
|
}
|
|
1035
1035
|
function kt(e) {
|
|
1036
|
-
return
|
|
1036
|
+
return sr(e) ? e.current_state.state_name : (hn("hgobj NULL"), "");
|
|
1037
1037
|
}
|
|
1038
1038
|
function At(e, t, n) {
|
|
1039
|
-
if (!
|
|
1039
|
+
if (!sr(e)) return hn("gobj NULL of bad type"), null;
|
|
1040
1040
|
let r = ve(e.gclass, t);
|
|
1041
1041
|
if (r) return r;
|
|
1042
1042
|
if (n) {
|
|
@@ -1054,10 +1054,18 @@ var gobjJs = function(e) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
function Ct(e, t, n) {
|
|
1056
1056
|
let r = At(e, t, !1);
|
|
1057
|
-
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag &
|
|
1057
|
+
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & $.EVF_OUTPUT_EVENT);
|
|
1058
1058
|
}
|
|
1059
1059
|
var Lt = [], Pt = !1;
|
|
1060
|
-
function Ut() {
|
|
1060
|
+
function Ut(e, t, r, l) {
|
|
1061
|
+
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (hn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : ir(t) ? (hn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (hn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
1062
|
+
dst: e,
|
|
1063
|
+
event: t,
|
|
1064
|
+
kw: r,
|
|
1065
|
+
src: l
|
|
1066
|
+
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ft, 0)), 0) : (hn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (hn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
1067
|
+
}
|
|
1068
|
+
function Ft() {
|
|
1061
1069
|
Pt = !1;
|
|
1062
1070
|
let e = Lt;
|
|
1063
1071
|
Lt = [];
|
|
@@ -1066,53 +1074,53 @@ var gobjJs = function(e) {
|
|
|
1066
1074
|
const r = e[n];
|
|
1067
1075
|
if (!(r.dst.obflag & (R.obflag_destroyed | R.obflag_destroying))) {
|
|
1068
1076
|
try {
|
|
1069
|
-
|
|
1077
|
+
Vt(r.dst, r.event, r.kw, r.src);
|
|
1070
1078
|
} catch (t) {
|
|
1071
|
-
throw (Lt = e.slice(n + 1).concat(Lt)).length > 0 && !Pt && (Pt = !0, setTimeout(
|
|
1079
|
+
throw (Lt = e.slice(n + 1).concat(Lt)).length > 0 && !Pt && (Pt = !0, setTimeout(Ft, 0)), t;
|
|
1072
1080
|
}
|
|
1073
1081
|
t++;
|
|
1074
1082
|
}
|
|
1075
1083
|
}
|
|
1076
|
-
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(
|
|
1084
|
+
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(Ft, 0)), t;
|
|
1077
1085
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!(e && e instanceof S)) return
|
|
1080
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
1086
|
+
function Vt(e, t, r, l) {
|
|
1087
|
+
if (!(e && e instanceof S)) return hn("gobj dst NULL"), -1;
|
|
1088
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return hn("gobj dst DESTROYED"), -1;
|
|
1081
1089
|
let o = e.current_state;
|
|
1082
|
-
if (!o) return
|
|
1090
|
+
if (!o) return hn(`${et(e)}: current_state NULL`), -1;
|
|
1083
1091
|
let s = H(e, t) && !z(l, t);
|
|
1084
1092
|
h++;
|
|
1085
1093
|
let i = me(o, t);
|
|
1086
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) &&
|
|
1094
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) && zn(r) && Un(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && L(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), hn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1087
1095
|
if (s) {
|
|
1088
1096
|
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1089
1097
|
else {
|
|
1090
1098
|
let r = "";
|
|
1091
|
-
i.action && (r =
|
|
1099
|
+
i.action && (r = nl(i.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1092
1100
|
}
|
|
1093
|
-
r && q(e) &&
|
|
1101
|
+
r && q(e) && zn(r) && Un(r);
|
|
1094
1102
|
}
|
|
1095
|
-
i.next_state &&
|
|
1103
|
+
i.next_state && Dt(e, i.next_state);
|
|
1096
1104
|
let _ = -1;
|
|
1097
1105
|
try {
|
|
1098
1106
|
i.action && (_ = i.action(e, t, r, l));
|
|
1099
1107
|
} catch (n) {
|
|
1100
1108
|
if (h--, !n || !n.__gobj_logged__) {
|
|
1101
|
-
|
|
1109
|
+
hn(`${et(e)}: action of ${t} in ${o.state_name} THREW: ${n && n.stack ? n.stack : n}`);
|
|
1102
1110
|
try {
|
|
1103
1111
|
n.__gobj_logged__ = !0;
|
|
1104
1112
|
} catch (e) {}
|
|
1105
1113
|
}
|
|
1106
1114
|
throw n;
|
|
1107
1115
|
}
|
|
1108
|
-
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "",
|
|
1116
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", nr(_) ? _ : 0)), h--, _;
|
|
1109
1117
|
}
|
|
1110
|
-
var
|
|
1118
|
+
var Gt = Object.freeze({
|
|
1111
1119
|
__rename_event_name__: 1,
|
|
1112
1120
|
__hard_subscription__: 2,
|
|
1113
1121
|
__own_event__: 4
|
|
1114
1122
|
});
|
|
1115
|
-
function
|
|
1123
|
+
function Mt(e) {
|
|
1116
1124
|
let t = String(e).toLowerCase();
|
|
1117
1125
|
for (let e in d) {
|
|
1118
1126
|
let n = d[e].dl_events;
|
|
@@ -1123,76 +1131,76 @@ var gobjJs = function(e) {
|
|
|
1123
1131
|
}
|
|
1124
1132
|
return null;
|
|
1125
1133
|
}
|
|
1126
|
-
var
|
|
1127
|
-
j(
|
|
1128
|
-
j(
|
|
1129
|
-
j(
|
|
1130
|
-
j(
|
|
1131
|
-
j(
|
|
1132
|
-
j(
|
|
1133
|
-
j(
|
|
1134
|
-
j(
|
|
1135
|
-
j(
|
|
1136
|
-
j(
|
|
1134
|
+
var Wt = [
|
|
1135
|
+
j(y.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1136
|
+
j(y.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1137
|
+
j(y.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
1138
|
+
j(y.DTP_STRING, "renamed_event", 0, "", "rename event name"),
|
|
1139
|
+
j(y.DTP_INTEGER, "subs_flag", 0, 0, "subscription flag"),
|
|
1140
|
+
j(y.DTP_JSON, "__config__", 0, null, "subscription config"),
|
|
1141
|
+
j(y.DTP_JSON, "__global__", 0, null, "global kw, merge in publishing"),
|
|
1142
|
+
j(y.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1143
|
+
j(y.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1144
|
+
j(y.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1137
1145
|
v()
|
|
1138
1146
|
];
|
|
1139
|
-
function
|
|
1147
|
+
function xt(e, t) {
|
|
1140
1148
|
let n = e ? e.__config__ : null;
|
|
1141
|
-
if (!
|
|
1149
|
+
if (!Zn(n) || !gr(n, "__hard_subscription__") && !gr(n, "__own_event__") && !gr(n, "__rename_event_name__")) return {
|
|
1142
1150
|
kw: e,
|
|
1143
1151
|
renamed_event: ""
|
|
1144
1152
|
};
|
|
1145
|
-
let r =
|
|
1153
|
+
let r = Gn({}, e), l = Gn({}, n);
|
|
1146
1154
|
r.__config__ = l;
|
|
1147
|
-
let o = "", s = l.__rename_event_name__, i = "string" != typeof s ||
|
|
1148
|
-
return i && (o = i.event_name, delete l.__rename_event_name__, t &&
|
|
1155
|
+
let o = "", s = l.__rename_event_name__, i = "string" != typeof s || ir(s) ? null : Mt(s);
|
|
1156
|
+
return i && (o = i.event_name, delete l.__rename_event_name__, t && Xn(r.__global__) > 0 && (r.__global__ = Gn(Gn({}, r.__global__), { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1149
1157
|
kw: r,
|
|
1150
1158
|
renamed_event: o
|
|
1151
1159
|
};
|
|
1152
1160
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let s =
|
|
1155
|
-
if (t && t !==
|
|
1156
|
-
let t =
|
|
1157
|
-
|
|
1161
|
+
function Kt(e, t, n, r, l, o) {
|
|
1162
|
+
let s = vr(t, l, "__config__", null), i = vr(t, l, "__global__", null), _ = vr(t, l, "__local__", null), a = jr(t, l, "__filter__", null), u = !0;
|
|
1163
|
+
if (t && t !== Tr(null, e, "publisher", null) && (u = !1), o && o !== Tr(null, e, "subscriber", null) && (u = !1), n && n !== Er(null, e, "event", "") && (u = !1), r && r !== Er(null, e, "renamed_event", "") && (u = !1), Xn(s) > 0) {
|
|
1164
|
+
let t = vr(null, e, "__config__", null);
|
|
1165
|
+
Xn(t) > 0 && Vn(t, s) || (u = !1);
|
|
1158
1166
|
}
|
|
1159
|
-
if (
|
|
1160
|
-
let t =
|
|
1161
|
-
|
|
1167
|
+
if (Xn(i) > 0) {
|
|
1168
|
+
let t = vr(null, e, "__global__", null);
|
|
1169
|
+
Xn(t) > 0 && Vn(t, i) || (u = !1);
|
|
1162
1170
|
}
|
|
1163
|
-
if (
|
|
1164
|
-
let t =
|
|
1165
|
-
|
|
1171
|
+
if (Xn(_) > 0) {
|
|
1172
|
+
let t = vr(null, e, "__local__", null);
|
|
1173
|
+
Xn(t) > 0 && Vn(t, _) || (u = !1);
|
|
1166
1174
|
}
|
|
1167
|
-
if (
|
|
1168
|
-
let t =
|
|
1169
|
-
|
|
1175
|
+
if (Xn(a) > 0) {
|
|
1176
|
+
let t = jr(null, e, "__filter__", null);
|
|
1177
|
+
Xn(t) > 0 && Vn(t, a) || (u = !1);
|
|
1170
1178
|
}
|
|
1171
1179
|
return u;
|
|
1172
1180
|
}
|
|
1173
|
-
function
|
|
1181
|
+
function Yt(e, t, n, r, l, o) {
|
|
1174
1182
|
let s = [];
|
|
1175
1183
|
for (let i = 0; i < e.length; i++) {
|
|
1176
1184
|
let _ = e[i];
|
|
1177
|
-
|
|
1185
|
+
Kt(_, t, n, r, l, o) && Jn(s, _);
|
|
1178
1186
|
}
|
|
1179
1187
|
return s;
|
|
1180
1188
|
}
|
|
1181
|
-
function
|
|
1189
|
+
function Bt(e, t) {
|
|
1182
1190
|
return e.indexOf(t);
|
|
1183
1191
|
}
|
|
1184
|
-
function Bt(e, t, r, l) {
|
|
1185
|
-
let o = yr(e, t, "publisher", null, Xt.KW_REQUIRED), s = yr(e, t, "subscriber", null, Xt.KW_REQUIRED), i = Er(e, t, "event", "", Xt.KW_REQUIRED);
|
|
1186
|
-
if (!!(hr(e, t, "subs_flag", null, Xt.KW_REQUIRED) & Vt.__hard_subscription__) && !r) return -1;
|
|
1187
|
-
let _ = B(s) || B(o);
|
|
1188
|
-
if (Yt(o.dl_subscriptions, t) < 0) return _ && L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", i || "", et(o), et(s))), 1;
|
|
1189
|
-
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), Tn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1190
|
-
let a = Yt(o.dl_subscriptions, t);
|
|
1191
|
-
return a >= 0 ? qn(o.dl_subscriptions, a) : (mn(`${et(e)}: subscription in publisher not found`), Tn(t)), a = Yt(s.dl_subscribings, t), a >= 0 ? qn(s.dl_subscribings, a) : (mn(`${et(e)}: subscription in subscriber not found`), Tn(t)), 0;
|
|
1192
|
-
}
|
|
1193
1192
|
function Jt(e, t, r, l) {
|
|
1194
|
-
|
|
1195
|
-
if (
|
|
1193
|
+
let o = Tr(e, t, "publisher", null, Zt.KW_REQUIRED), s = Tr(e, t, "subscriber", null, Zt.KW_REQUIRED), i = Er(e, t, "event", "", Zt.KW_REQUIRED);
|
|
1194
|
+
if (!!(yr(e, t, "subs_flag", null, Zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1195
|
+
let _ = B(s) || B(o);
|
|
1196
|
+
if (Bt(o.dl_subscriptions, t) < 0) return _ && L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", i || "", et(o), et(s))), 1;
|
|
1197
|
+
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), vn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1198
|
+
let a = Bt(o.dl_subscriptions, t);
|
|
1199
|
+
return a >= 0 ? Hn(o.dl_subscriptions, a) : (hn(`${et(e)}: subscription in publisher not found`), vn(t)), a = Bt(s.dl_subscribings, t), a >= 0 ? Hn(s.dl_subscribings, a) : (hn(`${et(e)}: subscription in subscriber not found`), vn(t)), 0;
|
|
1200
|
+
}
|
|
1201
|
+
function qt(e, t, r, l) {
|
|
1202
|
+
if (null == r && (r = {}), !e) return hn(`publisher NULL: ev ${t}`), 0;
|
|
1203
|
+
if (!l) return hn(`subscriber NULL: ev ${t}`), 0;
|
|
1196
1204
|
const o = /* @__PURE__ */ new Set([
|
|
1197
1205
|
"__config__",
|
|
1198
1206
|
"__global__",
|
|
@@ -1201,72 +1209,72 @@ var gobjJs = function(e) {
|
|
|
1201
1209
|
"__service__"
|
|
1202
1210
|
]);
|
|
1203
1211
|
if (Object.keys(r).forEach((n) => {
|
|
1204
|
-
o.has(n) ||
|
|
1205
|
-
}),
|
|
1206
|
-
else if (!(Ct(e, t,
|
|
1207
|
-
let s =
|
|
1208
|
-
for (let t = 0; t < i.length; t++) if (
|
|
1212
|
+
o.has(n) || hn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1213
|
+
}), ir(t)) t = "";
|
|
1214
|
+
else if (!(Ct(e, t, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return hn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1215
|
+
let s = xt(r, t), i = Yt(e.dl_subscriptions, e, t, s.renamed_event, s.kw, l), _ = null;
|
|
1216
|
+
for (let t = 0; t < i.length; t++) if (yr(e, i[t], "subs_flag", 0, Zt.KW_REQUIRED) & Gt.__hard_subscription__) {
|
|
1209
1217
|
_ = i[t];
|
|
1210
1218
|
break;
|
|
1211
1219
|
}
|
|
1212
|
-
if (_) return
|
|
1213
|
-
|
|
1220
|
+
if (_) return yn(`${et(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${t}, subscriber: ${et(l)})`), _;
|
|
1221
|
+
Qn(i) > 0 && (hn(`${et(e)}: ${Qn(i)} subscription(s) REPEATED, will be deleted and override`), vn(i, "subscription REPEATED"), Ht(e, i, !1));
|
|
1214
1222
|
let a = function(e, t, n, r) {
|
|
1215
|
-
let l = _e(e,
|
|
1216
|
-
|
|
1223
|
+
let l = _e(e, Wt);
|
|
1224
|
+
Bn(l, "event", t), Bn(l, "subscriber", r), Bn(l, "publisher", e);
|
|
1217
1225
|
let o = 0;
|
|
1218
1226
|
if (n) {
|
|
1219
|
-
let r =
|
|
1220
|
-
if (
|
|
1221
|
-
let n =
|
|
1222
|
-
|
|
1227
|
+
let r = vr(e, n, "__config__", null), s = vr(e, n, "__global__", null), i = vr(e, n, "__local__", null), _ = jr(e, n, "__filter__", null), a = Er(e, n, "__service__", "");
|
|
1228
|
+
if (Xn(s) > 0 && Bn(l, "__global__", Fn(s)), Xn(r) > 0) {
|
|
1229
|
+
let n = Fn(r);
|
|
1230
|
+
Bn(l, "__config__", n);
|
|
1223
1231
|
let s = Er(e, n, "__rename_event_name__", "");
|
|
1224
|
-
if (!
|
|
1225
|
-
let r =
|
|
1232
|
+
if (!ir(s)) {
|
|
1233
|
+
let r = Mt(s);
|
|
1226
1234
|
if (r) {
|
|
1227
|
-
|
|
1228
|
-
let s =
|
|
1229
|
-
|
|
1230
|
-
} else
|
|
1235
|
+
Bn(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= Gt.__rename_event_name__;
|
|
1236
|
+
let s = vr(e, l, "__global__", null);
|
|
1237
|
+
Zn(s) || (s = {}, Bn(l, "__global__", s)), s.__original_event_name__ = t;
|
|
1238
|
+
} else hn(`${et(e)}: EVENT NOT FOUND (__rename_event_name__: ${s})`);
|
|
1231
1239
|
}
|
|
1232
|
-
if (
|
|
1233
|
-
let t =
|
|
1234
|
-
|
|
1240
|
+
if (gr(n, "__hard_subscription__")) {
|
|
1241
|
+
let t = hr(e, n, "__hard_subscription__", !1);
|
|
1242
|
+
Kn(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1235
1243
|
}
|
|
1236
|
-
if (
|
|
1237
|
-
let t =
|
|
1238
|
-
|
|
1244
|
+
if (gr(n, "__own_event__")) {
|
|
1245
|
+
let t = hr(e, n, "__own_event__", !1);
|
|
1246
|
+
Kn(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1239
1247
|
}
|
|
1240
1248
|
}
|
|
1241
|
-
|
|
1249
|
+
Xn(i) > 0 && Bn(l, "__local__", Fn(i)), Xn(_) > 0 && Bn(l, "__filter__", Fn(_)), ir(a) || Bn(l, "__service__", a);
|
|
1242
1250
|
}
|
|
1243
|
-
return
|
|
1251
|
+
return Bn(l, "subs_flag", o), l;
|
|
1244
1252
|
}(e, t, r, l);
|
|
1245
|
-
if (!a) return
|
|
1246
|
-
if (
|
|
1253
|
+
if (!a) return hn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1254
|
+
if (Jn(e.dl_subscriptions, a), Jn(l.dl_subscribings, a), (B(l) || B(e)) && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (q(l) || q(e)) && Un(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1247
1255
|
let t = e.gclass.gmt.mt_subscription_added(e, a);
|
|
1248
|
-
(t < 0 || !1 === t) && (
|
|
1256
|
+
(t < 0 || !1 === t) && (Jt(e, a, !0, !0), a = 0);
|
|
1249
1257
|
}
|
|
1250
1258
|
return a;
|
|
1251
1259
|
}
|
|
1252
|
-
function
|
|
1260
|
+
function Ht(e, t, n) {
|
|
1253
1261
|
let r = [...t], l = 0;
|
|
1254
|
-
for (let t = 0; t < r.length; t++)
|
|
1255
|
-
return l &&
|
|
1256
|
-
}
|
|
1257
|
-
function Ht(e, t, n, r) {
|
|
1258
|
-
return null == n && (n = {}), Kt(e.dl_subscriptions, e, t, null, n, r);
|
|
1262
|
+
for (let t = 0; t < r.length; t++) Jt(e, r[t], n, !1) > 0 && l++;
|
|
1263
|
+
return l && yn(`${et(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1259
1264
|
}
|
|
1260
1265
|
function zt(e, t, n, r) {
|
|
1261
|
-
return
|
|
1266
|
+
return null == n && (n = {}), Yt(e.dl_subscriptions, e, t, null, n, r);
|
|
1267
|
+
}
|
|
1268
|
+
function Qt(e, t, n, r) {
|
|
1269
|
+
return Yt(e.dl_subscribings, r, t, null, n, e);
|
|
1262
1270
|
}
|
|
1263
|
-
function
|
|
1264
|
-
if (
|
|
1265
|
-
if (
|
|
1271
|
+
function Xt(e, t, r) {
|
|
1272
|
+
if (Zn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return hn("gobj NULL or DESTROYED"), -1;
|
|
1273
|
+
if (ir(t)) return hn(`${et(e)}: event EMPTY`), -1;
|
|
1266
1274
|
let l = At(e, t, !0);
|
|
1267
|
-
if (!(l && l.event_flag & (
|
|
1275
|
+
if (!(l && l.event_flag & ($.EVF_SYSTEM_EVENT | $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return hn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1268
1276
|
let o = (B(e) || H(e, t)) && !z(e, t);
|
|
1269
|
-
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) &&
|
|
1277
|
+
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) && zn(r) && Un(r)), e.gclass.gmt.mt_publish_event) {
|
|
1270
1278
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1271
1279
|
if (n <= 0) return n;
|
|
1272
1280
|
}
|
|
@@ -1278,31 +1286,31 @@ var gobjJs = function(e) {
|
|
|
1278
1286
|
if (n < 0) break;
|
|
1279
1287
|
if (!n) continue;
|
|
1280
1288
|
}
|
|
1281
|
-
let u =
|
|
1289
|
+
let u = Tr(e, a, "subscriber", null, Zt.KW_REQUIRED);
|
|
1282
1290
|
if (!u || ot(u)) continue;
|
|
1283
|
-
let c =
|
|
1284
|
-
if (
|
|
1285
|
-
|
|
1286
|
-
let l =
|
|
1287
|
-
|
|
1291
|
+
let c = yr(e, a, "subs_flag", 0, Zt.KW_REQUIRED), f = Er(e, a, "event", "", Zt.KW_REQUIRED);
|
|
1292
|
+
if (ir(f) || 0 === ur(f, t)) {
|
|
1293
|
+
vr(e, a, "__config__", null, 0);
|
|
1294
|
+
let l = vr(e, a, "__global__", null, 0), s = vr(e, a, "__local__", null, 0), f = jr(e, a, "__filter__", null, 0), g = a.renamed_event;
|
|
1295
|
+
ir(g) && (g = t);
|
|
1288
1296
|
let d = 1;
|
|
1289
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) :
|
|
1297
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) : Xn(f) > 0 && (d = Nr(r, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), vn(f))), d < 0) break;
|
|
1290
1298
|
if (!d) continue;
|
|
1291
1299
|
let b = At(u, t, !0);
|
|
1292
|
-
if (b && b.event_flag &
|
|
1300
|
+
if (b && b.event_flag & $.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1293
1301
|
let p = r;
|
|
1294
|
-
(
|
|
1295
|
-
let m =
|
|
1296
|
-
if (m < 0 && c &
|
|
1302
|
+
(Xn(s) > 0 || Xn(l) > 0) && (p = Gn({}, r)), Xn(s) > 0 && fr(p, s), Xn(l) > 0 && Gn(p, Fn(l)), o && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", g || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", g || "", e && !e.running ? "!!" : "", et(e))), q(e) && zn(p) && Un(p));
|
|
1303
|
+
let m = Vt(u, g, p, e);
|
|
1304
|
+
if (m < 0 && c & Gt.__own_event__) {
|
|
1297
1305
|
i = -1;
|
|
1298
1306
|
break;
|
|
1299
1307
|
}
|
|
1300
1308
|
if (_ += m, i++, ot(e)) break;
|
|
1301
1309
|
}
|
|
1302
1310
|
}
|
|
1303
|
-
return i || l && l.event_flag &
|
|
1311
|
+
return i || l && l.event_flag & $.EVF_NO_WARN_SUBS || yn(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1304
1312
|
}
|
|
1305
|
-
var
|
|
1313
|
+
var Zt = Object.freeze({
|
|
1306
1314
|
KW_REQUIRED: 1,
|
|
1307
1315
|
KW_CREATE: 2,
|
|
1308
1316
|
KW_WILD_NUMBER: 4,
|
|
@@ -1322,55 +1330,55 @@ var gobjJs = function(e) {
|
|
|
1322
1330
|
JSON_FALSE: 7,
|
|
1323
1331
|
JSON_NULL: 8
|
|
1324
1332
|
});
|
|
1325
|
-
var
|
|
1326
|
-
var
|
|
1327
|
-
var
|
|
1328
|
-
function
|
|
1329
|
-
if (!
|
|
1330
|
-
if (!
|
|
1333
|
+
var en = "undefined" != typeof window ? window.console : console, tn = en.error, nn = en.warn, rn = en.info, ln = en.debug, on = null, sn = 600, _n = [];
|
|
1334
|
+
var an = !0;
|
|
1335
|
+
var un = null;
|
|
1336
|
+
function cn(e, t) {
|
|
1337
|
+
if (!an) return !1;
|
|
1338
|
+
if (!un) return !0;
|
|
1331
1339
|
try {
|
|
1332
|
-
return !!
|
|
1340
|
+
return !!un(e, t);
|
|
1333
1341
|
} catch (e) {
|
|
1334
1342
|
return !0;
|
|
1335
1343
|
}
|
|
1336
1344
|
}
|
|
1337
|
-
var
|
|
1338
|
-
function
|
|
1339
|
-
|
|
1345
|
+
var fn = !1;
|
|
1346
|
+
function gn(e, t, n) {
|
|
1347
|
+
fn || (function(e, t, n) {
|
|
1340
1348
|
let r = t;
|
|
1341
1349
|
if ("json" === e) try {
|
|
1342
1350
|
r = JSON.stringify(t);
|
|
1343
1351
|
} catch (e) {
|
|
1344
1352
|
r = String(t);
|
|
1345
1353
|
}
|
|
1346
|
-
|
|
1354
|
+
_n.push([
|
|
1347
1355
|
e,
|
|
1348
1356
|
r,
|
|
1349
1357
|
n
|
|
1350
|
-
]),
|
|
1351
|
-
}(e, t, n),
|
|
1358
|
+
]), _n.length > sn && _n.shift();
|
|
1359
|
+
}(e, t, n), dn(e, t, n));
|
|
1352
1360
|
}
|
|
1353
|
-
function
|
|
1354
|
-
if (
|
|
1355
|
-
|
|
1361
|
+
function dn(e, t, n) {
|
|
1362
|
+
if (on && !fn) {
|
|
1363
|
+
fn = !0;
|
|
1356
1364
|
try {
|
|
1357
|
-
|
|
1365
|
+
on(e, t, n);
|
|
1358
1366
|
} catch (e) {} finally {
|
|
1359
|
-
|
|
1367
|
+
fn = !1;
|
|
1360
1368
|
}
|
|
1361
1369
|
}
|
|
1362
1370
|
}
|
|
1363
|
-
function dn(e) {
|
|
1364
|
-
e ? (en = e, tn = e) : (en = Zt.error, tn = Zt.warn);
|
|
1365
|
-
}
|
|
1366
1371
|
function bn(e) {
|
|
1372
|
+
e ? (tn = e, nn = e) : (tn = en.error, nn = en.warn);
|
|
1373
|
+
}
|
|
1374
|
+
function pn(e) {
|
|
1367
1375
|
try {
|
|
1368
1376
|
return JSON.stringify(e);
|
|
1369
1377
|
} catch (t) {
|
|
1370
1378
|
return String(e);
|
|
1371
1379
|
}
|
|
1372
1380
|
}
|
|
1373
|
-
function
|
|
1381
|
+
function mn(e) {
|
|
1374
1382
|
const t = Array.prototype.slice.call(arguments);
|
|
1375
1383
|
let n = "";
|
|
1376
1384
|
if ("string" == typeof e) {
|
|
@@ -1384,35 +1392,35 @@ var gobjJs = function(e) {
|
|
|
1384
1392
|
case "%i": return parseInt(n);
|
|
1385
1393
|
case "%f": return parseFloat(n);
|
|
1386
1394
|
case "%o":
|
|
1387
|
-
case "%O": return "object" == typeof n ?
|
|
1395
|
+
case "%O": return "object" == typeof n ? pn(n) : String(n);
|
|
1388
1396
|
default: return e;
|
|
1389
1397
|
}
|
|
1390
1398
|
});
|
|
1391
|
-
const l = t.slice(r).map((e) => "object" == typeof e ?
|
|
1399
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? pn(e) : String(e));
|
|
1392
1400
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1393
|
-
} else n = t.map((e) => "object" == typeof e ?
|
|
1401
|
+
} else n = t.map((e) => "object" == typeof e ? pn(e) : String(e)).join(" ");
|
|
1394
1402
|
return n;
|
|
1395
1403
|
}
|
|
1396
|
-
function mn(e, ...t) {
|
|
1397
|
-
let n = pn(e, ...t), r = Jr();
|
|
1398
|
-
en && (en === Zt.error ? un("error", n) && en("%c" + r + " ERROR: " + String(n), "color:red") : (un("error", n) && Zt.error("%c" + r + " ERROR: " + String(n), "color:red"), en(`${r} ERROR: ${String(n)}`))), fn("error", n, r);
|
|
1399
|
-
}
|
|
1400
1404
|
function hn(e, ...t) {
|
|
1401
|
-
let n =
|
|
1402
|
-
tn && (tn ===
|
|
1405
|
+
let n = mn(e, ...t), r = Zr();
|
|
1406
|
+
tn && (tn === en.error ? cn("error", n) && tn("%c" + r + " ERROR: " + String(n), "color:red") : (cn("error", n) && en.error("%c" + r + " ERROR: " + String(n), "color:red"), tn(`${r} ERROR: ${String(n)}`))), gn("error", n, r);
|
|
1407
|
+
}
|
|
1408
|
+
function yn(e, ...t) {
|
|
1409
|
+
let n = mn(e, ...t), r = Zr();
|
|
1410
|
+
nn && (nn === en.warn ? cn("warning", n) && nn("%c" + r + " WARNING: " + String(n), "color:yellow") : (cn("warning", n) && en.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), nn(`${r} WARNING: ${String(n)}`))), gn("warning", n, r);
|
|
1403
1411
|
}
|
|
1404
1412
|
function En(e, ...t) {
|
|
1405
|
-
let n =
|
|
1406
|
-
|
|
1413
|
+
let n = mn(e, ...t), r = Zr();
|
|
1414
|
+
ln && cn("debug", n) && ln("%c" + r + " DEBUG: " + String(n), "color:silver"), gn("debug", n, r);
|
|
1407
1415
|
}
|
|
1408
|
-
function
|
|
1409
|
-
let n =
|
|
1410
|
-
|
|
1416
|
+
function Tn(e, ...t) {
|
|
1417
|
+
let n = mn(e, ...t), r = Zr();
|
|
1418
|
+
ln && cn("msg", n) && ln("%c" + r + " MSG: " + String(n), "color:cyan"), gn("msg", n, r);
|
|
1411
1419
|
}
|
|
1412
|
-
function
|
|
1413
|
-
|
|
1420
|
+
function vn(e, t) {
|
|
1421
|
+
cn("json", t) && (t && en.warn("=====> " + t), en.dir(e)), gn("json", e, Zr());
|
|
1414
1422
|
}
|
|
1415
|
-
var
|
|
1423
|
+
var jn = [
|
|
1416
1424
|
"passw",
|
|
1417
1425
|
"pwd",
|
|
1418
1426
|
"passphrase",
|
|
@@ -1424,12 +1432,12 @@ var gobjJs = function(e) {
|
|
|
1424
1432
|
"cookie",
|
|
1425
1433
|
"credential",
|
|
1426
1434
|
"salt"
|
|
1427
|
-
],
|
|
1435
|
+
], On = [
|
|
1428
1436
|
"apikey",
|
|
1429
1437
|
"sessionid",
|
|
1430
1438
|
"sessionkey",
|
|
1431
1439
|
"authdata"
|
|
1432
|
-
],
|
|
1440
|
+
], Sn = /* @__PURE__ */ new Set([
|
|
1433
1441
|
"endpoint",
|
|
1434
1442
|
"url",
|
|
1435
1443
|
"uri",
|
|
@@ -1453,25 +1461,25 @@ var gobjJs = function(e) {
|
|
|
1453
1461
|
"expires",
|
|
1454
1462
|
"mode"
|
|
1455
1463
|
]);
|
|
1456
|
-
function
|
|
1464
|
+
function wn(e) {
|
|
1457
1465
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1458
1466
|
let t = e.toLowerCase(), n = !1;
|
|
1459
|
-
for (const e of
|
|
1467
|
+
for (const e of jn) if (t.indexOf(e) >= 0) {
|
|
1460
1468
|
n = !0;
|
|
1461
1469
|
break;
|
|
1462
1470
|
}
|
|
1463
1471
|
if (!n) {
|
|
1464
1472
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1465
|
-
for (const t of
|
|
1473
|
+
for (const t of On) if (e.indexOf(t) >= 0) {
|
|
1466
1474
|
n = !0;
|
|
1467
1475
|
break;
|
|
1468
1476
|
}
|
|
1469
1477
|
}
|
|
1470
1478
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1471
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1479
|
+
for (const e of t.split(/[_\-. \t]/)) if (Sn.has(e)) return !1;
|
|
1472
1480
|
return !0;
|
|
1473
1481
|
}
|
|
1474
|
-
function
|
|
1482
|
+
function Nn(e, t, n) {
|
|
1475
1483
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1476
1484
|
let o = t;
|
|
1477
1485
|
for (;;) {
|
|
@@ -1487,12 +1495,12 @@ var gobjJs = function(e) {
|
|
|
1487
1495
|
o = t;
|
|
1488
1496
|
}
|
|
1489
1497
|
}
|
|
1490
|
-
var
|
|
1491
|
-
function
|
|
1498
|
+
var Rn = 128, $n = 4194304, Dn = "<not shown: too large to mask>";
|
|
1499
|
+
function kn(e) {
|
|
1492
1500
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1493
|
-
if (e.length >
|
|
1501
|
+
if (e.length > $n) return Dn;
|
|
1494
1502
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1495
|
-
for (; null !== (t = r.exec(e));)
|
|
1503
|
+
for (; null !== (t = r.exec(e));) wn(t[2].slice(-128)) && (n = !0);
|
|
1496
1504
|
let l = [], o = 0, s = !1, i = "", _ = 0, a = 0;
|
|
1497
1505
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1498
1506
|
for (; a < e.length;) {
|
|
@@ -1505,8 +1513,8 @@ var gobjJs = function(e) {
|
|
|
1505
1513
|
a++;
|
|
1506
1514
|
continue;
|
|
1507
1515
|
}
|
|
1508
|
-
let r = e.substring(Math.max(_, a -
|
|
1509
|
-
if (_ = a + 1, !(
|
|
1516
|
+
let r = e.substring(Math.max(_, a - Rn), a);
|
|
1517
|
+
if (_ = a + 1, !(wn(r) || n && "value" === r.toLowerCase())) {
|
|
1510
1518
|
a++;
|
|
1511
1519
|
continue;
|
|
1512
1520
|
}
|
|
@@ -1515,18 +1523,18 @@ var gobjJs = function(e) {
|
|
|
1515
1523
|
if (f) {
|
|
1516
1524
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1517
1525
|
e[c] === f && c++;
|
|
1518
|
-
} else c =
|
|
1526
|
+
} else c = Nn(e, a, i);
|
|
1519
1527
|
c > a && (l.push(e.substring(o, a)), l.push("********"), o = c, s = !0), a = c, _ = a;
|
|
1520
1528
|
}
|
|
1521
1529
|
return s ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1522
1530
|
}
|
|
1523
|
-
var
|
|
1524
|
-
var
|
|
1525
|
-
function
|
|
1531
|
+
var An = 64, In = "<not shown: the masking failed>";
|
|
1532
|
+
var Cn = Symbol("mask-in-progress");
|
|
1533
|
+
function Ln(e, t, n, r) {
|
|
1526
1534
|
if ("string" == typeof e) {
|
|
1527
1535
|
if (e.length > r.left) return r.left = 0, Dn;
|
|
1528
1536
|
r.left -= e.length;
|
|
1529
|
-
let t =
|
|
1537
|
+
let t = kn(e);
|
|
1530
1538
|
return null !== t ? t : e;
|
|
1531
1539
|
}
|
|
1532
1540
|
let l = Array.isArray(e);
|
|
@@ -1538,10 +1546,10 @@ var gobjJs = function(e) {
|
|
|
1538
1546
|
if (r.left <= 0) return Dn;
|
|
1539
1547
|
if (t.has(e)) {
|
|
1540
1548
|
let n = t.get(e);
|
|
1541
|
-
return n ===
|
|
1549
|
+
return n === Cn ? "<cycle>" : n;
|
|
1542
1550
|
}
|
|
1543
|
-
if (n >=
|
|
1544
|
-
r.left -= 1, t.set(e,
|
|
1551
|
+
if (n >= An) return "<deeper not shown>";
|
|
1552
|
+
r.left -= 1, t.set(e, Cn);
|
|
1545
1553
|
let o, s = !1, i = !1;
|
|
1546
1554
|
if (l) {
|
|
1547
1555
|
o = [];
|
|
@@ -1551,13 +1559,13 @@ var gobjJs = function(e) {
|
|
|
1551
1559
|
break;
|
|
1552
1560
|
}
|
|
1553
1561
|
r.left -= 1;
|
|
1554
|
-
let _ =
|
|
1562
|
+
let _ = Ln(e[l], t, n + 1, r);
|
|
1555
1563
|
_ !== e[l] && (s = !0), o.push(_);
|
|
1556
1564
|
}
|
|
1557
1565
|
i && o.push(Dn);
|
|
1558
1566
|
} else {
|
|
1559
1567
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1560
|
-
let l = "string" == typeof e.attribute &&
|
|
1568
|
+
let l = "string" == typeof e.attribute && wn(e.attribute.slice(-128));
|
|
1561
1569
|
for (const _ in e) {
|
|
1562
1570
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1563
1571
|
if (r.left <= 0) {
|
|
@@ -1566,33 +1574,33 @@ var gobjJs = function(e) {
|
|
|
1566
1574
|
}
|
|
1567
1575
|
r.left -= 1 + _.length;
|
|
1568
1576
|
let a, u = e[_];
|
|
1569
|
-
a = (
|
|
1577
|
+
a = (wn(_.slice(-128)) || l && "value" === _) && null != u && "" !== u ? "********" : Ln(u, t, n + 1, r), a !== u && (s = !0), br(o, _, a);
|
|
1570
1578
|
}
|
|
1571
1579
|
i && (o["<more>"] = Dn);
|
|
1572
1580
|
}
|
|
1573
1581
|
return s || i || (o = e), t.set(e, o), o;
|
|
1574
1582
|
}
|
|
1575
|
-
function
|
|
1583
|
+
function Pn(e) {
|
|
1576
1584
|
try {
|
|
1577
|
-
return
|
|
1585
|
+
return Ln(e, /* @__PURE__ */ new WeakMap(), 0, { left: $n });
|
|
1578
1586
|
} catch (e) {
|
|
1579
|
-
return
|
|
1587
|
+
return In;
|
|
1580
1588
|
}
|
|
1581
1589
|
}
|
|
1582
|
-
function
|
|
1583
|
-
|
|
1590
|
+
function Un(e, t) {
|
|
1591
|
+
vn(Pn(e), t);
|
|
1584
1592
|
}
|
|
1585
|
-
function
|
|
1593
|
+
function Fn(e) {
|
|
1586
1594
|
return structuredClone(e);
|
|
1587
1595
|
}
|
|
1588
|
-
function
|
|
1596
|
+
function Vn(e, t) {
|
|
1589
1597
|
if (e === t) return !0;
|
|
1590
1598
|
if (null === e || null === t) return e === t;
|
|
1591
1599
|
if (typeof e != typeof t) return !1;
|
|
1592
1600
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1593
1601
|
if (Array.isArray(e)) {
|
|
1594
1602
|
if (e.length !== t.length) return !1;
|
|
1595
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1603
|
+
for (let n = 0; n < e.length; n++) if (!Vn(e[n], t[n])) return !1;
|
|
1596
1604
|
return !0;
|
|
1597
1605
|
}
|
|
1598
1606
|
if ("object" == typeof e) {
|
|
@@ -1600,118 +1608,118 @@ var gobjJs = function(e) {
|
|
|
1600
1608
|
if (n.length !== r.length) return !1;
|
|
1601
1609
|
for (let l = 0; l < n.length; l++) {
|
|
1602
1610
|
if (n[l] !== r[l]) return !1;
|
|
1603
|
-
if (!
|
|
1611
|
+
if (!Vn(e[n[l]], t[r[l]])) return !1;
|
|
1604
1612
|
}
|
|
1605
1613
|
return !0;
|
|
1606
1614
|
}
|
|
1607
1615
|
return e === t;
|
|
1608
1616
|
}
|
|
1609
|
-
function Vn(e, t) {
|
|
1610
|
-
if (!t) return e;
|
|
1611
|
-
for (let n of Object.keys(t)) dr(e, n, t[n]);
|
|
1612
|
-
return e;
|
|
1613
|
-
}
|
|
1614
1617
|
function Gn(e, t) {
|
|
1615
1618
|
if (!t) return e;
|
|
1616
|
-
for (let n
|
|
1619
|
+
for (let n of Object.keys(t)) br(e, n, t[n]);
|
|
1617
1620
|
return e;
|
|
1618
1621
|
}
|
|
1619
1622
|
function Mn(e, t) {
|
|
1620
1623
|
if (!t) return e;
|
|
1621
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) &&
|
|
1624
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && br(e, n, t[n]);
|
|
1622
1625
|
return e;
|
|
1623
1626
|
}
|
|
1624
1627
|
function Wn(e, t) {
|
|
1625
|
-
if (
|
|
1628
|
+
if (!t) return e;
|
|
1629
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && br(e, n, t[n]);
|
|
1630
|
+
return e;
|
|
1626
1631
|
}
|
|
1627
1632
|
function xn(e, t) {
|
|
1628
|
-
e && Object.prototype.hasOwnProperty.call(e, t)
|
|
1633
|
+
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1629
1634
|
}
|
|
1630
|
-
function Kn(e, t
|
|
1631
|
-
|
|
1635
|
+
function Kn(e, t) {
|
|
1636
|
+
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1632
1637
|
}
|
|
1633
1638
|
function Yn(e, t, n) {
|
|
1634
|
-
|
|
1639
|
+
br(e, t, n);
|
|
1635
1640
|
}
|
|
1636
|
-
function Bn(e, t) {
|
|
1637
|
-
e
|
|
1641
|
+
function Bn(e, t, n) {
|
|
1642
|
+
br(e, t, n);
|
|
1638
1643
|
}
|
|
1639
1644
|
function Jn(e, t) {
|
|
1640
1645
|
e.push(t);
|
|
1641
1646
|
}
|
|
1642
1647
|
function qn(e, t) {
|
|
1643
|
-
e.
|
|
1648
|
+
e.push(t);
|
|
1644
1649
|
}
|
|
1645
|
-
function Hn(e) {
|
|
1646
|
-
|
|
1650
|
+
function Hn(e, t) {
|
|
1651
|
+
e.splice(t, 1);
|
|
1647
1652
|
}
|
|
1648
1653
|
function zn(e) {
|
|
1649
|
-
return Zn(e) ? e.length : 0;
|
|
1654
|
+
return Zn(e) ? Object.keys(e).length : 0;
|
|
1650
1655
|
}
|
|
1651
1656
|
function Qn(e) {
|
|
1652
|
-
return
|
|
1657
|
+
return er(e) ? e.length : 0;
|
|
1653
1658
|
}
|
|
1654
1659
|
function Xn(e) {
|
|
1655
|
-
return
|
|
1660
|
+
return Zn(e) ? Object.keys(e).length : er(e) ? e.length : tr(e) && e.length > 0 ? 1 : 0;
|
|
1656
1661
|
}
|
|
1657
1662
|
function Zn(e) {
|
|
1658
|
-
return Array.isArray(e);
|
|
1663
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1659
1664
|
}
|
|
1660
1665
|
function er(e) {
|
|
1661
|
-
return
|
|
1666
|
+
return Array.isArray(e);
|
|
1662
1667
|
}
|
|
1663
1668
|
function tr(e) {
|
|
1664
|
-
return "
|
|
1669
|
+
return "string" == typeof e;
|
|
1665
1670
|
}
|
|
1666
1671
|
function nr(e) {
|
|
1667
|
-
return "
|
|
1672
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1668
1673
|
}
|
|
1669
1674
|
function rr(e) {
|
|
1670
|
-
return
|
|
1675
|
+
return "boolean" == typeof e;
|
|
1671
1676
|
}
|
|
1672
1677
|
function lr(e) {
|
|
1673
|
-
return
|
|
1678
|
+
return null == e;
|
|
1674
1679
|
}
|
|
1675
1680
|
function or(e) {
|
|
1676
|
-
return
|
|
1681
|
+
return "function" == typeof e;
|
|
1677
1682
|
}
|
|
1678
1683
|
function sr(e) {
|
|
1679
|
-
return
|
|
1684
|
+
return e instanceof S;
|
|
1680
1685
|
}
|
|
1681
1686
|
function ir(e) {
|
|
1682
|
-
return tr(e)
|
|
1687
|
+
return !tr(e) || 0 === e.length;
|
|
1683
1688
|
}
|
|
1684
|
-
function _r(e
|
|
1685
|
-
return e
|
|
1689
|
+
function _r(e) {
|
|
1690
|
+
return nr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1686
1691
|
}
|
|
1687
1692
|
function ar(e, t) {
|
|
1693
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1694
|
+
}
|
|
1695
|
+
function ur(e, t) {
|
|
1688
1696
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1689
1697
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1690
1698
|
}
|
|
1691
|
-
function
|
|
1692
|
-
if (
|
|
1693
|
-
if (
|
|
1699
|
+
function cr(e, t) {
|
|
1700
|
+
if (Zn(e) || Zn(t) || er(e) || er(t)) return 0;
|
|
1701
|
+
if (nr(e) || nr(t)) {
|
|
1694
1702
|
let n = Number(e), r = Number(t);
|
|
1695
1703
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1696
1704
|
}
|
|
1697
|
-
if (
|
|
1705
|
+
if (rr(e) || rr(t)) {
|
|
1698
1706
|
let n = Number(e), r = Number(t);
|
|
1699
1707
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1700
1708
|
}
|
|
1701
|
-
return
|
|
1709
|
+
return ar(String(e), String(t));
|
|
1702
1710
|
}
|
|
1703
|
-
function
|
|
1704
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1711
|
+
function fr(e, t) {
|
|
1712
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) fr(e, n);
|
|
1705
1713
|
else "string" == typeof t && delete e[t];
|
|
1706
1714
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1707
1715
|
}
|
|
1708
|
-
function
|
|
1716
|
+
function gr(e, t) {
|
|
1709
1717
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1710
1718
|
}
|
|
1711
|
-
function
|
|
1719
|
+
function dr(e, t) {
|
|
1712
1720
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1713
1721
|
}
|
|
1714
|
-
function
|
|
1722
|
+
function br(e, t, n) {
|
|
1715
1723
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1716
1724
|
value: n,
|
|
1717
1725
|
writable: !0,
|
|
@@ -1719,167 +1727,171 @@ var gobjJs = function(e) {
|
|
|
1719
1727
|
configurable: !0
|
|
1720
1728
|
}) : e[t] = n;
|
|
1721
1729
|
}
|
|
1722
|
-
function
|
|
1723
|
-
e && !
|
|
1730
|
+
function pr(e, t, n, r) {
|
|
1731
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1724
1732
|
const l = e ? `${et(e)}: ` : "";
|
|
1725
|
-
if (!
|
|
1726
|
-
if (!
|
|
1733
|
+
if (!Zn(t) && !er(t)) return void hn(`${l}kw must be list or dict: '${String(n)}'`);
|
|
1734
|
+
if (!tr(n)) return void hn(`${l}path must be a string: ${String(n)}`);
|
|
1727
1735
|
let o = n.split("`"), s = o.length;
|
|
1728
1736
|
for (let e = 0; e < s; e++) {
|
|
1729
|
-
if (
|
|
1737
|
+
if (er(t)) {
|
|
1738
|
+
if (!/^[0-9]+$/.test(o[e])) return void (r && hn(`${l}path not found: '${n}'`));
|
|
1739
|
+
o[e] = String(Number(o[e]));
|
|
1740
|
+
}
|
|
1741
|
+
if (dr(t, o[e])) return void (r && hn(`${l}path not found: '${n}'`));
|
|
1730
1742
|
if (e === s - 1) break;
|
|
1731
|
-
if (null == (t = t[o[e]])) return void (r &&
|
|
1732
|
-
if (!
|
|
1743
|
+
if (null == (t = t[o[e]])) return void (r && hn(`${l}path not found: '${n}'`));
|
|
1744
|
+
if (!Zn(t) && !er(t)) return void hn(`${l}kw must be list or dict: '${n}'`);
|
|
1733
1745
|
}
|
|
1734
1746
|
let i = t[o[s - 1]];
|
|
1735
|
-
return void 0 === i && r &&
|
|
1747
|
+
return void 0 === i && r && hn(`${l}path not found: '${n}'`), i;
|
|
1736
1748
|
}
|
|
1737
|
-
function
|
|
1738
|
-
e && !
|
|
1749
|
+
function mr(e, t, n) {
|
|
1750
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1739
1751
|
let [r, l] = function(e, t) {
|
|
1740
1752
|
let n = e.lastIndexOf(t);
|
|
1741
1753
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1742
1754
|
}(n, "`");
|
|
1743
|
-
return
|
|
1755
|
+
return ir(l) ? Kn(t, n) : Kn(pr(e, t, r, !0), l), 0;
|
|
1744
1756
|
}
|
|
1745
|
-
function
|
|
1746
|
-
e && !
|
|
1747
|
-
let o =
|
|
1748
|
-
const s = l && l &
|
|
1757
|
+
function hr(e, t, n, r, l) {
|
|
1758
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1759
|
+
let o = pr(e, t, n, !1);
|
|
1760
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
1749
1761
|
if (void 0 === o) {
|
|
1750
1762
|
if (i && t) {
|
|
1751
1763
|
let l = Boolean(r);
|
|
1752
|
-
return
|
|
1764
|
+
return Or(e, t, n, l), l;
|
|
1753
1765
|
}
|
|
1754
|
-
return s && (
|
|
1766
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), Boolean(r);
|
|
1755
1767
|
}
|
|
1756
1768
|
let u;
|
|
1757
|
-
if (
|
|
1758
|
-
else if (a &&
|
|
1759
|
-
else if (a &&
|
|
1769
|
+
if (rr(o)) u = o;
|
|
1770
|
+
else if (a && nr(o)) u = 0 !== o;
|
|
1771
|
+
else if (a && tr(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
1760
1772
|
else {
|
|
1761
|
-
if (!a || null !== o) return a ? (
|
|
1773
|
+
if (!a || null !== o) return a ? (hn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Un(t), !1) : (hn(`${e ? et(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), Un(t), Boolean(r));
|
|
1762
1774
|
u = !1;
|
|
1763
1775
|
}
|
|
1764
|
-
return _ &&
|
|
1776
|
+
return _ && mr(e, t, n), u;
|
|
1765
1777
|
}
|
|
1766
|
-
function
|
|
1767
|
-
e && !
|
|
1768
|
-
let o =
|
|
1769
|
-
const s = l && l &
|
|
1778
|
+
function yr(e, t, n, r, l) {
|
|
1779
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1780
|
+
let o = pr(e, t, n, !1);
|
|
1781
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
1770
1782
|
if (void 0 === o) {
|
|
1771
1783
|
if (i && t) {
|
|
1772
1784
|
let l = parseInt(r);
|
|
1773
|
-
return
|
|
1785
|
+
return Or(e, t, n, l), l;
|
|
1774
1786
|
}
|
|
1775
|
-
return s && (
|
|
1787
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), parseInt(r);
|
|
1776
1788
|
}
|
|
1777
1789
|
let u;
|
|
1778
|
-
if (
|
|
1790
|
+
if (nr(o)) u = Math.trunc(o);
|
|
1779
1791
|
else {
|
|
1780
|
-
if (!a) return
|
|
1781
|
-
if (
|
|
1782
|
-
else if (
|
|
1792
|
+
if (!a) return hn(`${e ? et(e) + ": " : ""}path MUST BE a json integer: '${n}'`), Un(t), parseInt(r);
|
|
1793
|
+
if (rr(o)) u = o ? 1 : 0;
|
|
1794
|
+
else if (tr(o)) u = function(e) {
|
|
1783
1795
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1784
1796
|
if (!t) return 0;
|
|
1785
1797
|
let n, r = t[2];
|
|
1786
1798
|
return n = r.length > 1 && ("x" === r[1] || "X" === r[1]) ? parseInt(r.substring(2), 16) : "0" === r[0] ? parseInt(r, 8) : parseInt(r, 10), "-" === t[1] ? -n : n;
|
|
1787
1799
|
}(o);
|
|
1788
1800
|
else {
|
|
1789
|
-
if (null !== o) return
|
|
1801
|
+
if (null !== o) return hn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Un(t), 0;
|
|
1790
1802
|
u = 0;
|
|
1791
1803
|
}
|
|
1792
1804
|
}
|
|
1793
|
-
return _ &&
|
|
1805
|
+
return _ && mr(e, t, n), u;
|
|
1794
1806
|
}
|
|
1795
1807
|
function Er(e, t, n, r, l) {
|
|
1796
|
-
e && !
|
|
1797
|
-
let o =
|
|
1798
|
-
const s = l && l &
|
|
1799
|
-
return void 0 === o ? i && t ? (
|
|
1800
|
-
let n =
|
|
1808
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1809
|
+
let o = pr(e, t, n, !1);
|
|
1810
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1811
|
+
return void 0 === o ? i && t ? (Or(e, t, n, tr(r) ? r : null), r) : (s && !function(e, t) {
|
|
1812
|
+
let n = tr(t) ? t.split("`") : [], r = e;
|
|
1801
1813
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1802
|
-
if (!
|
|
1814
|
+
if (!Zn(r) && !er(r)) return !1;
|
|
1803
1815
|
r = r[n[e]];
|
|
1804
1816
|
}
|
|
1805
|
-
return !(!
|
|
1806
|
-
}(t, n) && (
|
|
1817
|
+
return !(!Zn(r) && !er(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
1818
|
+
}(t, n) && (hn(`path not found: '${n}'`), Un(t)), r) : tr(o) ? (_ && mr(e, t, n), o) : (null !== o && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json str: '${n}'`), Un(t)), r);
|
|
1807
1819
|
}
|
|
1808
|
-
function
|
|
1809
|
-
e && !
|
|
1810
|
-
let o =
|
|
1811
|
-
const s = l && l &
|
|
1820
|
+
function Tr(e, t, n, r, l) {
|
|
1821
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1822
|
+
let o = pr(e, t, n, !1);
|
|
1823
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1812
1824
|
if (void 0 === o) {
|
|
1813
1825
|
if (i) {
|
|
1814
1826
|
let l = r;
|
|
1815
|
-
return
|
|
1827
|
+
return Or(e, t, n, l), l;
|
|
1816
1828
|
}
|
|
1817
|
-
return s && (
|
|
1829
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), r;
|
|
1818
1830
|
}
|
|
1819
|
-
return _ &&
|
|
1820
|
-
}
|
|
1821
|
-
function Tr(e, t, n, r, l) {
|
|
1822
|
-
e && !or(e) && mn("GObj bad instanceof");
|
|
1823
|
-
let o = br(e, t, n, !1);
|
|
1824
|
-
const s = l && l & Xt.KW_REQUIRED, i = l && l & Xt.KW_CREATE, _ = l && l & Xt.KW_EXTRACT;
|
|
1825
|
-
return void 0 === o ? i && Xn(r) && t ? (jr(e, t, n, r), r) : (s && (mn(`path not found: '${n}'`), Pn(t)), r) : Xn(o) ? (_ && pr(e, t, n), o) : (s && (mn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'`), Pn(t)), r);
|
|
1831
|
+
return _ && mr(e, t, n), o;
|
|
1826
1832
|
}
|
|
1827
1833
|
function vr(e, t, n, r, l) {
|
|
1828
|
-
e && !
|
|
1829
|
-
let o =
|
|
1830
|
-
const s = l && l &
|
|
1834
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1835
|
+
let o = pr(e, t, n, !1);
|
|
1836
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1837
|
+
return void 0 === o ? i && Zn(r) && t ? (Or(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : Zn(o) ? (_ && mr(e, t, n), o) : (s && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'`), Un(t)), r);
|
|
1838
|
+
}
|
|
1839
|
+
function jr(e, t, n, r, l) {
|
|
1840
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1841
|
+
let o = pr(e, t, n, !1);
|
|
1842
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1831
1843
|
if (void 0 === o) {
|
|
1832
1844
|
if (i) {
|
|
1833
1845
|
let l = r;
|
|
1834
|
-
return
|
|
1846
|
+
return Or(e, t, n, l), l;
|
|
1835
1847
|
}
|
|
1836
|
-
return s && (
|
|
1848
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), r;
|
|
1837
1849
|
}
|
|
1838
|
-
return _ &&
|
|
1850
|
+
return _ && mr(e, t, n), o;
|
|
1839
1851
|
}
|
|
1840
|
-
function
|
|
1841
|
-
if (e && !
|
|
1852
|
+
function Or(e, t, n, r) {
|
|
1853
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !Zn(t)) return hn("kw is not an object"), -1;
|
|
1842
1854
|
let l = n.split("`"), o = l.length;
|
|
1843
1855
|
for (let s = 0; s < o; s++) {
|
|
1844
1856
|
let i = l[s];
|
|
1845
|
-
if (s === o - 1)
|
|
1857
|
+
if (s === o - 1) br(t, i, r);
|
|
1846
1858
|
else {
|
|
1847
|
-
let r =
|
|
1848
|
-
if (void 0 === r)
|
|
1849
|
-
else if (!
|
|
1859
|
+
let r = dr(t, i) ? void 0 : t[i];
|
|
1860
|
+
if (void 0 === r) br(t, i, {});
|
|
1861
|
+
else if (!Zn(r) && !er(r)) return hn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not a dict or a list: '${n}'`), -1;
|
|
1850
1862
|
t = t[i];
|
|
1851
1863
|
}
|
|
1852
1864
|
}
|
|
1853
1865
|
return 0;
|
|
1854
1866
|
}
|
|
1855
|
-
function
|
|
1856
|
-
if (e && !
|
|
1857
|
-
let o =
|
|
1858
|
-
return
|
|
1867
|
+
function Sr(e, t, n, r, l) {
|
|
1868
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !Zn(t)) return hn("kw is not an object"), -1;
|
|
1869
|
+
let o = vr(e, t, n, {}, Zt.KW_CREATE);
|
|
1870
|
+
return Zn(o) ? (br(o, r, l), 0) : (hn("subdict is not an object"), -1);
|
|
1859
1871
|
}
|
|
1860
|
-
function
|
|
1872
|
+
function wr(e, t, r) {
|
|
1861
1873
|
let l = "", o = !1;
|
|
1862
|
-
if (
|
|
1874
|
+
if (er(t)) {
|
|
1863
1875
|
o = !1;
|
|
1864
1876
|
for (let s = 0; s < t.length; s++) {
|
|
1865
1877
|
let i = t[s];
|
|
1866
|
-
if (l =
|
|
1878
|
+
if (l = ir(r) ? n("%s", r) : n("%s`%d", r, s), o = wr(e, i, l), o) break;
|
|
1867
1879
|
}
|
|
1868
|
-
} else if (
|
|
1880
|
+
} else if (Zn(t)) {
|
|
1869
1881
|
o = !0;
|
|
1870
1882
|
let s = Object.keys(t);
|
|
1871
1883
|
for (let i = 0; i < s.length; i++) {
|
|
1872
1884
|
let _ = s[i], a = t[_];
|
|
1873
|
-
if (l =
|
|
1874
|
-
if (o =
|
|
1885
|
+
if (l = ir(r) ? n("%s", _) : n("%s`%s", r, _), er(a) || Zn(a)) {
|
|
1886
|
+
if (o = wr(e, a, l), !o) break;
|
|
1875
1887
|
continue;
|
|
1876
1888
|
}
|
|
1877
|
-
let u =
|
|
1878
|
-
if (void 0 === u && (u =
|
|
1889
|
+
let u = jr(0, e, l, void 0, 0);
|
|
1890
|
+
if (void 0 === u && (u = xn(e, l)), void 0 === u) {
|
|
1879
1891
|
o = !1;
|
|
1880
1892
|
break;
|
|
1881
1893
|
}
|
|
1882
|
-
if (0 !==
|
|
1894
|
+
if (0 !== cr(u, a)) {
|
|
1883
1895
|
o = !1;
|
|
1884
1896
|
break;
|
|
1885
1897
|
}
|
|
@@ -1887,37 +1899,37 @@ var gobjJs = function(e) {
|
|
|
1887
1899
|
}
|
|
1888
1900
|
return o;
|
|
1889
1901
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return 0 ===
|
|
1902
|
+
function Nr(e, t) {
|
|
1903
|
+
return 0 === Xn(t) || wr(e, t, "");
|
|
1892
1904
|
}
|
|
1893
|
-
function
|
|
1894
|
-
e && !
|
|
1905
|
+
function Rr(e, t, n, r) {
|
|
1906
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
1895
1907
|
let l = {};
|
|
1896
|
-
if (
|
|
1908
|
+
if (tr(n) && !ir(n)) {
|
|
1897
1909
|
let o = n;
|
|
1898
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1899
|
-
} else if (
|
|
1910
|
+
Object.prototype.hasOwnProperty.call(t, o) ? br(l, o, t[o]) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1911
|
+
} else if (Zn(n) && zn(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? br(l, o, t[o]) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1900
1912
|
else {
|
|
1901
|
-
if (!(
|
|
1913
|
+
if (!(er(n) && Qn(n) > 0)) return t;
|
|
1902
1914
|
for (let o = 0; o < n.length; o++) {
|
|
1903
1915
|
let s = n[o];
|
|
1904
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1916
|
+
Object.prototype.hasOwnProperty.call(t, s) ? br(l, s, t[s]) : r && hn(`${et(e)}: key not found: ${s}`);
|
|
1905
1917
|
}
|
|
1906
1918
|
}
|
|
1907
1919
|
return l;
|
|
1908
1920
|
}
|
|
1909
|
-
function
|
|
1921
|
+
function $r(e, t, n, r) {
|
|
1910
1922
|
let l = {};
|
|
1911
|
-
if (!
|
|
1912
|
-
if (
|
|
1923
|
+
if (!Zn(t)) return l;
|
|
1924
|
+
if (Gn(l, t), tr(n) && !ir(n)) {
|
|
1913
1925
|
let o = n;
|
|
1914
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1915
|
-
} else if (
|
|
1926
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Kn(l, o) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1927
|
+
} else if (Zn(n) && zn(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Kn(l, o) : r && hn(`${et(e)}: key not found: ${o}`);
|
|
1916
1928
|
else {
|
|
1917
|
-
if (!(
|
|
1929
|
+
if (!(er(n) && Qn(n) > 0)) return {};
|
|
1918
1930
|
for (let o = 0; o < n.length; o++) {
|
|
1919
1931
|
let s = n[o];
|
|
1920
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1932
|
+
Object.prototype.hasOwnProperty.call(t, s) ? Kn(l, s) : r && hn(`${et(e)}: key not found: ${s}`);
|
|
1921
1933
|
}
|
|
1922
1934
|
}
|
|
1923
1935
|
return l;
|
|
@@ -1925,21 +1937,21 @@ var gobjJs = function(e) {
|
|
|
1925
1937
|
function Dr(e, t, n = !1) {
|
|
1926
1938
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1927
1939
|
let r = window.localStorage.getItem(e);
|
|
1928
|
-
return null === r ? (n &&
|
|
1940
|
+
return null === r ? (n && kr(e, t), t) : JSON.parse(r);
|
|
1929
1941
|
} catch (n) {
|
|
1930
1942
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1931
1943
|
}
|
|
1932
1944
|
}
|
|
1933
|
-
function
|
|
1945
|
+
function kr(e, t) {
|
|
1934
1946
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1935
|
-
if (!e || void 0 === t) return
|
|
1947
|
+
if (!e || void 0 === t) return hn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1936
1948
|
try {
|
|
1937
1949
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1938
1950
|
} catch (t) {
|
|
1939
|
-
return
|
|
1951
|
+
return hn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1940
1952
|
}
|
|
1941
1953
|
}
|
|
1942
|
-
function
|
|
1954
|
+
function Ar(e) {
|
|
1943
1955
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1944
1956
|
window.localStorage.removeItem(e);
|
|
1945
1957
|
} catch (t) {
|
|
@@ -1947,46 +1959,46 @@ var gobjJs = function(e) {
|
|
|
1947
1959
|
}
|
|
1948
1960
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1949
1961
|
}
|
|
1950
|
-
function
|
|
1951
|
-
if (
|
|
1952
|
-
if (
|
|
1962
|
+
function Ir(e, t) {
|
|
1963
|
+
if (lr(e) || lr(t)) return !0;
|
|
1964
|
+
if (er(e)) {
|
|
1953
1965
|
if (0 === e.length) return !0;
|
|
1954
1966
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1955
|
-
} else if (
|
|
1967
|
+
} else if (Zn(e)) {
|
|
1956
1968
|
if (0 === Object.keys(e).length) return !0;
|
|
1957
1969
|
for (let n in e) if (n === t) return !0;
|
|
1958
|
-
} else if (
|
|
1970
|
+
} else if (tr(e) && e === t) return !0;
|
|
1959
1971
|
return !1;
|
|
1960
1972
|
}
|
|
1961
|
-
function
|
|
1962
|
-
if (e && !
|
|
1963
|
-
l || (l =
|
|
1973
|
+
function Cr(e, t, n, r, l) {
|
|
1974
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return null;
|
|
1975
|
+
l || (l = Nr);
|
|
1964
1976
|
let o = [];
|
|
1965
|
-
if (
|
|
1977
|
+
if (er(t)) for (let s = 0; s < t.length; s++) {
|
|
1966
1978
|
let i, _ = t[s];
|
|
1967
|
-
if (
|
|
1979
|
+
if (Zn(_)) i = Er(e, _, "id", "", 0);
|
|
1968
1980
|
else {
|
|
1969
|
-
if (!
|
|
1981
|
+
if (!tr(_)) continue;
|
|
1970
1982
|
i = _;
|
|
1971
1983
|
}
|
|
1972
|
-
|
|
1984
|
+
Ir(n, i) && l(_, r) && o.push(_);
|
|
1973
1985
|
}
|
|
1974
1986
|
else {
|
|
1975
|
-
if (!
|
|
1987
|
+
if (!Zn(t)) return hn("kw_collect() BAD kw parameter"), null;
|
|
1976
1988
|
for (let e of Object.keys(t)) {
|
|
1977
1989
|
let s = t[e];
|
|
1978
|
-
|
|
1990
|
+
Ir(n, e) && l(s, r) && o.push(s);
|
|
1979
1991
|
}
|
|
1980
1992
|
}
|
|
1981
1993
|
return o;
|
|
1982
1994
|
}
|
|
1983
|
-
function
|
|
1995
|
+
function Lr(e, t) {
|
|
1984
1996
|
if (!e) return -1;
|
|
1985
1997
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1986
1998
|
return -1;
|
|
1987
1999
|
}
|
|
1988
|
-
function
|
|
1989
|
-
if (!e || !t) return
|
|
2000
|
+
function Pr(e, t, n) {
|
|
2001
|
+
if (!e || !t) return hn("ERROR: str_in_list() list or str empty"), !1;
|
|
1990
2002
|
let r = e.length;
|
|
1991
2003
|
if (n) {
|
|
1992
2004
|
t = t.toLowerCase();
|
|
@@ -1997,7 +2009,7 @@ var gobjJs = function(e) {
|
|
|
1997
2009
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1998
2010
|
return !1;
|
|
1999
2011
|
}
|
|
2000
|
-
function
|
|
2012
|
+
function Ur(e, t) {
|
|
2001
2013
|
try {
|
|
2002
2014
|
let n = e.__md_iev__;
|
|
2003
2015
|
if (n) return n[t];
|
|
@@ -2005,35 +2017,35 @@ var gobjJs = function(e) {
|
|
|
2005
2017
|
return;
|
|
2006
2018
|
}
|
|
2007
2019
|
}
|
|
2008
|
-
function
|
|
2020
|
+
function Fr(e, t, n) {
|
|
2009
2021
|
let r = e.__md_iev__;
|
|
2010
2022
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2011
2023
|
}
|
|
2012
|
-
function
|
|
2013
|
-
if (!
|
|
2024
|
+
function Vr(e, t, n, r) {
|
|
2025
|
+
if (!sr(e)) return hn("gobj is not a GObj"), null;
|
|
2014
2026
|
if (!t) return;
|
|
2015
|
-
let l =
|
|
2016
|
-
l || (l = [],
|
|
2027
|
+
let l = Ur(t, n);
|
|
2028
|
+
l || (l = [], Fr(t, n, l));
|
|
2017
2029
|
try {
|
|
2018
|
-
|
|
2030
|
+
er(l) && l.unshift(r);
|
|
2019
2031
|
} catch (e) {
|
|
2020
|
-
|
|
2032
|
+
hn(e);
|
|
2021
2033
|
}
|
|
2022
2034
|
}
|
|
2023
|
-
function
|
|
2024
|
-
if (!
|
|
2025
|
-
if (!
|
|
2026
|
-
let l =
|
|
2027
|
-
return l ? 0 === l.length ? (r &&
|
|
2035
|
+
function Gr(e, t, n, r) {
|
|
2036
|
+
if (!sr(e)) return hn("gobj is not a GObj"), null;
|
|
2037
|
+
if (!Zn(t)) return hn("kw is not a dict"), null;
|
|
2038
|
+
let l = Ur(t, n);
|
|
2039
|
+
return l ? 0 === l.length ? (r && hn(`stack empty: ${n}`), null) : l[0] : (r && hn(`stack NOT FOUND: ${n}`), null);
|
|
2028
2040
|
}
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2041
|
+
function Mr(e, t, n) {
|
|
2042
|
+
return ir(n) ? mr(e, t, "__md_iev__`__msg_type__") : Sr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2031
2043
|
}
|
|
2032
|
-
function
|
|
2044
|
+
function Wr(e, t) {
|
|
2033
2045
|
return Er(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2034
2046
|
}
|
|
2035
|
-
function
|
|
2036
|
-
void 0 !== n &&
|
|
2047
|
+
function xr(e, t, n) {
|
|
2048
|
+
void 0 !== n && tr(n) || (n = "");
|
|
2037
2049
|
for (let r of Object.keys(e)) {
|
|
2038
2050
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2039
2051
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2042,10 +2054,10 @@ var gobjJs = function(e) {
|
|
|
2042
2054
|
r,
|
|
2043
2055
|
e[r],
|
|
2044
2056
|
n
|
|
2045
|
-
]),
|
|
2057
|
+
]), Zn(e[r]) && xr(e[r], t, n), n = n.slice(0, -l.length);
|
|
2046
2058
|
}
|
|
2047
2059
|
}
|
|
2048
|
-
function
|
|
2060
|
+
function Kr(e, t, n, r) {
|
|
2049
2061
|
if (!e) return null;
|
|
2050
2062
|
let l, o = e.length;
|
|
2051
2063
|
for (l = 0; l < o; l++) {
|
|
@@ -2053,15 +2065,15 @@ var gobjJs = function(e) {
|
|
|
2053
2065
|
if (o) {
|
|
2054
2066
|
let e = o.id;
|
|
2055
2067
|
if (e && e === n) return o;
|
|
2056
|
-
if (r &&
|
|
2057
|
-
let e =
|
|
2068
|
+
if (r && gr(o, t)) {
|
|
2069
|
+
let e = Kr(o[t], t, n, r);
|
|
2058
2070
|
if (e) return e;
|
|
2059
2071
|
}
|
|
2060
2072
|
}
|
|
2061
2073
|
}
|
|
2062
2074
|
return null;
|
|
2063
2075
|
}
|
|
2064
|
-
function
|
|
2076
|
+
function Yr(e) {
|
|
2065
2077
|
function t(e) {
|
|
2066
2078
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2067
2079
|
switch (t.length % 4) {
|
|
@@ -2092,36 +2104,52 @@ var gobjJs = function(e) {
|
|
|
2092
2104
|
signature: t(n[2])
|
|
2093
2105
|
};
|
|
2094
2106
|
}
|
|
2095
|
-
function
|
|
2107
|
+
function Br(e) {
|
|
2096
2108
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2097
2109
|
}
|
|
2098
|
-
|
|
2110
|
+
var Jr = class {
|
|
2111
|
+
constructor(e) {
|
|
2112
|
+
this.html = e, Object.freeze(this);
|
|
2113
|
+
}
|
|
2114
|
+
toString() {
|
|
2115
|
+
return this.html;
|
|
2116
|
+
}
|
|
2117
|
+
};
|
|
2118
|
+
function qr(e) {
|
|
2119
|
+
return e instanceof Jr;
|
|
2120
|
+
}
|
|
2121
|
+
function Hr(e) {
|
|
2122
|
+
const t = document.createElement("template");
|
|
2123
|
+
return t.innerHTML = e.html.trim(), t.content;
|
|
2124
|
+
}
|
|
2125
|
+
var zr = !1, Qr = /* @__PURE__ */ new Set();
|
|
2126
|
+
function Xr(e) {
|
|
2099
2127
|
const t = document.createElement("template");
|
|
2100
2128
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2101
2129
|
}
|
|
2102
|
-
function
|
|
2130
|
+
function Zr(e) {
|
|
2103
2131
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2104
2132
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2105
2133
|
}
|
|
2106
|
-
function
|
|
2134
|
+
function el(e, t) {
|
|
2107
2135
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2108
2136
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2109
2137
|
return -1;
|
|
2110
2138
|
}
|
|
2111
|
-
function
|
|
2139
|
+
function tl() {
|
|
2112
2140
|
let e = "";
|
|
2113
2141
|
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;
|
|
2114
2142
|
}
|
|
2115
|
-
function
|
|
2143
|
+
function nl(e) {
|
|
2116
2144
|
let t = null;
|
|
2117
2145
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2118
2146
|
}
|
|
2119
|
-
var
|
|
2120
|
-
function
|
|
2147
|
+
var rl = 256, ll = 1e5;
|
|
2148
|
+
function ol(e) {
|
|
2121
2149
|
const t = String(e).replace(/`/g, "``");
|
|
2122
2150
|
return "[" === t[0] ? "[" + t : t;
|
|
2123
2151
|
}
|
|
2124
|
-
function
|
|
2152
|
+
function sl(e) {
|
|
2125
2153
|
if ("string" != typeof e) return null;
|
|
2126
2154
|
let t = [], n = "";
|
|
2127
2155
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2142,17 +2170,17 @@ var gobjJs = function(e) {
|
|
|
2142
2170
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2143
2171
|
});
|
|
2144
2172
|
}
|
|
2145
|
-
function
|
|
2173
|
+
function il(e, t) {
|
|
2146
2174
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2147
2175
|
}
|
|
2148
|
-
function
|
|
2176
|
+
function _l(e) {
|
|
2149
2177
|
return "persistent-attrs-" + et(e);
|
|
2150
2178
|
}
|
|
2151
|
-
function
|
|
2152
|
-
if (
|
|
2179
|
+
function al(e, t) {
|
|
2180
|
+
if (tr(t)) {
|
|
2153
2181
|
if (-1 === t.indexOf("^")) {
|
|
2154
2182
|
let n, r, l = e.fkey;
|
|
2155
|
-
if (1 !==
|
|
2183
|
+
if (1 !== zn(l)) return hn("bad fkey 1"), hn(e), hn(t), null;
|
|
2156
2184
|
for (const e of Object.keys(l)) {
|
|
2157
2185
|
n = e, r = l[e];
|
|
2158
2186
|
break;
|
|
@@ -2165,20 +2193,20 @@ var gobjJs = function(e) {
|
|
|
2165
2193
|
}
|
|
2166
2194
|
{
|
|
2167
2195
|
let n = t.split("^");
|
|
2168
|
-
return 3 !== n.length ? (
|
|
2196
|
+
return 3 !== n.length ? (hn("bad fkey 2"), hn(e), hn(t), null) : {
|
|
2169
2197
|
topic_name: n[0],
|
|
2170
2198
|
id: n[1],
|
|
2171
2199
|
hook_name: n[2]
|
|
2172
2200
|
};
|
|
2173
2201
|
}
|
|
2174
2202
|
}
|
|
2175
|
-
return
|
|
2203
|
+
return Zn(t) ? {
|
|
2176
2204
|
topic_name: t.topic_name,
|
|
2177
2205
|
id: t.id,
|
|
2178
2206
|
hook_name: t.hook_name
|
|
2179
|
-
} : (
|
|
2207
|
+
} : (hn("bad fkey 3"), hn(e), hn(t), null);
|
|
2180
2208
|
}
|
|
2181
|
-
var
|
|
2209
|
+
var ul = [
|
|
2182
2210
|
"string",
|
|
2183
2211
|
"integer",
|
|
2184
2212
|
"object",
|
|
@@ -2188,7 +2216,7 @@ var gobjJs = function(e) {
|
|
|
2188
2216
|
"real",
|
|
2189
2217
|
"boolean",
|
|
2190
2218
|
"blob"
|
|
2191
|
-
],
|
|
2219
|
+
], cl = [
|
|
2192
2220
|
"persistent",
|
|
2193
2221
|
"required",
|
|
2194
2222
|
"notnull",
|
|
@@ -2200,7 +2228,7 @@ var gobjJs = function(e) {
|
|
|
2200
2228
|
"stats",
|
|
2201
2229
|
"rstats",
|
|
2202
2230
|
"pstats"
|
|
2203
|
-
],
|
|
2231
|
+
], fl = [
|
|
2204
2232
|
"hook",
|
|
2205
2233
|
"fkey",
|
|
2206
2234
|
"enum",
|
|
@@ -2229,7 +2257,7 @@ var gobjJs = function(e) {
|
|
|
2229
2257
|
"coordinates",
|
|
2230
2258
|
"gbuffer"
|
|
2231
2259
|
];
|
|
2232
|
-
function
|
|
2260
|
+
function gl(e) {
|
|
2233
2261
|
let t = {
|
|
2234
2262
|
name: e.id,
|
|
2235
2263
|
header: e.header,
|
|
@@ -2248,7 +2276,7 @@ var gobjJs = function(e) {
|
|
|
2248
2276
|
if (!e.flag) return t;
|
|
2249
2277
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2250
2278
|
let r = e.flag[n];
|
|
2251
|
-
if (
|
|
2279
|
+
if (Pr(fl, r)) {
|
|
2252
2280
|
switch (r) {
|
|
2253
2281
|
case "enum":
|
|
2254
2282
|
t.enum_list = e.enum;
|
|
@@ -2262,7 +2290,7 @@ var gobjJs = function(e) {
|
|
|
2262
2290
|
case "file": t.is_file = !0;
|
|
2263
2291
|
}
|
|
2264
2292
|
t.type = r;
|
|
2265
|
-
} else if (
|
|
2293
|
+
} else if (Pr(cl, r)) switch (r) {
|
|
2266
2294
|
case "writable":
|
|
2267
2295
|
t.is_writable = !0;
|
|
2268
2296
|
break;
|
|
@@ -2275,27 +2303,27 @@ var gobjJs = function(e) {
|
|
|
2275
2303
|
}
|
|
2276
2304
|
return t.is_file && (t.type = "file"), t;
|
|
2277
2305
|
}
|
|
2278
|
-
var
|
|
2279
|
-
j(
|
|
2280
|
-
j(
|
|
2281
|
-
j(
|
|
2306
|
+
var dl = [
|
|
2307
|
+
j(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2308
|
+
j(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2309
|
+
j(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2282
2310
|
v()
|
|
2283
|
-
],
|
|
2311
|
+
], bl = {
|
|
2284
2312
|
periodic: !1,
|
|
2285
2313
|
msec: 0,
|
|
2286
2314
|
timer_id: -1
|
|
2287
|
-
},
|
|
2288
|
-
function
|
|
2315
|
+
}, pl = null;
|
|
2316
|
+
function ml(e, t, n, r) {
|
|
2289
2317
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2290
2318
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2291
|
-
|
|
2292
|
-
}, l.msec) : l.timer_id = -1, lt(e) ?
|
|
2319
|
+
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2320
|
+
}, l.msec) : l.timer_id = -1, lt(e) ? Vt(nt(e), o, {}, e) : Xt(e, o, {}), l.periodic || -1 !== l.timer_id || Ke(e) && Ve(e), 0;
|
|
2293
2321
|
}
|
|
2294
|
-
var
|
|
2322
|
+
var hl = {
|
|
2295
2323
|
mt_create: function(e) {
|
|
2296
2324
|
let t = e.priv;
|
|
2297
2325
|
const n = Ot(e, "subscriber");
|
|
2298
|
-
n &&
|
|
2326
|
+
n && qt(e, null, {}, n), t.periodic = Tt(e, "periodic"), t.msec = vt(e, "msec");
|
|
2299
2327
|
},
|
|
2300
2328
|
mt_writing: function(e, t) {
|
|
2301
2329
|
let n = e.priv;
|
|
@@ -2304,7 +2332,7 @@ var gobjJs = function(e) {
|
|
|
2304
2332
|
n.periodic = Tt(e, "periodic");
|
|
2305
2333
|
break;
|
|
2306
2334
|
case "msec": n.msec = vt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2307
|
-
|
|
2335
|
+
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2308
2336
|
}, n.msec)), n.msec > 0 ? Ke(e) || Pe(e) : Ke(e) && Ve(e);
|
|
2309
2337
|
}
|
|
2310
2338
|
},
|
|
@@ -2316,92 +2344,92 @@ var gobjJs = function(e) {
|
|
|
2316
2344
|
},
|
|
2317
2345
|
mt_destroy: function(e) {}
|
|
2318
2346
|
};
|
|
2319
|
-
function
|
|
2320
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2321
|
-
}
|
|
2322
|
-
function
|
|
2323
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2324
|
-
}
|
|
2325
|
-
function
|
|
2326
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2327
|
-
}
|
|
2328
|
-
var
|
|
2329
|
-
j(
|
|
2330
|
-
j(
|
|
2331
|
-
j(
|
|
2332
|
-
j(
|
|
2333
|
-
j(
|
|
2334
|
-
j(
|
|
2335
|
-
j(
|
|
2336
|
-
j(
|
|
2337
|
-
j(
|
|
2338
|
-
j(
|
|
2339
|
-
j(
|
|
2340
|
-
j(
|
|
2341
|
-
j(
|
|
2342
|
-
j(
|
|
2343
|
-
j(
|
|
2344
|
-
j(
|
|
2345
|
-
j(
|
|
2346
|
-
j(
|
|
2347
|
+
function yl(e, t) {
|
|
2348
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (hn("not GObj TYPE"), -1);
|
|
2349
|
+
}
|
|
2350
|
+
function El(e, t) {
|
|
2351
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void Rt(e, "msec", t)) : (hn("not GObj TYPE"), -1);
|
|
2352
|
+
}
|
|
2353
|
+
function Tl(e) {
|
|
2354
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (hn("not GObj TYPE"), -1);
|
|
2355
|
+
}
|
|
2356
|
+
var vl = [
|
|
2357
|
+
j(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2358
|
+
j(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2359
|
+
j(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
2360
|
+
j(y.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
2361
|
+
j(y.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
2362
|
+
j(y.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
2363
|
+
j(y.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
2364
|
+
j(y.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
2365
|
+
j(y.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
2366
|
+
j(y.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
2367
|
+
j(y.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2368
|
+
j(y.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2369
|
+
j(y.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2370
|
+
j(y.DTP_DICT, "trace_levels", E.SDF_PERSIST, "{}", "Trace levels"),
|
|
2371
|
+
j(y.DTP_DICT, "no_trace_levels", E.SDF_PERSIST, "{}", "No trace levels"),
|
|
2372
|
+
j(y.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2373
|
+
j(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2374
|
+
j(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2347
2375
|
v()
|
|
2348
|
-
],
|
|
2349
|
-
function
|
|
2350
|
-
let l =
|
|
2351
|
-
return
|
|
2376
|
+
], jl = { gobj_timer: null }, Ol = null;
|
|
2377
|
+
function Sl(e, t, n, r) {
|
|
2378
|
+
let l = yt(e, t);
|
|
2379
|
+
return Zn(l) || (l = {}), l[n] = r, St(e, t, l), De(e, t);
|
|
2352
2380
|
}
|
|
2353
|
-
function
|
|
2381
|
+
function wl(e) {
|
|
2354
2382
|
if (!0 === e || !1 === e) return e;
|
|
2355
2383
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2356
2384
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2357
2385
|
}
|
|
2358
|
-
function
|
|
2386
|
+
function Nl() {
|
|
2359
2387
|
return `${ze()}^${He()}`;
|
|
2360
2388
|
}
|
|
2361
|
-
function
|
|
2362
|
-
return
|
|
2389
|
+
function Rl(e, t, n, r) {
|
|
2390
|
+
return Xt(e, t, n), 0;
|
|
2363
2391
|
}
|
|
2364
|
-
var
|
|
2392
|
+
var $l = {
|
|
2365
2393
|
mt_create: function(e) {
|
|
2366
2394
|
let t = e.priv;
|
|
2367
|
-
|
|
2368
|
-
let t =
|
|
2369
|
-
if (!
|
|
2395
|
+
$t(e, "start_date", Zr()), $t(e, "node_uuid", tl()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = yt(e, "periodic_timeout"), function(e) {
|
|
2396
|
+
let t = yt(e, "trace_levels");
|
|
2397
|
+
if (!Zn(t)) return 0;
|
|
2370
2398
|
let n = t.__global_trace__;
|
|
2371
|
-
if (
|
|
2399
|
+
if (er(n)) {
|
|
2372
2400
|
Z(4294967295, !1);
|
|
2373
2401
|
for (let e of n) Q(e, !0);
|
|
2374
2402
|
}
|
|
2375
2403
|
for (const [n, r] of Object.entries(t)) {
|
|
2376
2404
|
let t = Oe(n);
|
|
2377
|
-
if (t) if (
|
|
2405
|
+
if (t) if (er(r)) {
|
|
2378
2406
|
se(t, null, !1);
|
|
2379
2407
|
for (let e of r) se(t, e, !0);
|
|
2380
|
-
} else
|
|
2408
|
+
} else hn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2381
2409
|
}
|
|
2382
2410
|
}(e), function(e) {
|
|
2383
|
-
let t =
|
|
2384
|
-
if (!
|
|
2411
|
+
let t = yt(e, "no_trace_levels");
|
|
2412
|
+
if (!Zn(t)) return 0;
|
|
2385
2413
|
let n = t.__global_no_trace__;
|
|
2386
|
-
if (
|
|
2414
|
+
if (er(n)) {
|
|
2387
2415
|
ee(4294967295, !1);
|
|
2388
2416
|
for (let e of n) X(e, !0);
|
|
2389
2417
|
}
|
|
2390
2418
|
for (const [n, r] of Object.entries(t)) {
|
|
2391
2419
|
let t = Oe(n);
|
|
2392
|
-
if (t) if (
|
|
2420
|
+
if (t) if (er(r)) {
|
|
2393
2421
|
ie(t, null, !1);
|
|
2394
2422
|
for (let e of r) ie(t, e, !0);
|
|
2395
|
-
} else
|
|
2423
|
+
} else hn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2396
2424
|
}
|
|
2397
2425
|
}(e);
|
|
2398
2426
|
},
|
|
2399
2427
|
mt_writing: function(e, t) {},
|
|
2400
2428
|
mt_start: function(e) {
|
|
2401
|
-
return
|
|
2429
|
+
return El(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2402
2430
|
},
|
|
2403
2431
|
mt_stop: function(e) {
|
|
2404
|
-
return
|
|
2432
|
+
return Tl(e.priv.gobj_timer), Me(e), 0;
|
|
2405
2433
|
},
|
|
2406
2434
|
mt_destroy: function(e) {},
|
|
2407
2435
|
mt_play: function(e) {
|
|
@@ -2418,49 +2446,49 @@ var gobjJs = function(e) {
|
|
|
2418
2446
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2419
2447
|
case "set-global-trace":
|
|
2420
2448
|
case "set-global-no-trace": {
|
|
2421
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2422
|
-
return o ? null === s ? l(0, -1, `${
|
|
2449
|
+
let r = "set-global-no-trace" === t, o = n.level, s = wl(n.set);
|
|
2450
|
+
return o ? null === s ? l(0, -1, `${Nl()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${Nl()}: global trace level not found: ${o}`, null, null) : r ? (Sl(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (Sl(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${Nl()}: what level?`, null, null);
|
|
2423
2451
|
}
|
|
2424
2452
|
case "get-gclass-trace":
|
|
2425
2453
|
case "get-gclass-no-trace":
|
|
2426
2454
|
case "set-gclass-trace":
|
|
2427
2455
|
case "set-gclass-no-trace": {
|
|
2428
2456
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Oe(o);
|
|
2429
|
-
if (!s) return l(0, -1, `${
|
|
2457
|
+
if (!s) return l(0, -1, `${Nl()}: what gclass is '${o}'?`, null, null);
|
|
2430
2458
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2431
|
-
let i = n.level, _ =
|
|
2432
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2459
|
+
let i = n.level, _ = wl(n.set);
|
|
2460
|
+
return i ? null === _ ? l(0, -1, `${Nl()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${Nl()}: trace level of ${o} not found: ${i}`, null, null) : r ? (Sl(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (Sl(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${Nl()}: what level?`, null, null);
|
|
2433
2461
|
}
|
|
2434
|
-
default: return l(0, -1, `${
|
|
2462
|
+
default: return l(0, -1, `${Nl()}: command not available: ${t}`, null, null);
|
|
2435
2463
|
}
|
|
2436
2464
|
}
|
|
2437
2465
|
};
|
|
2438
|
-
var
|
|
2439
|
-
j(
|
|
2440
|
-
j(
|
|
2441
|
-
j(
|
|
2442
|
-
j(
|
|
2443
|
-
j(
|
|
2444
|
-
j(
|
|
2445
|
-
j(
|
|
2446
|
-
j(
|
|
2447
|
-
j(
|
|
2448
|
-
j(
|
|
2449
|
-
j(
|
|
2450
|
-
j(
|
|
2451
|
-
j(
|
|
2452
|
-
j(
|
|
2453
|
-
j(
|
|
2466
|
+
var Dl = "ievent_gate_stack", kl = [
|
|
2467
|
+
j(y.DTP_STRING, "wanted_yuno_role", E.SDF_RD, "", "wanted yuno role"),
|
|
2468
|
+
j(y.DTP_STRING, "wanted_yuno_name", E.SDF_RD, "", "wanted yuno name"),
|
|
2469
|
+
j(y.DTP_STRING, "wanted_yuno_service", E.SDF_RD, "", "wanted yuno service"),
|
|
2470
|
+
j(y.DTP_STRING, "remote_yuno_role", E.SDF_RD, "", "confirmed remote yuno role"),
|
|
2471
|
+
j(y.DTP_STRING, "remote_yuno_name", E.SDF_RD, "", "confirmed remote yuno name"),
|
|
2472
|
+
j(y.DTP_STRING, "remote_yuno_service", E.SDF_RD, "", "confirmed remote yuno service"),
|
|
2473
|
+
j(y.DTP_STRING, "url", E.SDF_RD, "", "Url to connect"),
|
|
2474
|
+
j(y.DTP_STRING, "jwt", E.SDF_PERSIST, "", "JWT"),
|
|
2475
|
+
j(y.DTP_STRING, "cert_pem", E.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2476
|
+
j(y.DTP_JSON, "extra_info", E.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2477
|
+
j(y.DTP_LIST, "required_services", E.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
2478
|
+
j(y.DTP_INTEGER, "timeout_retry", E.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2479
|
+
j(y.DTP_INTEGER, "timeout_retry_max", E.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2480
|
+
j(y.DTP_INTEGER, "timeout_idack", E.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2481
|
+
j(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2454
2482
|
v()
|
|
2455
|
-
],
|
|
2483
|
+
], Al = [
|
|
2456
2484
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2457
2485
|
["ievents2", "Trace inter-events with full kw"],
|
|
2458
2486
|
["identity-card", "Trace identity_card messages"]
|
|
2459
2487
|
];
|
|
2460
|
-
function
|
|
2488
|
+
function Il(e) {
|
|
2461
2489
|
return !!(3 & x(e));
|
|
2462
2490
|
}
|
|
2463
|
-
var
|
|
2491
|
+
var Cl = {
|
|
2464
2492
|
url: null,
|
|
2465
2493
|
remote_yuno_name: null,
|
|
2466
2494
|
remote_yuno_role: null,
|
|
@@ -2470,94 +2498,100 @@ var gobjJs = function(e) {
|
|
|
2470
2498
|
websocket: null,
|
|
2471
2499
|
inside_on_open: !1,
|
|
2472
2500
|
retry_ms: 0
|
|
2473
|
-
},
|
|
2474
|
-
function
|
|
2475
|
-
e.priv.websocket &&
|
|
2501
|
+
}, Ll = null;
|
|
2502
|
+
function Pl(e) {
|
|
2503
|
+
e.priv.websocket && hn("Websocket ALREADY setup");
|
|
2476
2504
|
const t = jt(e, "url");
|
|
2477
2505
|
En(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2478
2506
|
const n = ++e.priv.ws_seq;
|
|
2479
2507
|
let r;
|
|
2480
2508
|
try {
|
|
2481
2509
|
r = new WebSocket(t);
|
|
2482
|
-
} catch (
|
|
2483
|
-
return
|
|
2510
|
+
} catch (r) {
|
|
2511
|
+
return hn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), Ut(e, "EV_ON_CLOSE", {
|
|
2512
|
+
url: t,
|
|
2513
|
+
ws_seq: n,
|
|
2514
|
+
code: 1006,
|
|
2515
|
+
reason: r.message,
|
|
2516
|
+
was_clean: !1
|
|
2517
|
+
}, e), null;
|
|
2484
2518
|
}
|
|
2485
2519
|
return r ? (r.onopen = () => {
|
|
2486
|
-
n !== e.priv.ws_seq || ot(e) ||
|
|
2520
|
+
n !== e.priv.ws_seq || ot(e) || Vt(e, "EV_ON_OPEN", {
|
|
2487
2521
|
url: t,
|
|
2488
2522
|
ws_seq: n
|
|
2489
2523
|
}, e);
|
|
2490
2524
|
}, r.onmessage = (r) => {
|
|
2491
|
-
n !== e.priv.ws_seq || ot(e) ||
|
|
2525
|
+
n !== e.priv.ws_seq || ot(e) || Vt(e, "EV_ON_MESSAGE", {
|
|
2492
2526
|
url: t,
|
|
2493
2527
|
data: r.data
|
|
2494
2528
|
}, e);
|
|
2495
2529
|
}, r.onclose = (r) => {
|
|
2496
|
-
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ?
|
|
2530
|
+
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ? yn("Close websocket by unload page") : Vt(e, "EV_ON_CLOSE", {
|
|
2497
2531
|
url: t,
|
|
2498
2532
|
ws_seq: n,
|
|
2499
2533
|
code: r.code,
|
|
2500
2534
|
reason: r.reason,
|
|
2501
2535
|
was_clean: r.wasClean
|
|
2502
2536
|
}, e));
|
|
2503
|
-
}, r) : (
|
|
2537
|
+
}, r) : (hn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2504
2538
|
}
|
|
2505
|
-
function
|
|
2539
|
+
function Ul(e, t = 1e3, n = "") {
|
|
2506
2540
|
let r = e.priv, l = r.websocket;
|
|
2507
2541
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2508
2542
|
En(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2509
2543
|
try {
|
|
2510
2544
|
l.close(t, n);
|
|
2511
2545
|
} catch (t) {
|
|
2512
|
-
|
|
2546
|
+
hn(`${et(e)}: Error closing WebSocket: ${t.message}`);
|
|
2513
2547
|
}
|
|
2514
|
-
} else
|
|
2548
|
+
} else yn("WebSocket is already closed or in the process of closing.");
|
|
2515
2549
|
}
|
|
2516
|
-
function
|
|
2517
|
-
let r =
|
|
2550
|
+
function Fl(e, t, n) {
|
|
2551
|
+
let r = Zr();
|
|
2518
2552
|
try {
|
|
2519
|
-
En("\n" + r + " " + t + "\n"),
|
|
2553
|
+
En("\n" + r + " " + t + "\n"), Un(n);
|
|
2520
2554
|
} catch (e) {
|
|
2521
2555
|
En("ERROR in trace_inter_event: " + e);
|
|
2522
2556
|
}
|
|
2523
2557
|
}
|
|
2524
|
-
var
|
|
2558
|
+
var Vl = class {
|
|
2525
2559
|
constructor(e, t) {
|
|
2526
2560
|
this.event = e, this.kw = t || {};
|
|
2527
2561
|
}
|
|
2528
2562
|
};
|
|
2529
|
-
function
|
|
2563
|
+
function Gl(e, t, n, r) {
|
|
2530
2564
|
return function(e, t) {
|
|
2531
2565
|
let n = e.priv, r = JSON.stringify(t);
|
|
2532
|
-
if (
|
|
2533
|
-
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o =
|
|
2534
|
-
o ? o(l, t, 1, r.length) :
|
|
2566
|
+
if (Il(e)) {
|
|
2567
|
+
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o = yt(qe(), "trace_ievent_callback");
|
|
2568
|
+
o ? o(l, t, 1, r.length) : Fl(0, l, t);
|
|
2535
2569
|
}
|
|
2536
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2570
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return yn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2537
2571
|
try {
|
|
2538
2572
|
n.websocket.send(r);
|
|
2539
2573
|
} catch (t) {
|
|
2540
|
-
|
|
2574
|
+
hn(`${et(e)}: send_iev(): ${t}`);
|
|
2541
2575
|
}
|
|
2542
2576
|
return 0;
|
|
2543
2577
|
}(e, function(e, t) {
|
|
2544
|
-
return
|
|
2578
|
+
return ir(e) ? (hn("iev_create() event NULL"), null) : new Vl(e, t);
|
|
2545
2579
|
}(t, n));
|
|
2546
2580
|
}
|
|
2547
|
-
function
|
|
2548
|
-
return
|
|
2581
|
+
function Ml(e, t, n) {
|
|
2582
|
+
return ir(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2549
2583
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2550
2584
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
2551
2585
|
dst_service: n,
|
|
2552
2586
|
src_yuno: He(),
|
|
2553
2587
|
src_role: ze(),
|
|
2554
2588
|
src_service: t,
|
|
2555
|
-
host:
|
|
2589
|
+
host: tl()
|
|
2556
2590
|
};
|
|
2557
2591
|
}
|
|
2558
|
-
function
|
|
2559
|
-
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i =
|
|
2560
|
-
i && i.length || (i =
|
|
2592
|
+
function Wl(e) {
|
|
2593
|
+
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i = yt(e, "required_services");
|
|
2594
|
+
i && i.length || (i = yt(qe(), "required_services"));
|
|
2561
2595
|
let _ = {
|
|
2562
2596
|
yuno_role: ze(),
|
|
2563
2597
|
yuno_id: Qe(),
|
|
@@ -2573,34 +2607,34 @@ var gobjJs = function(e) {
|
|
|
2573
2607
|
username: jt(qe(), "__username__"),
|
|
2574
2608
|
launch_id: 0,
|
|
2575
2609
|
yuno_startdate: jt(qe(), "start_date"),
|
|
2576
|
-
id:
|
|
2610
|
+
id: tl(),
|
|
2577
2611
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2578
2612
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2579
2613
|
required_services: i
|
|
2580
2614
|
};
|
|
2581
|
-
return
|
|
2615
|
+
return Vr(e, _, Dl, Ml(e, Xe(nt(e)), null)), Mr(e, _, "__identity__"), yl(t.gobj_timer, vt(e, "timeout_idack")), Gl(e, "EV_IDENTITY_CARD", _);
|
|
2582
2616
|
}
|
|
2583
|
-
function
|
|
2584
|
-
if (
|
|
2617
|
+
function xl(e, t) {
|
|
2618
|
+
if (ir(t.event)) return -1;
|
|
2585
2619
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2586
2620
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2587
|
-
return
|
|
2621
|
+
return Vr(e, n, Dl, Ml(e, Xe(i), s)), Mr(e, n, "__subscribing__"), Gl(e, t.event, n);
|
|
2588
2622
|
}
|
|
2589
|
-
function
|
|
2623
|
+
function Kl(e, t, n, r) {
|
|
2590
2624
|
let l = e.priv;
|
|
2591
|
-
return Ke(e) && (l.websocket =
|
|
2625
|
+
return Ke(e) && (l.websocket = Pl(e)), 0;
|
|
2592
2626
|
}
|
|
2593
|
-
function
|
|
2594
|
-
return En("Websocket opened: " + e.priv.url),
|
|
2627
|
+
function Yl(e, t, n, r) {
|
|
2628
|
+
return En("Websocket opened: " + e.priv.url), Wl(e), 0;
|
|
2595
2629
|
}
|
|
2596
|
-
function
|
|
2630
|
+
function Bl(e, t, n, r) {
|
|
2597
2631
|
let l = e.priv, o = n.url;
|
|
2598
|
-
return
|
|
2632
|
+
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(), yn(`${et(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Xt(e, "EV_ON_CLOSE", {
|
|
2599
2633
|
url: o,
|
|
2600
2634
|
remote_yuno_name: l.remote_yuno_name,
|
|
2601
2635
|
remote_yuno_role: l.remote_yuno_role,
|
|
2602
2636
|
remote_yuno_service: l.remote_yuno_service
|
|
2603
|
-
})) : (
|
|
2637
|
+
})) : Ke(e) && (yn(`${et(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Xt(e, "EV_ON_OPEN_ERROR", {
|
|
2604
2638
|
url: o,
|
|
2605
2639
|
remote_yuno_name: l.remote_yuno_name,
|
|
2606
2640
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -2608,25 +2642,25 @@ var gobjJs = function(e) {
|
|
|
2608
2642
|
code: n.code,
|
|
2609
2643
|
reason: n.reason,
|
|
2610
2644
|
was_clean: n.was_clean
|
|
2611
|
-
})), Ke(e) &&
|
|
2645
|
+
})), Ke(e) && yl(l.gobj_timer, function(e) {
|
|
2612
2646
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2613
2647
|
r < n && (r = n);
|
|
2614
2648
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2615
2649
|
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
2616
2650
|
return Math.max(1, Math.round(o));
|
|
2617
|
-
}(e)), 0;
|
|
2651
|
+
}(e))), 0;
|
|
2618
2652
|
}
|
|
2619
|
-
function
|
|
2620
|
-
return
|
|
2653
|
+
function Jl(e, t, n, r) {
|
|
2654
|
+
return Wl(e), 0;
|
|
2621
2655
|
}
|
|
2622
|
-
function
|
|
2656
|
+
function ql(e, t, n, r) {
|
|
2623
2657
|
let l = e.priv;
|
|
2624
|
-
|
|
2625
|
-
let o =
|
|
2626
|
-
|
|
2627
|
-
let a =
|
|
2658
|
+
Tl(l.gobj_timer);
|
|
2659
|
+
let o = Gr(e, n, Dl, !0), s = Er(e, o, "src_yuno", ""), i = Er(e, o, "src_role", ""), _ = Er(e, o, "src_service", "");
|
|
2660
|
+
$t(e, "remote_yuno_name", s), $t(e, "remote_yuno_role", i), $t(e, "remote_yuno_service", _);
|
|
2661
|
+
let a = yr(e, n, "result", -1, 0), u = Er(e, n, "comment", "", 0), c = Er(e, n, "username", "", 0), f = jr(e, n, "services_roles", {});
|
|
2628
2662
|
if (a < 0) {
|
|
2629
|
-
|
|
2663
|
+
Ul(e);
|
|
2630
2664
|
let t = {
|
|
2631
2665
|
url: jt(e, "url"),
|
|
2632
2666
|
result: a,
|
|
@@ -2636,9 +2670,9 @@ var gobjJs = function(e) {
|
|
|
2636
2670
|
remote_yuno_role: i,
|
|
2637
2671
|
remote_yuno_service: _
|
|
2638
2672
|
};
|
|
2639
|
-
lt(e) ?
|
|
2673
|
+
lt(e) ? Vt(nt(e), "EV_ON_ID_NAK", t, e) : Xt(e, "EV_ON_ID_NAK", t);
|
|
2640
2674
|
} else {
|
|
2641
|
-
if (
|
|
2675
|
+
if (Dt(e, "ST_SESSION"), l.inside_on_open = !0, l.retry_ms = 0, !l.inform_on_close) {
|
|
2642
2676
|
l.inform_on_close = !0;
|
|
2643
2677
|
let t = {
|
|
2644
2678
|
username: c,
|
|
@@ -2647,70 +2681,70 @@ var gobjJs = function(e) {
|
|
|
2647
2681
|
remote_yuno_service: _,
|
|
2648
2682
|
services_roles: f
|
|
2649
2683
|
};
|
|
2650
|
-
lt(e) ?
|
|
2684
|
+
lt(e) ? Vt(nt(e), "EV_ON_OPEN", t, e) : Xt(e, "EV_ON_OPEN", t);
|
|
2651
2685
|
}
|
|
2652
2686
|
l.inside_on_open = !1, function(e) {
|
|
2653
|
-
let t =
|
|
2654
|
-
for (let n = 0; n < t.length; n++)
|
|
2687
|
+
let t = zt(e, null, null, null);
|
|
2688
|
+
for (let n = 0; n < t.length; n++) xl(e, t[n]);
|
|
2655
2689
|
}(e);
|
|
2656
2690
|
}
|
|
2657
2691
|
return 0;
|
|
2658
2692
|
}
|
|
2659
|
-
function
|
|
2693
|
+
function Hl(e, t, n, r) {
|
|
2660
2694
|
let l = e.priv.url, o = function(e, t) {
|
|
2661
2695
|
let n;
|
|
2662
2696
|
try {
|
|
2663
2697
|
n = JSON.parse(t);
|
|
2664
2698
|
} catch (t) {
|
|
2665
|
-
return
|
|
2699
|
+
return yn(`${et(e)}: parsing inter_event json: ${t}`), null;
|
|
2666
2700
|
}
|
|
2667
|
-
if (!(n instanceof Object)) return
|
|
2701
|
+
if (!(n instanceof Object)) return yn(`${et(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2668
2702
|
let r = n.event;
|
|
2669
|
-
if (!r) return
|
|
2670
|
-
if ("string" != typeof r) return
|
|
2703
|
+
if (!r) return yn(`${et(e)}: parsing inter_event: no event`), null;
|
|
2704
|
+
if ("string" != typeof r) return yn(`${et(e)}: parsing inter_event: event not a string`), null;
|
|
2671
2705
|
let l = n.kw;
|
|
2672
2706
|
return l ? l instanceof Object ? {
|
|
2673
2707
|
event: r,
|
|
2674
2708
|
kw: l || {}
|
|
2675
|
-
} : (
|
|
2709
|
+
} : (yn(`${et(e)}: parsing inter_event: kw not a json object`), null) : (yn(`${et(e)}: parsing inter_kw: no kw`), null);
|
|
2676
2710
|
}(e, n.data);
|
|
2677
|
-
if (!o) return
|
|
2678
|
-
if (
|
|
2679
|
-
let e = Xe(qe()) + " <== " + l, t = n.data.length, r =
|
|
2680
|
-
r ? r(e, o, 2, t) :
|
|
2711
|
+
if (!o) return yn(`${et(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2712
|
+
if (Il(e)) {
|
|
2713
|
+
let e = Xe(qe()) + " <== " + l, t = n.data.length, r = yt(qe(), "trace_ievent_callback");
|
|
2714
|
+
r ? r(e, o, 2, t) : Fl(0, e, o);
|
|
2681
2715
|
}
|
|
2682
2716
|
let s = o.event, i = o.kw;
|
|
2683
2717
|
if ("ST_SESSION" !== kt(e)) {
|
|
2684
|
-
if (It(e, s,
|
|
2685
|
-
if (!(
|
|
2686
|
-
} else
|
|
2687
|
-
return
|
|
2718
|
+
if (It(e, s, $.EVF_PUBLIC_EVENT)) {
|
|
2719
|
+
if (!(Vt(e, s, i, e) < 0)) return 0;
|
|
2720
|
+
} else hn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2721
|
+
return Ul(e), -1;
|
|
2688
2722
|
}
|
|
2689
2723
|
o = null;
|
|
2690
|
-
let _ =
|
|
2691
|
-
if (u.toLowerCase() !== ze().toLowerCase()) return
|
|
2724
|
+
let _ = Wr(e, i), a = Gr(e, i, Dl), u = Er(e, a, "dst_role", "");
|
|
2725
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return hn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2692
2726
|
let c = Er(e, a, "dst_service", "");
|
|
2693
|
-
if ("__subscribing__" === _) return
|
|
2694
|
-
if ("__unsubscribing__" === _) return
|
|
2695
|
-
if (It(e, s,
|
|
2696
|
-
if (!
|
|
2727
|
+
if ("__subscribing__" === _) return yn(`${et(e)}: subscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2728
|
+
if ("__unsubscribing__" === _) return yn(`${et(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2729
|
+
if (It(e, s, $.EVF_PUBLIC_EVENT)) return Vt(e, s, i, e), 0;
|
|
2730
|
+
if (!ir(c)) {
|
|
2697
2731
|
let t = we(c, !1);
|
|
2698
|
-
return t ? It(t, s,
|
|
2732
|
+
return t ? It(t, s, $.EVF_PUBLIC_EVENT) ? (Vt(t, s, i, e), 0) : (hn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (yn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2699
2733
|
}
|
|
2700
|
-
return lt(e) ?
|
|
2734
|
+
return lt(e) ? Vt(nt(e), s, i, e) : Xt(e, s, i), 0;
|
|
2701
2735
|
}
|
|
2702
|
-
function
|
|
2736
|
+
function zl(e, t, n, r) {
|
|
2703
2737
|
return 0;
|
|
2704
2738
|
}
|
|
2705
|
-
function
|
|
2739
|
+
function Ql(e, t, n, r) {
|
|
2706
2740
|
return 0;
|
|
2707
2741
|
}
|
|
2708
|
-
var
|
|
2742
|
+
var Xl = {
|
|
2709
2743
|
mt_create: function(e) {
|
|
2710
2744
|
let t = e.priv;
|
|
2711
|
-
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"),
|
|
2745
|
+
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), $t(e, "wanted_yuno_name", t.remote_yuno_name), $t(e, "wanted_yuno_role", t.remote_yuno_role), $t(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2712
2746
|
const n = Ot(e, "subscriber");
|
|
2713
|
-
n &&
|
|
2747
|
+
n && qt(e, null, {}, n);
|
|
2714
2748
|
},
|
|
2715
2749
|
mt_writing: function(e, t) {
|
|
2716
2750
|
let n = e.priv;
|
|
@@ -2729,58 +2763,58 @@ var gobjJs = function(e) {
|
|
|
2729
2763
|
},
|
|
2730
2764
|
mt_start: function(e) {
|
|
2731
2765
|
let t = e.priv;
|
|
2732
|
-
return t.retry_ms = 0, "ST_DISCONNECTED" !== kt(e) && (
|
|
2766
|
+
return t.retry_ms = 0, "ST_DISCONNECTED" !== kt(e) && (Vt(e, "EV_ON_CLOSE", {
|
|
2733
2767
|
url: t.url,
|
|
2734
2768
|
ws_seq: t.ws_seq,
|
|
2735
2769
|
code: 1e3,
|
|
2736
2770
|
reason: "restarted",
|
|
2737
2771
|
was_clean: !0
|
|
2738
|
-
}, e),
|
|
2772
|
+
}, e), Tl(t.gobj_timer)), t.websocket = Pl(e), 0;
|
|
2739
2773
|
},
|
|
2740
2774
|
mt_stop: function(e) {
|
|
2741
2775
|
let t = e.priv;
|
|
2742
|
-
return
|
|
2776
|
+
return Tl(t.gobj_timer), t.websocket && Ul(e), 0;
|
|
2743
2777
|
},
|
|
2744
2778
|
mt_destroy: function(e) {},
|
|
2745
2779
|
mt_stats: function(e, t, n, r) {
|
|
2746
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2780
|
+
if ("ST_SESSION" !== kt(e)) return hn("Not in session"), null;
|
|
2747
2781
|
n || (n = {});
|
|
2748
|
-
let l =
|
|
2749
|
-
return o || (o = {}),
|
|
2782
|
+
let l = Ml(e, Xe(r), Er(e, n, "service", null, 0)), o = jr(e, n, "__md_stats__", null, Zt.KW_EXTRACT);
|
|
2783
|
+
return o || (o = {}), Vr(e, n, "stats_stack", {
|
|
2750
2784
|
stats: t,
|
|
2751
2785
|
kw: o
|
|
2752
|
-
}),
|
|
2786
|
+
}), Vr(e, n, Dl, l), n.__stats__ = t, Mr(e, n, "__stats__"), Gl(e, "EV_MT_STATS", n, r), null;
|
|
2753
2787
|
},
|
|
2754
2788
|
mt_command_parser: function(e, t, n, r) {
|
|
2755
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2789
|
+
if ("ST_SESSION" !== kt(e)) return hn("Not in session"), null;
|
|
2756
2790
|
n || (n = {});
|
|
2757
|
-
let l =
|
|
2758
|
-
return o || (o = {}),
|
|
2791
|
+
let l = Ml(e, Xe(r), Er(e, n, "service", "", 0)), o = jr(e, n, "__md_command__", null, Zt.KW_EXTRACT);
|
|
2792
|
+
return o || (o = {}), Vr(e, n, "command_stack", {
|
|
2759
2793
|
command: t,
|
|
2760
2794
|
kw: o
|
|
2761
|
-
}),
|
|
2795
|
+
}), Vr(e, n, Dl, l), n.__command__ = t, Mr(e, n, "__command__"), Gl(e, "EV_MT_COMMAND", n, r), null;
|
|
2762
2796
|
},
|
|
2763
2797
|
mt_inject_event: function(e, t, n, r) {
|
|
2764
2798
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2765
|
-
if (n =
|
|
2799
|
+
if (n = Gn({}, Zn(n) ? n : {}), Zn(n.__md_iev__) && (n.__md_iev__ = Fn(n.__md_iev__)), Gr(e, n, Dl));
|
|
2766
2800
|
else {
|
|
2767
|
-
let l =
|
|
2768
|
-
|
|
2801
|
+
let l = Ml(e, Xe(r), Er(e, n, "__service__", 0, 0));
|
|
2802
|
+
Kn(n, "__service__"), Vr(e, n, "__message__", t), Vr(e, n, Dl, l);
|
|
2769
2803
|
}
|
|
2770
|
-
return
|
|
2804
|
+
return Mr(e, n, "__message__"), Gl(e, t, n, r);
|
|
2771
2805
|
},
|
|
2772
2806
|
mt_subscription_added: function(e, t) {
|
|
2773
2807
|
let n = e.priv;
|
|
2774
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2808
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : xl(e, t) : 0;
|
|
2775
2809
|
},
|
|
2776
2810
|
mt_subscription_deleted: function(e, t) {
|
|
2777
2811
|
let n = e.priv;
|
|
2778
2812
|
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2779
2813
|
if (n.inside_on_open) return 0;
|
|
2780
|
-
if (
|
|
2814
|
+
if (ir(t.event)) return 0;
|
|
2781
2815
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2782
2816
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2783
|
-
return
|
|
2817
|
+
return Vr(e, r, Dl, Ml(e, Xe(_), i)), Mr(e, r, "__unsubscribing__"), Gl(e, t.event, r, e);
|
|
2784
2818
|
}
|
|
2785
2819
|
};
|
|
2786
2820
|
return e.GObj = S, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new T(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new T(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new T(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new T(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new T(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new T(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = T, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
@@ -2794,50 +2828,55 @@ var gobjJs = function(e) {
|
|
|
2794
2828
|
return t;
|
|
2795
2829
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2796
2830
|
return e.replace(/[?# ^:]/g, "_");
|
|
2797
|
-
}, e.clear_timeout =
|
|
2831
|
+
}, e.clear_timeout = Tl, e.cmp_two_simple_json = cr, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2798
2832
|
let [r, l, o, s] = t;
|
|
2799
|
-
if (!r) return void
|
|
2833
|
+
if (!r) return void hn("Tag must be a valid HTML element.");
|
|
2800
2834
|
let i = document.createElement(r), _ = "";
|
|
2801
2835
|
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2802
2836
|
let t = "";
|
|
2803
2837
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2804
2838
|
i.style.cssText = t;
|
|
2805
2839
|
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2806
|
-
if (
|
|
2807
|
-
else if (
|
|
2840
|
+
if (qr(o)) i.appendChild(Hr(o));
|
|
2841
|
+
else if (tr(o)) if (o = o.trim(), o.length > 0 && "<" === o[0] && !zr) i.appendChild(Xr(o));
|
|
2842
|
+
else if (o.length > 0 && "<" === o[0] && function(e) {
|
|
2843
|
+
if (Qr.size >= 100) return;
|
|
2844
|
+
const t = e.slice(0, 80);
|
|
2845
|
+
Qr.has(t) || (Qr.add(t), yn(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2846
|
+
}(o), n && _) i.textContent = n(_) || o;
|
|
2808
2847
|
else i.textContent = o;
|
|
2809
|
-
else if (
|
|
2810
|
-
if (o.length > 0) if (
|
|
2811
|
-
else for (let t of o) Array.isArray(t)
|
|
2812
|
-
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (
|
|
2848
|
+
else if (er(o)) {
|
|
2849
|
+
if (o.length > 0) if (tr(o[0])) i.appendChild(e(o, n));
|
|
2850
|
+
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : qr(t) ? i.appendChild(Hr(t)) : tr(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && hn("createElement2: child ignored, type " + typeof t);
|
|
2851
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (hn("content ignored"), vn(o));
|
|
2813
2852
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2814
2853
|
return i;
|
|
2815
|
-
}, e.createOneHtml =
|
|
2816
|
-
let n =
|
|
2817
|
-
return
|
|
2854
|
+
}, e.createOneHtml = Xr, e.create_json_record = function(e, t) {
|
|
2855
|
+
let n = Fn(e);
|
|
2856
|
+
return Mn(n, t), n;
|
|
2818
2857
|
}, e.create_template_record = function(e, t) {
|
|
2819
2858
|
let n = {};
|
|
2820
2859
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2821
2860
|
let l;
|
|
2822
|
-
|
|
2823
|
-
let o =
|
|
2861
|
+
Zn(r) && (l = r.default);
|
|
2862
|
+
let o = jr(null, t, e, l);
|
|
2824
2863
|
n[e] = o;
|
|
2825
2864
|
}), n;
|
|
2826
|
-
}, e.current_timestamp =
|
|
2827
|
-
let n = Dr(
|
|
2828
|
-
return n &&
|
|
2865
|
+
}, e.current_timestamp = Zr, e.data_type_t = y, e.db_list_persistent_attrs = function(e, t) {
|
|
2866
|
+
let n = Dr(_l(e), null, !1), r = {};
|
|
2867
|
+
return n && Zn(n) && (r = Rr(e, n, t, !1)), r;
|
|
2829
2868
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2830
|
-
let n =
|
|
2831
|
-
if (r &&
|
|
2832
|
-
let l =
|
|
2833
|
-
l =
|
|
2869
|
+
let n = Et(e, E.SDF_PERSIST), r = Dr(_l(e), null, !1);
|
|
2870
|
+
if (r && Zn(r)) {
|
|
2871
|
+
let l = Rr(e, r, t, !1);
|
|
2872
|
+
l = Rr(e, l, n, !1), wt(e, l, E.SDF_PERSIST);
|
|
2834
2873
|
}
|
|
2835
2874
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2836
|
-
let n =
|
|
2837
|
-
0 ===
|
|
2875
|
+
let n = $r(e, Dr(_l(e), null, !1), t, !1);
|
|
2876
|
+
0 === zn(n) ? Ar(_l(e)) : kr(_l(e), n);
|
|
2838
2877
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2839
|
-
let n =
|
|
2840
|
-
return r &&
|
|
2878
|
+
let n = Rr(e, Et(e, E.SDF_PERSIST), t, !1), r = Dr(_l(e), null, !1);
|
|
2879
|
+
return r && Zn(r) && Wn(n, r), kr(_l(e), n);
|
|
2841
2880
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2842
2881
|
let r = null, l = null, o = null;
|
|
2843
2882
|
const s = (...s) => {
|
|
@@ -2857,27 +2896,24 @@ var gobjJs = function(e) {
|
|
|
2857
2896
|
return !1;
|
|
2858
2897
|
}, e.duplicate_objects = function(...e) {
|
|
2859
2898
|
const t = {};
|
|
2860
|
-
for (const n of e)
|
|
2861
|
-
const e = structuredClone(n);
|
|
2862
|
-
Object.assign(t, e);
|
|
2863
|
-
}
|
|
2899
|
+
for (const n of e) Gn(t, structuredClone(n));
|
|
2864
2900
|
return t;
|
|
2865
2901
|
}, e.empty_json = function(e) {
|
|
2866
|
-
return 0 ===
|
|
2867
|
-
}, e.empty_string =
|
|
2902
|
+
return 0 === Xn(e);
|
|
2903
|
+
}, e.empty_string = ir, e.escapeHtml = Br, e.event_flag_t = $, e.flat2json = function(e) {
|
|
2868
2904
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2869
2905
|
let t = null;
|
|
2870
2906
|
for (const n of Object.keys(e)) {
|
|
2871
|
-
const r =
|
|
2907
|
+
const r = sl(n);
|
|
2872
2908
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2873
|
-
if (r.length >
|
|
2909
|
+
if (r.length > rl) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2874
2910
|
const l = "number" == typeof r[0];
|
|
2875
2911
|
if (null === t) t = l ? [] : {};
|
|
2876
2912
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2877
2913
|
let o = t;
|
|
2878
2914
|
for (let t = 0; t < r.length; t++) {
|
|
2879
2915
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2880
|
-
if (s && l >
|
|
2916
|
+
if (s && l > ll) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2881
2917
|
if (s !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${s ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2882
2918
|
if (i) {
|
|
2883
2919
|
if (Array.isArray(o)) {
|
|
@@ -2885,7 +2921,7 @@ var gobjJs = function(e) {
|
|
|
2885
2921
|
o[l] = e[n];
|
|
2886
2922
|
} else {
|
|
2887
2923
|
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2888
|
-
|
|
2924
|
+
br(o, l, e[n]);
|
|
2889
2925
|
}
|
|
2890
2926
|
break;
|
|
2891
2927
|
}
|
|
@@ -2893,7 +2929,7 @@ var gobjJs = function(e) {
|
|
|
2893
2929
|
if (Array.isArray(o)) {
|
|
2894
2930
|
for (; o.length <= l;) o.push(null);
|
|
2895
2931
|
a = o[l], null == a && (a = _ ? [] : {}, o[l] = a);
|
|
2896
|
-
} else a =
|
|
2932
|
+
} else a = dr(o, l) ? void 0 : o[l], void 0 === a && (a = _ ? [] : {}, br(o, l, a));
|
|
2897
2933
|
if (null === a || "object" != typeof a) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2898
2934
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2899
2935
|
o = a;
|
|
@@ -2904,11 +2940,11 @@ var gobjJs = function(e) {
|
|
|
2904
2940
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2905
2941
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2906
2942
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2907
|
-
for (const n of Object.keys(t.added || {}))
|
|
2943
|
+
for (const n of Object.keys(t.added || {})) br(e, n, t.added[n]);
|
|
2908
2944
|
for (const n of Object.keys(t.changed || {})) {
|
|
2909
2945
|
const r = t.changed[n];
|
|
2910
2946
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2911
|
-
|
|
2947
|
+
br(e, n, r.to);
|
|
2912
2948
|
}
|
|
2913
2949
|
return e;
|
|
2914
2950
|
}, e.flat_diff = function(e, t) {
|
|
@@ -2917,15 +2953,15 @@ var gobjJs = function(e) {
|
|
|
2917
2953
|
removed: {},
|
|
2918
2954
|
changed: {}
|
|
2919
2955
|
};
|
|
2920
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2956
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? il(n[e], r[e]) || br(l.changed, e, {
|
|
2921
2957
|
from: n[e],
|
|
2922
2958
|
to: r[e]
|
|
2923
|
-
}) : l.removed
|
|
2924
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added
|
|
2959
|
+
}) : br(l.removed, e, n[e]);
|
|
2960
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || br(l.added, e, r[e]);
|
|
2925
2961
|
return l;
|
|
2926
2962
|
}, e.flat_key_join = function(e) {
|
|
2927
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2928
|
-
}, e.flat_key_split =
|
|
2963
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : ol(e)).join("`") : "";
|
|
2964
|
+
}, e.flat_key_split = sl, e.gclass_add_ev_action = ye, e.gclass_add_event_type = Te, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Oe, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2929
2965
|
if (!e) return {
|
|
2930
2966
|
top: 0,
|
|
2931
2967
|
left: 0,
|
|
@@ -2944,17 +2980,17 @@ var gobjJs = function(e) {
|
|
|
2944
2980
|
right: n + i + r,
|
|
2945
2981
|
bottom: t + s + l
|
|
2946
2982
|
};
|
|
2947
|
-
}, e.get_function_name =
|
|
2983
|
+
}, e.get_function_name = nl, e.get_now = function() {
|
|
2948
2984
|
return Math.floor(Date.now() / 1e3);
|
|
2949
2985
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
2950
|
-
return ot(e) ? (
|
|
2951
|
-
}, e.gobj_change_state =
|
|
2952
|
-
if (ot(e)) return
|
|
2986
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && ($e(e.parent, e), e.parent = null), Re(t, e), t.gclass.gmt.mt_child_added && (Y(e) && En(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (hn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2987
|
+
}, e.gobj_change_state = Dt, e.gobj_command = function(e, t, r, o) {
|
|
2988
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
2953
2989
|
if (function(e) {
|
|
2954
2990
|
return G > 1 || !!e && !!(x(e) & P.TRACE_COMMANDS);
|
|
2955
2991
|
}(e) || H(e, null) && !z(o, null)) {
|
|
2956
|
-
let l =
|
|
2957
|
-
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) &&
|
|
2992
|
+
let l = kn(t);
|
|
2993
|
+
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) && Un(r);
|
|
2958
2994
|
}
|
|
2959
2995
|
return e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0);
|
|
2960
2996
|
}, e.gobj_create = function(e, t, n, r) {
|
|
@@ -2967,37 +3003,37 @@ var gobjJs = function(e) {
|
|
|
2967
3003
|
return Ie(e, t, n, r, N.gobj_flag_volatil);
|
|
2968
3004
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2969
3005
|
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
2970
|
-
}, e.gobj_current_state = kt, e.gobj_default_service = Se, e.gobj_deliver_posted_events =
|
|
2971
|
-
if (
|
|
3006
|
+
}, e.gobj_current_state = kt, e.gobj_default_service = Se, e.gobj_deliver_posted_events = Ft, e.gobj_destroy = Le, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
3007
|
+
if (ir(t)) return null;
|
|
2972
3008
|
const n = t.toLowerCase();
|
|
2973
3009
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2974
|
-
}, e.gobj_find_service = we, e.gobj_find_subscribings =
|
|
3010
|
+
}, e.gobj_find_service = we, e.gobj_find_subscribings = Qt, e.gobj_find_subscriptions = zt, e.gobj_flag_t = N, e.gobj_full_name = tt, e.gobj_gclass_name = Ze, e.gobj_get_gclass_trace_level = re, e.gobj_get_gclass_trace_level2 = le, e.gobj_get_gclass_trace_no_level = oe, e.gobj_get_global_trace_level = te, e.gobj_get_global_trace_no_level = ne, e.gobj_global_trace_level = function() {
|
|
2975
3011
|
return F;
|
|
2976
3012
|
}, e.gobj_global_trace_no_level = function() {
|
|
2977
3013
|
return V;
|
|
2978
3014
|
}, e.gobj_has_attr = ht, e.gobj_has_event = It, e.gobj_has_output_event = Ct, e.gobj_hsdata = ce, e.gobj_is_destroying = ot, e.gobj_is_playing = Je, e.gobj_is_pure_child = lt, e.gobj_is_running = Ke, e.gobj_is_service = Be, e.gobj_is_volatil = rt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2979
3015
|
return u ? u(e, t) : null;
|
|
2980
3016
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2981
|
-
let t =
|
|
3017
|
+
let t = zt(e, null, null, null);
|
|
2982
3018
|
for (let n = 0; n < t.length; n++) {
|
|
2983
|
-
let r = t[n], l =
|
|
2984
|
-
|
|
3019
|
+
let r = t[n], l = Tr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Tr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3020
|
+
Bn(r, "s_event", Er(e, r, "event", "", Zt.KW_REQUIRED)), Bn(r, "s_publisher", et(l)), Bn(r, "s_subscriber", et(o));
|
|
2985
3021
|
}
|
|
2986
|
-
let n =
|
|
3022
|
+
let n = Qt(e, 0, null, 0);
|
|
2987
3023
|
for (let t = 0; t < n.length; t++) {
|
|
2988
|
-
let r = n[t], l =
|
|
2989
|
-
|
|
3024
|
+
let r = n[t], l = Tr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Tr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3025
|
+
Bn(r, "s_event", Er(e, r, "event", "", Zt.KW_REQUIRED)), Bn(r, "s_publisher", et(l)), Bn(r, "s_subscriber", et(o));
|
|
2990
3026
|
}
|
|
2991
3027
|
return {
|
|
2992
3028
|
subscriptions: t,
|
|
2993
3029
|
subscribings: n,
|
|
2994
|
-
"total subscriptions":
|
|
2995
|
-
total_subscribings:
|
|
3030
|
+
"total subscriptions": Qn(t),
|
|
3031
|
+
total_subscribings: Qn(n)
|
|
2996
3032
|
};
|
|
2997
3033
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
2998
|
-
return Be(e) ? i ? i(e, t) : -1 : (
|
|
3034
|
+
return Be(e) ? i ? i(e, t) : -1 : (hn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2999
3035
|
}, e.gobj_match_children = function(e, t) {
|
|
3000
|
-
if (ot(e)) return
|
|
3036
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), null;
|
|
3001
3037
|
t = t || {};
|
|
3002
3038
|
let n = [];
|
|
3003
3039
|
const r = e.dl_children;
|
|
@@ -3016,17 +3052,10 @@ var gobjJs = function(e) {
|
|
|
3016
3052
|
bt(o, t) && n.push(o), e(n, o);
|
|
3017
3053
|
}
|
|
3018
3054
|
}(n, e), n;
|
|
3019
|
-
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = xe, e.gobj_play = We, e.gobj_post_event =
|
|
3020
|
-
return e && e instanceof S ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (mn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : sr(t) ? (mn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (mn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
3021
|
-
dst: e,
|
|
3022
|
-
event: t,
|
|
3023
|
-
kw: r,
|
|
3024
|
-
src: l
|
|
3025
|
-
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ut, 0)), 0) : (mn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (mn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
3026
|
-
}, e.gobj_posted_events_size = function() {
|
|
3055
|
+
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = xe, e.gobj_play = We, e.gobj_post_event = Ut, e.gobj_posted_events_size = function() {
|
|
3027
3056
|
return Lt.length;
|
|
3028
|
-
}, e.gobj_publish_event =
|
|
3029
|
-
return Be(e) ? a ? a(e, t) : -1 : (
|
|
3057
|
+
}, e.gobj_publish_event = Xt, e.gobj_read_attr = yt, e.gobj_read_attrs = Et, e.gobj_read_bool_attr = Tt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = Ot, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
3058
|
+
return Be(e) ? a ? a(e, t) : -1 : (hn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3030
3059
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
3031
3060
|
return U.map(([e, t, n]) => ({
|
|
3032
3061
|
name: e,
|
|
@@ -3036,51 +3065,51 @@ var gobjJs = function(e) {
|
|
|
3036
3065
|
}));
|
|
3037
3066
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
3038
3067
|
return function(e, t, n) {
|
|
3039
|
-
if (ot(e)) return
|
|
3068
|
+
if (ot(e)) return hn("gobj NULL or DESTROYED"), -1;
|
|
3040
3069
|
let r = e.gclass.attrs_table;
|
|
3041
3070
|
for (let l = 0; l < r.length; l++) {
|
|
3042
3071
|
const o = r[l];
|
|
3043
|
-
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o),
|
|
3072
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o), Zn(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o.name) && (e.priv[o.name] = e.jn_attrs[o.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name)));
|
|
3044
3073
|
}
|
|
3045
3074
|
return 0;
|
|
3046
|
-
}(e,
|
|
3047
|
-
}, e.gobj_save_persistent_attrs =
|
|
3075
|
+
}(e, E.SDF_VOLATIL, 0);
|
|
3076
|
+
}, e.gobj_save_persistent_attrs = De, e.gobj_search_path = mt, e.gobj_send_event = Vt, e.gobj_services = function() {
|
|
3048
3077
|
let e = [];
|
|
3049
|
-
for (const t of Object.keys(b))
|
|
3078
|
+
for (const t of Object.keys(b)) qn(e, t);
|
|
3050
3079
|
return e;
|
|
3051
3080
|
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
3052
3081
|
return G = Number(e) || 0, 0;
|
|
3053
3082
|
}, e.gobj_set_gclass_no_trace = ie, e.gobj_set_gclass_trace = se, e.gobj_set_global_no_trace = X, e.gobj_set_global_no_trace2 = ee, e.gobj_set_global_trace = Q, e.gobj_set_global_trace2 = Z, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
3054
|
-
if (!e) return
|
|
3083
|
+
if (!e) return hn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
3055
3084
|
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3056
3085
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3057
3086
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
3058
|
-
if (!e) return
|
|
3087
|
+
if (!e) return hn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3059
3088
|
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3060
3089
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3061
3090
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
3062
3091
|
C = 1 === Number(e) ? 1 : 0;
|
|
3063
3092
|
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
3064
|
-
return ot(e) ? (
|
|
3093
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ue, 0, 0);
|
|
3065
3094
|
}, e.gobj_start_tree = function(e) {
|
|
3066
|
-
return ot(e) ? (
|
|
3095
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & w.gcflag_manual_start || e.disabled ? 0 : (e.running || Pe(e), ut(e, D.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
3067
3096
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
3068
3097
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
3069
|
-
const d = [["EV_STATE_CHANGED",
|
|
3098
|
+
const d = [["EV_STATE_CHANGED", $.EVF_SYSTEM_EVENT | $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]];
|
|
3070
3099
|
for (let e = 0; e < d.length; e++) {
|
|
3071
3100
|
let t = d[e][0], n = d[e][1];
|
|
3072
|
-
|
|
3101
|
+
Ee(g, t, n);
|
|
3073
3102
|
}
|
|
3074
3103
|
return 0;
|
|
3075
3104
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
3076
|
-
return ot(e) ? (
|
|
3105
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
3077
3106
|
}, e.gobj_stop = Ve, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
3078
|
-
return ot(e) ? (
|
|
3079
|
-
}, e.gobj_subscribe_event =
|
|
3107
|
+
return ot(e) ? (hn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), Ke(e) && Ve(e), ut(e, D.WALK_TOP2BOTTOM, Ge, 0, 0));
|
|
3108
|
+
}, e.gobj_subscribe_event = qt, e.gobj_trace_level = x, e.gobj_trace_machine_format = function() {
|
|
3080
3109
|
return C;
|
|
3081
3110
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3082
|
-
if (null == n && (n = {}), !e) return
|
|
3083
|
-
if (!r) return
|
|
3111
|
+
if (null == n && (n = {}), !e) return hn(`publisher NULL: ev ${t}`), 0;
|
|
3112
|
+
if (!r) return hn(`subscriber NULL: ev ${t}`), 0;
|
|
3084
3113
|
const l = /* @__PURE__ */ new Set([
|
|
3085
3114
|
"__config__",
|
|
3086
3115
|
"__global__",
|
|
@@ -3089,80 +3118,82 @@ var gobjJs = function(e) {
|
|
|
3089
3118
|
"__service__"
|
|
3090
3119
|
]);
|
|
3091
3120
|
if (Object.keys(n).forEach((n) => {
|
|
3092
|
-
l.has(n) ||
|
|
3093
|
-
}),
|
|
3094
|
-
else if (!(Ct(e, t,
|
|
3095
|
-
let o =
|
|
3121
|
+
l.has(n) || hn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
3122
|
+
}), ir(t)) t = "";
|
|
3123
|
+
else if (!(Ct(e, t, $.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return hn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
3124
|
+
let o = xt(n, t), s = Yt(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), i = 0, _ = 0, a = 0;
|
|
3096
3125
|
for (let t = 0; t < s.length; t++) {
|
|
3097
|
-
let n = s[t], r =
|
|
3126
|
+
let n = s[t], r = Jt(e, n, !1, !1);
|
|
3098
3127
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3099
3128
|
}
|
|
3100
|
-
return _ ?
|
|
3101
|
-
}, e.gobj_unsubscribe_list =
|
|
3129
|
+
return _ ? yn(`${et(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (yn(`${et(e)}: No subscription found`), Un(n, "No subscription found")), 0;
|
|
3130
|
+
}, e.gobj_unsubscribe_list = Ht, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = St, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = $t, e.gobj_yuno = qe, e.gobj_yuno_id = Qe, e.gobj_yuno_name = He, e.gobj_yuno_role = ze, e.html_markup = function(e) {
|
|
3131
|
+
return "string" != typeof e ? (hn("html_markup: not a string, type " + typeof e), new Jr("")) : new Jr(e);
|
|
3132
|
+
}, e.id_index_in_obj_list = Lr, e.index_in_list = el, e.is_array = er, e.is_boolean = rr, e.is_date = function(e) {
|
|
3102
3133
|
return e instanceof Date && !isNaN(e);
|
|
3103
|
-
}, e.is_function =
|
|
3104
|
-
if (!
|
|
3134
|
+
}, e.is_function = or, e.is_gobj = sr, e.is_html_markup = qr, e.is_metadata_key = function(e) {
|
|
3135
|
+
if (!tr(e)) return !1;
|
|
3105
3136
|
let t = 0;
|
|
3106
3137
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3107
3138
|
return 2 === t;
|
|
3108
|
-
}, e.is_null =
|
|
3109
|
-
if (!
|
|
3139
|
+
}, e.is_null = lr, e.is_number = nr, e.is_object = Zn, e.is_private_key = function(e) {
|
|
3140
|
+
if (!tr(e)) return !1;
|
|
3110
3141
|
let t = 0;
|
|
3111
3142
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3112
3143
|
return 1 === t;
|
|
3113
3144
|
}, e.is_pure_number = function(e) {
|
|
3114
|
-
if (
|
|
3115
|
-
if (!
|
|
3145
|
+
if (nr(e)) return !0;
|
|
3146
|
+
if (!tr(e)) return !1;
|
|
3116
3147
|
const t = Number(e);
|
|
3117
3148
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3118
|
-
}, e.is_secret_name =
|
|
3119
|
-
let l =
|
|
3120
|
-
if (!l) return
|
|
3121
|
-
if (
|
|
3149
|
+
}, e.is_secret_name = wn, e.is_string = tr, e.jdb_delete = function(e, t, n, r) {
|
|
3150
|
+
let l = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3151
|
+
if (!l) return hn("jdb_delete: topic not found: " + t), null;
|
|
3152
|
+
if (ir(r.id)) return hn("jdb_delete: record without id: " + r), Tn(r), null;
|
|
3122
3153
|
let o, s = n.split("`"), i = l;
|
|
3123
|
-
for (; (o = s.shift()) && !
|
|
3124
|
-
if (0 === s.length && i) if (
|
|
3125
|
-
let e =
|
|
3154
|
+
for (; (o = s.shift()) && !ir(o) && i;) Zn(i) && (i = jr(null, i, e.hook, null, 0)), i = Kr(i, null, o, !1);
|
|
3155
|
+
if (0 === s.length && i) if (er(i)) {
|
|
3156
|
+
let e = Lr(i, r.id);
|
|
3126
3157
|
e >= 0 && i.splice(e, 1);
|
|
3127
3158
|
} else {
|
|
3128
|
-
let t =
|
|
3159
|
+
let t = jr(null, i, e.hook, null, 0), n = Lr(t, r.id);
|
|
3129
3160
|
n >= 0 && t.splice(n, 1);
|
|
3130
3161
|
}
|
|
3131
3162
|
return l;
|
|
3132
3163
|
}, e.jdb_get = function(e, t, n, r) {
|
|
3133
|
-
let l =
|
|
3134
|
-
return l ? (void 0 === r && (r = !0),
|
|
3164
|
+
let l = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3165
|
+
return l ? (void 0 === r && (r = !0), Kr(l, e.hook, n, r)) : (hn("jdb_get: topic not found: " + t), null);
|
|
3135
3166
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
3136
|
-
let r =
|
|
3137
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
3167
|
+
let r = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3168
|
+
return r ? n < r.length ? r[n] : {} : (hn("jdb_get_by_idx: topic not found: " + t), null);
|
|
3138
3169
|
}, e.jdb_get_topic = function(e, t) {
|
|
3139
|
-
let n =
|
|
3140
|
-
if (!n) return
|
|
3141
|
-
return
|
|
3170
|
+
let n = jr(null, e, "topics", null, 0);
|
|
3171
|
+
if (!n) return hn("jdb topics section not found"), Tn(e), null;
|
|
3172
|
+
return jr(null, n, t, null, 0) || (hn("jdb topic not found: " + t), Tn(n), null);
|
|
3142
3173
|
}, e.jdb_init = function(e, t, n) {
|
|
3143
|
-
n && (e =
|
|
3144
|
-
let r =
|
|
3174
|
+
n && (e = Fn(e));
|
|
3175
|
+
let r = jr(null, e, "type", [], 1);
|
|
3145
3176
|
Er(null, e, "hook", "data", 1);
|
|
3146
|
-
let l =
|
|
3147
|
-
return
|
|
3148
|
-
"__" !== t.substring(0, 2) &&
|
|
3177
|
+
let l = jr(null, e, "schema", {}, 1), o = jr(null, e, "topics", {}, 1);
|
|
3178
|
+
return xr(l, function(e, t, n, l) {
|
|
3179
|
+
"__" !== t.substring(0, 2) && jr(null, o, l, Fn(r), 1);
|
|
3149
3180
|
}, t), e;
|
|
3150
3181
|
}, e.jdb_update = function(e, t, n, r) {
|
|
3151
|
-
let l =
|
|
3152
|
-
if (!l) return
|
|
3153
|
-
if (
|
|
3182
|
+
let l = jr(null, jr(null, e, "topics", null, 0), t, null, 0);
|
|
3183
|
+
if (!l) return hn("jdb_update: topic not found: " + t), null;
|
|
3184
|
+
if (ir(r.id)) return hn("jdb_update: record without id: " + r), Tn(r), null;
|
|
3154
3185
|
let o, s = n.split("`"), i = l;
|
|
3155
|
-
for (; (o = s.shift()) && !
|
|
3156
|
-
if (0 === s.length && i) if (
|
|
3157
|
-
else if (i.id === r.id)
|
|
3186
|
+
for (; (o = s.shift()) && !ir(o) && i;) Zn(i) && (i = jr(null, i, e.hook, [], 1)), i = Kr(i, null, o, !1);
|
|
3187
|
+
if (0 === s.length && i) if (er(i)) i.push(r);
|
|
3188
|
+
else if (i.id === r.id) Gn(i, r);
|
|
3158
3189
|
else {
|
|
3159
|
-
let t =
|
|
3160
|
-
n ?
|
|
3190
|
+
let t = jr(null, i, e.hook, [], 1), n = Kr(t, e.hook, r.id, !1);
|
|
3191
|
+
n ? Gn(n, r) : t.push(r);
|
|
3161
3192
|
}
|
|
3162
3193
|
return l;
|
|
3163
3194
|
}, e.json2flat = function(e) {
|
|
3164
3195
|
const t = {}, n = (e, r, l) => {
|
|
3165
|
-
if (l >
|
|
3196
|
+
if (l > rl) throw new Error("json2flat: deeper than 256");
|
|
3166
3197
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3167
3198
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3168
3199
|
const o = `[${t}]`;
|
|
@@ -3172,20 +3203,20 @@ var gobjJs = function(e) {
|
|
|
3172
3203
|
const t = Object.keys(e);
|
|
3173
3204
|
if (t.length > 0) {
|
|
3174
3205
|
for (const o of t) {
|
|
3175
|
-
const t =
|
|
3206
|
+
const t = ol(o);
|
|
3176
3207
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
3177
3208
|
}
|
|
3178
3209
|
return;
|
|
3179
3210
|
}
|
|
3180
3211
|
}
|
|
3181
|
-
0 !== l &&
|
|
3212
|
+
0 !== l && br(t, r, e);
|
|
3182
3213
|
};
|
|
3183
3214
|
return null == e || n(e, "", 0), t;
|
|
3184
|
-
}, e.json_array_append =
|
|
3215
|
+
}, e.json_array_append = Jn, e.json_array_append_new = qn, e.json_array_extend = function(e, t) {
|
|
3185
3216
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3186
|
-
}, e.json_array_remove =
|
|
3217
|
+
}, e.json_array_remove = Hn, e.json_array_size = Qn, e.json_deep_copy = Fn, e.json_is_identical = Vn, e.json_mask_secrets = Pn, e.json_object_del = Kn, e.json_object_get = xn, e.json_object_set = Yn, e.json_object_set_new = Bn, e.json_object_size = zn, e.json_object_update = Gn, e.json_object_update_existing = Mn, e.json_object_update_missing = Wn, e.json_size = Xn, e.jwt2json = function(e, t) {
|
|
3187
3218
|
try {
|
|
3188
|
-
let n =
|
|
3219
|
+
let n = Yr(e);
|
|
3189
3220
|
switch (t) {
|
|
3190
3221
|
case "header": return JSON.parse(n.header);
|
|
3191
3222
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3194,137 +3225,137 @@ var gobjJs = function(e) {
|
|
|
3194
3225
|
} catch (e) {
|
|
3195
3226
|
return null;
|
|
3196
3227
|
}
|
|
3197
|
-
}, e.jwtDecode =
|
|
3198
|
-
if (e && !
|
|
3199
|
-
r || (r =
|
|
3228
|
+
}, e.jwtDecode = Yr, e.kw_clone_by_keys = Rr, e.kw_clone_by_not_keys = $r, e.kw_collect = function(e, t, n, r) {
|
|
3229
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return null;
|
|
3230
|
+
r || (r = Nr);
|
|
3200
3231
|
let l = [];
|
|
3201
|
-
if (
|
|
3232
|
+
if (er(t)) for (let e = 0; e < t.length; e++) {
|
|
3202
3233
|
let o = t[e];
|
|
3203
3234
|
r(o, n) && l.push(o);
|
|
3204
3235
|
}
|
|
3205
3236
|
else {
|
|
3206
|
-
if (!
|
|
3237
|
+
if (!Zn(t)) return hn("kw_select() BAD kw parameter"), null;
|
|
3207
3238
|
r(t, n) && l.push(t);
|
|
3208
3239
|
}
|
|
3209
3240
|
return l;
|
|
3210
|
-
}, e.kw_delete =
|
|
3211
|
-
if (!n || !
|
|
3212
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3213
|
-
return r &&
|
|
3214
|
-
}, e.kw_find_path =
|
|
3215
|
-
e && !
|
|
3216
|
-
let o =
|
|
3217
|
-
const s = l && l &
|
|
3218
|
-
return void 0 === o ? i &&
|
|
3219
|
-
}, e.kw_get_local_storage_value = Dr, e.kw_get_pointer =
|
|
3220
|
-
e && !
|
|
3221
|
-
let o =
|
|
3222
|
-
const s = l && l &
|
|
3241
|
+
}, e.kw_delete = mr, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
3242
|
+
if (!n || !er(t)) return r && hn("item NULL or kw_list is not a list"), -1;
|
|
3243
|
+
for (let e = 0; e < t.length; e++) if (Vn(n, t[e])) return e;
|
|
3244
|
+
return r && hn("item not found in this list"), -1;
|
|
3245
|
+
}, e.kw_find_path = pr, e.kw_flag_t = Zt, e.kw_get_bool = hr, e.kw_get_dict = vr, e.kw_get_dict_value = jr, e.kw_get_int = yr, e.kw_get_list = function(e, t, n, r, l) {
|
|
3246
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3247
|
+
let o = pr(e, t, n, !1);
|
|
3248
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
3249
|
+
return void 0 === o ? i && er(r) && t ? (Or(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : er(o) ? (_ && mr(e, t, n), o) : (s && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'`), Un(t)), r);
|
|
3250
|
+
}, e.kw_get_local_storage_value = Dr, e.kw_get_pointer = Tr, e.kw_get_real = function(e, t, n, r, l) {
|
|
3251
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3252
|
+
let o = pr(e, t, n, !1);
|
|
3253
|
+
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
3223
3254
|
if (void 0 === o) {
|
|
3224
3255
|
if (i && t) {
|
|
3225
3256
|
let l = Number(r);
|
|
3226
|
-
return
|
|
3257
|
+
return Or(e, t, n, l), l;
|
|
3227
3258
|
}
|
|
3228
|
-
return s && (
|
|
3259
|
+
return s && (hn(`path not found: '${n}'`), Un(t)), Number(r);
|
|
3229
3260
|
}
|
|
3230
3261
|
let u;
|
|
3231
|
-
if (
|
|
3262
|
+
if (nr(o)) u = o;
|
|
3232
3263
|
else {
|
|
3233
|
-
if (!a) return
|
|
3234
|
-
if (
|
|
3235
|
-
else if (
|
|
3264
|
+
if (!a) return hn(`${e ? et(e) + ": " : ""}path MUST BE a json real: '${n}'`), Un(t), Number(r);
|
|
3265
|
+
if (rr(o)) u = o ? 1 : 0;
|
|
3266
|
+
else if (tr(o)) u = parseFloat(o), Number.isNaN(u) && (u = 0);
|
|
3236
3267
|
else {
|
|
3237
|
-
if (null !== o) return
|
|
3268
|
+
if (null !== o) return hn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Un(t), 0;
|
|
3238
3269
|
u = 0;
|
|
3239
3270
|
}
|
|
3240
3271
|
}
|
|
3241
|
-
return _ &&
|
|
3242
|
-
}, e.kw_get_str = Er, e.kw_has_key =
|
|
3243
|
-
if (e && !
|
|
3244
|
-
r || (r =
|
|
3272
|
+
return _ && mr(e, t, n), u;
|
|
3273
|
+
}, e.kw_get_str = Er, e.kw_has_key = gr, e.kw_match_simple = Nr, e.kw_pop = fr, e.kw_remove_local_storage_value = Ar, e.kw_select = function(e, t, n, r) {
|
|
3274
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return null;
|
|
3275
|
+
r || (r = Nr);
|
|
3245
3276
|
let l = [];
|
|
3246
|
-
if (
|
|
3277
|
+
if (er(t)) for (let e = 0; e < t.length; e++) {
|
|
3247
3278
|
let o = t[e];
|
|
3248
|
-
r(o, n) && l.push(
|
|
3279
|
+
r(o, n) && l.push(Fn(o));
|
|
3249
3280
|
}
|
|
3250
3281
|
else {
|
|
3251
|
-
if (!
|
|
3252
|
-
r(t, n) && l.push(
|
|
3282
|
+
if (!Zn(t)) return hn("kw_select() BAD kw parameter"), null;
|
|
3283
|
+
r(t, n) && l.push(Fn(t));
|
|
3253
3284
|
}
|
|
3254
3285
|
return l;
|
|
3255
|
-
}, e.kw_set_dict_value =
|
|
3256
|
-
e && !
|
|
3257
|
-
let o =
|
|
3286
|
+
}, e.kw_set_dict_value = Or, e.kw_set_local_storage_value = kr, e.kw_set_subdict_value = Sr, e.kwid_collect = Cr, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
3287
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3288
|
+
let o = Cr(e, t, n, r, l);
|
|
3258
3289
|
return o && 0 !== o.length ? o[0] : null;
|
|
3259
3290
|
}, e.kwid_get_ids = function(e, t) {
|
|
3260
|
-
if (e && !
|
|
3291
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), !t) return [];
|
|
3261
3292
|
let n = [];
|
|
3262
|
-
if (
|
|
3263
|
-
else if (
|
|
3264
|
-
else
|
|
3265
|
-
if (
|
|
3266
|
-
else if (
|
|
3293
|
+
if (tr(t)) n.push(t);
|
|
3294
|
+
else if (Zn(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
3295
|
+
else er(t) && t.forEach(function(t) {
|
|
3296
|
+
if (tr(t)) ir(t) || n.push(t);
|
|
3297
|
+
else if (Zn(t)) {
|
|
3267
3298
|
let r = Er(e, t, "id", 0, 0);
|
|
3268
3299
|
r && n.push(r);
|
|
3269
3300
|
}
|
|
3270
3301
|
});
|
|
3271
3302
|
return n;
|
|
3272
|
-
}, e.kwid_match_id =
|
|
3273
|
-
e && !
|
|
3303
|
+
}, e.kwid_match_id = Ir, e.kwid_new_dict = function(e, t, n) {
|
|
3304
|
+
e && !sr(e) && hn("GObj bad instanceof");
|
|
3274
3305
|
let r = {};
|
|
3275
|
-
if (
|
|
3276
|
-
else if (
|
|
3277
|
-
let l = t[n], o = Er(e, l, "id", "",
|
|
3278
|
-
|
|
3306
|
+
if (ir(n) || (t = pr(e, t, n)), Zn(t)) r = t;
|
|
3307
|
+
else if (er(t)) for (let n = 0; n < t.length; n++) {
|
|
3308
|
+
let l = t[n], o = Er(e, l, "id", "", Zt.KW_REQUIRED);
|
|
3309
|
+
ir(o) || br(r, o, l);
|
|
3279
3310
|
}
|
|
3280
|
-
else
|
|
3311
|
+
else hn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
3281
3312
|
return r;
|
|
3282
3313
|
}, e.kwid_new_list = function(e, t, n) {
|
|
3283
|
-
if (e && !
|
|
3284
|
-
if (
|
|
3314
|
+
if (e && !sr(e) && hn("GObj bad instanceof"), ir(n) || (t = pr(e, t, n)), er(t)) return t;
|
|
3315
|
+
if (Zn(t)) {
|
|
3285
3316
|
let n = [];
|
|
3286
3317
|
for (let r of Object.keys(t)) {
|
|
3287
3318
|
let l = t[r];
|
|
3288
|
-
|
|
3319
|
+
Zn(l) ? (l.id = r, n.push(l)) : hn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
3289
3320
|
}
|
|
3290
3321
|
return n;
|
|
3291
3322
|
}
|
|
3292
|
-
return
|
|
3323
|
+
return hn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
3293
3324
|
}, e.list2options = function(e, t, n) {
|
|
3294
3325
|
t = t || "id", n = n || "value";
|
|
3295
3326
|
let r = [];
|
|
3296
|
-
if (
|
|
3327
|
+
if (er(e)) for (let l = 0; l < e.length; l++) {
|
|
3297
3328
|
let o = e[l];
|
|
3298
|
-
if (
|
|
3329
|
+
if (tr(o)) r.push({
|
|
3299
3330
|
id: e[l],
|
|
3300
3331
|
value: e[l]
|
|
3301
3332
|
});
|
|
3302
|
-
else if (
|
|
3333
|
+
else if (Zn(o)) {
|
|
3303
3334
|
let e = {};
|
|
3304
|
-
if (
|
|
3305
|
-
if (!
|
|
3306
|
-
if (!(
|
|
3307
|
-
|
|
3335
|
+
if (gr(o, t)) {
|
|
3336
|
+
if (!gr(o, n)) {
|
|
3337
|
+
if (!(Xn(o) > 0)) {
|
|
3338
|
+
hn("list2options(): object without field value: " + n);
|
|
3308
3339
|
continue;
|
|
3309
3340
|
}
|
|
3310
3341
|
n = Object.keys(o)[0];
|
|
3311
3342
|
}
|
|
3312
3343
|
e.id = o[t], e.value = o[n];
|
|
3313
3344
|
} else {
|
|
3314
|
-
if (!(
|
|
3315
|
-
|
|
3345
|
+
if (!(Xn(o) > 0)) {
|
|
3346
|
+
hn("list2options(): object without field id: " + t);
|
|
3316
3347
|
continue;
|
|
3317
3348
|
}
|
|
3318
3349
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
3319
3350
|
}
|
|
3320
3351
|
r.push(e);
|
|
3321
|
-
} else
|
|
3352
|
+
} else hn("list2options(): case1 not implemented");
|
|
3322
3353
|
}
|
|
3323
|
-
else if (
|
|
3354
|
+
else if (Zn(e)) for (let t of Object.keys(e)) r.push({
|
|
3324
3355
|
id: t,
|
|
3325
3356
|
value: t
|
|
3326
3357
|
});
|
|
3327
|
-
else
|
|
3358
|
+
else hn("list2options(): case2 not implemented");
|
|
3328
3359
|
return r;
|
|
3329
3360
|
}, e.load_json_file = function(e, t, n) {
|
|
3330
3361
|
let r = new XMLHttpRequest();
|
|
@@ -3332,18 +3363,18 @@ var gobjJs = function(e) {
|
|
|
3332
3363
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3333
3364
|
t(JSON.parse(r.responseText));
|
|
3334
3365
|
} catch (e) {
|
|
3335
|
-
n && (
|
|
3366
|
+
n && (hn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3336
3367
|
}
|
|
3337
3368
|
else n && n(r.status);
|
|
3338
3369
|
var e;
|
|
3339
3370
|
}, r.send();
|
|
3340
|
-
}, e.log_debug = En, e.log_error =
|
|
3341
|
-
let n =
|
|
3342
|
-
|
|
3343
|
-
}, e.log_warning =
|
|
3371
|
+
}, e.log_debug = En, e.log_error = hn, e.log_info = function(e, ...t) {
|
|
3372
|
+
let n = mn(e, ...t), r = Zr();
|
|
3373
|
+
rn && cn("info", n) && rn("%c" + r + " INFO: " + String(n), "color:cyan"), gn("info", n, r);
|
|
3374
|
+
}, e.log_warning = yn, e.mask_secrets_inline = kn, e.msg_iev_get_msg_type = Wr, e.msg_iev_get_stack = Gr, e.msg_iev_push_stack = Vr, e.msg_iev_read_key = Ur, e.msg_iev_set_msg_type = Mr, e.msg_iev_write_key = Fr, e.node_uuid = tl, e.parseBoolean = _r, e.parseSVG = function(e) {
|
|
3344
3375
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3345
3376
|
}, e.refresh_language = function(e, t) {
|
|
3346
|
-
if (!
|
|
3377
|
+
if (!or(t)) return void hn("You must supply a translation function");
|
|
3347
3378
|
e || (e = document);
|
|
3348
3379
|
const n = (t) => {
|
|
3349
3380
|
let n = [];
|
|
@@ -3367,22 +3398,22 @@ var gobjJs = function(e) {
|
|
|
3367
3398
|
});
|
|
3368
3399
|
}, e.register_c_ievent_cli = function() {
|
|
3369
3400
|
return function(e) {
|
|
3370
|
-
if (
|
|
3401
|
+
if (Ll) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3371
3402
|
const t = [
|
|
3372
3403
|
["ST_DISCONNECTED", [
|
|
3373
3404
|
[
|
|
3374
3405
|
"EV_ON_OPEN",
|
|
3375
|
-
|
|
3406
|
+
Yl,
|
|
3376
3407
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3377
3408
|
],
|
|
3378
3409
|
[
|
|
3379
3410
|
"EV_ON_CLOSE",
|
|
3380
|
-
|
|
3411
|
+
Bl,
|
|
3381
3412
|
null
|
|
3382
3413
|
],
|
|
3383
3414
|
[
|
|
3384
3415
|
"EV_TIMEOUT",
|
|
3385
|
-
|
|
3416
|
+
Kl,
|
|
3386
3417
|
null
|
|
3387
3418
|
],
|
|
3388
3419
|
[
|
|
@@ -3394,22 +3425,22 @@ var gobjJs = function(e) {
|
|
|
3394
3425
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3395
3426
|
[
|
|
3396
3427
|
"EV_ON_MESSAGE",
|
|
3397
|
-
|
|
3428
|
+
Hl,
|
|
3398
3429
|
null
|
|
3399
3430
|
],
|
|
3400
3431
|
[
|
|
3401
3432
|
"EV_IDENTITY_CARD_ACK",
|
|
3402
|
-
|
|
3433
|
+
ql,
|
|
3403
3434
|
null
|
|
3404
3435
|
],
|
|
3405
3436
|
[
|
|
3406
3437
|
"EV_ON_CLOSE",
|
|
3407
|
-
|
|
3438
|
+
Bl,
|
|
3408
3439
|
"ST_DISCONNECTED"
|
|
3409
3440
|
],
|
|
3410
3441
|
[
|
|
3411
3442
|
"EV_TIMEOUT",
|
|
3412
|
-
|
|
3443
|
+
Jl,
|
|
3413
3444
|
null
|
|
3414
3445
|
],
|
|
3415
3446
|
[
|
|
@@ -3421,22 +3452,22 @@ var gobjJs = function(e) {
|
|
|
3421
3452
|
["ST_SESSION", [
|
|
3422
3453
|
[
|
|
3423
3454
|
"EV_ON_MESSAGE",
|
|
3424
|
-
|
|
3455
|
+
Hl,
|
|
3425
3456
|
null
|
|
3426
3457
|
],
|
|
3427
3458
|
[
|
|
3428
3459
|
"EV_MT_STATS",
|
|
3429
|
-
|
|
3460
|
+
zl,
|
|
3430
3461
|
null
|
|
3431
3462
|
],
|
|
3432
3463
|
[
|
|
3433
3464
|
"EV_MT_COMMAND",
|
|
3434
|
-
|
|
3465
|
+
Ql,
|
|
3435
3466
|
null
|
|
3436
3467
|
],
|
|
3437
3468
|
[
|
|
3438
3469
|
"EV_ON_CLOSE",
|
|
3439
|
-
|
|
3470
|
+
Bl,
|
|
3440
3471
|
"ST_DISCONNECTED"
|
|
3441
3472
|
],
|
|
3442
3473
|
[
|
|
@@ -3447,76 +3478,80 @@ var gobjJs = function(e) {
|
|
|
3447
3478
|
]],
|
|
3448
3479
|
[null, null]
|
|
3449
3480
|
];
|
|
3450
|
-
return (
|
|
3451
|
-
["EV_ON_MESSAGE",
|
|
3452
|
-
["EV_IDENTITY_CARD_ACK",
|
|
3453
|
-
["EV_ON_ID_NAK",
|
|
3454
|
-
["EV_MT_STATS",
|
|
3455
|
-
["EV_MT_COMMAND",
|
|
3456
|
-
["EV_ON_OPEN",
|
|
3457
|
-
["EV_ON_CLOSE",
|
|
3458
|
-
["EV_ON_OPEN_ERROR",
|
|
3481
|
+
return (Ll = de(e, [
|
|
3482
|
+
["EV_ON_MESSAGE", $.EVF_OUTPUT_EVENT],
|
|
3483
|
+
["EV_IDENTITY_CARD_ACK", $.EVF_PUBLIC_EVENT],
|
|
3484
|
+
["EV_ON_ID_NAK", $.EVF_PUBLIC_EVENT | $.EVF_OUTPUT_EVENT],
|
|
3485
|
+
["EV_MT_STATS", $.EVF_PUBLIC_EVENT],
|
|
3486
|
+
["EV_MT_COMMAND", $.EVF_PUBLIC_EVENT],
|
|
3487
|
+
["EV_ON_OPEN", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3488
|
+
["EV_ON_CLOSE", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3489
|
+
["EV_ON_OPEN_ERROR", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3459
3490
|
["EV_TIMEOUT", 0],
|
|
3460
3491
|
[null, 0]
|
|
3461
|
-
], t,
|
|
3492
|
+
], t, Xl, 0, kl, Cl, 0, 0, Al, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3462
3493
|
}("C_IEVENT_CLI");
|
|
3463
3494
|
}, e.register_c_timer = function() {
|
|
3464
3495
|
return function(e) {
|
|
3465
|
-
if (
|
|
3496
|
+
if (pl) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3466
3497
|
const t = [["ST_IDLE", [[
|
|
3467
3498
|
"EV_TIMEOUT",
|
|
3468
|
-
|
|
3499
|
+
ml,
|
|
3469
3500
|
null
|
|
3470
3501
|
]]]];
|
|
3471
|
-
return (
|
|
3472
|
-
["EV_TIMEOUT",
|
|
3473
|
-
["EV_TIMEOUT_PERIODIC",
|
|
3502
|
+
return (pl = de(e, [
|
|
3503
|
+
["EV_TIMEOUT", $.EVF_OUTPUT_EVENT],
|
|
3504
|
+
["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT],
|
|
3474
3505
|
[0, 0]
|
|
3475
|
-
], t,
|
|
3506
|
+
], t, hl, 0, dl, bl, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3476
3507
|
}("C_TIMER");
|
|
3477
3508
|
}, e.register_c_yuno = function() {
|
|
3478
3509
|
return function(e) {
|
|
3479
|
-
if (
|
|
3510
|
+
if (Ol) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3480
3511
|
const t = [["ST_IDLE", [[
|
|
3481
3512
|
"EV_TIMEOUT_PERIODIC",
|
|
3482
|
-
|
|
3513
|
+
Rl,
|
|
3483
3514
|
null
|
|
3484
3515
|
]]]];
|
|
3485
|
-
return (
|
|
3516
|
+
return (Ol = de(e, [["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]], t, $l, 0, vl, jl, 0, 0, 0, 0)) ? 0 : -1;
|
|
3486
3517
|
}("C_YUNO");
|
|
3487
3518
|
}, e.safeSrc = function(e) {
|
|
3488
3519
|
if (!e) return "";
|
|
3489
3520
|
const t = String(e).trim();
|
|
3490
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3491
|
-
}, e.sdata_flag_t =
|
|
3521
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Br(t);
|
|
3522
|
+
}, e.sdata_flag_t = E, e.send_http_json_post = function(e, t, n) {
|
|
3492
3523
|
let r = new XMLHttpRequest();
|
|
3493
3524
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3494
3525
|
4 === r.readyState && n(r.status, r.responseText);
|
|
3495
3526
|
}, r.send(t);
|
|
3496
3527
|
}, e.set_console_log_enabled = function(e) {
|
|
3497
|
-
|
|
3528
|
+
an = !!e;
|
|
3498
3529
|
}, e.set_console_log_filter = function(e) {
|
|
3499
|
-
|
|
3530
|
+
un = "function" == typeof e ? e : null;
|
|
3500
3531
|
}, e.set_log_callback = function(e) {
|
|
3501
|
-
if ((e = "function" == typeof e ? e : null) && e !==
|
|
3502
|
-
|
|
3503
|
-
for (const [e, t, n] of
|
|
3532
|
+
if ((e = "function" == typeof e ? e : null) && e !== on) {
|
|
3533
|
+
on = e;
|
|
3534
|
+
for (const [e, t, n] of _n.slice()) {
|
|
3504
3535
|
let r = t;
|
|
3505
3536
|
if ("json" === e) try {
|
|
3506
3537
|
r = JSON.parse(t);
|
|
3507
3538
|
} catch (e) {
|
|
3508
3539
|
r = t;
|
|
3509
3540
|
}
|
|
3510
|
-
|
|
3511
|
-
}
|
|
3512
|
-
} else
|
|
3513
|
-
}, e.set_remote_log_functions =
|
|
3541
|
+
dn(e, r, n);
|
|
3542
|
+
}
|
|
3543
|
+
} else on = e;
|
|
3544
|
+
}, e.set_remote_log_functions = bn, e.set_strings_are_text = function(e) {
|
|
3545
|
+
zr = !!e;
|
|
3546
|
+
}, e.set_timeout = yl, e.set_timeout_periodic = El, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = Pr, e.strcasecmp = ur, e.strcmp = ar, e.strings_are_text = function() {
|
|
3547
|
+
return zr;
|
|
3548
|
+
}, e.strncmp = function(e, t, n) {
|
|
3514
3549
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3515
3550
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3516
3551
|
}, e.strs_in_list = function(e, t, n) {
|
|
3517
|
-
if (!e) return
|
|
3518
|
-
if (!t) return
|
|
3519
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3552
|
+
if (!e) return hn("ERROR: strs_in_list() list empty"), !1;
|
|
3553
|
+
if (!t) return hn("ERROR: strs_in_list() str empty"), !1;
|
|
3554
|
+
for (let r = 0; r < t.length; r++) if (Pr(e, t[r], n)) return !0;
|
|
3520
3555
|
return !1;
|
|
3521
3556
|
}, e.strstr = function(e, t, n) {
|
|
3522
3557
|
var r;
|
|
@@ -3535,13 +3570,13 @@ var gobjJs = function(e) {
|
|
|
3535
3570
|
placeholder: void 0,
|
|
3536
3571
|
fkey: null
|
|
3537
3572
|
};
|
|
3538
|
-
if (
|
|
3573
|
+
if (tr(t)) {
|
|
3539
3574
|
let e = t.split(".");
|
|
3540
3575
|
for (let t = 0; t < e.length; t++) {
|
|
3541
3576
|
let r = e[t];
|
|
3542
|
-
if (
|
|
3543
|
-
else if (
|
|
3544
|
-
else if (
|
|
3577
|
+
if (Pr(ul, r)) n.real_type || (n.real_type = r);
|
|
3578
|
+
else if (Pr(fl, r)) n.type || (n.type = r);
|
|
3579
|
+
else if (Pr(cl, r)) switch (r) {
|
|
3545
3580
|
case "writable":
|
|
3546
3581
|
n.is_writable = !0;
|
|
3547
3582
|
break;
|
|
@@ -3553,23 +3588,23 @@ var gobjJs = function(e) {
|
|
|
3553
3588
|
}
|
|
3554
3589
|
}
|
|
3555
3590
|
n.real_type || (n.real_type = "string");
|
|
3556
|
-
} else
|
|
3591
|
+
} else Zn(t) ? (n = gl(t), n.name || (n.name = e), n.header || (n.header = e)) : er(t) && (n.real_type = "array", n.enum_list = t);
|
|
3557
3592
|
return n.type || (n.type = n.real_type), n;
|
|
3558
3593
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3559
3594
|
const n = e, r = performance.now();
|
|
3560
3595
|
let l = r;
|
|
3561
|
-
return t &&
|
|
3596
|
+
return t && yn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3562
3597
|
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3563
|
-
return t &&
|
|
3598
|
+
return t && yn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3564
3599
|
partial: i,
|
|
3565
3600
|
total: _
|
|
3566
3601
|
};
|
|
3567
3602
|
} };
|
|
3568
|
-
}, e.trace_json =
|
|
3569
|
-
if (
|
|
3603
|
+
}, e.trace_json = vn, e.trace_json_masked = Un, e.trace_level_t = P, e.trace_msg = Tn, e.treedb_decoder_fkey = al, e.treedb_decoder_hook = function(e, t) {
|
|
3604
|
+
if (tr(t)) {
|
|
3570
3605
|
if (-1 === t.indexOf("^")) {
|
|
3571
3606
|
let n, r = e.hook;
|
|
3572
|
-
if (1 !==
|
|
3607
|
+
if (1 !== zn(r)) return hn("bad hook 1"), hn(e), hn(t), null;
|
|
3573
3608
|
for (let e of Object.keys(r)) {
|
|
3574
3609
|
n = e, r[e];
|
|
3575
3610
|
break;
|
|
@@ -3581,28 +3616,28 @@ var gobjJs = function(e) {
|
|
|
3581
3616
|
}
|
|
3582
3617
|
{
|
|
3583
3618
|
let n = t.split("^");
|
|
3584
|
-
return 2 !== n.length ? (
|
|
3619
|
+
return 2 !== n.length ? (hn("bad hook 2"), hn(e), hn(t), null) : {
|
|
3585
3620
|
topic_name: n[0],
|
|
3586
3621
|
id: n[1]
|
|
3587
3622
|
};
|
|
3588
3623
|
}
|
|
3589
3624
|
}
|
|
3590
|
-
return
|
|
3625
|
+
return Zn(t) ? {
|
|
3591
3626
|
topic_name: t.topic_name,
|
|
3592
3627
|
id: t.id
|
|
3593
|
-
} : (
|
|
3628
|
+
} : (hn("bad hook 3"), hn(e), hn(t), null);
|
|
3594
3629
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3595
|
-
let n =
|
|
3630
|
+
let n = al(e, t);
|
|
3596
3631
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3597
|
-
}, e.treedb_get_field_desc =
|
|
3598
|
-
if (
|
|
3632
|
+
}, e.treedb_get_field_desc = gl, e.treedb_hook_data_size = function(e) {
|
|
3633
|
+
if (er(e) && 1 === Xn(e)) {
|
|
3599
3634
|
let t = e[0];
|
|
3600
|
-
return
|
|
3635
|
+
return gr(t, "size") ? t.size : 1;
|
|
3601
3636
|
}
|
|
3602
|
-
return
|
|
3637
|
+
return Xn(e);
|
|
3603
3638
|
}, e.vsprintf = function(e, t) {
|
|
3604
3639
|
return n.apply(null, [e].concat(t || []));
|
|
3605
|
-
}, e.walk_type_t =
|
|
3640
|
+
}, e.walk_type_t = D, e;
|
|
3606
3641
|
}({});
|
|
3607
3642
|
|
|
3608
3643
|
//# sourceMappingURL=gobj-js.iife.min.js.map
|