mol_plot_all 1.2.844 → 1.2.846
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/node.audit.js +1 -1
- package/node.d.ts +85 -85
- package/node.deps.json +1 -1
- package/node.js +585 -575
- package/node.js.map +1 -1
- package/node.mjs +585 -575
- package/node.test.js +798 -1091
- package/node.test.js.map +1 -1
- package/package.json +11 -11
- package/web.audit.js +1 -1
- package/web.d.ts +33 -8
- package/web.deps.json +1 -1
- package/web.js +67 -4
- package/web.js.map +1 -1
- package/web.mjs +67 -4
- package/web.test.js +33 -216
- package/web.test.js.map +1 -1
package/node.js
CHANGED
|
@@ -1075,385 +1075,6 @@ var $;
|
|
|
1075
1075
|
;
|
|
1076
1076
|
"use strict";
|
|
1077
1077
|
var $;
|
|
1078
|
-
(function ($) {
|
|
1079
|
-
class $mol_wire_task extends $mol_wire_fiber {
|
|
1080
|
-
static getter(task) {
|
|
1081
|
-
return function $mol_wire_task_get(host, args) {
|
|
1082
|
-
const sub = $mol_wire_auto();
|
|
1083
|
-
const existen = sub?.track_next();
|
|
1084
|
-
reuse: if (existen) {
|
|
1085
|
-
if (!existen.temp)
|
|
1086
|
-
break reuse;
|
|
1087
|
-
if (existen.host !== host)
|
|
1088
|
-
break reuse;
|
|
1089
|
-
if (existen.task !== task)
|
|
1090
|
-
break reuse;
|
|
1091
|
-
if (!$mol_compare_deep(existen.args, args))
|
|
1092
|
-
break reuse;
|
|
1093
|
-
return existen;
|
|
1094
|
-
}
|
|
1095
|
-
return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
|
|
1096
|
-
};
|
|
1097
|
-
}
|
|
1098
|
-
get temp() {
|
|
1099
|
-
return true;
|
|
1100
|
-
}
|
|
1101
|
-
complete() {
|
|
1102
|
-
if ($mol_promise_like(this.cache))
|
|
1103
|
-
return;
|
|
1104
|
-
this.destructor();
|
|
1105
|
-
}
|
|
1106
|
-
put(next) {
|
|
1107
|
-
const prev = this.cache;
|
|
1108
|
-
this.cache = next;
|
|
1109
|
-
if ($mol_promise_like(next)) {
|
|
1110
|
-
this.cursor = $mol_wire_cursor.fresh;
|
|
1111
|
-
if (next !== prev)
|
|
1112
|
-
this.emit();
|
|
1113
|
-
return next;
|
|
1114
|
-
}
|
|
1115
|
-
this.cursor = $mol_wire_cursor.final;
|
|
1116
|
-
if (this.sub_empty)
|
|
1117
|
-
this.destructor();
|
|
1118
|
-
else if (next !== prev)
|
|
1119
|
-
this.emit();
|
|
1120
|
-
return next;
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
$.$mol_wire_task = $mol_wire_task;
|
|
1124
|
-
})($ || ($ = {}));
|
|
1125
|
-
//mol/wire/task/task.ts
|
|
1126
|
-
;
|
|
1127
|
-
"use strict";
|
|
1128
|
-
var $;
|
|
1129
|
-
(function ($) {
|
|
1130
|
-
function $mol_wire_method(host, field, descr) {
|
|
1131
|
-
if (!descr)
|
|
1132
|
-
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1133
|
-
const orig = descr?.value ?? host[field];
|
|
1134
|
-
const sup = Reflect.getPrototypeOf(host);
|
|
1135
|
-
if (typeof sup[field] === 'function') {
|
|
1136
|
-
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1137
|
-
}
|
|
1138
|
-
const temp = $mol_wire_task.getter(orig);
|
|
1139
|
-
const value = function (...args) {
|
|
1140
|
-
const fiber = temp(this ?? null, args);
|
|
1141
|
-
return fiber.sync();
|
|
1142
|
-
};
|
|
1143
|
-
Object.defineProperty(value, 'name', { value: orig.name + ' ' });
|
|
1144
|
-
Object.assign(value, { orig });
|
|
1145
|
-
const descr2 = { ...descr, value };
|
|
1146
|
-
Reflect.defineProperty(host, field, descr2);
|
|
1147
|
-
return descr2;
|
|
1148
|
-
}
|
|
1149
|
-
$.$mol_wire_method = $mol_wire_method;
|
|
1150
|
-
})($ || ($ = {}));
|
|
1151
|
-
//mol/wire/method/method.ts
|
|
1152
|
-
;
|
|
1153
|
-
"use strict";
|
|
1154
|
-
//mol/type/tail/tail.ts
|
|
1155
|
-
;
|
|
1156
|
-
"use strict";
|
|
1157
|
-
//mol/type/foot/foot.ts
|
|
1158
|
-
;
|
|
1159
|
-
"use strict";
|
|
1160
|
-
var $;
|
|
1161
|
-
(function ($) {
|
|
1162
|
-
const catched = new WeakMap();
|
|
1163
|
-
function $mol_fail_catch(error) {
|
|
1164
|
-
if (typeof error !== 'object')
|
|
1165
|
-
return false;
|
|
1166
|
-
if ($mol_promise_like(error))
|
|
1167
|
-
$mol_fail_hidden(error);
|
|
1168
|
-
if (catched.get(error))
|
|
1169
|
-
return false;
|
|
1170
|
-
catched.set(error, true);
|
|
1171
|
-
return true;
|
|
1172
|
-
}
|
|
1173
|
-
$.$mol_fail_catch = $mol_fail_catch;
|
|
1174
|
-
})($ || ($ = {}));
|
|
1175
|
-
//mol/fail/catch/catch.ts
|
|
1176
|
-
;
|
|
1177
|
-
"use strict";
|
|
1178
|
-
var $;
|
|
1179
|
-
(function ($) {
|
|
1180
|
-
function $mol_fail_log(error) {
|
|
1181
|
-
if ($mol_promise_like(error))
|
|
1182
|
-
return false;
|
|
1183
|
-
if (!$mol_fail_catch(error))
|
|
1184
|
-
return false;
|
|
1185
|
-
console.error(error);
|
|
1186
|
-
return true;
|
|
1187
|
-
}
|
|
1188
|
-
$.$mol_fail_log = $mol_fail_log;
|
|
1189
|
-
})($ || ($ = {}));
|
|
1190
|
-
//mol/fail/log/log.ts
|
|
1191
|
-
;
|
|
1192
|
-
"use strict";
|
|
1193
|
-
var $;
|
|
1194
|
-
(function ($) {
|
|
1195
|
-
class $mol_wire_atom extends $mol_wire_fiber {
|
|
1196
|
-
static solo(host, task) {
|
|
1197
|
-
const field = task.name + '()';
|
|
1198
|
-
const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1199
|
-
if (existen)
|
|
1200
|
-
return existen;
|
|
1201
|
-
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1202
|
-
const key = `${prefix}.${field}`;
|
|
1203
|
-
const fiber = new $mol_wire_atom(key, task, host, []);
|
|
1204
|
-
(host ?? task)[field] = fiber;
|
|
1205
|
-
return fiber;
|
|
1206
|
-
}
|
|
1207
|
-
static plex(host, task, key) {
|
|
1208
|
-
const field = task.name + '()';
|
|
1209
|
-
let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1210
|
-
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1211
|
-
const id = `${prefix}.${task.name}(${$mol_key(key).replace(/^"|"$/g, "'")})`;
|
|
1212
|
-
if (dict) {
|
|
1213
|
-
const existen = dict.get(id);
|
|
1214
|
-
if (existen)
|
|
1215
|
-
return existen;
|
|
1216
|
-
}
|
|
1217
|
-
else {
|
|
1218
|
-
dict = (host ?? task)[field] = new Map();
|
|
1219
|
-
}
|
|
1220
|
-
const fiber = new $mol_wire_atom(id, task, host, [key]);
|
|
1221
|
-
dict.set(id, fiber);
|
|
1222
|
-
return fiber;
|
|
1223
|
-
}
|
|
1224
|
-
static watching = new Set();
|
|
1225
|
-
static watcher = null;
|
|
1226
|
-
static watch() {
|
|
1227
|
-
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1228
|
-
for (const atom of $mol_wire_atom.watching) {
|
|
1229
|
-
if (atom.cursor === $mol_wire_cursor.final) {
|
|
1230
|
-
$mol_wire_atom.watching.delete(atom);
|
|
1231
|
-
}
|
|
1232
|
-
else {
|
|
1233
|
-
atom.cursor = $mol_wire_cursor.stale;
|
|
1234
|
-
atom.fresh();
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
watch() {
|
|
1239
|
-
if (!$mol_wire_atom.watcher) {
|
|
1240
|
-
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1241
|
-
}
|
|
1242
|
-
$mol_wire_atom.watching.add(this);
|
|
1243
|
-
}
|
|
1244
|
-
resync(args) {
|
|
1245
|
-
return this.put(this.task.call(this.host, ...args));
|
|
1246
|
-
}
|
|
1247
|
-
once() {
|
|
1248
|
-
return this.sync();
|
|
1249
|
-
}
|
|
1250
|
-
channel() {
|
|
1251
|
-
return Object.assign((next) => {
|
|
1252
|
-
if (next !== undefined)
|
|
1253
|
-
return this.resync([...this.args, next]);
|
|
1254
|
-
if (!$mol_wire_fiber.warm)
|
|
1255
|
-
return this.result();
|
|
1256
|
-
if ($mol_wire_auto()?.temp) {
|
|
1257
|
-
return this.once();
|
|
1258
|
-
}
|
|
1259
|
-
else {
|
|
1260
|
-
return this.sync();
|
|
1261
|
-
}
|
|
1262
|
-
}, { atom: this });
|
|
1263
|
-
}
|
|
1264
|
-
destructor() {
|
|
1265
|
-
super.destructor();
|
|
1266
|
-
const prev = this.cache;
|
|
1267
|
-
if ($mol_owning_check(this, prev)) {
|
|
1268
|
-
prev.destructor();
|
|
1269
|
-
}
|
|
1270
|
-
if (this.pub_from === 0) {
|
|
1271
|
-
;
|
|
1272
|
-
(this.host ?? this.task)[this.field()] = null;
|
|
1273
|
-
}
|
|
1274
|
-
else {
|
|
1275
|
-
;
|
|
1276
|
-
(this.host ?? this.task)[this.field()].delete(this[Symbol.toStringTag]);
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
put(next) {
|
|
1280
|
-
const prev = this.cache;
|
|
1281
|
-
update: if (next !== prev) {
|
|
1282
|
-
try {
|
|
1283
|
-
if ($mol_compare_deep(prev, next))
|
|
1284
|
-
break update;
|
|
1285
|
-
}
|
|
1286
|
-
catch (error) {
|
|
1287
|
-
$mol_fail_log(error);
|
|
1288
|
-
}
|
|
1289
|
-
if ($mol_owning_check(this, prev)) {
|
|
1290
|
-
prev.destructor();
|
|
1291
|
-
}
|
|
1292
|
-
if ($mol_owning_catch(this, next)) {
|
|
1293
|
-
try {
|
|
1294
|
-
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1295
|
-
}
|
|
1296
|
-
catch {
|
|
1297
|
-
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
if (!this.sub_empty)
|
|
1301
|
-
this.emit();
|
|
1302
|
-
}
|
|
1303
|
-
this.cache = next;
|
|
1304
|
-
this.cursor = $mol_wire_cursor.fresh;
|
|
1305
|
-
if ($mol_promise_like(next))
|
|
1306
|
-
return next;
|
|
1307
|
-
this.complete_pubs();
|
|
1308
|
-
return next;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
__decorate([
|
|
1312
|
-
$mol_wire_method
|
|
1313
|
-
], $mol_wire_atom.prototype, "resync", null);
|
|
1314
|
-
__decorate([
|
|
1315
|
-
$mol_wire_method
|
|
1316
|
-
], $mol_wire_atom.prototype, "once", null);
|
|
1317
|
-
$.$mol_wire_atom = $mol_wire_atom;
|
|
1318
|
-
})($ || ($ = {}));
|
|
1319
|
-
//mol/wire/atom/atom.ts
|
|
1320
|
-
;
|
|
1321
|
-
"use strict";
|
|
1322
|
-
var $;
|
|
1323
|
-
(function ($) {
|
|
1324
|
-
function $mol_wire_solo(host, field, descr) {
|
|
1325
|
-
if (!descr)
|
|
1326
|
-
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1327
|
-
const orig = descr?.value ?? host[field];
|
|
1328
|
-
const sup = Reflect.getPrototypeOf(host);
|
|
1329
|
-
if (typeof sup[field] === 'function') {
|
|
1330
|
-
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1331
|
-
}
|
|
1332
|
-
const descr2 = {
|
|
1333
|
-
...descr,
|
|
1334
|
-
value: function (...args) {
|
|
1335
|
-
let atom = $mol_wire_atom.solo(this, orig);
|
|
1336
|
-
if ((args.length === 0) || (args[0] === undefined)) {
|
|
1337
|
-
if (!$mol_wire_fiber.warm)
|
|
1338
|
-
return atom.result();
|
|
1339
|
-
if ($mol_wire_auto()?.temp) {
|
|
1340
|
-
return atom.once();
|
|
1341
|
-
}
|
|
1342
|
-
else {
|
|
1343
|
-
return atom.sync();
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
return atom.resync(args);
|
|
1347
|
-
}
|
|
1348
|
-
};
|
|
1349
|
-
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
1350
|
-
Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
|
|
1351
|
-
Object.assign(descr2.value, { orig });
|
|
1352
|
-
Reflect.defineProperty(host, field, descr2);
|
|
1353
|
-
return descr2;
|
|
1354
|
-
}
|
|
1355
|
-
$.$mol_wire_solo = $mol_wire_solo;
|
|
1356
|
-
})($ || ($ = {}));
|
|
1357
|
-
//mol/wire/solo/solo.ts
|
|
1358
|
-
;
|
|
1359
|
-
"use strict";
|
|
1360
|
-
var $;
|
|
1361
|
-
(function ($) {
|
|
1362
|
-
function $mol_wire_plex(host, field, descr) {
|
|
1363
|
-
if (!descr)
|
|
1364
|
-
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1365
|
-
const orig = descr?.value ?? host[field];
|
|
1366
|
-
const sup = Reflect.getPrototypeOf(host);
|
|
1367
|
-
if (typeof sup[field] === 'function') {
|
|
1368
|
-
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1369
|
-
}
|
|
1370
|
-
const descr2 = {
|
|
1371
|
-
...descr,
|
|
1372
|
-
value: function (...args) {
|
|
1373
|
-
let atom = $mol_wire_atom.plex(this, orig, args[0]);
|
|
1374
|
-
if ((args.length === 1) || (args[1] === undefined)) {
|
|
1375
|
-
if (!$mol_wire_fiber.warm)
|
|
1376
|
-
return atom.result();
|
|
1377
|
-
if ($mol_wire_auto()?.temp) {
|
|
1378
|
-
return atom.once();
|
|
1379
|
-
}
|
|
1380
|
-
else {
|
|
1381
|
-
return atom.sync();
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
return atom.resync(args);
|
|
1385
|
-
}
|
|
1386
|
-
};
|
|
1387
|
-
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
1388
|
-
Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
|
|
1389
|
-
Object.assign(descr2.value, { orig });
|
|
1390
|
-
Reflect.defineProperty(host, field, descr2);
|
|
1391
|
-
return descr2;
|
|
1392
|
-
}
|
|
1393
|
-
$.$mol_wire_plex = $mol_wire_plex;
|
|
1394
|
-
})($ || ($ = {}));
|
|
1395
|
-
//mol/wire/plex/plex.ts
|
|
1396
|
-
;
|
|
1397
|
-
"use strict";
|
|
1398
|
-
var $;
|
|
1399
|
-
(function ($) {
|
|
1400
|
-
$.$mol_mem = $mol_wire_solo;
|
|
1401
|
-
$.$mol_mem_key = $mol_wire_plex;
|
|
1402
|
-
})($ || ($ = {}));
|
|
1403
|
-
//mol/mem/mem.ts
|
|
1404
|
-
;
|
|
1405
|
-
"use strict";
|
|
1406
|
-
var $;
|
|
1407
|
-
(function ($) {
|
|
1408
|
-
})($ || ($ = {}));
|
|
1409
|
-
//mol/dom/context/context.ts
|
|
1410
|
-
;
|
|
1411
|
-
"use strict";
|
|
1412
|
-
//node/node.ts
|
|
1413
|
-
;
|
|
1414
|
-
"use strict";
|
|
1415
|
-
var $node = new Proxy({ require }, {
|
|
1416
|
-
get(target, name, wrapper) {
|
|
1417
|
-
if (target[name])
|
|
1418
|
-
return target[name];
|
|
1419
|
-
const mod = target.require('module');
|
|
1420
|
-
if (mod.builtinModules.indexOf(name) >= 0)
|
|
1421
|
-
return target.require(name);
|
|
1422
|
-
if (name[0] === '.')
|
|
1423
|
-
return target.require(name);
|
|
1424
|
-
const path = target.require('path');
|
|
1425
|
-
const fs = target.require('fs');
|
|
1426
|
-
let dir = path.resolve('.');
|
|
1427
|
-
const suffix = `./node_modules/${name}`;
|
|
1428
|
-
const $$ = $;
|
|
1429
|
-
while (!fs.existsSync(path.join(dir, suffix))) {
|
|
1430
|
-
const parent = path.resolve(dir, '..');
|
|
1431
|
-
if (parent === dir) {
|
|
1432
|
-
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
|
|
1433
|
-
try {
|
|
1434
|
-
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
|
|
1435
|
-
}
|
|
1436
|
-
catch { }
|
|
1437
|
-
break;
|
|
1438
|
-
}
|
|
1439
|
-
else {
|
|
1440
|
-
dir = parent;
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
return target.require(name);
|
|
1444
|
-
},
|
|
1445
|
-
set(target, name, value) {
|
|
1446
|
-
target[name] = value;
|
|
1447
|
-
return true;
|
|
1448
|
-
},
|
|
1449
|
-
});
|
|
1450
|
-
require = (req => Object.assign(function require(name) {
|
|
1451
|
-
return $node[name];
|
|
1452
|
-
}, req))(require);
|
|
1453
|
-
//node/node.node.ts
|
|
1454
|
-
;
|
|
1455
|
-
"use strict";
|
|
1456
|
-
var $;
|
|
1457
1078
|
(function ($) {
|
|
1458
1079
|
function $mol_log3_area_lazy(event) {
|
|
1459
1080
|
const self = this;
|
|
@@ -1516,7 +1137,7 @@ var $;
|
|
|
1516
1137
|
};
|
|
1517
1138
|
}
|
|
1518
1139
|
error(message, Class = Error) {
|
|
1519
|
-
return new Class(`${message}${this}`);
|
|
1140
|
+
return new Class(`${message} (${this})`);
|
|
1520
1141
|
}
|
|
1521
1142
|
span(row, col, length) {
|
|
1522
1143
|
return new $mol_span(this.uri, this.source, row, col, length);
|
|
@@ -1531,11 +1152,11 @@ var $;
|
|
|
1531
1152
|
if (end < 0)
|
|
1532
1153
|
end += len;
|
|
1533
1154
|
if (begin < 0 || begin > len)
|
|
1534
|
-
this.$.$mol_fail(`Begin value '${begin}' out of range
|
|
1155
|
+
this.$.$mol_fail(this.error(`Begin value '${begin}' out of range`, RangeError));
|
|
1535
1156
|
if (end < 0 || end > len)
|
|
1536
|
-
this.$.$mol_fail(`End value '${end}' out of range
|
|
1157
|
+
this.$.$mol_fail(this.error(`End value '${end}' out of range`, RangeError));
|
|
1537
1158
|
if (end < begin)
|
|
1538
|
-
this.$.$mol_fail(`End value '${end}' can't be less than begin value
|
|
1159
|
+
this.$.$mol_fail(this.error(`End value '${end}' can't be less than begin value`, RangeError));
|
|
1539
1160
|
return this.span(this.row, this.col + begin, end - begin);
|
|
1540
1161
|
}
|
|
1541
1162
|
}
|
|
@@ -1720,250 +1341,639 @@ var $;
|
|
|
1720
1341
|
try {
|
|
1721
1342
|
return handle(child, belt, context);
|
|
1722
1343
|
}
|
|
1723
|
-
catch (error) {
|
|
1724
|
-
error.message += `\n${child.clone([])}${child.span}`;
|
|
1725
|
-
$mol_fail_hidden(error);
|
|
1344
|
+
catch (error) {
|
|
1345
|
+
error.message += `\n${child.clone([])}${child.span}`;
|
|
1346
|
+
$mol_fail_hidden(error);
|
|
1347
|
+
}
|
|
1348
|
+
}));
|
|
1349
|
+
}
|
|
1350
|
+
error(message, Class = Error) {
|
|
1351
|
+
return this.span.error(`${message}\n${this.clone([])}`, Class);
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
$.$mol_tree2 = $mol_tree2;
|
|
1355
|
+
class $mol_tree2_empty extends $mol_tree2 {
|
|
1356
|
+
constructor() {
|
|
1357
|
+
super('', '', [], $mol_span.unknown);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
$.$mol_tree2_empty = $mol_tree2_empty;
|
|
1361
|
+
})($ || ($ = {}));
|
|
1362
|
+
//mol/tree2/tree2.ts
|
|
1363
|
+
;
|
|
1364
|
+
"use strict";
|
|
1365
|
+
var $;
|
|
1366
|
+
(function ($) {
|
|
1367
|
+
class $mol_error_syntax extends SyntaxError {
|
|
1368
|
+
reason;
|
|
1369
|
+
line;
|
|
1370
|
+
span;
|
|
1371
|
+
constructor(reason, line, span) {
|
|
1372
|
+
super(`${reason}\n${span}\n${line.substring(0, span.col - 1).replace(/\S/g, ' ')}${''.padEnd(span.length, '!')}\n${line}`);
|
|
1373
|
+
this.reason = reason;
|
|
1374
|
+
this.line = line;
|
|
1375
|
+
this.span = span;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
$.$mol_error_syntax = $mol_error_syntax;
|
|
1379
|
+
})($ || ($ = {}));
|
|
1380
|
+
//mol/error/syntax/syntax.ts
|
|
1381
|
+
;
|
|
1382
|
+
"use strict";
|
|
1383
|
+
var $;
|
|
1384
|
+
(function ($) {
|
|
1385
|
+
function $mol_tree2_from_string(str, uri = '?') {
|
|
1386
|
+
const span = $mol_span.entire(uri, str);
|
|
1387
|
+
var root = $mol_tree2.list([], span);
|
|
1388
|
+
var stack = [root];
|
|
1389
|
+
var pos = 0, row = 0, min_indent = 0;
|
|
1390
|
+
while (str.length > pos) {
|
|
1391
|
+
var indent = 0;
|
|
1392
|
+
var line_start = pos;
|
|
1393
|
+
row++;
|
|
1394
|
+
while (str.length > pos && str[pos] == '\t') {
|
|
1395
|
+
indent++;
|
|
1396
|
+
pos++;
|
|
1397
|
+
}
|
|
1398
|
+
if (!root.kids.length) {
|
|
1399
|
+
min_indent = indent;
|
|
1400
|
+
}
|
|
1401
|
+
indent -= min_indent;
|
|
1402
|
+
if (indent < 0 || indent >= stack.length) {
|
|
1403
|
+
const sp = span.span(row, 1, pos - line_start);
|
|
1404
|
+
while (str.length > pos && str[pos] != '\n') {
|
|
1405
|
+
pos++;
|
|
1406
|
+
}
|
|
1407
|
+
if (indent < 0) {
|
|
1408
|
+
if (str.length > pos) {
|
|
1409
|
+
this.$mol_fail(new this.$mol_error_syntax(`Too few tabs`, str.substring(line_start, pos), sp));
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
else {
|
|
1413
|
+
this.$mol_fail(new this.$mol_error_syntax(`Too many tabs`, str.substring(line_start, pos), sp));
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
stack.length = indent + 1;
|
|
1417
|
+
var parent = stack[indent];
|
|
1418
|
+
while (str.length > pos && str[pos] != '\\' && str[pos] != '\n') {
|
|
1419
|
+
var error_start = pos;
|
|
1420
|
+
while (str.length > pos && (str[pos] == ' ' || str[pos] == '\t')) {
|
|
1421
|
+
pos++;
|
|
1422
|
+
}
|
|
1423
|
+
if (pos > error_start) {
|
|
1424
|
+
let line_end = str.indexOf('\n', pos);
|
|
1425
|
+
if (line_end === -1)
|
|
1426
|
+
line_end = str.length;
|
|
1427
|
+
const sp = span.span(row, error_start - line_start + 1, pos - error_start);
|
|
1428
|
+
this.$mol_fail(new this.$mol_error_syntax(`Wrong nodes separator`, str.substring(line_start, line_end), sp));
|
|
1429
|
+
}
|
|
1430
|
+
var type_start = pos;
|
|
1431
|
+
while (str.length > pos &&
|
|
1432
|
+
str[pos] != '\\' &&
|
|
1433
|
+
str[pos] != ' ' &&
|
|
1434
|
+
str[pos] != '\t' &&
|
|
1435
|
+
str[pos] != '\n') {
|
|
1436
|
+
pos++;
|
|
1437
|
+
}
|
|
1438
|
+
if (pos > type_start) {
|
|
1439
|
+
let next = new $mol_tree2(str.slice(type_start, pos), '', [], span.span(row, type_start - line_start + 1, pos - type_start));
|
|
1440
|
+
const parent_kids = parent.kids;
|
|
1441
|
+
parent_kids.push(next);
|
|
1442
|
+
parent = next;
|
|
1443
|
+
}
|
|
1444
|
+
if (str.length > pos && str[pos] == ' ') {
|
|
1445
|
+
pos++;
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
if (str.length > pos && str[pos] == '\\') {
|
|
1449
|
+
var data_start = pos;
|
|
1450
|
+
while (str.length > pos && str[pos] != '\n') {
|
|
1451
|
+
pos++;
|
|
1452
|
+
}
|
|
1453
|
+
let next = new $mol_tree2('', str.slice(data_start + 1, pos), [], span.span(row, data_start - line_start + 2, pos - data_start - 1));
|
|
1454
|
+
const parent_kids = parent.kids;
|
|
1455
|
+
parent_kids.push(next);
|
|
1456
|
+
parent = next;
|
|
1457
|
+
}
|
|
1458
|
+
if (str.length === pos && stack.length > 0) {
|
|
1459
|
+
const sp = span.span(row, pos - line_start + 1, 1);
|
|
1460
|
+
this.$mol_fail(new this.$mol_error_syntax(`Unexpected EOF, LF required`, str.substring(line_start, str.length), sp));
|
|
1461
|
+
}
|
|
1462
|
+
stack.push(parent);
|
|
1463
|
+
pos++;
|
|
1464
|
+
}
|
|
1465
|
+
return root;
|
|
1466
|
+
}
|
|
1467
|
+
$.$mol_tree2_from_string = $mol_tree2_from_string;
|
|
1468
|
+
})($ || ($ = {}));
|
|
1469
|
+
//mol/tree2/from/string/string.ts
|
|
1470
|
+
;
|
|
1471
|
+
"use strict";
|
|
1472
|
+
var $;
|
|
1473
|
+
(function ($) {
|
|
1474
|
+
function $mol_tree2_from_json(json, span = $mol_span.unknown) {
|
|
1475
|
+
if (typeof json === 'boolean' || typeof json === 'number' || json === null) {
|
|
1476
|
+
return new $mol_tree2(String(json), '', [], span);
|
|
1477
|
+
}
|
|
1478
|
+
if (typeof json === 'string') {
|
|
1479
|
+
return $mol_tree2.data(json, [], span);
|
|
1480
|
+
}
|
|
1481
|
+
if (Array.isArray(json)) {
|
|
1482
|
+
const sub = json.map(json => $mol_tree2_from_json(json, span));
|
|
1483
|
+
return new $mol_tree2('/', '', sub, span);
|
|
1484
|
+
}
|
|
1485
|
+
if (ArrayBuffer.isView(json)) {
|
|
1486
|
+
const buf = new Uint8Array(json.buffer, json.byteOffset, json.byteLength);
|
|
1487
|
+
return $mol_tree2.data(String.fromCharCode(...buf), [], span);
|
|
1488
|
+
}
|
|
1489
|
+
if (json instanceof Date) {
|
|
1490
|
+
return new $mol_tree2('', json.toISOString(), [], span);
|
|
1491
|
+
}
|
|
1492
|
+
if (typeof json.toJSON === 'function') {
|
|
1493
|
+
return $mol_tree2_from_json(json.toJSON());
|
|
1494
|
+
}
|
|
1495
|
+
if (json instanceof Error) {
|
|
1496
|
+
const { name, message, stack } = json;
|
|
1497
|
+
json = { ...json, name, message, stack };
|
|
1498
|
+
}
|
|
1499
|
+
const sub = [];
|
|
1500
|
+
for (var key in json) {
|
|
1501
|
+
const val = json[key];
|
|
1502
|
+
if (val === undefined)
|
|
1503
|
+
continue;
|
|
1504
|
+
const subsub = $mol_tree2_from_json(val, span);
|
|
1505
|
+
if (/^[^\n\t\\ ]+$/.test(key)) {
|
|
1506
|
+
sub.push(new $mol_tree2(key, '', [subsub], span));
|
|
1507
|
+
}
|
|
1508
|
+
else {
|
|
1509
|
+
sub.push($mol_tree2.data(key, [subsub], span));
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
return new $mol_tree2('*', '', sub, span);
|
|
1513
|
+
}
|
|
1514
|
+
$.$mol_tree2_from_json = $mol_tree2_from_json;
|
|
1515
|
+
})($ || ($ = {}));
|
|
1516
|
+
//mol/tree2/from/json/json.ts
|
|
1517
|
+
;
|
|
1518
|
+
"use strict";
|
|
1519
|
+
var $;
|
|
1520
|
+
(function ($) {
|
|
1521
|
+
class $mol_term_color {
|
|
1522
|
+
static reset = this.ansi(0, 0);
|
|
1523
|
+
static bold = this.ansi(1, 22);
|
|
1524
|
+
static italic = this.ansi(3, 23);
|
|
1525
|
+
static underline = this.ansi(4, 24);
|
|
1526
|
+
static inverse = this.ansi(7, 27);
|
|
1527
|
+
static hidden = this.ansi(8, 28);
|
|
1528
|
+
static strike = this.ansi(9, 29);
|
|
1529
|
+
static gray = this.ansi(90, 39);
|
|
1530
|
+
static red = this.ansi(91, 39);
|
|
1531
|
+
static green = this.ansi(92, 39);
|
|
1532
|
+
static yellow = this.ansi(93, 39);
|
|
1533
|
+
static blue = this.ansi(94, 39);
|
|
1534
|
+
static magenta = this.ansi(95, 39);
|
|
1535
|
+
static cyan = this.ansi(96, 39);
|
|
1536
|
+
static Gray = (str) => this.inverse(this.gray(str));
|
|
1537
|
+
static Red = (str) => this.inverse(this.red(str));
|
|
1538
|
+
static Green = (str) => this.inverse(this.green(str));
|
|
1539
|
+
static Yellow = (str) => this.inverse(this.yellow(str));
|
|
1540
|
+
static Blue = (str) => this.inverse(this.blue(str));
|
|
1541
|
+
static Magenta = (str) => this.inverse(this.magenta(str));
|
|
1542
|
+
static Cyan = (str) => this.inverse(this.cyan(str));
|
|
1543
|
+
static ansi(open, close) {
|
|
1544
|
+
if (typeof process === 'undefined')
|
|
1545
|
+
return String;
|
|
1546
|
+
if (!process.stdout.isTTY)
|
|
1547
|
+
return String;
|
|
1548
|
+
const prefix = `\x1b[${open}m`;
|
|
1549
|
+
const postfix = `\x1b[${close}m`;
|
|
1550
|
+
const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
|
|
1551
|
+
return function colorer(str) {
|
|
1552
|
+
str = String(str);
|
|
1553
|
+
if (str === '')
|
|
1554
|
+
return str;
|
|
1555
|
+
const suffix = str.replace(suffix_regexp, prefix);
|
|
1556
|
+
return prefix + suffix + postfix;
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
$.$mol_term_color = $mol_term_color;
|
|
1561
|
+
})($ || ($ = {}));
|
|
1562
|
+
//mol/term/color/color.ts
|
|
1563
|
+
;
|
|
1564
|
+
"use strict";
|
|
1565
|
+
var $;
|
|
1566
|
+
(function ($) {
|
|
1567
|
+
function $mol_log3_node_make(level, output, type, color) {
|
|
1568
|
+
return function $mol_log3_logger(event) {
|
|
1569
|
+
if (!event.time)
|
|
1570
|
+
event = { time: new Date().toISOString(), ...event };
|
|
1571
|
+
let tree = this.$mol_tree2_from_json(event);
|
|
1572
|
+
tree = tree.struct(type, tree.kids);
|
|
1573
|
+
let str = color(tree.toString());
|
|
1574
|
+
this.console[level](str);
|
|
1575
|
+
const self = this;
|
|
1576
|
+
return () => self.console.groupEnd();
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
1580
|
+
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
1581
|
+
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
1582
|
+
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
1583
|
+
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
1584
|
+
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
1585
|
+
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
1586
|
+
})($ || ($ = {}));
|
|
1587
|
+
//mol/log3/log3.node.ts
|
|
1588
|
+
;
|
|
1589
|
+
"use strict";
|
|
1590
|
+
var $;
|
|
1591
|
+
(function ($) {
|
|
1592
|
+
class $mol_wire_task extends $mol_wire_fiber {
|
|
1593
|
+
static getter(task) {
|
|
1594
|
+
return function $mol_wire_task_get(host, args) {
|
|
1595
|
+
const sub = $mol_wire_auto();
|
|
1596
|
+
const existen = sub?.track_next();
|
|
1597
|
+
reuse: if (existen) {
|
|
1598
|
+
if (!existen.temp)
|
|
1599
|
+
break reuse;
|
|
1600
|
+
if (existen.host !== host)
|
|
1601
|
+
break reuse;
|
|
1602
|
+
if (existen.task !== task)
|
|
1603
|
+
break reuse;
|
|
1604
|
+
if (!$mol_compare_deep(existen.args, args))
|
|
1605
|
+
break reuse;
|
|
1606
|
+
return existen;
|
|
1607
|
+
}
|
|
1608
|
+
const next = new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
|
|
1609
|
+
if (existen?.temp) {
|
|
1610
|
+
$$.$mol_log3_warn({
|
|
1611
|
+
place: '$mol_wire_task',
|
|
1612
|
+
message: `Non idempotency`,
|
|
1613
|
+
existen,
|
|
1614
|
+
next,
|
|
1615
|
+
hint: 'Ignore it',
|
|
1616
|
+
});
|
|
1726
1617
|
}
|
|
1727
|
-
|
|
1618
|
+
return next;
|
|
1619
|
+
};
|
|
1728
1620
|
}
|
|
1729
|
-
|
|
1730
|
-
return
|
|
1621
|
+
get temp() {
|
|
1622
|
+
return true;
|
|
1731
1623
|
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1624
|
+
complete() {
|
|
1625
|
+
if ($mol_promise_like(this.cache))
|
|
1626
|
+
return;
|
|
1627
|
+
this.destructor();
|
|
1628
|
+
}
|
|
1629
|
+
put(next) {
|
|
1630
|
+
const prev = this.cache;
|
|
1631
|
+
this.cache = next;
|
|
1632
|
+
if ($mol_promise_like(next)) {
|
|
1633
|
+
this.cursor = $mol_wire_cursor.fresh;
|
|
1634
|
+
if (next !== prev)
|
|
1635
|
+
this.emit();
|
|
1636
|
+
return next;
|
|
1637
|
+
}
|
|
1638
|
+
this.cursor = $mol_wire_cursor.final;
|
|
1639
|
+
if (this.sub_empty)
|
|
1640
|
+
this.destructor();
|
|
1641
|
+
else if (next !== prev)
|
|
1642
|
+
this.emit();
|
|
1643
|
+
return next;
|
|
1737
1644
|
}
|
|
1738
1645
|
}
|
|
1739
|
-
$.$
|
|
1646
|
+
$.$mol_wire_task = $mol_wire_task;
|
|
1740
1647
|
})($ || ($ = {}));
|
|
1741
|
-
//mol/
|
|
1648
|
+
//mol/wire/task/task.ts
|
|
1742
1649
|
;
|
|
1743
1650
|
"use strict";
|
|
1744
1651
|
var $;
|
|
1745
1652
|
(function ($) {
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
this.line = line;
|
|
1754
|
-
this.span = span;
|
|
1653
|
+
function $mol_wire_method(host, field, descr) {
|
|
1654
|
+
if (!descr)
|
|
1655
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1656
|
+
const orig = descr?.value ?? host[field];
|
|
1657
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1658
|
+
if (typeof sup[field] === 'function') {
|
|
1659
|
+
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1755
1660
|
}
|
|
1661
|
+
const temp = $mol_wire_task.getter(orig);
|
|
1662
|
+
const value = function (...args) {
|
|
1663
|
+
const fiber = temp(this ?? null, args);
|
|
1664
|
+
return fiber.sync();
|
|
1665
|
+
};
|
|
1666
|
+
Object.defineProperty(value, 'name', { value: orig.name + ' ' });
|
|
1667
|
+
Object.assign(value, { orig });
|
|
1668
|
+
const descr2 = { ...descr, value };
|
|
1669
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1670
|
+
return descr2;
|
|
1756
1671
|
}
|
|
1757
|
-
$.$
|
|
1672
|
+
$.$mol_wire_method = $mol_wire_method;
|
|
1758
1673
|
})($ || ($ = {}));
|
|
1759
|
-
//mol/
|
|
1674
|
+
//mol/wire/method/method.ts
|
|
1675
|
+
;
|
|
1676
|
+
"use strict";
|
|
1677
|
+
//mol/type/tail/tail.ts
|
|
1678
|
+
;
|
|
1679
|
+
"use strict";
|
|
1680
|
+
//mol/type/foot/foot.ts
|
|
1760
1681
|
;
|
|
1761
1682
|
"use strict";
|
|
1762
1683
|
var $;
|
|
1763
1684
|
(function ($) {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1685
|
+
const catched = new WeakMap();
|
|
1686
|
+
function $mol_fail_catch(error) {
|
|
1687
|
+
if (typeof error !== 'object')
|
|
1688
|
+
return false;
|
|
1689
|
+
if ($mol_promise_like(error))
|
|
1690
|
+
$mol_fail_hidden(error);
|
|
1691
|
+
if (catched.get(error))
|
|
1692
|
+
return false;
|
|
1693
|
+
catched.set(error, true);
|
|
1694
|
+
return true;
|
|
1695
|
+
}
|
|
1696
|
+
$.$mol_fail_catch = $mol_fail_catch;
|
|
1697
|
+
})($ || ($ = {}));
|
|
1698
|
+
//mol/fail/catch/catch.ts
|
|
1699
|
+
;
|
|
1700
|
+
"use strict";
|
|
1701
|
+
var $;
|
|
1702
|
+
(function ($) {
|
|
1703
|
+
function $mol_fail_log(error) {
|
|
1704
|
+
if ($mol_promise_like(error))
|
|
1705
|
+
return false;
|
|
1706
|
+
if (!$mol_fail_catch(error))
|
|
1707
|
+
return false;
|
|
1708
|
+
console.error(error);
|
|
1709
|
+
return true;
|
|
1710
|
+
}
|
|
1711
|
+
$.$mol_fail_log = $mol_fail_log;
|
|
1712
|
+
})($ || ($ = {}));
|
|
1713
|
+
//mol/fail/log/log.ts
|
|
1714
|
+
;
|
|
1715
|
+
"use strict";
|
|
1716
|
+
var $;
|
|
1717
|
+
(function ($) {
|
|
1718
|
+
class $mol_wire_atom extends $mol_wire_fiber {
|
|
1719
|
+
static solo(host, task) {
|
|
1720
|
+
const field = task.name + '()';
|
|
1721
|
+
const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1722
|
+
if (existen)
|
|
1723
|
+
return existen;
|
|
1724
|
+
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1725
|
+
const key = `${prefix}.${field}`;
|
|
1726
|
+
const fiber = new $mol_wire_atom(key, task, host, []);
|
|
1727
|
+
(host ?? task)[field] = fiber;
|
|
1728
|
+
return fiber;
|
|
1729
|
+
}
|
|
1730
|
+
static plex(host, task, key) {
|
|
1731
|
+
const field = task.name + '()';
|
|
1732
|
+
let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1733
|
+
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1734
|
+
const id = `${prefix}.${task.name}(${$mol_key(key).replace(/^"|"$/g, "'")})`;
|
|
1735
|
+
if (dict) {
|
|
1736
|
+
const existen = dict.get(id);
|
|
1737
|
+
if (existen)
|
|
1738
|
+
return existen;
|
|
1776
1739
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1740
|
+
else {
|
|
1741
|
+
dict = (host ?? task)[field] = new Map();
|
|
1779
1742
|
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1743
|
+
const fiber = new $mol_wire_atom(id, task, host, [key]);
|
|
1744
|
+
dict.set(id, fiber);
|
|
1745
|
+
return fiber;
|
|
1746
|
+
}
|
|
1747
|
+
static watching = new Set();
|
|
1748
|
+
static watcher = null;
|
|
1749
|
+
static watch() {
|
|
1750
|
+
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1751
|
+
for (const atom of $mol_wire_atom.watching) {
|
|
1752
|
+
if (atom.cursor === $mol_wire_cursor.final) {
|
|
1753
|
+
$mol_wire_atom.watching.delete(atom);
|
|
1790
1754
|
}
|
|
1791
1755
|
else {
|
|
1792
|
-
|
|
1756
|
+
atom.cursor = $mol_wire_cursor.stale;
|
|
1757
|
+
atom.fresh();
|
|
1793
1758
|
}
|
|
1794
1759
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1760
|
+
}
|
|
1761
|
+
watch() {
|
|
1762
|
+
if (!$mol_wire_atom.watcher) {
|
|
1763
|
+
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1764
|
+
}
|
|
1765
|
+
$mol_wire_atom.watching.add(this);
|
|
1766
|
+
}
|
|
1767
|
+
resync(args) {
|
|
1768
|
+
return this.put(this.task.call(this.host, ...args));
|
|
1769
|
+
}
|
|
1770
|
+
once() {
|
|
1771
|
+
return this.sync();
|
|
1772
|
+
}
|
|
1773
|
+
channel() {
|
|
1774
|
+
return Object.assign((next) => {
|
|
1775
|
+
if (next !== undefined)
|
|
1776
|
+
return this.resync([...this.args, next]);
|
|
1777
|
+
if (!$mol_wire_fiber.warm)
|
|
1778
|
+
return this.result();
|
|
1779
|
+
if ($mol_wire_auto()?.temp) {
|
|
1780
|
+
return this.once();
|
|
1808
1781
|
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
str[pos] != '\\' &&
|
|
1812
|
-
str[pos] != ' ' &&
|
|
1813
|
-
str[pos] != '\t' &&
|
|
1814
|
-
str[pos] != '\n') {
|
|
1815
|
-
pos++;
|
|
1782
|
+
else {
|
|
1783
|
+
return this.sync();
|
|
1816
1784
|
}
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1785
|
+
}, { atom: this });
|
|
1786
|
+
}
|
|
1787
|
+
destructor() {
|
|
1788
|
+
super.destructor();
|
|
1789
|
+
const prev = this.cache;
|
|
1790
|
+
if ($mol_owning_check(this, prev)) {
|
|
1791
|
+
prev.destructor();
|
|
1792
|
+
}
|
|
1793
|
+
if (this.pub_from === 0) {
|
|
1794
|
+
;
|
|
1795
|
+
(this.host ?? this.task)[this.field()] = null;
|
|
1796
|
+
}
|
|
1797
|
+
else {
|
|
1798
|
+
;
|
|
1799
|
+
(this.host ?? this.task)[this.field()].delete(this[Symbol.toStringTag]);
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
put(next) {
|
|
1803
|
+
const prev = this.cache;
|
|
1804
|
+
update: if (next !== prev) {
|
|
1805
|
+
try {
|
|
1806
|
+
if ($mol_compare_deep(prev, next))
|
|
1807
|
+
break update;
|
|
1822
1808
|
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1809
|
+
catch (error) {
|
|
1810
|
+
$mol_fail_log(error);
|
|
1825
1811
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
var data_start = pos;
|
|
1829
|
-
while (str.length > pos && str[pos] != '\n') {
|
|
1830
|
-
pos++;
|
|
1812
|
+
if ($mol_owning_check(this, prev)) {
|
|
1813
|
+
prev.destructor();
|
|
1831
1814
|
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1815
|
+
if ($mol_owning_catch(this, next)) {
|
|
1816
|
+
try {
|
|
1817
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1818
|
+
}
|
|
1819
|
+
catch {
|
|
1820
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
if (!this.sub_empty)
|
|
1824
|
+
this.emit();
|
|
1840
1825
|
}
|
|
1841
|
-
|
|
1842
|
-
|
|
1826
|
+
this.cache = next;
|
|
1827
|
+
this.cursor = $mol_wire_cursor.fresh;
|
|
1828
|
+
if ($mol_promise_like(next))
|
|
1829
|
+
return next;
|
|
1830
|
+
this.complete_pubs();
|
|
1831
|
+
return next;
|
|
1843
1832
|
}
|
|
1844
|
-
return root;
|
|
1845
1833
|
}
|
|
1846
|
-
|
|
1834
|
+
__decorate([
|
|
1835
|
+
$mol_wire_method
|
|
1836
|
+
], $mol_wire_atom.prototype, "resync", null);
|
|
1837
|
+
__decorate([
|
|
1838
|
+
$mol_wire_method
|
|
1839
|
+
], $mol_wire_atom.prototype, "once", null);
|
|
1840
|
+
$.$mol_wire_atom = $mol_wire_atom;
|
|
1847
1841
|
})($ || ($ = {}));
|
|
1848
|
-
//mol/
|
|
1842
|
+
//mol/wire/atom/atom.ts
|
|
1849
1843
|
;
|
|
1850
1844
|
"use strict";
|
|
1851
1845
|
var $;
|
|
1852
1846
|
(function ($) {
|
|
1853
|
-
function $
|
|
1854
|
-
if (
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
if (Array.isArray(json)) {
|
|
1861
|
-
const sub = json.map(json => $mol_tree2_from_json(json, span));
|
|
1862
|
-
return new $mol_tree2('/', '', sub, span);
|
|
1863
|
-
}
|
|
1864
|
-
if (ArrayBuffer.isView(json)) {
|
|
1865
|
-
const buf = new Uint8Array(json.buffer, json.byteOffset, json.byteLength);
|
|
1866
|
-
return $mol_tree2.data(String.fromCharCode(...buf), [], span);
|
|
1867
|
-
}
|
|
1868
|
-
if (json instanceof Date) {
|
|
1869
|
-
return new $mol_tree2('', json.toISOString(), [], span);
|
|
1870
|
-
}
|
|
1871
|
-
if (typeof json.toJSON === 'function') {
|
|
1872
|
-
return $mol_tree2_from_json(json.toJSON());
|
|
1873
|
-
}
|
|
1874
|
-
if (json instanceof Error) {
|
|
1875
|
-
const { name, message, stack } = json;
|
|
1876
|
-
json = { ...json, name, message, stack };
|
|
1847
|
+
function $mol_wire_solo(host, field, descr) {
|
|
1848
|
+
if (!descr)
|
|
1849
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1850
|
+
const orig = descr?.value ?? host[field];
|
|
1851
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1852
|
+
if (typeof sup[field] === 'function') {
|
|
1853
|
+
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1877
1854
|
}
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1855
|
+
const descr2 = {
|
|
1856
|
+
...descr,
|
|
1857
|
+
value: function (...args) {
|
|
1858
|
+
let atom = $mol_wire_atom.solo(this, orig);
|
|
1859
|
+
if ((args.length === 0) || (args[0] === undefined)) {
|
|
1860
|
+
if (!$mol_wire_fiber.warm)
|
|
1861
|
+
return atom.result();
|
|
1862
|
+
if ($mol_wire_auto()?.temp) {
|
|
1863
|
+
return atom.once();
|
|
1864
|
+
}
|
|
1865
|
+
else {
|
|
1866
|
+
return atom.sync();
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
return atom.resync(args);
|
|
1889
1870
|
}
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1871
|
+
};
|
|
1872
|
+
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
1873
|
+
Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
|
|
1874
|
+
Object.assign(descr2.value, { orig });
|
|
1875
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1876
|
+
return descr2;
|
|
1892
1877
|
}
|
|
1893
|
-
$.$
|
|
1878
|
+
$.$mol_wire_solo = $mol_wire_solo;
|
|
1894
1879
|
})($ || ($ = {}));
|
|
1895
|
-
//mol/
|
|
1880
|
+
//mol/wire/solo/solo.ts
|
|
1896
1881
|
;
|
|
1897
1882
|
"use strict";
|
|
1898
1883
|
var $;
|
|
1899
1884
|
(function ($) {
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
static strike = this.ansi(9, 29);
|
|
1908
|
-
static gray = this.ansi(90, 39);
|
|
1909
|
-
static red = this.ansi(91, 39);
|
|
1910
|
-
static green = this.ansi(92, 39);
|
|
1911
|
-
static yellow = this.ansi(93, 39);
|
|
1912
|
-
static blue = this.ansi(94, 39);
|
|
1913
|
-
static magenta = this.ansi(95, 39);
|
|
1914
|
-
static cyan = this.ansi(96, 39);
|
|
1915
|
-
static Gray = (str) => this.inverse(this.gray(str));
|
|
1916
|
-
static Red = (str) => this.inverse(this.red(str));
|
|
1917
|
-
static Green = (str) => this.inverse(this.green(str));
|
|
1918
|
-
static Yellow = (str) => this.inverse(this.yellow(str));
|
|
1919
|
-
static Blue = (str) => this.inverse(this.blue(str));
|
|
1920
|
-
static Magenta = (str) => this.inverse(this.magenta(str));
|
|
1921
|
-
static Cyan = (str) => this.inverse(this.cyan(str));
|
|
1922
|
-
static ansi(open, close) {
|
|
1923
|
-
if (typeof process === 'undefined')
|
|
1924
|
-
return String;
|
|
1925
|
-
if (!process.stdout.isTTY)
|
|
1926
|
-
return String;
|
|
1927
|
-
const prefix = `\x1b[${open}m`;
|
|
1928
|
-
const postfix = `\x1b[${close}m`;
|
|
1929
|
-
const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
|
|
1930
|
-
return function colorer(str) {
|
|
1931
|
-
str = String(str);
|
|
1932
|
-
if (str === '')
|
|
1933
|
-
return str;
|
|
1934
|
-
const suffix = str.replace(suffix_regexp, prefix);
|
|
1935
|
-
return prefix + suffix + postfix;
|
|
1936
|
-
};
|
|
1885
|
+
function $mol_wire_plex(host, field, descr) {
|
|
1886
|
+
if (!descr)
|
|
1887
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1888
|
+
const orig = descr?.value ?? host[field];
|
|
1889
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1890
|
+
if (typeof sup[field] === 'function') {
|
|
1891
|
+
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1937
1892
|
}
|
|
1893
|
+
const descr2 = {
|
|
1894
|
+
...descr,
|
|
1895
|
+
value: function (...args) {
|
|
1896
|
+
let atom = $mol_wire_atom.plex(this, orig, args[0]);
|
|
1897
|
+
if ((args.length === 1) || (args[1] === undefined)) {
|
|
1898
|
+
if (!$mol_wire_fiber.warm)
|
|
1899
|
+
return atom.result();
|
|
1900
|
+
if ($mol_wire_auto()?.temp) {
|
|
1901
|
+
return atom.once();
|
|
1902
|
+
}
|
|
1903
|
+
else {
|
|
1904
|
+
return atom.sync();
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
return atom.resync(args);
|
|
1908
|
+
}
|
|
1909
|
+
};
|
|
1910
|
+
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
1911
|
+
Reflect.defineProperty(descr2.value, 'length', { value: orig.length });
|
|
1912
|
+
Object.assign(descr2.value, { orig });
|
|
1913
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1914
|
+
return descr2;
|
|
1938
1915
|
}
|
|
1939
|
-
$.$
|
|
1916
|
+
$.$mol_wire_plex = $mol_wire_plex;
|
|
1940
1917
|
})($ || ($ = {}));
|
|
1941
|
-
//mol/
|
|
1918
|
+
//mol/wire/plex/plex.ts
|
|
1942
1919
|
;
|
|
1943
1920
|
"use strict";
|
|
1944
1921
|
var $;
|
|
1945
1922
|
(function ($) {
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
if (!event.time)
|
|
1949
|
-
event = { time: new Date().toISOString(), ...event };
|
|
1950
|
-
let tree = this.$mol_tree2_from_json(event);
|
|
1951
|
-
tree = tree.struct(type, tree.kids);
|
|
1952
|
-
let str = color(tree.toString());
|
|
1953
|
-
this.console[level](str);
|
|
1954
|
-
const self = this;
|
|
1955
|
-
return () => self.console.groupEnd();
|
|
1956
|
-
};
|
|
1957
|
-
}
|
|
1958
|
-
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
1959
|
-
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
1960
|
-
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
1961
|
-
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
1962
|
-
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
1963
|
-
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
1964
|
-
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
1923
|
+
$.$mol_mem = $mol_wire_solo;
|
|
1924
|
+
$.$mol_mem_key = $mol_wire_plex;
|
|
1965
1925
|
})($ || ($ = {}));
|
|
1966
|
-
//mol/
|
|
1926
|
+
//mol/mem/mem.ts
|
|
1927
|
+
;
|
|
1928
|
+
"use strict";
|
|
1929
|
+
var $;
|
|
1930
|
+
(function ($) {
|
|
1931
|
+
})($ || ($ = {}));
|
|
1932
|
+
//mol/dom/context/context.ts
|
|
1933
|
+
;
|
|
1934
|
+
"use strict";
|
|
1935
|
+
//node/node.ts
|
|
1936
|
+
;
|
|
1937
|
+
"use strict";
|
|
1938
|
+
var $node = new Proxy({ require }, {
|
|
1939
|
+
get(target, name, wrapper) {
|
|
1940
|
+
if (target[name])
|
|
1941
|
+
return target[name];
|
|
1942
|
+
const mod = target.require('module');
|
|
1943
|
+
if (mod.builtinModules.indexOf(name) >= 0)
|
|
1944
|
+
return target.require(name);
|
|
1945
|
+
if (name[0] === '.')
|
|
1946
|
+
return target.require(name);
|
|
1947
|
+
const path = target.require('path');
|
|
1948
|
+
const fs = target.require('fs');
|
|
1949
|
+
let dir = path.resolve('.');
|
|
1950
|
+
const suffix = `./node_modules/${name}`;
|
|
1951
|
+
const $$ = $;
|
|
1952
|
+
while (!fs.existsSync(path.join(dir, suffix))) {
|
|
1953
|
+
const parent = path.resolve(dir, '..');
|
|
1954
|
+
if (parent === dir) {
|
|
1955
|
+
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
|
|
1956
|
+
try {
|
|
1957
|
+
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
|
|
1958
|
+
}
|
|
1959
|
+
catch { }
|
|
1960
|
+
break;
|
|
1961
|
+
}
|
|
1962
|
+
else {
|
|
1963
|
+
dir = parent;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return target.require(name);
|
|
1967
|
+
},
|
|
1968
|
+
set(target, name, value) {
|
|
1969
|
+
target[name] = value;
|
|
1970
|
+
return true;
|
|
1971
|
+
},
|
|
1972
|
+
});
|
|
1973
|
+
require = (req => Object.assign(function require(name) {
|
|
1974
|
+
return $node[name];
|
|
1975
|
+
}, req))(require);
|
|
1976
|
+
//node/node.node.ts
|
|
1967
1977
|
;
|
|
1968
1978
|
"use strict";
|
|
1969
1979
|
var $;
|