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