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