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