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