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