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