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