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