kaabalah 6.7.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astrology/index.js +54 -54
- package/dist/astrology/index.js.map +1 -1
- package/dist/astrology/index.mjs +3 -3
- package/dist/astrology/index.mjs.map +1 -1
- package/dist/chunk-2WCC2KCJ.js +1 -1
- package/dist/chunk-2WCC2KCJ.js.map +1 -1
- package/dist/{chunk-XTE5DSDO.js → chunk-36XZ5WR2.js} +23 -23
- package/dist/chunk-36XZ5WR2.js.map +1 -0
- package/dist/{chunk-6P2CJUTH.mjs → chunk-3UJPBUY4.mjs} +8 -6
- package/dist/chunk-3UJPBUY4.mjs.map +1 -0
- package/dist/{chunk-FM7WUVZV.js → chunk-4337NVKS.js} +8 -4
- package/dist/chunk-4337NVKS.js.map +1 -0
- package/dist/{chunk-SFUCT6I2.mjs → chunk-5HXSHALQ.mjs} +49 -43
- package/dist/chunk-5HXSHALQ.mjs.map +1 -0
- package/dist/{chunk-EFZUZI22.mjs → chunk-5K4OQ4UB.mjs} +5 -4
- package/dist/chunk-5K4OQ4UB.mjs.map +1 -0
- package/dist/{chunk-ZKIJAZ6B.mjs → chunk-6N5YC2WD.mjs} +338 -10
- package/dist/chunk-6N5YC2WD.mjs.map +1 -0
- package/dist/{chunk-PWYOHULD.mjs → chunk-7YU7TRCG.mjs} +80 -42
- package/dist/chunk-7YU7TRCG.mjs.map +1 -0
- package/dist/{chunk-6O7MTBZN.js → chunk-BEFGGHIJ.js} +84 -46
- package/dist/chunk-BEFGGHIJ.js.map +1 -0
- package/dist/{chunk-MTI2SOQ6.mjs → chunk-ITESL6GR.mjs} +4 -4
- package/dist/chunk-ITESL6GR.mjs.map +1 -0
- package/dist/{chunk-UG6HZK3Z.js → chunk-K33NFXSD.js} +109 -109
- package/dist/chunk-K33NFXSD.js.map +1 -0
- package/dist/{chunk-OKZUVGA3.js → chunk-LQX6PW35.js} +349 -15
- package/dist/chunk-LQX6PW35.js.map +1 -0
- package/dist/{chunk-WY6NIR2V.mjs → chunk-NPQZ2DOY.mjs} +8 -4
- package/dist/chunk-NPQZ2DOY.mjs.map +1 -0
- package/dist/{chunk-WIKUOEOB.mjs → chunk-QS5XAAAG.mjs} +31 -19
- package/dist/chunk-QS5XAAAG.mjs.map +1 -0
- package/dist/{chunk-UN7QMOMX.mjs → chunk-SHKAAZHT.mjs} +8 -8
- package/dist/chunk-SHKAAZHT.mjs.map +1 -0
- package/dist/{chunk-COPYH3O2.js → chunk-SYLFUBAB.js} +51 -39
- package/dist/chunk-SYLFUBAB.js.map +1 -0
- package/dist/chunk-URDMOQRN.mjs +1 -1
- package/dist/chunk-URDMOQRN.mjs.map +1 -1
- package/dist/{chunk-PAKYKIZH.js → chunk-UZ42PN5T.js} +10 -8
- package/dist/chunk-UZ42PN5T.js.map +1 -0
- package/dist/{chunk-S6KNERP7.js → chunk-VJ6RW5H4.js} +8 -7
- package/dist/chunk-VJ6RW5H4.js.map +1 -0
- package/dist/{chunk-WCOGJKT7.js → chunk-WLML6SVX.js} +53 -47
- package/dist/chunk-WLML6SVX.js.map +1 -0
- package/dist/cli.js +1175 -420
- package/dist/cli.js.map +1 -1
- package/dist/core/index.d.mts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +69 -45
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +4 -4
- package/dist/core/index.mjs.map +1 -1
- package/dist/gematria/index.js +7 -7
- package/dist/gematria/index.js.map +1 -1
- package/dist/gematria/index.mjs +4 -4
- package/dist/gematria/index.mjs.map +1 -1
- package/dist/ifa/index.js +2 -2
- package/dist/ifa/index.js.map +1 -1
- package/dist/ifa/index.mjs +2 -2
- package/dist/ifa/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +377 -353
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/dist/numerology/index.js +20 -20
- package/dist/numerology/index.js.map +1 -1
- package/dist/numerology/index.mjs +5 -5
- package/dist/numerology/index.mjs.map +1 -1
- package/dist/semantic/index.js +28 -28
- package/dist/semantic/index.js.map +1 -1
- package/dist/semantic/index.mjs +9 -9
- package/dist/semantic/index.mjs.map +1 -1
- package/dist/{swisseph.node-6H4ISR7M.mjs → swisseph.node-2PWBQLWG.mjs} +270 -156
- package/dist/swisseph.node-2PWBQLWG.mjs.map +1 -0
- package/dist/{wasm/build/swisseph.node-UD2JYYLE.js → swisseph.node-NWM75JF3.js} +283 -169
- package/dist/swisseph.node-NWM75JF3.js.map +1 -0
- package/dist/{swisseph.web-TSFJI7DQ.mjs → swisseph.web-CK57WSU3.mjs} +264 -153
- package/dist/swisseph.web-CK57WSU3.mjs.map +1 -0
- package/dist/{wasm/build/swisseph.web-MXYBWOOS.js → swisseph.web-GPTWPXKT.js} +277 -166
- package/dist/swisseph.web-GPTWPXKT.js.map +1 -0
- package/dist/tarot/index.js +25 -25
- package/dist/tarot/index.js.map +1 -1
- package/dist/tarot/index.mjs +5 -5
- package/dist/tarot/index.mjs.map +1 -1
- package/dist/topology-Bbgniegh.d.ts +102 -0
- package/dist/topology-CSSfYL2c.d.mts +102 -0
- package/dist/visual/index.d.mts +2 -1
- package/dist/visual/index.d.ts +2 -1
- package/dist/visual/index.js +46 -46
- package/dist/visual/index.js.map +1 -1
- package/dist/visual/index.mjs +5 -5
- package/dist/visual/index.mjs.map +1 -1
- package/dist/wasm/build/{swisseph.node-6H4ISR7M.mjs → swisseph.node-2PWBQLWG.mjs} +270 -156
- package/dist/wasm/build/swisseph.node-2PWBQLWG.mjs.map +1 -0
- package/dist/{swisseph.node-UD2JYYLE.js → wasm/build/swisseph.node-NWM75JF3.js} +283 -169
- package/dist/wasm/build/swisseph.node-NWM75JF3.js.map +1 -0
- package/dist/wasm/build/{swisseph.web-TSFJI7DQ.mjs → swisseph.web-CK57WSU3.mjs} +264 -153
- package/dist/wasm/build/swisseph.web-CK57WSU3.mjs.map +1 -0
- package/dist/{swisseph.web-MXYBWOOS.js → wasm/build/swisseph.web-GPTWPXKT.js} +277 -166
- package/dist/wasm/build/swisseph.web-GPTWPXKT.js.map +1 -0
- package/package.json +7 -7
- package/dist/chunk-6O7MTBZN.js.map +0 -1
- package/dist/chunk-6P2CJUTH.mjs.map +0 -1
- package/dist/chunk-COPYH3O2.js.map +0 -1
- package/dist/chunk-EFZUZI22.mjs.map +0 -1
- package/dist/chunk-FM7WUVZV.js.map +0 -1
- package/dist/chunk-MTI2SOQ6.mjs.map +0 -1
- package/dist/chunk-OKZUVGA3.js.map +0 -1
- package/dist/chunk-PAKYKIZH.js.map +0 -1
- package/dist/chunk-PWYOHULD.mjs.map +0 -1
- package/dist/chunk-S6KNERP7.js.map +0 -1
- package/dist/chunk-SFUCT6I2.mjs.map +0 -1
- package/dist/chunk-UG6HZK3Z.js.map +0 -1
- package/dist/chunk-UN7QMOMX.mjs.map +0 -1
- package/dist/chunk-WCOGJKT7.js.map +0 -1
- package/dist/chunk-WIKUOEOB.mjs.map +0 -1
- package/dist/chunk-WY6NIR2V.mjs.map +0 -1
- package/dist/chunk-XTE5DSDO.js.map +0 -1
- package/dist/chunk-ZKIJAZ6B.mjs.map +0 -1
- package/dist/swisseph.node-6H4ISR7M.mjs.map +0 -1
- package/dist/swisseph.node-UD2JYYLE.js.map +0 -1
- package/dist/swisseph.web-MXYBWOOS.js.map +0 -1
- package/dist/swisseph.web-TSFJI7DQ.mjs.map +0 -1
- package/dist/wasm/build/swisseph.node-6H4ISR7M.mjs.map +0 -1
- package/dist/wasm/build/swisseph.node-UD2JYYLE.js.map +0 -1
- package/dist/wasm/build/swisseph.web-MXYBWOOS.js.map +0 -1
- package/dist/wasm/build/swisseph.web-TSFJI7DQ.mjs.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -34,7 +34,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var __publicField = (obj, key, value) =>
|
|
37
|
+
var __publicField = (obj, key, value) => {
|
|
38
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
39
|
+
return value;
|
|
40
|
+
};
|
|
38
41
|
|
|
39
42
|
// wasm/build/swisseph.node.wasm?url
|
|
40
43
|
var swisseph_node_default;
|
|
@@ -319,7 +322,8 @@ var init_swisseph = __esm({
|
|
|
319
322
|
const BYTES_PER_F64 = 8;
|
|
320
323
|
const totalBytes = (HOUSES_DOUBLES + ASCMC_DOUBLES) * BYTES_PER_F64;
|
|
321
324
|
const memoryPtr = this.module._malloc(totalBytes);
|
|
322
|
-
if (!memoryPtr)
|
|
325
|
+
if (!memoryPtr)
|
|
326
|
+
throw new Error("Memory allocation failed");
|
|
323
327
|
const housesPtr = memoryPtr;
|
|
324
328
|
const ascmcPtr = memoryPtr + HOUSES_DOUBLES * BYTES_PER_F64;
|
|
325
329
|
try {
|
|
@@ -443,9 +447,12 @@ var init_swisseph = __esm({
|
|
|
443
447
|
const xinPtr = this.module._malloc(3 * BYTES);
|
|
444
448
|
const xazPtr = this.module._malloc(3 * BYTES);
|
|
445
449
|
if (!geoPtr || !xinPtr || !xazPtr) {
|
|
446
|
-
if (geoPtr)
|
|
447
|
-
|
|
448
|
-
if (
|
|
450
|
+
if (geoPtr)
|
|
451
|
+
this.module._free(geoPtr);
|
|
452
|
+
if (xinPtr)
|
|
453
|
+
this.module._free(xinPtr);
|
|
454
|
+
if (xazPtr)
|
|
455
|
+
this.module._free(xazPtr);
|
|
449
456
|
throw new Error("Memory allocation failed for azalt");
|
|
450
457
|
}
|
|
451
458
|
try {
|
|
@@ -492,9 +499,12 @@ var init_swisseph = __esm({
|
|
|
492
499
|
const ERR_BYTES = 512;
|
|
493
500
|
const errPtr = this.module._malloc(ERR_BYTES);
|
|
494
501
|
if (!geoPtr || !tretPtr || !errPtr) {
|
|
495
|
-
if (geoPtr)
|
|
496
|
-
|
|
497
|
-
if (
|
|
502
|
+
if (geoPtr)
|
|
503
|
+
this.module._free(geoPtr);
|
|
504
|
+
if (tretPtr)
|
|
505
|
+
this.module._free(tretPtr);
|
|
506
|
+
if (errPtr)
|
|
507
|
+
this.module._free(errPtr);
|
|
498
508
|
throw new Error("Memory allocation failed for riseTransit");
|
|
499
509
|
}
|
|
500
510
|
this.module.HEAP8.fill(0, errPtr, errPtr + ERR_BYTES);
|
|
@@ -538,7 +548,8 @@ var require_swisseph_web = __commonJS({
|
|
|
538
548
|
"use strict";
|
|
539
549
|
var SwissEphemerisModule = (() => {
|
|
540
550
|
var _scriptName = typeof document != "undefined" ? document.currentScript?.src : void 0;
|
|
541
|
-
if (typeof __filename != "undefined")
|
|
551
|
+
if (typeof __filename != "undefined")
|
|
552
|
+
_scriptName = _scriptName || __filename;
|
|
542
553
|
return async function(moduleArg = {}) {
|
|
543
554
|
var moduleRtn;
|
|
544
555
|
var Module = moduleArg;
|
|
@@ -568,7 +579,8 @@ var require_swisseph_web = __commonJS({
|
|
|
568
579
|
}
|
|
569
580
|
var readAsync, readBinary;
|
|
570
581
|
if (ENVIRONMENT_IS_NODE) {
|
|
571
|
-
if (typeof process == "undefined" || !process.release || process.release.name !== "node")
|
|
582
|
+
if (typeof process == "undefined" || !process.release || process.release.name !== "node")
|
|
583
|
+
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
572
584
|
var nodeVersion = process.versions.node;
|
|
573
585
|
var numericVersion = nodeVersion.split(".").slice(0, 3);
|
|
574
586
|
numericVersion = numericVersion[0] * 1e4 + numericVersion[1] * 100 + numericVersion[2].split("-")[0] * 1;
|
|
@@ -599,7 +611,8 @@ var require_swisseph_web = __commonJS({
|
|
|
599
611
|
throw toThrow;
|
|
600
612
|
};
|
|
601
613
|
} else if (ENVIRONMENT_IS_SHELL) {
|
|
602
|
-
if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined")
|
|
614
|
+
if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined")
|
|
615
|
+
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
603
616
|
} else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
|
604
617
|
if (ENVIRONMENT_IS_WORKER) {
|
|
605
618
|
scriptDirectory = self.location.href;
|
|
@@ -614,7 +627,8 @@ var require_swisseph_web = __commonJS({
|
|
|
614
627
|
} else {
|
|
615
628
|
scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
|
|
616
629
|
}
|
|
617
|
-
if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined"))
|
|
630
|
+
if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined"))
|
|
631
|
+
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
618
632
|
{
|
|
619
633
|
readAsync = async (url) => {
|
|
620
634
|
assert(!isFileURI(url), "readAsync does not work with file:// URLs");
|
|
@@ -633,9 +647,11 @@ var require_swisseph_web = __commonJS({
|
|
|
633
647
|
Object.assign(Module, moduleOverrides);
|
|
634
648
|
moduleOverrides = null;
|
|
635
649
|
checkIncomingModuleAPI();
|
|
636
|
-
if (Module["arguments"])
|
|
650
|
+
if (Module["arguments"])
|
|
651
|
+
arguments_ = Module["arguments"];
|
|
637
652
|
legacyModuleProp("arguments", "arguments_");
|
|
638
|
-
if (Module["thisProgram"])
|
|
653
|
+
if (Module["thisProgram"])
|
|
654
|
+
thisProgram = Module["thisProgram"];
|
|
639
655
|
legacyModuleProp("thisProgram", "thisProgram");
|
|
640
656
|
assert(typeof Module["memoryInitializerPrefixURL"] == "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");
|
|
641
657
|
assert(typeof Module["pthreadMainPrefixURL"] == "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");
|
|
@@ -677,7 +693,8 @@ var require_swisseph_web = __commonJS({
|
|
|
677
693
|
SAFE_HEAP_STORE((max + 4 >> 2) * 4, 2310721022, 4);
|
|
678
694
|
}
|
|
679
695
|
function checkStackCookie() {
|
|
680
|
-
if (ABORT)
|
|
696
|
+
if (ABORT)
|
|
697
|
+
return;
|
|
681
698
|
var max = _emscripten_stack_get_end();
|
|
682
699
|
if (max == 0) {
|
|
683
700
|
max += 4;
|
|
@@ -692,7 +709,8 @@ var require_swisseph_web = __commonJS({
|
|
|
692
709
|
var h16 = new Int16Array(1);
|
|
693
710
|
var h8 = new Int8Array(h16.buffer);
|
|
694
711
|
h16[0] = 25459;
|
|
695
|
-
if (h8[0] !== 115 || h8[1] !== 99)
|
|
712
|
+
if (h8[0] !== 115 || h8[1] !== 99)
|
|
713
|
+
throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
|
|
696
714
|
})();
|
|
697
715
|
if (Module["ENVIRONMENT"]) {
|
|
698
716
|
throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
|
|
@@ -771,13 +789,18 @@ var require_swisseph_web = __commonJS({
|
|
|
771
789
|
}
|
|
772
790
|
}
|
|
773
791
|
function SAFE_HEAP_STORE(dest, value, bytes, isFloat) {
|
|
774
|
-
if (dest <= 0)
|
|
775
|
-
|
|
792
|
+
if (dest <= 0)
|
|
793
|
+
abort(`segmentation fault storing ${bytes} bytes to address ${dest}`);
|
|
794
|
+
if (dest % bytes !== 0)
|
|
795
|
+
abort(`alignment error storing to address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
|
|
776
796
|
if (runtimeInitialized) {
|
|
777
797
|
var brk = _sbrk(0);
|
|
778
|
-
if (dest + bytes > brk)
|
|
779
|
-
|
|
780
|
-
if (brk
|
|
798
|
+
if (dest + bytes > brk)
|
|
799
|
+
abort(`segmentation fault, exceeded the top of the available dynamic heap when storing ${bytes} bytes to address ${dest}. DYNAMICTOP=${brk}`);
|
|
800
|
+
if (brk < _emscripten_stack_get_base())
|
|
801
|
+
abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
|
|
802
|
+
if (brk > wasmMemory.buffer.byteLength)
|
|
803
|
+
abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
|
|
781
804
|
}
|
|
782
805
|
setValue_safe(dest, value, getSafeHeapType(bytes, isFloat));
|
|
783
806
|
return value;
|
|
@@ -786,17 +809,23 @@ var require_swisseph_web = __commonJS({
|
|
|
786
809
|
return SAFE_HEAP_STORE(dest, value, bytes, true);
|
|
787
810
|
}
|
|
788
811
|
function SAFE_HEAP_LOAD(dest, bytes, unsigned, isFloat) {
|
|
789
|
-
if (dest <= 0)
|
|
790
|
-
|
|
812
|
+
if (dest <= 0)
|
|
813
|
+
abort(`segmentation fault loading ${bytes} bytes from address ${dest}`);
|
|
814
|
+
if (dest % bytes !== 0)
|
|
815
|
+
abort(`alignment error loading from address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
|
|
791
816
|
if (runtimeInitialized) {
|
|
792
817
|
var brk = _sbrk(0);
|
|
793
|
-
if (dest + bytes > brk)
|
|
794
|
-
|
|
795
|
-
if (brk
|
|
818
|
+
if (dest + bytes > brk)
|
|
819
|
+
abort(`segmentation fault, exceeded the top of the available dynamic heap when loading ${bytes} bytes from address ${dest}. DYNAMICTOP=${brk}`);
|
|
820
|
+
if (brk < _emscripten_stack_get_base())
|
|
821
|
+
abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
|
|
822
|
+
if (brk > wasmMemory.buffer.byteLength)
|
|
823
|
+
abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
|
|
796
824
|
}
|
|
797
825
|
var type = getSafeHeapType(bytes, isFloat);
|
|
798
826
|
var ret = getValue_safe(dest, type);
|
|
799
|
-
if (unsigned)
|
|
827
|
+
if (unsigned)
|
|
828
|
+
ret = unSign(ret, parseInt(type.slice(1), 10));
|
|
800
829
|
return ret;
|
|
801
830
|
}
|
|
802
831
|
function SAFE_HEAP_LOAD_D(dest, bytes, unsigned) {
|
|
@@ -827,7 +856,8 @@ var require_swisseph_web = __commonJS({
|
|
|
827
856
|
assert(!Module["INITIAL_MEMORY"], "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
|
|
828
857
|
function preRun() {
|
|
829
858
|
if (Module["preRun"]) {
|
|
830
|
-
if (typeof Module["preRun"] == "function")
|
|
859
|
+
if (typeof Module["preRun"] == "function")
|
|
860
|
+
Module["preRun"] = [Module["preRun"]];
|
|
831
861
|
while (Module["preRun"].length) {
|
|
832
862
|
addOnPreRun(Module["preRun"].shift());
|
|
833
863
|
}
|
|
@@ -839,7 +869,8 @@ var require_swisseph_web = __commonJS({
|
|
|
839
869
|
assert(!runtimeInitialized);
|
|
840
870
|
runtimeInitialized = true;
|
|
841
871
|
checkStackCookie();
|
|
842
|
-
if (!Module["noFSInit"] && !FS.initialized)
|
|
872
|
+
if (!Module["noFSInit"] && !FS.initialized)
|
|
873
|
+
FS.init();
|
|
843
874
|
TTY.init();
|
|
844
875
|
wasmExports["__wasm_call_ctors"]();
|
|
845
876
|
FS.ignorePermissions = false;
|
|
@@ -847,7 +878,8 @@ var require_swisseph_web = __commonJS({
|
|
|
847
878
|
function postRun() {
|
|
848
879
|
checkStackCookie();
|
|
849
880
|
if (Module["postRun"]) {
|
|
850
|
-
if (typeof Module["postRun"] == "function")
|
|
881
|
+
if (typeof Module["postRun"] == "function")
|
|
882
|
+
Module["postRun"] = [Module["postRun"]];
|
|
851
883
|
while (Module["postRun"].length) {
|
|
852
884
|
addOnPostRun(Module["postRun"].shift());
|
|
853
885
|
}
|
|
@@ -862,7 +894,8 @@ var require_swisseph_web = __commonJS({
|
|
|
862
894
|
function getUniqueRunDependency(id2) {
|
|
863
895
|
var orig = id2;
|
|
864
896
|
while (1) {
|
|
865
|
-
if (!runDependencyTracking[id2])
|
|
897
|
+
if (!runDependencyTracking[id2])
|
|
898
|
+
return id2;
|
|
866
899
|
id2 = orig + Math.random();
|
|
867
900
|
}
|
|
868
901
|
}
|
|
@@ -1044,7 +1077,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1044
1077
|
var onPreRuns = [];
|
|
1045
1078
|
var addOnPreRun = (cb) => onPreRuns.unshift(cb);
|
|
1046
1079
|
function getValue(ptr, type = "i8") {
|
|
1047
|
-
if (type.endsWith("*"))
|
|
1080
|
+
if (type.endsWith("*"))
|
|
1081
|
+
type = "*";
|
|
1048
1082
|
switch (type) {
|
|
1049
1083
|
case "i1":
|
|
1050
1084
|
return SAFE_HEAP_LOAD(ptr, 1, 0);
|
|
@@ -1067,7 +1101,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1067
1101
|
}
|
|
1068
1102
|
}
|
|
1069
1103
|
function getValue_safe(ptr, type = "i8") {
|
|
1070
|
-
if (type.endsWith("*"))
|
|
1104
|
+
if (type.endsWith("*"))
|
|
1105
|
+
type = "*";
|
|
1071
1106
|
switch (type) {
|
|
1072
1107
|
case "i1":
|
|
1073
1108
|
return HEAP8[ptr];
|
|
@@ -1096,7 +1131,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1096
1131
|
return "0x" + ptr.toString(16).padStart(8, "0");
|
|
1097
1132
|
};
|
|
1098
1133
|
function setValue(ptr, value, type = "i8") {
|
|
1099
|
-
if (type.endsWith("*"))
|
|
1134
|
+
if (type.endsWith("*"))
|
|
1135
|
+
type = "*";
|
|
1100
1136
|
switch (type) {
|
|
1101
1137
|
case "i1":
|
|
1102
1138
|
SAFE_HEAP_STORE(ptr, value, 1);
|
|
@@ -1127,7 +1163,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1127
1163
|
}
|
|
1128
1164
|
}
|
|
1129
1165
|
function setValue_safe(ptr, value, type = "i8") {
|
|
1130
|
-
if (type.endsWith("*"))
|
|
1166
|
+
if (type.endsWith("*"))
|
|
1167
|
+
type = "*";
|
|
1131
1168
|
switch (type) {
|
|
1132
1169
|
case "i1":
|
|
1133
1170
|
HEAP8[ptr] = value;
|
|
@@ -1169,7 +1206,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1169
1206
|
warnOnce.shown || (warnOnce.shown = {});
|
|
1170
1207
|
if (!warnOnce.shown[text]) {
|
|
1171
1208
|
warnOnce.shown[text] = 1;
|
|
1172
|
-
if (ENVIRONMENT_IS_NODE)
|
|
1209
|
+
if (ENVIRONMENT_IS_NODE)
|
|
1210
|
+
text = "warning: " + text;
|
|
1173
1211
|
err(text);
|
|
1174
1212
|
}
|
|
1175
1213
|
};
|
|
@@ -1253,13 +1291,16 @@ var require_swisseph_web = __commonJS({
|
|
|
1253
1291
|
function trim(arr) {
|
|
1254
1292
|
var start = 0;
|
|
1255
1293
|
for (; start < arr.length; start++) {
|
|
1256
|
-
if (arr[start] !== "")
|
|
1294
|
+
if (arr[start] !== "")
|
|
1295
|
+
break;
|
|
1257
1296
|
}
|
|
1258
1297
|
var end = arr.length - 1;
|
|
1259
1298
|
for (; end >= 0; end--) {
|
|
1260
|
-
if (arr[end] !== "")
|
|
1299
|
+
if (arr[end] !== "")
|
|
1300
|
+
break;
|
|
1261
1301
|
}
|
|
1262
|
-
if (start > end)
|
|
1302
|
+
if (start > end)
|
|
1303
|
+
return [];
|
|
1263
1304
|
return arr.slice(start, end - start + 1);
|
|
1264
1305
|
}
|
|
1265
1306
|
var fromParts = trim(from.split("/"));
|
|
@@ -1283,7 +1324,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1283
1324
|
var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => {
|
|
1284
1325
|
var endIdx = idx + maxBytesToRead;
|
|
1285
1326
|
var endPtr = idx;
|
|
1286
|
-
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
|
1327
|
+
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
|
1328
|
+
++endPtr;
|
|
1287
1329
|
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
|
1288
1330
|
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
|
|
1289
1331
|
}
|
|
@@ -1303,7 +1345,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1303
1345
|
if ((u0 & 240) == 224) {
|
|
1304
1346
|
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
|
1305
1347
|
} else {
|
|
1306
|
-
if ((u0 & 248) != 240)
|
|
1348
|
+
if ((u0 & 248) != 240)
|
|
1349
|
+
warnOnce("Invalid UTF-8 leading byte " + ptrToString(u0) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
|
|
1307
1350
|
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
|
|
1308
1351
|
}
|
|
1309
1352
|
if (u0 < 65536) {
|
|
@@ -1335,7 +1378,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1335
1378
|
};
|
|
1336
1379
|
var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
|
|
1337
1380
|
assert(typeof str === "string", `stringToUTF8Array expects a string (got ${typeof str})`);
|
|
1338
|
-
if (!(maxBytesToWrite > 0))
|
|
1381
|
+
if (!(maxBytesToWrite > 0))
|
|
1382
|
+
return 0;
|
|
1339
1383
|
var startIdx = outIdx;
|
|
1340
1384
|
var endIdx = outIdx + maxBytesToWrite - 1;
|
|
1341
1385
|
for (var i = 0; i < str.length; ++i) {
|
|
@@ -1345,20 +1389,25 @@ var require_swisseph_web = __commonJS({
|
|
|
1345
1389
|
u = 65536 + ((u & 1023) << 10) | u1 & 1023;
|
|
1346
1390
|
}
|
|
1347
1391
|
if (u <= 127) {
|
|
1348
|
-
if (outIdx >= endIdx)
|
|
1392
|
+
if (outIdx >= endIdx)
|
|
1393
|
+
break;
|
|
1349
1394
|
heap[outIdx++] = u;
|
|
1350
1395
|
} else if (u <= 2047) {
|
|
1351
|
-
if (outIdx + 1 >= endIdx)
|
|
1396
|
+
if (outIdx + 1 >= endIdx)
|
|
1397
|
+
break;
|
|
1352
1398
|
heap[outIdx++] = 192 | u >> 6;
|
|
1353
1399
|
heap[outIdx++] = 128 | u & 63;
|
|
1354
1400
|
} else if (u <= 65535) {
|
|
1355
|
-
if (outIdx + 2 >= endIdx)
|
|
1401
|
+
if (outIdx + 2 >= endIdx)
|
|
1402
|
+
break;
|
|
1356
1403
|
heap[outIdx++] = 224 | u >> 12;
|
|
1357
1404
|
heap[outIdx++] = 128 | u >> 6 & 63;
|
|
1358
1405
|
heap[outIdx++] = 128 | u & 63;
|
|
1359
1406
|
} else {
|
|
1360
|
-
if (outIdx + 3 >= endIdx)
|
|
1361
|
-
|
|
1407
|
+
if (outIdx + 3 >= endIdx)
|
|
1408
|
+
break;
|
|
1409
|
+
if (u > 1114111)
|
|
1410
|
+
warnOnce("Invalid Unicode code point " + ptrToString(u) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
|
|
1362
1411
|
heap[outIdx++] = 240 | u >> 18;
|
|
1363
1412
|
heap[outIdx++] = 128 | u >> 12 & 63;
|
|
1364
1413
|
heap[outIdx++] = 128 | u >> 6 & 63;
|
|
@@ -1372,7 +1421,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1372
1421
|
var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
|
|
1373
1422
|
var u8array = new Array(len);
|
|
1374
1423
|
var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
|
|
1375
|
-
if (dontAddNull)
|
|
1424
|
+
if (dontAddNull)
|
|
1425
|
+
u8array.length = numBytesWritten;
|
|
1376
1426
|
return u8array;
|
|
1377
1427
|
};
|
|
1378
1428
|
var FS_stdin_getChar = () => {
|
|
@@ -1386,8 +1436,10 @@ var require_swisseph_web = __commonJS({
|
|
|
1386
1436
|
try {
|
|
1387
1437
|
bytesRead = fs.readSync(fd, buf, 0, BUFSIZE);
|
|
1388
1438
|
} catch (e) {
|
|
1389
|
-
if (e.toString().includes("EOF"))
|
|
1390
|
-
|
|
1439
|
+
if (e.toString().includes("EOF"))
|
|
1440
|
+
bytesRead = 0;
|
|
1441
|
+
else
|
|
1442
|
+
throw e;
|
|
1391
1443
|
}
|
|
1392
1444
|
if (bytesRead > 0) {
|
|
1393
1445
|
result = buf.slice(0, bytesRead).toString("utf-8");
|
|
@@ -1437,7 +1489,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1437
1489
|
if (result === void 0 && bytesRead === 0) {
|
|
1438
1490
|
throw new FS.ErrnoError(6);
|
|
1439
1491
|
}
|
|
1440
|
-
if (result === null || result === void 0)
|
|
1492
|
+
if (result === null || result === void 0)
|
|
1493
|
+
break;
|
|
1441
1494
|
bytesRead++;
|
|
1442
1495
|
buffer[offset + i] = result;
|
|
1443
1496
|
}
|
|
@@ -1467,7 +1520,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1467
1520
|
out(UTF8ArrayToString(tty.output));
|
|
1468
1521
|
tty.output = [];
|
|
1469
1522
|
} else {
|
|
1470
|
-
if (val != 0)
|
|
1523
|
+
if (val != 0)
|
|
1524
|
+
tty.output.push(val);
|
|
1471
1525
|
}
|
|
1472
1526
|
}, fsync(tty) {
|
|
1473
1527
|
if (tty.output?.length > 0) {
|
|
@@ -1485,7 +1539,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1485
1539
|
err(UTF8ArrayToString(tty.output));
|
|
1486
1540
|
tty.output = [];
|
|
1487
1541
|
} else {
|
|
1488
|
-
if (val != 0)
|
|
1542
|
+
if (val != 0)
|
|
1543
|
+
tty.output.push(val);
|
|
1489
1544
|
}
|
|
1490
1545
|
}, fsync(tty) {
|
|
1491
1546
|
if (tty.output?.length > 0) {
|
|
@@ -1531,20 +1586,26 @@ var require_swisseph_web = __commonJS({
|
|
|
1531
1586
|
}
|
|
1532
1587
|
return node;
|
|
1533
1588
|
}, getFileDataAsTypedArray(node) {
|
|
1534
|
-
if (!node.contents)
|
|
1535
|
-
|
|
1589
|
+
if (!node.contents)
|
|
1590
|
+
return new Uint8Array(0);
|
|
1591
|
+
if (node.contents.subarray)
|
|
1592
|
+
return node.contents.subarray(0, node.usedBytes);
|
|
1536
1593
|
return new Uint8Array(node.contents);
|
|
1537
1594
|
}, expandFileStorage(node, newCapacity) {
|
|
1538
1595
|
var prevCapacity = node.contents ? node.contents.length : 0;
|
|
1539
|
-
if (prevCapacity >= newCapacity)
|
|
1596
|
+
if (prevCapacity >= newCapacity)
|
|
1597
|
+
return;
|
|
1540
1598
|
var CAPACITY_DOUBLING_MAX = 1024 * 1024;
|
|
1541
1599
|
newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0);
|
|
1542
|
-
if (prevCapacity != 0)
|
|
1600
|
+
if (prevCapacity != 0)
|
|
1601
|
+
newCapacity = Math.max(newCapacity, 256);
|
|
1543
1602
|
var oldContents = node.contents;
|
|
1544
1603
|
node.contents = new Uint8Array(newCapacity);
|
|
1545
|
-
if (node.usedBytes > 0)
|
|
1604
|
+
if (node.usedBytes > 0)
|
|
1605
|
+
node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
|
|
1546
1606
|
}, resizeFileStorage(node, newSize) {
|
|
1547
|
-
if (node.usedBytes == newSize)
|
|
1607
|
+
if (node.usedBytes == newSize)
|
|
1608
|
+
return;
|
|
1548
1609
|
if (newSize == 0) {
|
|
1549
1610
|
node.contents = null;
|
|
1550
1611
|
node.usedBytes = 0;
|
|
@@ -1634,13 +1695,15 @@ var require_swisseph_web = __commonJS({
|
|
|
1634
1695
|
return node.link;
|
|
1635
1696
|
} }, stream_ops: { read(stream, buffer, offset, length, position) {
|
|
1636
1697
|
var contents = stream.node.contents;
|
|
1637
|
-
if (position >= stream.node.usedBytes)
|
|
1698
|
+
if (position >= stream.node.usedBytes)
|
|
1699
|
+
return 0;
|
|
1638
1700
|
var size = Math.min(stream.node.usedBytes - position, length);
|
|
1639
1701
|
assert(size >= 0);
|
|
1640
1702
|
if (size > 8 && contents.subarray) {
|
|
1641
1703
|
buffer.set(contents.subarray(position, position + size), offset);
|
|
1642
1704
|
} else {
|
|
1643
|
-
for (var i = 0; i < size; i++)
|
|
1705
|
+
for (var i = 0; i < size; i++)
|
|
1706
|
+
buffer[offset + i] = contents[position + i];
|
|
1644
1707
|
}
|
|
1645
1708
|
return size;
|
|
1646
1709
|
}, write(stream, buffer, offset, length, position, canOwn) {
|
|
@@ -1648,7 +1711,8 @@ var require_swisseph_web = __commonJS({
|
|
|
1648
1711
|
if (buffer.buffer === HEAP8.buffer) {
|
|
1649
1712
|
canOwn = false;
|
|
1650
1713
|
}
|
|
1651
|
-
if (!length)
|
|
1714
|
+
if (!length)
|
|
1715
|
+
return 0;
|
|
1652
1716
|
var node = stream.node;
|
|
1653
1717
|
node.mtime = node.ctime = Date.now();
|
|
1654
1718
|
if (buffer.subarray && (!node.contents || node.contents.subarray)) {
|
|
@@ -1731,10 +1795,12 @@ var require_swisseph_web = __commonJS({
|
|
|
1731
1795
|
};
|
|
1732
1796
|
var preloadPlugins = Module["preloadPlugins"] || [];
|
|
1733
1797
|
var FS_handledByPreloadPlugin = (byteArray, fullname, finish, onerror) => {
|
|
1734
|
-
if (typeof Browser != "undefined")
|
|
1798
|
+
if (typeof Browser != "undefined")
|
|
1799
|
+
Browser.init();
|
|
1735
1800
|
var handled = false;
|
|
1736
1801
|
preloadPlugins.forEach((plugin) => {
|
|
1737
|
-
if (handled)
|
|
1802
|
+
if (handled)
|
|
1803
|
+
return;
|
|
1738
1804
|
if (plugin["canHandle"](fullname)) {
|
|
1739
1805
|
plugin["handle"](byteArray, fullname, finish, onerror);
|
|
1740
1806
|
handled = true;
|
|
@@ -1779,8 +1845,10 @@ var require_swisseph_web = __commonJS({
|
|
|
1779
1845
|
};
|
|
1780
1846
|
var FS_getMode = (canRead, canWrite) => {
|
|
1781
1847
|
var mode = 0;
|
|
1782
|
-
if (canRead)
|
|
1783
|
-
|
|
1848
|
+
if (canRead)
|
|
1849
|
+
mode |= 292 | 73;
|
|
1850
|
+
if (canWrite)
|
|
1851
|
+
mode |= 146;
|
|
1784
1852
|
return mode;
|
|
1785
1853
|
};
|
|
1786
1854
|
var UTF8ToString = (ptr, maxBytesToRead) => {
|
|
@@ -1876,56 +1944,58 @@ var require_swisseph_web = __commonJS({
|
|
|
1876
1944
|
if (!PATH.isAbs(path)) {
|
|
1877
1945
|
path = FS.cwd() + "/" + path;
|
|
1878
1946
|
}
|
|
1879
|
-
linkloop:
|
|
1880
|
-
var
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
var
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
if (parts[i] === ".") {
|
|
1889
|
-
continue;
|
|
1890
|
-
}
|
|
1891
|
-
if (parts[i] === "..") {
|
|
1892
|
-
current_path = PATH.dirname(current_path);
|
|
1893
|
-
current = current.parent;
|
|
1894
|
-
continue;
|
|
1895
|
-
}
|
|
1896
|
-
current_path = PATH.join2(current_path, parts[i]);
|
|
1897
|
-
try {
|
|
1898
|
-
current = FS.lookupNode(current, parts[i]);
|
|
1899
|
-
} catch (e) {
|
|
1900
|
-
if (e?.errno === 44 && islast && opts.noent_okay) {
|
|
1901
|
-
return { path: current_path };
|
|
1947
|
+
linkloop:
|
|
1948
|
+
for (var nlinks = 0; nlinks < 40; nlinks++) {
|
|
1949
|
+
var parts = path.split("/").filter((p) => !!p);
|
|
1950
|
+
var current = FS.root;
|
|
1951
|
+
var current_path = "/";
|
|
1952
|
+
for (var i = 0; i < parts.length; i++) {
|
|
1953
|
+
var islast = i === parts.length - 1;
|
|
1954
|
+
if (islast && opts.parent) {
|
|
1955
|
+
break;
|
|
1902
1956
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1957
|
+
if (parts[i] === ".") {
|
|
1958
|
+
continue;
|
|
1959
|
+
}
|
|
1960
|
+
if (parts[i] === "..") {
|
|
1961
|
+
current_path = PATH.dirname(current_path);
|
|
1962
|
+
current = current.parent;
|
|
1963
|
+
continue;
|
|
1964
|
+
}
|
|
1965
|
+
current_path = PATH.join2(current_path, parts[i]);
|
|
1966
|
+
try {
|
|
1967
|
+
current = FS.lookupNode(current, parts[i]);
|
|
1968
|
+
} catch (e) {
|
|
1969
|
+
if (e?.errno === 44 && islast && opts.noent_okay) {
|
|
1970
|
+
return { path: current_path };
|
|
1971
|
+
}
|
|
1972
|
+
throw e;
|
|
1911
1973
|
}
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1974
|
+
if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) {
|
|
1975
|
+
current = current.mounted.root;
|
|
1976
|
+
}
|
|
1977
|
+
if (FS.isLink(current.mode) && (!islast || opts.follow)) {
|
|
1978
|
+
if (!current.node_ops.readlink) {
|
|
1979
|
+
throw new FS.ErrnoError(52);
|
|
1980
|
+
}
|
|
1981
|
+
var link = current.node_ops.readlink(current);
|
|
1982
|
+
if (!PATH.isAbs(link)) {
|
|
1983
|
+
link = PATH.dirname(current_path) + "/" + link;
|
|
1984
|
+
}
|
|
1985
|
+
path = link + "/" + parts.slice(i + 1).join("/");
|
|
1986
|
+
continue linkloop;
|
|
1915
1987
|
}
|
|
1916
|
-
path = link + "/" + parts.slice(i + 1).join("/");
|
|
1917
|
-
continue linkloop;
|
|
1918
1988
|
}
|
|
1989
|
+
return { path: current_path, node: current };
|
|
1919
1990
|
}
|
|
1920
|
-
return { path: current_path, node: current };
|
|
1921
|
-
}
|
|
1922
1991
|
throw new FS.ErrnoError(32);
|
|
1923
1992
|
}, getPath(node) {
|
|
1924
1993
|
var path;
|
|
1925
1994
|
while (true) {
|
|
1926
1995
|
if (FS.isRoot(node)) {
|
|
1927
1996
|
var mount = node.mount.mountpoint;
|
|
1928
|
-
if (!path)
|
|
1997
|
+
if (!path)
|
|
1998
|
+
return mount;
|
|
1929
1999
|
return mount[mount.length - 1] !== "/" ? `${mount}/${path}` : mount + path;
|
|
1930
2000
|
}
|
|
1931
2001
|
path = path ? `${node.name}/${path}` : node.name;
|
|
@@ -2012,10 +2082,13 @@ var require_swisseph_web = __commonJS({
|
|
|
2012
2082
|
}
|
|
2013
2083
|
return 0;
|
|
2014
2084
|
}, mayLookup(dir) {
|
|
2015
|
-
if (!FS.isDir(dir.mode))
|
|
2085
|
+
if (!FS.isDir(dir.mode))
|
|
2086
|
+
return 54;
|
|
2016
2087
|
var errCode = FS.nodePermissions(dir, "x");
|
|
2017
|
-
if (errCode)
|
|
2018
|
-
|
|
2088
|
+
if (errCode)
|
|
2089
|
+
return errCode;
|
|
2090
|
+
if (!dir.node_ops.lookup)
|
|
2091
|
+
return 2;
|
|
2019
2092
|
return 0;
|
|
2020
2093
|
}, mayCreate(dir, name) {
|
|
2021
2094
|
if (!FS.isDir(dir.mode)) {
|
|
@@ -2250,12 +2323,14 @@ var require_swisseph_web = __commonJS({
|
|
|
2250
2323
|
var dirs = path.split("/");
|
|
2251
2324
|
var d = "";
|
|
2252
2325
|
for (var dir of dirs) {
|
|
2253
|
-
if (!dir)
|
|
2326
|
+
if (!dir)
|
|
2327
|
+
continue;
|
|
2254
2328
|
d += "/" + dir;
|
|
2255
2329
|
try {
|
|
2256
2330
|
FS.mkdir(d, mode);
|
|
2257
2331
|
} catch (e) {
|
|
2258
|
-
if (e.errno != 20)
|
|
2332
|
+
if (e.errno != 20)
|
|
2333
|
+
throw e;
|
|
2259
2334
|
}
|
|
2260
2335
|
}
|
|
2261
2336
|
}, mkdev(path, mode, dev) {
|
|
@@ -2293,7 +2368,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2293
2368
|
old_dir = lookup.node;
|
|
2294
2369
|
lookup = FS.lookupPath(new_path, { parent: true });
|
|
2295
2370
|
new_dir = lookup.node;
|
|
2296
|
-
if (!old_dir || !new_dir)
|
|
2371
|
+
if (!old_dir || !new_dir)
|
|
2372
|
+
throw new FS.ErrnoError(44);
|
|
2297
2373
|
if (old_dir.mount !== new_dir.mount) {
|
|
2298
2374
|
throw new FS.ErrnoError(75);
|
|
2299
2375
|
}
|
|
@@ -2547,7 +2623,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2547
2623
|
if (FS.isClosed(stream)) {
|
|
2548
2624
|
throw new FS.ErrnoError(8);
|
|
2549
2625
|
}
|
|
2550
|
-
if (stream.getdents)
|
|
2626
|
+
if (stream.getdents)
|
|
2627
|
+
stream.getdents = null;
|
|
2551
2628
|
try {
|
|
2552
2629
|
if (stream.stream_ops.close) {
|
|
2553
2630
|
stream.stream_ops.close(stream);
|
|
@@ -2597,7 +2674,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2597
2674
|
throw new FS.ErrnoError(70);
|
|
2598
2675
|
}
|
|
2599
2676
|
var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
|
|
2600
|
-
if (!seeking)
|
|
2677
|
+
if (!seeking)
|
|
2678
|
+
stream.position += bytesRead;
|
|
2601
2679
|
return bytesRead;
|
|
2602
2680
|
}, write(stream, buffer, offset, length, position, canOwn) {
|
|
2603
2681
|
assert(offset >= 0);
|
|
@@ -2626,7 +2704,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2626
2704
|
throw new FS.ErrnoError(70);
|
|
2627
2705
|
}
|
|
2628
2706
|
var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
|
|
2629
|
-
if (!seeking)
|
|
2707
|
+
if (!seeking)
|
|
2708
|
+
stream.position += bytesWritten;
|
|
2630
2709
|
return bytesWritten;
|
|
2631
2710
|
}, mmap(stream, length, position, prot, flags) {
|
|
2632
2711
|
if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) {
|
|
@@ -2818,12 +2897,14 @@ var require_swisseph_web = __commonJS({
|
|
|
2818
2897
|
var parts = path.split("/").reverse();
|
|
2819
2898
|
while (parts.length) {
|
|
2820
2899
|
var part = parts.pop();
|
|
2821
|
-
if (!part)
|
|
2900
|
+
if (!part)
|
|
2901
|
+
continue;
|
|
2822
2902
|
var current = PATH.join2(parent, part);
|
|
2823
2903
|
try {
|
|
2824
2904
|
FS.mkdir(current);
|
|
2825
2905
|
} catch (e) {
|
|
2826
|
-
if (e.errno != 20)
|
|
2906
|
+
if (e.errno != 20)
|
|
2907
|
+
throw e;
|
|
2827
2908
|
}
|
|
2828
2909
|
parent = current;
|
|
2829
2910
|
}
|
|
@@ -2843,7 +2924,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2843
2924
|
if (data) {
|
|
2844
2925
|
if (typeof data == "string") {
|
|
2845
2926
|
var arr = new Array(data.length);
|
|
2846
|
-
for (var i = 0, len = data.length; i < len; ++i)
|
|
2927
|
+
for (var i = 0, len = data.length; i < len; ++i)
|
|
2928
|
+
arr[i] = data.charCodeAt(i);
|
|
2847
2929
|
data = arr;
|
|
2848
2930
|
}
|
|
2849
2931
|
FS.chmod(node, mode | 146);
|
|
@@ -2876,7 +2958,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2876
2958
|
if (result === void 0 && bytesRead === 0) {
|
|
2877
2959
|
throw new FS.ErrnoError(6);
|
|
2878
2960
|
}
|
|
2879
|
-
if (result === null || result === void 0)
|
|
2961
|
+
if (result === null || result === void 0)
|
|
2962
|
+
break;
|
|
2880
2963
|
bytesRead++;
|
|
2881
2964
|
buffer[offset + i] = result;
|
|
2882
2965
|
}
|
|
@@ -2899,7 +2982,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2899
2982
|
} });
|
|
2900
2983
|
return FS.mkdev(path, mode, dev);
|
|
2901
2984
|
}, forceLoadFile(obj) {
|
|
2902
|
-
if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
|
|
2985
|
+
if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
|
|
2986
|
+
return true;
|
|
2903
2987
|
if (typeof XMLHttpRequest != "undefined") {
|
|
2904
2988
|
throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
|
2905
2989
|
} else {
|
|
@@ -2931,25 +3015,31 @@ var require_swisseph_web = __commonJS({
|
|
|
2931
3015
|
var xhr = new XMLHttpRequest();
|
|
2932
3016
|
xhr.open("HEAD", url, false);
|
|
2933
3017
|
xhr.send(null);
|
|
2934
|
-
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304))
|
|
3018
|
+
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304))
|
|
3019
|
+
throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
|
|
2935
3020
|
var datalength = Number(xhr.getResponseHeader("Content-length"));
|
|
2936
3021
|
var header;
|
|
2937
3022
|
var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
|
|
2938
3023
|
var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
|
|
2939
3024
|
var chunkSize = 1024 * 1024;
|
|
2940
|
-
if (!hasByteServing)
|
|
3025
|
+
if (!hasByteServing)
|
|
3026
|
+
chunkSize = datalength;
|
|
2941
3027
|
var doXHR = (from, to) => {
|
|
2942
|
-
if (from > to)
|
|
2943
|
-
|
|
3028
|
+
if (from > to)
|
|
3029
|
+
throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
|
|
3030
|
+
if (to > datalength - 1)
|
|
3031
|
+
throw new Error("only " + datalength + " bytes available! programmer error!");
|
|
2944
3032
|
var xhr2 = new XMLHttpRequest();
|
|
2945
3033
|
xhr2.open("GET", url, false);
|
|
2946
|
-
if (datalength !== chunkSize)
|
|
3034
|
+
if (datalength !== chunkSize)
|
|
3035
|
+
xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
|
|
2947
3036
|
xhr2.responseType = "arraybuffer";
|
|
2948
3037
|
if (xhr2.overrideMimeType) {
|
|
2949
3038
|
xhr2.overrideMimeType("text/plain; charset=x-user-defined");
|
|
2950
3039
|
}
|
|
2951
3040
|
xhr2.send(null);
|
|
2952
|
-
if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304))
|
|
3041
|
+
if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304))
|
|
3042
|
+
throw new Error("Couldn't load " + url + ". Status: " + xhr2.status);
|
|
2953
3043
|
if (xhr2.response !== void 0) {
|
|
2954
3044
|
return new Uint8Array(xhr2.response || []);
|
|
2955
3045
|
}
|
|
@@ -2963,7 +3053,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2963
3053
|
if (typeof lazyArray2.chunks[chunkNum] == "undefined") {
|
|
2964
3054
|
lazyArray2.chunks[chunkNum] = doXHR(start, end);
|
|
2965
3055
|
}
|
|
2966
|
-
if (typeof lazyArray2.chunks[chunkNum] == "undefined")
|
|
3056
|
+
if (typeof lazyArray2.chunks[chunkNum] == "undefined")
|
|
3057
|
+
throw new Error("doXHR failed!");
|
|
2967
3058
|
return lazyArray2.chunks[chunkNum];
|
|
2968
3059
|
});
|
|
2969
3060
|
if (usesGzip || !datalength) {
|
|
@@ -2990,7 +3081,8 @@ var require_swisseph_web = __commonJS({
|
|
|
2990
3081
|
}
|
|
2991
3082
|
}
|
|
2992
3083
|
if (typeof XMLHttpRequest != "undefined") {
|
|
2993
|
-
if (!ENVIRONMENT_IS_WORKER)
|
|
3084
|
+
if (!ENVIRONMENT_IS_WORKER)
|
|
3085
|
+
throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
|
|
2994
3086
|
var lazyArray = new LazyUint8Array();
|
|
2995
3087
|
var properties = { isDevice: false, contents: lazyArray };
|
|
2996
3088
|
} else {
|
|
@@ -3017,7 +3109,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3017
3109
|
});
|
|
3018
3110
|
function writeChunks(stream, buffer, offset, length, position) {
|
|
3019
3111
|
var contents = stream.node.contents;
|
|
3020
|
-
if (position >= contents.length)
|
|
3112
|
+
if (position >= contents.length)
|
|
3113
|
+
return 0;
|
|
3021
3114
|
var size = Math.min(contents.length - position, length);
|
|
3022
3115
|
assert(size >= 0);
|
|
3023
3116
|
if (contents.slice) {
|
|
@@ -3164,7 +3257,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3164
3257
|
}
|
|
3165
3258
|
return -28;
|
|
3166
3259
|
} catch (e) {
|
|
3167
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3260
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3261
|
+
throw e;
|
|
3168
3262
|
return -e.errno;
|
|
3169
3263
|
}
|
|
3170
3264
|
}
|
|
@@ -3174,11 +3268,13 @@ var require_swisseph_web = __commonJS({
|
|
|
3174
3268
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
3175
3269
|
switch (op) {
|
|
3176
3270
|
case 21509: {
|
|
3177
|
-
if (!stream.tty)
|
|
3271
|
+
if (!stream.tty)
|
|
3272
|
+
return -59;
|
|
3178
3273
|
return 0;
|
|
3179
3274
|
}
|
|
3180
3275
|
case 21505: {
|
|
3181
|
-
if (!stream.tty)
|
|
3276
|
+
if (!stream.tty)
|
|
3277
|
+
return -59;
|
|
3182
3278
|
if (stream.tty.ops.ioctl_tcgets) {
|
|
3183
3279
|
var termios = stream.tty.ops.ioctl_tcgets(stream);
|
|
3184
3280
|
var argp = syscallGetVarargP();
|
|
@@ -3196,13 +3292,15 @@ var require_swisseph_web = __commonJS({
|
|
|
3196
3292
|
case 21510:
|
|
3197
3293
|
case 21511:
|
|
3198
3294
|
case 21512: {
|
|
3199
|
-
if (!stream.tty)
|
|
3295
|
+
if (!stream.tty)
|
|
3296
|
+
return -59;
|
|
3200
3297
|
return 0;
|
|
3201
3298
|
}
|
|
3202
3299
|
case 21506:
|
|
3203
3300
|
case 21507:
|
|
3204
3301
|
case 21508: {
|
|
3205
|
-
if (!stream.tty)
|
|
3302
|
+
if (!stream.tty)
|
|
3303
|
+
return -59;
|
|
3206
3304
|
if (stream.tty.ops.ioctl_tcsets) {
|
|
3207
3305
|
var argp = syscallGetVarargP();
|
|
3208
3306
|
var c_iflag = SAFE_HEAP_LOAD((argp >> 2) * 4, 4, 0);
|
|
@@ -3218,13 +3316,15 @@ var require_swisseph_web = __commonJS({
|
|
|
3218
3316
|
return 0;
|
|
3219
3317
|
}
|
|
3220
3318
|
case 21519: {
|
|
3221
|
-
if (!stream.tty)
|
|
3319
|
+
if (!stream.tty)
|
|
3320
|
+
return -59;
|
|
3222
3321
|
var argp = syscallGetVarargP();
|
|
3223
3322
|
SAFE_HEAP_STORE((argp >> 2) * 4, 0, 4);
|
|
3224
3323
|
return 0;
|
|
3225
3324
|
}
|
|
3226
3325
|
case 21520: {
|
|
3227
|
-
if (!stream.tty)
|
|
3326
|
+
if (!stream.tty)
|
|
3327
|
+
return -59;
|
|
3228
3328
|
return -28;
|
|
3229
3329
|
}
|
|
3230
3330
|
case 21531: {
|
|
@@ -3232,7 +3332,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3232
3332
|
return FS.ioctl(stream, op, argp);
|
|
3233
3333
|
}
|
|
3234
3334
|
case 21523: {
|
|
3235
|
-
if (!stream.tty)
|
|
3335
|
+
if (!stream.tty)
|
|
3336
|
+
return -59;
|
|
3236
3337
|
if (stream.tty.ops.ioctl_tiocgwinsz) {
|
|
3237
3338
|
var winsize = stream.tty.ops.ioctl_tiocgwinsz(stream.tty);
|
|
3238
3339
|
var argp = syscallGetVarargP();
|
|
@@ -3242,18 +3343,21 @@ var require_swisseph_web = __commonJS({
|
|
|
3242
3343
|
return 0;
|
|
3243
3344
|
}
|
|
3244
3345
|
case 21524: {
|
|
3245
|
-
if (!stream.tty)
|
|
3346
|
+
if (!stream.tty)
|
|
3347
|
+
return -59;
|
|
3246
3348
|
return 0;
|
|
3247
3349
|
}
|
|
3248
3350
|
case 21515: {
|
|
3249
|
-
if (!stream.tty)
|
|
3351
|
+
if (!stream.tty)
|
|
3352
|
+
return -59;
|
|
3250
3353
|
return 0;
|
|
3251
3354
|
}
|
|
3252
3355
|
default:
|
|
3253
3356
|
return -28;
|
|
3254
3357
|
}
|
|
3255
3358
|
} catch (e) {
|
|
3256
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3359
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3360
|
+
throw e;
|
|
3257
3361
|
return -e.errno;
|
|
3258
3362
|
}
|
|
3259
3363
|
}
|
|
@@ -3265,7 +3369,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3265
3369
|
var mode = varargs ? syscallGetVarargI() : 0;
|
|
3266
3370
|
return FS.open(path, flags, mode).fd;
|
|
3267
3371
|
} catch (e) {
|
|
3268
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3372
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3373
|
+
throw e;
|
|
3269
3374
|
return -e.errno;
|
|
3270
3375
|
}
|
|
3271
3376
|
}
|
|
@@ -3310,8 +3415,10 @@ var require_swisseph_web = __commonJS({
|
|
|
3310
3415
|
var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
|
|
3311
3416
|
var env = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: lang, _: getExecutableName() };
|
|
3312
3417
|
for (var x in ENV) {
|
|
3313
|
-
if (ENV[x] === void 0)
|
|
3314
|
-
|
|
3418
|
+
if (ENV[x] === void 0)
|
|
3419
|
+
delete env[x];
|
|
3420
|
+
else
|
|
3421
|
+
env[x] = ENV[x];
|
|
3315
3422
|
}
|
|
3316
3423
|
var strings = [];
|
|
3317
3424
|
for (var x in env) {
|
|
@@ -3352,7 +3459,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3352
3459
|
FS.close(stream);
|
|
3353
3460
|
return 0;
|
|
3354
3461
|
} catch (e) {
|
|
3355
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3462
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3463
|
+
throw e;
|
|
3356
3464
|
return e.errno;
|
|
3357
3465
|
}
|
|
3358
3466
|
}
|
|
@@ -3363,9 +3471,11 @@ var require_swisseph_web = __commonJS({
|
|
|
3363
3471
|
var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
|
|
3364
3472
|
iov += 8;
|
|
3365
3473
|
var curr = FS.read(stream, HEAP8, ptr, len, offset);
|
|
3366
|
-
if (curr < 0)
|
|
3474
|
+
if (curr < 0)
|
|
3475
|
+
return -1;
|
|
3367
3476
|
ret += curr;
|
|
3368
|
-
if (curr < len)
|
|
3477
|
+
if (curr < len)
|
|
3478
|
+
break;
|
|
3369
3479
|
if (typeof offset != "undefined") {
|
|
3370
3480
|
offset += curr;
|
|
3371
3481
|
}
|
|
@@ -3379,7 +3489,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3379
3489
|
SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
|
|
3380
3490
|
return 0;
|
|
3381
3491
|
} catch (e) {
|
|
3382
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3492
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3493
|
+
throw e;
|
|
3383
3494
|
return e.errno;
|
|
3384
3495
|
}
|
|
3385
3496
|
}
|
|
@@ -3389,14 +3500,17 @@ var require_swisseph_web = __commonJS({
|
|
|
3389
3500
|
function _fd_seek(fd, offset, whence, newOffset) {
|
|
3390
3501
|
offset = bigintToI53Checked(offset);
|
|
3391
3502
|
try {
|
|
3392
|
-
if (isNaN(offset))
|
|
3503
|
+
if (isNaN(offset))
|
|
3504
|
+
return 61;
|
|
3393
3505
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
3394
3506
|
FS.llseek(stream, offset, whence);
|
|
3395
3507
|
HEAP64[newOffset >> 3] = BigInt(stream.position);
|
|
3396
|
-
if (stream.getdents && offset === 0 && whence === 0)
|
|
3508
|
+
if (stream.getdents && offset === 0 && whence === 0)
|
|
3509
|
+
stream.getdents = null;
|
|
3397
3510
|
return 0;
|
|
3398
3511
|
} catch (e) {
|
|
3399
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3512
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3513
|
+
throw e;
|
|
3400
3514
|
return e.errno;
|
|
3401
3515
|
}
|
|
3402
3516
|
}
|
|
@@ -3407,7 +3521,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3407
3521
|
var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
|
|
3408
3522
|
iov += 8;
|
|
3409
3523
|
var curr = FS.write(stream, HEAP8, ptr, len, offset);
|
|
3410
|
-
if (curr < 0)
|
|
3524
|
+
if (curr < 0)
|
|
3525
|
+
return -1;
|
|
3411
3526
|
ret += curr;
|
|
3412
3527
|
if (curr < len) {
|
|
3413
3528
|
break;
|
|
@@ -3425,7 +3540,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3425
3540
|
SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
|
|
3426
3541
|
return 0;
|
|
3427
3542
|
} catch (e) {
|
|
3428
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3543
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
3544
|
+
throw e;
|
|
3429
3545
|
return e.errno;
|
|
3430
3546
|
}
|
|
3431
3547
|
}
|
|
@@ -3465,7 +3581,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3465
3581
|
if (returnType === "string") {
|
|
3466
3582
|
return UTF8ToString(ret2);
|
|
3467
3583
|
}
|
|
3468
|
-
if (returnType === "boolean")
|
|
3584
|
+
if (returnType === "boolean")
|
|
3585
|
+
return Boolean(ret2);
|
|
3469
3586
|
return ret2;
|
|
3470
3587
|
}
|
|
3471
3588
|
var func = getCFunc(ident);
|
|
@@ -3476,7 +3593,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3476
3593
|
for (var i = 0; i < args.length; i++) {
|
|
3477
3594
|
var converter = toC[argTypes[i]];
|
|
3478
3595
|
if (converter) {
|
|
3479
|
-
if (stack === 0)
|
|
3596
|
+
if (stack === 0)
|
|
3597
|
+
stack = stackSave();
|
|
3480
3598
|
cArgs[i] = converter(args[i]);
|
|
3481
3599
|
} else {
|
|
3482
3600
|
cArgs[i] = args[i];
|
|
@@ -3485,7 +3603,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3485
3603
|
}
|
|
3486
3604
|
var ret = func(...cArgs);
|
|
3487
3605
|
function onDone(ret2) {
|
|
3488
|
-
if (stack !== 0)
|
|
3606
|
+
if (stack !== 0)
|
|
3607
|
+
stackRestore(stack);
|
|
3489
3608
|
return convertReturnValue(ret2);
|
|
3490
3609
|
}
|
|
3491
3610
|
ret = onDone(ret);
|
|
@@ -3576,7 +3695,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3576
3695
|
assert(!calledRun);
|
|
3577
3696
|
calledRun = true;
|
|
3578
3697
|
Module["calledRun"] = true;
|
|
3579
|
-
if (ABORT)
|
|
3698
|
+
if (ABORT)
|
|
3699
|
+
return;
|
|
3580
3700
|
initRuntime();
|
|
3581
3701
|
readyPromiseResolve(Module);
|
|
3582
3702
|
Module["onRuntimeInitialized"]?.();
|
|
@@ -3596,7 +3716,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3596
3716
|
checkStackCookie();
|
|
3597
3717
|
}
|
|
3598
3718
|
if (Module["preInit"]) {
|
|
3599
|
-
if (typeof Module["preInit"] == "function")
|
|
3719
|
+
if (typeof Module["preInit"] == "function")
|
|
3720
|
+
Module["preInit"] = [Module["preInit"]];
|
|
3600
3721
|
while (Module["preInit"].length > 0) {
|
|
3601
3722
|
Module["preInit"].pop()();
|
|
3602
3723
|
}
|
|
@@ -3617,7 +3738,8 @@ var require_swisseph_web = __commonJS({
|
|
|
3617
3738
|
(() => {
|
|
3618
3739
|
var real_SwissEphemerisModule = SwissEphemerisModule;
|
|
3619
3740
|
SwissEphemerisModule = function(arg) {
|
|
3620
|
-
if (new.target)
|
|
3741
|
+
if (new.target)
|
|
3742
|
+
throw new Error("SwissEphemerisModule() should not be called with `new SwissEphemerisModule()`");
|
|
3621
3743
|
return real_SwissEphemerisModule(arg);
|
|
3622
3744
|
};
|
|
3623
3745
|
})();
|
|
@@ -3635,7 +3757,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3635
3757
|
"use strict";
|
|
3636
3758
|
var SwissEphemerisModule = (() => {
|
|
3637
3759
|
var _scriptName = typeof document != "undefined" ? document.currentScript?.src : void 0;
|
|
3638
|
-
if (typeof __filename != "undefined")
|
|
3760
|
+
if (typeof __filename != "undefined")
|
|
3761
|
+
_scriptName = _scriptName || __filename;
|
|
3639
3762
|
return async function(moduleArg = {}) {
|
|
3640
3763
|
var moduleRtn;
|
|
3641
3764
|
var Module = moduleArg;
|
|
@@ -3665,7 +3788,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3665
3788
|
}
|
|
3666
3789
|
var readAsync, readBinary;
|
|
3667
3790
|
if (ENVIRONMENT_IS_NODE) {
|
|
3668
|
-
if (typeof process == "undefined" || !process.release || process.release.name !== "node")
|
|
3791
|
+
if (typeof process == "undefined" || !process.release || process.release.name !== "node")
|
|
3792
|
+
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
3669
3793
|
var nodeVersion = process.versions.node;
|
|
3670
3794
|
var numericVersion = nodeVersion.split(".").slice(0, 3);
|
|
3671
3795
|
numericVersion = numericVersion[0] * 1e4 + numericVersion[1] * 100 + numericVersion[2].split("-")[0] * 1;
|
|
@@ -3696,7 +3820,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3696
3820
|
throw toThrow;
|
|
3697
3821
|
};
|
|
3698
3822
|
} else if (ENVIRONMENT_IS_SHELL) {
|
|
3699
|
-
if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined")
|
|
3823
|
+
if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof WorkerGlobalScope != "undefined")
|
|
3824
|
+
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
3700
3825
|
} else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
|
3701
3826
|
if (ENVIRONMENT_IS_WORKER) {
|
|
3702
3827
|
scriptDirectory = self.location.href;
|
|
@@ -3711,7 +3836,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3711
3836
|
} else {
|
|
3712
3837
|
scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
|
|
3713
3838
|
}
|
|
3714
|
-
if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined"))
|
|
3839
|
+
if (!(typeof window == "object" || typeof WorkerGlobalScope != "undefined"))
|
|
3840
|
+
throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
3715
3841
|
{
|
|
3716
3842
|
readAsync = async (url) => {
|
|
3717
3843
|
assert(!isFileURI(url), "readAsync does not work with file:// URLs");
|
|
@@ -3730,9 +3856,11 @@ var require_swisseph_node = __commonJS({
|
|
|
3730
3856
|
Object.assign(Module, moduleOverrides);
|
|
3731
3857
|
moduleOverrides = null;
|
|
3732
3858
|
checkIncomingModuleAPI();
|
|
3733
|
-
if (Module["arguments"])
|
|
3859
|
+
if (Module["arguments"])
|
|
3860
|
+
arguments_ = Module["arguments"];
|
|
3734
3861
|
legacyModuleProp("arguments", "arguments_");
|
|
3735
|
-
if (Module["thisProgram"])
|
|
3862
|
+
if (Module["thisProgram"])
|
|
3863
|
+
thisProgram = Module["thisProgram"];
|
|
3736
3864
|
legacyModuleProp("thisProgram", "thisProgram");
|
|
3737
3865
|
assert(typeof Module["memoryInitializerPrefixURL"] == "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");
|
|
3738
3866
|
assert(typeof Module["pthreadMainPrefixURL"] == "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");
|
|
@@ -3774,7 +3902,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3774
3902
|
SAFE_HEAP_STORE((max + 4 >> 2) * 4, 2310721022, 4);
|
|
3775
3903
|
}
|
|
3776
3904
|
function checkStackCookie() {
|
|
3777
|
-
if (ABORT)
|
|
3905
|
+
if (ABORT)
|
|
3906
|
+
return;
|
|
3778
3907
|
var max = _emscripten_stack_get_end();
|
|
3779
3908
|
if (max == 0) {
|
|
3780
3909
|
max += 4;
|
|
@@ -3789,7 +3918,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3789
3918
|
var h16 = new Int16Array(1);
|
|
3790
3919
|
var h8 = new Int8Array(h16.buffer);
|
|
3791
3920
|
h16[0] = 25459;
|
|
3792
|
-
if (h8[0] !== 115 || h8[1] !== 99)
|
|
3921
|
+
if (h8[0] !== 115 || h8[1] !== 99)
|
|
3922
|
+
throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
|
|
3793
3923
|
})();
|
|
3794
3924
|
if (Module["ENVIRONMENT"]) {
|
|
3795
3925
|
throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");
|
|
@@ -3868,13 +3998,18 @@ var require_swisseph_node = __commonJS({
|
|
|
3868
3998
|
}
|
|
3869
3999
|
}
|
|
3870
4000
|
function SAFE_HEAP_STORE(dest, value, bytes, isFloat) {
|
|
3871
|
-
if (dest <= 0)
|
|
3872
|
-
|
|
4001
|
+
if (dest <= 0)
|
|
4002
|
+
abort(`segmentation fault storing ${bytes} bytes to address ${dest}`);
|
|
4003
|
+
if (dest % bytes !== 0)
|
|
4004
|
+
abort(`alignment error storing to address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
|
|
3873
4005
|
if (runtimeInitialized) {
|
|
3874
4006
|
var brk = _sbrk(0);
|
|
3875
|
-
if (dest + bytes > brk)
|
|
3876
|
-
|
|
3877
|
-
if (brk
|
|
4007
|
+
if (dest + bytes > brk)
|
|
4008
|
+
abort(`segmentation fault, exceeded the top of the available dynamic heap when storing ${bytes} bytes to address ${dest}. DYNAMICTOP=${brk}`);
|
|
4009
|
+
if (brk < _emscripten_stack_get_base())
|
|
4010
|
+
abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
|
|
4011
|
+
if (brk > wasmMemory.buffer.byteLength)
|
|
4012
|
+
abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
|
|
3878
4013
|
}
|
|
3879
4014
|
setValue_safe(dest, value, getSafeHeapType(bytes, isFloat));
|
|
3880
4015
|
return value;
|
|
@@ -3883,17 +4018,23 @@ var require_swisseph_node = __commonJS({
|
|
|
3883
4018
|
return SAFE_HEAP_STORE(dest, value, bytes, true);
|
|
3884
4019
|
}
|
|
3885
4020
|
function SAFE_HEAP_LOAD(dest, bytes, unsigned, isFloat) {
|
|
3886
|
-
if (dest <= 0)
|
|
3887
|
-
|
|
4021
|
+
if (dest <= 0)
|
|
4022
|
+
abort(`segmentation fault loading ${bytes} bytes from address ${dest}`);
|
|
4023
|
+
if (dest % bytes !== 0)
|
|
4024
|
+
abort(`alignment error loading from address ${dest}, which was expected to be aligned to a multiple of ${bytes}`);
|
|
3888
4025
|
if (runtimeInitialized) {
|
|
3889
4026
|
var brk = _sbrk(0);
|
|
3890
|
-
if (dest + bytes > brk)
|
|
3891
|
-
|
|
3892
|
-
if (brk
|
|
4027
|
+
if (dest + bytes > brk)
|
|
4028
|
+
abort(`segmentation fault, exceeded the top of the available dynamic heap when loading ${bytes} bytes from address ${dest}. DYNAMICTOP=${brk}`);
|
|
4029
|
+
if (brk < _emscripten_stack_get_base())
|
|
4030
|
+
abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);
|
|
4031
|
+
if (brk > wasmMemory.buffer.byteLength)
|
|
4032
|
+
abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);
|
|
3893
4033
|
}
|
|
3894
4034
|
var type = getSafeHeapType(bytes, isFloat);
|
|
3895
4035
|
var ret = getValue_safe(dest, type);
|
|
3896
|
-
if (unsigned)
|
|
4036
|
+
if (unsigned)
|
|
4037
|
+
ret = unSign(ret, parseInt(type.slice(1), 10));
|
|
3897
4038
|
return ret;
|
|
3898
4039
|
}
|
|
3899
4040
|
function SAFE_HEAP_LOAD_D(dest, bytes, unsigned) {
|
|
@@ -3924,7 +4065,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3924
4065
|
assert(!Module["INITIAL_MEMORY"], "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");
|
|
3925
4066
|
function preRun() {
|
|
3926
4067
|
if (Module["preRun"]) {
|
|
3927
|
-
if (typeof Module["preRun"] == "function")
|
|
4068
|
+
if (typeof Module["preRun"] == "function")
|
|
4069
|
+
Module["preRun"] = [Module["preRun"]];
|
|
3928
4070
|
while (Module["preRun"].length) {
|
|
3929
4071
|
addOnPreRun(Module["preRun"].shift());
|
|
3930
4072
|
}
|
|
@@ -3936,7 +4078,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3936
4078
|
assert(!runtimeInitialized);
|
|
3937
4079
|
runtimeInitialized = true;
|
|
3938
4080
|
checkStackCookie();
|
|
3939
|
-
if (!Module["noFSInit"] && !FS.initialized)
|
|
4081
|
+
if (!Module["noFSInit"] && !FS.initialized)
|
|
4082
|
+
FS.init();
|
|
3940
4083
|
TTY.init();
|
|
3941
4084
|
wasmExports["__wasm_call_ctors"]();
|
|
3942
4085
|
FS.ignorePermissions = false;
|
|
@@ -3944,7 +4087,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3944
4087
|
function postRun() {
|
|
3945
4088
|
checkStackCookie();
|
|
3946
4089
|
if (Module["postRun"]) {
|
|
3947
|
-
if (typeof Module["postRun"] == "function")
|
|
4090
|
+
if (typeof Module["postRun"] == "function")
|
|
4091
|
+
Module["postRun"] = [Module["postRun"]];
|
|
3948
4092
|
while (Module["postRun"].length) {
|
|
3949
4093
|
addOnPostRun(Module["postRun"].shift());
|
|
3950
4094
|
}
|
|
@@ -3959,7 +4103,8 @@ var require_swisseph_node = __commonJS({
|
|
|
3959
4103
|
function getUniqueRunDependency(id2) {
|
|
3960
4104
|
var orig = id2;
|
|
3961
4105
|
while (1) {
|
|
3962
|
-
if (!runDependencyTracking[id2])
|
|
4106
|
+
if (!runDependencyTracking[id2])
|
|
4107
|
+
return id2;
|
|
3963
4108
|
id2 = orig + Math.random();
|
|
3964
4109
|
}
|
|
3965
4110
|
}
|
|
@@ -4141,7 +4286,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4141
4286
|
var onPreRuns = [];
|
|
4142
4287
|
var addOnPreRun = (cb) => onPreRuns.unshift(cb);
|
|
4143
4288
|
function getValue(ptr, type = "i8") {
|
|
4144
|
-
if (type.endsWith("*"))
|
|
4289
|
+
if (type.endsWith("*"))
|
|
4290
|
+
type = "*";
|
|
4145
4291
|
switch (type) {
|
|
4146
4292
|
case "i1":
|
|
4147
4293
|
return SAFE_HEAP_LOAD(ptr, 1, 0);
|
|
@@ -4164,7 +4310,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4164
4310
|
}
|
|
4165
4311
|
}
|
|
4166
4312
|
function getValue_safe(ptr, type = "i8") {
|
|
4167
|
-
if (type.endsWith("*"))
|
|
4313
|
+
if (type.endsWith("*"))
|
|
4314
|
+
type = "*";
|
|
4168
4315
|
switch (type) {
|
|
4169
4316
|
case "i1":
|
|
4170
4317
|
return HEAP8[ptr];
|
|
@@ -4193,7 +4340,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4193
4340
|
return "0x" + ptr.toString(16).padStart(8, "0");
|
|
4194
4341
|
};
|
|
4195
4342
|
function setValue(ptr, value, type = "i8") {
|
|
4196
|
-
if (type.endsWith("*"))
|
|
4343
|
+
if (type.endsWith("*"))
|
|
4344
|
+
type = "*";
|
|
4197
4345
|
switch (type) {
|
|
4198
4346
|
case "i1":
|
|
4199
4347
|
SAFE_HEAP_STORE(ptr, value, 1);
|
|
@@ -4224,7 +4372,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4224
4372
|
}
|
|
4225
4373
|
}
|
|
4226
4374
|
function setValue_safe(ptr, value, type = "i8") {
|
|
4227
|
-
if (type.endsWith("*"))
|
|
4375
|
+
if (type.endsWith("*"))
|
|
4376
|
+
type = "*";
|
|
4228
4377
|
switch (type) {
|
|
4229
4378
|
case "i1":
|
|
4230
4379
|
HEAP8[ptr] = value;
|
|
@@ -4266,7 +4415,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4266
4415
|
warnOnce.shown || (warnOnce.shown = {});
|
|
4267
4416
|
if (!warnOnce.shown[text]) {
|
|
4268
4417
|
warnOnce.shown[text] = 1;
|
|
4269
|
-
if (ENVIRONMENT_IS_NODE)
|
|
4418
|
+
if (ENVIRONMENT_IS_NODE)
|
|
4419
|
+
text = "warning: " + text;
|
|
4270
4420
|
err(text);
|
|
4271
4421
|
}
|
|
4272
4422
|
};
|
|
@@ -4296,7 +4446,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4296
4446
|
var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => {
|
|
4297
4447
|
var endIdx = idx + maxBytesToRead;
|
|
4298
4448
|
var endPtr = idx;
|
|
4299
|
-
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
|
4449
|
+
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
|
4450
|
+
++endPtr;
|
|
4300
4451
|
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
|
4301
4452
|
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
|
|
4302
4453
|
}
|
|
@@ -4316,7 +4467,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4316
4467
|
if ((u0 & 240) == 224) {
|
|
4317
4468
|
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
|
4318
4469
|
} else {
|
|
4319
|
-
if ((u0 & 248) != 240)
|
|
4470
|
+
if ((u0 & 248) != 240)
|
|
4471
|
+
warnOnce("Invalid UTF-8 leading byte " + ptrToString(u0) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
|
|
4320
4472
|
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
|
|
4321
4473
|
}
|
|
4322
4474
|
if (u0 < 65536) {
|
|
@@ -4348,7 +4500,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4348
4500
|
};
|
|
4349
4501
|
var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
|
|
4350
4502
|
assert(typeof str === "string", `stringToUTF8Array expects a string (got ${typeof str})`);
|
|
4351
|
-
if (!(maxBytesToWrite > 0))
|
|
4503
|
+
if (!(maxBytesToWrite > 0))
|
|
4504
|
+
return 0;
|
|
4352
4505
|
var startIdx = outIdx;
|
|
4353
4506
|
var endIdx = outIdx + maxBytesToWrite - 1;
|
|
4354
4507
|
for (var i = 0; i < str.length; ++i) {
|
|
@@ -4358,20 +4511,25 @@ var require_swisseph_node = __commonJS({
|
|
|
4358
4511
|
u = 65536 + ((u & 1023) << 10) | u1 & 1023;
|
|
4359
4512
|
}
|
|
4360
4513
|
if (u <= 127) {
|
|
4361
|
-
if (outIdx >= endIdx)
|
|
4514
|
+
if (outIdx >= endIdx)
|
|
4515
|
+
break;
|
|
4362
4516
|
heap[outIdx++] = u;
|
|
4363
4517
|
} else if (u <= 2047) {
|
|
4364
|
-
if (outIdx + 1 >= endIdx)
|
|
4518
|
+
if (outIdx + 1 >= endIdx)
|
|
4519
|
+
break;
|
|
4365
4520
|
heap[outIdx++] = 192 | u >> 6;
|
|
4366
4521
|
heap[outIdx++] = 128 | u & 63;
|
|
4367
4522
|
} else if (u <= 65535) {
|
|
4368
|
-
if (outIdx + 2 >= endIdx)
|
|
4523
|
+
if (outIdx + 2 >= endIdx)
|
|
4524
|
+
break;
|
|
4369
4525
|
heap[outIdx++] = 224 | u >> 12;
|
|
4370
4526
|
heap[outIdx++] = 128 | u >> 6 & 63;
|
|
4371
4527
|
heap[outIdx++] = 128 | u & 63;
|
|
4372
4528
|
} else {
|
|
4373
|
-
if (outIdx + 3 >= endIdx)
|
|
4374
|
-
|
|
4529
|
+
if (outIdx + 3 >= endIdx)
|
|
4530
|
+
break;
|
|
4531
|
+
if (u > 1114111)
|
|
4532
|
+
warnOnce("Invalid Unicode code point " + ptrToString(u) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
|
|
4375
4533
|
heap[outIdx++] = 240 | u >> 18;
|
|
4376
4534
|
heap[outIdx++] = 128 | u >> 12 & 63;
|
|
4377
4535
|
heap[outIdx++] = 128 | u >> 6 & 63;
|
|
@@ -4385,7 +4543,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4385
4543
|
var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
|
|
4386
4544
|
var u8array = new Array(len);
|
|
4387
4545
|
var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
|
|
4388
|
-
if (dontAddNull)
|
|
4546
|
+
if (dontAddNull)
|
|
4547
|
+
u8array.length = numBytesWritten;
|
|
4389
4548
|
return u8array;
|
|
4390
4549
|
};
|
|
4391
4550
|
var FS_stdin_getChar = () => {
|
|
@@ -4399,8 +4558,10 @@ var require_swisseph_node = __commonJS({
|
|
|
4399
4558
|
try {
|
|
4400
4559
|
bytesRead = fs.readSync(fd, buf, 0, BUFSIZE);
|
|
4401
4560
|
} catch (e) {
|
|
4402
|
-
if (e.toString().includes("EOF"))
|
|
4403
|
-
|
|
4561
|
+
if (e.toString().includes("EOF"))
|
|
4562
|
+
bytesRead = 0;
|
|
4563
|
+
else
|
|
4564
|
+
throw e;
|
|
4404
4565
|
}
|
|
4405
4566
|
if (bytesRead > 0) {
|
|
4406
4567
|
result = buf.slice(0, bytesRead).toString("utf-8");
|
|
@@ -4450,7 +4611,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4450
4611
|
if (result === void 0 && bytesRead === 0) {
|
|
4451
4612
|
throw new FS.ErrnoError(6);
|
|
4452
4613
|
}
|
|
4453
|
-
if (result === null || result === void 0)
|
|
4614
|
+
if (result === null || result === void 0)
|
|
4615
|
+
break;
|
|
4454
4616
|
bytesRead++;
|
|
4455
4617
|
buffer[offset + i] = result;
|
|
4456
4618
|
}
|
|
@@ -4480,7 +4642,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4480
4642
|
out(UTF8ArrayToString(tty.output));
|
|
4481
4643
|
tty.output = [];
|
|
4482
4644
|
} else {
|
|
4483
|
-
if (val != 0)
|
|
4645
|
+
if (val != 0)
|
|
4646
|
+
tty.output.push(val);
|
|
4484
4647
|
}
|
|
4485
4648
|
}, fsync(tty) {
|
|
4486
4649
|
if (tty.output?.length > 0) {
|
|
@@ -4498,7 +4661,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4498
4661
|
err(UTF8ArrayToString(tty.output));
|
|
4499
4662
|
tty.output = [];
|
|
4500
4663
|
} else {
|
|
4501
|
-
if (val != 0)
|
|
4664
|
+
if (val != 0)
|
|
4665
|
+
tty.output.push(val);
|
|
4502
4666
|
}
|
|
4503
4667
|
}, fsync(tty) {
|
|
4504
4668
|
if (tty.output?.length > 0) {
|
|
@@ -4544,20 +4708,26 @@ var require_swisseph_node = __commonJS({
|
|
|
4544
4708
|
}
|
|
4545
4709
|
return node;
|
|
4546
4710
|
}, getFileDataAsTypedArray(node) {
|
|
4547
|
-
if (!node.contents)
|
|
4548
|
-
|
|
4711
|
+
if (!node.contents)
|
|
4712
|
+
return new Uint8Array(0);
|
|
4713
|
+
if (node.contents.subarray)
|
|
4714
|
+
return node.contents.subarray(0, node.usedBytes);
|
|
4549
4715
|
return new Uint8Array(node.contents);
|
|
4550
4716
|
}, expandFileStorage(node, newCapacity) {
|
|
4551
4717
|
var prevCapacity = node.contents ? node.contents.length : 0;
|
|
4552
|
-
if (prevCapacity >= newCapacity)
|
|
4718
|
+
if (prevCapacity >= newCapacity)
|
|
4719
|
+
return;
|
|
4553
4720
|
var CAPACITY_DOUBLING_MAX = 1024 * 1024;
|
|
4554
4721
|
newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0);
|
|
4555
|
-
if (prevCapacity != 0)
|
|
4722
|
+
if (prevCapacity != 0)
|
|
4723
|
+
newCapacity = Math.max(newCapacity, 256);
|
|
4556
4724
|
var oldContents = node.contents;
|
|
4557
4725
|
node.contents = new Uint8Array(newCapacity);
|
|
4558
|
-
if (node.usedBytes > 0)
|
|
4726
|
+
if (node.usedBytes > 0)
|
|
4727
|
+
node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
|
|
4559
4728
|
}, resizeFileStorage(node, newSize) {
|
|
4560
|
-
if (node.usedBytes == newSize)
|
|
4729
|
+
if (node.usedBytes == newSize)
|
|
4730
|
+
return;
|
|
4561
4731
|
if (newSize == 0) {
|
|
4562
4732
|
node.contents = null;
|
|
4563
4733
|
node.usedBytes = 0;
|
|
@@ -4647,13 +4817,15 @@ var require_swisseph_node = __commonJS({
|
|
|
4647
4817
|
return node.link;
|
|
4648
4818
|
} }, stream_ops: { read(stream, buffer, offset, length, position) {
|
|
4649
4819
|
var contents = stream.node.contents;
|
|
4650
|
-
if (position >= stream.node.usedBytes)
|
|
4820
|
+
if (position >= stream.node.usedBytes)
|
|
4821
|
+
return 0;
|
|
4651
4822
|
var size = Math.min(stream.node.usedBytes - position, length);
|
|
4652
4823
|
assert(size >= 0);
|
|
4653
4824
|
if (size > 8 && contents.subarray) {
|
|
4654
4825
|
buffer.set(contents.subarray(position, position + size), offset);
|
|
4655
4826
|
} else {
|
|
4656
|
-
for (var i = 0; i < size; i++)
|
|
4827
|
+
for (var i = 0; i < size; i++)
|
|
4828
|
+
buffer[offset + i] = contents[position + i];
|
|
4657
4829
|
}
|
|
4658
4830
|
return size;
|
|
4659
4831
|
}, write(stream, buffer, offset, length, position, canOwn) {
|
|
@@ -4661,7 +4833,8 @@ var require_swisseph_node = __commonJS({
|
|
|
4661
4833
|
if (buffer.buffer === HEAP8.buffer) {
|
|
4662
4834
|
canOwn = false;
|
|
4663
4835
|
}
|
|
4664
|
-
if (!length)
|
|
4836
|
+
if (!length)
|
|
4837
|
+
return 0;
|
|
4665
4838
|
var node = stream.node;
|
|
4666
4839
|
node.mtime = node.ctime = Date.now();
|
|
4667
4840
|
if (buffer.subarray && (!node.contents || node.contents.subarray)) {
|
|
@@ -4744,10 +4917,12 @@ var require_swisseph_node = __commonJS({
|
|
|
4744
4917
|
};
|
|
4745
4918
|
var preloadPlugins = Module["preloadPlugins"] || [];
|
|
4746
4919
|
var FS_handledByPreloadPlugin = (byteArray, fullname, finish, onerror) => {
|
|
4747
|
-
if (typeof Browser != "undefined")
|
|
4920
|
+
if (typeof Browser != "undefined")
|
|
4921
|
+
Browser.init();
|
|
4748
4922
|
var handled = false;
|
|
4749
4923
|
preloadPlugins.forEach((plugin) => {
|
|
4750
|
-
if (handled)
|
|
4924
|
+
if (handled)
|
|
4925
|
+
return;
|
|
4751
4926
|
if (plugin["canHandle"](fullname)) {
|
|
4752
4927
|
plugin["handle"](byteArray, fullname, finish, onerror);
|
|
4753
4928
|
handled = true;
|
|
@@ -4792,8 +4967,10 @@ var require_swisseph_node = __commonJS({
|
|
|
4792
4967
|
};
|
|
4793
4968
|
var FS_getMode = (canRead, canWrite) => {
|
|
4794
4969
|
var mode = 0;
|
|
4795
|
-
if (canRead)
|
|
4796
|
-
|
|
4970
|
+
if (canRead)
|
|
4971
|
+
mode |= 292 | 73;
|
|
4972
|
+
if (canWrite)
|
|
4973
|
+
mode |= 146;
|
|
4797
4974
|
return mode;
|
|
4798
4975
|
};
|
|
4799
4976
|
var ERRNO_CODES = { EPERM: 63, ENOENT: 44, ESRCH: 71, EINTR: 27, EIO: 29, ENXIO: 60, E2BIG: 1, ENOEXEC: 45, EBADF: 8, ECHILD: 12, EAGAIN: 6, EWOULDBLOCK: 6, ENOMEM: 48, EACCES: 2, EFAULT: 21, ENOTBLK: 105, EBUSY: 10, EEXIST: 20, EXDEV: 75, ENODEV: 43, ENOTDIR: 54, EISDIR: 31, EINVAL: 28, ENFILE: 41, EMFILE: 33, ENOTTY: 59, ETXTBSY: 74, EFBIG: 22, ENOSPC: 51, ESPIPE: 70, EROFS: 69, EMLINK: 34, EPIPE: 64, EDOM: 18, ERANGE: 68, ENOMSG: 49, EIDRM: 24, ECHRNG: 106, EL2NSYNC: 156, EL3HLT: 107, EL3RST: 108, ELNRNG: 109, EUNATCH: 110, ENOCSI: 111, EL2HLT: 112, EDEADLK: 16, ENOLCK: 46, EBADE: 113, EBADR: 114, EXFULL: 115, ENOANO: 104, EBADRQC: 103, EBADSLT: 102, EDEADLOCK: 16, EBFONT: 101, ENOSTR: 100, ENODATA: 116, ETIME: 117, ENOSR: 118, ENONET: 119, ENOPKG: 120, EREMOTE: 121, ENOLINK: 47, EADV: 122, ESRMNT: 123, ECOMM: 124, EPROTO: 65, EMULTIHOP: 36, EDOTDOT: 125, EBADMSG: 9, ENOTUNIQ: 126, EBADFD: 127, EREMCHG: 128, ELIBACC: 129, ELIBBAD: 130, ELIBSCN: 131, ELIBMAX: 132, ELIBEXEC: 133, ENOSYS: 52, ENOTEMPTY: 55, ENAMETOOLONG: 37, ELOOP: 32, EOPNOTSUPP: 138, EPFNOSUPPORT: 139, ECONNRESET: 15, ENOBUFS: 42, EAFNOSUPPORT: 5, EPROTOTYPE: 67, ENOTSOCK: 57, ENOPROTOOPT: 50, ESHUTDOWN: 140, ECONNREFUSED: 14, EADDRINUSE: 3, ECONNABORTED: 13, ENETUNREACH: 40, ENETDOWN: 38, ETIMEDOUT: 73, EHOSTDOWN: 142, EHOSTUNREACH: 23, EINPROGRESS: 26, EALREADY: 7, EDESTADDRREQ: 17, EMSGSIZE: 35, EPROTONOSUPPORT: 66, ESOCKTNOSUPPORT: 137, EADDRNOTAVAIL: 4, ENETRESET: 39, EISCONN: 30, ENOTCONN: 53, ETOOMANYREFS: 141, EUSERS: 136, EDQUOT: 19, ESTALE: 72, ENOTSUP: 138, ENOMEDIUM: 148, EILSEQ: 25, EOVERFLOW: 61, ECANCELED: 11, ENOTRECOVERABLE: 56, EOWNERDEAD: 62, ESTRPIPE: 135 };
|
|
@@ -4810,8 +4987,10 @@ var require_swisseph_node = __commonJS({
|
|
|
4810
4987
|
try {
|
|
4811
4988
|
return f();
|
|
4812
4989
|
} catch (e) {
|
|
4813
|
-
if (!e.code)
|
|
4814
|
-
|
|
4990
|
+
if (!e.code)
|
|
4991
|
+
throw e;
|
|
4992
|
+
if (e.code === "UNKNOWN")
|
|
4993
|
+
throw new FS.ErrnoError(28);
|
|
4815
4994
|
throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
|
|
4816
4995
|
}
|
|
4817
4996
|
}, mount(mount) {
|
|
@@ -5126,9 +5305,11 @@ var require_swisseph_node = __commonJS({
|
|
|
5126
5305
|
return VFS.read(stream, buffer, offset, length, position);
|
|
5127
5306
|
}
|
|
5128
5307
|
var seeking = typeof position != "undefined";
|
|
5129
|
-
if (!seeking && stream.seekable)
|
|
5308
|
+
if (!seeking && stream.seekable)
|
|
5309
|
+
position = stream.position;
|
|
5130
5310
|
var bytesRead = fs.readSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
|
|
5131
|
-
if (!seeking)
|
|
5311
|
+
if (!seeking)
|
|
5312
|
+
stream.position += bytesRead;
|
|
5132
5313
|
return bytesRead;
|
|
5133
5314
|
}, write(stream, buffer, offset, length, position) {
|
|
5134
5315
|
if (stream.stream_ops) {
|
|
@@ -5138,9 +5319,11 @@ var require_swisseph_node = __commonJS({
|
|
|
5138
5319
|
FS.llseek(stream, 0, 2);
|
|
5139
5320
|
}
|
|
5140
5321
|
var seeking = typeof position != "undefined";
|
|
5141
|
-
if (!seeking && stream.seekable)
|
|
5322
|
+
if (!seeking && stream.seekable)
|
|
5323
|
+
position = stream.position;
|
|
5142
5324
|
var bytesWritten = fs.writeSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
|
|
5143
|
-
if (!seeking)
|
|
5325
|
+
if (!seeking)
|
|
5326
|
+
stream.position += bytesWritten;
|
|
5144
5327
|
return bytesWritten;
|
|
5145
5328
|
}, mmap(stream, length, position, prot, flags) {
|
|
5146
5329
|
if (!length) {
|
|
@@ -5253,56 +5436,58 @@ var require_swisseph_node = __commonJS({
|
|
|
5253
5436
|
if (!PATH.isAbs(path)) {
|
|
5254
5437
|
path = FS.cwd() + "/" + path;
|
|
5255
5438
|
}
|
|
5256
|
-
linkloop:
|
|
5257
|
-
var
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
var
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
if (parts[i] === ".") {
|
|
5266
|
-
continue;
|
|
5267
|
-
}
|
|
5268
|
-
if (parts[i] === "..") {
|
|
5269
|
-
current_path = PATH.dirname(current_path);
|
|
5270
|
-
current = current.parent;
|
|
5271
|
-
continue;
|
|
5272
|
-
}
|
|
5273
|
-
current_path = PATH.join2(current_path, parts[i]);
|
|
5274
|
-
try {
|
|
5275
|
-
current = FS.lookupNode(current, parts[i]);
|
|
5276
|
-
} catch (e) {
|
|
5277
|
-
if (e?.errno === 44 && islast && opts.noent_okay) {
|
|
5278
|
-
return { path: current_path };
|
|
5439
|
+
linkloop:
|
|
5440
|
+
for (var nlinks = 0; nlinks < 40; nlinks++) {
|
|
5441
|
+
var parts = path.split("/").filter((p) => !!p);
|
|
5442
|
+
var current = FS.root;
|
|
5443
|
+
var current_path = "/";
|
|
5444
|
+
for (var i = 0; i < parts.length; i++) {
|
|
5445
|
+
var islast = i === parts.length - 1;
|
|
5446
|
+
if (islast && opts.parent) {
|
|
5447
|
+
break;
|
|
5279
5448
|
}
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5449
|
+
if (parts[i] === ".") {
|
|
5450
|
+
continue;
|
|
5451
|
+
}
|
|
5452
|
+
if (parts[i] === "..") {
|
|
5453
|
+
current_path = PATH.dirname(current_path);
|
|
5454
|
+
current = current.parent;
|
|
5455
|
+
continue;
|
|
5456
|
+
}
|
|
5457
|
+
current_path = PATH.join2(current_path, parts[i]);
|
|
5458
|
+
try {
|
|
5459
|
+
current = FS.lookupNode(current, parts[i]);
|
|
5460
|
+
} catch (e) {
|
|
5461
|
+
if (e?.errno === 44 && islast && opts.noent_okay) {
|
|
5462
|
+
return { path: current_path };
|
|
5463
|
+
}
|
|
5464
|
+
throw e;
|
|
5288
5465
|
}
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5466
|
+
if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) {
|
|
5467
|
+
current = current.mounted.root;
|
|
5468
|
+
}
|
|
5469
|
+
if (FS.isLink(current.mode) && (!islast || opts.follow)) {
|
|
5470
|
+
if (!current.node_ops.readlink) {
|
|
5471
|
+
throw new FS.ErrnoError(52);
|
|
5472
|
+
}
|
|
5473
|
+
var link = current.node_ops.readlink(current);
|
|
5474
|
+
if (!PATH.isAbs(link)) {
|
|
5475
|
+
link = PATH.dirname(current_path) + "/" + link;
|
|
5476
|
+
}
|
|
5477
|
+
path = link + "/" + parts.slice(i + 1).join("/");
|
|
5478
|
+
continue linkloop;
|
|
5292
5479
|
}
|
|
5293
|
-
path = link + "/" + parts.slice(i + 1).join("/");
|
|
5294
|
-
continue linkloop;
|
|
5295
5480
|
}
|
|
5481
|
+
return { path: current_path, node: current };
|
|
5296
5482
|
}
|
|
5297
|
-
return { path: current_path, node: current };
|
|
5298
|
-
}
|
|
5299
5483
|
throw new FS.ErrnoError(32);
|
|
5300
5484
|
}, getPath(node) {
|
|
5301
5485
|
var path;
|
|
5302
5486
|
while (true) {
|
|
5303
5487
|
if (FS.isRoot(node)) {
|
|
5304
5488
|
var mount = node.mount.mountpoint;
|
|
5305
|
-
if (!path)
|
|
5489
|
+
if (!path)
|
|
5490
|
+
return mount;
|
|
5306
5491
|
return mount[mount.length - 1] !== "/" ? `${mount}/${path}` : mount + path;
|
|
5307
5492
|
}
|
|
5308
5493
|
path = path ? `${node.name}/${path}` : node.name;
|
|
@@ -5389,10 +5574,13 @@ var require_swisseph_node = __commonJS({
|
|
|
5389
5574
|
}
|
|
5390
5575
|
return 0;
|
|
5391
5576
|
}, mayLookup(dir) {
|
|
5392
|
-
if (!FS.isDir(dir.mode))
|
|
5577
|
+
if (!FS.isDir(dir.mode))
|
|
5578
|
+
return 54;
|
|
5393
5579
|
var errCode = FS.nodePermissions(dir, "x");
|
|
5394
|
-
if (errCode)
|
|
5395
|
-
|
|
5580
|
+
if (errCode)
|
|
5581
|
+
return errCode;
|
|
5582
|
+
if (!dir.node_ops.lookup)
|
|
5583
|
+
return 2;
|
|
5396
5584
|
return 0;
|
|
5397
5585
|
}, mayCreate(dir, name) {
|
|
5398
5586
|
if (!FS.isDir(dir.mode)) {
|
|
@@ -5627,12 +5815,14 @@ var require_swisseph_node = __commonJS({
|
|
|
5627
5815
|
var dirs = path.split("/");
|
|
5628
5816
|
var d = "";
|
|
5629
5817
|
for (var dir of dirs) {
|
|
5630
|
-
if (!dir)
|
|
5818
|
+
if (!dir)
|
|
5819
|
+
continue;
|
|
5631
5820
|
d += "/" + dir;
|
|
5632
5821
|
try {
|
|
5633
5822
|
FS.mkdir(d, mode);
|
|
5634
5823
|
} catch (e) {
|
|
5635
|
-
if (e.errno != 20)
|
|
5824
|
+
if (e.errno != 20)
|
|
5825
|
+
throw e;
|
|
5636
5826
|
}
|
|
5637
5827
|
}
|
|
5638
5828
|
}, mkdev(path, mode, dev) {
|
|
@@ -5670,7 +5860,8 @@ var require_swisseph_node = __commonJS({
|
|
|
5670
5860
|
old_dir = lookup.node;
|
|
5671
5861
|
lookup = FS.lookupPath(new_path, { parent: true });
|
|
5672
5862
|
new_dir = lookup.node;
|
|
5673
|
-
if (!old_dir || !new_dir)
|
|
5863
|
+
if (!old_dir || !new_dir)
|
|
5864
|
+
throw new FS.ErrnoError(44);
|
|
5674
5865
|
if (old_dir.mount !== new_dir.mount) {
|
|
5675
5866
|
throw new FS.ErrnoError(75);
|
|
5676
5867
|
}
|
|
@@ -5924,7 +6115,8 @@ var require_swisseph_node = __commonJS({
|
|
|
5924
6115
|
if (FS.isClosed(stream)) {
|
|
5925
6116
|
throw new FS.ErrnoError(8);
|
|
5926
6117
|
}
|
|
5927
|
-
if (stream.getdents)
|
|
6118
|
+
if (stream.getdents)
|
|
6119
|
+
stream.getdents = null;
|
|
5928
6120
|
try {
|
|
5929
6121
|
if (stream.stream_ops.close) {
|
|
5930
6122
|
stream.stream_ops.close(stream);
|
|
@@ -5974,7 +6166,8 @@ var require_swisseph_node = __commonJS({
|
|
|
5974
6166
|
throw new FS.ErrnoError(70);
|
|
5975
6167
|
}
|
|
5976
6168
|
var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
|
|
5977
|
-
if (!seeking)
|
|
6169
|
+
if (!seeking)
|
|
6170
|
+
stream.position += bytesRead;
|
|
5978
6171
|
return bytesRead;
|
|
5979
6172
|
}, write(stream, buffer, offset, length, position, canOwn) {
|
|
5980
6173
|
assert(offset >= 0);
|
|
@@ -6003,7 +6196,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6003
6196
|
throw new FS.ErrnoError(70);
|
|
6004
6197
|
}
|
|
6005
6198
|
var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
|
|
6006
|
-
if (!seeking)
|
|
6199
|
+
if (!seeking)
|
|
6200
|
+
stream.position += bytesWritten;
|
|
6007
6201
|
return bytesWritten;
|
|
6008
6202
|
}, mmap(stream, length, position, prot, flags) {
|
|
6009
6203
|
if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) {
|
|
@@ -6195,12 +6389,14 @@ var require_swisseph_node = __commonJS({
|
|
|
6195
6389
|
var parts = path.split("/").reverse();
|
|
6196
6390
|
while (parts.length) {
|
|
6197
6391
|
var part = parts.pop();
|
|
6198
|
-
if (!part)
|
|
6392
|
+
if (!part)
|
|
6393
|
+
continue;
|
|
6199
6394
|
var current = PATH.join2(parent, part);
|
|
6200
6395
|
try {
|
|
6201
6396
|
FS.mkdir(current);
|
|
6202
6397
|
} catch (e) {
|
|
6203
|
-
if (e.errno != 20)
|
|
6398
|
+
if (e.errno != 20)
|
|
6399
|
+
throw e;
|
|
6204
6400
|
}
|
|
6205
6401
|
parent = current;
|
|
6206
6402
|
}
|
|
@@ -6220,7 +6416,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6220
6416
|
if (data) {
|
|
6221
6417
|
if (typeof data == "string") {
|
|
6222
6418
|
var arr = new Array(data.length);
|
|
6223
|
-
for (var i = 0, len = data.length; i < len; ++i)
|
|
6419
|
+
for (var i = 0, len = data.length; i < len; ++i)
|
|
6420
|
+
arr[i] = data.charCodeAt(i);
|
|
6224
6421
|
data = arr;
|
|
6225
6422
|
}
|
|
6226
6423
|
FS.chmod(node, mode | 146);
|
|
@@ -6253,7 +6450,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6253
6450
|
if (result === void 0 && bytesRead === 0) {
|
|
6254
6451
|
throw new FS.ErrnoError(6);
|
|
6255
6452
|
}
|
|
6256
|
-
if (result === null || result === void 0)
|
|
6453
|
+
if (result === null || result === void 0)
|
|
6454
|
+
break;
|
|
6257
6455
|
bytesRead++;
|
|
6258
6456
|
buffer[offset + i] = result;
|
|
6259
6457
|
}
|
|
@@ -6276,7 +6474,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6276
6474
|
} });
|
|
6277
6475
|
return FS.mkdev(path, mode, dev);
|
|
6278
6476
|
}, forceLoadFile(obj) {
|
|
6279
|
-
if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
|
|
6477
|
+
if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
|
|
6478
|
+
return true;
|
|
6280
6479
|
if (typeof XMLHttpRequest != "undefined") {
|
|
6281
6480
|
throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
|
6282
6481
|
} else {
|
|
@@ -6308,25 +6507,31 @@ var require_swisseph_node = __commonJS({
|
|
|
6308
6507
|
var xhr = new XMLHttpRequest();
|
|
6309
6508
|
xhr.open("HEAD", url, false);
|
|
6310
6509
|
xhr.send(null);
|
|
6311
|
-
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304))
|
|
6510
|
+
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304))
|
|
6511
|
+
throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
|
|
6312
6512
|
var datalength = Number(xhr.getResponseHeader("Content-length"));
|
|
6313
6513
|
var header;
|
|
6314
6514
|
var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
|
|
6315
6515
|
var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
|
|
6316
6516
|
var chunkSize = 1024 * 1024;
|
|
6317
|
-
if (!hasByteServing)
|
|
6517
|
+
if (!hasByteServing)
|
|
6518
|
+
chunkSize = datalength;
|
|
6318
6519
|
var doXHR = (from, to) => {
|
|
6319
|
-
if (from > to)
|
|
6320
|
-
|
|
6520
|
+
if (from > to)
|
|
6521
|
+
throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
|
|
6522
|
+
if (to > datalength - 1)
|
|
6523
|
+
throw new Error("only " + datalength + " bytes available! programmer error!");
|
|
6321
6524
|
var xhr2 = new XMLHttpRequest();
|
|
6322
6525
|
xhr2.open("GET", url, false);
|
|
6323
|
-
if (datalength !== chunkSize)
|
|
6526
|
+
if (datalength !== chunkSize)
|
|
6527
|
+
xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
|
|
6324
6528
|
xhr2.responseType = "arraybuffer";
|
|
6325
6529
|
if (xhr2.overrideMimeType) {
|
|
6326
6530
|
xhr2.overrideMimeType("text/plain; charset=x-user-defined");
|
|
6327
6531
|
}
|
|
6328
6532
|
xhr2.send(null);
|
|
6329
|
-
if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304))
|
|
6533
|
+
if (!(xhr2.status >= 200 && xhr2.status < 300 || xhr2.status === 304))
|
|
6534
|
+
throw new Error("Couldn't load " + url + ". Status: " + xhr2.status);
|
|
6330
6535
|
if (xhr2.response !== void 0) {
|
|
6331
6536
|
return new Uint8Array(xhr2.response || []);
|
|
6332
6537
|
}
|
|
@@ -6340,7 +6545,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6340
6545
|
if (typeof lazyArray2.chunks[chunkNum] == "undefined") {
|
|
6341
6546
|
lazyArray2.chunks[chunkNum] = doXHR(start, end);
|
|
6342
6547
|
}
|
|
6343
|
-
if (typeof lazyArray2.chunks[chunkNum] == "undefined")
|
|
6548
|
+
if (typeof lazyArray2.chunks[chunkNum] == "undefined")
|
|
6549
|
+
throw new Error("doXHR failed!");
|
|
6344
6550
|
return lazyArray2.chunks[chunkNum];
|
|
6345
6551
|
});
|
|
6346
6552
|
if (usesGzip || !datalength) {
|
|
@@ -6367,7 +6573,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6367
6573
|
}
|
|
6368
6574
|
}
|
|
6369
6575
|
if (typeof XMLHttpRequest != "undefined") {
|
|
6370
|
-
if (!ENVIRONMENT_IS_WORKER)
|
|
6576
|
+
if (!ENVIRONMENT_IS_WORKER)
|
|
6577
|
+
throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
|
|
6371
6578
|
var lazyArray = new LazyUint8Array();
|
|
6372
6579
|
var properties = { isDevice: false, contents: lazyArray };
|
|
6373
6580
|
} else {
|
|
@@ -6394,7 +6601,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6394
6601
|
});
|
|
6395
6602
|
function writeChunks(stream, buffer, offset, length, position) {
|
|
6396
6603
|
var contents = stream.node.contents;
|
|
6397
|
-
if (position >= contents.length)
|
|
6604
|
+
if (position >= contents.length)
|
|
6605
|
+
return 0;
|
|
6398
6606
|
var size = Math.min(contents.length - position, length);
|
|
6399
6607
|
assert(size >= 0);
|
|
6400
6608
|
if (contents.slice) {
|
|
@@ -6541,7 +6749,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6541
6749
|
}
|
|
6542
6750
|
return -28;
|
|
6543
6751
|
} catch (e) {
|
|
6544
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6752
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6753
|
+
throw e;
|
|
6545
6754
|
return -e.errno;
|
|
6546
6755
|
}
|
|
6547
6756
|
}
|
|
@@ -6551,11 +6760,13 @@ var require_swisseph_node = __commonJS({
|
|
|
6551
6760
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
6552
6761
|
switch (op) {
|
|
6553
6762
|
case 21509: {
|
|
6554
|
-
if (!stream.tty)
|
|
6763
|
+
if (!stream.tty)
|
|
6764
|
+
return -59;
|
|
6555
6765
|
return 0;
|
|
6556
6766
|
}
|
|
6557
6767
|
case 21505: {
|
|
6558
|
-
if (!stream.tty)
|
|
6768
|
+
if (!stream.tty)
|
|
6769
|
+
return -59;
|
|
6559
6770
|
if (stream.tty.ops.ioctl_tcgets) {
|
|
6560
6771
|
var termios = stream.tty.ops.ioctl_tcgets(stream);
|
|
6561
6772
|
var argp = syscallGetVarargP();
|
|
@@ -6573,13 +6784,15 @@ var require_swisseph_node = __commonJS({
|
|
|
6573
6784
|
case 21510:
|
|
6574
6785
|
case 21511:
|
|
6575
6786
|
case 21512: {
|
|
6576
|
-
if (!stream.tty)
|
|
6787
|
+
if (!stream.tty)
|
|
6788
|
+
return -59;
|
|
6577
6789
|
return 0;
|
|
6578
6790
|
}
|
|
6579
6791
|
case 21506:
|
|
6580
6792
|
case 21507:
|
|
6581
6793
|
case 21508: {
|
|
6582
|
-
if (!stream.tty)
|
|
6794
|
+
if (!stream.tty)
|
|
6795
|
+
return -59;
|
|
6583
6796
|
if (stream.tty.ops.ioctl_tcsets) {
|
|
6584
6797
|
var argp = syscallGetVarargP();
|
|
6585
6798
|
var c_iflag = SAFE_HEAP_LOAD((argp >> 2) * 4, 4, 0);
|
|
@@ -6595,13 +6808,15 @@ var require_swisseph_node = __commonJS({
|
|
|
6595
6808
|
return 0;
|
|
6596
6809
|
}
|
|
6597
6810
|
case 21519: {
|
|
6598
|
-
if (!stream.tty)
|
|
6811
|
+
if (!stream.tty)
|
|
6812
|
+
return -59;
|
|
6599
6813
|
var argp = syscallGetVarargP();
|
|
6600
6814
|
SAFE_HEAP_STORE((argp >> 2) * 4, 0, 4);
|
|
6601
6815
|
return 0;
|
|
6602
6816
|
}
|
|
6603
6817
|
case 21520: {
|
|
6604
|
-
if (!stream.tty)
|
|
6818
|
+
if (!stream.tty)
|
|
6819
|
+
return -59;
|
|
6605
6820
|
return -28;
|
|
6606
6821
|
}
|
|
6607
6822
|
case 21531: {
|
|
@@ -6609,7 +6824,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6609
6824
|
return FS.ioctl(stream, op, argp);
|
|
6610
6825
|
}
|
|
6611
6826
|
case 21523: {
|
|
6612
|
-
if (!stream.tty)
|
|
6827
|
+
if (!stream.tty)
|
|
6828
|
+
return -59;
|
|
6613
6829
|
if (stream.tty.ops.ioctl_tiocgwinsz) {
|
|
6614
6830
|
var winsize = stream.tty.ops.ioctl_tiocgwinsz(stream.tty);
|
|
6615
6831
|
var argp = syscallGetVarargP();
|
|
@@ -6619,18 +6835,21 @@ var require_swisseph_node = __commonJS({
|
|
|
6619
6835
|
return 0;
|
|
6620
6836
|
}
|
|
6621
6837
|
case 21524: {
|
|
6622
|
-
if (!stream.tty)
|
|
6838
|
+
if (!stream.tty)
|
|
6839
|
+
return -59;
|
|
6623
6840
|
return 0;
|
|
6624
6841
|
}
|
|
6625
6842
|
case 21515: {
|
|
6626
|
-
if (!stream.tty)
|
|
6843
|
+
if (!stream.tty)
|
|
6844
|
+
return -59;
|
|
6627
6845
|
return 0;
|
|
6628
6846
|
}
|
|
6629
6847
|
default:
|
|
6630
6848
|
return -28;
|
|
6631
6849
|
}
|
|
6632
6850
|
} catch (e) {
|
|
6633
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6851
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6852
|
+
throw e;
|
|
6634
6853
|
return -e.errno;
|
|
6635
6854
|
}
|
|
6636
6855
|
}
|
|
@@ -6642,7 +6861,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6642
6861
|
var mode = varargs ? syscallGetVarargI() : 0;
|
|
6643
6862
|
return FS.open(path, flags, mode).fd;
|
|
6644
6863
|
} catch (e) {
|
|
6645
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6864
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6865
|
+
throw e;
|
|
6646
6866
|
return -e.errno;
|
|
6647
6867
|
}
|
|
6648
6868
|
}
|
|
@@ -6687,8 +6907,10 @@ var require_swisseph_node = __commonJS({
|
|
|
6687
6907
|
var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
|
|
6688
6908
|
var env = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: lang, _: getExecutableName() };
|
|
6689
6909
|
for (var x in ENV) {
|
|
6690
|
-
if (ENV[x] === void 0)
|
|
6691
|
-
|
|
6910
|
+
if (ENV[x] === void 0)
|
|
6911
|
+
delete env[x];
|
|
6912
|
+
else
|
|
6913
|
+
env[x] = ENV[x];
|
|
6692
6914
|
}
|
|
6693
6915
|
var strings = [];
|
|
6694
6916
|
for (var x in env) {
|
|
@@ -6729,7 +6951,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6729
6951
|
FS.close(stream);
|
|
6730
6952
|
return 0;
|
|
6731
6953
|
} catch (e) {
|
|
6732
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6954
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6955
|
+
throw e;
|
|
6733
6956
|
return e.errno;
|
|
6734
6957
|
}
|
|
6735
6958
|
}
|
|
@@ -6740,9 +6963,11 @@ var require_swisseph_node = __commonJS({
|
|
|
6740
6963
|
var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
|
|
6741
6964
|
iov += 8;
|
|
6742
6965
|
var curr = FS.read(stream, HEAP8, ptr, len, offset);
|
|
6743
|
-
if (curr < 0)
|
|
6966
|
+
if (curr < 0)
|
|
6967
|
+
return -1;
|
|
6744
6968
|
ret += curr;
|
|
6745
|
-
if (curr < len)
|
|
6969
|
+
if (curr < len)
|
|
6970
|
+
break;
|
|
6746
6971
|
if (typeof offset != "undefined") {
|
|
6747
6972
|
offset += curr;
|
|
6748
6973
|
}
|
|
@@ -6756,7 +6981,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6756
6981
|
SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
|
|
6757
6982
|
return 0;
|
|
6758
6983
|
} catch (e) {
|
|
6759
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6984
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
6985
|
+
throw e;
|
|
6760
6986
|
return e.errno;
|
|
6761
6987
|
}
|
|
6762
6988
|
}
|
|
@@ -6766,14 +6992,17 @@ var require_swisseph_node = __commonJS({
|
|
|
6766
6992
|
function _fd_seek(fd, offset, whence, newOffset) {
|
|
6767
6993
|
offset = bigintToI53Checked(offset);
|
|
6768
6994
|
try {
|
|
6769
|
-
if (isNaN(offset))
|
|
6995
|
+
if (isNaN(offset))
|
|
6996
|
+
return 61;
|
|
6770
6997
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
6771
6998
|
FS.llseek(stream, offset, whence);
|
|
6772
6999
|
HEAP64[newOffset >> 3] = BigInt(stream.position);
|
|
6773
|
-
if (stream.getdents && offset === 0 && whence === 0)
|
|
7000
|
+
if (stream.getdents && offset === 0 && whence === 0)
|
|
7001
|
+
stream.getdents = null;
|
|
6774
7002
|
return 0;
|
|
6775
7003
|
} catch (e) {
|
|
6776
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
7004
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
7005
|
+
throw e;
|
|
6777
7006
|
return e.errno;
|
|
6778
7007
|
}
|
|
6779
7008
|
}
|
|
@@ -6784,7 +7013,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6784
7013
|
var len = SAFE_HEAP_LOAD((iov + 4 >> 2) * 4, 4, 1);
|
|
6785
7014
|
iov += 8;
|
|
6786
7015
|
var curr = FS.write(stream, HEAP8, ptr, len, offset);
|
|
6787
|
-
if (curr < 0)
|
|
7016
|
+
if (curr < 0)
|
|
7017
|
+
return -1;
|
|
6788
7018
|
ret += curr;
|
|
6789
7019
|
if (curr < len) {
|
|
6790
7020
|
break;
|
|
@@ -6802,7 +7032,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6802
7032
|
SAFE_HEAP_STORE((pnum >> 2) * 4, num, 4);
|
|
6803
7033
|
return 0;
|
|
6804
7034
|
} catch (e) {
|
|
6805
|
-
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
7035
|
+
if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
|
|
7036
|
+
throw e;
|
|
6806
7037
|
return e.errno;
|
|
6807
7038
|
}
|
|
6808
7039
|
}
|
|
@@ -6842,7 +7073,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6842
7073
|
if (returnType === "string") {
|
|
6843
7074
|
return UTF8ToString(ret2);
|
|
6844
7075
|
}
|
|
6845
|
-
if (returnType === "boolean")
|
|
7076
|
+
if (returnType === "boolean")
|
|
7077
|
+
return Boolean(ret2);
|
|
6846
7078
|
return ret2;
|
|
6847
7079
|
}
|
|
6848
7080
|
var func = getCFunc(ident);
|
|
@@ -6853,7 +7085,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6853
7085
|
for (var i = 0; i < args.length; i++) {
|
|
6854
7086
|
var converter = toC[argTypes[i]];
|
|
6855
7087
|
if (converter) {
|
|
6856
|
-
if (stack === 0)
|
|
7088
|
+
if (stack === 0)
|
|
7089
|
+
stack = stackSave();
|
|
6857
7090
|
cArgs[i] = converter(args[i]);
|
|
6858
7091
|
} else {
|
|
6859
7092
|
cArgs[i] = args[i];
|
|
@@ -6862,7 +7095,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6862
7095
|
}
|
|
6863
7096
|
var ret = func(...cArgs);
|
|
6864
7097
|
function onDone(ret2) {
|
|
6865
|
-
if (stack !== 0)
|
|
7098
|
+
if (stack !== 0)
|
|
7099
|
+
stackRestore(stack);
|
|
6866
7100
|
return convertReturnValue(ret2);
|
|
6867
7101
|
}
|
|
6868
7102
|
ret = onDone(ret);
|
|
@@ -6976,7 +7210,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6976
7210
|
assert(!calledRun);
|
|
6977
7211
|
calledRun = true;
|
|
6978
7212
|
Module["calledRun"] = true;
|
|
6979
|
-
if (ABORT)
|
|
7213
|
+
if (ABORT)
|
|
7214
|
+
return;
|
|
6980
7215
|
initRuntime();
|
|
6981
7216
|
readyPromiseResolve(Module);
|
|
6982
7217
|
Module["onRuntimeInitialized"]?.();
|
|
@@ -6996,7 +7231,8 @@ var require_swisseph_node = __commonJS({
|
|
|
6996
7231
|
checkStackCookie();
|
|
6997
7232
|
}
|
|
6998
7233
|
if (Module["preInit"]) {
|
|
6999
|
-
if (typeof Module["preInit"] == "function")
|
|
7234
|
+
if (typeof Module["preInit"] == "function")
|
|
7235
|
+
Module["preInit"] = [Module["preInit"]];
|
|
7000
7236
|
while (Module["preInit"].length > 0) {
|
|
7001
7237
|
Module["preInit"].pop()();
|
|
7002
7238
|
}
|
|
@@ -7017,7 +7253,8 @@ var require_swisseph_node = __commonJS({
|
|
|
7017
7253
|
(() => {
|
|
7018
7254
|
var real_SwissEphemerisModule = SwissEphemerisModule;
|
|
7019
7255
|
SwissEphemerisModule = function(arg) {
|
|
7020
|
-
if (new.target)
|
|
7256
|
+
if (new.target)
|
|
7257
|
+
throw new Error("SwissEphemerisModule() should not be called with `new SwissEphemerisModule()`");
|
|
7021
7258
|
return real_SwissEphemerisModule(arg);
|
|
7022
7259
|
};
|
|
7023
7260
|
})();
|
|
@@ -7705,7 +7942,8 @@ function computeHorizonLongitude(gmst, ra, dec, latitude, angle) {
|
|
|
7705
7942
|
const tanPhi = Math.tan(latitude * DEG);
|
|
7706
7943
|
const tanDelta = Math.tan(dec * DEG);
|
|
7707
7944
|
const cosH = -(tanPhi * tanDelta);
|
|
7708
|
-
if (Math.abs(cosH) > 1)
|
|
7945
|
+
if (Math.abs(cosH) > 1)
|
|
7946
|
+
return null;
|
|
7709
7947
|
const H = Math.acos(cosH) / DEG;
|
|
7710
7948
|
const lon = angle === "AC" ? normalizeAngle(gmst - ra - H) : normalizeAngle(gmst - ra + H);
|
|
7711
7949
|
return toGeoLon(lon);
|
|
@@ -7737,9 +7975,12 @@ function findParansAtLatitude(equatorialPositions, gmst, latitude, paranOrb = 1)
|
|
|
7737
7975
|
for (const [name, eq] of Object.entries(equatorialPositions)) {
|
|
7738
7976
|
for (const angle of ANGLES) {
|
|
7739
7977
|
let lon;
|
|
7740
|
-
if (angle === "MC")
|
|
7741
|
-
|
|
7742
|
-
else
|
|
7978
|
+
if (angle === "MC")
|
|
7979
|
+
lon = computeMCLongitude(gmst, eq.ra);
|
|
7980
|
+
else if (angle === "IC")
|
|
7981
|
+
lon = computeICLongitude(gmst, eq.ra);
|
|
7982
|
+
else
|
|
7983
|
+
lon = computeHorizonLongitude(gmst, eq.ra, eq.dec, latitude, angle);
|
|
7743
7984
|
if (lon !== null) {
|
|
7744
7985
|
lines.push({ planet: name, angle, longitude: lon });
|
|
7745
7986
|
}
|
|
@@ -7750,8 +7991,10 @@ function findParansAtLatitude(equatorialPositions, gmst, latitude, paranOrb = 1)
|
|
|
7750
7991
|
for (let j = i + 1; j < lines.length; j++) {
|
|
7751
7992
|
const a = lines[i];
|
|
7752
7993
|
const b = lines[j];
|
|
7753
|
-
if (a.planet === b.planet)
|
|
7754
|
-
|
|
7994
|
+
if (a.planet === b.planet)
|
|
7995
|
+
continue;
|
|
7996
|
+
if (a.angle === b.angle)
|
|
7997
|
+
continue;
|
|
7755
7998
|
const dist = geographicAngularDifference(a.longitude, b.longitude);
|
|
7756
7999
|
if (dist <= paranOrb) {
|
|
7757
8000
|
parans.push({
|
|
@@ -7784,8 +8027,10 @@ function queryAstrocartographyLocation(date, options) {
|
|
|
7784
8027
|
for (const [name, eq] of Object.entries(positions)) {
|
|
7785
8028
|
for (const angle of ANGLES) {
|
|
7786
8029
|
let lineLon;
|
|
7787
|
-
if (angle === "MC")
|
|
7788
|
-
|
|
8030
|
+
if (angle === "MC")
|
|
8031
|
+
lineLon = computeMCLongitude(gmst, eq.ra);
|
|
8032
|
+
else if (angle === "IC")
|
|
8033
|
+
lineLon = computeICLongitude(gmst, eq.ra);
|
|
7789
8034
|
else
|
|
7790
8035
|
lineLon = computeHorizonLongitude(
|
|
7791
8036
|
gmst,
|
|
@@ -7794,7 +8039,8 @@ function queryAstrocartographyLocation(date, options) {
|
|
|
7794
8039
|
latitude,
|
|
7795
8040
|
angle
|
|
7796
8041
|
);
|
|
7797
|
-
if (lineLon === null)
|
|
8042
|
+
if (lineLon === null)
|
|
8043
|
+
continue;
|
|
7798
8044
|
const dist = geographicAngularDifference(longitude, lineLon);
|
|
7799
8045
|
lines.push({
|
|
7800
8046
|
planet: name,
|
|
@@ -7938,14 +8184,17 @@ function computeSynastryAspects(planetsA, planetsB, specs = DEFAULT_ASPECT_SPECS
|
|
|
7938
8184
|
}
|
|
7939
8185
|
function shorterArcMidpoint(a, b) {
|
|
7940
8186
|
let diff = b - a;
|
|
7941
|
-
if (diff > 180)
|
|
7942
|
-
|
|
8187
|
+
if (diff > 180)
|
|
8188
|
+
diff -= 360;
|
|
8189
|
+
if (diff < -180)
|
|
8190
|
+
diff += 360;
|
|
7943
8191
|
return normalizeAngle(a + diff / 2);
|
|
7944
8192
|
}
|
|
7945
8193
|
function computeMidpoints(planetsA, planetsB) {
|
|
7946
8194
|
const result = {};
|
|
7947
8195
|
for (const key of Object.keys(planetsA)) {
|
|
7948
|
-
if (!(key in planetsB))
|
|
8196
|
+
if (!(key in planetsB))
|
|
8197
|
+
continue;
|
|
7949
8198
|
result[key] = shorterArcMidpoint(planetsA[key].longitude, planetsB[key].longitude);
|
|
7950
8199
|
}
|
|
7951
8200
|
return result;
|
|
@@ -7959,7 +8208,8 @@ function computeTransitAspects(transitPlanets, natalPlanets, specs = DEFAULT_ASP
|
|
|
7959
8208
|
for (const kN of keysN) {
|
|
7960
8209
|
const n = natalPlanets[kN];
|
|
7961
8210
|
const match = getAspectMatch(t.longitude, n.longitude, specs);
|
|
7962
|
-
if (!match)
|
|
8211
|
+
if (!match)
|
|
8212
|
+
continue;
|
|
7963
8213
|
const tSpeed = t.longitudeSpeed ?? 0;
|
|
7964
8214
|
const nSpeed = n.longitudeSpeed ?? 0;
|
|
7965
8215
|
const dt = 0.01;
|
|
@@ -8527,9 +8777,11 @@ function findHouseOf(longitude, housePositions) {
|
|
|
8527
8777
|
for (let k = 0; k < H.length; k++) {
|
|
8528
8778
|
const cur = H[k], nxt = H[(k + 1) % H.length];
|
|
8529
8779
|
if (nxt.L < cur.L) {
|
|
8530
|
-
if (L >= cur.L || L < nxt.L)
|
|
8780
|
+
if (L >= cur.L || L < nxt.L)
|
|
8781
|
+
return cur.i;
|
|
8531
8782
|
} else {
|
|
8532
|
-
if (L >= cur.L && L < nxt.L)
|
|
8783
|
+
if (L >= cur.L && L < nxt.L)
|
|
8784
|
+
return cur.i;
|
|
8533
8785
|
}
|
|
8534
8786
|
}
|
|
8535
8787
|
return 1;
|
|
@@ -8597,11 +8849,13 @@ function getNatalAspectPoints(planets, ascLon, mcLon) {
|
|
|
8597
8849
|
return points;
|
|
8598
8850
|
}
|
|
8599
8851
|
function filterByNames(points, names) {
|
|
8600
|
-
if (!names || names.length === 0)
|
|
8852
|
+
if (!names || names.length === 0)
|
|
8853
|
+
return points;
|
|
8601
8854
|
const allowed = new Set(names.map((n) => n.toLowerCase()));
|
|
8602
8855
|
const result = {};
|
|
8603
8856
|
for (const [key, val] of Object.entries(points)) {
|
|
8604
|
-
if (allowed.has(key))
|
|
8857
|
+
if (allowed.has(key))
|
|
8858
|
+
result[key] = val;
|
|
8605
8859
|
}
|
|
8606
8860
|
return result;
|
|
8607
8861
|
}
|
|
@@ -8664,7 +8918,8 @@ async function getTransitRange(options) {
|
|
|
8664
8918
|
);
|
|
8665
8919
|
const natalKeys = Object.keys(nPoints);
|
|
8666
8920
|
const rawStep = options.stepDays ?? 1;
|
|
8667
|
-
if (rawStep <= 0)
|
|
8921
|
+
if (rawStep <= 0)
|
|
8922
|
+
throw new Error("stepDays must be greater than 0");
|
|
8668
8923
|
const fromMs = options.from.getTime();
|
|
8669
8924
|
const toMs = options.to.getTime();
|
|
8670
8925
|
const specs = options.aspectSpecs;
|
|
@@ -8685,7 +8940,8 @@ async function getTransitRange(options) {
|
|
|
8685
8940
|
const date = new Date(ms);
|
|
8686
8941
|
const utcDate = await toUtcDate(date, transitLat, transitLon, transitTz ?? { autoTimeZone: true });
|
|
8687
8942
|
const positions = await calculatePlanetaryPositions(utcDate);
|
|
8688
|
-
if (!positions)
|
|
8943
|
+
if (!positions)
|
|
8944
|
+
continue;
|
|
8689
8945
|
const points = {};
|
|
8690
8946
|
for (const [planetId, pos] of Object.entries(positions)) {
|
|
8691
8947
|
const id2 = planetId;
|
|
@@ -8704,7 +8960,8 @@ async function getTransitRange(options) {
|
|
|
8704
8960
|
for (const step of steps) {
|
|
8705
8961
|
const tPos = step.positions[tKey];
|
|
8706
8962
|
const nPos = nPoints[nKey];
|
|
8707
|
-
if (!tPos || !nPos)
|
|
8963
|
+
if (!tPos || !nPos)
|
|
8964
|
+
continue;
|
|
8708
8965
|
const match = specs ? findClosestAspectOrb(tPos.longitude, nPos.longitude, specs) : findClosestAspectOrb(tPos.longitude, nPos.longitude);
|
|
8709
8966
|
if (!match) {
|
|
8710
8967
|
prevOrb = null;
|
|
@@ -8726,7 +8983,8 @@ async function getTransitRange(options) {
|
|
|
8726
8983
|
transitLon,
|
|
8727
8984
|
transitTz
|
|
8728
8985
|
);
|
|
8729
|
-
if (exactResult)
|
|
8986
|
+
if (exactResult)
|
|
8987
|
+
perfections.push(exactResult);
|
|
8730
8988
|
}
|
|
8731
8989
|
prevDecreasing = wasDecreasing;
|
|
8732
8990
|
} else {
|
|
@@ -8790,7 +9048,8 @@ async function getTransitLongitudeAt(ms, transitKey, transitLat, transitLon, tra
|
|
|
8790
9048
|
}
|
|
8791
9049
|
}
|
|
8792
9050
|
const positions = await calculatePlanetaryPositions(utc);
|
|
8793
|
-
if (!positions)
|
|
9051
|
+
if (!positions)
|
|
9052
|
+
return null;
|
|
8794
9053
|
return findPlanetByName(positions, transitKey) ?? null;
|
|
8795
9054
|
}
|
|
8796
9055
|
async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs, natalPoint, transitLat, transitLon, transitTz) {
|
|
@@ -8799,12 +9058,14 @@ async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs
|
|
|
8799
9058
|
let lo = startMs;
|
|
8800
9059
|
let hi = endMs;
|
|
8801
9060
|
for (let i = 0; i < maxIterations; i++) {
|
|
8802
|
-
if (hi - lo < 6e4)
|
|
9061
|
+
if (hi - lo < 6e4)
|
|
9062
|
+
break;
|
|
8803
9063
|
const m1 = lo + Math.floor((hi - lo) / 3);
|
|
8804
9064
|
const m2 = hi - Math.floor((hi - lo) / 3);
|
|
8805
9065
|
const pos1 = await getTransitLongitudeAt(m1, transitKey, transitLat, transitLon, tz);
|
|
8806
9066
|
const pos2 = await getTransitLongitudeAt(m2, transitKey, transitLat, transitLon, tz);
|
|
8807
|
-
if (!pos1 || !pos2)
|
|
9067
|
+
if (!pos1 || !pos2)
|
|
9068
|
+
break;
|
|
8808
9069
|
const orb1 = computeOrbForAspect(pos1.longitude, natalPoint.longitude, spec.angle);
|
|
8809
9070
|
const orb2 = computeOrbForAspect(pos2.longitude, natalPoint.longitude, spec.angle);
|
|
8810
9071
|
if (orb1 < orb2) {
|
|
@@ -8815,9 +9076,11 @@ async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs
|
|
|
8815
9076
|
}
|
|
8816
9077
|
const finalMs = Math.floor((lo + hi) / 2);
|
|
8817
9078
|
const finalPos = await getTransitLongitudeAt(finalMs, transitKey, transitLat, transitLon, tz);
|
|
8818
|
-
if (!finalPos)
|
|
9079
|
+
if (!finalPos)
|
|
9080
|
+
return null;
|
|
8819
9081
|
const finalOrb = computeOrbForAspect(finalPos.longitude, natalPoint.longitude, spec.angle);
|
|
8820
|
-
if (finalOrb > spec.orb)
|
|
9082
|
+
if (finalOrb > spec.orb)
|
|
9083
|
+
return null;
|
|
8821
9084
|
return {
|
|
8822
9085
|
transitPlanet: transitKey,
|
|
8823
9086
|
natalPlanet: natalKey,
|
|
@@ -8831,19 +9094,22 @@ async function binarySearchPerfection(transitKey, natalKey, spec, startMs, endMs
|
|
|
8831
9094
|
function findPlanetByName(positions, name) {
|
|
8832
9095
|
for (const [planetId, pos] of Object.entries(positions)) {
|
|
8833
9096
|
const id2 = planetId;
|
|
8834
|
-
if (PLANET_AND_NODE_NAMES[id2].toLowerCase() === name)
|
|
9097
|
+
if (PLANET_AND_NODE_NAMES[id2].toLowerCase() === name)
|
|
9098
|
+
return pos;
|
|
8835
9099
|
}
|
|
8836
9100
|
return void 0;
|
|
8837
9101
|
}
|
|
8838
9102
|
async function getSunLongitudeAtMs(ms) {
|
|
8839
9103
|
const positions = await calculatePlanetaryPositions(new Date(ms));
|
|
8840
9104
|
const sun = findPlanetByName(positions, "sun");
|
|
8841
|
-
if (!sun)
|
|
9105
|
+
if (!sun)
|
|
9106
|
+
throw new Error("Failed to compute Sun position");
|
|
8842
9107
|
return sun.longitude;
|
|
8843
9108
|
}
|
|
8844
9109
|
function signedAngularDelta(current, target) {
|
|
8845
9110
|
let d = normalizeAngle(current - target);
|
|
8846
|
-
if (d > 180)
|
|
9111
|
+
if (d > 180)
|
|
9112
|
+
d -= 360;
|
|
8847
9113
|
return d;
|
|
8848
9114
|
}
|
|
8849
9115
|
async function getSolarReturnChart(options) {
|
|
@@ -8861,7 +9127,8 @@ async function getSolarReturnChart(options) {
|
|
|
8861
9127
|
let lo = approxReturn.getTime() - 2 * 864e5;
|
|
8862
9128
|
let hi = approxReturn.getTime() + 2 * 864e5;
|
|
8863
9129
|
for (let i = 0; i < 30; i++) {
|
|
8864
|
-
if (hi - lo < 6e4)
|
|
9130
|
+
if (hi - lo < 6e4)
|
|
9131
|
+
break;
|
|
8865
9132
|
const mid = Math.floor((lo + hi) / 2);
|
|
8866
9133
|
const sunLon = await getSunLongitudeAtMs(mid);
|
|
8867
9134
|
const delta = signedAngularDelta(sunLon, natalSunLongitude);
|
|
@@ -8921,7 +9188,8 @@ var init_astrology = __esm({
|
|
|
8921
9188
|
NAME_TO_PLANET = {};
|
|
8922
9189
|
for (const [id2, name] of Object.entries(PLANET_AND_NODE_NAMES)) {
|
|
8923
9190
|
const numId = Number(id2);
|
|
8924
|
-
if (!isNaN(numId))
|
|
9191
|
+
if (!isNaN(numId))
|
|
9192
|
+
NAME_TO_PLANET[name.toLowerCase()] = numId;
|
|
8925
9193
|
}
|
|
8926
9194
|
}
|
|
8927
9195
|
});
|
|
@@ -8979,15 +9247,24 @@ function generateArcheometerSvg(options = {}) {
|
|
|
8979
9247
|
push(`<circle cx="${fmt(center.x)}" cy="${fmt(center.y)}" r="${fmt(outerRadius)}" fill="${escapeAttr(palette.paper)}"/>`);
|
|
8980
9248
|
renderDefs(push, model);
|
|
8981
9249
|
renderRingGrounds(push, model);
|
|
8982
|
-
if (model.layers.chromicRays)
|
|
8983
|
-
|
|
8984
|
-
if (model.layers.
|
|
8985
|
-
|
|
8986
|
-
if (model.layers.
|
|
8987
|
-
|
|
8988
|
-
if (model.layers.
|
|
8989
|
-
|
|
8990
|
-
if (model.layers.
|
|
9250
|
+
if (model.layers.chromicRays)
|
|
9251
|
+
renderChromicRays(push, model);
|
|
9252
|
+
if (model.layers.planetaryUtterance)
|
|
9253
|
+
renderPlanetaryUtterance(push, model);
|
|
9254
|
+
if (model.layers.zodiacUtterance)
|
|
9255
|
+
renderZodiacUtterance(push, model);
|
|
9256
|
+
if (model.layers.cosmologicalMusic)
|
|
9257
|
+
renderCosmologicalMusic(push, model);
|
|
9258
|
+
if (model.layers.astralZodiac)
|
|
9259
|
+
renderAstralZodiac(push, model);
|
|
9260
|
+
if (model.layers.astralPlanetary)
|
|
9261
|
+
renderAstralPlanetary(push, model);
|
|
9262
|
+
if (model.layers.solarCenter)
|
|
9263
|
+
renderSolarCenter(push, model);
|
|
9264
|
+
if (model.layers.whiteRays)
|
|
9265
|
+
renderWhiteRays(push, model);
|
|
9266
|
+
if (model.layers.degreeCrown)
|
|
9267
|
+
renderDegreeCrown(push, model);
|
|
8991
9268
|
renderFrame(push, model);
|
|
8992
9269
|
push(`</svg>`);
|
|
8993
9270
|
return lines.join("\n");
|
|
@@ -9124,7 +9401,8 @@ function renderPlanetaryUtterance(push, model) {
|
|
|
9124
9401
|
}
|
|
9125
9402
|
push(`</g>`);
|
|
9126
9403
|
for (const label of sortedByDegree(model.triangleLabels)) {
|
|
9127
|
-
if (!label.label)
|
|
9404
|
+
if (!label.label)
|
|
9405
|
+
continue;
|
|
9128
9406
|
const a = angleOf(model, label.degree);
|
|
9129
9407
|
const labelPoint = polarToXY(center, ring.r1 + (clipOuter - ring.r1) * 0.56, a);
|
|
9130
9408
|
push(textSvg(label.label, labelPoint, 12 * scale, palette.ink, 0, "middle", 700));
|
|
@@ -9157,7 +9435,8 @@ function renderCosmologicalMusic(push, model) {
|
|
|
9157
9435
|
}
|
|
9158
9436
|
}
|
|
9159
9437
|
for (const note of notes) {
|
|
9160
|
-
if (!note.note)
|
|
9438
|
+
if (!note.note)
|
|
9439
|
+
continue;
|
|
9161
9440
|
const p = polarToXY(center, (ring.r1 + ring.r2) / 2, angleOf(model, note.degree));
|
|
9162
9441
|
push(textSvg(note.note, p, 11.8 * scale, palette.ink, tangentRotation(angleOf(model, note.degree)), "middle", 700));
|
|
9163
9442
|
}
|
|
@@ -9289,7 +9568,8 @@ function renderChromicTriangleCore(push, model) {
|
|
|
9289
9568
|
push(`<path class="archeometer-chromic-foundation" data-triangle="divineFire" d="${path(move(272.7, 137.047), line(69.2251, 254.523), line(69.2251, 19.5703), "Z")}" fill="${escapeAttr(divineFire?.fill ?? "#CC58A1")}" stroke="${escapeAttr(palette.ink)}" stroke-width="${strokeWidth}"/>`);
|
|
9290
9569
|
push(`<path class="archeometer-chromic-foundation" data-triangle="mary" d="${path(move(137.05, 272.702), line(19.5737, 69.2266), line(254.527, 69.2266), "Z")}" fill="${escapeAttr(mary?.fill ?? "#E25B61")}" stroke="${escapeAttr(palette.ink)}" stroke-width="${strokeWidth}"/>`);
|
|
9291
9570
|
for (const triangle of [ether, divineFire, mary]) {
|
|
9292
|
-
if (!triangle?.vertexFills)
|
|
9571
|
+
if (!triangle?.vertexFills)
|
|
9572
|
+
continue;
|
|
9293
9573
|
const vertices = triangle.vertices.map((degree) => polarToXY(center, chromicOuter, angleOf(model, degree)));
|
|
9294
9574
|
const centroid = polygonCentroid(vertices);
|
|
9295
9575
|
const midpoints = vertices.map((vertex, index) => midpoint(vertex, vertices[(index + 1) % vertices.length]));
|
|
@@ -9330,7 +9610,8 @@ function renderWhiteRays(push, model) {
|
|
|
9330
9610
|
const sunCenterCircleRadiusWithPadding = 3 + 0.3;
|
|
9331
9611
|
push(`<g id="archeometer-white-rays" aria-label="crown of white rays and musical staff">`);
|
|
9332
9612
|
for (let degree = 0; degree < 180; degree += 30) {
|
|
9333
|
-
if (degree === 90 || degree === 270)
|
|
9613
|
+
if (degree === 90 || degree === 270)
|
|
9614
|
+
continue;
|
|
9334
9615
|
push(lineSvg(lineFromPolar(center, solarRadius, sunCenterCircleRadiusWithPadding, angleOf(model, degree)), palette.whiteRay, 1.55 * scale, 0.92));
|
|
9335
9616
|
push(lineSvg(lineFromPolar(center, solarRadius, sunCenterCircleRadiusWithPadding, angleOf(model, degree + 180)), palette.whiteRay, 1.55 * scale, 0.92));
|
|
9336
9617
|
}
|
|
@@ -9376,7 +9657,8 @@ function renderFrame(push, model) {
|
|
|
9376
9657
|
);
|
|
9377
9658
|
push(`<g id="archeometer-frame" aria-hidden="true">`);
|
|
9378
9659
|
for (const radius of radii) {
|
|
9379
|
-
if (radius <= 0)
|
|
9660
|
+
if (radius <= 0)
|
|
9661
|
+
continue;
|
|
9380
9662
|
push(
|
|
9381
9663
|
`<circle cx="${fmt(center.x)}" cy="${fmt(center.y)}" r="${fmt(radius)}" fill="none" stroke="${escapeAttr(
|
|
9382
9664
|
palette.ringStroke
|
|
@@ -9513,7 +9795,8 @@ function arcSegmentPath(center, radius, startAngle, endAngle) {
|
|
|
9513
9795
|
return `M ${fmt(start.x)} ${fmt(start.y)} A ${fmt(radius)} ${fmt(radius)} 0 0 1 ${fmt(end.x)} ${fmt(end.y)}`;
|
|
9514
9796
|
}
|
|
9515
9797
|
function polygonPath(points) {
|
|
9516
|
-
if (points.length === 0)
|
|
9798
|
+
if (points.length === 0)
|
|
9799
|
+
return "";
|
|
9517
9800
|
const [first, ...rest] = points;
|
|
9518
9801
|
return [`M ${fmt(first.x)} ${fmt(first.y)}`, ...rest.map((p) => `L ${fmt(p.x)} ${fmt(p.y)}`), "Z"].join(" ");
|
|
9519
9802
|
}
|
|
@@ -9544,7 +9827,8 @@ function nearestUtterance(degree, utterance) {
|
|
|
9544
9827
|
}
|
|
9545
9828
|
function triangleVertexFillForDegree(model, degree) {
|
|
9546
9829
|
for (const triangle of model.triangles) {
|
|
9547
|
-
if (!triangle.vertexFills)
|
|
9830
|
+
if (!triangle.vertexFills)
|
|
9831
|
+
continue;
|
|
9548
9832
|
for (const [index, vertexDegree] of triangle.vertices.entries()) {
|
|
9549
9833
|
if (Math.abs(shortestAngularDistance(degree, vertexDegree)) < 1e-3) {
|
|
9550
9834
|
return triangle.vertexFills[index];
|
|
@@ -9556,7 +9840,8 @@ function triangleVertexFillForDegree(model, degree) {
|
|
|
9556
9840
|
function tangentRotation(angleRad) {
|
|
9557
9841
|
let degrees = rad2deg(angleRad) + 90;
|
|
9558
9842
|
degrees = (degrees % 360 + 360) % 360;
|
|
9559
|
-
if (degrees > 90 && degrees < 270)
|
|
9843
|
+
if (degrees > 90 && degrees < 270)
|
|
9844
|
+
degrees += 180;
|
|
9560
9845
|
return (degrees % 360 + 360) % 360;
|
|
9561
9846
|
}
|
|
9562
9847
|
function shortestAngularDistance(a, b) {
|
|
@@ -9575,7 +9860,8 @@ function round(value) {
|
|
|
9575
9860
|
return Math.round(value * 1e3) / 1e3;
|
|
9576
9861
|
}
|
|
9577
9862
|
function fmt(value) {
|
|
9578
|
-
if (!Number.isFinite(value))
|
|
9863
|
+
if (!Number.isFinite(value))
|
|
9864
|
+
return "0";
|
|
9579
9865
|
return Number.isInteger(value) ? String(value) : value.toFixed(3).replace(/0+$/, "").replace(/\.$/, "");
|
|
9580
9866
|
}
|
|
9581
9867
|
function escapeAttr(value) {
|
|
@@ -9881,7 +10167,8 @@ function listAstroGlyphs(category) {
|
|
|
9881
10167
|
const seen = /* @__PURE__ */ new Set();
|
|
9882
10168
|
return Object.values(ASTRO_GLYPHS).filter((glyph) => {
|
|
9883
10169
|
const id2 = `${glyph.category}:${glyph.key}`;
|
|
9884
|
-
if (seen.has(id2))
|
|
10170
|
+
if (seen.has(id2))
|
|
10171
|
+
return false;
|
|
9885
10172
|
seen.add(id2);
|
|
9886
10173
|
return category ? glyph.category === category : true;
|
|
9887
10174
|
});
|
|
@@ -10445,8 +10732,10 @@ function renderAngleGlyph(push, marker, model) {
|
|
|
10445
10732
|
push(`</g>`);
|
|
10446
10733
|
}
|
|
10447
10734
|
function angleDisplayLabel(key) {
|
|
10448
|
-
if (key === "ASC")
|
|
10449
|
-
|
|
10735
|
+
if (key === "ASC")
|
|
10736
|
+
return "AC";
|
|
10737
|
+
if (key === "DSC")
|
|
10738
|
+
return "DC";
|
|
10450
10739
|
return key;
|
|
10451
10740
|
}
|
|
10452
10741
|
function renderPointLabelGroup(push, point, model) {
|
|
@@ -14812,13 +15101,13 @@ function loadHermeticQabalah(tree) {
|
|
|
14812
15101
|
}
|
|
14813
15102
|
];
|
|
14814
15103
|
for (const path of paths) {
|
|
14815
|
-
const
|
|
15104
|
+
const pathId = tree.addPath({
|
|
14816
15105
|
leftSphere: path.leftSphere,
|
|
14817
15106
|
rightSphere: path.rightSphere,
|
|
14818
15107
|
relatedNumber: path.relatedNumber
|
|
14819
15108
|
});
|
|
14820
15109
|
tree.addLetters({
|
|
14821
|
-
path:
|
|
15110
|
+
path: pathId,
|
|
14822
15111
|
letters: path.letters
|
|
14823
15112
|
});
|
|
14824
15113
|
}
|
|
@@ -16151,14 +16440,14 @@ var init_kaabalah = __esm({
|
|
|
16151
16440
|
}
|
|
16152
16441
|
];
|
|
16153
16442
|
for (const path of paths) {
|
|
16154
|
-
const
|
|
16443
|
+
const pathId = tree.addPath({
|
|
16155
16444
|
leftSphere: path.leftSphere,
|
|
16156
16445
|
rightSphere: path.rightSphere,
|
|
16157
16446
|
relatedNumber: path.relatedNumber,
|
|
16158
16447
|
data: path.data
|
|
16159
16448
|
});
|
|
16160
16449
|
tree.addLetters({
|
|
16161
|
-
path:
|
|
16450
|
+
path: pathId,
|
|
16162
16451
|
letters: path.letters
|
|
16163
16452
|
});
|
|
16164
16453
|
}
|
|
@@ -18478,13 +18767,13 @@ function loadLurianicKabbalah(tree) {
|
|
|
18478
18767
|
}
|
|
18479
18768
|
];
|
|
18480
18769
|
for (const path of paths) {
|
|
18481
|
-
const
|
|
18770
|
+
const pathId = tree.addPath({
|
|
18482
18771
|
leftSphere: path.leftSphere,
|
|
18483
18772
|
rightSphere: path.rightSphere,
|
|
18484
18773
|
relatedNumber: path.relatedNumber
|
|
18485
18774
|
});
|
|
18486
18775
|
tree.addLetters({
|
|
18487
|
-
path:
|
|
18776
|
+
path: pathId,
|
|
18488
18777
|
letters: path.letters
|
|
18489
18778
|
});
|
|
18490
18779
|
}
|
|
@@ -18940,7 +19229,8 @@ var init_tree_of_life = __esm({
|
|
|
18940
19229
|
* @param id - the id of the node to remove
|
|
18941
19230
|
*/
|
|
18942
19231
|
removeNode(id2) {
|
|
18943
|
-
if (!this.nodes.has(id2))
|
|
19232
|
+
if (!this.nodes.has(id2))
|
|
19233
|
+
return;
|
|
18944
19234
|
const neighbors = this.adjacent.get(id2);
|
|
18945
19235
|
if (neighbors) {
|
|
18946
19236
|
for (const neighbor of neighbors) {
|
|
@@ -19004,7 +19294,7 @@ var init_tree_of_life = __esm({
|
|
|
19004
19294
|
relatedNumber,
|
|
19005
19295
|
data
|
|
19006
19296
|
}) {
|
|
19007
|
-
const
|
|
19297
|
+
const pathId = this.upsertNode(
|
|
19008
19298
|
new BaseNode({
|
|
19009
19299
|
id: relatedNumber,
|
|
19010
19300
|
type: "path" /* PATH */,
|
|
@@ -19017,11 +19307,11 @@ var init_tree_of_life = __esm({
|
|
|
19017
19307
|
);
|
|
19018
19308
|
const numberOfSpheres = 10;
|
|
19019
19309
|
const pathNumber = relatedNumber + numberOfSpheres;
|
|
19020
|
-
this.link(leftSphere,
|
|
19021
|
-
this.link(rightSphere,
|
|
19022
|
-
this.addNumber({ number: relatedNumber, nodeId:
|
|
19023
|
-
this.addNumber({ number: pathNumber, nodeId:
|
|
19024
|
-
return
|
|
19310
|
+
this.link(leftSphere, pathId);
|
|
19311
|
+
this.link(rightSphere, pathId);
|
|
19312
|
+
this.addNumber({ number: relatedNumber, nodeId: pathId });
|
|
19313
|
+
this.addNumber({ number: pathNumber, nodeId: pathId });
|
|
19314
|
+
return pathId;
|
|
19025
19315
|
}
|
|
19026
19316
|
addLetters({
|
|
19027
19317
|
path,
|
|
@@ -19131,6 +19421,343 @@ var init_factory = __esm({
|
|
|
19131
19421
|
}
|
|
19132
19422
|
});
|
|
19133
19423
|
|
|
19424
|
+
// src/core/topology.ts
|
|
19425
|
+
function isNodeType(node, type) {
|
|
19426
|
+
return node.type === type;
|
|
19427
|
+
}
|
|
19428
|
+
function cloneSphereData(data) {
|
|
19429
|
+
return data ? { ...data } : void 0;
|
|
19430
|
+
}
|
|
19431
|
+
function clonePathData(data) {
|
|
19432
|
+
return { ...data };
|
|
19433
|
+
}
|
|
19434
|
+
function parsePathNumber(pathId) {
|
|
19435
|
+
const parsed = Number.parseInt(parseId(pathId), 10);
|
|
19436
|
+
if (!Number.isInteger(parsed)) {
|
|
19437
|
+
throw new Error(`Invalid tree path id: ${pathId}`);
|
|
19438
|
+
}
|
|
19439
|
+
return parsed;
|
|
19440
|
+
}
|
|
19441
|
+
function normalizeName(value) {
|
|
19442
|
+
return value.trim().toLowerCase();
|
|
19443
|
+
}
|
|
19444
|
+
function pairKey(left, right) {
|
|
19445
|
+
return [String(left), String(right)].sort().join("|");
|
|
19446
|
+
}
|
|
19447
|
+
function routeNames() {
|
|
19448
|
+
return [...TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES];
|
|
19449
|
+
}
|
|
19450
|
+
function routeDescriptor(key) {
|
|
19451
|
+
return key === "lightning" ? {
|
|
19452
|
+
name: "Lightning Path",
|
|
19453
|
+
direction: "descending"
|
|
19454
|
+
} : {
|
|
19455
|
+
name: "Serpent Path",
|
|
19456
|
+
direction: "ascending"
|
|
19457
|
+
};
|
|
19458
|
+
}
|
|
19459
|
+
function routeTargetList(segments) {
|
|
19460
|
+
if (segments.length === 0) {
|
|
19461
|
+
return [];
|
|
19462
|
+
}
|
|
19463
|
+
const targets = [
|
|
19464
|
+
{ targetId: segments[0].from.id, targetType: "sphere" }
|
|
19465
|
+
];
|
|
19466
|
+
for (const segment of segments) {
|
|
19467
|
+
if (segment.path) {
|
|
19468
|
+
targets.push({ targetId: segment.path.id, targetType: "path" });
|
|
19469
|
+
}
|
|
19470
|
+
targets.push({ targetId: segment.to.id, targetType: "sphere" });
|
|
19471
|
+
}
|
|
19472
|
+
return targets;
|
|
19473
|
+
}
|
|
19474
|
+
function getTreeTopology(options = {}) {
|
|
19475
|
+
const system = options.system ?? options.tree?.activeSystem ?? "kaabalah";
|
|
19476
|
+
const tree = options.tree ?? createTree({ system });
|
|
19477
|
+
const spheres = [];
|
|
19478
|
+
for (const sphereId2 of TREE_TOPOLOGY_SPHERE_IDS) {
|
|
19479
|
+
const sphereNode = tree.getNode(sphereId2);
|
|
19480
|
+
if (!sphereNode) {
|
|
19481
|
+
continue;
|
|
19482
|
+
}
|
|
19483
|
+
const name = parseId(sphereId2);
|
|
19484
|
+
spheres.push({
|
|
19485
|
+
id: sphereId2,
|
|
19486
|
+
name,
|
|
19487
|
+
number: TREE_TOPOLOGY_SPHERE_NUMBERS[name],
|
|
19488
|
+
role: name === SPHERES.DAATH ? "hidden" : "sephirah",
|
|
19489
|
+
data: cloneSphereData(sphereNode.data)
|
|
19490
|
+
});
|
|
19491
|
+
}
|
|
19492
|
+
const spheresById = new Map(spheres.map((sphere) => [sphere.id, sphere]));
|
|
19493
|
+
const paths = tree.getNodes().filter(
|
|
19494
|
+
(node) => isNodeType(node, "path" /* PATH */)
|
|
19495
|
+
).map((pathNode) => {
|
|
19496
|
+
if (!pathNode.data?.from || !pathNode.data?.to) {
|
|
19497
|
+
throw new Error(`Tree topology path ${pathNode.id} is missing endpoints.`);
|
|
19498
|
+
}
|
|
19499
|
+
const from = spheresById.get(pathNode.data.from);
|
|
19500
|
+
const to = spheresById.get(pathNode.data.to);
|
|
19501
|
+
if (!from || !to) {
|
|
19502
|
+
throw new Error(
|
|
19503
|
+
`Tree topology path ${pathNode.id} references unknown spheres.`
|
|
19504
|
+
);
|
|
19505
|
+
}
|
|
19506
|
+
return {
|
|
19507
|
+
id: pathNode.id,
|
|
19508
|
+
number: parsePathNumber(pathNode.id),
|
|
19509
|
+
from,
|
|
19510
|
+
to,
|
|
19511
|
+
data: clonePathData(pathNode.data)
|
|
19512
|
+
};
|
|
19513
|
+
}).sort((left, right) => left.number - right.number);
|
|
19514
|
+
return new TreeTopology({
|
|
19515
|
+
system,
|
|
19516
|
+
spheres,
|
|
19517
|
+
paths
|
|
19518
|
+
});
|
|
19519
|
+
}
|
|
19520
|
+
var TREE_TOPOLOGY_SPHERE_NAMES, TREE_TOPOLOGY_SPHERE_IDS, TREE_TOPOLOGY_PATH_IDS, TREE_TOPOLOGY_SPHERE_NUMBERS, TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES, TreeTopology;
|
|
19521
|
+
var init_topology = __esm({
|
|
19522
|
+
"src/core/topology.ts"() {
|
|
19523
|
+
"use strict";
|
|
19524
|
+
init_constants();
|
|
19525
|
+
init_factory();
|
|
19526
|
+
init_types();
|
|
19527
|
+
TREE_TOPOLOGY_SPHERE_NAMES = [
|
|
19528
|
+
SPHERES.KETHER,
|
|
19529
|
+
SPHERES.CHOKHMAH,
|
|
19530
|
+
SPHERES.BINAH,
|
|
19531
|
+
SPHERES.DAATH,
|
|
19532
|
+
SPHERES.CHESED,
|
|
19533
|
+
SPHERES.GEBURAH,
|
|
19534
|
+
SPHERES.TIPHARETH,
|
|
19535
|
+
SPHERES.NETZACH,
|
|
19536
|
+
SPHERES.HOD,
|
|
19537
|
+
SPHERES.YESOD,
|
|
19538
|
+
SPHERES.MALKUTH
|
|
19539
|
+
];
|
|
19540
|
+
TREE_TOPOLOGY_SPHERE_IDS = TREE_TOPOLOGY_SPHERE_NAMES.map(
|
|
19541
|
+
(name) => id("sphere" /* SPHERE */, name)
|
|
19542
|
+
);
|
|
19543
|
+
TREE_TOPOLOGY_PATH_IDS = Array.from(
|
|
19544
|
+
{ length: 22 },
|
|
19545
|
+
(_, index) => id("path" /* PATH */, index + 1)
|
|
19546
|
+
);
|
|
19547
|
+
TREE_TOPOLOGY_SPHERE_NUMBERS = {
|
|
19548
|
+
[SPHERES.KETHER]: 1,
|
|
19549
|
+
[SPHERES.CHOKHMAH]: 2,
|
|
19550
|
+
[SPHERES.BINAH]: 3,
|
|
19551
|
+
[SPHERES.DAATH]: 11,
|
|
19552
|
+
[SPHERES.CHESED]: 4,
|
|
19553
|
+
[SPHERES.GEBURAH]: 5,
|
|
19554
|
+
[SPHERES.TIPHARETH]: 6,
|
|
19555
|
+
[SPHERES.NETZACH]: 7,
|
|
19556
|
+
[SPHERES.HOD]: 8,
|
|
19557
|
+
[SPHERES.YESOD]: 9,
|
|
19558
|
+
[SPHERES.MALKUTH]: 10
|
|
19559
|
+
};
|
|
19560
|
+
TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES = [
|
|
19561
|
+
SPHERES.KETHER,
|
|
19562
|
+
SPHERES.CHOKHMAH,
|
|
19563
|
+
SPHERES.BINAH,
|
|
19564
|
+
SPHERES.CHESED,
|
|
19565
|
+
SPHERES.GEBURAH,
|
|
19566
|
+
SPHERES.TIPHARETH,
|
|
19567
|
+
SPHERES.NETZACH,
|
|
19568
|
+
SPHERES.HOD,
|
|
19569
|
+
SPHERES.YESOD,
|
|
19570
|
+
SPHERES.MALKUTH
|
|
19571
|
+
];
|
|
19572
|
+
TreeTopology = class {
|
|
19573
|
+
constructor({
|
|
19574
|
+
system,
|
|
19575
|
+
spheres,
|
|
19576
|
+
paths
|
|
19577
|
+
}) {
|
|
19578
|
+
this.spheresById = /* @__PURE__ */ new Map();
|
|
19579
|
+
this.spheresByName = /* @__PURE__ */ new Map();
|
|
19580
|
+
this.spheresByNumber = /* @__PURE__ */ new Map();
|
|
19581
|
+
this.pathsById = /* @__PURE__ */ new Map();
|
|
19582
|
+
this.pathsByNumber = /* @__PURE__ */ new Map();
|
|
19583
|
+
this.pathsBySpherePair = /* @__PURE__ */ new Map();
|
|
19584
|
+
this.routesByKey = /* @__PURE__ */ new Map();
|
|
19585
|
+
this.system = system;
|
|
19586
|
+
this.spheres = spheres.map(
|
|
19587
|
+
(sphere) => Object.freeze({
|
|
19588
|
+
...sphere,
|
|
19589
|
+
data: cloneSphereData(sphere.data)
|
|
19590
|
+
})
|
|
19591
|
+
);
|
|
19592
|
+
for (const sphere of this.spheres) {
|
|
19593
|
+
this.spheresById.set(sphere.id, sphere);
|
|
19594
|
+
this.spheresByName.set(normalizeName(sphere.name), sphere);
|
|
19595
|
+
this.spheresByNumber.set(sphere.number, sphere);
|
|
19596
|
+
}
|
|
19597
|
+
this.paths = paths.map((path) => {
|
|
19598
|
+
const from = this.spheresById.get(path.from.id);
|
|
19599
|
+
const to = this.spheresById.get(path.to.id);
|
|
19600
|
+
if (!from || !to) {
|
|
19601
|
+
throw new Error(
|
|
19602
|
+
`Tree topology path ${path.id} references unknown spheres.`
|
|
19603
|
+
);
|
|
19604
|
+
}
|
|
19605
|
+
return Object.freeze({
|
|
19606
|
+
...path,
|
|
19607
|
+
from,
|
|
19608
|
+
to,
|
|
19609
|
+
data: clonePathData(path.data)
|
|
19610
|
+
});
|
|
19611
|
+
});
|
|
19612
|
+
for (const path of this.paths) {
|
|
19613
|
+
this.pathsById.set(path.id, path);
|
|
19614
|
+
this.pathsByNumber.set(path.number, path);
|
|
19615
|
+
this.pathsBySpherePair.set(pairKey(path.from.id, path.to.id), path);
|
|
19616
|
+
}
|
|
19617
|
+
for (const key of ["lightning", "serpent"]) {
|
|
19618
|
+
this.routesByKey.set(key, this.buildRoute(key));
|
|
19619
|
+
}
|
|
19620
|
+
}
|
|
19621
|
+
getSpheres(options = {}) {
|
|
19622
|
+
const includeDaath = options.includeDaath ?? true;
|
|
19623
|
+
return includeDaath ? [...this.spheres] : this.spheres.filter((sphere) => sphere.name !== SPHERES.DAATH);
|
|
19624
|
+
}
|
|
19625
|
+
getPrimarySpheres() {
|
|
19626
|
+
return this.getSpheres({ includeDaath: false });
|
|
19627
|
+
}
|
|
19628
|
+
getSphere(lookup) {
|
|
19629
|
+
if (typeof lookup === "string") {
|
|
19630
|
+
if (lookup.startsWith(`${"sphere" /* SPHERE */}:`)) {
|
|
19631
|
+
return this.spheresById.get(lookup);
|
|
19632
|
+
}
|
|
19633
|
+
return this.spheresByName.get(normalizeName(lookup));
|
|
19634
|
+
}
|
|
19635
|
+
if (lookup.id) {
|
|
19636
|
+
return this.spheresById.get(lookup.id);
|
|
19637
|
+
}
|
|
19638
|
+
if (lookup.number) {
|
|
19639
|
+
return this.spheresByNumber.get(lookup.number);
|
|
19640
|
+
}
|
|
19641
|
+
if (lookup.name) {
|
|
19642
|
+
return this.spheresByName.get(normalizeName(lookup.name));
|
|
19643
|
+
}
|
|
19644
|
+
return void 0;
|
|
19645
|
+
}
|
|
19646
|
+
getPaths() {
|
|
19647
|
+
return [...this.paths];
|
|
19648
|
+
}
|
|
19649
|
+
getPath(lookup) {
|
|
19650
|
+
if (typeof lookup === "number") {
|
|
19651
|
+
return this.pathsByNumber.get(lookup);
|
|
19652
|
+
}
|
|
19653
|
+
if (typeof lookup === "string") {
|
|
19654
|
+
return this.pathsById.get(lookup);
|
|
19655
|
+
}
|
|
19656
|
+
if (lookup.id) {
|
|
19657
|
+
return this.pathsById.get(lookup.id);
|
|
19658
|
+
}
|
|
19659
|
+
if (lookup.number) {
|
|
19660
|
+
return this.pathsByNumber.get(lookup.number);
|
|
19661
|
+
}
|
|
19662
|
+
if (lookup.between) {
|
|
19663
|
+
return this.getPathBetween(lookup.between[0], lookup.between[1]);
|
|
19664
|
+
}
|
|
19665
|
+
return void 0;
|
|
19666
|
+
}
|
|
19667
|
+
getPathBetween(first, second) {
|
|
19668
|
+
const firstSphere = this.getSphere(first);
|
|
19669
|
+
const secondSphere = this.getSphere(second);
|
|
19670
|
+
if (!firstSphere || !secondSphere) {
|
|
19671
|
+
return void 0;
|
|
19672
|
+
}
|
|
19673
|
+
return this.pathsBySpherePair.get(pairKey(firstSphere.id, secondSphere.id));
|
|
19674
|
+
}
|
|
19675
|
+
getAdjacentSpheres(sphereLookup) {
|
|
19676
|
+
const sphere = this.getSphere(sphereLookup);
|
|
19677
|
+
if (!sphere) {
|
|
19678
|
+
return [];
|
|
19679
|
+
}
|
|
19680
|
+
return this.paths.filter((path) => path.from.id === sphere.id || path.to.id === sphere.id).map((path) => {
|
|
19681
|
+
const isForward = path.from.id === sphere.id;
|
|
19682
|
+
return {
|
|
19683
|
+
sphere: isForward ? path.to : path.from,
|
|
19684
|
+
path,
|
|
19685
|
+
direction: isForward ? "forward" : "reverse"
|
|
19686
|
+
};
|
|
19687
|
+
});
|
|
19688
|
+
}
|
|
19689
|
+
getRoutes() {
|
|
19690
|
+
return [...this.routesByKey.values()];
|
|
19691
|
+
}
|
|
19692
|
+
getRoute(key) {
|
|
19693
|
+
return this.routesByKey.get(key);
|
|
19694
|
+
}
|
|
19695
|
+
nextInRoute(routeKey, sphereLookup) {
|
|
19696
|
+
const route = this.getRoute(routeKey);
|
|
19697
|
+
const sphere = this.getSphere(sphereLookup);
|
|
19698
|
+
if (!route || !sphere) {
|
|
19699
|
+
return void 0;
|
|
19700
|
+
}
|
|
19701
|
+
const index = route.spheres.findIndex(
|
|
19702
|
+
(routeSphere) => routeSphere.id === sphere.id
|
|
19703
|
+
);
|
|
19704
|
+
return index >= 0 ? route.spheres[index + 1] : void 0;
|
|
19705
|
+
}
|
|
19706
|
+
previousInRoute(routeKey, sphereLookup) {
|
|
19707
|
+
const route = this.getRoute(routeKey);
|
|
19708
|
+
const sphere = this.getSphere(sphereLookup);
|
|
19709
|
+
if (!route || !sphere) {
|
|
19710
|
+
return void 0;
|
|
19711
|
+
}
|
|
19712
|
+
const index = route.spheres.findIndex(
|
|
19713
|
+
(routeSphere) => routeSphere.id === sphere.id
|
|
19714
|
+
);
|
|
19715
|
+
return index > 0 ? route.spheres[index - 1] : void 0;
|
|
19716
|
+
}
|
|
19717
|
+
buildRoute(key) {
|
|
19718
|
+
const descriptor = routeDescriptor(key);
|
|
19719
|
+
const names = routeNames();
|
|
19720
|
+
const orderedNames = key === "serpent" ? names.reverse() : names;
|
|
19721
|
+
const spheres = orderedNames.map((name) => {
|
|
19722
|
+
const sphere = this.getSphere(name);
|
|
19723
|
+
if (!sphere) {
|
|
19724
|
+
throw new Error(
|
|
19725
|
+
`Tree topology route "${key}" references missing sphere "${name}" in ${this.system}.`
|
|
19726
|
+
);
|
|
19727
|
+
}
|
|
19728
|
+
return sphere;
|
|
19729
|
+
});
|
|
19730
|
+
const segments = [];
|
|
19731
|
+
for (let index = 0; index < spheres.length - 1; index++) {
|
|
19732
|
+
const from = spheres[index];
|
|
19733
|
+
const to = spheres[index + 1];
|
|
19734
|
+
const path = this.getPathBetween(from.name, to.name);
|
|
19735
|
+
segments.push({
|
|
19736
|
+
index,
|
|
19737
|
+
from,
|
|
19738
|
+
to,
|
|
19739
|
+
path,
|
|
19740
|
+
isConnected: Boolean(path)
|
|
19741
|
+
});
|
|
19742
|
+
}
|
|
19743
|
+
const targets = routeTargetList(segments);
|
|
19744
|
+
const missingSegments = segments.filter((segment) => !segment.isConnected);
|
|
19745
|
+
return Object.freeze({
|
|
19746
|
+
key,
|
|
19747
|
+
name: descriptor.name,
|
|
19748
|
+
direction: descriptor.direction,
|
|
19749
|
+
spheres: Object.freeze([...spheres]),
|
|
19750
|
+
segments: Object.freeze(segments),
|
|
19751
|
+
isFullyConnected: missingSegments.length === 0,
|
|
19752
|
+
missingSegments: Object.freeze(missingSegments),
|
|
19753
|
+
targets: Object.freeze(targets),
|
|
19754
|
+
targetIds: Object.freeze(targets.map((target) => target.targetId))
|
|
19755
|
+
});
|
|
19756
|
+
}
|
|
19757
|
+
};
|
|
19758
|
+
}
|
|
19759
|
+
});
|
|
19760
|
+
|
|
19134
19761
|
// src/core/workspace.ts
|
|
19135
19762
|
function cloneNode(node) {
|
|
19136
19763
|
return Object.freeze({
|
|
@@ -19667,6 +20294,7 @@ var init_core = __esm({
|
|
|
19667
20294
|
init_correspondence_model();
|
|
19668
20295
|
init_factory();
|
|
19669
20296
|
init_registry();
|
|
20297
|
+
init_topology();
|
|
19670
20298
|
init_tree_of_life();
|
|
19671
20299
|
init_types();
|
|
19672
20300
|
init_workspace();
|
|
@@ -20547,7 +21175,7 @@ function resolveDualToneFill(fill) {
|
|
|
20547
21175
|
function escapeAttr3(value) {
|
|
20548
21176
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
20549
21177
|
}
|
|
20550
|
-
var TREE_SVG_DEFAULT_VIEWBOX, TREE_SPHERE_NAMES,
|
|
21178
|
+
var TREE_SVG_DEFAULT_VIEWBOX, TREE_SPHERE_NAMES, CANONICAL_X_PERCENTAGES, CANONICAL_ROW_Y_PERCENTAGES, DEFAULT_SPHERE_RADIUS, DEFAULT_PATH_EDGE_WIDTH, DEFAULT_PATH_MAIN_WIDTH, DEFAULT_PATH_HIGHLIGHT_WIDTH, DEFAULT_SPHERE_HIT_RADIUS, DEFAULT_PATH_HIT_STROKE_WIDTH, MUTED_TARGET_COLOR, sphereId, TREE_SPHERE_IDS, TREE_PATH_IDS, CANONICAL_SPHERE_PERCENTAGES;
|
|
20551
21179
|
var init_tree = __esm({
|
|
20552
21180
|
"src/visual/tree.ts"() {
|
|
20553
21181
|
"use strict";
|
|
@@ -20559,19 +21187,8 @@ var init_tree = __esm({
|
|
|
20559
21187
|
height: 561
|
|
20560
21188
|
};
|
|
20561
21189
|
TREE_SPHERE_NAMES = [
|
|
20562
|
-
|
|
20563
|
-
"Chokhmah",
|
|
20564
|
-
"Binah",
|
|
20565
|
-
"Daath",
|
|
20566
|
-
"Chesed",
|
|
20567
|
-
"Geburah",
|
|
20568
|
-
"Tiphareth",
|
|
20569
|
-
"Netzach",
|
|
20570
|
-
"Hod",
|
|
20571
|
-
"Yesod",
|
|
20572
|
-
"Malkuth"
|
|
21190
|
+
...TREE_TOPOLOGY_SPHERE_NAMES
|
|
20573
21191
|
];
|
|
20574
|
-
TREE_PATH_NUMBERS = Array.from({ length: 22 }, (_, index) => index + 1);
|
|
20575
21192
|
CANONICAL_X_PERCENTAGES = { left: 13.25, mid: 49.94, right: 86.66 };
|
|
20576
21193
|
CANONICAL_ROW_Y_PERCENTAGES = [
|
|
20577
21194
|
6.83,
|
|
@@ -20591,13 +21208,8 @@ var init_tree = __esm({
|
|
|
20591
21208
|
DEFAULT_PATH_HIT_STROKE_WIDTH = DEFAULT_PATH_EDGE_WIDTH + 8;
|
|
20592
21209
|
MUTED_TARGET_COLOR = "#AAA";
|
|
20593
21210
|
sphereId = (name) => id("sphere" /* SPHERE */, name);
|
|
20594
|
-
|
|
20595
|
-
|
|
20596
|
-
(name) => sphereId(name)
|
|
20597
|
-
);
|
|
20598
|
-
TREE_PATH_IDS = TREE_PATH_NUMBERS.map(
|
|
20599
|
-
(pathNumber) => pathId(pathNumber)
|
|
20600
|
-
);
|
|
21211
|
+
TREE_SPHERE_IDS = [...TREE_TOPOLOGY_SPHERE_IDS];
|
|
21212
|
+
TREE_PATH_IDS = [...TREE_TOPOLOGY_PATH_IDS];
|
|
20601
21213
|
CANONICAL_SPHERE_PERCENTAGES = {
|
|
20602
21214
|
[sphereId("Kether")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[0] },
|
|
20603
21215
|
[sphereId("Chokhmah")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[1] },
|
|
@@ -20676,7 +21288,7 @@ var import_config3 = require("dotenv/config");
|
|
|
20676
21288
|
// package.json
|
|
20677
21289
|
var package_default = {
|
|
20678
21290
|
name: "kaabalah",
|
|
20679
|
-
version: "6.
|
|
21291
|
+
version: "6.8.0",
|
|
20680
21292
|
description: "The de-facto library for any esoteric calculations and tooling",
|
|
20681
21293
|
engines: {
|
|
20682
21294
|
node: ">=18.18.0"
|
|
@@ -20795,12 +21407,12 @@ var package_default = {
|
|
|
20795
21407
|
"tz-lookup": "^6.1.25"
|
|
20796
21408
|
},
|
|
20797
21409
|
devDependencies: {
|
|
20798
|
-
"@types/node": "
|
|
20799
|
-
"@vitest/coverage-v8": "
|
|
20800
|
-
"ts-node": "
|
|
20801
|
-
tsup: "
|
|
20802
|
-
typescript: "
|
|
20803
|
-
vitest: "
|
|
21410
|
+
"@types/node": "20.11.5",
|
|
21411
|
+
"@vitest/coverage-v8": "1.3.1",
|
|
21412
|
+
"ts-node": "10.9.2",
|
|
21413
|
+
tsup: "8.0.1",
|
|
21414
|
+
typescript: "5.3.3",
|
|
21415
|
+
vitest: "1.3.1"
|
|
20804
21416
|
}
|
|
20805
21417
|
};
|
|
20806
21418
|
|
|
@@ -20979,6 +21591,20 @@ var COMMANDS = [
|
|
|
20979
21591
|
"kaabalah tree:layout --render-model --activations=activations.json --json --compact"
|
|
20980
21592
|
]
|
|
20981
21593
|
},
|
|
21594
|
+
{
|
|
21595
|
+
name: "tree:topology",
|
|
21596
|
+
description: "Return the structural Tree of Life topology, paths, and named routes",
|
|
21597
|
+
args: [],
|
|
21598
|
+
flags: [
|
|
21599
|
+
{ name: "system", type: "string", default: "kaabalah", description: "Tree system: kaabalah, hermetic-qabalah, lurianic-kabbalah" },
|
|
21600
|
+
{ name: "route", type: "string", default: "all", description: "Route filter: all, lightning, or serpent" }
|
|
21601
|
+
],
|
|
21602
|
+
examples: [
|
|
21603
|
+
"kaabalah tree:topology --json --compact",
|
|
21604
|
+
"kaabalah tree:topology --route=lightning --json --compact",
|
|
21605
|
+
"kaabalah tree:topology --system=lurianic-kabbalah --route=lightning --json --compact"
|
|
21606
|
+
]
|
|
21607
|
+
},
|
|
20982
21608
|
{
|
|
20983
21609
|
name: "tree:svg",
|
|
20984
21610
|
description: "Generate a structural Tree of Life SVG from the canonical library renderer",
|
|
@@ -23668,13 +24294,16 @@ var reduceWithMasterNumbers = (num, masterNumbers = EXTENDED_MASTER_NUMBERS) =>
|
|
|
23668
24294
|
};
|
|
23669
24295
|
};
|
|
23670
24296
|
var getLastArkAnnuStep = (steps) => {
|
|
23671
|
-
if (steps.length === 0)
|
|
24297
|
+
if (steps.length === 0)
|
|
24298
|
+
return 0;
|
|
23672
24299
|
const step = steps.sort((a, b) => b - a).find((step2) => step2 <= 22);
|
|
23673
24300
|
return step ?? steps.at(-1) ?? 0;
|
|
23674
24301
|
};
|
|
23675
24302
|
function normalizeLetter(letter) {
|
|
23676
|
-
if (letter.toUpperCase() === "\xC3")
|
|
23677
|
-
|
|
24303
|
+
if (letter.toUpperCase() === "\xC3")
|
|
24304
|
+
return "\xC3";
|
|
24305
|
+
if (letter.toUpperCase() === "\xC7")
|
|
24306
|
+
return "\xC7";
|
|
23678
24307
|
return letter.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
23679
24308
|
}
|
|
23680
24309
|
function getLetterMapping({
|
|
@@ -23791,7 +24420,8 @@ function getMissingGematriaValues(tree, includedGematriaValues) {
|
|
|
23791
24420
|
for (const hebrewLetter of Object.values(HEBREW_LETTERS)) {
|
|
23792
24421
|
const hebrewLetterId = id("hebrewLetter" /* HEBREW_LETTER */, hebrewLetter);
|
|
23793
24422
|
const hebrewLetterNode = tree.getNode(hebrewLetterId);
|
|
23794
|
-
if (!hebrewLetterNode?.data)
|
|
24423
|
+
if (!hebrewLetterNode?.data)
|
|
24424
|
+
continue;
|
|
23795
24425
|
if (!includedGematriaValues.has(hebrewLetterNode.data.gematriaValue)) {
|
|
23796
24426
|
missingGematriaValues.push({
|
|
23797
24427
|
value: hebrewLetterNode.data.gematriaValue,
|
|
@@ -23813,9 +24443,11 @@ function getMissingGematriaValues(tree, includedGematriaValues) {
|
|
|
23813
24443
|
function buildLetterInfo(tree, letter, isStarting) {
|
|
23814
24444
|
const latinLetterId = id("latinLetter" /* LATIN_LETTER */, letter);
|
|
23815
24445
|
const latinLetterNode = tree.getNode(latinLetterId);
|
|
23816
|
-
if (!latinLetterNode?.data)
|
|
24446
|
+
if (!latinLetterNode?.data)
|
|
24447
|
+
return void 0;
|
|
23817
24448
|
const mapping = getLetterMapping({ tree, letterId: latinLetterId, isStarting });
|
|
23818
|
-
if (!mapping?.data)
|
|
24449
|
+
if (!mapping?.data)
|
|
24450
|
+
return void 0;
|
|
23819
24451
|
return {
|
|
23820
24452
|
letter,
|
|
23821
24453
|
normalValue: mapping.data.gematriaValue,
|
|
@@ -23999,7 +24631,8 @@ var reverseGematria = (options, tree) => {
|
|
|
23999
24631
|
for (const letter of availableLetters) {
|
|
24000
24632
|
const isStarting = currentLength === 0;
|
|
24001
24633
|
const letterInfo = getLetterInfoCached(letter, isStarting);
|
|
24002
|
-
if (!letterInfo)
|
|
24634
|
+
if (!letterInfo)
|
|
24635
|
+
continue;
|
|
24003
24636
|
if (maxLetterRepeat !== void 0) {
|
|
24004
24637
|
const currentCount = letterCounts.get(letter) || 0;
|
|
24005
24638
|
if (currentCount >= maxLetterRepeat) {
|
|
@@ -24176,7 +24809,8 @@ function reverseGematriaAnagram(options, tree) {
|
|
|
24176
24809
|
}
|
|
24177
24810
|
const isStarting = currentInfos.length === 0;
|
|
24178
24811
|
const letterInfo = getLetterInfoCached(letter, isStarting);
|
|
24179
|
-
if (!letterInfo)
|
|
24812
|
+
if (!letterInfo)
|
|
24813
|
+
continue;
|
|
24180
24814
|
const value = letterInfo.normalValue;
|
|
24181
24815
|
const newVowelsSum = runningVowelsSum + (letterInfo.isVowel ? value : 0);
|
|
24182
24816
|
const newConsonantsSum = runningConsonantsSum + (letterInfo.isVowel ? 0 : value);
|
|
@@ -24354,7 +24988,8 @@ function reverseGematriaFromSubsequence(options, tree) {
|
|
|
24354
24988
|
}
|
|
24355
24989
|
const isStarting = currentInfos.length === 0;
|
|
24356
24990
|
const letterInfo = getLetterInfoCached(letter, isStarting);
|
|
24357
|
-
if (!letterInfo)
|
|
24991
|
+
if (!letterInfo)
|
|
24992
|
+
return;
|
|
24358
24993
|
const value = letterInfo.normalValue;
|
|
24359
24994
|
const newVowelsSum = runningVowelsSum + (letterInfo.isVowel ? value : 0);
|
|
24360
24995
|
const newConsonantsSum = runningConsonantsSum + (letterInfo.isVowel ? 0 : value);
|
|
@@ -24415,13 +25050,16 @@ function reverseGematriaFromSubsequence(options, tree) {
|
|
|
24415
25050
|
totalFound
|
|
24416
25051
|
};
|
|
24417
25052
|
}
|
|
25053
|
+
function ensureTreeExists(tree) {
|
|
25054
|
+
if (!tree)
|
|
25055
|
+
return createTree({ system: SYSTEM2, parts: [] });
|
|
25056
|
+
return tree;
|
|
25057
|
+
}
|
|
24418
25058
|
var calculateGematria = (phrase, options = {
|
|
24419
25059
|
missing: false,
|
|
24420
25060
|
percentages: false
|
|
24421
25061
|
}, tree) => {
|
|
24422
|
-
|
|
24423
|
-
tree = createTree({ system: SYSTEM2, parts: [] });
|
|
24424
|
-
}
|
|
25062
|
+
const treeForMappings = ensureTreeExists(tree);
|
|
24425
25063
|
const words = phrase.toUpperCase().trim().split(" ");
|
|
24426
25064
|
const initialState = {
|
|
24427
25065
|
includedLetters: [],
|
|
@@ -24430,7 +25068,7 @@ var calculateGematria = (phrase, options = {
|
|
|
24430
25068
|
includedGematriaValues: /* @__PURE__ */ new Set()
|
|
24431
25069
|
};
|
|
24432
25070
|
const finalState = words.reduce((state, word) => {
|
|
24433
|
-
const wordResult = processWord(word,
|
|
25071
|
+
const wordResult = processWord(word, treeForMappings);
|
|
24434
25072
|
return {
|
|
24435
25073
|
includedLetters: [...state.includedLetters, ...wordResult.letters],
|
|
24436
25074
|
vowelsSum: state.vowelsSum + wordResult.vowelsSum,
|
|
@@ -24448,7 +25086,7 @@ var calculateGematria = (phrase, options = {
|
|
|
24448
25086
|
};
|
|
24449
25087
|
if (options?.percentages) {
|
|
24450
25088
|
letterPercentages = words.reduce((acc, word) => {
|
|
24451
|
-
return calculateLetterPercentages(word,
|
|
25089
|
+
return calculateLetterPercentages(word, treeForMappings, acc);
|
|
24452
25090
|
}, letterPercentages);
|
|
24453
25091
|
}
|
|
24454
25092
|
const vowelsReduction = reduceToSingleDigitWithSteps(finalState.vowelsSum);
|
|
@@ -24458,7 +25096,7 @@ var calculateGematria = (phrase, options = {
|
|
|
24458
25096
|
const synthesisReduction = reduceToSingleDigitWithSteps(
|
|
24459
25097
|
getLastArkAnnuStep(vowelsReduction.steps) + getLastArkAnnuStep(consonantsReduction.steps)
|
|
24460
25098
|
);
|
|
24461
|
-
const missingGematriaValues = options?.missing ? getMissingGematriaValues(
|
|
25099
|
+
const missingGematriaValues = options?.missing ? getMissingGematriaValues(treeForMappings, finalState.includedGematriaValues) : void 0;
|
|
24462
25100
|
return {
|
|
24463
25101
|
vowels: {
|
|
24464
25102
|
originalSum: finalState.vowelsSum,
|
|
@@ -25265,8 +25903,10 @@ function diffInPersonalMonths(birthDate, today) {
|
|
|
25265
25903
|
if (today.getDate() < birthDate.getDate()) {
|
|
25266
25904
|
k -= 1;
|
|
25267
25905
|
}
|
|
25268
|
-
if (k < 0)
|
|
25269
|
-
|
|
25906
|
+
if (k < 0)
|
|
25907
|
+
k = 0;
|
|
25908
|
+
if (k > 12)
|
|
25909
|
+
k = 12;
|
|
25270
25910
|
return k;
|
|
25271
25911
|
}
|
|
25272
25912
|
function calculatePersonalMonths(birthDate, personalYear, today) {
|
|
@@ -27315,6 +27955,74 @@ function serializeRenderModel(model) {
|
|
|
27315
27955
|
pathById: model.pathById
|
|
27316
27956
|
};
|
|
27317
27957
|
}
|
|
27958
|
+
function serializeTopologySphere(sphere) {
|
|
27959
|
+
const result = {
|
|
27960
|
+
id: sphere.id,
|
|
27961
|
+
name: sphere.name,
|
|
27962
|
+
number: sphere.number,
|
|
27963
|
+
role: sphere.role
|
|
27964
|
+
};
|
|
27965
|
+
if (sphere.data && Object.keys(sphere.data).length > 0) {
|
|
27966
|
+
result.data = sphere.data;
|
|
27967
|
+
}
|
|
27968
|
+
return result;
|
|
27969
|
+
}
|
|
27970
|
+
function serializeTopologyPath(path) {
|
|
27971
|
+
const result = {
|
|
27972
|
+
id: path.id,
|
|
27973
|
+
number: path.number,
|
|
27974
|
+
fromId: path.from.id,
|
|
27975
|
+
fromName: path.from.name,
|
|
27976
|
+
toId: path.to.id,
|
|
27977
|
+
toName: path.to.name
|
|
27978
|
+
};
|
|
27979
|
+
if (path.data && Object.keys(path.data).length > 0) {
|
|
27980
|
+
result.data = path.data;
|
|
27981
|
+
}
|
|
27982
|
+
return result;
|
|
27983
|
+
}
|
|
27984
|
+
function serializeTopologySegment(segment) {
|
|
27985
|
+
return {
|
|
27986
|
+
index: segment.index,
|
|
27987
|
+
fromId: segment.from.id,
|
|
27988
|
+
fromName: segment.from.name,
|
|
27989
|
+
toId: segment.to.id,
|
|
27990
|
+
toName: segment.to.name,
|
|
27991
|
+
isConnected: segment.isConnected,
|
|
27992
|
+
...segment.path ? {
|
|
27993
|
+
pathId: segment.path.id,
|
|
27994
|
+
pathNumber: segment.path.number
|
|
27995
|
+
} : {}
|
|
27996
|
+
};
|
|
27997
|
+
}
|
|
27998
|
+
function serializeTopologyRoute(route) {
|
|
27999
|
+
return {
|
|
28000
|
+
key: route.key,
|
|
28001
|
+
name: route.name,
|
|
28002
|
+
direction: route.direction,
|
|
28003
|
+
isFullyConnected: route.isFullyConnected,
|
|
28004
|
+
sphereOrder: route.spheres.map((sphere) => sphere.id),
|
|
28005
|
+
sphereNames: route.spheres.map((sphere) => sphere.name),
|
|
28006
|
+
segments: route.segments.map(serializeTopologySegment),
|
|
28007
|
+
missingSegments: route.missingSegments.map(serializeTopologySegment),
|
|
28008
|
+
targets: route.targets,
|
|
28009
|
+
targetIds: route.targetIds
|
|
28010
|
+
};
|
|
28011
|
+
}
|
|
28012
|
+
function resolveTopologyRouteKey(flags) {
|
|
28013
|
+
const route = getFlagString(flags, "route");
|
|
28014
|
+
if (!route || route === "all") {
|
|
28015
|
+
return void 0;
|
|
28016
|
+
}
|
|
28017
|
+
if (route === "lightning" || route === "serpent") {
|
|
28018
|
+
return route;
|
|
28019
|
+
}
|
|
28020
|
+
exitWithError(
|
|
28021
|
+
"INVALID_ARGUMENT",
|
|
28022
|
+
`Unknown topology route "${route}". Expected one of: lightning, serpent, all.`,
|
|
28023
|
+
flags
|
|
28024
|
+
);
|
|
28025
|
+
}
|
|
27318
28026
|
function buildViewBox(flags) {
|
|
27319
28027
|
const width = getFlagNumber(flags, "viewbox-width");
|
|
27320
28028
|
const height = getFlagNumber(flags, "viewbox-height");
|
|
@@ -27542,8 +28250,8 @@ function renderAsciiTree(layout, columns, rows) {
|
|
|
27542
28250
|
}
|
|
27543
28251
|
plot(x1, y1, lineChar);
|
|
27544
28252
|
};
|
|
27545
|
-
for (const
|
|
27546
|
-
const path = layout.percentages.paths[
|
|
28253
|
+
for (const pathId of layout.pathOrder) {
|
|
28254
|
+
const path = layout.percentages.paths[pathId];
|
|
27547
28255
|
drawLine(
|
|
27548
28256
|
toGridX(path.from.x),
|
|
27549
28257
|
toGridY(path.from.y),
|
|
@@ -27809,6 +28517,50 @@ Tree layout (${system})
|
|
|
27809
28517
|
}
|
|
27810
28518
|
console.log();
|
|
27811
28519
|
}
|
|
28520
|
+
function cmdTreeTopology(flags) {
|
|
28521
|
+
const system = resolveSystem(flags);
|
|
28522
|
+
const routeKey = resolveTopologyRouteKey(flags);
|
|
28523
|
+
const topology = getTreeTopology({ system });
|
|
28524
|
+
const spheres = topology.getSpheres();
|
|
28525
|
+
const paths = topology.getPaths();
|
|
28526
|
+
const routes = routeKey ? [topology.getRoute(routeKey)].filter(
|
|
28527
|
+
(route) => Boolean(route)
|
|
28528
|
+
) : topology.getRoutes();
|
|
28529
|
+
if (isJsonMode(flags)) {
|
|
28530
|
+
outputJson(
|
|
28531
|
+
{
|
|
28532
|
+
system,
|
|
28533
|
+
sphereOrder: spheres.map((sphere) => sphere.id),
|
|
28534
|
+
pathOrder: paths.map((path) => path.id),
|
|
28535
|
+
spheres: spheres.map(serializeTopologySphere),
|
|
28536
|
+
paths: paths.map(serializeTopologyPath),
|
|
28537
|
+
routes: routes.map(serializeTopologyRoute)
|
|
28538
|
+
},
|
|
28539
|
+
flags
|
|
28540
|
+
);
|
|
28541
|
+
return;
|
|
28542
|
+
}
|
|
28543
|
+
console.log(`
|
|
28544
|
+
Tree topology (${system})
|
|
28545
|
+
`);
|
|
28546
|
+
console.log(` Spheres: ${spheres.length}`);
|
|
28547
|
+
console.log(` Paths: ${paths.length}`);
|
|
28548
|
+
for (const route of routes) {
|
|
28549
|
+
const serialized = serializeTopologyRoute(route);
|
|
28550
|
+
console.log(
|
|
28551
|
+
`
|
|
28552
|
+
${route.name} (${route.direction}, ${route.isFullyConnected ? "fully connected" : "has missing path segments"}):`
|
|
28553
|
+
);
|
|
28554
|
+
console.log(` ${serialized.sphereNames.join(" -> ")}`);
|
|
28555
|
+
if (route.missingSegments.length > 0) {
|
|
28556
|
+
console.log(" Missing direct paths:");
|
|
28557
|
+
for (const segment of route.missingSegments) {
|
|
28558
|
+
console.log(` ${segment.from.name} -> ${segment.to.name}`);
|
|
28559
|
+
}
|
|
28560
|
+
}
|
|
28561
|
+
}
|
|
28562
|
+
console.log();
|
|
28563
|
+
}
|
|
27812
28564
|
function cmdTreeSvg(flags) {
|
|
27813
28565
|
const svgOptions = buildSvgOptions(flags);
|
|
27814
28566
|
const svg = generateTreeSvg(svgOptions);
|
|
@@ -28053,6 +28805,9 @@ async function runCli(argv) {
|
|
|
28053
28805
|
case "tree:layout":
|
|
28054
28806
|
cmdTreeLayout(flags);
|
|
28055
28807
|
return;
|
|
28808
|
+
case "tree:topology":
|
|
28809
|
+
cmdTreeTopology(flags);
|
|
28810
|
+
return;
|
|
28056
28811
|
case "tree:svg":
|
|
28057
28812
|
cmdTreeSvg(flags);
|
|
28058
28813
|
return;
|