From 360bfeb5ab876ef26e54513de21e29a20ae4e65d Mon Sep 17 00:00:00 2001 From: maverick Date: Wed, 22 Jul 2026 01:56:59 +1000 Subject: [PATCH] Cipher: E2E encrypted messenger scaffold (Signal Protocol + Cloudflare) - Hono Worker: auth, key directory (X3DH prekey bundles), message relay, R2 media - Mailbox Durable Object: WebSocket delivery + offline ciphertext queue - PWA client: libsignal (vendored), IndexedDB key store, chat UI, media E2E - Server only ever holds public keys + ciphertext; private keys stay on device Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitignore | 6 + migrations/0001_init.sql | 56 + package-lock.json | 1803 ++ package.json | 22 + public/icons/icon.svg | 9 + public/index.html | 98 + public/js/api.js | 108 + public/js/app.js | 392 + public/js/crypto.js | 170 + public/js/store.js | 161 + public/js/vendor/libsignal.js | 29317 ++++++++++++++++++++++++++++++++ public/manifest.webmanifest | 12 + public/sw.js | 59 + src/do/mailbox.js | 152 + src/index.js | 25 + src/lib/auth.js | 73 + src/lib/util.js | 32 + src/routes/auth.js | 102 + src/routes/keys.js | 121 + src/routes/media.js | 45 + src/routes/messages.js | 78 + wrangler.jsonc | 38 + 22 files changed, 32879 insertions(+) create mode 100644 .gitignore create mode 100644 migrations/0001_init.sql create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/icons/icon.svg create mode 100644 public/index.html create mode 100644 public/js/api.js create mode 100644 public/js/app.js create mode 100644 public/js/crypto.js create mode 100644 public/js/store.js create mode 100644 public/js/vendor/libsignal.js create mode 100644 public/manifest.webmanifest create mode 100644 public/sw.js create mode 100644 src/do/mailbox.js create mode 100644 src/index.js create mode 100644 src/lib/auth.js create mode 100644 src/lib/util.js create mode 100644 src/routes/auth.js create mode 100644 src/routes/keys.js create mode 100644 src/routes/media.js create mode 100644 src/routes/messages.js create mode 100644 wrangler.jsonc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fc7ba2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +.wrangler/ +.dev.vars +dist/ +*.log +.DS_Store diff --git a/migrations/0001_init.sql b/migrations/0001_init.sql new file mode 100644 index 0000000..0870a9c --- /dev/null +++ b/migrations/0001_init.sql @@ -0,0 +1,56 @@ +-- Cipher schema. The server is a "dumb" key directory + relay. +-- It stores ONLY public keys and ciphertext. Private keys never leave the client. + +-- A user account. Identified by username; discoverable by other users. +CREATE TABLE users ( + id TEXT PRIMARY KEY, -- uuid + username TEXT NOT NULL UNIQUE, -- lowercase handle, e.g. "alice" + display_name TEXT NOT NULL, + pw_hash TEXT NOT NULL, -- PBKDF2(password) — account auth only, unrelated to E2E keys + pw_salt TEXT NOT NULL, + created_at INTEGER NOT NULL +); +CREATE INDEX idx_users_username ON users(username); + +-- A device belonging to a user. Each device has its own Signal identity. +-- Multi-device: a user may register several (phone, desktop) via QR linking. +CREATE TABLE devices ( + id TEXT PRIMARY KEY, -- uuid + user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE, + registration_id INTEGER NOT NULL, -- Signal registrationId + identity_key TEXT NOT NULL, -- base64 public identity key + signed_prekey_id INTEGER NOT NULL, + signed_prekey_pub TEXT NOT NULL, -- base64 + signed_prekey_sig TEXT NOT NULL, -- base64 signature over signed_prekey_pub + created_at INTEGER NOT NULL, + last_seen INTEGER NOT NULL +); +CREATE INDEX idx_devices_user ON devices(user_id); + +-- One-time prekeys. Server hands one out per session-init request, then deletes it. +CREATE TABLE one_time_prekeys ( + device_id TEXT NOT NULL REFERENCES devices(id) ON DELETE CASCADE, + prekey_id INTEGER NOT NULL, + prekey_pub TEXT NOT NULL, -- base64 + PRIMARY KEY (device_id, prekey_id) +); +CREATE INDEX idx_otk_device ON one_time_prekeys(device_id); + +-- Bearer auth sessions (account-level). Token proves control of the account. +CREATE TABLE sessions ( + token TEXT PRIMARY KEY, -- random opaque token + user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE, + device_id TEXT NOT NULL REFERENCES devices(id) ON DELETE CASCADE, + created_at INTEGER NOT NULL, + expires_at INTEGER NOT NULL +); +CREATE INDEX idx_sessions_user ON sessions(user_id); + +-- Web Push subscriptions for wake-on-message notifications (endpoint is opaque). +CREATE TABLE push_subs ( + device_id TEXT PRIMARY KEY REFERENCES devices(id) ON DELETE CASCADE, + endpoint TEXT NOT NULL, + p256dh TEXT NOT NULL, + auth TEXT NOT NULL, + created_at INTEGER NOT NULL +); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ed479af --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1803 @@ +{ + "name": "cipher", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cipher", + "version": "0.1.0", + "dependencies": { + "hono": "^4.6.14" + }, + "devDependencies": { + "@privacyresearch/libsignal-protocol-typescript": "^0.0.16", + "buffer": "^6.0.3", + "esbuild": "^0.28.1", + "wrangler": "^4.96.0" + } + }, + "node_modules/@cloudflare/kv-asset-handler": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.0.tgz", + "integrity": "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==", + "dev": true, + "license": "MIT OR Apache-2.0", + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@cloudflare/unenv-preset": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.1.tgz", + "integrity": "sha512-ECxObrMfyTl5bhQf/lZCXwo5G6xX9IAUo+nDMKK4SZ8m4Jvvxp52vilxyySSWh2YTZz8+HQ07qGH/2rEom1vDw==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peerDependencies": { + "unenv": "2.0.0-rc.24", + "workerd": ">1.20260305.0 <2.0.0-0" + }, + "peerDependenciesMeta": { + "workerd": { + "optional": true + } + } + }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20260714.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260714.1.tgz", + "integrity": "sha512-ZWXqAN8G7Cx9hMRQuk+59ziJhR3j1F4iO+Qs8aHdfKZ3Dq5Yi/57xvkJTgCGBnW1YU/L78r8f6HEy51bwbTpNw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20260714.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260714.1.tgz", + "integrity": "sha512-tueWxWC3wyCbMG6zRAxsMXX0YLgrRWbiAPYFQ2uJ7dUH8G+5E7UTWaQS9B1HdJ0bpKFW1NWxhs1o2noKVFSUYg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20260714.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260714.1.tgz", + "integrity": "sha512-1VChTZRb0l0F7R4e1G5RtLKV4oFi6x+rQgxh2+yu887j3l/3TLgatuv1L8/5zhc9gKEhATTxOh0e52Rtd9dDWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20260714.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260714.1.tgz", + "integrity": "sha512-rMm3G+NirG2UdgHIRDdF1asNC6FqgIzZzkRG+VDhhDGcVxAQwvrMT1E38BivEvHr3G04MB4AfhcOczX0+GtRkQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20260714.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260714.1.tgz", + "integrity": "sha512-cGqnU3Hg2YZS/k3SAqrMp1DjpdsyFde72tWltdl6ZT9+SFz/Zrk/8gyTU1TcxC4YApXeNVH5TyU5cOGPgUJ0pg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.2.tgz", + "integrity": "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@poppinss/colors": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^4.1.5" + } + }, + "node_modules/@poppinss/dumper": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@sindresorhus/is": "^7.0.2", + "supports-color": "^10.0.0" + } + }, + "node_modules/@poppinss/exception": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@privacyresearch/curve25519-typescript": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@privacyresearch/curve25519-typescript/-/curve25519-typescript-0.0.12.tgz", + "integrity": "sha512-ASU2mjNsE838GgEqKYokka6ksjjW05dhYxRRq1aPfC/YEgS0+0OpCvNdF+oBaxjDx1ZYUHLTgV49jfkd1GQ+ig==", + "dev": true, + "license": "GPL-3.0-only" + }, + "node_modules/@privacyresearch/libsignal-protocol-protobuf-ts": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/@privacyresearch/libsignal-protocol-protobuf-ts/-/libsignal-protocol-protobuf-ts-0.0.9.tgz", + "integrity": "sha512-5dYQc1gL+T9u+8oqGgvSHEoSLBsecg2vbeJ9vOenchSyve4WFcLR3FHJug3ZlK/KGfDyVE4/sWd7XqyHLnqn7A==", + "dev": true, + "license": "GPL-3.0-only", + "dependencies": { + "ts-proto": "^1.83.1" + } + }, + "node_modules/@privacyresearch/libsignal-protocol-typescript": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@privacyresearch/libsignal-protocol-typescript/-/libsignal-protocol-typescript-0.0.16.tgz", + "integrity": "sha512-/2jMM3pcUn4rmXfn6BFpxUygUJSlYTprZVLaWzNCTbJmjXusVUpfWHZeneER67q9qHEWVSIPlLJ9OFRhgar2vQ==", + "dev": true, + "license": "GPL-3.0-only", + "dependencies": { + "@privacyresearch/curve25519-typescript": "^0.0.12", + "@privacyresearch/libsignal-protocol-protobuf-ts": "^0.0.9", + "base64-js": "^1.5.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz", + "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", + "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz", + "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@sindresorhus/is": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", + "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@speed-highlight/core": { + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.17.tgz", + "integrity": "sha512-Z92FwKpCtfaW1V0jTU/fh3QzYEZN8wDwrzRIBoADCJfn4mJCNcJN/XegifX7BDrQ8/h9Xh/JnbyMchL0FqXrkg==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/@types/node": { + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.3.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/blake3-wasm": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", + "dev": true, + "license": "MIT" + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/case-anything": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dprint-node": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", + "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/dprint-node/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/error-stack-parser-es": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", + "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/esbuild": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/hono": { + "version": "4.12.31", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.31.tgz", + "integrity": "sha512-zJIHFrl6bq3RDd2YusFNCDlM8qUprxKswyi/OPzPyzKDdyBXDqWx8bZlZ7R+saTdSTatUmb3O7K4SspGPaEOQg==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/miniflare": { + "version": "4.20260714.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260714.0.tgz", + "integrity": "sha512-MYlTCLdWCPqvrYY2uLwOjXwmglXuiHE3TGGkbOW4BwjUPa1r07E0iuHwrNDIs/sxK21r+o90Jx58AV2KeNdJZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.34.5", + "undici": "7.28.0", + "workerd": "1.20260714.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "bin": { + "miniflare": "bootstrap.js" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/protobufjs": { + "version": "7.6.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz", + "integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==", + "dev": true, + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.1", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/ts-poet": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.12.0.tgz", + "integrity": "sha512-xo+iRNMWqyvXpFTaOAvLPA5QAWO6TZrSUs5s4Odaya3epqofBu/fMLHEWl8jPmjhA0s9sgj9sNvF1BmaQlmQkA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dprint-node": "^1.0.8" + } + }, + "node_modules/ts-proto": { + "version": "1.181.2", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.181.2.tgz", + "integrity": "sha512-knJ8dtjn2Pd0c5ZGZG8z9DMiD4PUY8iGI9T9tb8DvGdWRMkLpf0WcPO7G+7cmbZyxvNTAG6ci3fybEaFgMZIvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "case-anything": "^2.1.13", + "protobufjs": "^7.2.4", + "ts-poet": "^6.7.0", + "ts-proto-descriptors": "1.16.0" + }, + "bin": { + "protoc-gen-ts_proto": "protoc-gen-ts_proto" + } + }, + "node_modules/ts-proto-descriptors": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.16.0.tgz", + "integrity": "sha512-3yKuzMLpltdpcyQji1PJZRfoo4OJjNieKTYkQY8pF7xGKsYz/RHe3aEe4KiRxcinoBmnEhmuI+yJTxLb922ULA==", + "dev": true, + "license": "ISC", + "dependencies": { + "long": "^5.2.3", + "protobufjs": "^7.2.4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/undici": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.28.0.tgz", + "integrity": "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unenv": { + "version": "2.0.0-rc.24", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "pathe": "^2.0.3" + } + }, + "node_modules/workerd": { + "version": "1.20260714.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260714.1.tgz", + "integrity": "sha512-oIbQzfdyl9UQUnG6XLegcSq0Mgt/7WKDbFOoqGgOWCS+/fhyGB460uKEgdAQQ9RHCO/ttcNCX/KiMIQzdoeu3Q==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20260714.1", + "@cloudflare/workerd-darwin-arm64": "1.20260714.1", + "@cloudflare/workerd-linux-64": "1.20260714.1", + "@cloudflare/workerd-linux-arm64": "1.20260714.1", + "@cloudflare/workerd-windows-64": "1.20260714.1" + } + }, + "node_modules/wrangler": { + "version": "4.112.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.112.0.tgz", + "integrity": "sha512-5H+XUD0TySCv1LuktFHDIEOkboH2nTfQs+35L+USt3MtntjDTMVIJprLgQcL2WBjulOyjxpd1vyTiSTJVW5MjQ==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "0.5.0", + "@cloudflare/unenv-preset": "2.16.1", + "blake3-wasm": "2.1.5", + "esbuild": "0.28.1", + "miniflare": "4.20260714.0", + "path-to-regexp": "6.3.0", + "unenv": "2.0.0-rc.24", + "workerd": "1.20260714.1" + }, + "bin": { + "cf-wrangler": "bin/cf-wrangler.js", + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "engines": { + "node": ">=22.0.0" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^5.20260714.1" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/youch": { + "version": "4.1.0-beta.10", + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@poppinss/dumper": "^0.6.4", + "@speed-highlight/core": "^1.2.7", + "cookie": "^1.0.2", + "youch-core": "^0.3.3" + } + }, + "node_modules/youch-core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1327bca --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "cipher", + "version": "0.1.0", + "private": true, + "description": "Cipher — end-to-end encrypted messenger (Signal Protocol) on Cloudflare", + "type": "module", + "scripts": { + "dev": "wrangler dev", + "deploy": "wrangler deploy", + "db:migrate:local": "wrangler d1 migrations apply cipher --local", + "db:migrate": "wrangler d1 migrations apply cipher --remote" + }, + "dependencies": { + "hono": "^4.6.14" + }, + "devDependencies": { + "@privacyresearch/libsignal-protocol-typescript": "^0.0.16", + "buffer": "^6.0.3", + "esbuild": "^0.28.1", + "wrangler": "^4.96.0" + } +} diff --git a/public/icons/icon.svg b/public/icons/icon.svg new file mode 100644 index 0000000..a1153f3 --- /dev/null +++ b/public/icons/icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..d104441 --- /dev/null +++ b/public/index.html @@ -0,0 +1,98 @@ + + + + + + + Cipher — encrypted messaging + + + + + + +
+ + + diff --git a/public/js/api.js b/public/js/api.js new file mode 100644 index 0000000..b82aa9c --- /dev/null +++ b/public/js/api.js @@ -0,0 +1,108 @@ +// Thin client for the Cipher Worker API + the mailbox WebSocket. + +let token = null; +export function setToken(t) { + token = t; +} + +async function req(method, path, body, raw = false) { + const headers = {}; + if (token) headers["Authorization"] = "Bearer " + token; + const opts = { method, headers }; + if (body !== undefined) { + if (raw) { + opts.body = body; // ArrayBuffer / Blob + } else { + headers["Content-Type"] = "application/json"; + opts.body = JSON.stringify(body); + } + } + const res = await fetch(path, opts); + if (!res.ok) { + let msg = res.statusText; + try { + msg = (await res.json()).error || msg; + } catch {} + throw new Error(msg); + } + const ct = res.headers.get("Content-Type") || ""; + return ct.includes("application/json") ? res.json() : res; +} + +export const api = { + register: (payload) => req("POST", "/api/auth/register", payload), + login: (payload) => req("POST", "/api/auth/login", payload), + lookup: (username) => req("GET", "/api/users/" + encodeURIComponent(username)), + bundle: (userId) => req("GET", "/api/keys/bundle/" + userId), + keyCount: () => req("GET", "/api/keys/count"), + addPreKeys: (oneTimePreKeys) => req("POST", "/api/keys/prekeys", { oneTimePreKeys }), + send: (toUserId, messages) => req("POST", "/api/messages/send", { toUserId, messages }), + uploadMedia: async (ciphertext) => { + const res = await req("POST", "/api/media", ciphertext, true); + return res.json ? res.json() : res; + }, + fetchMedia: async (key) => { + const res = await req("GET", "/api/media/" + key); + return res.arrayBuffer(); + }, +}; + +// ---- WebSocket with auto-reconnect + ack ---- +export class MailboxSocket { + constructor(tok, onEnvelope) { + this.tok = tok; + this.onEnvelope = onEnvelope; + this.ws = null; + this.backoff = 1000; + this.closed = false; + this.pending = []; // envelope ids awaiting ack batch + } + + connect() { + const proto = location.protocol === "https:" ? "wss:" : "ws:"; + this.ws = new WebSocket(`${proto}//${location.host}/api/ws?token=${encodeURIComponent(this.tok)}`); + this.ws.onopen = () => { + this.backoff = 1000; + this.ws.send(JSON.stringify({ t: "pull" })); + }; + this.ws.onmessage = async (ev) => { + let msg; + try { + msg = JSON.parse(ev.data); + } catch { + return; + } + if (msg.t === "message" && msg.envelope) { + try { + await this.onEnvelope(msg.envelope); + this.ack(msg.envelope.id); + } catch (e) { + console.error("envelope handling failed", e); + } + } + }; + this.ws.onclose = () => { + if (this.closed) return; + setTimeout(() => this.connect(), this.backoff); + this.backoff = Math.min(this.backoff * 2, 30000); + }; + this.ws.onerror = () => this.ws && this.ws.close(); + } + + ack(id) { + // Batch acks briefly to reduce chatter. + this.pending.push(id); + clearTimeout(this._ackTimer); + this._ackTimer = setTimeout(() => { + if (this.ws && this.ws.readyState === WebSocket.OPEN && this.pending.length) { + this.ws.send(JSON.stringify({ t: "ack", ids: this.pending })); + this.pending = []; + } + }, 150); + } + + close() { + this.closed = true; + if (this.ws) this.ws.close(); + } +} diff --git a/public/js/app.js b/public/js/app.js new file mode 100644 index 0000000..f74a8c2 --- /dev/null +++ b/public/js/app.js @@ -0,0 +1,392 @@ +// Cipher client orchestration: auth, contacts, chat, media. Ties crypto + api + UI. + +import { api, setToken, MailboxSocket } from "./api.js"; +import * as C from "./crypto.js"; +import { meta, contacts, messages as msgStore } from "./store.js"; + +const $ = (sel) => document.querySelector(sel); +const el = (tag, props = {}, ...children) => { + const n = Object.assign(document.createElement(tag), props); + for (const c of children) n.append(c); + return n; +}; + +const state = { + me: null, // { userId, deviceId, username, displayName } + token: null, + socket: null, + activeContact: null, // contact object +}; + +// ---------- boot ---------- +async function boot() { + const saved = await meta.get("account"); + if (saved?.token) { + state.me = saved; + state.token = saved.token; + setToken(saved.token); + await enterApp(); + } else { + renderAuth(); + } +} + +// ---------- auth ---------- +function renderAuth() { + const root = $("#app"); + root.innerHTML = ""; + const form = el("form", { className: "auth-card" }); + const title = el("h1", { textContent: "Cipher" }); + const tag = el("p", { className: "tagline", textContent: "end-to-end encrypted messaging" }); + const err = el("div", { className: "auth-err" }); + + const username = el("input", { placeholder: "username", autocomplete: "username", required: true }); + const displayName = el("input", { placeholder: "display name (register only)", autocomplete: "name" }); + const password = el("input", { type: "password", placeholder: "password", autocomplete: "current-password", required: true }); + + const loginBtn = el("button", { type: "submit", className: "primary", textContent: "Log in" }); + const registerBtn = el("button", { type: "button", className: "ghost", textContent: "Create account" }); + + form.append(title, tag, err, username, displayName, password, loginBtn, registerBtn); + root.append(form); + + form.onsubmit = async (e) => { + e.preventDefault(); + err.textContent = ""; + try { + loginBtn.disabled = true; + const res = await api.login({ username: username.value, password: password.value }); + await onAuthenticated(res); + } catch (ex) { + err.textContent = ex.message; + } finally { + loginBtn.disabled = false; + } + }; + + registerBtn.onclick = async () => { + err.textContent = ""; + if (!username.value || password.value.length < 8) { + err.textContent = "username + 8-char password required"; + return; + } + try { + registerBtn.disabled = true; + registerBtn.textContent = "Generating keys…"; + const device = await C.generateRegistration(); + const res = await api.register({ + username: username.value, + displayName: displayName.value || username.value, + password: password.value, + device, + }); + await onAuthenticated(res); + } catch (ex) { + err.textContent = ex.message; + } finally { + registerBtn.disabled = false; + registerBtn.textContent = "Create account"; + } + }; +} + +async function onAuthenticated(res) { + state.me = res; + state.token = res.token; + setToken(res.token); + await meta.set("account", res); + await enterApp(); +} + +// ---------- main app ---------- +async function enterApp() { + renderShell(); + await refreshContacts(); + connectSocket(); + maybeReplenishPreKeys(); + registerServiceWorker(); +} + +function renderShell() { + const root = $("#app"); + root.innerHTML = ""; + const shell = el("div", { className: "shell" }); + + // Sidebar + const sidebar = el("aside", { className: "sidebar" }); + const header = el("div", { className: "side-header" }); + header.append( + el("div", { className: "me", textContent: state.me.displayName || state.me.username }), + el("div", { className: "handle", textContent: "@" + state.me.username }) + ); + const newChat = el("button", { className: "new-chat", textContent: "+ New chat", onclick: startNewChat }); + const list = el("div", { className: "chat-list", id: "chatList" }); + sidebar.append(header, newChat, list); + + // Main pane + const main = el("section", { className: "main", id: "main" }); + main.append(el("div", { className: "empty", textContent: "Select a chat or start a new one" })); + + shell.append(sidebar, main); + root.append(shell); +} + +async function refreshContacts() { + const list = $("#chatList"); + if (!list) return; + list.innerHTML = ""; + const all = await contacts.all(); + for (const c of all) { + const item = el("div", { className: "chat-item", onclick: () => openChat(c) }); + item.append( + el("div", { className: "avatar", textContent: (c.displayName || c.username)[0].toUpperCase() }), + el("div", { className: "chat-meta" }, + el("div", { className: "chat-name", textContent: c.displayName || c.username }), + el("div", { className: "chat-sub", textContent: "@" + c.username }) + ) + ); + list.append(item); + } +} + +async function startNewChat() { + const username = prompt("Username to message:"); + if (!username) return; + try { + const user = await api.lookup(username.trim().toLowerCase()); + const contact = { + userId: user.userId, + username: user.username, + displayName: user.displayName, + deviceIds: [], + }; + await contacts.put(contact); + await refreshContacts(); + await openChat(contact); + } catch (ex) { + alert("Could not find user: " + ex.message); + } +} + +// ---------- chat view ---------- +async function openChat(contact) { + state.activeContact = contact; + const main = $("#main"); + main.innerHTML = ""; + + const head = el("div", { className: "chat-head" }); + head.append( + el("div", { className: "avatar", textContent: (contact.displayName || contact.username)[0].toUpperCase() }), + el("div", {}, + el("div", { className: "chat-name", textContent: contact.displayName || contact.username }), + el("div", { className: "chat-sub", textContent: "🔒 end-to-end encrypted" }) + ) + ); + + const thread = el("div", { className: "thread", id: "thread" }); + + const composer = el("form", { className: "composer" }); + const input = el("input", { placeholder: "Type a message", autocomplete: "off" }); + const attach = el("label", { className: "attach", textContent: "📎" }); + const fileInput = el("input", { type: "file", style: "display:none" }); + attach.append(fileInput); + const sendBtn = el("button", { type: "submit", className: "send", textContent: "Send" }); + composer.append(attach, input, sendBtn); + + main.append(head, thread, composer); + + // load history + const convo = state.me.userId + ":" + contact.userId; + const history = await msgStore.forConvo(convo); + for (const m of history) renderMessage(m); + scrollThread(); + + composer.onsubmit = async (e) => { + e.preventDefault(); + const text = input.value.trim(); + if (!text) return; + input.value = ""; + await sendText(contact, text); + }; + + fileInput.onchange = async () => { + const file = fileInput.files[0]; + if (file) await sendMedia(contact, file); + fileInput.value = ""; + }; +} + +function convoKey(otherUserId) { + return state.me.userId + ":" + otherUserId; +} + +async function ensureRecipientDevices(contact) { + const bundle = await api.bundle(contact.userId); + contact.deviceIds = bundle.bundles.map((b) => b.deviceId); + await contacts.put(contact); + await C.ensureSessions(bundle); + return contact.deviceIds; +} + +async function sendText(contact, text) { + // structured payload lets us carry media refs in the same E2E channel + const payload = JSON.stringify({ k: "text", text }); + await deliver(contact, payload); + await persistAndRender(contact.userId, { dir: "out", kind: "text", text, ts: Date.now() }); +} + +async function sendMedia(contact, file) { + const buf = await file.arrayBuffer(); + const enc = await C.encryptMedia(buf); + const { key } = await api.uploadMedia(enc.ciphertext); + const payload = JSON.stringify({ + k: "media", + key, + keyB64: enc.keyB64, + ivB64: enc.ivB64, + name: file.name, + type: file.type, + size: file.size, + }); + await deliver(contact, payload); + await persistAndRender(contact.userId, { + dir: "out", + kind: "media", + name: file.name, + mime: file.type, + localUrl: URL.createObjectURL(file), + ts: Date.now(), + }); +} + +async function deliver(contact, plaintextPayload) { + let deviceIds = contact.deviceIds; + if (!deviceIds || !deviceIds.length) deviceIds = await ensureRecipientDevices(contact); + const messages = await C.encryptForUser(contact.userId, deviceIds, plaintextPayload); + await api.send(contact.userId, messages); +} + +// ---------- receiving ---------- +function connectSocket() { + if (state.socket) state.socket.close(); + state.socket = new MailboxSocket(state.token, onEnvelope); + state.socket.connect(); +} + +async function onEnvelope(envelope) { + // Look up / create the sender contact. + let contact = await contactByUserId(envelope.fromUserId); + const plaintext = await C.decryptEnvelope(envelope, envelope.fromUserId); + let data; + try { + data = JSON.parse(plaintext); + } catch { + data = { k: "text", text: plaintext }; + } + + if (!contact) { + // Unknown sender — create a stub contact so the message has a home. + contact = { userId: envelope.fromUserId, username: envelope.fromUserId.slice(0, 8), displayName: "New contact", deviceIds: [] }; + await contacts.put(contact); + await refreshContacts(); + } + + if (data.k === "media") { + await persistAndRender(envelope.fromUserId, { + dir: "in", + kind: "media", + name: data.name, + mime: data.type, + mediaRef: { key: data.key, keyB64: data.keyB64, ivB64: data.ivB64 }, + ts: envelope.sentAt || Date.now(), + }); + } else { + await persistAndRender(envelope.fromUserId, { dir: "in", kind: "text", text: data.text, ts: envelope.sentAt || Date.now() }); + } +} + +async function contactByUserId(userId) { + return contacts.get(userId); +} + +// ---------- persistence + render ---------- +async function persistAndRender(otherUserId, msg) { + const record = { ...msg, convo: convoKey(otherUserId), otherUserId }; + await msgStore.add(record); + if (state.activeContact && state.activeContact.userId === otherUserId) { + renderMessage(record); + scrollThread(); + } +} + +function renderMessage(m) { + const thread = $("#thread"); + if (!thread) return; + const bubble = el("div", { className: "bubble " + (m.dir === "out" ? "out" : "in") }); + if (m.kind === "media") { + if (m.mime && m.mime.startsWith("image/")) { + const img = el("img", { className: "media-img", alt: m.name || "image" }); + if (m.localUrl) img.src = m.localUrl; + else if (m.mediaRef) loadMediaInto(img, m.mediaRef); + bubble.append(img); + } else { + const link = el("a", { className: "media-file", textContent: "📄 " + (m.name || "file") }); + if (m.mediaRef) makeDownloadable(link, m.mediaRef, m.name); + bubble.append(link); + } + } else { + bubble.append(el("div", { className: "text", textContent: m.text })); + } + bubble.append(el("div", { className: "time", textContent: fmtTime(m.ts) })); + thread.append(bubble); +} + +async function loadMediaInto(img, ref) { + try { + const ct = await api.fetchMedia(ref.key); + const plain = await C.decryptMedia(ct, ref.keyB64, ref.ivB64); + img.src = URL.createObjectURL(new Blob([plain])); + } catch (e) { + img.alt = "failed to load media"; + } +} + +async function makeDownloadable(link, ref, name) { + link.onclick = async (e) => { + e.preventDefault(); + const ct = await api.fetchMedia(ref.key); + const plain = await C.decryptMedia(ct, ref.keyB64, ref.ivB64); + const url = URL.createObjectURL(new Blob([plain])); + const a = el("a", { href: url, download: name || "file" }); + a.click(); + }; +} + +function scrollThread() { + const t = $("#thread"); + if (t) t.scrollTop = t.scrollHeight; +} + +function fmtTime(ts) { + const d = new Date(ts); + return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); +} + +// ---------- prekey replenishment ---------- +async function maybeReplenishPreKeys() { + try { + const { count } = await api.keyCount(); + if (count < 20) { + const otks = await C.generateMoreOneTimePreKeys(100); + await api.addPreKeys(otks); + } + } catch {} +} + +function registerServiceWorker() { + if ("serviceWorker" in navigator) { + navigator.serviceWorker.register("/sw.js").catch(() => {}); + } +} + +boot(); diff --git a/public/js/crypto.js b/public/js/crypto.js new file mode 100644 index 0000000..9a207e4 --- /dev/null +++ b/public/js/crypto.js @@ -0,0 +1,170 @@ +// High-level E2E crypto built on the vendored Signal Protocol library. +// This module is the ONLY place message plaintext exists in the app besides the UI. + +import { + KeyHelper, + SignalProtocolAddress, + SessionBuilder, + SessionCipher, +} from "./vendor/libsignal.js"; +import { SignalStore } from "./store.js"; + +export const store = new SignalStore(); + +// ---- encoding helpers ---- +export function abToB64(ab) { + const bytes = new Uint8Array(ab); + let bin = ""; + for (let i = 0; i < bytes.length; i++) bin += String.fromCharCode(bytes[i]); + return btoa(bin); +} +export function b64ToAb(b64) { + const bin = atob(b64); + const bytes = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i); + return bytes.buffer; +} +// Signal message bodies are binary strings; base64 them for JSON transport. +function binStrToB64(s) { + return btoa(s); +} +function b64ToBinStr(b64) { + return atob(b64); +} + +const NUM_ONE_TIME_PREKEYS = 100; +const SIGNED_PREKEY_ID = 1; + +// Generate a fresh identity + prekeys and persist private halves locally. +// Returns the PUBLIC registration payload to send to the server. +export async function generateRegistration() { + const identityKeyPair = await KeyHelper.generateIdentityKeyPair(); + const registrationId = KeyHelper.generateRegistrationId(); + await store.setIdentity(identityKeyPair, registrationId); + + const signedPreKey = await KeyHelper.generateSignedPreKey(identityKeyPair, SIGNED_PREKEY_ID); + await store.storeSignedPreKey(SIGNED_PREKEY_ID, signedPreKey.keyPair); + + const oneTimePreKeys = []; + const startId = 1; + for (let i = 0; i < NUM_ONE_TIME_PREKEYS; i++) { + const id = startId + i; + const pk = await KeyHelper.generatePreKey(id); + await store.storePreKey(id, pk.keyPair); + oneTimePreKeys.push({ id, pub: abToB64(pk.keyPair.pubKey) }); + } + + return { + registrationId, + identityKey: abToB64(identityKeyPair.pubKey), + signedPreKey: { + id: SIGNED_PREKEY_ID, + pub: abToB64(signedPreKey.keyPair.pubKey), + sig: abToB64(signedPreKey.signature), + }, + oneTimePreKeys, + }; +} + +// Generate a batch of fresh one-time prekeys to replenish the server's supply. +export async function generateMoreOneTimePreKeys(count = 100) { + // Continue numbering past whatever we've used; store a counter in meta-less way: + // derive from a random high base to avoid collisions (server ignores dupes). + const base = 1000 + Math.floor(Math.random() * 1_000_000); + const oneTimePreKeys = []; + for (let i = 0; i < count; i++) { + const id = base + i; + const pk = await KeyHelper.generatePreKey(id); + await store.storePreKey(id, pk.keyPair); + oneTimePreKeys.push({ id, pub: abToB64(pk.keyPair.pubKey) }); + } + return oneTimePreKeys; +} + +// Establish outbound sessions with every device in a fetched prekey bundle. +export async function ensureSessions(bundlesResponse) { + for (const b of bundlesResponse.bundles) { + const address = new SignalProtocolAddress(bundlesResponse.userId, deviceIndex(b.deviceId)); + const existing = await store.loadSession(address.toString()); + if (existing) continue; + const builder = new SessionBuilder(store, address); + await builder.processPreKey({ + registrationId: b.registrationId, + identityKey: b64ToAb(b.identityKey), + signedPreKey: { + keyId: b.signedPreKey.id, + publicKey: b64ToAb(b.signedPreKey.pub), + signature: b64ToAb(b.signedPreKey.sig), + }, + preKey: b.oneTimePreKey + ? { keyId: b.oneTimePreKey.id, publicKey: b64ToAb(b.oneTimePreKey.pub) } + : undefined, + }); + } +} + +// Signal addresses need an integer deviceId. Map our uuid deviceIds to a stable +// small int by keeping a per-user registry in memory (and the session key string +// already encodes the full identity, so uniqueness within a user is all we need). +const deviceIndexMap = new Map(); +let deviceCounter = 1; +function deviceIndex(deviceId) { + if (!deviceIndexMap.has(deviceId)) deviceIndexMap.set(deviceId, deviceCounter++); + return deviceIndexMap.get(deviceId); +} + +// Encrypt a plaintext string for every device of a recipient. Returns the array +// of per-device messages to POST to /api/messages/send. +export async function encryptForUser(userId, deviceIds, plaintext) { + const buffer = new TextEncoder().encode(plaintext).buffer; + const messages = []; + for (const deviceId of deviceIds) { + const address = new SignalProtocolAddress(userId, deviceIndex(deviceId)); + const cipher = new SessionCipher(store, address); + const ct = await cipher.encrypt(buffer); + messages.push({ toDeviceId: deviceId, type: ct.type, body: binStrToB64(ct.body) }); + } + return messages; +} + +// Decrypt an inbound envelope. Handles both prekey (type 3) and whisper (type 1). +export async function decryptEnvelope(envelope, senderUserId) { + const address = new SignalProtocolAddress(senderUserId, deviceIndex(envelope.fromDeviceId)); + const cipher = new SessionCipher(store, address); + const body = b64ToBinStr(envelope.body); + let plaintextBuf; + if (envelope.type === 3) { + plaintextBuf = await cipher.decryptPreKeyWhisperMessage(body, "binary"); + } else { + plaintextBuf = await cipher.decryptWhisperMessage(body, "binary"); + } + return new TextDecoder().decode(new Uint8Array(plaintextBuf)); +} + +// ---- media encryption (AES-GCM, key travels inside the E2E message) ---- +export async function encryptMedia(fileArrayBuffer) { + const key = await crypto.subtle.generateKey({ name: "AES-GCM", length: 256 }, true, [ + "encrypt", + "decrypt", + ]); + const iv = crypto.getRandomValues(new Uint8Array(12)); + const ciphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, fileArrayBuffer); + const rawKey = await crypto.subtle.exportKey("raw", key); + return { + ciphertext, // ArrayBuffer to upload to R2 + keyB64: abToB64(rawKey), + ivB64: abToB64(iv.buffer), + }; +} + +export async function decryptMedia(ciphertext, keyB64, ivB64) { + const key = await crypto.subtle.importKey( + "raw", + b64ToAb(keyB64), + { name: "AES-GCM" }, + false, + ["decrypt"] + ); + const iv = new Uint8Array(b64ToAb(ivB64)); + return crypto.subtle.decrypt({ name: "AES-GCM", iv }, key, ciphertext); +} diff --git a/public/js/store.js b/public/js/store.js new file mode 100644 index 0000000..1a3a174 --- /dev/null +++ b/public/js/store.js @@ -0,0 +1,161 @@ +// IndexedDB persistence: the Signal protocol store + app data (contacts, chats). +// Private keys live ONLY here, in the browser. They are never sent to the server. + +const DB_NAME = "cipher"; +const DB_VERSION = 1; + +function openDB() { + return new Promise((resolve, reject) => { + const req = indexedDB.open(DB_NAME, DB_VERSION); + req.onupgradeneeded = () => { + const db = req.result; + // Signal protocol material (identity keypair, prekeys, sessions, peer identities). + if (!db.objectStoreNames.contains("signal")) db.createObjectStore("signal"); + // App metadata (my account, settings). + if (!db.objectStoreNames.contains("meta")) db.createObjectStore("meta"); + // Known contacts, keyed by userId. + if (!db.objectStoreNames.contains("contacts")) db.createObjectStore("contacts", { keyPath: "userId" }); + // Message history, keyed by autoincrement, indexed by conversation. + if (!db.objectStoreNames.contains("messages")) { + const s = db.createObjectStore("messages", { keyPath: "id", autoIncrement: true }); + s.createIndex("convo", "convo"); + } + }; + req.onsuccess = () => resolve(req.result); + req.onerror = () => reject(req.error); + }); +} + +let _db; +async function db() { + if (!_db) _db = await openDB(); + return _db; +} + +function tx(store, mode = "readonly") { + return db().then((d) => d.transaction(store, mode).objectStore(store)); +} + +function reqP(request) { + return new Promise((resolve, reject) => { + request.onsuccess = () => resolve(request.result); + request.onerror = () => reject(request.error); + }); +} + +// ---- generic KV helpers over the "signal" and "meta" stores ---- +async function kvGet(store, key) { + return reqP((await tx(store)).get(key)); +} +async function kvPut(store, key, val) { + return reqP((await tx(store, "readwrite")).put(val, key)); +} +async function kvDel(store, key) { + return reqP((await tx(store, "readwrite")).delete(key)); +} + +export const meta = { + get: (k) => kvGet("meta", k), + set: (k, v) => kvPut("meta", k, v), + del: (k) => kvDel("meta", k), +}; + +// ---- contacts ---- +export const contacts = { + async put(contact) { + return reqP((await tx("contacts", "readwrite")).put(contact)); + }, + async get(userId) { + return reqP((await tx("contacts")).get(userId)); + }, + async all() { + return reqP((await tx("contacts")).getAll()); + }, +}; + +// ---- messages ---- +export const messages = { + async add(msg) { + return reqP((await tx("messages", "readwrite")).add(msg)); + }, + async forConvo(convo) { + const idx = (await tx("messages")).index("convo"); + return reqP(idx.getAll(convo)); + }, +}; + +// ---- Signal protocol store ---- +// Implements the StorageType interface libsignal expects. Keys are strings; +// ArrayBuffers and records are stored directly (IndexedDB structured-clones them). +export class SignalStore { + Direction = { SENDING: 1, RECEIVING: 2 }; + + async getIdentityKeyPair() { + return kvGet("signal", "identityKey"); + } + async getLocalRegistrationId() { + return kvGet("signal", "registrationId"); + } + async setIdentity(keyPair, registrationId) { + await kvPut("signal", "identityKey", keyPair); + await kvPut("signal", "registrationId", registrationId); + } + + // Trust-on-first-use: trust a new peer identity; reject if it silently changes. + async isTrustedIdentity(identifier, identityKey /*, direction */) { + const existing = await kvGet("signal", "identity/" + identifier); + if (!existing) return true; + return buffersEqual(existing, identityKey); + } + async saveIdentity(identifier, identityKey) { + const addr = identifier.split(".")[0]; + const existing = await kvGet("signal", "identity/" + addr); + await kvPut("signal", "identity/" + addr, identityKey); + return !!existing && !buffersEqual(existing, identityKey); // true = identity changed + } + async loadIdentityKey(identifier) { + return kvGet("signal", "identity/" + identifier.split(".")[0]); + } + + async loadPreKey(keyId) { + return kvGet("signal", "prekey/" + keyId); + } + async storePreKey(keyId, keyPair) { + return kvPut("signal", "prekey/" + keyId, keyPair); + } + async removePreKey(keyId) { + return kvDel("signal", "prekey/" + keyId); + } + + async loadSignedPreKey(keyId) { + return kvGet("signal", "signedprekey/" + keyId); + } + async storeSignedPreKey(keyId, keyPair) { + return kvPut("signal", "signedprekey/" + keyId, keyPair); + } + async removeSignedPreKey(keyId) { + return kvDel("signal", "signedprekey/" + keyId); + } + + async loadSession(identifier) { + return kvGet("signal", "session/" + identifier); + } + async storeSession(identifier, record) { + return kvPut("signal", "session/" + identifier, record); + } + async removeSession(identifier) { + return kvDel("signal", "session/" + identifier); + } + async removeAllSessions() { + /* not needed for MVP */ + } +} + +function buffersEqual(a, b) { + const ua = new Uint8Array(a); + const ub = new Uint8Array(b); + if (ua.length !== ub.length) return false; + let diff = 0; + for (let i = 0; i < ua.length; i++) diff |= ua[i] ^ ub[i]; + return diff === 0; +} diff --git a/public/js/vendor/libsignal.js b/public/js/vendor/libsignal.js new file mode 100644 index 0000000..9e87a91 --- /dev/null +++ b/public/js/vendor/libsignal.js @@ -0,0 +1,29317 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] +}) : x)(function(x) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x + '" is not supported'); +}); +var __esm = (fn, res, err) => function __init() { + if (err) throw err[0]; + try { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + } catch (e) { + throw err = [e], e; + } +}; +var __commonJS = (cb, mod) => function __require2() { + try { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + } catch (e) { + throw mod = 0, e; + } +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// node_modules/base64-js/index.js +var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + init_inject_buffer(); + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i2 = 0, len = code.length; i2 < len; ++i2) { + lookup[i2] = code[i2]; + revLookup[code.charCodeAt(i2)] = i2; + } + var i2; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i3; + for (i3 = 0; i3 < len2; i3 += 4) { + tmp = revLookup[b64.charCodeAt(i3)] << 18 | revLookup[b64.charCodeAt(i3 + 1)] << 12 | revLookup[b64.charCodeAt(i3 + 2)] << 6 | revLookup[b64.charCodeAt(i3 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i3)] << 2 | revLookup[b64.charCodeAt(i3 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i3)] << 10 | revLookup[b64.charCodeAt(i3 + 1)] << 4 | revLookup[b64.charCodeAt(i3 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i3 = start; i3 < end; i3 += 3) { + tmp = (uint8[i3] << 16 & 16711680) + (uint8[i3 + 1] << 8 & 65280) + (uint8[i3 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i3 = 0, len22 = len2 - extraBytes; i3 < len22; i3 += maxChunkLength) { + parts.push(encodeChunk(uint8, i3, i3 + maxChunkLength > len22 ? len22 : i3 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push( + lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" + ); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push( + lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" + ); + } + return parts.join(""); + } + } +}); + +// node_modules/ieee754/index.js +var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + init_inject_buffer(); + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i2 = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i2]; + i2 += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i2], i2 += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i2], i2 += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i2 = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i2] = m & 255, i2 += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i2] = e & 255, i2 += d, e /= 256, eLen -= 8) { + } + buffer[offset + i2 - d] |= s * 128; + }; + } +}); + +// node_modules/buffer/index.js +var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") { + console.error( + "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support." + ); + } + function typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) return void 0; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ); + } + return allocUnsafe(arg); + } + return from(arg, encodingOrOffset, length); + } + Buffer2.poolSize = 8192; + function from(value, encodingOrOffset, length) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value + ); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === "number") { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length); + } + const b = fromObject(value); + if (b) return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); + } + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value + ); + } + Buffer2.from = function(value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length = byteLength(string, encoding) | 0; + let buf = createBuffer(length); + const actual = buf.write(string, encoding); + if (actual !== length) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i2 = 0; i2 < length; i2 += 1) { + buf[i2] = array[i2] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length === void 0) { + buf = new Uint8Array(array); + } else if (length === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length | 0; + } + function SlowBuffer(length) { + if (+length != length) { + length = 0; + } + return Buffer2.alloc(+length); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ); + } + if (a === b) return 0; + let x = a.length; + let y = b.length; + for (let i2 = 0, len = Math.min(x, y); i2 < len; ++i2) { + if (a[i2] !== b[i2]) { + x = a[i2]; + y = b[i2]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i2; + if (length === void 0) { + length = 0; + for (i2 = 0; i2 < list.length; ++i2) { + length += list[i2].length; + } + } + const buffer = Buffer2.allocUnsafe(length); + let pos = 0; + for (i2 = 0; i2 < list.length; ++i2) { + let buf = list[i2]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string, encoding) { + if (Buffer2.isBuffer(string)) { + return string.length; + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + if (typeof string !== "string") { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string + ); + } + const len = string.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i2 = b[n]; + b[n] = b[m]; + b[m] = i2; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i2 = 0; i2 < len; i2 += 2) { + swap(this, i2, i2 + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i2 = 0; i2 < len; i2 += 4) { + swap(this, i2, i2 + 3); + swap(this, i2 + 1, i2 + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i2 = 0; i2 < len; i2 += 8) { + swap(this, i2, i2 + 7); + swap(this, i2 + 1, i2 + 6); + swap(this, i2 + 2, i2 + 5); + swap(this, i2 + 3, i2 + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length = this.length; + if (length === 0) return ""; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals(b) { + if (!Buffer2.isBuffer(b)) throw new TypeError("Argument must be a Buffer"); + if (this === b) return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target + ); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i2 = 0; i2 < len; ++i2) { + if (thisCopy[i2] !== targetCopy[i2]) { + x = thisCopy[i2]; + y = targetCopy[i2]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1; + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i3) { + if (indexSize === 1) { + return buf[i3]; + } else { + return buf.readUInt16BE(i3 * indexSize); + } + } + let i2; + if (dir) { + let foundIndex = -1; + for (i2 = byteOffset; i2 < arrLength; i2++) { + if (read2(arr, i2) === read2(val, foundIndex === -1 ? 0 : i2 - foundIndex)) { + if (foundIndex === -1) foundIndex = i2; + if (i2 - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i2 -= i2 - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i2 = byteOffset; i2 >= 0; i2--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i2 + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) return i2; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + const strLen = string.length; + if (length > strLen / 2) { + length = strLen / 2; + } + let i2; + for (i2 = 0; i2 < length; ++i2) { + const parsed = parseInt(string.substr(i2 * 2, 2), 16); + if (numberIsNaN(parsed)) return i2; + buf[offset + i2] = parsed; + } + return i2; + } + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + Buffer2.prototype.write = function write(string, offset, length, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length = this.length; + offset = 0; + } else if (length === void 0 && typeof offset === "string") { + encoding = offset; + length = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === void 0) encoding = "utf8"; + } else { + encoding = length; + length = void 0; + } + } else { + throw new Error( + "Buffer.write(string, encoding, offset[, length]) is no longer supported" + ); + } + const remaining = this.length - offset; + if (length === void 0 || length > remaining) length = remaining; + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string, offset, length); + case "utf8": + case "utf-8": + return utf8Write(this, string, offset, length); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string, offset, length); + case "base64": + return base64Write(this, string, offset, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string, offset, length); + default: + if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i2 = start; + while (i2 < end) { + const firstByte = buf[i2]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i2 + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i2 + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i2 + 1]; + thirdByte = buf[i2 + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i2 + 1]; + thirdByte = buf[i2 + 2]; + fourthByte = buf[i2 + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i2 += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i2 = 0; + while (i2 < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i2, i2 += MAX_ARGUMENTS_LENGTH) + ); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i2 = start; i2 < end; ++i2) { + ret += String.fromCharCode(buf[i2] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i2 = start; i2 < end; ++i2) { + ret += String.fromCharCode(buf[i2]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + let out = ""; + for (let i2 = start; i2 < end; ++i2) { + out += hexSliceLookupTable[buf[i2]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i2 = 0; i2 < bytes.length - 1; i2 += 2) { + res += String.fromCharCode(bytes[i2] + bytes[i2 + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + if (end < start) end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint"); + if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i2 = 0; + while (++i2 < byteLength2 && (mul *= 256)) { + val += this[offset + i2] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i2 = 0; + while (++i2 < byteLength2 && (mul *= 256)) { + val += this[offset + i2] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) checkOffset(offset, byteLength2, this.length); + let i2 = byteLength2; + let mul = 1; + let val = this[offset + --i2]; + while (i2 > 0 && (mul *= 256)) { + val += this[offset + --i2] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i2 = 0; + this[offset] = value & 255; + while (++i2 < byteLength2 && (mul *= 256)) { + this[offset + i2] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i2 = byteLength2 - 1; + let mul = 1; + this[offset + i2] = value & 255; + while (--i2 >= 0 && (mul *= 256)) { + this[offset + i2] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i2 = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i2 < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i2 - 1] !== 0) { + sub = 1; + } + this[offset + i2] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i2 = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i2] = value & 255; + while (--i2 >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i2 + 1] !== 0) { + sub = 1; + } + this[offset + i2] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 127, -128); + if (value < 0) value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError("Index out of range"); + if (offset < 0) throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) throw new TypeError("argument should be a Buffer"); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) throw new RangeError("Index out of range"); + if (end < 0) throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) val = 0; + let i2; + if (typeof val === "number") { + for (i2 = start; i2 < end; ++i2) { + this[i2] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i2 = 0; i2 < end - start; ++i2) { + this[i2 + start] = bytes[i2 % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E( + "ERR_BUFFER_OUT_OF_BOUNDS", + function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, + RangeError + ); + E( + "ERR_INVALID_ARG_TYPE", + function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, + TypeError + ); + E( + "ERR_OUT_OF_RANGE", + function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, + RangeError + ); + function addNumericalSeparator(val) { + let res = ""; + let i2 = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i2 >= start + 4; i2 -= 3) { + res = `_${val.slice(i2 - 3, i2)}${res}`; + } + return `${val.slice(0, i2)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE( + type || "offset", + `>= ${type ? 1 : 0} and <= ${length}`, + value + ); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string, units) { + units = units || Infinity; + let codePoint; + const length = string.length; + let leadSurrogate = null; + const bytes = []; + for (let i2 = 0; i2 < length; ++i2) { + codePoint = string.charCodeAt(i2); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + continue; + } else if (i2 + 1 === length) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) break; + bytes.push( + codePoint >> 6 | 192, + codePoint & 63 | 128 + ); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) break; + bytes.push( + codePoint >> 12 | 224, + codePoint >> 6 & 63 | 128, + codePoint & 63 | 128 + ); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) break; + bytes.push( + codePoint >> 18 | 240, + codePoint >> 12 & 63 | 128, + codePoint >> 6 & 63 | 128, + codePoint & 63 | 128 + ); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i2 = 0; i2 < str.length; ++i2) { + byteArray.push(str.charCodeAt(i2) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i2 = 0; i2 < str.length; ++i2) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i2); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src, dst, offset, length) { + let i2; + for (i2 = 0; i2 < length; ++i2) { + if (i2 + offset >= dst.length || i2 >= src.length) break; + dst[i2 + offset] = src[i2]; + } + return i2; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = (function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i2 = 0; i2 < 16; ++i2) { + const i16 = i2 * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i2] + alphabet[j]; + } + } + return table; + })(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } +}); + +// _inject-buffer.js +var import_buffer; +var init_inject_buffer = __esm({ + "_inject-buffer.js"() { + import_buffer = __toESM(require_buffer(), 1); + globalThis.Buffer = import_buffer.Buffer; + } +}); + +// node_modules/@privacyresearch/curve25519-typescript/lib/built/curveasm.js +var require_curveasm = __commonJS({ + "node_modules/@privacyresearch/curve25519-typescript/lib/built/curveasm.js"(exports, module) { + "use strict"; + init_inject_buffer(); + var document2 = document2 || {}; + var Module = (function() { + var _scriptDir = typeof document2 !== "undefined" && document2.currentScript ? document2.currentScript.src : void 0; + if (true) + _scriptDir = _scriptDir || "/index.js"; + return function(Module2) { + Module2 = Module2 || {}; + var Module2 = typeof Module2 !== "undefined" ? Module2 : {}; + var readyPromiseResolve, readyPromiseReject; + Module2["ready"] = new Promise(function(resolve, reject) { + readyPromiseResolve = resolve; + readyPromiseReject = reject; + }); + var moduleOverrides = {}; + var key; + for (key in Module2) { + if (Module2.hasOwnProperty(key)) { + moduleOverrides[key] = Module2[key]; + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function(status, toThrow) { + throw toThrow; + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + var scriptDirectory = ""; + function locateFile(path) { + if (Module2["locateFile"]) { + return Module2["locateFile"](path, scriptDirectory); + } + return scriptDirectory + path; + } + var read_, readAsync, readBinary, setWindowTitle; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + try { + scriptDirectory = __require("path").dirname(scriptDirectory) + "/"; + } catch (e) { + console.log(`'path' module not found`); + } + } else { + scriptDirectory = "//"; + } + read_ = function shell_read(filename, binary) { + var ret = tryParseAsDataURI(filename); + if (ret) { + return binary ? ret : ret.toString(); + } + if (!nodeFS) { + try { + nodeFS = __require("fs"); + } catch (e) { + console.log(`'fs' module not found`); + } + } + if (!nodePath) { + try { + nodePath = __require("path"); + } catch (e) { + console.log(`'path' module not found`); + } + } + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8"); + }; + readBinary = function readBinary2(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret; + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/"); + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function(ex) { + if (!(ex instanceof ExitStatus)) { + throw ex; + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function(status) { + process["exit"](status); + }; + Module2["inspect"] = function() { + return "[Emscripten Module object]"; + }; + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + var data = tryParseAsDataURI(f); + if (data) { + return intArrayToString(data); + } + return read(f); + }; + } + readBinary = function readBinary2(f) { + var data; + data = tryParseAsDataURI(f); + if (data) { + return data; + } + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)); + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data; + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs; + } else if (typeof arguments != "undefined") { + arguments_ = arguments; + } + if (typeof quit === "function") { + quit_ = function(status) { + quit(status); + }; + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") + console = /** @type{!Console} */ + {}; + console.log = /** @type{!function(this:Console, ...*): undefined} */ + print; + console.warn = console.error = /** @type{!function(this:Console, ...*): undefined} */ + typeof printErr !== "undefined" ? printErr : print; + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href; + } else if (document2.currentScript) { + scriptDirectory = document2.currentScript.src; + } + if (_scriptDir) { + scriptDirectory = _scriptDir; + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1); + } else { + scriptDirectory = ""; + } + { + read_ = function shell_read(url) { + try { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText; + } catch (err2) { + var data = tryParseAsDataURI(url); + if (data) { + return intArrayToString(data); + } + throw err2; + } + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary2(url) { + try { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array( + /** @type{!ArrayBuffer} */ + xhr.response + ); + } catch (err2) { + var data = tryParseAsDataURI(url); + if (data) { + return data; + } + throw err2; + } + }; + } + readAsync = function readAsync2(url, onload, onerror) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || xhr.status == 0 && xhr.response) { + onload(xhr.response); + return; + } + var data = tryParseAsDataURI(url); + if (data) { + onload(data.buffer); + return; + } + onerror(); + }; + xhr.onerror = onerror; + xhr.send(null); + }; + } + setWindowTitle = function(title) { + document2.title = title; + }; + } else { + } + var out = Module2["print"] || console.log.bind(console); + var err = Module2["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module2[key] = moduleOverrides[key]; + } + } + moduleOverrides = null; + if (Module2["arguments"]) + arguments_ = Module2["arguments"]; + if (Module2["thisProgram"]) + thisProgram = Module2["thisProgram"]; + if (Module2["quit"]) + quit_ = Module2["quit"]; + var STACK_ALIGN = 16; + function dynamicAlloc(size) { + var ret = HEAP32[DYNAMICTOP_PTR >> 2]; + var end = ret + size + 15 & -16; + HEAP32[DYNAMICTOP_PTR >> 2] = end; + return ret; + } + function alignMemory(size, factor) { + if (!factor) + factor = STACK_ALIGN; + return Math.ceil(size / factor) * factor; + } + function getNativeTypeSize(type) { + switch (type) { + case "i1": + case "i8": + return 1; + case "i16": + return 2; + case "i32": + return 4; + case "i64": + return 8; + case "float": + return 4; + case "double": + return 8; + default: { + if (type[type.length - 1] === "*") { + return 4; + } else if (type[0] === "i") { + var bits = Number(type.substr(1)); + assert(bits % 8 === 0, "getNativeTypeSize invalid bits " + bits + ", type " + type); + return bits / 8; + } else { + return 0; + } + } + } + } + function warnOnce(text) { + if (!warnOnce.shown) + warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text); + } + } + function convertJsFunctionToWasm(func, sig) { + return func; + } + var freeTableIndexes = []; + var functionsInTableMap; + function addFunctionWasm(func, sig) { + var table = wasmTable; + if (!functionsInTableMap) { + functionsInTableMap = /* @__PURE__ */ new WeakMap(); + for (var i2 = 0; i2 < table.length; i2++) { + var item = table.get(i2); + if (item) { + functionsInTableMap.set(item, i2); + } + } + } + if (functionsInTableMap.has(func)) { + return functionsInTableMap.get(func); + } + var ret; + if (freeTableIndexes.length) { + ret = freeTableIndexes.pop(); + } else { + ret = table.length; + try { + table.grow(1); + } catch (err2) { + if (!(err2 instanceof RangeError)) { + throw err2; + } + throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."; + } + } + try { + table.set(ret, func); + } catch (err2) { + if (!(err2 instanceof TypeError)) { + throw err2; + } + var wrapped = convertJsFunctionToWasm(func, sig); + table.set(ret, wrapped); + } + functionsInTableMap.set(func, ret); + return ret; + } + function removeFunctionWasm(index) { + functionsInTableMap.delete(wasmTable.get(index)); + freeTableIndexes.push(index); + } + function addFunction(func, sig) { + return addFunctionWasm(func, sig); + } + function removeFunction(index) { + removeFunctionWasm(index); + } + var funcWrappers = {}; + function getFuncWrapper(func, sig) { + if (!func) + return; + assert(sig); + if (!funcWrappers[sig]) { + funcWrappers[sig] = {}; + } + var sigCache = funcWrappers[sig]; + if (!sigCache[func]) { + if (sig.length === 1) { + sigCache[func] = function dynCall_wrapper() { + return dynCall(sig, func); + }; + } else if (sig.length === 2) { + sigCache[func] = function dynCall_wrapper(arg) { + return dynCall(sig, func, [arg]); + }; + } else { + sigCache[func] = function dynCall_wrapper() { + return dynCall(sig, func, Array.prototype.slice.call(arguments)); + }; + } + } + return sigCache[func]; + } + function makeBigInt(low, high, unsigned) { + return unsigned ? +(low >>> 0) + +(high >>> 0) * 4294967296 : +(low >>> 0) + +(high | 0) * 4294967296; + } + function dynCall(sig, ptr, args) { + if (args && args.length) { + return Module2["dynCall_" + sig].apply(null, [ptr].concat(args)); + } else { + return Module2["dynCall_" + sig].call(null, ptr); + } + } + var tempRet0 = 0; + var setTempRet0 = function(value) { + tempRet0 = value; + }; + var getTempRet0 = function() { + return tempRet0; + }; + var GLOBAL_BASE = 1024; + var wasmBinary; + if (Module2["wasmBinary"]) + wasmBinary = Module2["wasmBinary"]; + var noExitRuntime; + if (Module2["noExitRuntime"]) + noExitRuntime = Module2["noExitRuntime"]; + var WebAssembly2 = { + Memory: ( + /** @constructor */ + function(opts) { + return { + buffer: new ArrayBuffer(opts["initial"] * 65536), + grow: function(amount) { + var ret = __growWasmMemory(amount); + return ret; + } + }; + } + ), + Table: function(opts) { + var ret = new Array(opts["initial"]); + ret.grow = function(by) { + if (ret.length >= 1 + 0) { + abort("Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH."); + } + ret.push(null); + }; + ret.set = function(i2, func) { + ret[i2] = func; + }; + ret.get = function(i2) { + return ret[i2]; + }; + return ret; + }, + Module: function(binary) { + return {}; + }, + Instance: function(module2, info) { + var exports2 = (function instantiate(asmLibraryArg2, wasmMemory2, wasmTable2) { + function asmFunc(global2, env, buffer2) { + var memory = env.memory; + var HEAP82 = new global2.Int8Array(buffer2); + var HEAP162 = new global2.Int16Array(buffer2); + var HEAP322 = new global2.Int32Array(buffer2); + var HEAPU82 = new global2.Uint8Array(buffer2); + var HEAPU162 = new global2.Uint16Array(buffer2); + var HEAPU322 = new global2.Uint32Array(buffer2); + var HEAPF322 = new global2.Float32Array(buffer2); + var HEAPF642 = new global2.Float64Array(buffer2); + var Math_imul2 = global2.Math.imul; + var Math_fround2 = global2.Math.fround; + var Math_abs2 = global2.Math.abs; + var Math_clz322 = global2.Math.clz32; + var Math_min2 = global2.Math.min; + var Math_max2 = global2.Math.max; + var Math_floor2 = global2.Math.floor; + var Math_ceil2 = global2.Math.ceil; + var Math_sqrt2 = global2.Math.sqrt; + var abort2 = env.abort; + var nan = global2.NaN; + var infinity = global2.Infinity; + var fimport$0 = env.emscripten_memcpy_big; + var fimport$1 = env.emscripten_resize_heap; + var global$0 = 5277136; + var global$1 = 34084; + var i64toi32_i32$HIGH_BITS = 0; + function $1() { + } + function $2($0, $1_1) { + return ((HEAPU82[$1_1 + 1 | 0] ^ HEAPU82[$0 + 1 | 0] | HEAPU82[$1_1 | 0] ^ HEAPU82[$0 | 0] | HEAPU82[$1_1 + 2 | 0] ^ HEAPU82[$0 + 2 | 0] | HEAPU82[$1_1 + 3 | 0] ^ HEAPU82[$0 + 3 | 0] | HEAPU82[$1_1 + 4 | 0] ^ HEAPU82[$0 + 4 | 0] | HEAPU82[$1_1 + 5 | 0] ^ HEAPU82[$0 + 5 | 0] | HEAPU82[$1_1 + 6 | 0] ^ HEAPU82[$0 + 6 | 0] | HEAPU82[$1_1 + 7 | 0] ^ HEAPU82[$0 + 7 | 0] | HEAPU82[$1_1 + 8 | 0] ^ HEAPU82[$0 + 8 | 0] | HEAPU82[$1_1 + 9 | 0] ^ HEAPU82[$0 + 9 | 0] | HEAPU82[$1_1 + 10 | 0] ^ HEAPU82[$0 + 10 | 0] | HEAPU82[$1_1 + 11 | 0] ^ HEAPU82[$0 + 11 | 0] | HEAPU82[$1_1 + 12 | 0] ^ HEAPU82[$0 + 12 | 0] | HEAPU82[$1_1 + 13 | 0] ^ HEAPU82[$0 + 13 | 0] | HEAPU82[$1_1 + 14 | 0] ^ HEAPU82[$0 + 14 | 0] | HEAPU82[$1_1 + 15 | 0] ^ HEAPU82[$0 + 15 | 0] | HEAPU82[$1_1 + 16 | 0] ^ HEAPU82[$0 + 16 | 0] | HEAPU82[$1_1 + 17 | 0] ^ HEAPU82[$0 + 17 | 0] | HEAPU82[$1_1 + 18 | 0] ^ HEAPU82[$0 + 18 | 0] | HEAPU82[$1_1 + 19 | 0] ^ HEAPU82[$0 + 19 | 0] | HEAPU82[$1_1 + 20 | 0] ^ HEAPU82[$0 + 20 | 0] | HEAPU82[$1_1 + 21 | 0] ^ HEAPU82[$0 + 21 | 0] | HEAPU82[$1_1 + 22 | 0] ^ HEAPU82[$0 + 22 | 0] | HEAPU82[$1_1 + 23 | 0] ^ HEAPU82[$0 + 23 | 0] | HEAPU82[$1_1 + 24 | 0] ^ HEAPU82[$0 + 24 | 0] | HEAPU82[$1_1 + 25 | 0] ^ HEAPU82[$0 + 25 | 0] | HEAPU82[$1_1 + 26 | 0] ^ HEAPU82[$0 + 26 | 0] | HEAPU82[$1_1 + 27 | 0] ^ HEAPU82[$0 + 27 | 0] | HEAPU82[$1_1 + 28 | 0] ^ HEAPU82[$0 + 28 | 0] | HEAPU82[$1_1 + 29 | 0] ^ HEAPU82[$0 + 29 | 0] | HEAPU82[$1_1 + 30 | 0] ^ HEAPU82[$0 + 30 | 0] | HEAPU82[$1_1 + 31 | 0] ^ HEAPU82[$0 + 31 | 0]) + -1 >>> 8 & 1) + -1 | 0; + } + function $3($0, $1_1, $2_1, $3_1) { + $0 = $0 | 0; + $1_1 = $1_1 | 0; + $2_1 = $2_1 | 0; + $3_1 = $3_1 | 0; + var $4_1 = 0, $5_1 = 0, $6_1 = 0; + $5_1 = global$0 - 240 | 0; + global$0 = $5_1; + $4_1 = $5_1 - ($3_1 + 79 & -16) | 0; + global$0 = $4_1; + HEAP322[$5_1 + 8 >> 2] = 0; + HEAP322[$5_1 + 12 >> 2] = 0; + $6_1 = HEAPU82[$1_1 + 20 | 0] | HEAPU82[$1_1 + 21 | 0] << 8 | (HEAPU82[$1_1 + 22 | 0] << 16 | HEAPU82[$1_1 + 23 | 0] << 24); + HEAP322[$5_1 + 32 >> 2] = HEAPU82[$1_1 + 16 | 0] | HEAPU82[$1_1 + 17 | 0] << 8 | (HEAPU82[$1_1 + 18 | 0] << 16 | HEAPU82[$1_1 + 19 | 0] << 24); + HEAP322[$5_1 + 36 >> 2] = $6_1; + $6_1 = HEAPU82[$1_1 + 28 | 0] | HEAPU82[$1_1 + 29 | 0] << 8 | (HEAPU82[$1_1 + 30 | 0] << 16 | HEAPU82[$1_1 + 31 | 0] << 24); + HEAP322[$5_1 + 40 >> 2] = HEAPU82[$1_1 + 24 | 0] | HEAPU82[$1_1 + 25 | 0] << 8 | (HEAPU82[$1_1 + 26 | 0] << 16 | HEAPU82[$1_1 + 27 | 0] << 24); + HEAP322[$5_1 + 44 >> 2] = $6_1; + $6_1 = HEAPU82[$1_1 + 4 | 0] | HEAPU82[$1_1 + 5 | 0] << 8 | (HEAPU82[$1_1 + 6 | 0] << 16 | HEAPU82[$1_1 + 7 | 0] << 24); + HEAP322[$5_1 + 16 >> 2] = HEAPU82[$1_1 | 0] | HEAPU82[$1_1 + 1 | 0] << 8 | (HEAPU82[$1_1 + 2 | 0] << 16 | HEAPU82[$1_1 + 3 | 0] << 24); + HEAP322[$5_1 + 20 >> 2] = $6_1; + $6_1 = HEAPU82[$1_1 + 12 | 0] | HEAPU82[$1_1 + 13 | 0] << 8 | (HEAPU82[$1_1 + 14 | 0] << 16 | HEAPU82[$1_1 + 15 | 0] << 24); + HEAP322[$5_1 + 24 >> 2] = HEAPU82[$1_1 + 8 | 0] | HEAPU82[$1_1 + 9 | 0] << 8 | (HEAPU82[$1_1 + 10 | 0] << 16 | HEAPU82[$1_1 + 11 | 0] << 24); + HEAP322[$5_1 + 28 >> 2] = $6_1; + $61($5_1 + 80 | 0, $1_1); + $57($5_1 + 48 | 0, $5_1 + 80 | 0); + $1_1 = HEAPU82[$5_1 + 79 | 0]; + $6($4_1, $5_1 + 8 | 0, $2_1, $3_1, $5_1 + 16 | 0); + $3_1 = HEAPU82[$4_1 + 60 | 0] | HEAPU82[$4_1 + 61 | 0] << 8 | (HEAPU82[$4_1 + 62 | 0] << 16 | HEAPU82[$4_1 + 63 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 56 | 0] | HEAPU82[$4_1 + 57 | 0] << 8 | (HEAPU82[$4_1 + 58 | 0] << 16 | HEAPU82[$4_1 + 59 | 0] << 24); + HEAP82[$0 + 56 | 0] = $2_1; + HEAP82[$0 + 57 | 0] = $2_1 >>> 8; + HEAP82[$0 + 58 | 0] = $2_1 >>> 16; + HEAP82[$0 + 59 | 0] = $2_1 >>> 24; + HEAP82[$0 + 60 | 0] = $3_1; + HEAP82[$0 + 61 | 0] = $3_1 >>> 8; + HEAP82[$0 + 62 | 0] = $3_1 >>> 16; + HEAP82[$0 + 63 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 52 | 0] | HEAPU82[$4_1 + 53 | 0] << 8 | (HEAPU82[$4_1 + 54 | 0] << 16 | HEAPU82[$4_1 + 55 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 48 | 0] | HEAPU82[$4_1 + 49 | 0] << 8 | (HEAPU82[$4_1 + 50 | 0] << 16 | HEAPU82[$4_1 + 51 | 0] << 24); + HEAP82[$0 + 48 | 0] = $2_1; + HEAP82[$0 + 49 | 0] = $2_1 >>> 8; + HEAP82[$0 + 50 | 0] = $2_1 >>> 16; + HEAP82[$0 + 51 | 0] = $2_1 >>> 24; + HEAP82[$0 + 52 | 0] = $3_1; + HEAP82[$0 + 53 | 0] = $3_1 >>> 8; + HEAP82[$0 + 54 | 0] = $3_1 >>> 16; + HEAP82[$0 + 55 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 44 | 0] | HEAPU82[$4_1 + 45 | 0] << 8 | (HEAPU82[$4_1 + 46 | 0] << 16 | HEAPU82[$4_1 + 47 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 40 | 0] | HEAPU82[$4_1 + 41 | 0] << 8 | (HEAPU82[$4_1 + 42 | 0] << 16 | HEAPU82[$4_1 + 43 | 0] << 24); + HEAP82[$0 + 40 | 0] = $2_1; + HEAP82[$0 + 41 | 0] = $2_1 >>> 8; + HEAP82[$0 + 42 | 0] = $2_1 >>> 16; + HEAP82[$0 + 43 | 0] = $2_1 >>> 24; + HEAP82[$0 + 44 | 0] = $3_1; + HEAP82[$0 + 45 | 0] = $3_1 >>> 8; + HEAP82[$0 + 46 | 0] = $3_1 >>> 16; + HEAP82[$0 + 47 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 36 | 0] | HEAPU82[$4_1 + 37 | 0] << 8 | (HEAPU82[$4_1 + 38 | 0] << 16 | HEAPU82[$4_1 + 39 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 32 | 0] | HEAPU82[$4_1 + 33 | 0] << 8 | (HEAPU82[$4_1 + 34 | 0] << 16 | HEAPU82[$4_1 + 35 | 0] << 24); + HEAP82[$0 + 32 | 0] = $2_1; + HEAP82[$0 + 33 | 0] = $2_1 >>> 8; + HEAP82[$0 + 34 | 0] = $2_1 >>> 16; + HEAP82[$0 + 35 | 0] = $2_1 >>> 24; + HEAP82[$0 + 36 | 0] = $3_1; + HEAP82[$0 + 37 | 0] = $3_1 >>> 8; + HEAP82[$0 + 38 | 0] = $3_1 >>> 16; + HEAP82[$0 + 39 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 28 | 0] | HEAPU82[$4_1 + 29 | 0] << 8 | (HEAPU82[$4_1 + 30 | 0] << 16 | HEAPU82[$4_1 + 31 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 24 | 0] | HEAPU82[$4_1 + 25 | 0] << 8 | (HEAPU82[$4_1 + 26 | 0] << 16 | HEAPU82[$4_1 + 27 | 0] << 24); + HEAP82[$0 + 24 | 0] = $2_1; + HEAP82[$0 + 25 | 0] = $2_1 >>> 8; + HEAP82[$0 + 26 | 0] = $2_1 >>> 16; + HEAP82[$0 + 27 | 0] = $2_1 >>> 24; + HEAP82[$0 + 28 | 0] = $3_1; + HEAP82[$0 + 29 | 0] = $3_1 >>> 8; + HEAP82[$0 + 30 | 0] = $3_1 >>> 16; + HEAP82[$0 + 31 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 20 | 0] | HEAPU82[$4_1 + 21 | 0] << 8 | (HEAPU82[$4_1 + 22 | 0] << 16 | HEAPU82[$4_1 + 23 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 16 | 0] | HEAPU82[$4_1 + 17 | 0] << 8 | (HEAPU82[$4_1 + 18 | 0] << 16 | HEAPU82[$4_1 + 19 | 0] << 24); + HEAP82[$0 + 16 | 0] = $2_1; + HEAP82[$0 + 17 | 0] = $2_1 >>> 8; + HEAP82[$0 + 18 | 0] = $2_1 >>> 16; + HEAP82[$0 + 19 | 0] = $2_1 >>> 24; + HEAP82[$0 + 20 | 0] = $3_1; + HEAP82[$0 + 21 | 0] = $3_1 >>> 8; + HEAP82[$0 + 22 | 0] = $3_1 >>> 16; + HEAP82[$0 + 23 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 12 | 0] | HEAPU82[$4_1 + 13 | 0] << 8 | (HEAPU82[$4_1 + 14 | 0] << 16 | HEAPU82[$4_1 + 15 | 0] << 24); + $2_1 = HEAPU82[$4_1 + 8 | 0] | HEAPU82[$4_1 + 9 | 0] << 8 | (HEAPU82[$4_1 + 10 | 0] << 16 | HEAPU82[$4_1 + 11 | 0] << 24); + HEAP82[$0 + 8 | 0] = $2_1; + HEAP82[$0 + 9 | 0] = $2_1 >>> 8; + HEAP82[$0 + 10 | 0] = $2_1 >>> 16; + HEAP82[$0 + 11 | 0] = $2_1 >>> 24; + HEAP82[$0 + 12 | 0] = $3_1; + HEAP82[$0 + 13 | 0] = $3_1 >>> 8; + HEAP82[$0 + 14 | 0] = $3_1 >>> 16; + HEAP82[$0 + 15 | 0] = $3_1 >>> 24; + $3_1 = HEAPU82[$4_1 + 4 | 0] | HEAPU82[$4_1 + 5 | 0] << 8 | (HEAPU82[$4_1 + 6 | 0] << 16 | HEAPU82[$4_1 + 7 | 0] << 24); + $2_1 = HEAPU82[$4_1 | 0] | HEAPU82[$4_1 + 1 | 0] << 8 | (HEAPU82[$4_1 + 2 | 0] << 16 | HEAPU82[$4_1 + 3 | 0] << 24); + HEAP82[$0 | 0] = $2_1; + HEAP82[$0 + 1 | 0] = $2_1 >>> 8; + HEAP82[$0 + 2 | 0] = $2_1 >>> 16; + HEAP82[$0 + 3 | 0] = $2_1 >>> 24; + HEAP82[$0 + 4 | 0] = $3_1; + HEAP82[$0 + 5 | 0] = $3_1 >>> 8; + HEAP82[$0 + 6 | 0] = $3_1 >>> 16; + HEAP82[$0 + 7 | 0] = $3_1 >>> 24; + HEAP82[$0 + 63 | 0] = HEAPU82[$0 + 63 | 0] | $1_1 & 128; + global$0 = $5_1 + 240 | 0; + } + function $4($0, $1_1, $2_1, $3_1) { + $0 = $0 | 0; + $1_1 = $1_1 | 0; + $2_1 = $2_1 | 0; + $3_1 = $3_1 | 0; + var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0; + $6_1 = global$0 - 336 | 0; + global$0 = $6_1; + $5_1 = $3_1 + 79 & -16; + $4_1 = $6_1 - $5_1 | 0; + global$0 = $4_1; + $7_1 = $4_1 - $5_1 | 0; + global$0 = $7_1; + $32($6_1 + 288 | 0, $1_1); + $28($6_1 + 96 | 0); + $43($6_1 + 240 | 0, $6_1 + 288 | 0, $6_1 + 96 | 0); + $29($6_1 + 192 | 0, $6_1 + 288 | 0, $6_1 + 96 | 0); + $35($6_1 + 144 | 0, $6_1 + 192 | 0); + $38($6_1 + 48 | 0, $6_1 + 240 | 0, $6_1 + 144 | 0); + $44($6_1 + 16 | 0, $6_1 + 48 | 0); + $1_1 = HEAPU82[$0 + 63 | 0]; + HEAP82[$6_1 + 47 | 0] = HEAPU82[$6_1 + 47 | 0] | $1_1 & 128; + HEAP82[$0 + 63 | 0] = $1_1 & 127; + $1_1 = HEAPU82[$0 + 52 | 0] | HEAPU82[$0 + 53 | 0] << 8 | (HEAPU82[$0 + 54 | 0] << 16 | HEAPU82[$0 + 55 | 0] << 24); + $5_1 = HEAPU82[$0 + 48 | 0] | HEAPU82[$0 + 49 | 0] << 8 | (HEAPU82[$0 + 50 | 0] << 16 | HEAPU82[$0 + 51 | 0] << 24); + HEAP82[$4_1 + 48 | 0] = $5_1; + HEAP82[$4_1 + 49 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 50 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 51 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 52 | 0] = $1_1; + HEAP82[$4_1 + 53 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 54 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 55 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 44 | 0] | HEAPU82[$0 + 45 | 0] << 8 | (HEAPU82[$0 + 46 | 0] << 16 | HEAPU82[$0 + 47 | 0] << 24); + $5_1 = HEAPU82[$0 + 40 | 0] | HEAPU82[$0 + 41 | 0] << 8 | (HEAPU82[$0 + 42 | 0] << 16 | HEAPU82[$0 + 43 | 0] << 24); + HEAP82[$4_1 + 40 | 0] = $5_1; + HEAP82[$4_1 + 41 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 42 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 43 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 44 | 0] = $1_1; + HEAP82[$4_1 + 45 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 46 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 47 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 36 | 0] | HEAPU82[$0 + 37 | 0] << 8 | (HEAPU82[$0 + 38 | 0] << 16 | HEAPU82[$0 + 39 | 0] << 24); + $5_1 = HEAPU82[$0 + 32 | 0] | HEAPU82[$0 + 33 | 0] << 8 | (HEAPU82[$0 + 34 | 0] << 16 | HEAPU82[$0 + 35 | 0] << 24); + HEAP82[$4_1 + 32 | 0] = $5_1; + HEAP82[$4_1 + 33 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 34 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 35 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 36 | 0] = $1_1; + HEAP82[$4_1 + 37 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 38 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 39 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 28 | 0] | HEAPU82[$0 + 29 | 0] << 8 | (HEAPU82[$0 + 30 | 0] << 16 | HEAPU82[$0 + 31 | 0] << 24); + $5_1 = HEAPU82[$0 + 24 | 0] | HEAPU82[$0 + 25 | 0] << 8 | (HEAPU82[$0 + 26 | 0] << 16 | HEAPU82[$0 + 27 | 0] << 24); + HEAP82[$4_1 + 24 | 0] = $5_1; + HEAP82[$4_1 + 25 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 26 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 27 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 28 | 0] = $1_1; + HEAP82[$4_1 + 29 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 30 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 31 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 20 | 0] | HEAPU82[$0 + 21 | 0] << 8 | (HEAPU82[$0 + 22 | 0] << 16 | HEAPU82[$0 + 23 | 0] << 24); + $5_1 = HEAPU82[$0 + 16 | 0] | HEAPU82[$0 + 17 | 0] << 8 | (HEAPU82[$0 + 18 | 0] << 16 | HEAPU82[$0 + 19 | 0] << 24); + HEAP82[$4_1 + 16 | 0] = $5_1; + HEAP82[$4_1 + 17 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 18 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 19 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 20 | 0] = $1_1; + HEAP82[$4_1 + 21 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 22 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 23 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 12 | 0] | HEAPU82[$0 + 13 | 0] << 8 | (HEAPU82[$0 + 14 | 0] << 16 | HEAPU82[$0 + 15 | 0] << 24); + $5_1 = HEAPU82[$0 + 8 | 0] | HEAPU82[$0 + 9 | 0] << 8 | (HEAPU82[$0 + 10 | 0] << 16 | HEAPU82[$0 + 11 | 0] << 24); + HEAP82[$4_1 + 8 | 0] = $5_1; + HEAP82[$4_1 + 9 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 10 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 11 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 12 | 0] = $1_1; + HEAP82[$4_1 + 13 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 14 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 15 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 4 | 0] | HEAPU82[$0 + 5 | 0] << 8 | (HEAPU82[$0 + 6 | 0] << 16 | HEAPU82[$0 + 7 | 0] << 24); + $5_1 = HEAPU82[$0 | 0] | HEAPU82[$0 + 1 | 0] << 8 | (HEAPU82[$0 + 2 | 0] << 16 | HEAPU82[$0 + 3 | 0] << 24); + HEAP82[$4_1 | 0] = $5_1; + HEAP82[$4_1 + 1 | 0] = $5_1 >>> 8; + HEAP82[$4_1 + 2 | 0] = $5_1 >>> 16; + HEAP82[$4_1 + 3 | 0] = $5_1 >>> 24; + HEAP82[$4_1 + 4 | 0] = $1_1; + HEAP82[$4_1 + 5 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 6 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 7 | 0] = $1_1 >>> 24; + $1_1 = HEAPU82[$0 + 60 | 0] | HEAPU82[$0 + 61 | 0] << 8 | (HEAPU82[$0 + 62 | 0] << 16 | HEAPU82[$0 + 63 | 0] << 24); + $0 = HEAPU82[$0 + 56 | 0] | HEAPU82[$0 + 57 | 0] << 8 | (HEAPU82[$0 + 58 | 0] << 16 | HEAPU82[$0 + 59 | 0] << 24); + HEAP82[$4_1 + 56 | 0] = $0; + HEAP82[$4_1 + 57 | 0] = $0 >>> 8; + HEAP82[$4_1 + 58 | 0] = $0 >>> 16; + HEAP82[$4_1 + 59 | 0] = $0 >>> 24; + HEAP82[$4_1 + 60 | 0] = $1_1; + HEAP82[$4_1 + 61 | 0] = $1_1 >>> 8; + HEAP82[$4_1 + 62 | 0] = $1_1 >>> 16; + HEAP82[$4_1 + 63 | 0] = $1_1 >>> 24; + $78($4_1 - -64 | 0, $2_1, $3_1); + $0 = $67($7_1, $6_1 + 8 | 0, $4_1, $3_1 - -64 | 0, $6_1 + 16 | 0); + global$0 = $6_1 + 336 | 0; + return $0 | 0; + } + function $5($0, $1_1, $2_1) { + var $3_1 = 0; + $3_1 = global$0 - 208 | 0; + global$0 = $3_1; + $70($3_1 + 8 | 0); + $71($3_1 + 8 | 0, $1_1, $2_1); + $1_1 = $3_1 + 8 | 0; + $75($1_1, $0); + $70($1_1); + global$0 = $3_1 + 208 | 0; + } + function $6($0, $1_1, $2_1, $3_1, $4_1) { + var $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0; + $7_1 = global$0 - 320 | 0; + global$0 = $7_1; + $6_1 = HEAPU82[$4_1 + 52 | 0] | HEAPU82[$4_1 + 53 | 0] << 8 | (HEAPU82[$4_1 + 54 | 0] << 16 | HEAPU82[$4_1 + 55 | 0] << 24); + $14_1 = $7_1 + 304 | 0; + $5_1 = $14_1; + HEAP322[$5_1 >> 2] = HEAPU82[$4_1 + 48 | 0] | HEAPU82[$4_1 + 49 | 0] << 8 | (HEAPU82[$4_1 + 50 | 0] << 16 | HEAPU82[$4_1 + 51 | 0] << 24); + HEAP322[$5_1 + 4 >> 2] = $6_1; + $6_1 = HEAPU82[$4_1 + 60 | 0] | HEAPU82[$4_1 + 61 | 0] << 8 | (HEAPU82[$4_1 + 62 | 0] << 16 | HEAPU82[$4_1 + 63 | 0] << 24); + $15_1 = $7_1 + 312 | 0; + $5_1 = $15_1; + HEAP322[$5_1 >> 2] = HEAPU82[$4_1 + 56 | 0] | HEAPU82[$4_1 + 57 | 0] << 8 | (HEAPU82[$4_1 + 58 | 0] << 16 | HEAPU82[$4_1 + 59 | 0] << 24); + HEAP322[$5_1 + 4 >> 2] = $6_1; + $6_1 = HEAPU82[$4_1 + 36 | 0] | HEAPU82[$4_1 + 37 | 0] << 8 | (HEAPU82[$4_1 + 38 | 0] << 16 | HEAPU82[$4_1 + 39 | 0] << 24); + HEAP322[$7_1 + 288 >> 2] = HEAPU82[$4_1 + 32 | 0] | HEAPU82[$4_1 + 33 | 0] << 8 | (HEAPU82[$4_1 + 34 | 0] << 16 | HEAPU82[$4_1 + 35 | 0] << 24); + HEAP322[$7_1 + 292 >> 2] = $6_1; + $6_1 = HEAPU82[$4_1 + 44 | 0] | HEAPU82[$4_1 + 45 | 0] << 8 | (HEAPU82[$4_1 + 46 | 0] << 16 | HEAPU82[$4_1 + 47 | 0] << 24); + HEAP322[$7_1 + 296 >> 2] = HEAPU82[$4_1 + 40 | 0] | HEAPU82[$4_1 + 41 | 0] << 8 | (HEAPU82[$4_1 + 42 | 0] << 16 | HEAPU82[$4_1 + 43 | 0] << 24); + HEAP322[$7_1 + 300 >> 2] = $6_1; + $16_1 = $3_1 - -64 | 0; + HEAP322[$1_1 >> 2] = $16_1; + HEAP322[$1_1 + 4 >> 2] = 0 - (($3_1 >>> 0 < 4294967232) + -1 | 0); + $80($0 - -64 | 0, $2_1, $3_1); + $8_1 = HEAPU82[$4_1 + 8 | 0] | HEAPU82[$4_1 + 9 | 0] << 8 | (HEAPU82[$4_1 + 10 | 0] << 16 | HEAPU82[$4_1 + 11 | 0] << 24); + $9_1 = HEAPU82[$4_1 + 12 | 0] | HEAPU82[$4_1 + 13 | 0] << 8 | (HEAPU82[$4_1 + 14 | 0] << 16 | HEAPU82[$4_1 + 15 | 0] << 24); + $5_1 = HEAPU82[$4_1 + 16 | 0] | HEAPU82[$4_1 + 17 | 0] << 8 | (HEAPU82[$4_1 + 18 | 0] << 16 | HEAPU82[$4_1 + 19 | 0] << 24); + $10_1 = HEAPU82[$4_1 + 20 | 0] | HEAPU82[$4_1 + 21 | 0] << 8 | (HEAPU82[$4_1 + 22 | 0] << 16 | HEAPU82[$4_1 + 23 | 0] << 24); + $11_1 = HEAPU82[$4_1 | 0] | HEAPU82[$4_1 + 1 | 0] << 8 | (HEAPU82[$4_1 + 2 | 0] << 16 | HEAPU82[$4_1 + 3 | 0] << 24); + $12_1 = HEAPU82[$4_1 + 4 | 0] | HEAPU82[$4_1 + 5 | 0] << 8 | (HEAPU82[$4_1 + 6 | 0] << 16 | HEAPU82[$4_1 + 7 | 0] << 24); + $6_1 = HEAPU82[$4_1 + 28 | 0] | HEAPU82[$4_1 + 29 | 0] << 8 | (HEAPU82[$4_1 + 30 | 0] << 16 | HEAPU82[$4_1 + 31 | 0] << 24); + $1_1 = $0 + 56 | 0; + $2_1 = $1_1; + $13_1 = HEAPU82[$4_1 + 24 | 0] | HEAPU82[$4_1 + 25 | 0] << 8 | (HEAPU82[$4_1 + 26 | 0] << 16 | HEAPU82[$4_1 + 27 | 0] << 24); + HEAP82[$2_1 | 0] = $13_1; + HEAP82[$2_1 + 1 | 0] = $13_1 >>> 8; + HEAP82[$2_1 + 2 | 0] = $13_1 >>> 16; + HEAP82[$2_1 + 3 | 0] = $13_1 >>> 24; + HEAP82[$2_1 + 4 | 0] = $6_1; + HEAP82[$2_1 + 5 | 0] = $6_1 >>> 8; + HEAP82[$2_1 + 6 | 0] = $6_1 >>> 16; + HEAP82[$2_1 + 7 | 0] = $6_1 >>> 24; + $2_1 = $0 + 48 | 0; + HEAP82[$2_1 | 0] = $5_1; + HEAP82[$2_1 + 1 | 0] = $5_1 >>> 8; + HEAP82[$2_1 + 2 | 0] = $5_1 >>> 16; + HEAP82[$2_1 + 3 | 0] = $5_1 >>> 24; + HEAP82[$2_1 + 4 | 0] = $10_1; + HEAP82[$2_1 + 5 | 0] = $10_1 >>> 8; + HEAP82[$2_1 + 6 | 0] = $10_1 >>> 16; + HEAP82[$2_1 + 7 | 0] = $10_1 >>> 24; + $6_1 = $0 + 40 | 0; + $5_1 = $6_1; + HEAP82[$5_1 | 0] = $8_1; + HEAP82[$5_1 + 1 | 0] = $8_1 >>> 8; + HEAP82[$5_1 + 2 | 0] = $8_1 >>> 16; + HEAP82[$5_1 + 3 | 0] = $8_1 >>> 24; + HEAP82[$5_1 + 4 | 0] = $9_1; + HEAP82[$5_1 + 5 | 0] = $9_1 >>> 8; + HEAP82[$5_1 + 6 | 0] = $9_1 >>> 16; + HEAP82[$5_1 + 7 | 0] = $9_1 >>> 24; + HEAP82[$0 + 32 | 0] = $11_1; + HEAP82[$0 + 33 | 0] = $11_1 >>> 8; + HEAP82[$0 + 34 | 0] = $11_1 >>> 16; + HEAP82[$0 + 35 | 0] = $11_1 >>> 24; + HEAP82[$0 + 36 | 0] = $12_1; + HEAP82[$0 + 37 | 0] = $12_1 >>> 8; + HEAP82[$0 + 38 | 0] = $12_1 >>> 16; + HEAP82[$0 + 39 | 0] = $12_1 >>> 24; + $8_1 = $0 + 32 | 0; + $5($7_1 + 224 | 0, $8_1, $3_1 + 32 | 0); + $3_1 = HEAP322[$15_1 + 4 >> 2]; + $5_1 = HEAP322[$15_1 >> 2]; + HEAP82[$1_1 | 0] = $5_1; + HEAP82[$1_1 + 1 | 0] = $5_1 >>> 8; + HEAP82[$1_1 + 2 | 0] = $5_1 >>> 16; + HEAP82[$1_1 + 3 | 0] = $5_1 >>> 24; + HEAP82[$1_1 + 4 | 0] = $3_1; + HEAP82[$1_1 + 5 | 0] = $3_1 >>> 8; + HEAP82[$1_1 + 6 | 0] = $3_1 >>> 16; + HEAP82[$1_1 + 7 | 0] = $3_1 >>> 24; + $1_1 = HEAP322[$14_1 + 4 >> 2]; + $3_1 = HEAP322[$14_1 >> 2]; + HEAP82[$2_1 | 0] = $3_1; + HEAP82[$2_1 + 1 | 0] = $3_1 >>> 8; + HEAP82[$2_1 + 2 | 0] = $3_1 >>> 16; + HEAP82[$2_1 + 3 | 0] = $3_1 >>> 24; + HEAP82[$2_1 + 4 | 0] = $1_1; + HEAP82[$2_1 + 5 | 0] = $1_1 >>> 8; + HEAP82[$2_1 + 6 | 0] = $1_1 >>> 16; + HEAP82[$2_1 + 7 | 0] = $1_1 >>> 24; + $1_1 = HEAP322[$7_1 + 300 >> 2]; + $2_1 = HEAP322[$7_1 + 296 >> 2]; + HEAP82[$6_1 | 0] = $2_1; + HEAP82[$6_1 + 1 | 0] = $2_1 >>> 8; + HEAP82[$6_1 + 2 | 0] = $2_1 >>> 16; + HEAP82[$6_1 + 3 | 0] = $2_1 >>> 24; + HEAP82[$6_1 + 4 | 0] = $1_1; + HEAP82[$6_1 + 5 | 0] = $1_1 >>> 8; + HEAP82[$6_1 + 6 | 0] = $1_1 >>> 16; + HEAP82[$6_1 + 7 | 0] = $1_1 >>> 24; + $1_1 = HEAP322[$7_1 + 292 >> 2]; + $2_1 = HEAP322[$7_1 + 288 >> 2]; + HEAP82[$0 + 32 | 0] = $2_1; + HEAP82[$0 + 33 | 0] = $2_1 >>> 8; + HEAP82[$0 + 34 | 0] = $2_1 >>> 16; + HEAP82[$0 + 35 | 0] = $2_1 >>> 24; + HEAP82[$0 + 36 | 0] = $1_1; + HEAP82[$0 + 37 | 0] = $1_1 >>> 8; + HEAP82[$0 + 38 | 0] = $1_1 >>> 16; + HEAP82[$0 + 39 | 0] = $1_1 >>> 24; + $69($7_1 + 224 | 0); + $61($7_1, $7_1 + 224 | 0); + $57($0, $7_1); + $5($7_1 + 160 | 0, $0, $16_1); + $69($7_1 + 160 | 0); + $68($8_1, $7_1 + 160 | 0, $4_1, $7_1 + 224 | 0); + global$0 = $7_1 + 320 | 0; + } + function $7($0, $1_1, $2_1) { + $0 = $0 | 0; + $1_1 = $1_1 | 0; + $2_1 = $2_1 | 0; + var $3_1 = 0, $4_1 = 0; + $3_1 = global$0 - 368 | 0; + global$0 = $3_1; + $4_1 = HEAPU82[$1_1 + 28 | 0] | HEAPU82[$1_1 + 29 | 0] << 8 | (HEAPU82[$1_1 + 30 | 0] << 16 | HEAPU82[$1_1 + 31 | 0] << 24); + HEAP322[$3_1 + 24 >> 2] = HEAPU82[$1_1 + 24 | 0] | HEAPU82[$1_1 + 25 | 0] << 8 | (HEAPU82[$1_1 + 26 | 0] << 16 | HEAPU82[$1_1 + 27 | 0] << 24); + HEAP322[$3_1 + 28 >> 2] = $4_1; + $4_1 = HEAPU82[$1_1 + 20 | 0] | HEAPU82[$1_1 + 21 | 0] << 8 | (HEAPU82[$1_1 + 22 | 0] << 16 | HEAPU82[$1_1 + 23 | 0] << 24); + HEAP322[$3_1 + 16 >> 2] = HEAPU82[$1_1 + 16 | 0] | HEAPU82[$1_1 + 17 | 0] << 8 | (HEAPU82[$1_1 + 18 | 0] << 16 | HEAPU82[$1_1 + 19 | 0] << 24); + HEAP322[$3_1 + 20 >> 2] = $4_1; + $4_1 = HEAPU82[$1_1 + 12 | 0] | HEAPU82[$1_1 + 13 | 0] << 8 | (HEAPU82[$1_1 + 14 | 0] << 16 | HEAPU82[$1_1 + 15 | 0] << 24); + HEAP322[$3_1 + 8 >> 2] = HEAPU82[$1_1 + 8 | 0] | HEAPU82[$1_1 + 9 | 0] << 8 | (HEAPU82[$1_1 + 10 | 0] << 16 | HEAPU82[$1_1 + 11 | 0] << 24); + HEAP322[$3_1 + 12 >> 2] = $4_1; + $4_1 = HEAPU82[$1_1 + 4 | 0] | HEAPU82[$1_1 + 5 | 0] << 8 | (HEAPU82[$1_1 + 6 | 0] << 16 | HEAPU82[$1_1 + 7 | 0] << 24); + HEAP322[$3_1 >> 2] = HEAPU82[$1_1 | 0] | HEAPU82[$1_1 + 1 | 0] << 8 | (HEAPU82[$1_1 + 2 | 0] << 16 | HEAPU82[$1_1 + 3 | 0] << 24); + HEAP322[$3_1 + 4 >> 2] = $4_1; + $8($3_1 + 288 | 0, $2_1); + $9($3_1 + 208 | 0, $3_1 + 112 | 0, $3_1, $3_1 + 288 | 0); + $10($3_1 + 32 | 0, $3_1 + 112 | 0); + $11($3_1 + 112 | 0, $3_1 + 208 | 0, $3_1 + 32 | 0); + $12($0, $3_1 + 112 | 0); + global$0 = $3_1 + 368 | 0; + return 0; + } + function $8($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; + $3_1 = HEAPU82[$1_1 + 3 | 0]; + $5_1 = $3_1 << 24 & 50331648; + $2_1 = HEAPU82[$1_1 + 2 | 0]; + $3_1 = $2_1 >>> 16 | 0; + HEAP322[$0 >> 2] = $5_1 | (HEAPU82[$1_1 | 0] | HEAPU82[$1_1 + 1 | 0] << 8 | $2_1 << 16); + HEAP322[$0 + 4 >> 2] = $3_1; + $2_1 = HEAPU82[$1_1 + 5 | 0]; + $3_1 = $2_1 >>> 16 | 0; + $5_1 = HEAPU82[$1_1 + 3 | 0] | HEAPU82[$1_1 + 4 | 0] << 8 | $2_1 << 16; + $4_1 = HEAPU82[$1_1 + 6 | 0]; + $2_1 = $4_1 >>> 8 | 0; + $4_1 = $4_1 << 24; + $3_1 = $3_1 | $2_1; + $2_1 = $4_1 | $5_1; + HEAP322[$0 + 8 >> 2] = (($3_1 & 3) << 30 | $2_1 >>> 2) & 33554431; + HEAP322[$0 + 12 >> 2] = 0; + $2_1 = HEAPU82[$1_1 + 8 | 0]; + $3_1 = $2_1 >>> 16 | 0; + $5_1 = HEAPU82[$1_1 + 6 | 0] | HEAPU82[$1_1 + 7 | 0] << 8 | $2_1 << 16; + $2_1 = $3_1; + $4_1 = HEAPU82[$1_1 + 9 | 0]; + $3_1 = $4_1 >>> 8 | 0; + $4_1 = $4_1 << 24; + $3_1 = $3_1 | $2_1; + $2_1 = $4_1 | $5_1; + HEAP322[$0 + 16 >> 2] = (($3_1 & 7) << 29 | $2_1 >>> 3) & 67108863; + HEAP322[$0 + 20 >> 2] = 0; + $2_1 = HEAPU82[$1_1 + 11 | 0]; + $3_1 = $2_1 >>> 16 | 0; + $5_1 = HEAPU82[$1_1 + 9 | 0] | HEAPU82[$1_1 + 10 | 0] << 8 | $2_1 << 16; + $4_1 = HEAPU82[$1_1 + 12 | 0]; + $2_1 = $4_1 >>> 8 | 0; + $4_1 = $4_1 << 24; + $3_1 = $3_1 | $2_1; + $2_1 = $4_1 | $5_1; + HEAP322[$0 + 24 >> 2] = (($3_1 & 31) << 27 | $2_1 >>> 5) & 33554431; + HEAP322[$0 + 28 >> 2] = 0; + $3_1 = $0; + HEAP322[$3_1 + 32 >> 2] = (HEAPU82[$1_1 + 12 | 0] | HEAPU82[$1_1 + 13 | 0] << 8 | (HEAPU82[$1_1 + 14 | 0] << 16 | HEAPU82[$1_1 + 15 | 0] << 24)) >>> 6; + HEAP322[$3_1 + 36 >> 2] = 0; + $3_1 = HEAPU82[$1_1 + 19 | 0]; + $5_1 = $3_1 << 24 & 16777216; + $2_1 = HEAPU82[$1_1 + 18 | 0]; + $3_1 = $2_1 >>> 16 | 0; + HEAP322[$0 + 40 >> 2] = $5_1 | (HEAPU82[$1_1 + 16 | 0] | HEAPU82[$1_1 + 17 | 0] << 8 | $2_1 << 16); + HEAP322[$0 + 44 >> 2] = $3_1; + $2_1 = HEAPU82[$1_1 + 21 | 0]; + $3_1 = $2_1 >>> 16 | 0; + $5_1 = HEAPU82[$1_1 + 19 | 0] | HEAPU82[$1_1 + 20 | 0] << 8 | $2_1 << 16; + $4_1 = HEAPU82[$1_1 + 22 | 0]; + $2_1 = $4_1 >>> 8 | 0; + $4_1 = $4_1 << 24; + $3_1 = $3_1 | $2_1; + $2_1 = $4_1 | $5_1; + HEAP322[$0 + 48 >> 2] = (($3_1 & 1) << 31 | $2_1 >>> 1) & 67108863; + HEAP322[$0 + 52 >> 2] = 0; + $2_1 = HEAPU82[$1_1 + 24 | 0]; + $3_1 = $2_1 >>> 16 | 0; + $5_1 = HEAPU82[$1_1 + 22 | 0] | HEAPU82[$1_1 + 23 | 0] << 8 | $2_1 << 16; + $2_1 = $3_1; + $4_1 = HEAPU82[$1_1 + 25 | 0]; + $3_1 = $4_1 >>> 8 | 0; + $4_1 = $4_1 << 24; + $3_1 = $3_1 | $2_1; + $2_1 = $4_1 | $5_1; + HEAP322[$0 + 56 >> 2] = (($3_1 & 7) << 29 | $2_1 >>> 3) & 33554431; + HEAP322[$0 + 60 >> 2] = 0; + $2_1 = HEAPU82[$1_1 + 27 | 0]; + $3_1 = $2_1 >>> 16 | 0; + $5_1 = HEAPU82[$1_1 + 25 | 0] | HEAPU82[$1_1 + 26 | 0] << 8 | $2_1 << 16; + $4_1 = HEAPU82[$1_1 + 28 | 0]; + $2_1 = $4_1 >>> 8 | 0; + $4_1 = $4_1 << 24; + $3_1 = $3_1 | $2_1; + $2_1 = $4_1 | $5_1; + HEAP322[$0 + 64 >> 2] = (($3_1 & 15) << 28 | $2_1 >>> 4) & 67108863; + HEAP322[$0 + 68 >> 2] = 0; + $5_1 = HEAPU82[$1_1 + 30 | 0]; + $3_1 = $5_1 >>> 16 | 0; + $2_1 = HEAPU82[$1_1 + 28 | 0] | HEAPU82[$1_1 + 29 | 0] << 8 | $5_1 << 16; + $5_1 = $3_1; + $1_1 = HEAPU82[$1_1 + 31 | 0]; + $3_1 = $1_1 >>> 8 | 0; + $4_1 = $1_1 << 24; + $1_1 = $3_1 | $5_1; + $3_1 = $2_1 | $4_1; + HEAP322[$0 + 72 >> 2] = (($1_1 & 63) << 26 | $3_1 >>> 6) & 33554431; + HEAP322[$0 + 76 >> 2] = 0; + } + function $9($0, $1_1, $2_1, $3_1) { + var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0; + $4_1 = global$0 - 1280 | 0; + global$0 = $4_1; + $79($4_1 + 960 | 0, 152); + HEAP322[$4_1 + 960 >> 2] = 1; + HEAP322[$4_1 + 964 >> 2] = 0; + $79($4_1 + 800 | 0, 152); + HEAP322[$4_1 + 800 >> 2] = 1; + HEAP322[$4_1 + 804 >> 2] = 0; + $79($4_1 + 640 | 0, 152); + $79($4_1 + 480 | 0, 152); + $79($4_1 + 320 | 0, 152); + HEAP322[$4_1 + 320 >> 2] = 1; + HEAP322[$4_1 + 324 >> 2] = 0; + $79($4_1 + 160 | 0, 152); + $5_1 = $79($4_1, 152); + HEAP322[$5_1 >> 2] = 1; + HEAP322[$5_1 + 4 >> 2] = 0; + $79($5_1 + 1200 | 0, 72); + $78($5_1 + 1120 | 0, $3_1, 80); + $15_1 = $5_1 + 160 | 0; + $9_1 = $5_1 + 480 | 0; + $4_1 = $5_1; + $16_1 = $4_1 + 320 | 0; + $10_1 = $4_1 + 640 | 0; + $6_1 = $4_1 + 1120 | 0; + $7_1 = $4_1 + 800 | 0; + $8_1 = $4_1 + 960 | 0; + while (1) { + $12_1 = HEAPU82[($2_1 - $11_1 | 0) + 31 | 0]; + $13_1 = 0; + while (1) { + $14_1 = $9_1; + $17_1 = $7_1; + $9_1 = $6_1; + $6_1 = ($12_1 & 128) >>> 7 | 0; + $13($7_1, $9_1, $6_1); + $18_1 = $10_1; + $19 = $8_1; + $13($10_1, $8_1, $6_1); + $7_1 = $15_1; + $10_1 = $4_1; + $8_1 = $16_1; + $14($7_1, $4_1, $14_1, $8_1, $17_1, $18_1, $9_1, $19, $3_1); + $13($7_1, $14_1, $6_1); + $13($4_1, $8_1, $6_1); + $12_1 = $12_1 << 1; + $6_1 = $14_1; + $4_1 = $18_1; + $15_1 = $17_1; + $16_1 = $19; + $13_1 = $13_1 + 1 | 0; + if (($13_1 | 0) != 8) { + continue; + } + break; + } + $11_1 = $11_1 + 1 | 0; + if (($11_1 | 0) != 32) { + continue; + } + break; + } + $78($0, $7_1, 80); + $78($1_1, $10_1, 80); + global$0 = $5_1 + 1280 | 0; + } + function $10($0, $1_1) { + var $2_1 = 0, $3_1 = 0; + $2_1 = global$0 - 800 | 0; + global$0 = $2_1; + $15($2_1 + 720 | 0, $1_1); + $15($2_1, $2_1 + 720 | 0); + $15($2_1 + 80 | 0, $2_1); + $11($2_1 + 640 | 0, $2_1 + 80 | 0, $1_1); + $11($2_1 + 560 | 0, $2_1 + 640 | 0, $2_1 + 720 | 0); + $15($2_1 + 80 | 0, $2_1 + 560 | 0); + $11($2_1 + 480 | 0, $2_1 + 80 | 0, $2_1 + 640 | 0); + $15($2_1 + 80 | 0, $2_1 + 480 | 0); + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $11($2_1 + 400 | 0, $2_1 + 80 | 0, $2_1 + 480 | 0); + $15($2_1 + 80 | 0, $2_1 + 400 | 0); + $15($2_1, $2_1 + 80 | 0); + $1_1 = 2; + while (1) { + $3_1 = $1_1 >>> 0 < 8; + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $1_1 = $1_1 + 2 | 0; + if ($3_1) { + continue; + } + break; + } + $11($2_1 + 320 | 0, $2_1, $2_1 + 400 | 0); + $15($2_1 + 80 | 0, $2_1 + 320 | 0); + $15($2_1, $2_1 + 80 | 0); + $1_1 = 2; + while (1) { + $3_1 = $1_1 >>> 0 < 18; + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $1_1 = $1_1 + 2 | 0; + if ($3_1) { + continue; + } + break; + } + $11($2_1 + 80 | 0, $2_1, $2_1 + 320 | 0); + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $1_1 = 2; + while (1) { + $3_1 = $1_1 >>> 0 < 8; + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $1_1 = $1_1 + 2 | 0; + if ($3_1) { + continue; + } + break; + } + $11($2_1 + 240 | 0, $2_1 + 80 | 0, $2_1 + 400 | 0); + $15($2_1 + 80 | 0, $2_1 + 240 | 0); + $15($2_1, $2_1 + 80 | 0); + $1_1 = 2; + while (1) { + $3_1 = $1_1 >>> 0 < 48; + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $1_1 = $1_1 + 2 | 0; + if ($3_1) { + continue; + } + break; + } + $11($2_1 + 160 | 0, $2_1, $2_1 + 240 | 0); + $15($2_1, $2_1 + 160 | 0); + $15($2_1 + 80 | 0, $2_1); + $1_1 = 2; + while (1) { + $3_1 = $1_1 >>> 0 < 98; + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $1_1 = $1_1 + 2 | 0; + if ($3_1) { + continue; + } + break; + } + $11($2_1, $2_1 + 80 | 0, $2_1 + 160 | 0); + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $1_1 = 2; + while (1) { + $3_1 = $1_1 >>> 0 < 48; + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $1_1 = $1_1 + 2 | 0; + if ($3_1) { + continue; + } + break; + } + $11($2_1 + 80 | 0, $2_1, $2_1 + 240 | 0); + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $15($2_1 + 80 | 0, $2_1); + $15($2_1, $2_1 + 80 | 0); + $11($0, $2_1, $2_1 + 560 | 0); + global$0 = $2_1 + 800 | 0; + } + function $11($0, $1_1, $2_1) { + var $3_1 = 0; + $3_1 = global$0 - 160 | 0; + global$0 = $3_1; + $16($3_1, $1_1, $2_1); + $17($3_1); + $18($3_1); + $78($0, $3_1, 80); + global$0 = $3_1 + 160 | 0; + } + function $12($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0; + $3_1 = global$0 - 48 | 0; + global$0 = $3_1; + while (1) { + HEAP322[($2_1 << 2) + $3_1 >> 2] = HEAP322[($2_1 << 3) + $1_1 >> 2]; + $2_1 = $2_1 + 1 | 0; + if (($2_1 | 0) != 10) { + continue; + } + break; + } + $2_1 = 0; + while (1) { + $1_1 = $2_1; + $2_1 = 0; + while (1) { + $5_1 = ($2_1 << 2) + $3_1 | 0; + $4_1 = HEAP322[$5_1 >> 2]; + $6_1 = $4_1 >> 31 & $4_1; + $7_1 = $4_1; + $4_1 = $2_1 & 1; + HEAP322[$5_1 >> 2] = $7_1 - ($6_1 & ($4_1 ? -33554432 : -67108864)); + $2_1 = $2_1 + 1 | 0; + $5_1 = ($2_1 << 2) + $3_1 | 0; + HEAP322[$5_1 >> 2] = HEAP322[$5_1 >> 2] + ($6_1 >> ($4_1 ? 25 : 26)); + if (($2_1 | 0) != 9) { + continue; + } + break; + } + $2_1 = HEAP322[$3_1 + 36 >> 2]; + $4_1 = $2_1 >> 31 & $2_1; + HEAP322[$3_1 + 36 >> 2] = $2_1 - ($4_1 & -33554432); + $4_1 = HEAP322[$3_1 >> 2] + Math_imul2($4_1 >> 25, 19) | 0; + HEAP322[$3_1 >> 2] = $4_1; + $2_1 = $1_1 + 1 | 0; + if (!$1_1) { + continue; + } + break; + } + $1_1 = $4_1 & $4_1 >> 31; + HEAP322[$3_1 >> 2] = $4_1 - ($1_1 & -67108864); + HEAP322[$3_1 + 4 >> 2] = HEAP322[$3_1 + 4 >> 2] + ($1_1 >> 26); + $2_1 = 0; + while (1) { + $1_1 = $2_1; + $2_1 = 0; + while (1) { + $6_1 = ($2_1 << 2) + $3_1 | 0; + $4_1 = HEAP322[$6_1 >> 2]; + $7_1 = $6_1; + $6_1 = $2_1 & 1; + HEAP322[$7_1 >> 2] = $4_1 & ($6_1 ? 33554431 : 67108863); + $2_1 = $2_1 + 1 | 0; + $5_1 = ($2_1 << 2) + $3_1 | 0; + HEAP322[$5_1 >> 2] = HEAP322[$5_1 >> 2] + ($4_1 >> ($6_1 ? 25 : 26)); + if (($2_1 | 0) != 9) { + continue; + } + break; + } + $2_1 = HEAP322[$3_1 + 36 >> 2]; + HEAP322[$3_1 + 36 >> 2] = $2_1 & 33554431; + $4_1 = HEAP322[$3_1 >> 2] + Math_imul2($2_1 >> 25, 19) | 0; + HEAP322[$3_1 >> 2] = $4_1; + $2_1 = $1_1 + 1 | 0; + if (!$1_1) { + continue; + } + break; + } + $1_1 = $4_1 + -67108845 >> 31 ^ -1; + $2_1 = 1; + while (1) { + $1_1 = $20(HEAP322[($2_1 << 2) + $3_1 >> 2], $2_1 & 1 ? 33554431 : 67108863) & $1_1; + $2_1 = $2_1 + 1 | 0; + if (($2_1 | 0) != 10) { + continue; + } + break; + } + HEAP322[$3_1 >> 2] = $4_1 - ($1_1 & 67108845); + $2_1 = 1; + while (1) { + $4_1 = ($2_1 << 2) + $3_1 | 0; + HEAP322[$4_1 >> 2] = HEAP322[$4_1 >> 2] - (($2_1 & 1 ? 33554431 : 67108863) & $1_1); + $2_1 = $2_1 + 1 | 0; + if (($2_1 | 0) != 10) { + continue; + } + break; + } + $2_1 = HEAP322[$3_1 + 24 >> 2]; + $11_1 = $2_1 << 1; + HEAP322[$3_1 + 24 >> 2] = $11_1; + $4_1 = HEAP322[$3_1 + 28 >> 2]; + $12_1 = $4_1 << 3; + HEAP322[$3_1 + 28 >> 2] = $12_1; + $6_1 = HEAP322[$3_1 + 32 >> 2]; + $13_1 = $6_1 << 4; + HEAP322[$3_1 + 32 >> 2] = $13_1; + $5_1 = HEAP322[$3_1 + 36 >> 2]; + $14_1 = $5_1 << 6; + HEAP322[$3_1 + 36 >> 2] = $14_1; + $7_1 = HEAP322[$3_1 + 4 >> 2]; + $15_1 = $7_1 << 2; + HEAP322[$3_1 + 4 >> 2] = $15_1; + $8_1 = HEAP322[$3_1 + 8 >> 2]; + $16_1 = $8_1 << 3; + HEAP322[$3_1 + 8 >> 2] = $16_1; + $9_1 = HEAP322[$3_1 + 12 >> 2]; + $17_1 = $9_1 << 5; + HEAP322[$3_1 + 12 >> 2] = $17_1; + $10_1 = HEAP322[$3_1 + 16 >> 2]; + $18_1 = $10_1 << 6; + HEAP322[$3_1 + 16 >> 2] = $18_1; + HEAP82[$0 + 16 | 0] = 0; + HEAP82[$0 | 0] = 0; + $1_1 = HEAP322[$3_1 >> 2]; + HEAP82[$0 + 15 | 0] = $10_1 >>> 18; + HEAP82[$0 + 14 | 0] = $10_1 >>> 10; + HEAP82[$0 + 13 | 0] = $10_1 >>> 2; + HEAP82[$0 + 12 | 0] = $9_1 >>> 19 | $18_1; + HEAP82[$0 + 11 | 0] = $9_1 >>> 11; + HEAP82[$0 + 10 | 0] = $9_1 >>> 3; + HEAP82[$0 + 9 | 0] = $8_1 >>> 21 | $17_1; + HEAP82[$0 + 8 | 0] = $8_1 >>> 13; + HEAP82[$0 + 7 | 0] = $8_1 >>> 5; + HEAP82[$0 + 6 | 0] = $7_1 >>> 22 | $16_1; + HEAP82[$0 + 5 | 0] = $7_1 >>> 14; + HEAP82[$0 + 4 | 0] = $7_1 >>> 6; + HEAP82[$0 | 0] = $1_1; + HEAP82[$0 + 2 | 0] = $1_1 >>> 16; + HEAP82[$0 + 1 | 0] = $1_1 >>> 8; + HEAP82[$0 + 3 | 0] = $1_1 >>> 24 | $15_1; + $1_1 = HEAP322[$3_1 + 20 >> 2]; + HEAP82[$0 + 31 | 0] = $5_1 >>> 18; + HEAP82[$0 + 30 | 0] = $5_1 >>> 10; + HEAP82[$0 + 29 | 0] = $5_1 >>> 2; + HEAP82[$0 + 28 | 0] = $6_1 >>> 20 | $14_1; + HEAP82[$0 + 27 | 0] = $6_1 >>> 12; + HEAP82[$0 + 26 | 0] = $6_1 >>> 4; + HEAP82[$0 + 25 | 0] = $4_1 >>> 21 | $13_1; + HEAP82[$0 + 24 | 0] = $4_1 >>> 13; + HEAP82[$0 + 23 | 0] = $4_1 >>> 5; + HEAP82[$0 + 22 | 0] = $2_1 >>> 23 | $12_1; + HEAP82[$0 + 21 | 0] = $2_1 >>> 15; + HEAP82[$0 + 20 | 0] = $2_1 >>> 7; + HEAP82[$0 + 16 | 0] = $1_1; + HEAP82[$0 + 18 | 0] = $1_1 >>> 16; + HEAP82[$0 + 17 | 0] = $1_1 >>> 8; + HEAP82[$0 + 19 | 0] = $1_1 >>> 24 | $11_1; + global$0 = $3_1 + 48 | 0; + } + function $13($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0; + $7_1 = 0 - $2_1 | 0; + while (1) { + $2_1 = $6_1 << 3; + $3_1 = $2_1 + $0 | 0; + $4_1 = HEAP322[$3_1 >> 2]; + $5_1 = $4_1; + $2_1 = $1_1 + $2_1 | 0; + $4_1 = ($4_1 ^ HEAP322[$2_1 >> 2]) & $7_1; + $5_1 = $5_1 ^ $4_1; + HEAP322[$3_1 >> 2] = $5_1; + HEAP322[$3_1 + 4 >> 2] = $5_1 >> 31; + $3_1 = $4_1 ^ HEAP322[$2_1 >> 2]; + HEAP322[$2_1 >> 2] = $3_1; + HEAP322[$2_1 + 4 >> 2] = $3_1 >> 31; + $6_1 = $6_1 + 1 | 0; + if (($6_1 | 0) != 10) { + continue; + } + break; + } + } + function $14($0, $1_1, $2_1, $3_1, $4_1, $5_1, $6_1, $7_1, $8_1) { + var $9_1 = 0; + $9_1 = global$0 - 1280 | 0; + global$0 = $9_1; + $78($9_1 + 1200 | 0, $4_1, 80); + $21($4_1, $5_1); + $22($5_1, $9_1 + 1200 | 0); + $78($9_1 + 1120 | 0, $6_1, 80); + $21($6_1, $7_1); + $22($7_1, $9_1 + 1120 | 0); + $16($9_1 + 480 | 0, $6_1, $5_1); + $16($9_1 + 320 | 0, $4_1, $7_1); + $17($9_1 + 480 | 0); + $18($9_1 + 480 | 0); + $17($9_1 + 320 | 0); + $18($9_1 + 320 | 0); + $78($9_1 + 1120 | 0, $9_1 + 480 | 0, 80); + $21($9_1 + 480 | 0, $9_1 + 320 | 0); + $22($9_1 + 320 | 0, $9_1 + 1120 | 0); + $15($9_1, $9_1 + 480 | 0); + $15($9_1 + 160 | 0, $9_1 + 320 | 0); + $16($9_1 + 320 | 0, $9_1 + 160 | 0, $8_1); + $17($9_1 + 320 | 0); + $18($9_1 + 320 | 0); + $78($2_1, $9_1, 80); + $78($3_1, $9_1 + 320 | 0, 80); + $15($9_1 + 800 | 0, $4_1); + $15($9_1 + 640 | 0, $5_1); + $16($0, $9_1 + 800 | 0, $9_1 + 640 | 0); + $17($0); + $18($0); + $22($9_1 + 640 | 0, $9_1 + 800 | 0); + $79($9_1 + 1040 | 0, 72); + $23($9_1 + 960 | 0, $9_1 + 640 | 0); + $18($9_1 + 960 | 0); + $21($9_1 + 960 | 0, $9_1 + 800 | 0); + $16($1_1, $9_1 + 640 | 0, $9_1 + 960 | 0); + $17($1_1); + $18($1_1); + global$0 = $9_1 + 1280 | 0; + } + function $15($0, $1_1) { + var $2_1 = 0; + $2_1 = global$0 - 160 | 0; + global$0 = $2_1; + $26($2_1, $1_1); + $17($2_1); + $18($2_1); + $78($0, $2_1, 80); + global$0 = $2_1 + 160 | 0; + } + function $16($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0; + $3_1 = HEAP322[$2_1 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + HEAP322[$0 >> 2] = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + HEAP322[$0 + 4 >> 2] = i64toi32_i32$HIGH_BITS; + $3_1 = HEAP322[$2_1 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $9_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($9_1, $8_1, $3_1, $3_1 >> 31); + $9_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $0; + HEAP322[$4_1 + 8 >> 2] = $9_1; + HEAP322[$4_1 + 12 >> 2] = $9_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + $9_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $4_1; + $4_1 = HEAP322[$2_1 + 8 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = $4_1 >> 31; + $7_1 = __wasm_i64_mul($8_1, $6_1, ($4_1 & 2147483647) << 1, $5_1); + $4_1 = $3_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $9_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = $4_1; + $4_1 = HEAP322[$2_1 >> 2]; + $9_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 16 >> 2]; + $9_1 = __wasm_i64_mul($9_1, $8_1, $4_1, $4_1 >> 31); + $4_1 = $3_1 + $9_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $0; + HEAP322[$3_1 + 16 >> 2] = $4_1; + HEAP322[$3_1 + 20 >> 2] = $4_1 >>> 0 < $9_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $9_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $7_1 = __wasm_i64_mul($9_1, $8_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = $4_1; + $4_1 = HEAP322[$2_1 + 24 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = $9_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$2_1 >> 2]; + $9_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $7_1 = __wasm_i64_mul($9_1, $8_1, $3_1, $3_1 >> 31); + $3_1 = $7_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $9_1 = $0; + HEAP322[$9_1 + 24 >> 2] = $3_1; + HEAP322[$9_1 + 28 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 8 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 24 >> 2]; + $4_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $3_1; + $6_1 = $4_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $5_1 << 1 | $3_1 >>> 31; + $6_1 = $3_1 << 1; + $3_1 = $8_1 + $6_1 | 0; + $5_1 = $4_1 + $7_1 | 0; + $5_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + HEAP322[$9_1 + 32 >> 2] = $4_1; + HEAP322[$9_1 + 36 >> 2] = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 40 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + HEAP322[$9_1 + 40 >> 2] = $4_1; + HEAP322[$9_1 + 44 >> 2] = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 40 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $4_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $3_1; + $6_1 = $4_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $6_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $4_1 << 1 | $3_1 >>> 31; + $4_1 = $3_1 << 1; + $3_1 = $8_1 + $4_1 | 0; + $5_1 = $5_1 + $7_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 + 48 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $7_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$9_1 + 48 >> 2] = $3_1; + HEAP322[$9_1 + 52 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 + 48 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $7_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$9_1 + 56 >> 2] = $3_1; + HEAP322[$9_1 + 60 >> 2] = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 24 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 40 >> 2]; + $4_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $6_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $3_1, $3_1 >> 31); + $4_1 = $6_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 + 56 >> 2]; + $6_1 = $4_1; + $10_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $6_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $6_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1; + $3_1 = ($3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1) << 1 | $3_1 >>> 31; + $6_1 = $5_1 << 1; + $4_1 = $8_1 + $6_1 | 0; + $5_1 = $3_1 + $7_1 | 0; + $5_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $4_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $5_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + HEAP322[$9_1 + 64 >> 2] = $5_1; + HEAP322[$9_1 + 68 >> 2] = $5_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $5_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = HEAP322[$2_1 + 64 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $7_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $4_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 72 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$9_1 + 72 >> 2] = $3_1; + HEAP322[$9_1 + 76 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 56 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 24 >> 2]; + $4_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $6_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $3_1, $3_1 >> 31); + $4_1 = $6_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 + 24 >> 2]; + $6_1 = $4_1; + $10_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 56 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $6_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $6_1 = $4_1; + $3_1 = HEAP322[$2_1 + 72 >> 2]; + $4_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $6_1 = $3_1; + $3_1 = HEAP322[$2_1 + 8 >> 2]; + $4_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $5_1 = $5_1 << 1 | $3_1 >>> 31; + $6_1 = $3_1 << 1; + $3_1 = $8_1 + $6_1 | 0; + $4_1 = $5_1 + $7_1 | 0; + $4_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $5_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = HEAP322[$2_1 + 64 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $7_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $4_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$9_1 + 80 >> 2] = $3_1; + HEAP322[$9_1 + 84 >> 2] = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $5_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = HEAP322[$2_1 + 64 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 24 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $7_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $4_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 72 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 16 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$9_1 + 88 >> 2] = $3_1; + HEAP322[$9_1 + 92 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 40 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $3_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $6_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $3_1, $3_1 >> 31); + $4_1 = $6_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 + 72 >> 2]; + $6_1 = $4_1; + $10_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 24 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $6_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $6_1 = $4_1; + $3_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = $5_1 << 1 | $3_1 >>> 31; + $6_1 = $4_1 << 1; + $4_1 = $8_1 + $6_1 | 0; + $5_1 = $3_1 + $7_1 | 0; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $8_1 = $3_1; + $7_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $7_1, $3_1, $3_1 >> 31); + $3_1 = $7_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + ($4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1) | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + HEAP322[$9_1 + 96 >> 2] = $3_1; + HEAP322[$9_1 + 100 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = HEAP322[$2_1 + 40 >> 2]; + $8_1 = $4_1; + $6_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 64 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $4_1, $4_1 >> 31); + $4_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 72 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $7_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $3_1 = HEAP322[$2_1 + 32 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + HEAP322[$9_1 + 104 >> 2] = $3_1; + HEAP322[$9_1 + 108 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $4_1 = $3_1; + $5_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $5_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 72 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 40 >> 2]; + $4_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $3_1; + $6_1 = $4_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $4_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $3_1, $3_1 >> 31); + $3_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 40 >> 2]; + $6_1 = $3_1; + $10_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $10_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $3_1 << 1 | $4_1 >>> 31; + $4_1 = $4_1 << 1; + $3_1 = $8_1 + $4_1 | 0; + $5_1 = $5_1 + $7_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 48 >> 2]; + $8_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $7_1 = __wasm_i64_mul($8_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$9_1 + 112 >> 2] = $3_1; + HEAP322[$9_1 + 116 >> 2] = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$2_1 + 56 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + $9_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $5_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $7_1 = __wasm_i64_mul($5_1, $8_1, $3_1, $3_1 >> 31); + $3_1 = $4_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $9_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 + 72 >> 2]; + $9_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $7_1 = __wasm_i64_mul($9_1, $8_1, $3_1, $3_1 >> 31); + $9_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $9_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $9_1; + $9_1 = HEAP322[$2_1 + 48 >> 2]; + $5_1 = $9_1; + $8_1 = $9_1 >> 31; + $9_1 = HEAP322[$1_1 + 72 >> 2]; + $7_1 = __wasm_i64_mul($5_1, $8_1, $9_1, $9_1 >> 31); + $9_1 = $4_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $0; + HEAP322[$4_1 + 120 >> 2] = $9_1; + HEAP322[$4_1 + 124 >> 2] = $9_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $3_1 = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $4_1 = HEAP322[$2_1 + 56 >> 2]; + $9_1 = $4_1; + $5_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 72 >> 2]; + $4_1 = __wasm_i64_mul($9_1, $5_1, $4_1, $4_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $9_1 = $3_1; + $8_1 = $4_1; + $3_1 = HEAP322[$2_1 + 72 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $8_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $5_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $3_1 = $5_1 << 1 | $3_1 >>> 31; + $6_1 = $4_1 << 1; + $5_1 = $9_1 + $6_1 | 0; + $4_1 = $3_1 + $7_1 | 0; + $9_1 = $0; + HEAP322[$9_1 + 128 >> 2] = $5_1; + HEAP322[$9_1 + 132 >> 2] = $5_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$2_1 + 64 >> 2]; + $4_1 = $3_1; + $9_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $9_1, $3_1, $3_1 >> 31); + $9_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $4_1; + $4_1 = HEAP322[$2_1 + 72 >> 2]; + $5_1 = $4_1; + $8_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 64 >> 2]; + $7_1 = __wasm_i64_mul($5_1, $8_1, $4_1, $4_1 >> 31); + $4_1 = $3_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $9_1 | 0; + $3_1 = $0; + HEAP322[$3_1 + 136 >> 2] = $4_1; + HEAP322[$3_1 + 140 >> 2] = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $2_1 = HEAP322[$2_1 + 72 >> 2]; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $1_1 = 0; + HEAP322[$0 + 144 >> 2] = __wasm_i64_mul($2_1, $2_1 >> 31, ($3_1 & 2147483647) << 1 | $1_1 >>> 31, $3_1 >> 31); + HEAP322[$0 + 148 >> 2] = i64toi32_i32$HIGH_BITS; + } + function $17($0) { + var $1_1 = 0, $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $2_1 = HEAP322[$0 + 148 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 68 >> 2] | 0; + $3_1 = HEAP322[$0 + 144 >> 2]; + $4_1 = HEAP322[$0 + 64 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $6_1 = $0; + HEAP322[$0 + 64 >> 2] = $2_1; + HEAP322[$0 + 68 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 140 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 60 >> 2] | 0; + $3_1 = HEAP322[$0 + 136 >> 2]; + $4_1 = HEAP322[$0 + 56 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 56 >> 2] = $2_1; + HEAP322[$6_1 + 60 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 132 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 52 >> 2] | 0; + $3_1 = HEAP322[$0 + 128 >> 2]; + $4_1 = HEAP322[$0 + 48 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 48 >> 2] = $2_1; + HEAP322[$6_1 + 52 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 124 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 44 >> 2] | 0; + $3_1 = HEAP322[$0 + 120 >> 2]; + $4_1 = HEAP322[$0 + 40 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 40 >> 2] = $2_1; + HEAP322[$6_1 + 44 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 116 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 36 >> 2] | 0; + $3_1 = HEAP322[$0 + 112 >> 2]; + $4_1 = HEAP322[$0 + 32 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 32 >> 2] = $2_1; + HEAP322[$6_1 + 36 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 108 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 28 >> 2] | 0; + $3_1 = HEAP322[$0 + 104 >> 2]; + $4_1 = HEAP322[$0 + 24 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 24 >> 2] = $2_1; + HEAP322[$6_1 + 28 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 100 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 20 >> 2] | 0; + $3_1 = HEAP322[$0 + 96 >> 2]; + $4_1 = HEAP322[$0 + 16 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 16 >> 2] = $2_1; + HEAP322[$6_1 + 20 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = HEAP322[$0 + 92 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 12 >> 2] | 0; + $3_1 = HEAP322[$0 + 88 >> 2]; + $4_1 = HEAP322[$0 + 8 >> 2]; + $5_1 = $3_1 + $4_1 | 0; + if ($5_1 >>> 0 < $4_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $2_1 = $3_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$0 + 8 >> 2] = $2_1; + HEAP322[$6_1 + 12 >> 2] = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = $0; + $2_1 = HEAP322[$0 + 84 >> 2]; + $1_1 = $2_1 + HEAP322[$0 + 4 >> 2] | 0; + $3_1 = HEAP322[$0 + 80 >> 2]; + $0 = HEAP322[$0 >> 2]; + $4_1 = $3_1 + $0 | 0; + if ($4_1 >>> 0 < $0 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $2_1 = __wasm_i64_mul($3_1, $2_1, 18, 0); + $0 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + HEAP322[$5_1 >> 2] = $0; + HEAP322[$6_1 + 4 >> 2] = $0 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + } + function $18($0) { + var $1_1 = 0, $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0; + HEAP322[$0 + 80 >> 2] = 0; + HEAP322[$0 + 84 >> 2] = 0; + while (1) { + $9_1 = $3_1 << 3; + $2_1 = $9_1 + $0 | 0; + $4_1 = HEAP322[$2_1 + 4 >> 2]; + $1_1 = HEAP322[$2_1 >> 2]; + $7_1 = $4_1; + $4_1 = $24($1_1, $4_1); + $8_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $8_1; + $8_1 = $5_1 << 26 | $4_1 >>> 6; + $6_1 = $4_1 << 26; + HEAP322[$2_1 >> 2] = $1_1 - $6_1; + HEAP322[$2_1 + 4 >> 2] = $7_1 - (($1_1 >>> 0 < $6_1 >>> 0) + $8_1 | 0); + $2_1 = ($9_1 | 8) + $0 | 0; + $1_1 = $2_1; + $7_1 = $4_1 + HEAP322[$1_1 >> 2] | 0; + $5_1 = $5_1 + HEAP322[$1_1 + 4 >> 2] | 0; + $1_1 = $7_1; + $5_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $7_1 = $5_1; + $4_1 = $25($1_1, $5_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $8_1 = $5_1; + $5_1 = $5_1 << 25 | $4_1 >>> 7; + $6_1 = $4_1 << 25; + HEAP322[$2_1 >> 2] = $1_1 - $6_1; + HEAP322[$2_1 + 4 >> 2] = $7_1 - (($1_1 >>> 0 < $6_1 >>> 0) + $5_1 | 0); + $1_1 = $3_1 + 2 | 0; + $2_1 = ($1_1 << 3) + $0 | 0; + $7_1 = $2_1; + $5_1 = $2_1; + $6_1 = $8_1 + HEAP322[$2_1 + 4 >> 2] | 0; + $2_1 = $4_1 + HEAP322[$2_1 >> 2] | 0; + if ($2_1 >>> 0 < $4_1 >>> 0) { + $6_1 = $6_1 + 1 | 0; + } + HEAP322[$5_1 >> 2] = $2_1; + HEAP322[$7_1 + 4 >> 2] = $6_1; + $4_1 = $3_1 >>> 0 < 8; + $3_1 = $1_1; + if ($4_1) { + continue; + } + break; + } + $6_1 = HEAP322[$0 + 80 >> 2]; + $7_1 = HEAP322[$0 + 84 >> 2]; + HEAP322[$0 + 80 >> 2] = 0; + HEAP322[$0 + 84 >> 2] = 0; + $3_1 = HEAP322[$0 + 4 >> 2] + $7_1 | 0; + $2_1 = HEAP322[$0 >> 2]; + $1_1 = $2_1 + $6_1 | 0; + if ($1_1 >>> 0 < $2_1 >>> 0) { + $3_1 = $3_1 + 1 | 0; + } + $2_1 = $1_1; + $1_1 = __wasm_i64_mul($6_1, $7_1, 18, 0); + $2_1 = $2_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = $2_1; + HEAP322[$0 >> 2] = $1_1; + HEAP322[$0 + 4 >> 2] = $3_1; + $7_1 = $3_1; + $4_1 = $24($1_1, $3_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = $3_1 << 26 | $4_1 >>> 6; + $6_1 = $4_1 << 26; + HEAP322[$0 >> 2] = $1_1 - $6_1; + HEAP322[$0 + 4 >> 2] = $7_1 - (($1_1 >>> 0 < $6_1 >>> 0) + $3_1 | 0); + $1_1 = $0; + $7_1 = $0; + $8_1 = $5_1 + HEAP322[$0 + 12 >> 2] | 0; + $0 = $4_1 + HEAP322[$0 + 8 >> 2] | 0; + if ($0 >>> 0 < $4_1 >>> 0) { + $8_1 = $8_1 + 1 | 0; + } + HEAP322[$7_1 + 8 >> 2] = $0; + HEAP322[$1_1 + 12 >> 2] = $8_1; + } + function $20($0, $1_1) { + $0 = $0 ^ $1_1 ^ -1; + $0 = $0 << 16 & $0; + $0 = $0 << 8 & $0; + $0 = $0 << 4 & $0; + $0 = $0 << 2 & $0; + return ($0 << 1 & $0) >> 31; + } + function $21($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0; + while (1) { + $3_1 = $7_1 << 3; + $2_1 = $3_1 + $0 | 0; + $4_1 = $2_1; + $8_1 = HEAP322[$2_1 >> 2]; + $5_1 = $1_1 + $3_1 | 0; + $6_1 = $8_1 + HEAP322[$5_1 >> 2] | 0; + $2_1 = HEAP322[$5_1 + 4 >> 2] + HEAP322[$2_1 + 4 >> 2] | 0; + HEAP322[$4_1 >> 2] = $6_1; + HEAP322[$4_1 + 4 >> 2] = $6_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $3_1 | 8; + $2_1 = $3_1 + $0 | 0; + $6_1 = $2_1; + $5_1 = HEAP322[$2_1 >> 2]; + $4_1 = $1_1 + $3_1 | 0; + $3_1 = $5_1 + HEAP322[$4_1 >> 2] | 0; + $2_1 = HEAP322[$4_1 + 4 >> 2] + HEAP322[$2_1 + 4 >> 2] | 0; + HEAP322[$6_1 >> 2] = $3_1; + HEAP322[$6_1 + 4 >> 2] = $3_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $7_1 >>> 0 < 8; + $7_1 = $7_1 + 2 | 0; + if ($2_1) { + continue; + } + break; + } + } + function $22($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0; + while (1) { + $2_1 = $5_1 << 3; + $3_1 = $2_1 + $0 | 0; + $6_1 = $3_1; + $4_1 = $1_1 + $2_1 | 0; + $2_1 = HEAP322[$4_1 >> 2]; + $7_1 = HEAP322[$4_1 + 4 >> 2]; + $4_1 = HEAP322[$3_1 >> 2]; + $3_1 = $7_1 - (HEAP322[$3_1 + 4 >> 2] + ($2_1 >>> 0 < $4_1 >>> 0) | 0) | 0; + HEAP322[$6_1 >> 2] = $2_1 - $4_1; + HEAP322[$6_1 + 4 >> 2] = $3_1; + $5_1 = $5_1 + 1 | 0; + if (($5_1 | 0) != 10) { + continue; + } + break; + } + } + function $23($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0; + while (1) { + $2_1 = $3_1 << 3; + $4_1 = $2_1 + $0 | 0; + $2_1 = $1_1 + $2_1 | 0; + HEAP322[$4_1 >> 2] = __wasm_i64_mul(HEAP322[$2_1 >> 2], HEAP322[$2_1 + 4 >> 2], 121665, 0); + HEAP322[$4_1 + 4 >> 2] = i64toi32_i32$HIGH_BITS; + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 10) { + continue; + } + break; + } + } + function $24($0, $1_1) { + var $2_1 = 0; + $2_1 = $0; + $0 = $0 + ($1_1 >> 31 >>> 6 | 0) | 0; + if ($0 >>> 0 < $2_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $0 = ($1_1 & 67108863) << 6 | $0 >>> 26; + i64toi32_i32$HIGH_BITS = $1_1 >> 26; + return $0; + } + function $25($0, $1_1) { + var $2_1 = 0; + $2_1 = $0; + $0 = $0 + ($1_1 >> 31 >>> 7 | 0) | 0; + if ($0 >>> 0 < $2_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $0 = ($1_1 & 33554431) << 7 | $0 >>> 25; + i64toi32_i32$HIGH_BITS = $1_1 >> 25; + return $0; + } + function $26($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0; + $3_1 = HEAP322[$1_1 >> 2]; + $2_1 = $3_1 >> 31; + HEAP322[$0 >> 2] = __wasm_i64_mul($3_1, $2_1, $3_1, $2_1); + HEAP322[$0 + 4 >> 2] = i64toi32_i32$HIGH_BITS; + $3_1 = $0; + $2_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = $2_1; + $6_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 >> 2]; + $4_1 = $2_1 >> 31; + HEAP322[$3_1 + 8 >> 2] = __wasm_i64_mul($5_1, $6_1, ($2_1 & 2147483647) << 1, $4_1); + HEAP322[$3_1 + 12 >> 2] = i64toi32_i32$HIGH_BITS; + $2_1 = HEAP322[$1_1 + 16 >> 2]; + $3_1 = $2_1; + $5_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 >> 2]; + $2_1 = __wasm_i64_mul($3_1, $5_1, $2_1, $2_1 >> 31); + $3_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $2_1; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $2_1 = $4_1 >> 31; + $4_1 = __wasm_i64_mul($4_1, $2_1, $4_1, $2_1); + $2_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $0; + HEAP322[$5_1 + 16 >> 2] = $2_1 << 1; + HEAP322[$5_1 + 20 >> 2] = $3_1 << 1 | $2_1 >>> 31; + $2_1 = HEAP322[$1_1 + 24 >> 2]; + $3_1 = $2_1; + $5_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 >> 2]; + $3_1 = __wasm_i64_mul($3_1, $5_1, $2_1, $2_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $3_1; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $5_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $6_1 = __wasm_i64_mul($5_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $2_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $0; + HEAP322[$2_1 + 24 >> 2] = $5_1 << 1; + HEAP322[$2_1 + 28 >> 2] = $3_1 << 1 | $5_1 >>> 31; + $2_1 = HEAP322[$1_1 + 24 >> 2]; + $5_1 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 8 >> 2]; + $3_1 = $2_1 >> 30; + $2_1 = __wasm_i64_mul($5_1, $4_1, ($2_1 & 1073741823) << 2, $3_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $2_1; + $4_1 = HEAP322[$1_1 + 16 >> 2]; + $2_1 = $4_1 >> 31; + $6_1 = __wasm_i64_mul($4_1, $2_1, $4_1, $2_1); + $2_1 = $5_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $2_1; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 >> 2]; + $3_1 = $2_1 >> 31; + $6_1 = __wasm_i64_mul($6_1, $7_1, ($2_1 & 2147483647) << 1, $3_1); + $2_1 = $5_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $0; + HEAP322[$5_1 + 32 >> 2] = $2_1; + HEAP322[$5_1 + 36 >> 2] = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = $2_1; + $5_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 8 >> 2]; + $3_1 = __wasm_i64_mul($3_1, $5_1, $2_1, $2_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $3_1; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $5_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $6_1 = __wasm_i64_mul($5_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $2_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $5_1; + $5_1 = HEAP322[$1_1 + 40 >> 2]; + $4_1 = $5_1; + $6_1 = $5_1 >> 31; + $5_1 = HEAP322[$1_1 >> 2]; + $6_1 = __wasm_i64_mul($4_1, $6_1, $5_1, $5_1 >> 31); + $5_1 = $2_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = $0; + HEAP322[$2_1 + 40 >> 2] = $5_1 << 1; + HEAP322[$2_1 + 44 >> 2] = $4_1 << 1 | $5_1 >>> 31; + $5_1 = $2_1; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 16 >> 2]; + $2_1 = __wasm_i64_mul($3_1, $4_1, $2_1, $2_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $2_1; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $2_1 = $3_1 >> 31; + $6_1 = __wasm_i64_mul($3_1, $2_1, $3_1, $2_1); + $3_1 = $7_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $3_1; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $6_1 = $3_1; + $7_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1; + $4_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $7_1 = $2_1; + $2_1 = HEAP322[$1_1 + 40 >> 2]; + $6_1 = $2_1; + $8_1 = $2_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $2_1 = $3_1 >> 31; + $6_1 = __wasm_i64_mul($6_1, $8_1, ($3_1 & 2147483647) << 1, $2_1); + $2_1 = $7_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + HEAP322[$5_1 + 48 >> 2] = $2_1 << 1; + HEAP322[$5_1 + 52 >> 2] = $3_1 << 1 | $2_1 >>> 31; + $2_1 = HEAP322[$1_1 + 40 >> 2]; + $3_1 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 16 >> 2]; + $2_1 = __wasm_i64_mul($3_1, $4_1, $2_1, $2_1 >> 31); + $3_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 24 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $2_1 = $4_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = $2_1; + $2_1 = HEAP322[$1_1 + 48 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 8 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $2_1 = $3_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $4_1 = $4_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1; + HEAP322[$5_1 + 56 >> 2] = $3_1 << 1; + HEAP322[$5_1 + 60 >> 2] = ($3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1) << 1 | $3_1 >>> 31; + $2_1 = $5_1; + $5_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = $5_1 >> 31; + $4_1 = __wasm_i64_mul($5_1, $3_1, $5_1, $3_1); + $9_1 = i64toi32_i32$HIGH_BITS; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $5_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $3_1 = __wasm_i64_mul($5_1, $6_1, $3_1, $3_1 >> 31); + $6_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $7_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = __wasm_i64_mul($7_1, $8_1, $3_1, $3_1 >> 31); + $5_1 = $5_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $6_1 | 0; + $3_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $7_1 = $5_1; + $5_1 = $3_1; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $6_1 = $3_1; + $8_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $3_1 = __wasm_i64_mul($6_1, $8_1, $3_1, $3_1 >> 31); + $11_1 = i64toi32_i32$HIGH_BITS; + $6_1 = $2_1; + $8_1 = $4_1; + $10_1 = $7_1; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 8 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $7_1, $2_1, $2_1 >> 31); + $2_1 = $4_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $11_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = $3_1 << 1 | $2_1 >>> 31; + $7_1 = $2_1 << 1; + $2_1 = $10_1 + $7_1 | 0; + $4_1 = $3_1 + $5_1 | 0; + $4_1 = $2_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = $4_1 << 1 | $2_1 >>> 31; + $4_1 = $2_1 << 1; + $5_1 = $8_1 + $4_1 | 0; + $2_1 = $3_1 + $9_1 | 0; + HEAP322[$6_1 + 64 >> 2] = $5_1; + HEAP322[$6_1 + 68 >> 2] = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = $2_1; + $5_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 24 >> 2]; + $3_1 = __wasm_i64_mul($3_1, $5_1, $2_1, $2_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $3_1; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $5_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $6_1 = __wasm_i64_mul($5_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $2_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $5_1; + $5_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = $5_1; + $6_1 = $5_1 >> 31; + $5_1 = HEAP322[$1_1 + 16 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $6_1, $5_1, $5_1 >> 31); + $5_1 = $2_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $5_1; + $5_1 = HEAP322[$1_1 + 64 >> 2]; + $4_1 = $5_1; + $6_1 = $5_1 >> 31; + $5_1 = HEAP322[$1_1 + 8 >> 2]; + $6_1 = __wasm_i64_mul($4_1, $6_1, $5_1, $5_1 >> 31); + $5_1 = $2_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $2_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 >> 2]; + $6_1 = __wasm_i64_mul($2_1, $6_1, $3_1, $3_1 >> 31); + $5_1 = $6_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $0; + HEAP322[$2_1 + 72 >> 2] = $5_1 << 1; + HEAP322[$2_1 + 76 >> 2] = $3_1 << 1 | $5_1 >>> 31; + $5_1 = $2_1; + $2_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $2_1 = __wasm_i64_mul($3_1, $4_1, $2_1, $2_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $2_1; + $3_1 = HEAP322[$1_1 + 40 >> 2]; + $2_1 = $3_1 >> 31; + $6_1 = __wasm_i64_mul($3_1, $2_1, $3_1, $2_1); + $3_1 = $7_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $3_1; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $6_1 = $3_1; + $7_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 16 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $3_1, $3_1 >> 31); + $4_1 = $4_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1; + $4_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + $6_1 = $3_1; + $7_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $3_1 = __wasm_i64_mul($6_1, $7_1, $3_1, $3_1 >> 31); + $6_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $2_1; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $8_1 = $2_1; + $10_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 24 >> 2]; + $9_1 = __wasm_i64_mul($8_1, $10_1, $2_1, $2_1 >> 31); + $2_1 = $9_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $6_1 | 0; + $6_1 = $2_1; + $2_1 = ($2_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $9_1 = $6_1 << 1; + $6_1 = $7_1 + $9_1 | 0; + $3_1 = $2_1 + $4_1 | 0; + $2_1 = $6_1; + HEAP322[$5_1 + 80 >> 2] = $2_1 << 1; + HEAP322[$5_1 + 84 >> 2] = ($2_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $3_1 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $2_1 = __wasm_i64_mul($3_1, $4_1, $2_1, $2_1 >> 31); + $3_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = HEAP322[$1_1 + 48 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 40 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $2_1 = $4_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = $2_1; + $2_1 = HEAP322[$1_1 + 64 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 24 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $2_1 = $3_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1; + $2_1 = HEAP322[$1_1 + 72 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 16 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $4_1 = $4_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1; + HEAP322[$5_1 + 88 >> 2] = $3_1 << 1; + HEAP322[$5_1 + 92 >> 2] = ($3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1) << 1 | $3_1 >>> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $2_1 = $3_1 >> 31; + $2_1 = __wasm_i64_mul($3_1, $2_1, $3_1, $2_1); + $6_1 = i64toi32_i32$HIGH_BITS; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $5_1 = $3_1; + $4_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = __wasm_i64_mul($5_1, $4_1, $3_1, $3_1 >> 31); + $9_1 = i64toi32_i32$HIGH_BITS; + $5_1 = HEAP322[$1_1 + 72 >> 2]; + $4_1 = $5_1; + $7_1 = $5_1 >> 31; + $5_1 = HEAP322[$1_1 + 24 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $7_1, $5_1, $5_1 >> 31); + $7_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $2_1; + $8_1 = $3_1; + $3_1 = $4_1; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = $2_1; + $10_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 40 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $10_1, $2_1, $2_1 >> 31); + $2_1 = $3_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $7_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1; + $2_1 = $3_1 << 1 | $2_1 >>> 31; + $7_1 = $4_1 << 1; + $4_1 = $8_1 + $7_1 | 0; + $3_1 = $2_1 + $9_1 | 0; + $2_1 = $4_1; + $3_1 = ($2_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $9_1 = $2_1 << 1; + $2_1 = $5_1 + $9_1 | 0; + $4_1 = $3_1 + $6_1 | 0; + $5_1 = $0; + HEAP322[$5_1 + 96 >> 2] = $2_1; + HEAP322[$5_1 + 100 >> 2] = $2_1 >>> 0 < $9_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = HEAP322[$1_1 + 64 >> 2]; + $3_1 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 40 >> 2]; + $2_1 = __wasm_i64_mul($3_1, $4_1, $2_1, $2_1 >> 31); + $3_1 = i64toi32_i32$HIGH_BITS; + $6_1 = $2_1; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 48 >> 2]; + $4_1 = __wasm_i64_mul($4_1, $7_1, $2_1, $2_1 >> 31); + $2_1 = $6_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1; + $2_1 = HEAP322[$1_1 + 72 >> 2]; + $6_1 = $2_1; + $7_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 32 >> 2]; + $6_1 = __wasm_i64_mul($6_1, $7_1, $2_1, $2_1 >> 31); + $4_1 = $4_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1; + HEAP322[$5_1 + 104 >> 2] = $3_1 << 1; + HEAP322[$5_1 + 108 >> 2] = ($3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1) << 1 | $3_1 >>> 31; + $2_1 = $5_1; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $5_1 = $3_1; + $4_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = __wasm_i64_mul($5_1, $4_1, $3_1, $3_1 >> 31); + $4_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $3_1; + $5_1 = HEAP322[$1_1 + 56 >> 2]; + $3_1 = $5_1 >> 31; + $6_1 = __wasm_i64_mul($5_1, $3_1, $5_1, $3_1); + $5_1 = $7_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = $5_1; + $5_1 = $3_1; + $4_1 = $2_1; + $7_1 = $6_1; + $2_1 = HEAP322[$1_1 + 72 >> 2]; + $6_1 = $2_1; + $8_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 40 >> 2]; + $3_1 = $2_1 >> 31; + $6_1 = __wasm_i64_mul($6_1, $8_1, ($2_1 & 2147483647) << 1, $3_1); + $2_1 = $7_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + HEAP322[$4_1 + 112 >> 2] = $2_1 << 1; + HEAP322[$4_1 + 116 >> 2] = ($2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $2_1 = HEAP322[$1_1 + 72 >> 2]; + $3_1 = $2_1; + $5_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 48 >> 2]; + $3_1 = __wasm_i64_mul($3_1, $5_1, $2_1, $2_1 >> 31); + $5_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $3_1; + $3_1 = HEAP322[$1_1 + 64 >> 2]; + $4_1 = $3_1; + $6_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 56 >> 2]; + $6_1 = __wasm_i64_mul($4_1, $6_1, $3_1, $3_1 >> 31); + $3_1 = $2_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $2_1 = $0; + HEAP322[$2_1 + 120 >> 2] = $3_1 << 1; + HEAP322[$2_1 + 124 >> 2] = ($3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1) << 1 | $3_1 >>> 31; + $2_1 = HEAP322[$1_1 + 72 >> 2]; + $3_1 = $2_1; + $5_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 56 >> 2]; + $4_1 = $2_1 >> 30; + $5_1 = __wasm_i64_mul($3_1, $5_1, ($2_1 & 1073741823) << 2, $4_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $5_1; + $5_1 = HEAP322[$1_1 + 64 >> 2]; + $3_1 = $5_1 >> 31; + $6_1 = __wasm_i64_mul($5_1, $3_1, $5_1, $3_1); + $5_1 = $2_1 + $6_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $0; + HEAP322[$2_1 + 128 >> 2] = $5_1; + HEAP322[$2_1 + 132 >> 2] = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $2_1; + $2_1 = HEAP322[$1_1 + 72 >> 2]; + $0 = $2_1; + $4_1 = $2_1 >> 31; + $2_1 = HEAP322[$1_1 + 64 >> 2]; + $3_1 = $2_1 >> 31; + HEAP322[$5_1 + 136 >> 2] = __wasm_i64_mul($0, $4_1, ($2_1 & 2147483647) << 1, $3_1); + HEAP322[$5_1 + 140 >> 2] = i64toi32_i32$HIGH_BITS; + $3_1 = HEAP322[$1_1 + 72 >> 2]; + HEAP322[$5_1 + 144 >> 2] = __wasm_i64_mul(($3_1 & 2147483647) << 1, $3_1 >> 31, $3_1, $3_1 >> 31); + HEAP322[$5_1 + 148 >> 2] = i64toi32_i32$HIGH_BITS; + } + function $27($0) { + HEAP322[$0 >> 2] = 0; + HEAP322[$0 + 4 >> 2] = 0; + HEAP322[$0 + 32 >> 2] = 0; + HEAP322[$0 + 36 >> 2] = 0; + HEAP322[$0 + 24 >> 2] = 0; + HEAP322[$0 + 28 >> 2] = 0; + HEAP322[$0 + 16 >> 2] = 0; + HEAP322[$0 + 20 >> 2] = 0; + HEAP322[$0 + 8 >> 2] = 0; + HEAP322[$0 + 12 >> 2] = 0; + } + function $28($0) { + HEAP322[$0 + 4 >> 2] = 0; + HEAP322[$0 + 8 >> 2] = 0; + HEAP322[$0 >> 2] = 1; + HEAP322[$0 + 12 >> 2] = 0; + HEAP322[$0 + 16 >> 2] = 0; + HEAP322[$0 + 20 >> 2] = 0; + HEAP322[$0 + 24 >> 2] = 0; + HEAP322[$0 + 28 >> 2] = 0; + HEAP322[$0 + 32 >> 2] = 0; + HEAP322[$0 + 36 >> 2] = 0; + } + function $29($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0; + $3_1 = HEAP322[$2_1 >> 2]; + $4_1 = HEAP322[$1_1 >> 2]; + $5_1 = HEAP322[$2_1 + 4 >> 2]; + $6_1 = HEAP322[$1_1 + 4 >> 2]; + $7_1 = HEAP322[$2_1 + 8 >> 2]; + $8_1 = HEAP322[$1_1 + 8 >> 2]; + $9_1 = HEAP322[$2_1 + 12 >> 2]; + $10_1 = HEAP322[$1_1 + 12 >> 2]; + $11_1 = HEAP322[$2_1 + 16 >> 2]; + $12_1 = HEAP322[$1_1 + 16 >> 2]; + $13_1 = HEAP322[$2_1 + 20 >> 2]; + $14_1 = HEAP322[$1_1 + 20 >> 2]; + $15_1 = HEAP322[$2_1 + 24 >> 2]; + $16_1 = HEAP322[$1_1 + 24 >> 2]; + $17_1 = HEAP322[$2_1 + 28 >> 2]; + $18_1 = HEAP322[$1_1 + 28 >> 2]; + $19 = HEAP322[$2_1 + 32 >> 2]; + $20_1 = HEAP322[$1_1 + 32 >> 2]; + HEAP322[$0 + 36 >> 2] = HEAP322[$2_1 + 36 >> 2] + HEAP322[$1_1 + 36 >> 2]; + HEAP322[$0 + 32 >> 2] = $19 + $20_1; + HEAP322[$0 + 28 >> 2] = $17_1 + $18_1; + HEAP322[$0 + 24 >> 2] = $15_1 + $16_1; + HEAP322[$0 + 20 >> 2] = $13_1 + $14_1; + HEAP322[$0 + 16 >> 2] = $11_1 + $12_1; + HEAP322[$0 + 12 >> 2] = $9_1 + $10_1; + HEAP322[$0 + 8 >> 2] = $7_1 + $8_1; + HEAP322[$0 + 4 >> 2] = $5_1 + $6_1; + HEAP322[$0 >> 2] = $3_1 + $4_1; + } + function $30($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0; + $13_1 = HEAP322[$1_1 >> 2]; + $3_1 = HEAP322[$0 >> 2]; + $14_1 = HEAP322[$1_1 + 4 >> 2]; + $4_1 = HEAP322[$0 + 4 >> 2]; + $15_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = HEAP322[$0 + 8 >> 2]; + $16_1 = HEAP322[$1_1 + 12 >> 2]; + $6_1 = HEAP322[$0 + 12 >> 2]; + $17_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = HEAP322[$0 + 16 >> 2]; + $18_1 = HEAP322[$1_1 + 20 >> 2]; + $8_1 = HEAP322[$0 + 20 >> 2]; + $19 = HEAP322[$1_1 + 24 >> 2]; + $9_1 = HEAP322[$0 + 24 >> 2]; + $20_1 = HEAP322[$1_1 + 28 >> 2]; + $10_1 = HEAP322[$0 + 28 >> 2]; + $21_1 = HEAP322[$1_1 + 32 >> 2]; + $11_1 = HEAP322[$0 + 32 >> 2]; + $12_1 = HEAP322[$0 + 36 >> 2]; + $22_1 = HEAP322[$1_1 + 36 >> 2] ^ $12_1; + $1_1 = 0 - $2_1 | 0; + HEAP322[$0 + 36 >> 2] = $12_1 ^ $22_1 & $1_1; + HEAP322[$0 + 32 >> 2] = $1_1 & ($11_1 ^ $21_1) ^ $11_1; + HEAP322[$0 + 28 >> 2] = $1_1 & ($10_1 ^ $20_1) ^ $10_1; + HEAP322[$0 + 24 >> 2] = $1_1 & ($9_1 ^ $19) ^ $9_1; + HEAP322[$0 + 20 >> 2] = $1_1 & ($8_1 ^ $18_1) ^ $8_1; + HEAP322[$0 + 16 >> 2] = $1_1 & ($7_1 ^ $17_1) ^ $7_1; + HEAP322[$0 + 12 >> 2] = $1_1 & ($6_1 ^ $16_1) ^ $6_1; + HEAP322[$0 + 8 >> 2] = $1_1 & ($5_1 ^ $15_1) ^ $5_1; + HEAP322[$0 + 4 >> 2] = $1_1 & ($4_1 ^ $14_1) ^ $4_1; + HEAP322[$0 >> 2] = $1_1 & ($3_1 ^ $13_1) ^ $3_1; + } + function $31($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0; + $2_1 = HEAP322[$1_1 >> 2]; + $3_1 = HEAP322[$1_1 + 4 >> 2]; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = HEAP322[$1_1 + 12 >> 2]; + $6_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = HEAP322[$1_1 + 20 >> 2]; + $8_1 = HEAP322[$1_1 + 24 >> 2]; + $9_1 = HEAP322[$1_1 + 28 >> 2]; + $10_1 = HEAP322[$1_1 + 36 >> 2]; + HEAP322[$0 + 32 >> 2] = HEAP322[$1_1 + 32 >> 2]; + HEAP322[$0 + 36 >> 2] = $10_1; + HEAP322[$0 + 24 >> 2] = $8_1; + HEAP322[$0 + 28 >> 2] = $9_1; + HEAP322[$0 + 16 >> 2] = $6_1; + HEAP322[$0 + 20 >> 2] = $7_1; + HEAP322[$0 + 8 >> 2] = $4_1; + HEAP322[$0 + 12 >> 2] = $5_1; + HEAP322[$0 >> 2] = $2_1; + HEAP322[$0 + 4 >> 2] = $3_1; + } + function $32($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0; + $13_1 = $33($1_1); + $14_1 = i64toi32_i32$HIGH_BITS; + $12_1 = $34($1_1 + 4 | 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $9_1 = $34($1_1 + 7 | 0); + $4_1 = i64toi32_i32$HIGH_BITS; + $11_1 = $34($1_1 + 10 | 0); + $3_1 = i64toi32_i32$HIGH_BITS; + $15_1 = $34($1_1 + 13 | 0); + $8_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $33($1_1 + 16 | 0); + $10_1 = i64toi32_i32$HIGH_BITS; + $16_1 = $34($1_1 + 20 | 0); + $17_1 = i64toi32_i32$HIGH_BITS; + $18_1 = $34($1_1 + 23 | 0); + $19 = i64toi32_i32$HIGH_BITS; + $20_1 = $34($1_1 + 26 | 0); + $21_1 = i64toi32_i32$HIGH_BITS; + $22_1 = $34($1_1 + 29 | 0); + $6_1 = $0; + $1_1 = $3_1 << 3 | $11_1 >>> 29; + $3_1 = $11_1 << 3; + $23_1 = $3_1; + $3_1 = $3_1 + 16777216 | 0; + if ($3_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $11_1 = $3_1; + $3_1 = $1_1; + $1_1 = $4_1 << 5 | $9_1 >>> 27; + $7_1 = $9_1 << 5; + $4_1 = $1_1; + $9_1 = $12_1; + $1_1 = $2_1 << 6 | $9_1 >>> 26; + $9_1 = $9_1 << 6; + $24_1 = $6_1; + $6_1 = $7_1; + $2_1 = $1_1; + $1_1 = $9_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $2_1 = $2_1 + 1 | 0; + } + $12_1 = $1_1; + $7_1 = $1_1; + $1_1 = $2_1 >> 25; + $7_1 = ($2_1 & 33554431) << 7 | $7_1 >>> 25; + $2_1 = $6_1 + $7_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $1_1 = $2_1 >>> 0 < $7_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $2_1 + 33554432 | 0; + if ($4_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $6_1 = ($23_1 - ($11_1 & -33554432) | 0) + (($1_1 & 67108863) << 6 | $4_1 >>> 26) | 0; + HEAP322[$24_1 + 12 >> 2] = $6_1; + $1_1 = $4_1 & -67108864; + HEAP322[$0 + 8 >> 2] = $2_1 - $1_1; + $2_1 = $0; + $4_1 = $5_1; + $1_1 = $10_1; + $5_1 = $4_1 + 16777216 | 0; + if ($5_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $10_1 = $5_1; + $5_1 = $1_1; + $6_1 = $4_1 - ($10_1 & -33554432) | 0; + $4_1 = $15_1; + $1_1 = $8_1 << 2 | $4_1 >>> 30; + $8_1 = $4_1 << 2; + $4_1 = $1_1; + $7_1 = $8_1; + $1_1 = $3_1 >> 25; + $8_1 = ($3_1 & 33554431) << 7 | $11_1 >>> 25; + $3_1 = $7_1 + $8_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $1_1 = $3_1 >>> 0 < $8_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $7_1 = $2_1; + $2_1 = $1_1; + $1_1 = $3_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $4_1 = (($2_1 & 67108863) << 6 | $1_1 >>> 26) + $6_1 | 0; + HEAP322[$7_1 + 20 >> 2] = $4_1; + $1_1 = $1_1 & -67108864; + HEAP322[$0 + 16 >> 2] = $3_1 - $1_1; + $3_1 = $0; + $2_1 = $16_1; + $1_1 = $17_1 << 7 | $2_1 >>> 25; + $6_1 = $2_1 << 7; + $2_1 = $5_1 >> 25; + $4_1 = ($5_1 & 33554431) << 7 | $10_1 >>> 25; + $5_1 = $6_1 + $4_1 | 0; + $1_1 = $1_1 + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $5_1; + $5_1 = $2_1; + $2_1 = $2_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $4_1 = $2_1; + $2_1 = $1_1; + $1_1 = $4_1 & -67108864; + HEAP322[$3_1 + 24 >> 2] = $5_1 - $1_1; + $5_1 = $0; + $3_1 = $18_1; + $1_1 = $19 << 5 | $3_1 >>> 27; + $3_1 = $3_1 << 5; + $10_1 = $3_1; + $3_1 = $3_1 + 16777216 | 0; + if ($3_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $8_1 = $3_1; + $3_1 = $1_1; + $2_1 = ($10_1 - ($8_1 & -33554432) | 0) + (($2_1 & 67108863) << 6 | $4_1 >>> 26) | 0; + HEAP322[$5_1 + 28 >> 2] = $2_1; + $2_1 = $20_1; + $1_1 = $21_1 << 4 | $2_1 >>> 28; + $4_1 = $2_1 << 4; + $2_1 = $1_1; + $6_1 = $4_1; + $1_1 = $3_1 >> 25; + $4_1 = ($3_1 & 33554431) << 7 | $8_1 >>> 25; + $3_1 = $6_1 + $4_1 | 0; + $1_1 = $1_1 + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $3_1; + $3_1 = $2_1; + $2_1 = $2_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $4_1 = $2_1; + $2_1 = $1_1; + $1_1 = $4_1 & -67108864; + HEAP322[$5_1 + 32 >> 2] = $3_1 - $1_1; + $1_1 = 0; + $5_1 = $22_1; + $5_1 = $5_1 << 2 & 33554428; + $3_1 = $5_1; + $5_1 = $5_1 + 16777216 | 0; + if ($5_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = ($3_1 - ($5_1 & 33554432) | 0) + (($2_1 & 67108863) << 6 | $4_1 >>> 26) | 0; + HEAP322[$0 + 36 >> 2] = $3_1; + $5_1 = __wasm_i64_mul(($1_1 & 33554431) << 7 | $5_1 >>> 25, $1_1 >>> 25 | 0, 19, 0); + $2_1 = $5_1 + $13_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $14_1 | 0; + $1_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $2_1 + 33554432 | 0; + if ($3_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $5_1 = ($9_1 - ($12_1 & -33554432) | 0) + (($1_1 & 67108863) << 6 | $3_1 >>> 26) | 0; + HEAP322[$0 + 4 >> 2] = $5_1; + $1_1 = $0; + $0 = $3_1 & -67108864; + HEAP322[$1_1 >> 2] = $2_1 - $0; + } + function $33($0) { + i64toi32_i32$HIGH_BITS = 0; + return HEAPU82[$0 | 0] | HEAPU82[$0 + 1 | 0] << 8 | (HEAPU82[$0 + 2 | 0] << 16 | HEAPU82[$0 + 3 | 0] << 24); + } + function $34($0) { + var $1_1 = 0, $2_1 = 0; + $1_1 = HEAPU82[$0 | 0] | HEAPU82[$0 + 1 | 0] << 8; + $0 = HEAPU82[$0 + 2 | 0]; + $2_1 = $0 >>> 16 | 0; + $0 = $1_1 | $0 << 16; + i64toi32_i32$HIGH_BITS = $2_1; + return $0; + } + function $35($0, $1_1) { + var $2_1 = 0; + $2_1 = global$0 - 192 | 0; + global$0 = $2_1; + $42($2_1 + 144 | 0, $1_1); + $42($2_1 + 96 | 0, $2_1 + 144 | 0); + $42($2_1 + 96 | 0, $2_1 + 96 | 0); + $38($2_1 + 96 | 0, $1_1, $2_1 + 96 | 0); + $38($2_1 + 144 | 0, $2_1 + 144 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 144 | 0); + $38($2_1 + 96 | 0, $2_1 + 96 | 0, $2_1 + 48 | 0); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $1_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 5) { + continue; + } + break; + } + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $1_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 10) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1, $2_1 + 48 | 0); + $1_1 = 1; + while (1) { + $42($2_1, $2_1); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 20) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1, $2_1 + 48 | 0); + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 10) { + continue; + } + break; + } + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $1_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 50) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1, $2_1 + 48 | 0); + $1_1 = 1; + while (1) { + $42($2_1, $2_1); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 100) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1, $2_1 + 48 | 0); + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 50) { + continue; + } + break; + } + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 96 | 0, $2_1 + 96 | 0); + $1_1 = 1; + while (1) { + $42($2_1 + 96 | 0, $2_1 + 96 | 0); + $1_1 = $1_1 + 1 | 0; + if (($1_1 | 0) != 5) { + continue; + } + break; + } + $38($0, $2_1 + 96 | 0, $2_1 + 144 | 0); + global$0 = $2_1 + 192 | 0; + } + function $36($0) { + var $1_1 = 0; + $1_1 = global$0 - 32 | 0; + global$0 = $1_1; + $44($1_1, $0); + global$0 = $1_1 + 32 | 0; + return HEAP82[$1_1 | 0] & 1; + } + function $37($0) { + var $1_1 = 0; + $1_1 = global$0 - 32 | 0; + global$0 = $1_1; + $44($1_1, $0); + $0 = $2($1_1, 1024); + global$0 = $1_1 + 32 | 0; + return $0; + } + function $38($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0, $25_1 = 0, $26_1 = 0, $27_1 = 0, $28_1 = 0, $29_1 = 0, $30_1 = 0, $31_1 = 0, $32_1 = 0, $33_1 = 0, $34_1 = 0, $35_1 = 0, $36_1 = 0, $37_1 = 0, $38_1 = 0, $39_1 = 0, $40_1 = 0, $41_1 = 0, $42_1 = 0, $43_1 = 0, $44_1 = 0, $45_1 = 0, $46_1 = 0, $47_1 = 0, $48_1 = 0, $49_1 = 0, $50_1 = 0, $51_1 = 0, $52_1 = 0, $53 = 0, $54_1 = 0, $55 = 0, $56_1 = 0, $57_1 = 0, $58_1 = 0, $59_1 = 0, $60 = 0, $61_1 = 0, $62_1 = 0, $63 = 0, $64_1 = 0, $65_1 = 0, $66_1 = 0, $67_1 = 0, $68_1 = 0, $69_1 = 0, $70_1 = 0, $71_1 = 0, $72_1 = 0, $73_1 = 0, $74 = 0, $75_1 = 0, $76_1 = 0, $77 = 0, $78_1 = 0, $79_1 = 0, $80_1 = 0, $81_1 = 0; + $9_1 = $0; + $41_1 = HEAP322[$2_1 + 4 >> 2]; + $3_1 = $41_1; + $30_1 = $3_1; + $31_1 = $3_1 >> 31; + $17_1 = HEAP322[$1_1 + 20 >> 2]; + $3_1 = $17_1 << 1; + $64_1 = $3_1; + $48_1 = $3_1 >> 31; + $3_1 = __wasm_i64_mul($30_1, $31_1, $3_1, $48_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $3_1; + $3_1 = HEAP322[$2_1 >> 2]; + $23_1 = $3_1; + $24_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 24 >> 2]; + $32_1 = $3_1; + $25_1 = $3_1 >> 31; + $7_1 = __wasm_i64_mul($23_1, $24_1, $3_1, $25_1); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $8_1 = HEAP322[$2_1 + 8 >> 2]; + $4_1 = $8_1; + $49_1 = $4_1; + $39_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 + 16 >> 2]; + $33_1 = $4_1; + $26_1 = $4_1 >> 31; + $7_1 = __wasm_i64_mul($8_1, $39_1, $4_1, $26_1); + $4_1 = $5_1 + $7_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $19 = HEAP322[$2_1 + 12 >> 2]; + $3_1 = $19; + $65_1 = $3_1; + $42_1 = $3_1 >> 31; + $14_1 = HEAP322[$1_1 + 12 >> 2]; + $3_1 = $14_1 << 1; + $66_1 = $3_1; + $50_1 = $3_1 >> 31; + $7_1 = __wasm_i64_mul($19, $42_1, $3_1, $50_1); + $3_1 = $7_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $3_1; + $18_1 = HEAP322[$2_1 + 16 >> 2]; + $3_1 = $18_1; + $73_1 = $3_1; + $46_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $34_1 = $3_1; + $27_1 = $3_1 >> 31; + $7_1 = __wasm_i64_mul($18_1, $46_1, $3_1, $27_1); + $5_1 = $5_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = $5_1; + $12_1 = HEAP322[$2_1 + 20 >> 2]; + $4_1 = $12_1; + $74 = $4_1; + $51_1 = $4_1 >> 31; + $10_1 = HEAP322[$1_1 + 4 >> 2]; + $4_1 = $10_1 << 1; + $67_1 = $4_1; + $52_1 = $4_1 >> 31; + $5_1 = __wasm_i64_mul($12_1, $51_1, $4_1, $52_1); + $4_1 = $6_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $13_1 = HEAP322[$2_1 + 24 >> 2]; + $4_1 = $13_1; + $75_1 = $4_1; + $68_1 = $4_1 >> 31; + $4_1 = HEAP322[$1_1 >> 2]; + $35_1 = $4_1; + $28_1 = $4_1 >> 31; + $7_1 = __wasm_i64_mul($13_1, $68_1, $4_1, $28_1); + $5_1 = $5_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $20_1 = HEAP322[$2_1 + 28 >> 2]; + $3_1 = Math_imul2($20_1, 19); + $43_1 = $3_1; + $44_1 = $3_1 >> 31; + $15_1 = HEAP322[$1_1 + 36 >> 2]; + $3_1 = $15_1 << 1; + $69_1 = $3_1; + $53 = $3_1 >> 31; + $7_1 = __wasm_i64_mul($43_1, $44_1, $3_1, $53); + $3_1 = $7_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = $3_1; + $16_1 = HEAP322[$2_1 + 32 >> 2]; + $3_1 = Math_imul2($16_1, 19); + $21_1 = $3_1; + $22_1 = $3_1 >> 31; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $36_1 = $3_1; + $29_1 = $3_1 >> 31; + $7_1 = __wasm_i64_mul($21_1, $22_1, $3_1, $29_1); + $4_1 = $4_1 + $7_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $76_1 = HEAP322[$2_1 + 36 >> 2]; + $2_1 = Math_imul2($76_1, 19); + $37_1 = $2_1; + $38_1 = $2_1 >> 31; + $1_1 = HEAP322[$1_1 + 28 >> 2]; + $2_1 = $1_1 << 1; + $70_1 = $2_1; + $54_1 = $2_1 >> 31; + $4_1 = __wasm_i64_mul($37_1, $38_1, $2_1, $54_1); + $2_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $11_1 = $2_1; + $2_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = __wasm_i64_mul($33_1, $26_1, $30_1, $31_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $17_1; + $55 = $7_1 >> 31; + $17_1 = __wasm_i64_mul($23_1, $24_1, $7_1, $55); + $3_1 = $17_1 + $3_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $17_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $17_1 = $14_1; + $56_1 = $14_1 >> 31; + $14_1 = __wasm_i64_mul($8_1, $39_1, $14_1, $56_1); + $3_1 = $14_1 + $3_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $14_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $14_1 = __wasm_i64_mul($34_1, $27_1, $19, $42_1); + $5_1 = $14_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $14_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $5_1; + $14_1 = $10_1; + $57_1 = $10_1 >> 31; + $5_1 = __wasm_i64_mul($18_1, $46_1, $10_1, $57_1); + $4_1 = $4_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($35_1, $28_1, $12_1, $51_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = Math_imul2($13_1, 19); + $58_1 = $4_1; + $47_1 = $4_1 >> 31; + $10_1 = $15_1; + $59_1 = $10_1 >> 31; + $15_1 = __wasm_i64_mul($4_1, $47_1, $10_1, $59_1); + $4_1 = $5_1 + $15_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $15_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $15_1 = __wasm_i64_mul($36_1, $29_1, $43_1, $44_1); + $3_1 = $15_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $15_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $15_1 = $1_1; + $60 = $1_1 >> 31; + $5_1 = __wasm_i64_mul($21_1, $22_1, $1_1, $60); + $1_1 = $5_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = __wasm_i64_mul($37_1, $38_1, $32_1, $25_1); + $1_1 = $4_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $45_1 = $1_1; + $1_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = __wasm_i64_mul($30_1, $31_1, $66_1, $50_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $13_1 = __wasm_i64_mul($23_1, $24_1, $33_1, $26_1); + $4_1 = $13_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $13_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $13_1 = __wasm_i64_mul($34_1, $27_1, $8_1, $39_1); + $4_1 = $13_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $13_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $13_1 = __wasm_i64_mul($19, $42_1, $67_1, $52_1); + $3_1 = $13_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $13_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $13_1 = __wasm_i64_mul($35_1, $28_1, $18_1, $46_1); + $5_1 = $13_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $13_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = $5_1; + $4_1 = Math_imul2($12_1, 19); + $71_1 = $4_1; + $61_1 = $4_1 >> 31; + $5_1 = __wasm_i64_mul($4_1, $61_1, $69_1, $53); + $4_1 = $6_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($36_1, $29_1, $58_1, $47_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $12_1 = __wasm_i64_mul($43_1, $44_1, $70_1, $54_1); + $4_1 = $12_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $12_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $12_1 = __wasm_i64_mul($21_1, $22_1, $32_1, $25_1); + $3_1 = $12_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $12_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $12_1 = __wasm_i64_mul($37_1, $38_1, $64_1, $48_1); + $5_1 = $12_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $12_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $12_1 = $5_1; + $78_1 = $3_1; + $4_1 = $5_1 + 33554432 | 0; + if ($4_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $13_1 = $4_1; + $79_1 = $3_1; + $5_1 = $45_1; + $45_1 = ($3_1 & 67108863) << 6 | $4_1 >>> 26; + $5_1 = $5_1 + $45_1 | 0; + $3_1 = ($3_1 >> 26) + $1_1 | 0; + $3_1 = $5_1 >>> 0 < $45_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $45_1 = $5_1; + $5_1 = $3_1; + $1_1 = $45_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $5_1 = $5_1 + 1 | 0; + } + $80_1 = $1_1; + $4_1 = $5_1 >> 25; + $5_1 = ($5_1 & 33554431) << 7 | $1_1 >>> 25; + $1_1 = $5_1 + $11_1 | 0; + $3_1 = $2_1 + $4_1 | 0; + $3_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $1_1; + $1_1 = $2_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $62_1 = $1_1; + $1_1 = $3_1; + $3_1 = $62_1 & -67108864; + HEAP322[$9_1 + 24 >> 2] = $2_1 - $3_1; + $11_1 = $0; + $2_1 = __wasm_i64_mul($30_1, $31_1, $67_1, $52_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $4_1 = __wasm_i64_mul($23_1, $24_1, $34_1, $27_1); + $2_1 = $4_1 + $2_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = __wasm_i64_mul($35_1, $28_1, $49_1, $39_1); + $2_1 = $4_1 + $2_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $2_1; + $2_1 = Math_imul2($19, 19); + $9_1 = $2_1; + $19 = $2_1 >> 31; + $4_1 = __wasm_i64_mul($2_1, $19, $69_1, $53); + $2_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1; + $2_1 = Math_imul2($18_1, 19); + $77 = $2_1; + $72_1 = $2_1 >> 31; + $5_1 = __wasm_i64_mul($36_1, $29_1, $2_1, $72_1); + $2_1 = $4_1 + $5_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = __wasm_i64_mul($70_1, $54_1, $71_1, $61_1); + $2_1 = $5_1 + $2_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = __wasm_i64_mul($32_1, $25_1, $58_1, $47_1); + $2_1 = $4_1 + $2_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $4_1 = __wasm_i64_mul($43_1, $44_1, $64_1, $48_1); + $2_1 = $4_1 + $2_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = __wasm_i64_mul($21_1, $22_1, $33_1, $26_1); + $2_1 = $4_1 + $2_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($37_1, $38_1, $66_1, $50_1); + $2_1 = $5_1 + $2_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $6_1 = $2_1; + $2_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = __wasm_i64_mul($35_1, $28_1, $30_1, $31_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $18_1 = __wasm_i64_mul($23_1, $24_1, $14_1, $57_1); + $4_1 = $18_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $18_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = $4_1; + $4_1 = Math_imul2($8_1, 19); + $18_1 = $4_1; + $40_1 = $4_1 >> 31; + $8_1 = __wasm_i64_mul($4_1, $40_1, $10_1, $59_1); + $4_1 = $5_1 + $8_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $8_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = __wasm_i64_mul($36_1, $29_1, $9_1, $19); + $4_1 = $8_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $8_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($77, $72_1, $15_1, $60); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $8_1 = __wasm_i64_mul($32_1, $25_1, $71_1, $61_1); + $5_1 = $8_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $8_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $8_1 = __wasm_i64_mul($58_1, $47_1, $7_1, $55); + $5_1 = $8_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $8_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $8_1 = __wasm_i64_mul($33_1, $26_1, $43_1, $44_1); + $4_1 = $8_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $8_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $8_1 = __wasm_i64_mul($21_1, $22_1, $17_1, $56_1); + $4_1 = $8_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $8_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($37_1, $38_1, $34_1, $27_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $63 = $4_1; + $8_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $3_1 = Math_imul2($41_1, 19); + $3_1 = __wasm_i64_mul($3_1, $3_1 >> 31, $69_1, $53); + $4_1 = i64toi32_i32$HIGH_BITS; + $5_1 = __wasm_i64_mul($23_1, $24_1, $35_1, $28_1); + $3_1 = $5_1 + $3_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $4_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $41_1 = __wasm_i64_mul($36_1, $29_1, $18_1, $40_1); + $5_1 = $41_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $9_1 = __wasm_i64_mul($9_1, $19, $70_1, $54_1); + $4_1 = $9_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + ($5_1 >>> 0 < $41_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) | 0; + $5_1 = $4_1 >>> 0 < $9_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $9_1 = __wasm_i64_mul($32_1, $25_1, $77, $72_1); + $4_1 = $9_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($64_1, $48_1, $71_1, $61_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = __wasm_i64_mul($33_1, $26_1, $58_1, $47_1); + $5_1 = $9_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $9_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $9_1 = __wasm_i64_mul($43_1, $44_1, $66_1, $50_1); + $5_1 = $9_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = __wasm_i64_mul($21_1, $22_1, $34_1, $27_1); + $4_1 = $9_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $9_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $9_1 = __wasm_i64_mul($37_1, $38_1, $67_1, $52_1); + $4_1 = $9_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = $4_1; + $41_1 = $3_1; + $4_1 = $4_1 + 33554432 | 0; + if ($4_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $19 = $4_1; + $18_1 = $3_1; + $5_1 = $3_1 >> 26; + $40_1 = ($3_1 & 67108863) << 6 | $4_1 >>> 26; + $3_1 = $40_1 + $63 | 0; + $4_1 = $5_1 + $8_1 | 0; + $8_1 = $3_1; + $5_1 = $6_1; + $3_1 = $3_1 >>> 0 < $40_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $4_1 = $8_1 + 16777216 | 0; + if ($4_1 >>> 0 < 16777216) { + $3_1 = $3_1 + 1 | 0; + } + $81_1 = $4_1; + $6_1 = ($3_1 & 33554431) << 7 | $4_1 >>> 25; + $4_1 = $5_1 + $6_1 | 0; + $3_1 = ($3_1 >> 25) + $2_1 | 0; + $3_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $4_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $40_1 = $2_1; + $2_1 = $3_1; + $3_1 = $40_1 & -67108864; + HEAP322[$11_1 + 8 >> 2] = $4_1 - $3_1; + $6_1 = $0; + $3_1 = __wasm_i64_mul($32_1, $25_1, $30_1, $31_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $11_1 = __wasm_i64_mul($23_1, $24_1, $15_1, $60); + $4_1 = $11_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $11_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($49_1, $39_1, $7_1, $55); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($33_1, $26_1, $65_1, $42_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $11_1 = __wasm_i64_mul($73_1, $46_1, $17_1, $56_1); + $4_1 = $11_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $11_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $11_1 = __wasm_i64_mul($34_1, $27_1, $74, $51_1); + $3_1 = $11_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $11_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $11_1 = __wasm_i64_mul($14_1, $57_1, $75_1, $68_1); + $5_1 = $11_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $11_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $5_1; + $11_1 = $20_1; + $63 = $11_1 >> 31; + $5_1 = __wasm_i64_mul($35_1, $28_1, $11_1, $63); + $4_1 = $4_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($21_1, $22_1, $10_1, $59_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $20_1 = __wasm_i64_mul($37_1, $38_1, $36_1, $29_1); + $4_1 = $20_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $20_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $3_1 = $1_1 >> 26; + $20_1 = ($1_1 & 67108863) << 6 | $62_1 >>> 26; + $1_1 = $20_1 + $4_1 | 0; + $4_1 = $3_1 + $5_1 | 0; + $4_1 = $1_1 >>> 0 < $20_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $5_1 = $1_1; + $3_1 = $4_1; + $1_1 = $5_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $3_1 = $3_1 + 1 | 0; + } + $62_1 = $1_1; + $1_1 = $3_1; + $3_1 = $62_1 & -33554432; + HEAP322[$6_1 + 28 >> 2] = $5_1 - $3_1; + $20_1 = $0; + $3_1 = __wasm_i64_mul($34_1, $27_1, $30_1, $31_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $6_1 = __wasm_i64_mul($23_1, $24_1, $17_1, $56_1); + $3_1 = $6_1 + $3_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $6_1 = __wasm_i64_mul($49_1, $39_1, $14_1, $57_1); + $3_1 = $6_1 + $3_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $6_1 = __wasm_i64_mul($35_1, $28_1, $65_1, $42_1); + $5_1 = $6_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $5_1; + $5_1 = __wasm_i64_mul($77, $72_1, $10_1, $59_1); + $4_1 = $4_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($36_1, $29_1, $71_1, $61_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = __wasm_i64_mul($58_1, $47_1, $15_1, $60); + $4_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $6_1 = __wasm_i64_mul($32_1, $25_1, $43_1, $44_1); + $3_1 = $6_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $6_1 = __wasm_i64_mul($21_1, $22_1, $7_1, $55); + $5_1 = $6_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $5_1; + $5_1 = __wasm_i64_mul($37_1, $38_1, $33_1, $26_1); + $4_1 = $4_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = $4_1; + $4_1 = $2_1 >> 26; + $5_1 = ($2_1 & 67108863) << 6 | $40_1 >>> 26; + $2_1 = $6_1 + $5_1 | 0; + $3_1 = $3_1 + $4_1 | 0; + $3_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1; + $5_1 = $3_1; + $2_1 = $4_1 + 16777216 | 0; + if ($2_1 >>> 0 < 16777216) { + $5_1 = $5_1 + 1 | 0; + } + $21_1 = $2_1; + $2_1 = $5_1; + $3_1 = $21_1 & -33554432; + HEAP322[$20_1 + 12 >> 2] = $4_1 - $3_1; + $3_1 = __wasm_i64_mul($30_1, $31_1, $70_1, $54_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $6_1 = __wasm_i64_mul($23_1, $24_1, $36_1, $29_1); + $4_1 = $6_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($32_1, $25_1, $49_1, $39_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = __wasm_i64_mul($65_1, $42_1, $64_1, $48_1); + $4_1 = $6_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $6_1 = __wasm_i64_mul($33_1, $26_1, $73_1, $46_1); + $3_1 = $6_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $6_1 = __wasm_i64_mul($66_1, $50_1, $74, $51_1); + $5_1 = $6_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $3_1 = $5_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $5_1; + $5_1 = __wasm_i64_mul($34_1, $27_1, $75_1, $68_1); + $4_1 = $4_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($11_1, $63, $67_1, $52_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = $16_1; + $22_1 = $6_1 >> 31; + $16_1 = __wasm_i64_mul($35_1, $28_1, $6_1, $22_1); + $4_1 = $16_1 + $4_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $5_1 = $4_1 >>> 0 < $16_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $16_1 = __wasm_i64_mul($37_1, $38_1, $69_1, $53); + $3_1 = $16_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $4_1 = $3_1 >>> 0 < $16_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $16_1 = $3_1; + $3_1 = $1_1 >> 25; + $5_1 = ($1_1 & 33554431) << 7 | $62_1 >>> 25; + $1_1 = $16_1 + $5_1 | 0; + $3_1 = $3_1 + $4_1 | 0; + $3_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $1_1; + $1_1 = $4_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $16_1 = $1_1; + $1_1 = $3_1; + $3_1 = $16_1 & -67108864; + HEAP322[$20_1 + 32 >> 2] = $4_1 - $3_1; + $3_1 = $13_1 & -67108864; + $4_1 = $12_1 - $3_1 | 0; + $3_1 = $78_1 - (($12_1 >>> 0 < $3_1 >>> 0) + $79_1 | 0) | 0; + $5_1 = $4_1; + $4_1 = $2_1 >> 25; + $12_1 = ($2_1 & 33554431) << 7 | $21_1 >>> 25; + $2_1 = $5_1 + $12_1 | 0; + $3_1 = $3_1 + $4_1 | 0; + $3_1 = $2_1 >>> 0 < $12_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $2_1 + 33554432 | 0; + if ($4_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $5_1 = ($45_1 - ($80_1 & -33554432) | 0) + (($3_1 & 67108863) << 6 | $4_1 >>> 26) | 0; + HEAP322[$0 + 20 >> 2] = $5_1; + $3_1 = $4_1 & -67108864; + HEAP322[$0 + 16 >> 2] = $2_1 - $3_1; + $3_1 = __wasm_i64_mul($36_1, $29_1, $30_1, $31_1); + $5_1 = i64toi32_i32$HIGH_BITS; + $10_1 = __wasm_i64_mul($23_1, $24_1, $10_1, $59_1); + $4_1 = $10_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $10_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $10_1 = __wasm_i64_mul($49_1, $39_1, $15_1, $60); + $5_1 = $10_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $10_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $10_1 = __wasm_i64_mul($32_1, $25_1, $65_1, $42_1); + $3_1 = $10_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $7_1 = __wasm_i64_mul($73_1, $46_1, $7_1, $55); + $4_1 = $7_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + ($3_1 >>> 0 < $10_1 >>> 0 ? $5_1 + 1 | 0 : $5_1) | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($33_1, $26_1, $74, $51_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($17_1, $56_1, $75_1, $68_1); + $4_1 = $5_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $7_1 = __wasm_i64_mul($34_1, $27_1, $11_1, $63); + $5_1 = $7_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $5_1 >>> 0 < $7_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $7_1 = __wasm_i64_mul($6_1, $22_1, $14_1, $57_1); + $3_1 = $7_1 + $5_1 | 0; + $5_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $5_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $5_1 + 1 | 0 : $5_1; + $7_1 = __wasm_i64_mul($35_1, $28_1, $76_1, $76_1 >> 31); + $4_1 = $7_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $5_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $4_1; + $4_1 = $1_1 >> 26; + $5_1 = ($1_1 & 67108863) << 6 | $16_1 >>> 26; + $1_1 = $2_1 + $5_1 | 0; + $3_1 = $3_1 + $4_1 | 0; + $3_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $1_1; + $5_1 = $2_1; + $1_1 = $2_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $3_1 = $3_1 + 1 | 0; + } + $4_1 = $1_1; + $1_1 = $4_1 & -33554432; + HEAP322[$0 + 36 >> 2] = $2_1 - $1_1; + $2_1 = $0; + $5_1 = $8_1 - ($81_1 & -33554432) | 0; + $1_1 = $19 & -67108864; + $7_1 = $9_1 - $1_1 | 0; + $17_1 = $41_1 - (($9_1 >>> 0 < $1_1 >>> 0) + $18_1 | 0) | 0; + $1_1 = $3_1; + $3_1 = $3_1 >> 25; + $3_1 = __wasm_i64_mul(($1_1 & 33554431) << 7 | $4_1 >>> 25, $3_1, 19, 0); + $1_1 = $3_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $17_1 | 0; + $4_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $6_1 = $2_1; + $3_1 = $4_1; + $2_1 = $1_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $4_1 = $2_1; + $4_1 = (($3_1 & 67108863) << 6 | $4_1 >>> 26) + $5_1 | 0; + HEAP322[$6_1 + 4 >> 2] = $4_1; + $4_1 = $0; + $0 = $2_1 & -67108864; + HEAP322[$4_1 >> 2] = $1_1 - $0; + } + function $39($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0; + $2_1 = HEAP322[$1_1 >> 2]; + $3_1 = HEAP322[$1_1 + 4 >> 2]; + $4_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = HEAP322[$1_1 + 12 >> 2]; + $6_1 = HEAP322[$1_1 + 16 >> 2]; + $7_1 = HEAP322[$1_1 + 20 >> 2]; + $8_1 = HEAP322[$1_1 + 24 >> 2]; + $9_1 = HEAP322[$1_1 + 28 >> 2]; + $10_1 = HEAP322[$1_1 + 32 >> 2]; + HEAP322[$0 + 36 >> 2] = 0 - HEAP322[$1_1 + 36 >> 2]; + HEAP322[$0 + 32 >> 2] = 0 - $10_1; + HEAP322[$0 + 28 >> 2] = 0 - $9_1; + HEAP322[$0 + 24 >> 2] = 0 - $8_1; + HEAP322[$0 + 20 >> 2] = 0 - $7_1; + HEAP322[$0 + 16 >> 2] = 0 - $6_1; + HEAP322[$0 + 12 >> 2] = 0 - $5_1; + HEAP322[$0 + 8 >> 2] = 0 - $4_1; + HEAP322[$0 + 4 >> 2] = 0 - $3_1; + HEAP322[$0 >> 2] = 0 - $2_1; + } + function $40($0, $1_1) { + var $2_1 = 0, $3_1 = 0; + $2_1 = global$0 - 144 | 0; + global$0 = $2_1; + $42($2_1 + 96 | 0, $1_1); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $38($2_1 + 48 | 0, $1_1, $2_1 + 48 | 0); + $38($2_1 + 96 | 0, $2_1 + 96 | 0, $2_1 + 48 | 0); + $42($2_1 + 96 | 0, $2_1 + 96 | 0); + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $3_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 5) { + continue; + } + break; + } + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $3_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 10) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1, $2_1 + 48 | 0); + $3_1 = 1; + while (1) { + $42($2_1, $2_1); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 20) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1, $2_1 + 48 | 0); + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 10) { + continue; + } + break; + } + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 48 | 0, $2_1 + 96 | 0); + $3_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 50) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1, $2_1 + 48 | 0); + $3_1 = 1; + while (1) { + $42($2_1, $2_1); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 100) { + continue; + } + break; + } + $38($2_1 + 48 | 0, $2_1, $2_1 + 48 | 0); + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = 1; + while (1) { + $42($2_1 + 48 | 0, $2_1 + 48 | 0); + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 50) { + continue; + } + break; + } + $38($2_1 + 96 | 0, $2_1 + 48 | 0, $2_1 + 96 | 0); + $42($2_1 + 96 | 0, $2_1 + 96 | 0); + $42($2_1 + 96 | 0, $2_1 + 96 | 0); + $38($0, $2_1 + 96 | 0, $1_1); + global$0 = $2_1 + 144 | 0; + } + function $41($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0, $25_1 = 0, $26_1 = 0, $27_1 = 0, $28_1 = 0, $29_1 = 0, $30_1 = 0, $31_1 = 0, $32_1 = 0, $33_1 = 0, $34_1 = 0, $35_1 = 0, $36_1 = 0, $37_1 = 0, $38_1 = 0, $39_1 = 0, $40_1 = 0, $41_1 = 0, $42_1 = 0, $43_1 = 0, $44_1 = 0, $45_1 = 0, $46_1 = 0, $47_1 = 0, $48_1 = 0, $49_1 = 0, $50_1 = 0, $51_1 = 0, $52_1 = 0, $53 = 0, $54_1 = 0, $55 = 0, $56_1 = 0, $57_1 = 0, $58_1 = 0, $59_1 = 0; + $42_1 = $0; + $6_1 = HEAP322[$1_1 + 12 >> 2]; + $2_1 = $6_1 << 1; + $17_1 = $2_1; + $18_1 = $2_1 >> 31; + $10_1 = HEAP322[$1_1 + 4 >> 2]; + $2_1 = $10_1 << 1; + $19 = $2_1; + $14_1 = $2_1 >> 31; + $2_1 = __wasm_i64_mul($17_1, $18_1, $2_1, $14_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $2_1; + $28_1 = HEAP322[$1_1 + 8 >> 2]; + $2_1 = $28_1; + $13_1 = $2_1 >> 31; + $43_1 = $2_1; + $5_1 = __wasm_i64_mul($2_1, $13_1, $2_1, $13_1); + $3_1 = $3_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $5_1 = $3_1; + $35_1 = HEAP322[$1_1 + 16 >> 2]; + $3_1 = $35_1; + $20_1 = $3_1; + $21_1 = $3_1 >> 31; + $36_1 = HEAP322[$1_1 >> 2]; + $3_1 = $36_1 << 1; + $22_1 = $3_1; + $15_1 = $3_1 >> 31; + $4_1 = __wasm_i64_mul($20_1, $21_1, $3_1, $15_1); + $3_1 = $5_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $8_1 = $3_1; + $4_1 = HEAP322[$1_1 + 28 >> 2]; + $3_1 = Math_imul2($4_1, 38); + $37_1 = $3_1; + $31_1 = $3_1 >> 31; + $51_1 = $4_1; + $44_1 = $4_1 >> 31; + $5_1 = __wasm_i64_mul($3_1, $31_1, $4_1, $44_1); + $3_1 = $8_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = $3_1; + $8_1 = HEAP322[$1_1 + 32 >> 2]; + $3_1 = Math_imul2($8_1, 19); + $24_1 = $3_1; + $25_1 = $3_1 >> 31; + $5_1 = HEAP322[$1_1 + 24 >> 2]; + $3_1 = $5_1 << 1; + $9_1 = __wasm_i64_mul($24_1, $25_1, $3_1, $3_1 >> 31); + $11_1 = $7_1 + $9_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $11_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $7_1 = $11_1; + $26_1 = HEAP322[$1_1 + 36 >> 2]; + $2_1 = Math_imul2($26_1, 38); + $23_1 = $2_1; + $16_1 = $2_1 >> 31; + $11_1 = HEAP322[$1_1 + 20 >> 2]; + $1_1 = $11_1 << 1; + $32_1 = $1_1; + $29_1 = $1_1 >> 31; + $9_1 = __wasm_i64_mul($2_1, $16_1, $1_1, $29_1); + $2_1 = $7_1 + $9_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $45_1 = $2_1 << 1; + $2_1 = ($2_1 >>> 0 < $9_1 >>> 0 ? $1_1 + 1 | 0 : $1_1) << 1 | $2_1 >>> 31; + $56_1 = $2_1; + $1_1 = $45_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $52_1 = $1_1; + $57_1 = $2_1; + $1_1 = $2_1 >> 26; + $2_1 = ($2_1 & 67108863) << 6 | $52_1 >>> 26; + $3_1 = __wasm_i64_mul($19, $14_1, $20_1, $21_1); + $9_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $2_1; + $2_1 = $28_1 << 1; + $33_1 = $2_1; + $30_1 = $2_1 >> 31; + $38_1 = $6_1; + $46_1 = $6_1 >> 31; + $6_1 = __wasm_i64_mul($2_1, $30_1, $6_1, $46_1); + $3_1 = $6_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $9_1 | 0; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $28_1 = $11_1; + $39_1 = $11_1 >> 31; + $9_1 = __wasm_i64_mul($11_1, $39_1, $22_1, $15_1); + $6_1 = $9_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $6_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $34_1 = $6_1; + $2_1 = $4_1 << 1; + $53 = $2_1; + $47_1 = $2_1 >> 31; + $6_1 = __wasm_i64_mul($24_1, $25_1, $2_1, $47_1); + $4_1 = $34_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $4_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $4_1; + $6_1 = $5_1; + $27_1 = $5_1 >> 31; + $4_1 = __wasm_i64_mul($23_1, $16_1, $5_1, $27_1); + $3_1 = $3_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $3_1; + $3_1 = $2_1 << 1 | $3_1 >>> 31; + $4_1 = $4_1 << 1; + $2_1 = $7_1 + $4_1 | 0; + $1_1 = $1_1 + $3_1 | 0; + $40_1 = $2_1; + $2_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = $40_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $2_1 = $2_1 + 1 | 0; + } + $58_1 = $1_1; + $1_1 = ($2_1 & 33554431) << 7 | $1_1 >>> 25; + $4_1 = $2_1 >> 25; + $2_1 = __wasm_i64_mul($17_1, $18_1, $38_1, $46_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $1_1; + $9_1 = __wasm_i64_mul($20_1, $21_1, $33_1, $30_1); + $1_1 = $9_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $9_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($19, $14_1, $32_1, $29_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $9_1 = __wasm_i64_mul($22_1, $15_1, $6_1, $27_1); + $3_1 = $9_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $9_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $9_1 = $8_1; + $41_1 = $8_1 >> 31; + $8_1 = __wasm_i64_mul($24_1, $25_1, $8_1, $41_1); + $3_1 = $8_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $8_1 = __wasm_i64_mul($23_1, $16_1, $53, $47_1); + $1_1 = $8_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1; + $1_1 = ($2_1 >>> 0 < $8_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $8_1 = $2_1 << 1; + $3_1 = $7_1 + $8_1 | 0; + $2_1 = $1_1 + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = $1_1 + 33554432 | 0; + if ($3_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $34_1 = $3_1; + $4_1 = $2_1; + $2_1 = $3_1 & -67108864; + HEAP322[$42_1 + 24 >> 2] = $1_1 - $2_1; + $8_1 = $0; + $1_1 = Math_imul2($11_1, 38); + $1_1 = __wasm_i64_mul($1_1, $1_1 >> 31, $28_1, $39_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $1_1; + $1_1 = $36_1; + $3_1 = $1_1 >> 31; + $11_1 = __wasm_i64_mul($1_1, $3_1, $1_1, $3_1); + $1_1 = $7_1 + $11_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $11_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $1_1; + $1_1 = Math_imul2($5_1, 19); + $12_1 = $1_1; + $48_1 = $1_1 >> 31; + $1_1 = $35_1 << 1; + $54_1 = $1_1; + $49_1 = $1_1 >> 31; + $5_1 = __wasm_i64_mul($12_1, $48_1, $1_1, $49_1); + $1_1 = $2_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($17_1, $18_1, $37_1, $31_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $5_1 = __wasm_i64_mul($24_1, $25_1, $33_1, $30_1); + $3_1 = $5_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = __wasm_i64_mul($19, $14_1, $23_1, $16_1); + $3_1 = $5_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $3_1; + $11_1 = $1_1 << 1; + $2_1 = ($1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1) << 1 | $1_1 >>> 31; + $42_1 = $2_1; + $3_1 = $2_1; + $1_1 = $11_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $36_1 = $1_1; + $35_1 = $3_1; + $1_1 = ($3_1 & 67108863) << 6 | $1_1 >>> 26; + $5_1 = $3_1 >> 26; + $2_1 = __wasm_i64_mul($12_1, $48_1, $32_1, $29_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $50_1 = $1_1; + $7_1 = $10_1; + $55 = $7_1 >> 31; + $10_1 = __wasm_i64_mul($22_1, $15_1, $7_1, $55); + $1_1 = $10_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $10_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = __wasm_i64_mul($20_1, $21_1, $37_1, $31_1); + $3_1 = $10_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $10_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $10_1 = __wasm_i64_mul($24_1, $25_1, $17_1, $18_1); + $3_1 = $10_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $10_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = __wasm_i64_mul($23_1, $16_1, $43_1, $13_1); + $1_1 = $10_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1; + $1_1 = ($2_1 >>> 0 < $10_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $10_1 = $2_1 << 1; + $3_1 = $50_1 + $10_1 | 0; + $2_1 = $1_1 + $5_1 | 0; + $2_1 = $3_1 >>> 0 < $10_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = $3_1; + $1_1 = $3_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $2_1 = $2_1 + 1 | 0; + } + $50_1 = $1_1; + $3_1 = $1_1; + $1_1 = $2_1 >> 25; + $2_1 = ($2_1 & 33554431) << 7 | $3_1 >>> 25; + $5_1 = $1_1; + $1_1 = __wasm_i64_mul($22_1, $15_1, $43_1, $13_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $59_1 = $2_1; + $7_1 = __wasm_i64_mul($19, $14_1, $7_1, $55); + $1_1 = $7_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $7_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = __wasm_i64_mul($12_1, $48_1, $6_1, $27_1); + $1_1 = $7_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $7_1 = __wasm_i64_mul($32_1, $29_1, $37_1, $31_1); + $1_1 = $7_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $7_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($24_1, $25_1, $54_1, $49_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = __wasm_i64_mul($23_1, $16_1, $17_1, $18_1); + $3_1 = $7_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $1_1 << 1 | $3_1 >>> 31; + $3_1 = $3_1 << 1; + $1_1 = $59_1 + $3_1 | 0; + $2_1 = $2_1 + $5_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $2_1; + $2_1 = $1_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $3_1 = $3_1 + 1 | 0; + } + $7_1 = $2_1; + $5_1 = $3_1; + $2_1 = $2_1 & -67108864; + HEAP322[$8_1 + 8 >> 2] = $1_1 - $2_1; + $1_1 = __wasm_i64_mul($33_1, $30_1, $28_1, $39_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $12_1 = __wasm_i64_mul($20_1, $21_1, $17_1, $18_1); + $2_1 = $12_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $2_1 >>> 0 < $12_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $12_1 = __wasm_i64_mul($19, $14_1, $6_1, $27_1); + $3_1 = $12_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $12_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $12_1 = __wasm_i64_mul($22_1, $15_1, $51_1, $44_1); + $1_1 = $12_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $12_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $12_1 = __wasm_i64_mul($23_1, $16_1, $9_1, $41_1); + $1_1 = $12_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $12_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $2_1 << 1 | $1_1 >>> 31; + $3_1 = $4_1 >> 26; + $4_1 = ($4_1 & 67108863) << 6 | $34_1 >>> 26; + $1_1 = $4_1 + ($1_1 << 1) | 0; + $2_1 = $2_1 + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $1_1; + $1_1 = $2_1; + $2_1 = $3_1 + 16777216 | 0; + if ($2_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $34_1 = $2_1; + $4_1 = $1_1; + $1_1 = $2_1 & -33554432; + HEAP322[$8_1 + 28 >> 2] = $3_1 - $1_1; + $1_1 = __wasm_i64_mul($22_1, $15_1, $38_1, $46_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = __wasm_i64_mul($19, $14_1, $43_1, $13_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($6_1, $27_1, $37_1, $31_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $13_1 = __wasm_i64_mul($24_1, $25_1, $32_1, $29_1); + $3_1 = $13_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $13_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $13_1 = __wasm_i64_mul($23_1, $16_1, $20_1, $21_1); + $2_1 = $13_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $2_1; + $2_1 = ($2_1 >>> 0 < $13_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $3_1 = $1_1 << 1; + $1_1 = $5_1 >> 26; + $5_1 = ($5_1 & 67108863) << 6 | $7_1 >>> 26; + $3_1 = $3_1 + $5_1 | 0; + $2_1 = $1_1 + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = $1_1 + 16777216 | 0; + if ($3_1 >>> 0 < 16777216) { + $2_1 = $2_1 + 1 | 0; + } + $38_1 = $3_1; + $5_1 = $2_1; + $2_1 = $3_1 & -33554432; + HEAP322[$8_1 + 12 >> 2] = $1_1 - $2_1; + $13_1 = $0; + $1_1 = __wasm_i64_mul($6_1, $27_1, $33_1, $30_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = __wasm_i64_mul($20_1, $21_1, $20_1, $21_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($17_1, $18_1, $32_1, $29_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($19, $14_1, $53, $47_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $8_1 = __wasm_i64_mul($22_1, $15_1, $9_1, $41_1); + $3_1 = $8_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $8_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $8_1 = $26_1; + $7_1 = $8_1 >> 31; + $26_1 = __wasm_i64_mul($23_1, $16_1, $8_1, $7_1); + $2_1 = $26_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $2_1; + $2_1 = ($2_1 >>> 0 < $26_1 >>> 0 ? $3_1 + 1 | 0 : $3_1) << 1 | $2_1 >>> 31; + $3_1 = $1_1 << 1; + $1_1 = $4_1 >> 25; + $4_1 = ($4_1 & 33554431) << 7 | $34_1 >>> 25; + $3_1 = $3_1 + $4_1 | 0; + $2_1 = $1_1 + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = $1_1 + 33554432 | 0; + if ($3_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $26_1 = $3_1; + $4_1 = $2_1; + $2_1 = $3_1 & -67108864; + HEAP322[$13_1 + 32 >> 2] = $1_1 - $2_1; + $40_1 = $40_1 - ($58_1 & -33554432) | 0; + $2_1 = $5_1 >> 25; + $5_1 = ($5_1 & 33554431) << 7 | $38_1 >>> 25; + $1_1 = $52_1 & -67108864; + $3_1 = $5_1 + ($45_1 - $1_1 | 0) | 0; + $1_1 = $2_1 + ($56_1 - (($45_1 >>> 0 < $1_1 >>> 0) + $57_1 | 0) | 0) | 0; + $1_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $1_1; + $1_1 = $3_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $5_1 = (($2_1 & 67108863) << 6 | $1_1 >>> 26) + $40_1 | 0; + HEAP322[$13_1 + 20 >> 2] = $5_1; + $1_1 = $1_1 & -67108864; + HEAP322[$0 + 16 >> 2] = $3_1 - $1_1; + $1_1 = __wasm_i64_mul($17_1, $18_1, $6_1, $27_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $6_1 = __wasm_i64_mul($28_1, $39_1, $54_1, $49_1); + $2_1 = $6_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $6_1 = __wasm_i64_mul($33_1, $30_1, $51_1, $44_1); + $3_1 = $6_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = __wasm_i64_mul($19, $14_1, $9_1, $41_1); + $1_1 = $6_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = __wasm_i64_mul($22_1, $15_1, $8_1, $7_1); + $1_1 = $6_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $2_1 << 1 | $1_1 >>> 31; + $3_1 = $4_1 >> 26; + $4_1 = ($4_1 & 67108863) << 6 | $26_1 >>> 26; + $1_1 = $4_1 + ($1_1 << 1) | 0; + $2_1 = $2_1 + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $1_1; + $4_1 = $1_1; + $5_1 = $1_1; + $1_1 = $2_1; + $2_1 = $3_1 + 16777216 | 0; + if ($2_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = $2_1 & -33554432; + HEAP322[$0 + 36 >> 2] = $4_1 - $3_1; + $4_1 = $0; + $5_1 = $10_1 - ($50_1 & -33554432) | 0; + $2_1 = __wasm_i64_mul(($1_1 & 33554431) << 7 | $2_1 >>> 25, $1_1 >> 25, 19, 0); + $3_1 = $36_1 & -67108864; + $1_1 = $2_1 + ($11_1 - $3_1 | 0) | 0; + $3_1 = i64toi32_i32$HIGH_BITS + ($42_1 - (($11_1 >>> 0 < $3_1 >>> 0) + $35_1 | 0) | 0) | 0; + $3_1 = $1_1 >>> 0 < $2_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $1_1; + $6_1 = $4_1; + $1_1 = $3_1; + $3_1 = $2_1 + 33554432 | 0; + if ($3_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $4_1 = (($1_1 & 67108863) << 6 | $3_1 >>> 26) + $5_1 | 0; + HEAP322[$6_1 + 4 >> 2] = $4_1; + $1_1 = $0; + $0 = $3_1 & -67108864; + HEAP322[$1_1 >> 2] = $2_1 - $0; + } + function $42($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0, $25_1 = 0, $26_1 = 0, $27_1 = 0, $28_1 = 0, $29_1 = 0, $30_1 = 0, $31_1 = 0, $32_1 = 0, $33_1 = 0, $34_1 = 0, $35_1 = 0, $36_1 = 0, $37_1 = 0, $38_1 = 0, $39_1 = 0, $40_1 = 0, $41_1 = 0, $42_1 = 0, $43_1 = 0, $44_1 = 0, $45_1 = 0, $46_1 = 0, $47_1 = 0, $48_1 = 0, $49_1 = 0, $50_1 = 0, $51_1 = 0, $52_1 = 0, $53 = 0, $54_1 = 0, $55 = 0, $56_1 = 0; + $7_1 = $0; + $2_1 = HEAP322[$1_1 + 12 >> 2]; + $3_1 = $2_1 << 1; + $23_1 = $3_1; + $16_1 = $3_1 >> 31; + $9_1 = $2_1; + $44_1 = $2_1 >> 31; + $2_1 = __wasm_i64_mul($3_1, $16_1, $2_1, $44_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $2_1; + $39_1 = HEAP322[$1_1 + 16 >> 2]; + $2_1 = $39_1; + $17_1 = $2_1; + $18_1 = $2_1 >> 31; + $11_1 = HEAP322[$1_1 + 8 >> 2]; + $2_1 = $11_1 << 1; + $33_1 = $2_1; + $28_1 = $2_1 >> 31; + $6_1 = __wasm_i64_mul($17_1, $18_1, $2_1, $28_1); + $3_1 = $3_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $3_1; + $6_1 = HEAP322[$1_1 + 20 >> 2]; + $3_1 = $6_1 << 1; + $29_1 = $3_1; + $30_1 = $3_1 >> 31; + $12_1 = HEAP322[$1_1 + 4 >> 2]; + $3_1 = $12_1 << 1; + $19 = $3_1; + $13_1 = $3_1 >> 31; + $5_1 = __wasm_i64_mul($29_1, $30_1, $3_1, $13_1); + $4_1 = $4_1 + $5_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $8_1 = HEAP322[$1_1 + 24 >> 2]; + $2_1 = $8_1; + $34_1 = $2_1; + $24_1 = $2_1 >> 31; + $35_1 = HEAP322[$1_1 >> 2]; + $2_1 = $35_1 << 1; + $20_1 = $2_1; + $14_1 = $2_1 >> 31; + $5_1 = __wasm_i64_mul($8_1, $24_1, $2_1, $14_1); + $4_1 = $5_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $4_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = $4_1; + $3_1 = HEAP322[$1_1 + 32 >> 2]; + $4_1 = Math_imul2($3_1, 19); + $31_1 = $4_1; + $25_1 = $4_1 >> 31; + $45_1 = $3_1; + $40_1 = $3_1 >> 31; + $4_1 = __wasm_i64_mul($4_1, $25_1, $3_1, $40_1); + $3_1 = $10_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = $3_1; + $26_1 = HEAP322[$1_1 + 36 >> 2]; + $3_1 = Math_imul2($26_1, 38); + $21_1 = $3_1; + $15_1 = $3_1 >> 31; + $4_1 = HEAP322[$1_1 + 28 >> 2]; + $1_1 = $4_1 << 1; + $51_1 = $1_1; + $46_1 = $1_1 >> 31; + $5_1 = __wasm_i64_mul($3_1, $15_1, $1_1, $46_1); + $3_1 = $10_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $27_1 = $3_1; + $22_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($19, $13_1, $17_1, $18_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = __wasm_i64_mul($33_1, $28_1, $9_1, $44_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $47_1 = $6_1; + $41_1 = $6_1 >> 31; + $5_1 = __wasm_i64_mul($6_1, $41_1, $20_1, $14_1); + $1_1 = $5_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($31_1, $25_1, $51_1, $46_1); + $1_1 = $5_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($21_1, $15_1, $8_1, $24_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $10_1 = $1_1; + $36_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($19, $13_1, $23_1, $16_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $11_1; + $37_1 = $5_1 >> 31; + $11_1 = __wasm_i64_mul($5_1, $37_1, $5_1, $37_1); + $2_1 = $11_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $2_1 >>> 0 < $11_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $11_1 = __wasm_i64_mul($20_1, $14_1, $17_1, $18_1); + $3_1 = $11_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $11_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = Math_imul2($4_1, 38); + $42_1 = $1_1; + $38_1 = $1_1 >> 31; + $11_1 = $4_1; + $48_1 = $4_1 >> 31; + $4_1 = __wasm_i64_mul($1_1, $38_1, $4_1, $48_1); + $1_1 = $4_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $1_1; + $1_1 = $8_1 << 1; + $4_1 = __wasm_i64_mul($31_1, $25_1, $1_1, $1_1 >> 31); + $1_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($21_1, $15_1, $29_1, $30_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $49_1 = $1_1; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $54_1 = $2_1; + $1_1 = $2_1; + $2_1 = $49_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $52_1 = $2_1; + $55 = $1_1; + $2_1 = $1_1 >> 26; + $3_1 = ($1_1 & 67108863) << 6 | $52_1 >>> 26; + $1_1 = $3_1 + $10_1 | 0; + $2_1 = $2_1 + $36_1 | 0; + $36_1 = $1_1; + $3_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $1_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $3_1 = $3_1 + 1 | 0; + } + $56_1 = $1_1; + $2_1 = $3_1 >> 25; + $3_1 = ($3_1 & 33554431) << 7 | $1_1 >>> 25; + $1_1 = $3_1 + $27_1 | 0; + $2_1 = $2_1 + $22_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $1_1; + $1_1 = $2_1; + $2_1 = $3_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $10_1 = $2_1; + $4_1 = $1_1; + $1_1 = $2_1 & -67108864; + HEAP322[$7_1 + 24 >> 2] = $3_1 - $1_1; + $22_1 = $0; + $1_1 = __wasm_i64_mul($20_1, $14_1, $5_1, $37_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $12_1; + $32_1 = $7_1 >> 31; + $12_1 = __wasm_i64_mul($19, $13_1, $7_1, $32_1); + $1_1 = $12_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $12_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $1_1; + $1_1 = Math_imul2($8_1, 19); + $12_1 = $1_1; + $27_1 = $1_1 >> 31; + $8_1 = __wasm_i64_mul($1_1, $27_1, $34_1, $24_1); + $1_1 = $2_1 + $8_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $8_1 = __wasm_i64_mul($29_1, $30_1, $42_1, $38_1); + $3_1 = $8_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $8_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $39_1 << 1; + $53 = $2_1; + $50_1 = $2_1 >> 31; + $8_1 = __wasm_i64_mul($31_1, $25_1, $2_1, $50_1); + $3_1 = $8_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = __wasm_i64_mul($21_1, $15_1, $23_1, $16_1); + $1_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $43_1 = $1_1; + $8_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($29_1, $30_1, $12_1, $27_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $7_1 = __wasm_i64_mul($20_1, $14_1, $7_1, $32_1); + $1_1 = $7_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $7_1 = __wasm_i64_mul($17_1, $18_1, $42_1, $38_1); + $1_1 = $7_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $7_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = __wasm_i64_mul($31_1, $25_1, $23_1, $16_1); + $3_1 = $7_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $7_1 = __wasm_i64_mul($21_1, $15_1, $5_1, $37_1); + $3_1 = $7_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $32_1 = $3_1; + $7_1 = $3_1 >>> 0 < $7_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = Math_imul2($6_1, 38); + $1_1 = __wasm_i64_mul($1_1, $1_1 >> 31, $47_1, $41_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $6_1 = $1_1; + $1_1 = $35_1; + $3_1 = $1_1 >> 31; + $3_1 = __wasm_i64_mul($1_1, $3_1, $1_1, $3_1); + $1_1 = $6_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = __wasm_i64_mul($12_1, $27_1, $53, $50_1); + $1_1 = $6_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $6_1 = __wasm_i64_mul($23_1, $16_1, $42_1, $38_1); + $1_1 = $6_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = __wasm_i64_mul($31_1, $25_1, $33_1, $28_1); + $3_1 = $6_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $6_1 = __wasm_i64_mul($19, $13_1, $21_1, $15_1); + $3_1 = $6_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $12_1 = $3_1; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $27_1 = $2_1; + $1_1 = $3_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $35_1 = $1_1; + $39_1 = $2_1; + $1_1 = $2_1 >> 26; + $6_1 = ($2_1 & 67108863) << 6 | $35_1 >>> 26; + $2_1 = $6_1 + $32_1 | 0; + $3_1 = $1_1 + $7_1 | 0; + $7_1 = $2_1; + $2_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = $7_1 + 16777216 | 0; + if ($1_1 >>> 0 < 16777216) { + $2_1 = $2_1 + 1 | 0; + } + $32_1 = $1_1; + $6_1 = ($2_1 & 33554431) << 7 | $1_1 >>> 25; + $3_1 = $6_1 + $43_1 | 0; + $2_1 = ($2_1 >> 25) + $8_1 | 0; + $2_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = $1_1 + 33554432 | 0; + if ($3_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $8_1 = $3_1; + $6_1 = $2_1; + $2_1 = $3_1 & -67108864; + HEAP322[$22_1 + 8 >> 2] = $1_1 - $2_1; + $1_1 = __wasm_i64_mul($33_1, $28_1, $47_1, $41_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = __wasm_i64_mul($17_1, $18_1, $23_1, $16_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($19, $13_1, $34_1, $24_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($20_1, $14_1, $11_1, $48_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $43_1 = __wasm_i64_mul($21_1, $15_1, $45_1, $40_1); + $3_1 = $43_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $43_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1 >> 26; + $10_1 = ($4_1 & 67108863) << 6 | $10_1 >>> 26; + $4_1 = $10_1 + $3_1 | 0; + $3_1 = $1_1 + $2_1 | 0; + $3_1 = $4_1 >>> 0 < $10_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = $4_1; + $2_1 = $3_1; + $3_1 = $1_1 + 16777216 | 0; + if ($3_1 >>> 0 < 16777216) { + $2_1 = $2_1 + 1 | 0; + } + $10_1 = $3_1; + $4_1 = $2_1; + $2_1 = $3_1 & -33554432; + HEAP322[$22_1 + 28 >> 2] = $1_1 - $2_1; + $1_1 = __wasm_i64_mul($20_1, $14_1, $9_1, $44_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $5_1 = __wasm_i64_mul($19, $13_1, $5_1, $37_1); + $2_1 = $5_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = __wasm_i64_mul($34_1, $24_1, $42_1, $38_1); + $2_1 = $5_1 + $2_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $3_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($31_1, $25_1, $29_1, $30_1); + $1_1 = $5_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($21_1, $15_1, $17_1, $18_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $6_1 >> 26; + $6_1 = ($6_1 & 67108863) << 6 | $8_1 >>> 26; + $1_1 = $6_1 + $1_1 | 0; + $2_1 = $2_1 + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $1_1; + $1_1 = $2_1; + $2_1 = $3_1 + 16777216 | 0; + if ($2_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $8_1 = $2_1; + $6_1 = $1_1; + $1_1 = $2_1 & -33554432; + HEAP322[$22_1 + 12 >> 2] = $3_1 - $1_1; + $5_1 = $0; + $1_1 = __wasm_i64_mul($34_1, $24_1, $33_1, $28_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = __wasm_i64_mul($17_1, $18_1, $17_1, $18_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($23_1, $16_1, $29_1, $30_1); + $1_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $9_1 = __wasm_i64_mul($19, $13_1, $51_1, $46_1); + $3_1 = $9_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $3_1 >>> 0 < $9_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $9_1 = __wasm_i64_mul($20_1, $14_1, $45_1, $40_1); + $2_1 = $9_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $3_1 = $2_1 >>> 0 < $9_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = $26_1; + $22_1 = $9_1 >> 31; + $26_1 = __wasm_i64_mul($21_1, $15_1, $9_1, $22_1); + $1_1 = $26_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $1_1 >>> 0 < $26_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $1_1; + $1_1 = $4_1 >> 25; + $4_1 = ($4_1 & 33554431) << 7 | $10_1 >>> 25; + $3_1 = $3_1 + $4_1 | 0; + $2_1 = $1_1 + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = $1_1 + 33554432 | 0; + if ($3_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $26_1 = $3_1; + $4_1 = $2_1; + $2_1 = $3_1 & -67108864; + HEAP322[$5_1 + 32 >> 2] = $1_1 - $2_1; + $36_1 = $36_1 - ($56_1 & -33554432) | 0; + $2_1 = $6_1 >> 25; + $6_1 = ($6_1 & 33554431) << 7 | $8_1 >>> 25; + $1_1 = $52_1 & -67108864; + $3_1 = $6_1 + ($49_1 - $1_1 | 0) | 0; + $1_1 = $2_1 + ($54_1 - (($49_1 >>> 0 < $1_1 >>> 0) + $55 | 0) | 0) | 0; + $1_1 = $3_1 >>> 0 < $6_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $1_1; + $1_1 = $3_1 + 33554432 | 0; + if ($1_1 >>> 0 < 33554432) { + $2_1 = $2_1 + 1 | 0; + } + $6_1 = (($2_1 & 67108863) << 6 | $1_1 >>> 26) + $36_1 | 0; + HEAP322[$5_1 + 20 >> 2] = $6_1; + $1_1 = $1_1 & -67108864; + HEAP322[$0 + 16 >> 2] = $3_1 - $1_1; + $6_1 = $0; + $1_1 = __wasm_i64_mul($23_1, $16_1, $34_1, $24_1); + $3_1 = i64toi32_i32$HIGH_BITS; + $5_1 = __wasm_i64_mul($47_1, $41_1, $53, $50_1); + $2_1 = $5_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $2_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = __wasm_i64_mul($33_1, $28_1, $11_1, $48_1); + $3_1 = $5_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $3_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $5_1 = __wasm_i64_mul($19, $13_1, $45_1, $40_1); + $1_1 = $5_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $5_1 = __wasm_i64_mul($20_1, $14_1, $9_1, $22_1); + $1_1 = $5_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $1_1; + $1_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $4_1 >> 26; + $4_1 = ($4_1 & 67108863) << 6 | $26_1 >>> 26; + $3_1 = $4_1 + $3_1 | 0; + $2_1 = $1_1 + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $3_1; + $8_1 = $3_1; + $1_1 = $2_1; + $2_1 = $3_1 + 16777216 | 0; + if ($2_1 >>> 0 < 16777216) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = $2_1 & -33554432; + HEAP322[$6_1 + 36 >> 2] = $4_1 - $3_1; + $5_1 = __wasm_i64_mul(($1_1 & 33554431) << 7 | $2_1 >>> 25, $1_1 >> 25, 19, 0); + $3_1 = $35_1 & -67108864; + $1_1 = $5_1 + ($12_1 - $3_1 | 0) | 0; + $2_1 = i64toi32_i32$HIGH_BITS + ($27_1 - (($12_1 >>> 0 < $3_1 >>> 0) + $39_1 | 0) | 0) | 0; + $3_1 = $1_1; + $1_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $3_1 + 33554432 | 0; + if ($2_1 >>> 0 < 33554432) { + $1_1 = $1_1 + 1 | 0; + } + $4_1 = ($7_1 - ($32_1 & -33554432) | 0) + (($1_1 & 67108863) << 6 | $2_1 >>> 26) | 0; + HEAP322[$0 + 4 >> 2] = $4_1; + $1_1 = $0; + $0 = $2_1 & -67108864; + HEAP322[$1_1 >> 2] = $3_1 - $0; + } + function $43($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0; + $3_1 = HEAP322[$2_1 >> 2]; + $4_1 = HEAP322[$1_1 >> 2]; + $5_1 = HEAP322[$2_1 + 4 >> 2]; + $6_1 = HEAP322[$1_1 + 4 >> 2]; + $7_1 = HEAP322[$2_1 + 8 >> 2]; + $8_1 = HEAP322[$1_1 + 8 >> 2]; + $9_1 = HEAP322[$2_1 + 12 >> 2]; + $10_1 = HEAP322[$1_1 + 12 >> 2]; + $11_1 = HEAP322[$2_1 + 16 >> 2]; + $12_1 = HEAP322[$1_1 + 16 >> 2]; + $13_1 = HEAP322[$2_1 + 20 >> 2]; + $14_1 = HEAP322[$1_1 + 20 >> 2]; + $15_1 = HEAP322[$2_1 + 24 >> 2]; + $16_1 = HEAP322[$1_1 + 24 >> 2]; + $17_1 = HEAP322[$2_1 + 28 >> 2]; + $18_1 = HEAP322[$1_1 + 28 >> 2]; + $19 = HEAP322[$2_1 + 32 >> 2]; + $20_1 = HEAP322[$1_1 + 32 >> 2]; + HEAP322[$0 + 36 >> 2] = HEAP322[$1_1 + 36 >> 2] - HEAP322[$2_1 + 36 >> 2]; + HEAP322[$0 + 32 >> 2] = $20_1 - $19; + HEAP322[$0 + 28 >> 2] = $18_1 - $17_1; + HEAP322[$0 + 24 >> 2] = $16_1 - $15_1; + HEAP322[$0 + 20 >> 2] = $14_1 - $13_1; + HEAP322[$0 + 16 >> 2] = $12_1 - $11_1; + HEAP322[$0 + 12 >> 2] = $10_1 - $9_1; + HEAP322[$0 + 8 >> 2] = $8_1 - $7_1; + HEAP322[$0 + 4 >> 2] = $6_1 - $5_1; + HEAP322[$0 >> 2] = $4_1 - $3_1; + } + function $44($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0; + $6_1 = HEAP322[$1_1 + 36 >> 2]; + $7_1 = HEAP322[$1_1 + 32 >> 2]; + $8_1 = HEAP322[$1_1 + 28 >> 2]; + $9_1 = HEAP322[$1_1 + 24 >> 2]; + $10_1 = HEAP322[$1_1 + 20 >> 2]; + $4_1 = HEAP322[$1_1 + 16 >> 2]; + $11_1 = HEAP322[$1_1 + 12 >> 2]; + $5_1 = HEAP322[$1_1 + 8 >> 2]; + $3_1 = HEAP322[$1_1 + 4 >> 2]; + $2_1 = HEAP322[$1_1 >> 2]; + $1_1 = Math_imul2($6_1 + ($7_1 + ($8_1 + ($9_1 + ($10_1 + ($4_1 + ($11_1 + ($5_1 + ($3_1 + ($2_1 + (Math_imul2($6_1, 19) + 16777216 >> 25) >> 26) >> 25) >> 26) >> 25) >> 26) >> 25) >> 26) >> 25) >> 26) >> 25, 19) + $2_1 | 0; + HEAP82[$0 | 0] = $1_1; + HEAP82[$0 + 2 | 0] = $1_1 >>> 16; + HEAP82[$0 + 1 | 0] = $1_1 >>> 8; + $2_1 = $3_1 + ($1_1 >> 26) | 0; + HEAP82[$0 + 5 | 0] = $2_1 >>> 14; + HEAP82[$0 + 4 | 0] = $2_1 >>> 6; + $3_1 = $5_1 + ($2_1 >> 25) | 0; + HEAP82[$0 + 8 | 0] = $3_1 >>> 13; + HEAP82[$0 + 7 | 0] = $3_1 >>> 5; + $5_1 = $1_1 >>> 24 & 3; + $1_1 = $2_1 & 33554431; + HEAP82[$0 + 3 | 0] = $5_1 | $1_1 << 2; + $2_1 = ($3_1 >> 26) + $11_1 | 0; + HEAP82[$0 + 11 | 0] = $2_1 >>> 11; + HEAP82[$0 + 10 | 0] = $2_1 >>> 3; + $3_1 = $3_1 & 67108863; + HEAP82[$0 + 6 | 0] = $3_1 << 3 | $1_1 >>> 22; + $1_1 = ($2_1 >> 25) + $4_1 | 0; + HEAP82[$0 + 15 | 0] = $1_1 >>> 18; + HEAP82[$0 + 14 | 0] = $1_1 >>> 10; + HEAP82[$0 + 13 | 0] = $1_1 >>> 2; + $4_1 = $2_1 & 33554431; + HEAP82[$0 + 9 | 0] = $4_1 << 5 | $3_1 >>> 21; + $2_1 = ($1_1 >> 26) + $10_1 | 0; + HEAP82[$0 + 16 | 0] = $2_1; + HEAP82[$0 + 12 | 0] = $1_1 << 6 | $4_1 >>> 19; + HEAP82[$0 + 18 | 0] = $2_1 >>> 16; + HEAP82[$0 + 17 | 0] = $2_1 >>> 8; + $1_1 = ($2_1 >> 25) + $9_1 | 0; + HEAP82[$0 + 21 | 0] = $1_1 >>> 15; + HEAP82[$0 + 20 | 0] = $1_1 >>> 7; + $3_1 = ($1_1 >> 26) + $8_1 | 0; + HEAP82[$0 + 24 | 0] = $3_1 >>> 13; + HEAP82[$0 + 23 | 0] = $3_1 >>> 5; + $4_1 = $2_1 >>> 24 & 1; + $2_1 = $1_1 & 67108863; + HEAP82[$0 + 19 | 0] = $4_1 | $2_1 << 1; + $1_1 = ($3_1 >> 25) + $7_1 | 0; + HEAP82[$0 + 27 | 0] = $1_1 >>> 12; + HEAP82[$0 + 26 | 0] = $1_1 >>> 4; + $3_1 = $3_1 & 33554431; + HEAP82[$0 + 22 | 0] = $3_1 << 3 | $2_1 >>> 23; + $2_1 = ($1_1 >> 26) + $6_1 | 0; + HEAP82[$0 + 30 | 0] = $2_1 >>> 10; + HEAP82[$0 + 29 | 0] = $2_1 >>> 2; + $1_1 = $1_1 & 67108863; + HEAP82[$0 + 25 | 0] = $1_1 << 4 | $3_1 >>> 21; + $2_1 = $2_1 & 33554431; + HEAP82[$0 + 31 | 0] = $2_1 >>> 18; + HEAP82[$0 + 28 | 0] = $2_1 << 6 | $1_1 >>> 20; + } + function $45($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $5_1 = global$0 - 48 | 0; + global$0 = $5_1; + $3_1 = $1_1 + 40 | 0; + $29($0, $3_1, $1_1); + $4_1 = $0 + 40 | 0; + $43($4_1, $3_1, $1_1); + $3_1 = $0 + 80 | 0; + $38($3_1, $0, $2_1); + $38($4_1, $4_1, $2_1 + 40 | 0); + $6_1 = $0 + 120 | 0; + $38($6_1, $2_1 + 120 | 0, $1_1 + 120 | 0); + $38($0, $1_1 + 80 | 0, $2_1 + 80 | 0); + $29($5_1, $0, $0); + $43($0, $3_1, $4_1); + $29($4_1, $3_1, $4_1); + $29($3_1, $5_1, $6_1); + $43($6_1, $5_1, $6_1); + global$0 = $5_1 + 48 | 0; + } + function $46($0, $1_1, $2_1, $3_1) { + var $4_1 = 0; + $4_1 = global$0 - 2272 | 0; + global$0 = $4_1; + $47($4_1 + 2016 | 0, $1_1); + $47($4_1 + 1760 | 0, $3_1); + $58($4_1 + 480 | 0, $2_1); + $56($4_1 + 320 | 0, $2_1); + $52($4_1, $4_1 + 320 | 0); + $45($4_1 + 320 | 0, $4_1, $4_1 + 480 | 0); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $1_1 = $4_1 + 640 | 0; + $58($1_1, $4_1 + 160 | 0); + $45($4_1 + 320 | 0, $4_1, $1_1); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $1_1 = $4_1 + 800 | 0; + $58($1_1, $4_1 + 160 | 0); + $45($4_1 + 320 | 0, $4_1, $1_1); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $1_1 = $4_1 + 960 | 0; + $58($1_1, $4_1 + 160 | 0); + $45($4_1 + 320 | 0, $4_1, $1_1); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $1_1 = $4_1 + 1120 | 0; + $58($1_1, $4_1 + 160 | 0); + $45($4_1 + 320 | 0, $4_1, $1_1); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $1_1 = $4_1 + 1280 | 0; + $58($1_1, $4_1 + 160 | 0); + $45($4_1 + 320 | 0, $4_1, $1_1); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $1_1 = $4_1 + 1440 | 0; + $58($1_1, $4_1 + 160 | 0); + $45($4_1 + 320 | 0, $4_1, $1_1); + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $58($4_1 + 1600 | 0, $4_1 + 160 | 0); + $27($0); + $28($0 + 40 | 0); + $28($0 + 80 | 0); + $1_1 = 255; + while (1) { + label$2: { + $2_1 = $1_1; + if (HEAPU82[$1_1 + ($4_1 + 2016 | 0) | 0]) { + $3_1 = $2_1; + break label$2; + } + if (HEAPU82[$2_1 + ($4_1 + 1760 | 0) | 0]) { + $3_1 = $2_1; + break label$2; + } + $3_1 = -1; + $1_1 = $2_1 + -1 | 0; + if ($2_1) { + continue; + } + } + break; + } + if (($3_1 | 0) >= 0) { + while (1) { + $54($4_1 + 320 | 0, $0); + $1_1 = $3_1; + $2_1 = HEAP82[$1_1 + ($4_1 + 2016 | 0) | 0]; + label$7: { + if (($2_1 | 0) >= 1) { + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $45($4_1 + 320 | 0, $4_1 + 160 | 0, ($4_1 + 480 | 0) + Math_imul2(($2_1 | 0) / 2 << 24 >> 24, 160) | 0); + break label$7; + } + if (($2_1 | 0) > -1) { + break label$7; + } + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $66($4_1 + 320 | 0, $4_1 + 160 | 0, ($4_1 + 480 | 0) + Math_imul2(($2_1 | 0) / -2 << 24 >> 24, 160) | 0); + } + $2_1 = HEAP82[$1_1 + ($4_1 + 1760 | 0) | 0]; + label$9: { + if (($2_1 | 0) >= 1) { + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $49($4_1 + 320 | 0, $4_1 + 160 | 0, Math_imul2(($2_1 | 0) / 2 << 24 >> 24, 120) + 1904 | 0); + break label$9; + } + if (($2_1 | 0) > -1) { + break label$9; + } + $52($4_1 + 160 | 0, $4_1 + 320 | 0); + $50($4_1 + 320 | 0, $4_1 + 160 | 0, Math_imul2(($2_1 | 0) / -2 << 24 >> 24, 120) + 1904 | 0); + } + $51($0, $4_1 + 320 | 0); + $3_1 = $1_1 + -1 | 0; + if (($1_1 | 0) > 0) { + continue; + } + break; + } + } + global$0 = $4_1 + 2272 | 0; + } + function $47($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0; + while (1) { + HEAP82[$0 + $2_1 | 0] = HEAPU82[($2_1 >>> 3 | 0) + $1_1 | 0] >>> ($2_1 & 7) & 1; + $2_1 = $2_1 + 1 | 0; + if (($2_1 | 0) != 256) { + continue; + } + break; + } + $5_1 = 254; + while (1) { + $6_1 = $0 + $3_1 | 0; + label$3: { + if (!HEAPU82[$6_1 | 0] | $3_1 >>> 0 > 254) { + break label$3; + } + $10_1 = $5_1 >>> 0 < 5 ? $5_1 : 5; + $1_1 = 1; + $2_1 = $3_1 + 1 | 0; + while (1) { + $7_1 = $1_1; + $1_1 = $0 + $2_1 | 0; + $4_1 = HEAP82[$1_1 | 0]; + label$5: { + if (!$4_1) { + break label$5; + } + $8_1 = HEAP82[$6_1 | 0]; + $4_1 = $4_1 << $7_1; + $9_1 = $8_1 + $4_1 | 0; + if (($9_1 | 0) <= 15) { + HEAP82[$6_1 | 0] = $9_1; + HEAP82[$1_1 | 0] = 0; + break label$5; + } + $1_1 = $8_1 - $4_1 | 0; + if (($1_1 | 0) < -15) { + break label$3; + } + HEAP82[$6_1 | 0] = $1_1; + while (1) { + $1_1 = $0 + $2_1 | 0; + if (!HEAPU82[$1_1 | 0]) { + HEAP82[$1_1 | 0] = 1; + break label$5; + } + HEAP82[$1_1 | 0] = 0; + $1_1 = $2_1 >>> 0 < 255; + $2_1 = $2_1 + 1 | 0; + if ($1_1) { + continue; + } + break; + } + } + $1_1 = $7_1 + 1 | 0; + $2_1 = $3_1 + $1_1 | 0; + if (($10_1 + 1 | 0) != ($7_1 | 0)) { + continue; + } + break; + } + } + $5_1 = $5_1 + -1 | 0; + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 256) { + continue; + } + break; + } + } + function $48($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0; + $2_1 = global$0 - 240 | 0; + global$0 = $2_1; + $4_1 = $0 + 40 | 0; + $32($4_1, $1_1); + $3_1 = $0 + 80 | 0; + $28($3_1); + $42($2_1 + 192 | 0, $4_1); + $38($2_1 + 144 | 0, $2_1 + 192 | 0, 1056); + $43($2_1 + 192 | 0, $2_1 + 192 | 0, $3_1); + $29($2_1 + 144 | 0, $2_1 + 144 | 0, $3_1); + $42($2_1 + 96 | 0, $2_1 + 144 | 0); + $38($2_1 + 96 | 0, $2_1 + 96 | 0, $2_1 + 144 | 0); + $42($0, $2_1 + 96 | 0); + $38($0, $0, $2_1 + 144 | 0); + $38($0, $0, $2_1 + 192 | 0); + $40($0, $0); + $38($0, $0, $2_1 + 96 | 0); + $38($0, $0, $2_1 + 192 | 0); + $42($2_1 + 48 | 0, $0); + $38($2_1 + 48 | 0, $2_1 + 48 | 0, $2_1 + 144 | 0); + $43($2_1, $2_1 + 48 | 0, $2_1 + 192 | 0); + label$1: { + if ($37($2_1)) { + $29($2_1, $2_1 + 48 | 0, $2_1 + 192 | 0); + $3_1 = -1; + if ($37($2_1)) { + break label$1; + } + $38($0, $0, 1104); + } + if (($36($0) | 0) == (HEAPU82[$1_1 + 31 | 0] >>> 7 | 0)) { + $39($0, $0); + } + $38($0 + 120 | 0, $0, $4_1); + $3_1 = 0; + } + global$0 = $2_1 + 240 | 0; + return $3_1; + } + function $49($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $5_1 = global$0 - 48 | 0; + global$0 = $5_1; + $3_1 = $1_1 + 40 | 0; + $29($0, $3_1, $1_1); + $4_1 = $0 + 40 | 0; + $43($4_1, $3_1, $1_1); + $3_1 = $0 + 80 | 0; + $38($3_1, $0, $2_1); + $38($4_1, $4_1, $2_1 + 40 | 0); + $6_1 = $0 + 120 | 0; + $38($6_1, $2_1 + 80 | 0, $1_1 + 120 | 0); + $1_1 = $1_1 + 80 | 0; + $29($5_1, $1_1, $1_1); + $43($0, $3_1, $4_1); + $29($4_1, $3_1, $4_1); + $29($3_1, $5_1, $6_1); + $43($6_1, $5_1, $6_1); + global$0 = $5_1 + 48 | 0; + } + function $50($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $5_1 = global$0 - 48 | 0; + global$0 = $5_1; + $3_1 = $1_1 + 40 | 0; + $29($0, $3_1, $1_1); + $4_1 = $0 + 40 | 0; + $43($4_1, $3_1, $1_1); + $3_1 = $0 + 80 | 0; + $38($3_1, $0, $2_1 + 40 | 0); + $38($4_1, $4_1, $2_1); + $6_1 = $0 + 120 | 0; + $38($6_1, $2_1 + 80 | 0, $1_1 + 120 | 0); + $1_1 = $1_1 + 80 | 0; + $29($5_1, $1_1, $1_1); + $43($0, $3_1, $4_1); + $29($4_1, $3_1, $4_1); + $43($3_1, $5_1, $6_1); + $29($6_1, $5_1, $6_1); + global$0 = $5_1 + 48 | 0; + } + function $51($0, $1_1) { + var $2_1 = 0, $3_1 = 0; + $2_1 = $1_1 + 120 | 0; + $38($0, $1_1, $2_1); + $3_1 = $1_1 + 40 | 0; + $1_1 = $1_1 + 80 | 0; + $38($0 + 40 | 0, $3_1, $1_1); + $38($0 + 80 | 0, $1_1, $2_1); + } + function $52($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0; + $2_1 = $1_1 + 120 | 0; + $38($0, $1_1, $2_1); + $3_1 = $1_1 + 40 | 0; + $4_1 = $1_1 + 80 | 0; + $38($0 + 40 | 0, $3_1, $4_1); + $38($0 + 80 | 0, $4_1, $2_1); + $38($0 + 120 | 0, $1_1, $3_1); + } + function $54($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $3_1 = global$0 - 48 | 0; + global$0 = $3_1; + $42($0, $1_1); + $2_1 = $0 + 80 | 0; + $6_1 = $1_1 + 40 | 0; + $42($2_1, $6_1); + $5_1 = $0 + 120 | 0; + $41($5_1, $1_1 + 80 | 0); + $4_1 = $0 + 40 | 0; + $29($4_1, $1_1, $6_1); + $42($3_1, $4_1); + $29($4_1, $2_1, $0); + $43($2_1, $2_1, $0); + $43($0, $3_1, $4_1); + $43($5_1, $5_1, $2_1); + global$0 = $3_1 + 48 | 0; + } + function $56($0, $1_1) { + var $2_1 = 0; + $2_1 = global$0 - 128 | 0; + global$0 = $2_1; + $59($2_1 + 8 | 0, $1_1); + $54($0, $2_1 + 8 | 0); + global$0 = $2_1 + 128 | 0; + } + function $57($0, $1_1) { + var $2_1 = 0; + $2_1 = global$0 - 144 | 0; + global$0 = $2_1; + $35($2_1 + 96 | 0, $1_1 + 80 | 0); + $38($2_1 + 48 | 0, $1_1, $2_1 + 96 | 0); + $38($2_1, $1_1 + 40 | 0, $2_1 + 96 | 0); + $44($0, $2_1); + HEAP82[$0 + 31 | 0] = $36($2_1 + 48 | 0) << 7 ^ HEAPU82[$0 + 31 | 0]; + global$0 = $2_1 + 144 | 0; + } + function $58($0, $1_1) { + var $2_1 = 0; + $2_1 = $1_1 + 40 | 0; + $29($0, $2_1, $1_1); + $43($0 + 40 | 0, $2_1, $1_1); + $31($0 + 80 | 0, $1_1 + 80 | 0); + $38($0 + 120 | 0, $1_1 + 120 | 0, 1152); + } + function $59($0, $1_1) { + $31($0, $1_1); + $31($0 + 40 | 0, $1_1 + 40 | 0); + $31($0 + 80 | 0, $1_1 + 80 | 0); + } + function $61($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $2_1 = global$0 - 464 | 0; + global$0 = $2_1; + while (1) { + $4_1 = $3_1 << 1; + $6_1 = HEAPU82[$1_1 + $3_1 | 0]; + HEAP82[$4_1 + ($2_1 + 400 | 0) | 0] = $6_1 & 15; + HEAP82[($2_1 + 400 | 0) + ($4_1 | 1) | 0] = $6_1 >>> 4; + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 32) { + continue; + } + break; + } + $3_1 = 0; + while (1) { + $4_1 = ($2_1 + 400 | 0) + $5_1 | 0; + $3_1 = $3_1 + HEAPU82[$4_1 | 0] | 0; + $1_1 = $3_1 + 8 | 0; + HEAP82[$4_1 | 0] = $3_1 - ($1_1 & 240); + $3_1 = $1_1 << 24 >> 28; + $5_1 = $5_1 + 1 | 0; + if (($5_1 | 0) != 63) { + continue; + } + break; + } + HEAP82[$2_1 + 463 | 0] = HEAPU82[$2_1 + 463 | 0] + $3_1; + $27($0); + $28($0 + 40 | 0); + $28($0 + 80 | 0); + $27($0 + 120 | 0); + $3_1 = 1; + while (1) { + $62($2_1, $3_1 >>> 1 | 0, HEAP82[($2_1 + 400 | 0) + $3_1 | 0]); + $49($2_1 + 240 | 0, $0, $2_1); + $52($0, $2_1 + 240 | 0); + $1_1 = $3_1 >>> 0 < 62; + $3_1 = $3_1 + 2 | 0; + if ($1_1) { + continue; + } + break; + } + $56($2_1 + 240 | 0, $0); + $51($2_1 + 120 | 0, $2_1 + 240 | 0); + $54($2_1 + 240 | 0, $2_1 + 120 | 0); + $51($2_1 + 120 | 0, $2_1 + 240 | 0); + $54($2_1 + 240 | 0, $2_1 + 120 | 0); + $51($2_1 + 120 | 0, $2_1 + 240 | 0); + $54($2_1 + 240 | 0, $2_1 + 120 | 0); + $52($0, $2_1 + 240 | 0); + $3_1 = 0; + while (1) { + $62($2_1, $3_1 >>> 1 | 0, HEAP82[($2_1 + 400 | 0) + $3_1 | 0]); + $49($2_1 + 240 | 0, $0, $2_1); + $52($0, $2_1 + 240 | 0); + $1_1 = $3_1 >>> 0 < 62; + $3_1 = $3_1 + 2 | 0; + if ($1_1) { + continue; + } + break; + } + global$0 = $2_1 + 464 | 0; + } + function $62($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0; + $3_1 = global$0 - 128 | 0; + global$0 = $3_1; + $28($0); + $28($0 + 40 | 0); + $27($0 + 80 | 0); + $1_1 = Math_imul2($1_1, 960); + $4_1 = ($2_1 & 128) >>> 7 | 0; + $2_1 = $2_1 - ((0 - $4_1 & $2_1) << 1) << 24 >> 24; + $65($0, $1_1 + 2864 | 0, $64($2_1, 1)); + $65($0, $1_1 + 2984 | 0, $64($2_1, 2)); + $65($0, $1_1 + 3104 | 0, $64($2_1, 3)); + $65($0, $1_1 + 3224 | 0, $64($2_1, 4)); + $65($0, $1_1 + 3344 | 0, $64($2_1, 5)); + $65($0, $1_1 + 3464 | 0, $64($2_1, 6)); + $65($0, $1_1 + 3584 | 0, $64($2_1, 7)); + $65($0, $1_1 + 3704 | 0, $64($2_1, 8)); + $31($3_1 + 8 | 0, $0 + 40 | 0); + $31($3_1 + 48 | 0, $0); + $39($3_1 + 88 | 0, $0 + 80 | 0); + $65($0, $3_1 + 8 | 0, $4_1); + global$0 = $3_1 + 128 | 0; + } + function $64($0, $1_1) { + return (($0 ^ $1_1) & 255) + -1 >>> 31 | 0; + } + function $65($0, $1_1, $2_1) { + $30($0, $1_1, $2_1); + $30($0 + 40 | 0, $1_1 + 40 | 0, $2_1); + $30($0 + 80 | 0, $1_1 + 80 | 0, $2_1); + } + function $66($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $5_1 = global$0 - 48 | 0; + global$0 = $5_1; + $3_1 = $1_1 + 40 | 0; + $29($0, $3_1, $1_1); + $4_1 = $0 + 40 | 0; + $43($4_1, $3_1, $1_1); + $3_1 = $0 + 80 | 0; + $38($3_1, $0, $2_1 + 40 | 0); + $38($4_1, $4_1, $2_1); + $6_1 = $0 + 120 | 0; + $38($6_1, $2_1 + 120 | 0, $1_1 + 120 | 0); + $38($0, $1_1 + 80 | 0, $2_1 + 80 | 0); + $29($5_1, $0, $0); + $43($0, $3_1, $4_1); + $29($4_1, $3_1, $4_1); + $43($3_1, $5_1, $6_1); + $29($6_1, $5_1, $6_1); + global$0 = $5_1 + 48 | 0; + } + function $67($0, $1_1, $2_1, $3_1, $4_1) { + var $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0; + $5_1 = global$0 - 480 | 0; + global$0 = $5_1; + label$1: { + label$2: { + if ($3_1 >>> 0 < 64 | HEAPU82[$2_1 + 63 | 0] > 31) { + break label$2; + } + if ($48($5_1 + 128 | 0, $4_1)) { + break label$2; + } + $8_1 = HEAPU82[$4_1 + 28 | 0] | HEAPU82[$4_1 + 29 | 0] << 8 | (HEAPU82[$4_1 + 30 | 0] << 16 | HEAPU82[$4_1 + 31 | 0] << 24); + $7_1 = $5_1 + 472 | 0; + $6_1 = $7_1; + HEAP322[$6_1 >> 2] = HEAPU82[$4_1 + 24 | 0] | HEAPU82[$4_1 + 25 | 0] << 8 | (HEAPU82[$4_1 + 26 | 0] << 16 | HEAPU82[$4_1 + 27 | 0] << 24); + HEAP322[$6_1 + 4 >> 2] = $8_1; + $8_1 = HEAPU82[$4_1 + 20 | 0] | HEAPU82[$4_1 + 21 | 0] << 8 | (HEAPU82[$4_1 + 22 | 0] << 16 | HEAPU82[$4_1 + 23 | 0] << 24); + $9_1 = $5_1 + 464 | 0; + $6_1 = $9_1; + HEAP322[$6_1 >> 2] = HEAPU82[$4_1 + 16 | 0] | HEAPU82[$4_1 + 17 | 0] << 8 | (HEAPU82[$4_1 + 18 | 0] << 16 | HEAPU82[$4_1 + 19 | 0] << 24); + HEAP322[$6_1 + 4 >> 2] = $8_1; + $8_1 = HEAPU82[$4_1 + 4 | 0] | HEAPU82[$4_1 + 5 | 0] << 8 | (HEAPU82[$4_1 + 6 | 0] << 16 | HEAPU82[$4_1 + 7 | 0] << 24); + HEAP322[$5_1 + 448 >> 2] = HEAPU82[$4_1 | 0] | HEAPU82[$4_1 + 1 | 0] << 8 | (HEAPU82[$4_1 + 2 | 0] << 16 | HEAPU82[$4_1 + 3 | 0] << 24); + HEAP322[$5_1 + 452 >> 2] = $8_1; + $8_1 = HEAPU82[$4_1 + 12 | 0] | HEAPU82[$4_1 + 13 | 0] << 8 | (HEAPU82[$4_1 + 14 | 0] << 16 | HEAPU82[$4_1 + 15 | 0] << 24); + HEAP322[$5_1 + 456 >> 2] = HEAPU82[$4_1 + 8 | 0] | HEAPU82[$4_1 + 9 | 0] << 8 | (HEAPU82[$4_1 + 10 | 0] << 16 | HEAPU82[$4_1 + 11 | 0] << 24); + HEAP322[$5_1 + 460 >> 2] = $8_1; + $4_1 = HEAPU82[$2_1 + 20 | 0] | HEAPU82[$2_1 + 21 | 0] << 8 | (HEAPU82[$2_1 + 22 | 0] << 16 | HEAPU82[$2_1 + 23 | 0] << 24); + HEAP322[$5_1 + 432 >> 2] = HEAPU82[$2_1 + 16 | 0] | HEAPU82[$2_1 + 17 | 0] << 8 | (HEAPU82[$2_1 + 18 | 0] << 16 | HEAPU82[$2_1 + 19 | 0] << 24); + HEAP322[$5_1 + 436 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 28 | 0] | HEAPU82[$2_1 + 29 | 0] << 8 | (HEAPU82[$2_1 + 30 | 0] << 16 | HEAPU82[$2_1 + 31 | 0] << 24); + HEAP322[$5_1 + 440 >> 2] = HEAPU82[$2_1 + 24 | 0] | HEAPU82[$2_1 + 25 | 0] << 8 | (HEAPU82[$2_1 + 26 | 0] << 16 | HEAPU82[$2_1 + 27 | 0] << 24); + HEAP322[$5_1 + 444 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 4 | 0] | HEAPU82[$2_1 + 5 | 0] << 8 | (HEAPU82[$2_1 + 6 | 0] << 16 | HEAPU82[$2_1 + 7 | 0] << 24); + HEAP322[$5_1 + 416 >> 2] = HEAPU82[$2_1 | 0] | HEAPU82[$2_1 + 1 | 0] << 8 | (HEAPU82[$2_1 + 2 | 0] << 16 | HEAPU82[$2_1 + 3 | 0] << 24); + HEAP322[$5_1 + 420 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 12 | 0] | HEAPU82[$2_1 + 13 | 0] << 8 | (HEAPU82[$2_1 + 14 | 0] << 16 | HEAPU82[$2_1 + 15 | 0] << 24); + HEAP322[$5_1 + 424 >> 2] = HEAPU82[$2_1 + 8 | 0] | HEAPU82[$2_1 + 9 | 0] << 8 | (HEAPU82[$2_1 + 10 | 0] << 16 | HEAPU82[$2_1 + 11 | 0] << 24); + HEAP322[$5_1 + 428 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 52 | 0] | HEAPU82[$2_1 + 53 | 0] << 8 | (HEAPU82[$2_1 + 54 | 0] << 16 | HEAPU82[$2_1 + 55 | 0] << 24); + HEAP322[$5_1 + 400 >> 2] = HEAPU82[$2_1 + 48 | 0] | HEAPU82[$2_1 + 49 | 0] << 8 | (HEAPU82[$2_1 + 50 | 0] << 16 | HEAPU82[$2_1 + 51 | 0] << 24); + HEAP322[$5_1 + 404 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 60 | 0] | HEAPU82[$2_1 + 61 | 0] << 8 | (HEAPU82[$2_1 + 62 | 0] << 16 | HEAPU82[$2_1 + 63 | 0] << 24); + HEAP322[$5_1 + 408 >> 2] = HEAPU82[$2_1 + 56 | 0] | HEAPU82[$2_1 + 57 | 0] << 8 | (HEAPU82[$2_1 + 58 | 0] << 16 | HEAPU82[$2_1 + 59 | 0] << 24); + HEAP322[$5_1 + 412 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 36 | 0] | HEAPU82[$2_1 + 37 | 0] << 8 | (HEAPU82[$2_1 + 38 | 0] << 16 | HEAPU82[$2_1 + 39 | 0] << 24); + HEAP322[$5_1 + 384 >> 2] = HEAPU82[$2_1 + 32 | 0] | HEAPU82[$2_1 + 33 | 0] << 8 | (HEAPU82[$2_1 + 34 | 0] << 16 | HEAPU82[$2_1 + 35 | 0] << 24); + HEAP322[$5_1 + 388 >> 2] = $4_1; + $4_1 = HEAPU82[$2_1 + 44 | 0] | HEAPU82[$2_1 + 45 | 0] << 8 | (HEAPU82[$2_1 + 46 | 0] << 16 | HEAPU82[$2_1 + 47 | 0] << 24); + HEAP322[$5_1 + 392 >> 2] = HEAPU82[$2_1 + 40 | 0] | HEAPU82[$2_1 + 41 | 0] << 8 | (HEAPU82[$2_1 + 42 | 0] << 16 | HEAPU82[$2_1 + 43 | 0] << 24); + HEAP322[$5_1 + 396 >> 2] = $4_1; + $8_1 = $3_1; + $4_1 = $80($0, $2_1, $3_1); + $2_1 = $4_1; + $6_1 = HEAP322[$7_1 + 4 >> 2]; + $7_1 = HEAP322[$7_1 >> 2]; + HEAP82[$2_1 + 56 | 0] = $7_1; + HEAP82[$2_1 + 57 | 0] = $7_1 >>> 8; + HEAP82[$2_1 + 58 | 0] = $7_1 >>> 16; + HEAP82[$2_1 + 59 | 0] = $7_1 >>> 24; + HEAP82[$2_1 + 60 | 0] = $6_1; + HEAP82[$2_1 + 61 | 0] = $6_1 >>> 8; + HEAP82[$2_1 + 62 | 0] = $6_1 >>> 16; + HEAP82[$2_1 + 63 | 0] = $6_1 >>> 24; + $6_1 = HEAP322[$9_1 + 4 >> 2]; + $7_1 = HEAP322[$9_1 >> 2]; + HEAP82[$2_1 + 48 | 0] = $7_1; + HEAP82[$2_1 + 49 | 0] = $7_1 >>> 8; + HEAP82[$2_1 + 50 | 0] = $7_1 >>> 16; + HEAP82[$2_1 + 51 | 0] = $7_1 >>> 24; + HEAP82[$2_1 + 52 | 0] = $6_1; + HEAP82[$2_1 + 53 | 0] = $6_1 >>> 8; + HEAP82[$2_1 + 54 | 0] = $6_1 >>> 16; + HEAP82[$2_1 + 55 | 0] = $6_1 >>> 24; + $6_1 = HEAP322[$5_1 + 460 >> 2]; + $7_1 = HEAP322[$5_1 + 456 >> 2]; + HEAP82[$2_1 + 40 | 0] = $7_1; + HEAP82[$2_1 + 41 | 0] = $7_1 >>> 8; + HEAP82[$2_1 + 42 | 0] = $7_1 >>> 16; + HEAP82[$2_1 + 43 | 0] = $7_1 >>> 24; + HEAP82[$2_1 + 44 | 0] = $6_1; + HEAP82[$2_1 + 45 | 0] = $6_1 >>> 8; + HEAP82[$2_1 + 46 | 0] = $6_1 >>> 16; + HEAP82[$2_1 + 47 | 0] = $6_1 >>> 24; + $6_1 = HEAP322[$5_1 + 452 >> 2]; + $7_1 = HEAP322[$5_1 + 448 >> 2]; + HEAP82[$2_1 + 32 | 0] = $7_1; + HEAP82[$2_1 + 33 | 0] = $7_1 >>> 8; + HEAP82[$2_1 + 34 | 0] = $7_1 >>> 16; + HEAP82[$2_1 + 35 | 0] = $7_1 >>> 24; + HEAP82[$2_1 + 36 | 0] = $6_1; + HEAP82[$2_1 + 37 | 0] = $6_1 >>> 8; + HEAP82[$2_1 + 38 | 0] = $6_1 >>> 16; + HEAP82[$2_1 + 39 | 0] = $6_1 >>> 24; + $5($5_1 + 320 | 0, $2_1, $3_1); + $69($5_1 + 320 | 0); + $46($5_1 + 8 | 0, $5_1 + 320 | 0, $5_1 + 128 | 0, $5_1 + 384 | 0); + $57($5_1 + 288 | 0, $5_1 + 8 | 0); + if ($2($5_1 + 288 | 0, $5_1 + 416 | 0)) { + break label$2; + } + $0 = $4_1; + $4_1 = $4_1 - -64 | 0; + $2_1 = -1; + $3_1 = $3_1 + -64 | 0; + if ($3_1 >>> 0 < 4294967232) { + $2_1 = 0; + } + $0 = ($80($0, $4_1, $3_1) + $8_1 | 0) + -64 | 0; + HEAP82[$0 + 56 | 0] = 0; + HEAP82[$0 + 57 | 0] = 0; + HEAP82[$0 + 58 | 0] = 0; + HEAP82[$0 + 59 | 0] = 0; + HEAP82[$0 + 60 | 0] = 0; + HEAP82[$0 + 61 | 0] = 0; + HEAP82[$0 + 62 | 0] = 0; + HEAP82[$0 + 63 | 0] = 0; + HEAP82[$0 + 48 | 0] = 0; + HEAP82[$0 + 49 | 0] = 0; + HEAP82[$0 + 50 | 0] = 0; + HEAP82[$0 + 51 | 0] = 0; + HEAP82[$0 + 52 | 0] = 0; + HEAP82[$0 + 53 | 0] = 0; + HEAP82[$0 + 54 | 0] = 0; + HEAP82[$0 + 55 | 0] = 0; + HEAP82[$0 + 40 | 0] = 0; + HEAP82[$0 + 41 | 0] = 0; + HEAP82[$0 + 42 | 0] = 0; + HEAP82[$0 + 43 | 0] = 0; + HEAP82[$0 + 44 | 0] = 0; + HEAP82[$0 + 45 | 0] = 0; + HEAP82[$0 + 46 | 0] = 0; + HEAP82[$0 + 47 | 0] = 0; + HEAP82[$0 + 32 | 0] = 0; + HEAP82[$0 + 33 | 0] = 0; + HEAP82[$0 + 34 | 0] = 0; + HEAP82[$0 + 35 | 0] = 0; + HEAP82[$0 + 36 | 0] = 0; + HEAP82[$0 + 37 | 0] = 0; + HEAP82[$0 + 38 | 0] = 0; + HEAP82[$0 + 39 | 0] = 0; + HEAP82[$0 + 24 | 0] = 0; + HEAP82[$0 + 25 | 0] = 0; + HEAP82[$0 + 26 | 0] = 0; + HEAP82[$0 + 27 | 0] = 0; + HEAP82[$0 + 28 | 0] = 0; + HEAP82[$0 + 29 | 0] = 0; + HEAP82[$0 + 30 | 0] = 0; + HEAP82[$0 + 31 | 0] = 0; + HEAP82[$0 + 16 | 0] = 0; + HEAP82[$0 + 17 | 0] = 0; + HEAP82[$0 + 18 | 0] = 0; + HEAP82[$0 + 19 | 0] = 0; + HEAP82[$0 + 20 | 0] = 0; + HEAP82[$0 + 21 | 0] = 0; + HEAP82[$0 + 22 | 0] = 0; + HEAP82[$0 + 23 | 0] = 0; + HEAP82[$0 + 8 | 0] = 0; + HEAP82[$0 + 9 | 0] = 0; + HEAP82[$0 + 10 | 0] = 0; + HEAP82[$0 + 11 | 0] = 0; + HEAP82[$0 + 12 | 0] = 0; + HEAP82[$0 + 13 | 0] = 0; + HEAP82[$0 + 14 | 0] = 0; + HEAP82[$0 + 15 | 0] = 0; + HEAP82[$0 | 0] = 0; + HEAP82[$0 + 1 | 0] = 0; + HEAP82[$0 + 2 | 0] = 0; + HEAP82[$0 + 3 | 0] = 0; + HEAP82[$0 + 4 | 0] = 0; + HEAP82[$0 + 5 | 0] = 0; + HEAP82[$0 + 6 | 0] = 0; + HEAP82[$0 + 7 | 0] = 0; + HEAP322[$1_1 >> 2] = $3_1; + HEAP322[$1_1 + 4 >> 2] = $2_1; + $0 = 0; + break label$1; + } + HEAP322[$1_1 >> 2] = -1; + HEAP322[$1_1 + 4 >> 2] = -1; + $79($0, $3_1); + $0 = -1; + } + global$0 = $5_1 + 480 | 0; + return $0; + } + function $68($0, $1_1, $2_1, $3_1) { + var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0, $25_1 = 0, $26_1 = 0, $27_1 = 0, $28_1 = 0, $29_1 = 0, $30_1 = 0, $31_1 = 0, $32_1 = 0, $33_1 = 0, $34_1 = 0, $35_1 = 0, $36_1 = 0, $37_1 = 0, $38_1 = 0, $39_1 = 0, $40_1 = 0, $41_1 = 0, $42_1 = 0, $43_1 = 0, $44_1 = 0, $45_1 = 0, $46_1 = 0, $47_1 = 0, $48_1 = 0, $49_1 = 0, $50_1 = 0, $51_1 = 0, $52_1 = 0, $53 = 0, $54_1 = 0, $55 = 0, $56_1 = 0, $57_1 = 0, $58_1 = 0, $59_1 = 0, $60 = 0, $61_1 = 0, $62_1 = 0, $63 = 0, $64_1 = 0, $65_1 = 0, $66_1 = 0, $67_1 = 0, $68_1 = 0, $69_1 = 0, $70_1 = 0, $71_1 = 0, $72_1 = 0, $73_1 = 0, $74 = 0, $75_1 = 0, $76_1 = 0, $77 = 0, $78_1 = 0, $79_1 = 0, $80_1 = 0, $81_1 = 0, $82_1 = 0, $83_1 = 0, $84_1 = 0, $85_1 = 0, $86_1 = 0, $87_1 = 0, $88_1 = 0, $89 = 0, $90 = 0, $91 = 0, $92 = 0, $93 = 0, $94 = 0, $95 = 0, $96 = 0, $97 = 0, $98 = 0, $99 = 0, $100 = 0, $101 = 0, $102 = 0, $103 = 0, $104 = 0, $105 = 0, $106 = 0, $107 = 0, $108 = 0, $109 = 0, $110 = 0, $111 = 0, $112 = 0, $113 = 0, $114 = 0, $115 = 0, $116 = 0, $117 = 0, $118 = 0, $119 = 0, $120 = 0, $121 = 0, $122 = 0, $123 = 0, $124 = 0, $125 = 0, $126 = 0, $127 = 0, $128 = 0; + $100 = $34($1_1); + $105 = $33($1_1 + 2 | 0); + $84_1 = i64toi32_i32$HIGH_BITS; + $25_1 = $34($1_1 + 5 | 0); + $85_1 = i64toi32_i32$HIGH_BITS; + $91 = $33($1_1 + 7 | 0); + $86_1 = i64toi32_i32$HIGH_BITS; + $92 = $33($1_1 + 10 | 0); + $21_1 = i64toi32_i32$HIGH_BITS; + $93 = $34($1_1 + 13 | 0); + $18_1 = i64toi32_i32$HIGH_BITS; + $94 = $33($1_1 + 15 | 0); + $22_1 = i64toi32_i32$HIGH_BITS; + $95 = $34($1_1 + 18 | 0); + $19 = i64toi32_i32$HIGH_BITS; + $96 = $34($1_1 + 21 | 0); + $27_1 = $33($1_1 + 23 | 0); + $11_1 = i64toi32_i32$HIGH_BITS; + $30_1 = $34($1_1 + 26 | 0); + $8_1 = i64toi32_i32$HIGH_BITS; + $16_1 = $33($1_1 + 28 | 0); + $6_1 = i64toi32_i32$HIGH_BITS; + $97 = $34($2_1); + $98 = $33($2_1 + 2 | 0); + $15_1 = i64toi32_i32$HIGH_BITS; + $114 = $34($2_1 + 5 | 0); + $13_1 = i64toi32_i32$HIGH_BITS; + $115 = $33($2_1 + 7 | 0); + $23_1 = i64toi32_i32$HIGH_BITS; + $87_1 = $33($2_1 + 10 | 0); + $20_1 = i64toi32_i32$HIGH_BITS; + $116 = $34($2_1 + 13 | 0); + $17_1 = i64toi32_i32$HIGH_BITS; + $58_1 = $33($2_1 + 15 | 0); + $10_1 = i64toi32_i32$HIGH_BITS; + $106 = $34($2_1 + 18 | 0); + $7_1 = i64toi32_i32$HIGH_BITS; + $107 = $34($2_1 + 21 | 0); + $14_1 = $33($2_1 + 23 | 0); + $9_1 = i64toi32_i32$HIGH_BITS; + $12_1 = $34($2_1 + 26 | 0); + $5_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $33($2_1 + 28 | 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $122 = $34($3_1); + $123 = $33($3_1 + 2 | 0); + $124 = i64toi32_i32$HIGH_BITS; + $125 = $34($3_1 + 5 | 0); + $126 = i64toi32_i32$HIGH_BITS; + $127 = $33($3_1 + 7 | 0); + $90 = i64toi32_i32$HIGH_BITS; + $117 = $33($3_1 + 10 | 0); + $31_1 = i64toi32_i32$HIGH_BITS; + $118 = $34($3_1 + 13 | 0); + $28_1 = i64toi32_i32$HIGH_BITS; + $61_1 = $33($3_1 + 15 | 0); + $26_1 = i64toi32_i32$HIGH_BITS; + $32_1 = $34($3_1 + 18 | 0); + $24_1 = i64toi32_i32$HIGH_BITS; + $62_1 = $34($3_1 + 21 | 0); + $128 = $0; + $4_1 = $1_1 >>> 7 | 0; + $59_1 = $4_1; + $33_1 = ($1_1 & 127) << 25 | $2_1 >>> 7; + $34_1 = (($8_1 & 3) << 30 | $30_1 >>> 2) & 2097151; + $1_1 = __wasm_i64_mul($33_1, $4_1, $34_1, 0); + $4_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $1_1; + $35_1 = (($5_1 & 3) << 30 | $12_1 >>> 2) & 2097151; + $36_1 = ($6_1 & 127) << 25 | $16_1 >>> 7; + $37_1 = $6_1 >>> 7 | 0; + $1_1 = __wasm_i64_mul($35_1, 0, $36_1, $37_1); + $5_1 = $2_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $8_1 = $5_1; + $5_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($34_1, $63, $35_1, $64_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $38_1 = (($9_1 & 31) << 27 | $14_1 >>> 5) & 2097151; + $2_1 = __wasm_i64_mul($38_1, 0, $36_1, $37_1); + $9_1 = $2_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $9_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $39_1 = (($11_1 & 31) << 27 | $27_1 >>> 5) & 2097151; + $2_1 = __wasm_i64_mul($33_1, $59_1, $39_1, 0); + $9_1 = $2_1 + $9_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $6_1 = $9_1; + $4_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $16_1 = $4_1; + $1_1 = $6_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $29_1 = $1_1 - -1048576 | 0; + $14_1 = $4_1; + $2_1 = $4_1 >>> 21 | 0; + $4_1 = ($4_1 & 2097151) << 11 | $29_1 >>> 21; + $9_1 = $4_1 + $8_1 | 0; + $1_1 = $2_1 + $5_1 | 0; + $5_1 = $9_1; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $12_1 = $1_1; + $1_1 = $5_1; + $8_1 = $12_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $30_1 = $1_1 - -1048576 | 0; + $11_1 = $8_1; + $9_1 = __wasm_i64_mul($33_1, $59_1, $36_1, $37_1); + $1_1 = $9_1; + $99 = $1_1 - -1048576 | 0; + $88_1 = i64toi32_i32$HIGH_BITS; + $27_1 = $88_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $4_1 = $27_1; + $2_1 = $8_1 >>> 21 | 0; + $27_1 = ($8_1 & 2097151) << 11 | $30_1 >>> 21; + $8_1 = $99 & -2097152; + $9_1 = $1_1 - $8_1 | 0; + $89 = $27_1 + $9_1 | 0; + $1_1 = ($88_1 - (($4_1 & 2147483647) + ($1_1 >>> 0 < $8_1 >>> 0) | 0) | 0) + $2_1 | 0; + $108 = $89; + $1_1 = $89 >>> 0 < $9_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $109 = $1_1; + $8_1 = __wasm_i64_mul($89, $1_1, -683901, -1); + $9_1 = i64toi32_i32$HIGH_BITS; + $1_1 = $4_1 >>> 21 | 0; + $89 = $1_1; + $101 = ($4_1 & 2097151) << 11 | $99 >>> 21; + $1_1 = __wasm_i64_mul($101, $1_1, 136657, 0); + $4_1 = $1_1 + $8_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $9_1 | 0; + $27_1 = $4_1; + $8_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $40_1 = (($17_1 & 1) << 31 | $116 >>> 1) & 2097151; + $1_1 = __wasm_i64_mul($40_1, 0, $34_1, $63); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $41_1 = (($20_1 & 15) << 28 | $87_1 >>> 4) & 2097151; + $1_1 = __wasm_i64_mul($41_1, 0, $36_1, $37_1); + $9_1 = $4_1 + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $42_1 = (($10_1 & 63) << 26 | $58_1 >>> 6) & 2097151; + $1_1 = __wasm_i64_mul($42_1, 0, $39_1, $65_1); + $9_1 = $1_1 + $9_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = 0; + $60 = $1_1; + $43_1 = $107 & 2097151; + $44_1 = (($19 & 7) << 29 | $95 >>> 3) & 2097151; + $4_1 = __wasm_i64_mul($43_1, $1_1, $44_1, 0); + $9_1 = $9_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $9_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $45_1 = (($7_1 & 7) << 29 | $106 >>> 3) & 2097151; + $46_1 = $96 & 2097151; + $2_1 = __wasm_i64_mul($45_1, 0, $46_1, 0); + $9_1 = $2_1 + $9_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $9_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $47_1 = (($22_1 & 63) << 26 | $94 >>> 6) & 2097151; + $1_1 = __wasm_i64_mul($38_1, $66_1, $47_1, 0); + $9_1 = $1_1 + $9_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $48_1 = (($18_1 & 1) << 31 | $93 >>> 1) & 2097151; + $4_1 = __wasm_i64_mul($35_1, $64_1, $48_1, 0); + $9_1 = $4_1 + $9_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $9_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $49_1 = (($21_1 & 15) << 28 | $92 >>> 4) & 2097151; + $2_1 = __wasm_i64_mul($33_1, $59_1, $49_1, 0); + $9_1 = $2_1 + $9_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $19 = $9_1; + $9_1 = $9_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($34_1, $63, $41_1, $67_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $50_1 = (($23_1 & 127) << 25 | $115 >>> 7) & 2097151; + $1_1 = __wasm_i64_mul($50_1, 0, $36_1, $37_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($40_1, $68_1, $39_1, $65_1); + $7_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($46_1, $69_1, $42_1, $70_1); + $7_1 = $2_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $7_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($47_1, $71_1, $43_1, $60); + $7_1 = $1_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $7_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($44_1, $72_1, $45_1, $73_1); + $7_1 = $4_1 + $7_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($38_1, $66_1, $48_1, $74); + $7_1 = $4_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($35_1, $64_1, $49_1, $75_1); + $7_1 = $4_1 + $7_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $51_1 = (($86_1 & 127) << 25 | $91 >>> 7) & 2097151; + $2_1 = __wasm_i64_mul($33_1, $59_1, $51_1, 0); + $7_1 = $2_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $20_1 = $7_1; + $4_1 = $7_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $10_1 = $4_1; + $1_1 = $7_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $17_1 = $1_1 - -1048576 | 0; + $7_1 = $4_1; + $2_1 = $4_1 >> 21; + $4_1 = ($4_1 & 2097151) << 11 | $17_1 >>> 21; + $23_1 = $4_1 + $19 | 0; + $1_1 = $2_1 + $9_1 | 0; + $2_1 = $23_1; + $9_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = $9_1 + $8_1 | 0; + $8_1 = $2_1 + $27_1 | 0; + if ($8_1 >>> 0 < $2_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $4_1 = $8_1; + $21_1 = $2_1 - -1048576 | 0; + $8_1 = $9_1 - (($2_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $9_1 = $8_1; + $2_1 = $4_1; + $4_1 = $21_1 & -2097152; + $22_1 = $2_1 - $4_1 | 0; + $19 = $1_1 - (($2_1 >>> 0 < $4_1 >>> 0) + $9_1 | 0) | 0; + $1_1 = $30_1 & -2097152; + $4_1 = $12_1 - (($11_1 & 2147483647) + ($5_1 >>> 0 < $1_1 >>> 0) | 0) | 0; + $102 = $5_1 - $1_1 | 0; + $91 = $4_1; + $1_1 = __wasm_i64_mul($101, $89, -997805, -1); + $5_1 = $1_1 + $20_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $10_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $5_1; + $5_1 = __wasm_i64_mul($108, $109, 136657, 0); + $10_1 = $1_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = __wasm_i64_mul($102, $4_1, -683901, -1); + $4_1 = $2_1 + $10_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($10_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1) | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $17_1 & -2097152; + $8_1 = $4_1 - $2_1 | 0; + $10_1 = $1_1 - (($4_1 >>> 0 < $2_1 >>> 0) + $7_1 | 0) | 0; + $1_1 = __wasm_i64_mul($34_1, $63, $50_1, $76_1); + $4_1 = i64toi32_i32$HIGH_BITS; + $52_1 = (($13_1 & 3) << 30 | $114 >>> 2) & 2097151; + $2_1 = __wasm_i64_mul($52_1, 0, $36_1, $37_1); + $5_1 = $2_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($39_1, $65_1, $41_1, $67_1); + $5_1 = $2_1 + $5_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($40_1, $68_1, $46_1, $69_1); + $5_1 = $1_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($44_1, $72_1, $42_1, $70_1); + $5_1 = $4_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($43_1, $60, $48_1, $74); + $5_1 = $4_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($45_1, $73_1, $47_1, $71_1); + $5_1 = $4_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($38_1, $66_1, $49_1, $75_1); + $5_1 = $2_1 + $5_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($35_1, $64_1, $51_1, $77); + $5_1 = $1_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $53 = (($85_1 & 3) << 30 | $25_1 >>> 2) & 2097151; + $4_1 = __wasm_i64_mul($33_1, $59_1, $53, 0); + $5_1 = $4_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $7_1 = $5_1; + $5_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($34_1, $63, $52_1, $78_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $54_1 = (($15_1 & 31) << 27 | $98 >>> 5) & 2097151; + $1_1 = __wasm_i64_mul($54_1, 0, $36_1, $37_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($39_1, $65_1, $50_1, $76_1); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($41_1, $67_1, $46_1, $69_1); + $11_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $11_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($40_1, $68_1, $44_1, $72_1); + $4_1 = $2_1 + $11_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($47_1, $71_1, $42_1, $70_1); + $11_1 = $2_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $11_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($43_1, $60, $49_1, $75_1); + $11_1 = $1_1 + $11_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $11_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($45_1, $73_1, $48_1, $74); + $4_1 = $1_1 + $11_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($38_1, $66_1, $51_1, $77); + $11_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $11_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($35_1, $64_1, $53, $79_1); + $4_1 = $2_1 + $11_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $55 = (($84_1 & 31) << 27 | $105 >>> 5) & 2097151; + $2_1 = __wasm_i64_mul($33_1, $59_1, $55, 0); + $11_1 = $2_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $23_1 = $11_1; + $4_1 = $11_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $106 = $4_1; + $1_1 = $11_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $114 = $1_1 - -1048576 | 0; + $107 = $4_1; + $1_1 = $4_1 >> 21; + $2_1 = ($4_1 & 2097151) << 11 | $114 >>> 21; + $4_1 = $2_1 + $7_1 | 0; + $1_1 = $1_1 + $5_1 | 0; + $20_1 = $4_1; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $88_1 = $1_1; + $1_1 = $4_1; + $4_1 = $88_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $115 = $1_1 - -1048576 | 0; + $27_1 = $4_1; + $2_1 = ($4_1 & 2097151) << 11 | $115 >>> 21; + $5_1 = $2_1 + $8_1 | 0; + $4_1 = ($4_1 >> 21) + $10_1 | 0; + $17_1 = $5_1; + $4_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $30_1 = $4_1; + $1_1 = $5_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $87_1 = $1_1 - -1048576 | 0; + $84_1 = $4_1; + $1_1 = $4_1 >> 21; + $2_1 = ($4_1 & 2097151) << 11 | $87_1 >>> 21; + $4_1 = $2_1 + $22_1 | 0; + $1_1 = $1_1 + $19 | 0; + $7_1 = $4_1; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $19 = $1_1; + $1_1 = $4_1; + $4_1 = $19 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $58_1 = $1_1 - -1048576 | 0; + $15_1 = $4_1; + $12_1 = ($4_1 & 2097151) << 11 | $58_1 >>> 21; + $10_1 = $4_1 >> 21; + $1_1 = __wasm_i64_mul($34_1, $63, $42_1, $70_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($36_1, $37_1, $40_1, $68_1); + $5_1 = $4_1 + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($46_1, $69_1, $43_1, $60); + $5_1 = $1_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($39_1, $65_1, $45_1, $73_1); + $5_1 = $4_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($38_1, $66_1, $44_1, $72_1); + $5_1 = $4_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($35_1, $64_1, $47_1, $71_1); + $5_1 = $4_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($33_1, $59_1, $48_1, $74); + $5_1 = $2_1 + $5_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $8_1 = __wasm_i64_mul($101, $89, -683901, -1); + $11_1 = $5_1 + $8_1 | 0; + $1_1 = $4_1; + $2_1 = $1_1 + i64toi32_i32$HIGH_BITS | 0; + $2_1 = $11_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $11_1; + $8_1 = $1_1; + $1_1 = $5_1; + $8_1 = $8_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $18_1 = $1_1 - -1048576 | 0; + $1_1 = $4_1; + $4_1 = $18_1 & -2097152; + $11_1 = $1_1 - $4_1 | 0; + $5_1 = $8_1; + $4_1 = $2_1 - ($5_1 + ($1_1 >>> 0 < $4_1 >>> 0) | 0) | 0; + $1_1 = $9_1 >> 21; + $2_1 = ($9_1 & 2097151) << 11 | $21_1 >>> 21; + $9_1 = $2_1 + $11_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $1_1 = $9_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $9_1; + $22_1 = $2_1 - -1048576 | 0; + $11_1 = $1_1 - (($2_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $4_1 = $11_1; + $8_1 = $22_1 & -2097152; + $9_1 = $2_1 - $8_1 | 0; + $12_1 = $9_1 + $12_1 | 0; + $2_1 = ($1_1 - (($2_1 >>> 0 < $8_1 >>> 0) + $4_1 | 0) | 0) + $10_1 | 0; + $110 = $12_1; + $2_1 = $12_1 >>> 0 < $9_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $92 = $2_1; + $13_1 = __wasm_i64_mul($12_1, $2_1, -683901, -1); + $12_1 = i64toi32_i32$HIGH_BITS; + $8_1 = ($4_1 & 2097151) << 11 | $22_1 >>> 21; + $9_1 = $4_1 >> 21; + $2_1 = __wasm_i64_mul($39_1, $65_1, $43_1, $60); + $1_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = __wasm_i64_mul($36_1, $37_1, $42_1, $70_1); + $4_1 = $4_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($34_1, $63, $45_1, $73_1); + $10_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $10_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($38_1, $66_1, $46_1, $69_1); + $10_1 = $1_1 + $10_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $10_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($35_1, $64_1, $44_1, $72_1); + $10_1 = $1_1 + $10_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $10_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($33_1, $59_1, $47_1, $71_1); + $10_1 = $4_1 + $10_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $10_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $5_1 >> 21; + $2_1 = ($5_1 & 2097151) << 11 | $18_1 >>> 21; + $5_1 = $2_1 + $10_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $5_1; + $21_1 = $2_1 - -1048576 | 0; + $10_1 = $1_1 - (($2_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $11_1 = $10_1; + $5_1 = $21_1 & -2097152; + $4_1 = $2_1 - $5_1 | 0; + $8_1 = $4_1 + $8_1 | 0; + $1_1 = ($1_1 - (($2_1 >>> 0 < $5_1 >>> 0) + $10_1 | 0) | 0) + $9_1 | 0; + $111 = $8_1; + $1_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $93 = $1_1; + $2_1 = __wasm_i64_mul($8_1, $1_1, 136657, 0); + $4_1 = $2_1 + $13_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $12_1 | 0; + $85_1 = $4_1; + $13_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = $29_1 & -2097152; + $18_1 = $6_1 - $1_1 | 0; + $22_1 = $16_1 - (($14_1 & 2147483647) + ($6_1 >>> 0 < $1_1 >>> 0) | 0) | 0; + $1_1 = __wasm_i64_mul($34_1, $63, $38_1, $66_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($36_1, $37_1, $43_1, $60); + $5_1 = $4_1 + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($35_1, $64_1, $39_1, $65_1); + $5_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($33_1, $59_1, $46_1, $69_1); + $4_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $6_1 = $4_1; + $5_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($36_1, $37_1, $45_1, $73_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($34_1, $63, $43_1, $60); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($38_1, $66_1, $39_1, $65_1); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($35_1, $64_1, $46_1, $69_1); + $9_1 = $1_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($33_1, $59_1, $44_1, $72_1); + $9_1 = $2_1 + $9_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $9_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $8_1 = $1_1; + $1_1 = $9_1; + $2_1 = $8_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $14_1 = $1_1 - -1048576 | 0; + $10_1 = $2_1; + $1_1 = ($2_1 & 2097151) << 11 | $14_1 >>> 21; + $6_1 = $1_1 + $6_1 | 0; + $2_1 = ($2_1 >> 21) + $5_1 | 0; + $5_1 = $6_1; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = $2_1; + $1_1 = $5_1; + $16_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $12_1 = $1_1 - -1048576 | 0; + $2_1 = $16_1; + $4_1 = $2_1 >> 21; + $16_1 = ($2_1 & 2097151) << 11 | $12_1 >>> 21; + $18_1 = $16_1 + $18_1 | 0; + $1_1 = $4_1 + $22_1 | 0; + $112 = $18_1; + $1_1 = $18_1 >>> 0 < $16_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $94 = $1_1; + $4_1 = __wasm_i64_mul($18_1, $1_1, 470296, 0); + $16_1 = i64toi32_i32$HIGH_BITS; + $1_1 = $12_1 & -2097152; + $2_1 = $6_1 - (($5_1 >>> 0 < $1_1 >>> 0) + $2_1 | 0) | 0; + $103 = $5_1 - $1_1 | 0; + $95 = $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($102, $91, 666643, 0); + $5_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $16_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($103, $2_1, 654183, 0); + $5_1 = $4_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $6_1 = $5_1; + $4_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $14_1 & -2097152; + $1_1 = $9_1 - $2_1 | 0; + $9_1 = $8_1 - (($9_1 >>> 0 < $2_1 >>> 0) + $10_1 | 0) | 0; + $5_1 = ($11_1 & 2097151) << 11 | $21_1 >>> 21; + $10_1 = $5_1 + $1_1 | 0; + $1_1 = ($11_1 >> 21) + $9_1 | 0; + $113 = $10_1; + $1_1 = $10_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $96 = $1_1; + $1_1 = __wasm_i64_mul($10_1, $1_1, -997805, -1); + $5_1 = $1_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $14_1 = $5_1; + $8_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($46_1, $69_1, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $56_1 = $97 & 2097151; + $1_1 = __wasm_i64_mul($56_1, 0, $39_1, $65_1); + $5_1 = $4_1 + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($44_1, $72_1, $52_1, $78_1); + $5_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($47_1, $71_1, $50_1, $76_1); + $4_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($41_1, $67_1, $48_1, $74); + $5_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($40_1, $68_1, $49_1, $75_1); + $4_1 = $1_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($42_1, $70_1, $51_1, $77); + $5_1 = $1_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($43_1, $60, $55, $81_1); + $5_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($45_1, $73_1, $53, $79_1); + $4_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $57_1 = $100 & 2097151; + $4_1 = __wasm_i64_mul($38_1, $66_1, $57_1, 0); + $5_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $5_1; + $2_1 = $1_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $33($3_1 + 23 | 0); + $4_1 = i64toi32_i32$HIGH_BITS; + $4_1 = (($4_1 & 31) << 27 | $1_1 >>> 5) & 2097151; + $1_1 = $5_1 + $4_1 | 0; + if ($1_1 >>> 0 < $4_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $12_1 = $1_1; + $9_1 = $2_1; + $2_1 = __wasm_i64_mul($44_1, $72_1, $54_1, $80_1); + $1_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = __wasm_i64_mul($46_1, $69_1, $56_1, $82_1); + $4_1 = $4_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($47_1, $71_1, $52_1, $78_1); + $4_1 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($48_1, $74, $50_1, $76_1); + $5_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($41_1, $67_1, $49_1, $75_1); + $5_1 = $1_1 + $5_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($40_1, $68_1, $51_1, $77); + $5_1 = $1_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($42_1, $70_1, $53, $79_1); + $5_1 = $4_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($43_1, $60, $57_1, $83_1); + $4_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($45_1, $73_1, $55, $81_1); + $5_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $62_1 & 2097151; + $5_1 = $1_1 + $5_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = $4_1; + $1_1 = $5_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $11_1 = $1_1 - -1048576 | 0; + $6_1 = $4_1; + $1_1 = $4_1 >> 21; + $2_1 = ($4_1 & 2097151) << 11 | $11_1 >>> 21; + $4_1 = $2_1 + $12_1 | 0; + $1_1 = $1_1 + $9_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $9_1 = $1_1; + $2_1 = $1_1 + $8_1 | 0; + $1_1 = $4_1; + $8_1 = $1_1 + $14_1 | 0; + if ($8_1 >>> 0 < $1_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $1_1 = $8_1; + $8_1 = $9_1 - (($4_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $9_1 = $8_1; + $99 = $4_1 - -1048576 | 0; + $4_1 = $99 & -2097152; + $86_1 = $1_1 - $4_1 | 0; + $21_1 = $2_1 - (($1_1 >>> 0 < $4_1 >>> 0) + $9_1 | 0) | 0; + $2_1 = __wasm_i64_mul($103, $95, 470296, 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = __wasm_i64_mul($112, $94, 666643, 0); + $4_1 = $4_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($113, $96, 654183, 0); + $8_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $5_1 + $8_1 | 0; + $4_1 = $10_1 + ($8_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1) | 0; + $4_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = $1_1; + $1_1 = $11_1 & -2097152; + $14_1 = $2_1 - $1_1 | 0; + $10_1 = $4_1 - (($2_1 >>> 0 < $1_1 >>> 0) + $6_1 | 0) | 0; + $1_1 = __wasm_i64_mul($47_1, $71_1, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($44_1, $72_1, $56_1, $82_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($48_1, $74, $52_1, $78_1); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($49_1, $75_1, $50_1, $76_1); + $5_1 = $1_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($41_1, $67_1, $51_1, $77); + $5_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($40_1, $68_1, $53, $79_1); + $4_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($42_1, $70_1, $55, $81_1); + $5_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($45_1, $73_1, $57_1, $83_1); + $4_1 = $1_1 + $5_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = $2_1; + $2_1 = (($24_1 & 7) << 29 | $32_1 >>> 3) & 2097151; + $1_1 = $2_1 + $1_1 | 0; + if ($1_1 >>> 0 < $2_1 >>> 0) { + $4_1 = $4_1 + 1 | 0; + } + $6_1 = $1_1; + $5_1 = $4_1; + $2_1 = __wasm_i64_mul($48_1, $74, $54_1, $80_1); + $1_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = __wasm_i64_mul($47_1, $71_1, $56_1, $82_1); + $4_1 = $4_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($49_1, $75_1, $52_1, $78_1); + $8_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($51_1, $77, $50_1, $76_1); + $8_1 = $4_1 + $8_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($41_1, $67_1, $53, $79_1); + $8_1 = $4_1 + $8_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($40_1, $68_1, $55, $81_1); + $8_1 = $1_1 + $8_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $8_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($42_1, $70_1, $57_1, $83_1); + $8_1 = $2_1 + $8_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $4_1 = $8_1; + $2_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = (($26_1 & 63) << 26 | $61_1 >>> 6) & 2097151; + $1_1 = $8_1 + $4_1 | 0; + if ($1_1 >>> 0 < $4_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $18_1 = $1_1; + $12_1 = $2_1; + $2_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $29_1 = $1_1 - -1048576 | 0; + $16_1 = $2_1; + $4_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $29_1 >>> 21; + $6_1 = $2_1 + $6_1 | 0; + $1_1 = $4_1 + $5_1 | 0; + $1_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $11_1 = $1_1; + $1_1 = $6_1; + $2_1 = $11_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $22_1 = $1_1 - -1048576 | 0; + $8_1 = $2_1; + $1_1 = ($2_1 & 2097151) << 11 | $22_1 >>> 21; + $5_1 = $1_1 + $14_1 | 0; + $2_1 = ($2_1 >> 21) + $10_1 | 0; + $26_1 = $5_1; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = $2_1; + $1_1 = $5_1; + $2_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $24_1 = $1_1 - -1048576 | 0; + $14_1 = $2_1; + $4_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $24_1 >>> 21; + $5_1 = $2_1 + $86_1 | 0; + $1_1 = $4_1 + $21_1 | 0; + $4_1 = $5_1; + $5_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $5_1 + $13_1 | 0; + $1_1 = $4_1; + $13_1 = $1_1 + $85_1 | 0; + if ($13_1 >>> 0 < $1_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $1_1 = $13_1; + $13_1 = $5_1 - (($4_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $5_1 = $13_1; + $100 = $4_1 - -1048576 | 0; + $4_1 = $100 & -2097152; + $105 = $1_1 - $4_1 | 0; + $25_1 = $2_1 - (($1_1 >>> 0 < $4_1 >>> 0) + $5_1 | 0) | 0; + $1_1 = __wasm_i64_mul($111, $93, -997805, -1); + $2_1 = $1_1 + $26_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $10_1 | 0; + $97 = $2_1; + $13_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($113, $96, 470296, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($103, $95, 666643, 0); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1 + $6_1 | 0; + $2_1 = $2_1 + $11_1 | 0; + $2_1 = $1_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $1_1; + $1_1 = $22_1 & -2097152; + $32_1 = $4_1 - $1_1 | 0; + $62_1 = $2_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $8_1 | 0) | 0; + $2_1 = __wasm_i64_mul($113, $96, 666643, 0); + $4_1 = $2_1 + $18_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $12_1 | 0; + $26_1 = $4_1; + $10_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($49_1, $75_1, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($48_1, $74, $56_1, $82_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($51_1, $77, $52_1, $78_1); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($53, $79_1, $50_1, $76_1); + $6_1 = $1_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($41_1, $67_1, $55, $81_1); + $6_1 = $2_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($40_1, $68_1, $57_1, $83_1); + $4_1 = $2_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $1_1; + $1_1 = $4_1; + $4_1 = (($28_1 & 1) << 31 | $118 >>> 1) & 2097151; + $1_1 = $1_1 + $4_1 | 0; + if ($1_1 >>> 0 < $4_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $8_1 = $1_1; + $6_1 = $2_1; + $1_1 = __wasm_i64_mul($51_1, $77, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($49_1, $75_1, $56_1, $82_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($53, $79_1, $52_1, $78_1); + $11_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $11_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($55, $81_1, $50_1, $76_1); + $11_1 = $2_1 + $11_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $11_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($41_1, $67_1, $57_1, $83_1); + $11_1 = $2_1 + $11_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $4_1 = $11_1; + $2_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = (($31_1 & 15) << 28 | $117 >>> 4) & 2097151; + $1_1 = $11_1 + $4_1 | 0; + if ($1_1 >>> 0 < $4_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $12_1 = $1_1; + $85_1 = $2_1; + $2_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $116 = $1_1 - -1048576 | 0; + $86_1 = $2_1; + $4_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $116 >>> 21; + $8_1 = $2_1 + $8_1 | 0; + $1_1 = $4_1 + $6_1 | 0; + $11_1 = $8_1; + $1_1 = $8_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $21_1 = $1_1; + $1_1 = $8_1; + $2_1 = $21_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $117 = $1_1 - -1048576 | 0; + $18_1 = $2_1; + $1_1 = ($2_1 & 2097151) << 11 | $117 >>> 21; + $6_1 = $1_1 + $26_1 | 0; + $2_1 = ($2_1 >> 21) + $10_1 | 0; + $4_1 = $6_1; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $29_1 & -2097152; + $22_1 = $2_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $16_1 | 0) | 0; + $8_1 = $4_1 - $1_1 | 0; + $1_1 = $8_1; + $4_1 = $22_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $118 = $1_1 - -1048576 | 0; + $31_1 = $4_1; + $2_1 = ($4_1 & 2097151) << 11 | $118 >>> 21; + $6_1 = $2_1 + $32_1 | 0; + $4_1 = ($4_1 >> 21) + $62_1 | 0; + $61_1 = $6_1; + $4_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $28_1 = $4_1; + $1_1 = $6_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $32_1 = $1_1 - -1048576 | 0; + $26_1 = $4_1; + $1_1 = $58_1 & -2097152; + $6_1 = $19 - (($7_1 >>> 0 < $1_1 >>> 0) + $15_1 | 0) | 0; + $104 = $7_1 - $1_1 | 0; + $98 = $6_1; + $1_1 = $4_1 >> 21; + $4_1 = ($4_1 & 2097151) << 11 | $32_1 >>> 21; + $7_1 = $4_1 + $97 | 0; + $2_1 = $1_1 + $13_1 | 0; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($110, $92, 136657, 0); + $4_1 = $24_1 & -2097152; + $10_1 = $1_1 + ($7_1 - $4_1 | 0) | 0; + $4_1 = i64toi32_i32$HIGH_BITS + ($2_1 - (($7_1 >>> 0 < $4_1 >>> 0) + $14_1 | 0) | 0) | 0; + $4_1 = $10_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($104, $6_1, -683901, -1); + $6_1 = $1_1 + $10_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $10_1 = $6_1; + $2_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $24_1 = $2_1; + $1_1 = $6_1; + $4_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $62_1 = $1_1 - -1048576 | 0; + $19 = $4_1; + $2_1 = ($4_1 & 2097151) << 11 | $62_1 >>> 21; + $6_1 = $2_1 + $105 | 0; + $4_1 = ($4_1 >> 21) + $25_1 | 0; + $7_1 = $6_1; + $4_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $15_1 = $4_1; + $1_1 = $6_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $58_1 = $1_1 - -1048576 | 0; + $16_1 = $4_1; + $97 = ($4_1 & 2097151) << 11 | $58_1 >>> 21; + $14_1 = $4_1 >> 21; + $1_1 = __wasm_i64_mul($39_1, $65_1, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($34_1, $63, $56_1, $82_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($46_1, $69_1, $52_1, $78_1); + $6_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($44_1, $72_1, $50_1, $76_1); + $6_1 = $2_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($41_1, $67_1, $47_1, $71_1); + $6_1 = $1_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($40_1, $68_1, $48_1, $74); + $6_1 = $4_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($42_1, $70_1, $49_1, $75_1); + $6_1 = $4_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($43_1, $60, $53, $79_1); + $6_1 = $4_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($45_1, $73_1, $51_1, $77); + $6_1 = $2_1 + $6_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($38_1, $66_1, $55, $81_1); + $6_1 = $1_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($35_1, $64_1, $57_1, $83_1); + $6_1 = $4_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $1_1; + $1_1 = $34($3_1 + 26 | 0); + $4_1 = i64toi32_i32$HIGH_BITS; + $4_1 = (($4_1 & 3) << 30 | $1_1 >>> 2) & 2097151; + $1_1 = $6_1 + $4_1 | 0; + if ($1_1 >>> 0 < $4_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $29_1 = $1_1; + $6_1 = $2_1; + $2_1 = __wasm_i64_mul($102, $91, 470296, 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = __wasm_i64_mul($108, $109, 666643, 0); + $4_1 = $4_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($112, $94, 654183, 0); + $25_1 = $2_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $25_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($103, $95, -997805, -1); + $25_1 = $2_1 + $25_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $25_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($113, $96, 136657, 0); + $25_1 = $4_1 + $25_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $25_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $25_1; + $4_1 = $1_1 + $29_1 | 0; + $2_1 = $2_1 + $6_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $29_1; + $13_1 = $6_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $119 = $1_1 - -1048576 | 0; + $6_1 = $13_1; + $13_1 = $4_1; + $1_1 = $9_1 >> 21; + $4_1 = ($9_1 & 2097151) << 11 | $99 >>> 21; + $9_1 = $13_1 + $4_1 | 0; + $1_1 = $1_1 + $2_1 | 0; + $1_1 = $9_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $29_1 = $9_1; + $2_1 = $119 & -2097152; + $4_1 = $9_1 - $2_1 | 0; + $9_1 = __wasm_i64_mul($111, $93, -683901, -1); + $25_1 = $4_1 + $9_1 | 0; + $1_1 = $1_1 - (($29_1 >>> 0 < $2_1 >>> 0) + $6_1 | 0) | 0; + $2_1 = $1_1 + i64toi32_i32$HIGH_BITS | 0; + $2_1 = $25_1 >>> 0 < $9_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $9_1 = $1_1; + $1_1 = $4_1; + $13_1 = $9_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $120 = $1_1 - -1048576 | 0; + $9_1 = $13_1; + $1_1 = $5_1 >> 21; + $4_1 = ($5_1 & 2097151) << 11 | $100 >>> 21; + $5_1 = $4_1 + $25_1 | 0; + $1_1 = $1_1 + $2_1 | 0; + $1_1 = $5_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $120 & -2097152; + $4_1 = $5_1 - $2_1 | 0; + $13_1 = $1_1 - (($5_1 >>> 0 < $2_1 >>> 0) + $9_1 | 0) | 0; + $2_1 = $13_1 + $14_1 | 0; + $1_1 = $4_1; + $5_1 = $1_1 + $97 | 0; + if ($5_1 >>> 0 < $1_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $1_1 = $5_1; + $13_1 = $13_1 - (($4_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $5_1 = $13_1; + $121 = $4_1 - -1048576 | 0; + $4_1 = $121 & -2097152; + $99 = $1_1 - $4_1 | 0; + $100 = $2_1 - (($1_1 >>> 0 < $4_1 >>> 0) + $5_1 | 0) | 0; + $1_1 = $58_1 & -2097152; + $105 = $7_1 - $1_1 | 0; + $25_1 = $15_1 - (($7_1 >>> 0 < $1_1 >>> 0) + $16_1 | 0) | 0; + $1_1 = $62_1 & -2097152; + $97 = $10_1 - $1_1 | 0; + $62_1 = $24_1 - (($10_1 >>> 0 < $1_1 >>> 0) + $19 | 0) | 0; + $1_1 = __wasm_i64_mul($111, $93, 654183, 0); + $4_1 = $1_1 + $61_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $28_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = $4_1; + $1_1 = $32_1 & -2097152; + $4_1 = __wasm_i64_mul($110, $92, -997805, -1); + $10_1 = ($7_1 - $1_1 | 0) + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($2_1 - (($7_1 >>> 0 < $1_1 >>> 0) + $26_1 | 0) | 0) | 0; + $1_1 = $10_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($104, $98, 136657, 0); + $7_1 = $4_1 + $10_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $58_1 = $7_1; + $10_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $87_1 & -2097152; + $29_1 = $17_1 - $1_1 | 0; + $24_1 = $30_1 - (($17_1 >>> 0 < $1_1 >>> 0) + $84_1 | 0) | 0; + $1_1 = __wasm_i64_mul($108, $109, -997805, -1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($101, $89, 654183, 0); + $7_1 = $4_1 + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $7_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = __wasm_i64_mul($102, $91, 136657, 0); + $7_1 = $2_1 + $7_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $1_1 = $7_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($112, $94, -683901, -1); + $7_1 = $4_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $7_1 + $20_1 | 0; + $1_1 = $2_1 + $88_1 | 0; + $1_1 = $4_1 >>> 0 < $20_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $115 & -2097152; + $19 = $4_1 - $2_1 | 0; + $15_1 = $1_1 - (($4_1 >>> 0 < $2_1 >>> 0) + $27_1 | 0) | 0; + $1_1 = __wasm_i64_mul($108, $109, 654183, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($101, $89, 470296, 0); + $7_1 = $4_1 + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $7_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($102, $91, -997805, -1); + $7_1 = $1_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $4_1 = $7_1 + $23_1 | 0; + $1_1 = $106 + ($7_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1) | 0; + $1_1 = $4_1 >>> 0 < $23_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($112, $94, 136657, 0); + $4_1 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($103, $95, -683901, -1); + $7_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $7_1; + $1_1 = $114 & -2097152; + $20_1 = $4_1 - $1_1 | 0; + $17_1 = $2_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $107 | 0) | 0; + $1_1 = __wasm_i64_mul($34_1, $63, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($36_1, $37_1, $56_1, $82_1); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($39_1, $65_1, $52_1, $78_1); + $7_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($46_1, $69_1, $50_1, $76_1); + $7_1 = $4_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($41_1, $67_1, $44_1, $72_1); + $7_1 = $4_1 + $7_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($40_1, $68_1, $47_1, $71_1); + $7_1 = $2_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $7_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($42_1, $70_1, $48_1, $74); + $7_1 = $1_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $7_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($43_1, $60, $51_1, $77); + $7_1 = $4_1 + $7_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($45_1, $73_1, $49_1, $75_1); + $7_1 = $4_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($38_1, $66_1, $53, $79_1); + $7_1 = $4_1 + $7_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($33_1, $59_1, $57_1, $83_1); + $7_1 = $2_1 + $7_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $7_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($35_1, $64_1, $55, $81_1); + $7_1 = $1_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $4_1 = $7_1; + $1_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $33($3_1 + 28 | 0); + $4_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1 >>> 7 | 0; + $3_1 = ($4_1 & 127) << 25 | $3_1 >>> 7; + $4_1 = $7_1 + $3_1 | 0; + $1_1 = $1_1 + $2_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = ($6_1 >> 21) + $1_1 | 0; + $3_1 = ($6_1 & 2097151) << 11 | $119 >>> 21; + $4_1 = $4_1 + $3_1 | 0; + if ($4_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $7_1 = $4_1; + $16_1 = $2_1; + $1_1 = $4_1; + $3_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $28_1 = $1_1 - -1048576 | 0; + $14_1 = $3_1; + $1_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $28_1 >>> 21; + $4_1 = $3_1 + $20_1 | 0; + $2_1 = $1_1 + $17_1 | 0; + $6_1 = $4_1; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $13_1 = $2_1; + $1_1 = $4_1; + $3_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $26_1 = $1_1 - -1048576 | 0; + $23_1 = $3_1; + $1_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $26_1 >>> 21; + $4_1 = $3_1 + $19 | 0; + $2_1 = $1_1 + $15_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $4_1; + $17_1 = $2_1; + $1_1 = $4_1; + $15_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $20_1 = $1_1 - -1048576 | 0; + $4_1 = $15_1; + $1_1 = $4_1 >> 21; + $15_1 = ($4_1 & 2097151) << 11 | $20_1 >>> 21; + $19 = $15_1 + $29_1 | 0; + $2_1 = $1_1 + $24_1 | 0; + $87_1 = $19; + $2_1 = $19 >>> 0 < $15_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $27_1 = $2_1; + $2_1 = __wasm_i64_mul($19, $2_1, -683901, -1); + $15_1 = $2_1 + $58_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $10_1 | 0; + $1_1 = $15_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $10_1 = $1_1; + $1_1 = $20_1 & -2097152; + $4_1 = $17_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $4_1 | 0) | 0; + $61_1 = $3_1 - $1_1 | 0; + $30_1 = $4_1; + $1_1 = __wasm_i64_mul($111, $93, 470296, 0) + $8_1 | 0; + $2_1 = $22_1 + i64toi32_i32$HIGH_BITS | 0; + $2_1 = $1_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($110, $92, 654183, 0); + $8_1 = $1_1; + $1_1 = $118 & -2097152; + $17_1 = $3_1 + ($8_1 - $1_1 | 0) | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($2_1 - (($8_1 >>> 0 < $1_1 >>> 0) + $31_1 | 0) | 0) | 0; + $1_1 = $17_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($104, $98, -997805, -1); + $3_1 = $2_1 + $17_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $3_1; + $3_1 = __wasm_i64_mul($19, $27_1, 136657, 0); + $8_1 = $2_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $8_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($61_1, $4_1, -683901, -1); + $3_1 = $1_1 + $8_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $20_1 = $4_1; + $1_1 = $3_1; + $4_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $24_1 = $1_1 - -1048576 | 0; + $17_1 = $4_1; + $2_1 = $4_1 >> 21; + $1_1 = ($4_1 & 2097151) << 11 | $24_1 >>> 21; + $4_1 = $1_1 + $15_1 | 0; + $2_1 = $2_1 + $10_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $8_1 = $2_1; + $10_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $2_1 = $10_1 >> 21; + $15_1 = $1_1 - -1048576 | 0; + $19 = ($10_1 & 2097151) << 11 | $15_1 >>> 21; + $31_1 = $19 + $97 | 0; + $4_1 = $2_1 + $62_1 | 0; + $62_1 = $31_1; + $19 = $31_1 >>> 0 < $19 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $2_1 = $15_1 & -2097152; + $58_1 = $1_1 - $2_1 | 0; + $29_1 = $8_1 - (($1_1 >>> 0 < $2_1 >>> 0) + $10_1 | 0) | 0; + $1_1 = $24_1 & -2097152; + $88_1 = $3_1 - $1_1 | 0; + $22_1 = $20_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $17_1 | 0) | 0; + $2_1 = __wasm_i64_mul($111, $93, 666643, 0); + $1_1 = $117 & -2097152; + $3_1 = $2_1 + ($11_1 - $1_1 | 0) | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($21_1 - (($11_1 >>> 0 < $1_1 >>> 0) + $18_1 | 0) | 0) | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($110, $92, 470296, 0); + $3_1 = $2_1 + $3_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $4_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($104, $98, 654183, 0); + $3_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $11_1 = $3_1; + $3_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $26_1 & -2097152; + $8_1 = $6_1 - $1_1 | 0; + $10_1 = $13_1 - (($6_1 >>> 0 < $1_1 >>> 0) + $23_1 | 0) | 0; + $1_1 = __wasm_i64_mul($108, $109, 470296, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($101, $89, 666643, 0); + $4_1 = $4_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($102, $91, 654183, 0); + $6_1 = $1_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $4_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($112, $94, -997805, -1); + $6_1 = $1_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = __wasm_i64_mul($103, $95, 136657, 0); + $6_1 = $4_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($113, $96, -683901, -1); + $4_1 = $2_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $4_1 + $7_1 | 0; + $2_1 = $1_1 + $16_1 | 0; + $2_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = $4_1; + $4_1 = $28_1 & -2097152; + $1_1 = $6_1 - $4_1 | 0; + $4_1 = $2_1 - (($6_1 >>> 0 < $4_1 >>> 0) + $14_1 | 0) | 0; + $6_1 = $1_1; + $2_1 = $9_1 >> 21; + $1_1 = ($9_1 & 2097151) << 11 | $120 >>> 21; + $9_1 = $6_1 + $1_1 | 0; + $2_1 = $2_1 + $4_1 | 0; + $2_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $13_1 = $2_1; + $1_1 = $9_1; + $4_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $31_1 = $1_1 - -1048576 | 0; + $23_1 = $4_1; + $2_1 = $4_1 >> 21; + $4_1 = ($4_1 & 2097151) << 11 | $31_1 >>> 21; + $6_1 = $4_1 + $8_1 | 0; + $1_1 = $2_1 + $10_1 | 0; + $32_1 = $6_1; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $84_1 = $1_1; + $1_1 = __wasm_i64_mul($6_1, $1_1, -683901, -1); + $2_1 = $1_1 + $11_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $4_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($87_1, $27_1, -997805, -1); + $3_1 = $1_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = __wasm_i64_mul($61_1, $30_1, 136657, 0); + $4_1 = $1_1 + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $14_1 = $4_1; + $10_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($53, $79_1, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($51_1, $77, $56_1, $82_1); + $3_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = __wasm_i64_mul($55, $81_1, $52_1, $78_1); + $4_1 = $1_1 + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($57_1, $83_1, $50_1, $76_1); + $3_1 = $2_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $3_1; + $2_1 = $1_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $3_1 = (($90 & 127) << 25 | $127 >>> 7) & 2097151; + $1_1 = $3_1 + $1_1 | 0; + if ($1_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $6_1 = $1_1; + $3_1 = $2_1; + $2_1 = __wasm_i64_mul($55, $81_1, $54_1, $80_1); + $1_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $2_1; + $2_1 = __wasm_i64_mul($53, $79_1, $56_1, $82_1); + $4_1 = $4_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($57_1, $83_1, $52_1, $78_1); + $7_1 = $2_1 + $4_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $7_1; + $2_1 = $1_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $4_1 = (($126 & 3) << 30 | $125 >>> 2) & 2097151; + $1_1 = $4_1 + $1_1 | 0; + if ($1_1 >>> 0 < $4_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $7_1 = $1_1; + $15_1 = $2_1; + $4_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $18_1 = $1_1 - -1048576 | 0; + $16_1 = $4_1; + $2_1 = ($4_1 & 2097151) << 11 | $18_1 >>> 21; + $6_1 = $2_1 + $6_1 | 0; + $4_1 = ($4_1 >>> 21 | 0) + $3_1 | 0; + $4_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $20_1 = $4_1; + $1_1 = $6_1; + $3_1 = $4_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $28_1 = $1_1 - -1048576 | 0; + $17_1 = $3_1; + $1_1 = $3_1 >> 21; + $3_1 = $12_1 + (($3_1 & 2097151) << 11 | $28_1 >>> 21) | 0; + $2_1 = $1_1 + $85_1 | 0; + $2_1 = $3_1 >>> 0 < $12_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($110, $92, 666643, 0); + $4_1 = $3_1; + $3_1 = $116 & -2097152; + $8_1 = $1_1 + ($4_1 - $3_1 | 0) | 0; + $4_1 = i64toi32_i32$HIGH_BITS + ($2_1 - (($4_1 >>> 0 < $3_1 >>> 0) + $86_1 | 0) | 0) | 0; + $2_1 = __wasm_i64_mul($104, $98, 470296, 0); + $3_1 = $2_1 + $8_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($8_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1) | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $3_1; + $3_1 = __wasm_i64_mul($32_1, $84_1, 136657, 0); + $4_1 = $2_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($87_1, $27_1, 654183, 0); + $3_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = __wasm_i64_mul($61_1, $30_1, -997805, -1); + $4_1 = $1_1 + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $26_1 = $4_1; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $11_1 = $1_1; + $1_1 = $4_1; + $3_1 = $11_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $24_1 = $1_1 - -1048576 | 0; + $8_1 = $3_1; + $2_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $24_1 >>> 21; + $4_1 = $3_1 + $14_1 | 0; + $1_1 = $2_1 + $10_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1; + $1_1 = $4_1; + $14_1 = $3_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $12_1 = $1_1 - -1048576 | 0; + $10_1 = $14_1; + $2_1 = $10_1 >> 21; + $14_1 = ($10_1 & 2097151) << 11 | $12_1 >>> 21; + $21_1 = $14_1 + $88_1 | 0; + $1_1 = $2_1 + $22_1 | 0; + $106 = $21_1; + $14_1 = $21_1 >>> 0 < $14_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $31_1 & -2097152; + $1_1 = $9_1 - $2_1 | 0; + $9_1 = $13_1 - (($9_1 >>> 0 < $2_1 >>> 0) + $23_1 | 0) | 0; + $13_1 = $1_1; + $1_1 = $5_1 >> 21; + $2_1 = ($5_1 & 2097151) << 11 | $121 >>> 21; + $5_1 = $13_1 + $2_1 | 0; + $1_1 = $1_1 + $9_1 | 0; + $9_1 = $5_1; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $13_1 = $1_1; + $1_1 = $5_1; + $5_1 = $13_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $22_1 = $1_1 - -1048576 | 0; + $23_1 = $5_1; + $1_1 = $5_1 >> 21; + $21_1 = $1_1; + $90 = ($5_1 & 2097151) << 11 | $22_1 >>> 21; + $1_1 = __wasm_i64_mul($90, $1_1, -683901, -1); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $12_1 & -2097152; + $107 = $4_1 - $1_1 | 0; + $88_1 = $2_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $10_1 | 0) | 0; + $2_1 = __wasm_i64_mul($90, $21_1, 136657, 0); + $3_1 = $2_1 + $26_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $11_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $24_1 & -2097152; + $85_1 = $3_1 - $2_1 | 0; + $86_1 = $1_1 - (($3_1 >>> 0 < $2_1 >>> 0) + $8_1 | 0) | 0; + $1_1 = __wasm_i64_mul($104, $98, 666643, 0); + $2_1 = $28_1 & -2097152; + $3_1 = $1_1 + ($6_1 - $2_1 | 0) | 0; + $4_1 = i64toi32_i32$HIGH_BITS + ($20_1 - (($6_1 >>> 0 < $2_1 >>> 0) + $17_1 | 0) | 0) | 0; + $4_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = __wasm_i64_mul($32_1, $84_1, -997805, -1); + $3_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = __wasm_i64_mul($87_1, $27_1, 470296, 0); + $4_1 = $1_1 + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($61_1, $30_1, 654183, 0); + $3_1 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $8_1 = $3_1; + $6_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($57_1, $83_1, $54_1, $80_1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($55, $81_1, $56_1, $82_1); + $3_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $4_1 = $2_1; + $2_1 = (($124 & 31) << 27 | $123 >>> 5) & 2097151; + $1_1 = $2_1 + $1_1 | 0; + if ($1_1 >>> 0 < $2_1 >>> 0) { + $4_1 = $4_1 + 1 | 0; + } + $10_1 = $1_1; + $1_1 = $122 & 2097151; + $3_1 = __wasm_i64_mul($57_1, $83_1, $56_1, $82_1) + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $5_1 = $3_1; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $20_1 = $2_1; + $1_1 = $3_1; + $3_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $31_1 = $1_1 - -1048576 | 0; + $17_1 = $3_1; + $1_1 = $3_1 >>> 21 | 0; + $2_1 = ($3_1 & 2097151) << 11 | $31_1 >>> 21; + $3_1 = $2_1 + $10_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $12_1 = $1_1; + $1_1 = $3_1; + $4_1 = $12_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $28_1 = $1_1 - -1048576 | 0; + $11_1 = $4_1; + $1_1 = $4_1 >>> 21 | 0; + $4_1 = $7_1 + (($4_1 & 2097151) << 11 | $28_1 >>> 21) | 0; + $2_1 = $1_1 + $15_1 | 0; + $2_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = $4_1; + $1_1 = $18_1 & -2097152; + $4_1 = __wasm_i64_mul($32_1, $84_1, 654183, 0); + $10_1 = ($7_1 - $1_1 | 0) + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($2_1 - (($16_1 & 16383) + ($7_1 >>> 0 < $1_1 >>> 0) | 0) | 0) | 0; + $1_1 = $10_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($87_1, $27_1, 666643, 0); + $4_1 = $2_1 + $10_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $4_1; + $4_1 = __wasm_i64_mul($61_1, $30_1, 470296, 0); + $7_1 = $2_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $26_1 = $7_1; + $2_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $10_1 = $2_1; + $1_1 = $7_1; + $4_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $24_1 = $1_1 - -1048576 | 0; + $7_1 = $4_1; + $1_1 = $4_1 >> 21; + $4_1 = ($4_1 & 2097151) << 11 | $24_1 >>> 21; + $8_1 = $4_1 + $8_1 | 0; + $2_1 = $1_1 + $6_1 | 0; + $15_1 = $8_1; + $2_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $2_1; + $1_1 = $8_1; + $8_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $16_1 = $1_1 - -1048576 | 0; + $6_1 = $8_1; + $1_1 = $6_1 >> 21; + $8_1 = ($6_1 & 2097151) << 11 | $16_1 >>> 21; + $18_1 = $8_1 + $85_1 | 0; + $2_1 = $1_1 + $86_1 | 0; + $85_1 = $18_1; + $8_1 = $18_1 >>> 0 < $8_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($90, $21_1, -997805, -1); + $2_1 = $1_1 + $15_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS + $4_1 | 0; + $4_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = $16_1 & -2097152; + $86_1 = $2_1 - $1_1 | 0; + $18_1 = $4_1 - (($2_1 >>> 0 < $1_1 >>> 0) + $6_1 | 0) | 0; + $2_1 = __wasm_i64_mul($90, $21_1, 654183, 0); + $4_1 = $2_1 + $26_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $10_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $24_1 & -2097152; + $15_1 = $4_1 - $2_1 | 0; + $16_1 = $1_1 - (($4_1 >>> 0 < $2_1 >>> 0) + $7_1 | 0) | 0; + $1_1 = __wasm_i64_mul($32_1, $84_1, 470296, 0); + $2_1 = $28_1 & -2097152; + $4_1 = $1_1 + ($3_1 - $2_1 | 0) | 0; + $2_1 = i64toi32_i32$HIGH_BITS + ($12_1 - (($11_1 & 16383) + ($3_1 >>> 0 < $2_1 >>> 0) | 0) | 0) | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($61_1, $30_1, 666643, 0); + $4_1 = $3_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $6_1 = $4_1; + $4_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($32_1, $84_1, 666643, 0); + $1_1 = $31_1 & -2097152; + $3_1 = $2_1 + ($5_1 - $1_1 | 0) | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($20_1 - (($17_1 & 4095) + ($5_1 >>> 0 < $1_1 >>> 0) | 0) | 0) | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $10_1 = $1_1; + $1_1 = $3_1; + $5_1 = $10_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $17_1 = $1_1 - -1048576 | 0; + $7_1 = $5_1; + $2_1 = $5_1 >> 21; + $5_1 = ($5_1 & 2097151) << 11 | $17_1 >>> 21; + $6_1 = $5_1 + $6_1 | 0; + $1_1 = $2_1 + $4_1 | 0; + $12_1 = $6_1; + $1_1 = $6_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $6_1 = $1_1; + $1_1 = $12_1; + $4_1 = $6_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $11_1 = $1_1 - -1048576 | 0; + $5_1 = $4_1; + $2_1 = $4_1 >> 21; + $4_1 = ($4_1 & 2097151) << 11 | $11_1 >>> 21; + $20_1 = $4_1 + $15_1 | 0; + $1_1 = $2_1 + $16_1 | 0; + $1_1 = $20_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $1_1; + $1_1 = __wasm_i64_mul($90, $21_1, 470296, 0); + $12_1 = $1_1 + $12_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $6_1 | 0; + $2_1 = $12_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = $11_1 & -2097152; + $1_1 = $12_1 - $6_1 | 0; + $6_1 = $2_1 - (($12_1 >>> 0 < $6_1 >>> 0) + $5_1 | 0) | 0; + $11_1 = $1_1; + $2_1 = __wasm_i64_mul($90, $21_1, 666643, 0); + $1_1 = $17_1 & -2097152; + $5_1 = $2_1 + ($3_1 - $1_1 | 0) | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($10_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $7_1 | 0) | 0) | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $5_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $11_1 + $1_1 | 0; + $2_1 = $2_1 + $6_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $11_1 = $3_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $2_1 + $20_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $6_1 = $3_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $1_1 + $86_1 | 0; + $4_1 = $2_1 + $18_1 | 0; + $28_1 = $3_1; + $2_1 = $3_1; + $4_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = $4_1 >> 21; + $3_1 = ($4_1 & 2097151) << 11 | $2_1 >>> 21; + $4_1 = $3_1 + $85_1 | 0; + $2_1 = $1_1 + $8_1 | 0; + $26_1 = $4_1; + $1_1 = $4_1; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $1_1 >>> 21; + $3_1 = $2_1 + $107 | 0; + $1_1 = $4_1 + $88_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $24_1 = $3_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $1_1 + $106 | 0; + $2_1 = $2_1 + $14_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $15_1 = $3_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $2_1 + $58_1 | 0; + $1_1 = $1_1 + $29_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $16_1 = $3_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $1_1 + $62_1 | 0; + $4_1 = $2_1 + $19 | 0; + $14_1 = $3_1; + $2_1 = $3_1; + $4_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = $4_1 >> 21; + $3_1 = ($4_1 & 2097151) << 11 | $2_1 >>> 21; + $4_1 = $3_1 + $105 | 0; + $2_1 = $1_1 + $25_1 | 0; + $20_1 = $4_1; + $1_1 = $4_1; + $2_1 = $1_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $4_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $1_1 >>> 21; + $3_1 = $2_1 + $99 | 0; + $1_1 = $4_1 + $100 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $17_1 = $3_1; + $2_1 = $1_1 >> 21; + $4_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $1_1 = $22_1 & -2097152; + $3_1 = $9_1 - $1_1 | 0; + $4_1 = $4_1 + $3_1 | 0; + $1_1 = ($13_1 - (($9_1 >>> 0 < $1_1 >>> 0) + $23_1 | 0) | 0) + $2_1 | 0; + $12_1 = $4_1; + $2_1 = $4_1; + $1_1 = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $23_1 = ($1_1 & 2097151) << 11 | $2_1 >>> 21; + $4_1 = $1_1 >> 21; + $10_1 = $4_1; + $2_1 = $5_1 & 2097151; + $3_1 = __wasm_i64_mul($23_1, $4_1, 666643, 0) + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $3_1; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1; + HEAP82[$128 | 0] = $7_1; + HEAP82[$0 + 1 | 0] = ($1_1 & 255) << 24 | $7_1 >>> 8; + $5_1 = $0; + $1_1 = $11_1 & 2097151; + $4_1 = __wasm_i64_mul($23_1, $4_1, 470296, 0) + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $8_1 = $4_1; + $1_1 = $3_1; + $4_1 = $1_1 >> 21; + $9_1 = ($1_1 & 2097151) << 11 | $7_1 >>> 21; + $8_1 = $8_1 + $9_1 | 0; + $1_1 = $2_1 + $4_1 | 0; + $1_1 = $8_1 >>> 0 < $9_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $9_1 = $8_1; + $4_1 = $9_1; + HEAP82[$5_1 + 4 | 0] = ($1_1 & 2047) << 21 | $4_1 >>> 11; + $2_1 = $1_1; + HEAP82[$5_1 + 3 | 0] = ($1_1 & 7) << 29 | $4_1 >>> 3; + $4_1 = $6_1 & 2097151; + $6_1 = __wasm_i64_mul($23_1, $10_1, 654183, 0) + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS; + $1_1 = $6_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $6_1; + $6_1 = ($2_1 & 2097151) << 11 | $9_1 >>> 21; + $8_1 = $4_1 + $6_1 | 0; + $2_1 = ($2_1 >> 21) + $1_1 | 0; + $2_1 = $8_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = $8_1; + $1_1 = $2_1; + HEAP82[$5_1 + 6 | 0] = ($1_1 & 63) << 26 | $6_1 >>> 6; + $5_1 = 0; + $11_1 = $9_1 & 2097151; + $2_1 = $11_1; + HEAP82[$0 + 2 | 0] = (($3_1 & 65535) << 16 | $7_1 >>> 16) & 31 | $2_1 << 5; + $4_1 = $0; + $3_1 = $28_1 & 2097151; + $9_1 = __wasm_i64_mul($23_1, $10_1, -997805, -1) + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $9_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $9_1; + $9_1 = ($1_1 & 2097151) << 11 | $6_1 >>> 21; + $7_1 = $3_1 + $9_1 | 0; + $1_1 = ($1_1 >> 21) + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $9_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $7_1; + HEAP82[$4_1 + 9 | 0] = ($1_1 & 511) << 23 | $3_1 >>> 9; + $2_1 = $1_1; + HEAP82[$4_1 + 8 | 0] = ($1_1 & 1) << 31 | $3_1 >>> 1; + $9_1 = 0; + $8_1 = $6_1 & 2097151; + $3_1 = $8_1; + HEAP82[$4_1 + 5 | 0] = ($5_1 & 524287) << 13 | $11_1 >>> 19 | $3_1 << 2; + $5_1 = $4_1; + $1_1 = $26_1 & 2097151; + $3_1 = __wasm_i64_mul($23_1, $10_1, 136657, 0) + $1_1 | 0; + $4_1 = i64toi32_i32$HIGH_BITS; + $4_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $4_1 + 1 | 0 : $4_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $7_1 >>> 21; + $3_1 = $2_1 + $3_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $6_1 = $3_1; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $3_1; + HEAP82[$5_1 + 12 | 0] = ($1_1 & 4095) << 20 | $2_1 >>> 12; + $3_1 = $1_1; + HEAP82[$5_1 + 11 | 0] = ($1_1 & 15) << 28 | $2_1 >>> 4; + $5_1 = 0; + $7_1 = $7_1 & 2097151; + $2_1 = $7_1; + HEAP82[$0 + 7 | 0] = ($9_1 & 16383) << 18 | $8_1 >>> 14 | $2_1 << 7; + $4_1 = $0; + $1_1 = $24_1 & 2097151; + $9_1 = __wasm_i64_mul($23_1, $10_1, -683901, -1) + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $6_1 >>> 21; + $9_1 = $3_1 + $9_1 | 0; + $2_1 = $1_1 + $2_1 | 0; + $2_1 = $9_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $2_1; + HEAP82[$4_1 + 14 | 0] = ($1_1 & 127) << 25 | $9_1 >>> 7; + $4_1 = 0; + $10_1 = $6_1 & 2097151; + $3_1 = $10_1; + HEAP82[$0 + 10 | 0] = ($5_1 & 131071) << 15 | $7_1 >>> 17 | $3_1 << 4; + $5_1 = ($1_1 & 2097151) << 11 | $9_1 >>> 21; + $7_1 = $5_1 + ($15_1 & 2097151) | 0; + $1_1 = $1_1 >> 21; + $1_1 = $7_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $7_1; + HEAP82[$0 + 17 | 0] = ($1_1 & 1023) << 22 | $3_1 >>> 10; + $2_1 = $1_1; + HEAP82[$0 + 16 | 0] = ($1_1 & 3) << 30 | $3_1 >>> 2; + $3_1 = 0; + $8_1 = $9_1 & 2097151; + $5_1 = $8_1; + HEAP82[$0 + 13 | 0] = ($4_1 & 1048575) << 12 | $10_1 >>> 20 | $5_1 << 1; + $1_1 = $0; + $4_1 = $2_1; + $2_1 = $2_1 >> 21; + $5_1 = ($4_1 & 2097151) << 11 | $7_1 >>> 21; + $6_1 = $5_1 + ($16_1 & 2097151) | 0; + $4_1 = $6_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + HEAP82[$1_1 + 20 | 0] = ($4_1 & 8191) << 19 | $6_1 >>> 13; + $5_1 = $4_1; + HEAP82[$1_1 + 19 | 0] = ($4_1 & 31) << 27 | $6_1 >>> 5; + $9_1 = 0; + $10_1 = $7_1 & 2097151; + $2_1 = $10_1; + HEAP82[$1_1 + 15 | 0] = ($3_1 & 32767) << 17 | $8_1 >>> 15 | $2_1 << 6; + $4_1 = $1_1; + $1_1 = $5_1; + $2_1 = $1_1 >> 21; + $3_1 = ($1_1 & 2097151) << 11 | $6_1 >>> 21; + $8_1 = $3_1 + ($14_1 & 2097151) | 0; + $1_1 = $2_1; + $1_1 = $8_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1; + HEAP82[$4_1 + 21 | 0] = $8_1; + $1_1 = $6_1; + HEAP82[$4_1 + 18 | 0] = ($9_1 & 262143) << 14 | $10_1 >>> 18 | $1_1 << 3; + $1_1 = $3_1; + HEAP82[$4_1 + 22 | 0] = ($1_1 & 255) << 24 | $8_1 >>> 8; + $2_1 = $1_1; + $1_1 = $1_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $8_1 >>> 21; + $5_1 = $2_1 + ($20_1 & 2097151) | 0; + $6_1 = $5_1; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $5_1; + HEAP82[$0 + 25 | 0] = ($1_1 & 2047) << 21 | $4_1 >>> 11; + HEAP82[$0 + 24 | 0] = ($1_1 & 7) << 29 | $4_1 >>> 3; + $5_1 = $0; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $4_1 >>> 21; + $7_1 = $1_1 + ($17_1 & 2097151) | 0; + $9_1 = $7_1; + $4_1 = $7_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + HEAP82[$5_1 + 27 | 0] = ($1_1 & 63) << 26 | $7_1 >>> 6; + $4_1 = 0; + $7_1 = $6_1 & 2097151; + $2_1 = $7_1; + HEAP82[$5_1 + 23 | 0] = (($3_1 & 65535) << 16 | $8_1 >>> 16) & 31 | $2_1 << 5; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $9_1 >>> 21; + $5_1 = $1_1 + ($12_1 & 2097151) | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $5_1; + HEAP82[$0 + 31 | 0] = ($2_1 & 131071) << 15 | $3_1 >>> 17; + $1_1 = $2_1; + HEAP82[$0 + 30 | 0] = ($1_1 & 511) << 23 | $3_1 >>> 9; + HEAP82[$0 + 29 | 0] = ($1_1 & 1) << 31 | $3_1 >>> 1; + $2_1 = 0; + $9_1 = $9_1 & 2097151; + $6_1 = $9_1; + HEAP82[$0 + 26 | 0] = ($4_1 & 524287) << 13 | $7_1 >>> 19 | $6_1 << 2; + HEAP82[$0 + 28 | 0] = ($2_1 & 16383) << 18 | $6_1 >>> 14 | $3_1 << 7; + } + function $69($0) { + var $1_1 = 0, $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0, $25_1 = 0, $26_1 = 0, $27_1 = 0, $28_1 = 0, $29_1 = 0, $30_1 = 0, $31_1 = 0, $32_1 = 0, $33_1 = 0, $34_1 = 0, $35_1 = 0, $36_1 = 0, $37_1 = 0, $38_1 = 0, $39_1 = 0, $40_1 = 0, $41_1 = 0, $42_1 = 0, $43_1 = 0, $44_1 = 0, $45_1 = 0, $46_1 = 0, $47_1 = 0, $48_1 = 0, $49_1 = 0, $50_1 = 0, $51_1 = 0, $52_1 = 0, $53 = 0, $54_1 = 0, $55 = 0, $56_1 = 0, $57_1 = 0, $58_1 = 0, $59_1 = 0, $60 = 0, $61_1 = 0, $62_1 = 0, $63 = 0, $64_1 = 0, $65_1 = 0, $66_1 = 0, $67_1 = 0, $68_1 = 0, $69_1 = 0; + $59_1 = $34($0); + $60 = $33($0 + 2 | 0); + $61_1 = i64toi32_i32$HIGH_BITS; + $62_1 = $34($0 + 5 | 0); + $63 = i64toi32_i32$HIGH_BITS; + $64_1 = $33($0 + 7 | 0); + $52_1 = i64toi32_i32$HIGH_BITS; + $65_1 = $33($0 + 10 | 0); + $53 = i64toi32_i32$HIGH_BITS; + $66_1 = $34($0 + 13 | 0); + $54_1 = i64toi32_i32$HIGH_BITS; + $67_1 = $33($0 + 15 | 0); + $19 = i64toi32_i32$HIGH_BITS; + $28_1 = $34($0 + 18 | 0); + $20_1 = i64toi32_i32$HIGH_BITS; + $42_1 = $34($0 + 21 | 0); + $23_1 = $33($0 + 23 | 0); + $13_1 = i64toi32_i32$HIGH_BITS; + $29_1 = $34($0 + 26 | 0); + $8_1 = i64toi32_i32$HIGH_BITS; + $68_1 = $33($0 + 28 | 0); + $43_1 = i64toi32_i32$HIGH_BITS; + $32_1 = $33($0 + 31 | 0); + $24_1 = i64toi32_i32$HIGH_BITS; + $30_1 = $34($0 + 34 | 0); + $27_1 = i64toi32_i32$HIGH_BITS; + $33_1 = $33($0 + 36 | 0); + $12_1 = i64toi32_i32$HIGH_BITS; + $34_1 = $34($0 + 39 | 0); + $15_1 = i64toi32_i32$HIGH_BITS; + $3_1 = $34($0 + 42 | 0); + $2_1 = $33($0 + 44 | 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $35_1 = $34($0 + 47 | 0); + $10_1 = i64toi32_i32$HIGH_BITS; + $31_1 = $33($0 + 49 | 0); + $9_1 = i64toi32_i32$HIGH_BITS; + $25_1 = $33($0 + 52 | 0); + $4_1 = i64toi32_i32$HIGH_BITS; + $17_1 = $34($0 + 55 | 0); + $7_1 = i64toi32_i32$HIGH_BITS; + $16_1 = $33($0 + 57 | 0); + $5_1 = i64toi32_i32$HIGH_BITS; + $69_1 = $0; + $14_1 = (($1_1 & 31) << 27 | $2_1 >>> 5) & 2097151; + $2_1 = $33($0 + 60 | 0); + $6_1 = i64toi32_i32$HIGH_BITS; + $1_1 = $6_1 >>> 3 | 0; + $36_1 = ($6_1 & 7) << 29 | $2_1 >>> 3; + $44_1 = $1_1; + $2_1 = __wasm_i64_mul($36_1, $1_1, -683901, -1); + $1_1 = $3_1 & 2097151; + $3_1 = $2_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $6_1 = $3_1; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $22_1 = $2_1; + $1_1 = $3_1; + $3_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $21_1 = $1_1 - -1048576 | 0; + $11_1 = $3_1; + $1_1 = ($3_1 & 2097151) << 11 | $21_1 >>> 21; + $14_1 = $1_1 + $14_1 | 0; + $3_1 = ($3_1 >> 21) + $18_1 | 0; + $45_1 = $14_1; + $3_1 = $14_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $46_1 = $3_1; + $14_1 = __wasm_i64_mul($14_1, $3_1, -683901, -1); + $18_1 = i64toi32_i32$HIGH_BITS; + $37_1 = (($10_1 & 3) << 30 | $35_1 >>> 2) & 2097151; + $2_1 = __wasm_i64_mul($37_1, 0, 136657, 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($8_1 & 3) << 30 | $29_1 >>> 2) & 2097151; + $2_1 = $3_1 + $2_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = $2_1; + $2_1 = $1_1; + $38_1 = (($9_1 & 127) << 25 | $31_1 >>> 7) & 2097151; + $1_1 = __wasm_i64_mul($38_1, 0, -997805, -1); + $3_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $39_1 = (($4_1 & 15) << 28 | $25_1 >>> 4) & 2097151; + $1_1 = __wasm_i64_mul($39_1, 0, 654183, 0); + $3_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $40_1 = (($7_1 & 1) << 31 | $17_1 >>> 1) & 2097151; + $3_1 = __wasm_i64_mul($40_1, 0, 470296, 0); + $7_1 = $1_1 + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $7_1; + $2_1 = $1_1; + $41_1 = (($5_1 & 63) << 26 | $16_1 >>> 6) & 2097151; + $1_1 = __wasm_i64_mul($41_1, 0, 666643, 0); + $3_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $5_1 = $3_1; + $7_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = $7_1 + $18_1 | 0; + $1_1 = $3_1; + $3_1 = $1_1 + $14_1 | 0; + if ($3_1 >>> 0 < $1_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $25_1 = $3_1; + $10_1 = $2_1; + $2_1 = __wasm_i64_mul($37_1, $48_1, -997805, -1); + $1_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($13_1 & 31) << 27 | $23_1 >>> 5) & 2097151; + $2_1 = $3_1 + $2_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = $2_1; + $2_1 = __wasm_i64_mul($38_1, $49_1, 654183, 0); + $4_1 = $3_1 + $2_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $3_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = __wasm_i64_mul($39_1, $50_1, 470296, 0); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($40_1, $51_1, 666643, 0); + $4_1 = $3_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $9_1 = $4_1; + $3_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = $42_1 & 2097151; + $4_1 = __wasm_i64_mul($37_1, $48_1, 654183, 0) + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $4_1; + $4_1 = __wasm_i64_mul($38_1, $49_1, 470296, 0); + $8_1 = $1_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = __wasm_i64_mul($39_1, $50_1, 666643, 0); + $8_1 = $4_1 + $8_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $8_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $16_1 = $2_1; + $1_1 = $8_1; + $4_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $29_1 = $1_1 - -1048576 | 0; + $18_1 = $4_1; + $1_1 = $4_1 >>> 21 | 0; + $2_1 = ($4_1 & 2097151) << 11 | $29_1 >>> 21; + $4_1 = $2_1 + $9_1 | 0; + $3_1 = $1_1 + $3_1 | 0; + $3_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = $3_1; + $1_1 = $4_1; + $17_1 = $3_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $14_1 = $1_1 - -1048576 | 0; + $57_1 = $5_1 - -1048576 | 0; + $13_1 = $7_1 - (($5_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $7_1 = $13_1; + $3_1 = $17_1; + $1_1 = $3_1 >> 21; + $5_1 = ($3_1 & 2097151) << 11 | $14_1 >>> 21; + $17_1 = $5_1 + $25_1 | 0; + $2_1 = $1_1 + $10_1 | 0; + $2_1 = $17_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $5_1 = $17_1; + $1_1 = $57_1 & -2097152; + $13_1 = $2_1 - (($5_1 >>> 0 < $1_1 >>> 0) + $7_1 | 0) | 0; + $1_1 = $5_1 - $1_1 | 0; + $58_1 = $1_1 - -1048576 | 0; + $5_1 = $13_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $2_1 = $58_1 & -2097152; + $55 = $1_1 - $2_1 | 0; + $56_1 = $13_1 - (($1_1 >>> 0 < $2_1 >>> 0) + $5_1 | 0) | 0; + $2_1 = __wasm_i64_mul($45_1, $46_1, 136657, 0) + $4_1 | 0; + $1_1 = $9_1 + i64toi32_i32$HIGH_BITS | 0; + $1_1 = $2_1 >>> 0 < $4_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $4_1 = $2_1; + $2_1 = $14_1 & -2097152; + $31_1 = $4_1 - $2_1 | 0; + $25_1 = $1_1 - (($4_1 >>> 0 < $2_1 >>> 0) + $3_1 | 0) | 0; + $1_1 = $21_1 & -2097152; + $13_1 = $6_1 - $1_1 | 0; + $9_1 = $22_1 - (($6_1 >>> 0 < $1_1 >>> 0) + $11_1 | 0) | 0; + $1_1 = __wasm_i64_mul($36_1, $44_1, 136657, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($15_1 & 7) << 29 | $34_1 >>> 3) & 2097151; + $1_1 = $3_1 + $1_1 | 0; + if ($1_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($41_1, $26_1, -683901, -1); + $4_1 = $3_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $6_1 = $4_1; + $4_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($40_1, $51_1, -683901, -1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($12_1 & 63) << 26 | $33_1 >>> 6) & 2097151; + $1_1 = $3_1 + $1_1 | 0; + if ($1_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($36_1, $44_1, -997805, -1); + $10_1 = $3_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $10_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = __wasm_i64_mul($41_1, $26_1, 136657, 0); + $10_1 = $2_1 + $10_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $10_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $21_1 = $1_1; + $1_1 = $10_1; + $2_1 = $21_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $35_1 = $1_1 - -1048576 | 0; + $14_1 = $2_1; + $1_1 = ($2_1 & 2097151) << 11 | $35_1 >>> 21; + $6_1 = $1_1 + $6_1 | 0; + $2_1 = ($2_1 >> 21) + $4_1 | 0; + $4_1 = $6_1; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $15_1 = $2_1; + $1_1 = $4_1; + $2_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $17_1 = $1_1 - -1048576 | 0; + $22_1 = $2_1; + $3_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $17_1 >>> 21; + $6_1 = $2_1 + $13_1 | 0; + $1_1 = $3_1 + $9_1 | 0; + $47_1 = $6_1; + $1_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $23_1 = $1_1; + $2_1 = __wasm_i64_mul($6_1, $1_1, -683901, -1); + $3_1 = $2_1 + $31_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $25_1 | 0; + $42_1 = $3_1; + $11_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($37_1, $48_1, 470296, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($20_1 & 7) << 29 | $28_1 >>> 3) & 2097151; + $1_1 = $3_1 + $1_1 | 0; + if ($1_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($38_1, $49_1, 666643, 0); + $3_1 = $3_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $12_1 = $3_1; + $3_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $2_1 = __wasm_i64_mul($37_1, $48_1, 666643, 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $6_1 = (($19 & 63) << 26 | $67_1 >>> 6) & 2097151; + $2_1 = $6_1 + $2_1 | 0; + if ($2_1 >>> 0 < $6_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $9_1 = $2_1; + $19 = $1_1; + $1_1 = $2_1; + $6_1 = $19 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $31_1 = $1_1 - -1048576 | 0; + $20_1 = $6_1; + $2_1 = $6_1 >>> 21 | 0; + $1_1 = ($6_1 & 2097151) << 11 | $31_1 >>> 21; + $6_1 = $1_1 + $12_1 | 0; + $2_1 = $2_1 + $3_1 | 0; + $2_1 = $6_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $13_1 = $2_1; + $1_1 = $6_1; + $34_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $25_1 = $1_1 - -1048576 | 0; + $1_1 = $17_1 & -2097152; + $3_1 = $15_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $22_1 | 0) | 0; + $28_1 = $4_1 - $1_1 | 0; + $33_1 = $3_1; + $12_1 = $34_1; + $4_1 = $8_1 + (($12_1 & 2097151) << 11 | $25_1 >>> 21) | 0; + $1_1 = $16_1 + ($12_1 >>> 21 | 0) | 0; + $1_1 = $4_1 >>> 0 < $8_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $8_1 = $4_1; + $2_1 = $29_1 & -2097152; + $4_1 = __wasm_i64_mul($45_1, $46_1, -997805, -1); + $22_1 = ($8_1 - $2_1 | 0) + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + ($1_1 - (($18_1 & 8191) + ($8_1 >>> 0 < $2_1 >>> 0) | 0) | 0) | 0; + $2_1 = $22_1 >>> 0 < $4_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($47_1, $23_1, 136657, 0); + $4_1 = $1_1 + $22_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($28_1, $3_1, -683901, -1); + $4_1 = $3_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $15_1 = $1_1; + $1_1 = $4_1; + $3_1 = $15_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $17_1 = $1_1 - -1048576 | 0; + $22_1 = $3_1; + $1_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $17_1 >>> 21; + $8_1 = $3_1 + $42_1 | 0; + $2_1 = $1_1 + $11_1 | 0; + $2_1 = $8_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $8_1; + $11_1 = $2_1; + $1_1 = $3_1; + $18_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $16_1 = $1_1 - -1048576 | 0; + $8_1 = $18_1; + $1_1 = $8_1 >> 21; + $2_1 = ($8_1 & 2097151) << 11 | $16_1 >>> 21; + $18_1 = $2_1 + $55 | 0; + $1_1 = $1_1 + $56_1 | 0; + $55 = $18_1; + $18_1 = $18_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = $16_1 & -2097152; + $56_1 = $3_1 - $1_1 | 0; + $42_1 = $11_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $8_1 | 0) | 0; + $1_1 = $17_1 & -2097152; + $34_1 = $4_1 - $1_1 | 0; + $29_1 = $15_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $22_1 | 0) | 0; + $1_1 = __wasm_i64_mul($45_1, $46_1, 654183, 0); + $2_1 = $25_1 & -2097152; + $4_1 = $1_1 + ($6_1 - $2_1 | 0) | 0; + $3_1 = i64toi32_i32$HIGH_BITS + ($13_1 - (($12_1 & 8191) + ($6_1 >>> 0 < $2_1 >>> 0) | 0) | 0) | 0; + $3_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = __wasm_i64_mul($47_1, $23_1, -997805, -1); + $4_1 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($28_1, $33_1, 136657, 0); + $4_1 = $3_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $17_1 = $4_1; + $12_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $35_1 & -2097152; + $16_1 = $10_1 - $1_1 | 0; + $21_1 = $21_1 - (($10_1 >>> 0 < $1_1 >>> 0) + $14_1 | 0) | 0; + $2_1 = __wasm_i64_mul($39_1, $50_1, -683901, -1); + $1_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($27_1 & 1) << 31 | $30_1 >>> 1) & 2097151; + $2_1 = $3_1 + $2_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = $2_1; + $2_1 = __wasm_i64_mul($40_1, $51_1, 136657, 0); + $3_1 = $3_1 + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $3_1; + $3_1 = __wasm_i64_mul($36_1, $44_1, 654183, 0); + $4_1 = $2_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($41_1, $26_1, -997805, -1); + $3_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $10_1 = $3_1; + $4_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($38_1, $49_1, -683901, -1); + $3_1 = i64toi32_i32$HIGH_BITS; + $2_1 = (($24_1 & 15) << 28 | $32_1 >>> 4) & 2097151; + $1_1 = $2_1 + $1_1 | 0; + if ($1_1 >>> 0 < $2_1 >>> 0) { + $3_1 = $3_1 + 1 | 0; + } + $2_1 = __wasm_i64_mul($39_1, $50_1, 136657, 0); + $6_1 = $2_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($40_1, $51_1, -997805, -1); + $6_1 = $3_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($36_1, $44_1, 470296, 0); + $6_1 = $3_1 + $6_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($41_1, $26_1, 654183, 0); + $6_1 = $3_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $15_1 = $2_1; + $1_1 = $6_1; + $3_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $14_1 = $1_1 - -1048576 | 0; + $22_1 = $3_1; + $1_1 = $3_1 >> 21; + $2_1 = ($3_1 & 2097151) << 11 | $14_1 >>> 21; + $3_1 = $2_1 + $10_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $4_1 = $3_1; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $11_1 = $1_1; + $1_1 = $3_1; + $3_1 = $11_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $13_1 = $1_1 - -1048576 | 0; + $8_1 = $3_1; + $1_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $13_1 >>> 21; + $10_1 = $3_1 + $16_1 | 0; + $2_1 = $1_1 + $21_1 | 0; + $32_1 = $10_1; + $2_1 = $10_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $24_1 = $2_1; + $1_1 = __wasm_i64_mul($10_1, $2_1, -683901, -1); + $2_1 = $1_1 + $17_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $12_1 | 0; + $12_1 = $2_1; + $10_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = $13_1 & -2097152; + $8_1 = $11_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $8_1 | 0) | 0; + $30_1 = $4_1 - $1_1 | 0; + $27_1 = $8_1; + $1_1 = __wasm_i64_mul($45_1, $46_1, 470296, 0); + $2_1 = $31_1 & -2097152; + $3_1 = $1_1 + ($9_1 - $2_1 | 0) | 0; + $2_1 = i64toi32_i32$HIGH_BITS + ($19 - (($20_1 & 2047) + ($9_1 >>> 0 < $2_1 >>> 0) | 0) | 0) | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($47_1, $23_1, 654183, 0); + $3_1 = $1_1 + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($28_1, $33_1, -997805, -1); + $4_1 = $1_1 + $3_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = __wasm_i64_mul($32_1, $24_1, 136657, 0); + $4_1 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($30_1, $8_1, -683901, -1); + $4_1 = $3_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $11_1 = $2_1; + $1_1 = $4_1; + $3_1 = $2_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $20_1 = $1_1 - -1048576 | 0; + $8_1 = $3_1; + $1_1 = $3_1 >> 21; + $2_1 = ($3_1 & 2097151) << 11 | $20_1 >>> 21; + $3_1 = $2_1 + $12_1 | 0; + $1_1 = $1_1 + $10_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $10_1 = $1_1; + $1_1 = $3_1; + $13_1 = $10_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $12_1 = $1_1 - -1048576 | 0; + $9_1 = $13_1; + $1_1 = $9_1 >> 21; + $13_1 = ($9_1 & 2097151) << 11 | $12_1 >>> 21; + $19 = $13_1 + $34_1 | 0; + $2_1 = $1_1 + $29_1 | 0; + $34_1 = $19; + $13_1 = $19 >>> 0 < $13_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $12_1 & -2097152; + $29_1 = $3_1 - $1_1 | 0; + $35_1 = $10_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $9_1 | 0) | 0; + $1_1 = $20_1 & -2097152; + $17_1 = $4_1 - $1_1 | 0; + $21_1 = $11_1 - (($4_1 >>> 0 < $1_1 >>> 0) + $8_1 | 0) | 0; + $2_1 = __wasm_i64_mul($45_1, $46_1, 666643, 0); + $1_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($54_1 & 1) << 31 | $66_1 >>> 1) & 2097151; + $2_1 = $3_1 + $2_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $1_1 = $1_1 + 1 | 0; + } + $3_1 = __wasm_i64_mul($47_1, $23_1, 470296, 0); + $4_1 = $3_1 + $2_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($28_1, $33_1, 654183, 0); + $4_1 = $3_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($32_1, $24_1, -997805, -1); + $4_1 = $2_1 + $4_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $3_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = __wasm_i64_mul($30_1, $27_1, 136657, 0); + $4_1 = $1_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $8_1 = $4_1; + $9_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $14_1 & -2097152; + $10_1 = $6_1 - $1_1 | 0; + $6_1 = $15_1 - (($6_1 >>> 0 < $1_1 >>> 0) + $22_1 | 0) | 0; + $1_1 = __wasm_i64_mul($37_1, $48_1, -683901, -1); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($43_1 & 127) << 25 | $68_1 >>> 7) & 2097151; + $1_1 = $3_1 + $1_1 | 0; + if ($1_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($38_1, $49_1, 136657, 0); + $4_1 = $3_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = __wasm_i64_mul($39_1, $50_1, -997805, -1); + $4_1 = $2_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($40_1, $51_1, 654183, 0); + $4_1 = $3_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = __wasm_i64_mul($36_1, $44_1, 666643, 0); + $4_1 = $3_1 + $4_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($41_1, $26_1, 470296, 0); + $4_1 = $3_1 + $4_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $4_1; + $1_1 = $2_1; + $2_1 = $7_1 >> 21; + $7_1 = ($7_1 & 2097151) << 11 | $57_1 >>> 21; + $4_1 = $7_1 + $3_1 | 0; + $3_1 = $1_1 + $2_1 | 0; + $3_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $22_1 = $3_1; + $1_1 = $4_1; + $3_1 = $3_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $15_1 = $1_1 - -1048576 | 0; + $11_1 = $3_1; + $2_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $15_1 >>> 21; + $7_1 = $3_1 + $10_1 | 0; + $1_1 = $2_1 + $6_1 | 0; + $26_1 = $7_1; + $1_1 = $7_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $16_1 = $1_1; + $1_1 = __wasm_i64_mul($7_1, $1_1, -683901, -1); + $3_1 = $1_1 + $8_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $9_1 | 0; + $9_1 = $3_1; + $7_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($47_1, $23_1, 666643, 0); + $3_1 = i64toi32_i32$HIGH_BITS; + $2_1 = (($53 & 15) << 28 | $65_1 >>> 4) & 2097151; + $1_1 = $2_1 + $1_1 | 0; + if ($1_1 >>> 0 < $2_1 >>> 0) { + $3_1 = $3_1 + 1 | 0; + } + $2_1 = __wasm_i64_mul($28_1, $33_1, 470296, 0); + $6_1 = $2_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $6_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = __wasm_i64_mul($32_1, $24_1, 654183, 0); + $6_1 = $3_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $2_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = __wasm_i64_mul($30_1, $27_1, -997805, -1); + $3_1 = $1_1 + $6_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1; + $3_1 = __wasm_i64_mul($26_1, $16_1, 136657, 0); + $6_1 = $1_1 + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $8_1 = $1_1; + $1_1 = $6_1; + $3_1 = $8_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $19 = $1_1 - -1048576 | 0; + $10_1 = $3_1; + $2_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $19 >>> 21; + $9_1 = $3_1 + $9_1 | 0; + $1_1 = $2_1 + $7_1 | 0; + $7_1 = $9_1; + $1_1 = $7_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1; + $1_1 = $7_1; + $12_1 = $3_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $20_1 = $1_1 - -1048576 | 0; + $9_1 = $12_1; + $2_1 = $9_1 >> 21; + $12_1 = ($9_1 & 2097151) << 11 | $20_1 >>> 21; + $14_1 = $12_1 + $17_1 | 0; + $1_1 = $2_1 + $21_1 | 0; + $31_1 = $14_1; + $12_1 = $14_1 >>> 0 < $12_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $15_1 & -2097152; + $1_1 = $4_1 - $2_1 | 0; + $4_1 = $22_1 - (($4_1 >>> 0 < $2_1 >>> 0) + $11_1 | 0) | 0; + $11_1 = $1_1; + $1_1 = $5_1 >> 21; + $2_1 = ($5_1 & 2097151) << 11 | $58_1 >>> 21; + $5_1 = $11_1 + $2_1 | 0; + $1_1 = $1_1 + $4_1 | 0; + $4_1 = $5_1; + $1_1 = $4_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $15_1 = $1_1; + $1_1 = $4_1; + $5_1 = $15_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $14_1 = $1_1 - -1048576 | 0; + $22_1 = $5_1; + $1_1 = $5_1 >> 21; + $21_1 = $1_1; + $23_1 = ($5_1 & 2097151) << 11 | $14_1 >>> 21; + $1_1 = __wasm_i64_mul($23_1, $1_1, -683901, -1); + $5_1 = $1_1 + $7_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $5_1; + $1_1 = $20_1 & -2097152; + $25_1 = $3_1 - $1_1 | 0; + $17_1 = $2_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $9_1 | 0) | 0; + $2_1 = __wasm_i64_mul($23_1, $21_1, 136657, 0) + $6_1 | 0; + $1_1 = $8_1 + i64toi32_i32$HIGH_BITS | 0; + $1_1 = $2_1 >>> 0 < $6_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $2_1; + $2_1 = $19 & -2097152; + $43_1 = $3_1 - $2_1 | 0; + $19 = $1_1 - (($3_1 >>> 0 < $2_1 >>> 0) + $10_1 | 0) | 0; + $1_1 = __wasm_i64_mul($28_1, $33_1, 666643, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $3_1 = (($52_1 & 127) << 25 | $64_1 >>> 7) & 2097151; + $1_1 = $3_1 + $1_1 | 0; + if ($1_1 >>> 0 < $3_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($32_1, $24_1, 470296, 0); + $5_1 = $3_1 + $1_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $3_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = __wasm_i64_mul($30_1, $27_1, 654183, 0); + $5_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = __wasm_i64_mul($26_1, $16_1, -997805, -1); + $3_1 = $2_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $1_1 | 0; + $10_1 = $3_1; + $3_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($32_1, $24_1, 666643, 0); + $2_1 = i64toi32_i32$HIGH_BITS; + $5_1 = (($63 & 3) << 30 | $62_1 >>> 2) & 2097151; + $1_1 = $5_1 + $1_1 | 0; + if ($1_1 >>> 0 < $5_1 >>> 0) { + $2_1 = $2_1 + 1 | 0; + } + $5_1 = $1_1; + $1_1 = __wasm_i64_mul($30_1, $27_1, 470296, 0); + $5_1 = $5_1 + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $5_1; + $5_1 = __wasm_i64_mul($26_1, $16_1, 654183, 0); + $7_1 = $1_1 + $5_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $2_1 | 0; + $1_1 = $7_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = $7_1; + $9_1 = $1_1; + $1_1 = $5_1; + $7_1 = $9_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $20_1 = $1_1 - -1048576 | 0; + $6_1 = $7_1; + $2_1 = $6_1 >> 21; + $7_1 = ($6_1 & 2097151) << 11 | $20_1 >>> 21; + $10_1 = $7_1 + $10_1 | 0; + $1_1 = $2_1 + $3_1 | 0; + $8_1 = $10_1; + $1_1 = $8_1 >>> 0 < $7_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1; + $1_1 = $8_1; + $11_1 = $3_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $10_1 = $1_1 - -1048576 | 0; + $7_1 = $11_1; + $2_1 = $7_1 >> 21; + $11_1 = ($7_1 & 2097151) << 11 | $10_1 >>> 21; + $24_1 = $11_1 + $43_1 | 0; + $1_1 = $2_1 + $19 | 0; + $52_1 = $24_1; + $11_1 = $24_1 >>> 0 < $11_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $1_1 = __wasm_i64_mul($23_1, $21_1, -997805, -1); + $2_1 = $1_1 + $8_1 | 0; + $3_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $3_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $1_1 = $10_1 & -2097152; + $53 = $2_1 - $1_1 | 0; + $54_1 = $3_1 - (($2_1 >>> 0 < $1_1 >>> 0) + $7_1 | 0) | 0; + $1_1 = __wasm_i64_mul($23_1, $21_1, 654183, 0) + $5_1 | 0; + $2_1 = $9_1 + i64toi32_i32$HIGH_BITS | 0; + $2_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $1_1; + $1_1 = $20_1 & -2097152; + $43_1 = $3_1 - $1_1 | 0; + $24_1 = $2_1 - (($3_1 >>> 0 < $1_1 >>> 0) + $6_1 | 0) | 0; + $1_1 = __wasm_i64_mul($30_1, $27_1, 666643, 0); + $3_1 = i64toi32_i32$HIGH_BITS; + $2_1 = (($61_1 & 31) << 27 | $60 >>> 5) & 2097151; + $1_1 = $2_1 + $1_1 | 0; + if ($1_1 >>> 0 < $2_1 >>> 0) { + $3_1 = $3_1 + 1 | 0; + } + $2_1 = __wasm_i64_mul($26_1, $16_1, 470296, 0); + $5_1 = $2_1 + $1_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS + $3_1 | 0; + $6_1 = $5_1; + $3_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $59_1 & 2097151; + $5_1 = __wasm_i64_mul($26_1, $16_1, 666643, 0) + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $5_1; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $8_1 = $1_1; + $1_1 = $5_1; + $5_1 = $8_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $19 = $1_1 - -1048576 | 0; + $10_1 = $5_1; + $2_1 = $5_1 >> 21; + $1_1 = ($5_1 & 2097151) << 11 | $19 >>> 21; + $5_1 = $1_1 + $6_1 | 0; + $3_1 = $2_1 + $3_1 | 0; + $3_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $9_1 = $3_1; + $1_1 = $5_1; + $3_1 = $3_1 - (($1_1 >>> 0 < 4293918720) + -1 | 0) | 0; + $20_1 = $1_1 - -1048576 | 0; + $6_1 = $3_1; + $2_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $20_1 >>> 21; + $16_1 = $3_1 + $43_1 | 0; + $1_1 = $2_1 + $24_1 | 0; + $1_1 = $16_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1; + $1_1 = __wasm_i64_mul($23_1, $21_1, 470296, 0) + $5_1 | 0; + $2_1 = $9_1 + i64toi32_i32$HIGH_BITS | 0; + $2_1 = $1_1 >>> 0 < $5_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $9_1 = $1_1; + $5_1 = $20_1 & -2097152; + $1_1 = $1_1 - $5_1 | 0; + $6_1 = $2_1 - (($9_1 >>> 0 < $5_1 >>> 0) + $6_1 | 0) | 0; + $9_1 = $1_1; + $2_1 = __wasm_i64_mul($23_1, $21_1, 666643, 0); + $1_1 = $19 & -2097152; + $5_1 = $2_1 + ($7_1 - $1_1 | 0) | 0; + $1_1 = i64toi32_i32$HIGH_BITS + ($8_1 - (($7_1 >>> 0 < $1_1 >>> 0) + $10_1 | 0) | 0) | 0; + $1_1 = $5_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $7_1 = $5_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $5_1 >>> 21; + $5_1 = $9_1 + $1_1 | 0; + $2_1 = $2_1 + $6_1 | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $27_1 = $5_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $5_1 >>> 21; + $5_1 = $2_1 + $16_1 | 0; + $3_1 = $1_1 + $3_1 | 0; + $6_1 = $5_1; + $1_1 = $5_1; + $3_1 = $1_1 >>> 0 < $2_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $1_1 >>> 21; + $5_1 = $3_1 + $53 | 0; + $1_1 = $2_1 + $54_1 | 0; + $10_1 = $5_1; + $2_1 = $5_1; + $1_1 = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $2_1 >>> 21; + $5_1 = $1_1 + $52_1 | 0; + $2_1 = $3_1 + $11_1 | 0; + $11_1 = $5_1; + $3_1 = $5_1; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $2_1 + $25_1 | 0; + $1_1 = $1_1 + $17_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $16_1 = $3_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $1_1 + $31_1 | 0; + $2_1 = $2_1 + $12_1 | 0; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $21_1 = $3_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $3_1 >>> 21; + $5_1 = $2_1 + $29_1 | 0; + $3_1 = $1_1 + $35_1 | 0; + $19 = $5_1; + $1_1 = $5_1; + $3_1 = $1_1 >>> 0 < $2_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $2_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $1_1 >>> 21; + $5_1 = $3_1 + $34_1 | 0; + $1_1 = $2_1 + $13_1 | 0; + $20_1 = $5_1; + $2_1 = $5_1; + $1_1 = $2_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $2_1 >>> 21; + $5_1 = $1_1 + $56_1 | 0; + $2_1 = $3_1 + $42_1 | 0; + $13_1 = $5_1; + $3_1 = $5_1; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $2_1 + $55 | 0; + $1_1 = $1_1 + $18_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $12_1 = $3_1; + $2_1 = $1_1 >> 21; + $5_1 = ($1_1 & 2097151) << 11 | $3_1 >>> 21; + $3_1 = $14_1 & -2097152; + $1_1 = $4_1 - $3_1 | 0; + $5_1 = $5_1 + $1_1 | 0; + $3_1 = ($15_1 - (($4_1 >>> 0 < $3_1 >>> 0) + $22_1 | 0) | 0) + $2_1 | 0; + $22_1 = $5_1; + $2_1 = $5_1; + $3_1 = $2_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $18_1 = ($3_1 & 2097151) << 11 | $2_1 >>> 21; + $1_1 = $3_1 >> 21; + $8_1 = $1_1; + $2_1 = $7_1 & 2097151; + $3_1 = __wasm_i64_mul($18_1, $1_1, 666643, 0) + $2_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS; + $9_1 = $3_1; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = $1_1; + HEAP82[$69_1 | 0] = $3_1; + HEAP82[$0 + 1 | 0] = ($1_1 & 255) << 24 | $3_1 >>> 8; + $1_1 = $27_1 & 2097151; + $3_1 = __wasm_i64_mul($18_1, $8_1, 470296, 0) + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $3_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $7_1 = $3_1; + $3_1 = $5_1; + $1_1 = $3_1 >> 21; + $4_1 = ($3_1 & 2097151) << 11 | $9_1 >>> 21; + $15_1 = $7_1 + $4_1 | 0; + $3_1 = $1_1 + $2_1 | 0; + $3_1 = $15_1 >>> 0 < $4_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + $4_1 = $15_1; + HEAP82[$0 + 4 | 0] = ($3_1 & 2047) << 21 | $4_1 >>> 11; + $2_1 = $3_1; + $1_1 = $2_1; + $3_1 = $4_1; + HEAP82[$0 + 3 | 0] = ($1_1 & 7) << 29 | $3_1 >>> 3; + $3_1 = $6_1 & 2097151; + $6_1 = __wasm_i64_mul($18_1, $8_1, 654183, 0) + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS; + $1_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $6_1; + $6_1 = ($2_1 & 2097151) << 11 | $4_1 >>> 21; + $15_1 = $3_1 + $6_1 | 0; + $2_1 = ($2_1 >> 21) + $1_1 | 0; + $2_1 = $15_1 >>> 0 < $6_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $6_1 = $15_1; + $1_1 = $2_1; + HEAP82[$0 + 6 | 0] = ($1_1 & 63) << 26 | $6_1 >>> 6; + $7_1 = 0; + $3_1 = (($5_1 & 65535) << 16 | $9_1 >>> 16) & 31; + $9_1 = $4_1 & 2097151; + $2_1 = $9_1; + HEAP82[$0 + 2 | 0] = $3_1 | $2_1 << 5; + $5_1 = $0; + $3_1 = $10_1 & 2097151; + $4_1 = __wasm_i64_mul($18_1, $8_1, -997805, -1) + $3_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $2_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $6_1 >>> 21; + $4_1 = $1_1 + $4_1 | 0; + $3_1 = $2_1 + $3_1 | 0; + $10_1 = $4_1; + $3_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $3_1 + 1 | 0 : $3_1; + HEAP82[$5_1 + 9 | 0] = ($3_1 & 511) << 23 | $4_1 >>> 9; + $2_1 = $3_1; + $1_1 = $2_1; + $3_1 = $4_1; + HEAP82[$5_1 + 8 | 0] = ($1_1 & 1) << 31 | $3_1 >>> 1; + $4_1 = 0; + $6_1 = $6_1 & 2097151; + $3_1 = $6_1; + HEAP82[$5_1 + 5 | 0] = ($7_1 & 524287) << 13 | $9_1 >>> 19 | $3_1 << 2; + $3_1 = $11_1 & 2097151; + $7_1 = __wasm_i64_mul($18_1, $8_1, 136657, 0) + $3_1 | 0; + $1_1 = i64toi32_i32$HIGH_BITS; + $1_1 = $7_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $3_1 = $2_1 >> 21; + $2_1 = ($2_1 & 2097151) << 11 | $10_1 >>> 21; + $7_1 = $2_1 + $7_1 | 0; + $1_1 = $1_1 + $3_1 | 0; + $9_1 = $7_1; + $1_1 = $7_1 >>> 0 < $2_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $7_1; + HEAP82[$5_1 + 12 | 0] = ($1_1 & 4095) << 20 | $2_1 >>> 12; + $3_1 = $1_1; + HEAP82[$5_1 + 11 | 0] = ($1_1 & 15) << 28 | $2_1 >>> 4; + $7_1 = 0; + $11_1 = $10_1 & 2097151; + $2_1 = $11_1; + HEAP82[$5_1 + 7 | 0] = ($4_1 & 16383) << 18 | $6_1 >>> 14 | $2_1 << 7; + $1_1 = $16_1 & 2097151; + $4_1 = __wasm_i64_mul($18_1, $8_1, -683901, -1) + $1_1 | 0; + $2_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $3_1 >> 21; + $3_1 = ($3_1 & 2097151) << 11 | $9_1 >>> 21; + $4_1 = $3_1 + $4_1 | 0; + $2_1 = $1_1 + $2_1 | 0; + $6_1 = $4_1; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $1_1 = $2_1; + HEAP82[$5_1 + 14 | 0] = ($1_1 & 127) << 25 | $4_1 >>> 7; + $4_1 = 0; + $10_1 = $9_1 & 2097151; + $3_1 = $10_1; + HEAP82[$5_1 + 10 | 0] = ($7_1 & 131071) << 15 | $11_1 >>> 17 | $3_1 << 4; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $6_1 >>> 21; + $9_1 = $1_1 + ($21_1 & 2097151) | 0; + $3_1 = $9_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + HEAP82[$5_1 + 17 | 0] = ($3_1 & 1023) << 22 | $9_1 >>> 10; + $1_1 = $3_1; + $3_1 = $9_1; + HEAP82[$5_1 + 16 | 0] = ($1_1 & 3) << 30 | $3_1 >>> 2; + $8_1 = $6_1 & 2097151; + $3_1 = $8_1; + HEAP82[$5_1 + 13 | 0] = ($4_1 & 1048575) << 12 | $10_1 >>> 20 | $3_1 << 1; + $3_1 = ($1_1 & 2097151) << 11 | $9_1 >>> 21; + $6_1 = $3_1 + ($19 & 2097151) | 0; + $1_1 = $1_1 >> 21; + $1_1 = $6_1 >>> 0 < $3_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $6_1; + HEAP82[$5_1 + 20 | 0] = ($1_1 & 8191) << 19 | $2_1 >>> 13; + HEAP82[$5_1 + 19 | 0] = ($1_1 & 31) << 27 | $2_1 >>> 5; + $10_1 = $9_1 & 2097151; + $2_1 = $10_1; + HEAP82[$5_1 + 15 | 0] = ($7_1 & 32767) << 17 | $8_1 >>> 15 | $2_1 << 6; + $2_1 = $1_1 >> 21; + $5_1 = ($1_1 & 2097151) << 11 | $6_1 >>> 21; + $8_1 = $5_1 + ($20_1 & 2097151) | 0; + $1_1 = $2_1; + $1_1 = $8_1 >>> 0 < $5_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $5_1 = $1_1; + HEAP82[$0 + 21 | 0] = $8_1; + $1_1 = $6_1; + HEAP82[$0 + 18 | 0] = ($4_1 & 262143) << 14 | $10_1 >>> 18 | $1_1 << 3; + $1_1 = $5_1; + HEAP82[$0 + 22 | 0] = ($1_1 & 255) << 24 | $8_1 >>> 8; + $2_1 = $0; + $3_1 = $1_1; + $1_1 = $1_1 >> 21; + $7_1 = ($3_1 & 2097151) << 11 | $8_1 >>> 21; + $6_1 = $7_1 + ($13_1 & 2097151) | 0; + $3_1 = $6_1 >>> 0 < $7_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + HEAP82[$2_1 + 25 | 0] = ($3_1 & 2047) << 21 | $6_1 >>> 11; + $1_1 = $3_1; + $3_1 = $6_1; + HEAP82[$2_1 + 24 | 0] = ($1_1 & 7) << 29 | $3_1 >>> 3; + $3_1 = $2_1; + $7_1 = ($1_1 & 2097151) << 11 | $6_1 >>> 21; + $9_1 = $7_1 + ($12_1 & 2097151) | 0; + $1_1 = $1_1 >> 21; + $4_1 = $9_1; + $1_1 = $4_1 >>> 0 < $7_1 >>> 0 ? $1_1 + 1 | 0 : $1_1; + $2_1 = $1_1; + HEAP82[$3_1 + 27 | 0] = ($1_1 & 63) << 26 | $4_1 >>> 6; + $7_1 = 0; + $9_1 = $6_1 & 2097151; + $1_1 = $9_1; + HEAP82[$3_1 + 23 | 0] = (($5_1 & 65535) << 16 | $8_1 >>> 16) & 31 | $1_1 << 5; + $1_1 = $2_1; + $2_1 = $1_1 >> 21; + $1_1 = ($1_1 & 2097151) << 11 | $4_1 >>> 21; + $5_1 = $1_1 + ($22_1 & 2097151) | 0; + $2_1 = $5_1 >>> 0 < $1_1 >>> 0 ? $2_1 + 1 | 0 : $2_1; + $3_1 = $5_1; + HEAP82[$0 + 31 | 0] = ($2_1 & 131071) << 15 | $3_1 >>> 17; + $1_1 = $2_1; + HEAP82[$0 + 30 | 0] = ($1_1 & 511) << 23 | $3_1 >>> 9; + HEAP82[$0 + 29 | 0] = ($1_1 & 1) << 31 | $3_1 >>> 1; + $2_1 = 0; + $4_1 = $4_1 & 2097151; + HEAP82[$0 + 26 | 0] = ($7_1 & 524287) << 13 | $9_1 >>> 19 | $4_1 << 2; + HEAP82[$0 + 28 | 0] = ($2_1 & 16383) << 18 | $4_1 >>> 14 | $3_1 << 7; + } + function $70($0) { + var $1_1 = 0; + $1_1 = HEAP322[315]; + HEAP322[$0 + 184 >> 2] = HEAP322[314]; + HEAP322[$0 + 188 >> 2] = $1_1; + $1_1 = HEAP322[313]; + HEAP322[$0 + 176 >> 2] = HEAP322[312]; + HEAP322[$0 + 180 >> 2] = $1_1; + $1_1 = HEAP322[311]; + HEAP322[$0 + 168 >> 2] = HEAP322[310]; + HEAP322[$0 + 172 >> 2] = $1_1; + $1_1 = HEAP322[309]; + HEAP322[$0 + 160 >> 2] = HEAP322[308]; + HEAP322[$0 + 164 >> 2] = $1_1; + $1_1 = HEAP322[307]; + HEAP322[$0 + 152 >> 2] = HEAP322[306]; + HEAP322[$0 + 156 >> 2] = $1_1; + $1_1 = HEAP322[305]; + HEAP322[$0 + 144 >> 2] = HEAP322[304]; + HEAP322[$0 + 148 >> 2] = $1_1; + $1_1 = HEAP322[303]; + HEAP322[$0 + 136 >> 2] = HEAP322[302]; + HEAP322[$0 + 140 >> 2] = $1_1; + $1_1 = HEAP322[301]; + HEAP322[$0 + 128 >> 2] = HEAP322[300]; + HEAP322[$0 + 132 >> 2] = $1_1; + HEAP322[$0 + 192 >> 2] = 0; + HEAP322[$0 + 196 >> 2] = 0; + } + function $71($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0; + if ($2_1) { + $7_1 = $0 + 128 | 0; + $4_1 = HEAP322[$0 + 192 >> 2] & 127; + while (1) { + $3_1 = 128 - $4_1 | 0; + $3_1 = $3_1 >>> 0 > $2_1 >>> 0 ? $2_1 : $3_1; + $78($0 + $4_1 | 0, $1_1, $3_1); + $2_1 = $2_1 - $3_1 | 0; + $4_1 = $3_1 + $4_1 | 0; + if (($4_1 | 0) == 128) { + $72($0, $7_1); + $4_1 = 0; + } + $1_1 = $1_1 + $3_1 | 0; + $5_1 = HEAP322[$0 + 196 >> 2]; + $6_1 = HEAP322[$0 + 192 >> 2] + $3_1 | 0; + if ($6_1 >>> 0 < $3_1 >>> 0) { + $5_1 = $5_1 + 1 | 0; + } + HEAP322[$0 + 192 >> 2] = $6_1; + HEAP322[$0 + 196 >> 2] = $5_1; + if ($2_1) { + continue; + } + break; + } + } + } + function $72($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0, $12_1 = 0, $13_1 = 0, $14_1 = 0, $15_1 = 0, $16_1 = 0, $17_1 = 0, $18_1 = 0, $19 = 0, $20_1 = 0, $21_1 = 0, $22_1 = 0, $23_1 = 0, $24_1 = 0, $25_1 = 0, $26_1 = 0, $27_1 = 0, $28_1 = 0, $29_1 = 0, $30_1 = 0, $31_1 = 0, $32_1 = 0, $33_1 = 0, $34_1 = 0, $35_1 = 0, $36_1 = 0, $37_1 = 0, $38_1 = 0, $39_1 = 0, $40_1 = 0, $41_1 = 0, $42_1 = 0, $43_1 = 0; + $24_1 = global$0 - 640 | 0; + global$0 = $24_1; + while (1) { + $5_1 = $3_1 << 3; + $4_1 = $5_1 + $24_1 | 0; + HEAP322[$4_1 >> 2] = $73($0 + $5_1 | 0); + HEAP322[$4_1 + 4 >> 2] = i64toi32_i32$HIGH_BITS; + $26_1 = 16; + $3_1 = $3_1 + 1 | 0; + if (($3_1 | 0) != 16) { + continue; + } + break; + } + while (1) { + $6_1 = ($26_1 << 3) + $24_1 | 0; + $3_1 = $6_1; + $4_1 = $3_1 + -56 | 0; + $9_1 = HEAP322[$4_1 >> 2]; + $0 = $3_1 + -128 | 0; + $5_1 = $9_1 + HEAP322[$0 >> 2] | 0; + $0 = HEAP322[$0 + 4 >> 2] + HEAP322[$4_1 + 4 >> 2] | 0; + $4_1 = $5_1; + $5_1 = $4_1 >>> 0 < $9_1 >>> 0 ? $0 + 1 | 0 : $0; + $9_1 = $3_1 + -16 | 0; + $0 = HEAP322[$9_1 + 4 >> 2]; + $9_1 = HEAP322[$9_1 >> 2]; + $16_1 = __wasm_rotl_i64($9_1, $0, 3); + $14_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1; + $4_1 = $0; + $0 = $0 >>> 6 | 0; + $9_1 = __wasm_rotl_i64($9_1, $4_1, 45) ^ ((($4_1 & 63) << 26 | $9_1 >>> 6) ^ $16_1); + $4_1 = $2_1 + $9_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ ($0 ^ $14_1)) + $5_1 | 0; + $0 = $4_1 >>> 0 < $9_1 >>> 0 ? $0 + 1 | 0 : $0; + $5_1 = $0; + $6_1 = $3_1 + -120 | 0; + $0 = HEAP322[$6_1 + 4 >> 2]; + $6_1 = HEAP322[$6_1 >> 2]; + $9_1 = __wasm_rotl_i64($6_1, $0, 56); + $16_1 = i64toi32_i32$HIGH_BITS; + $2_1 = $4_1; + $4_1 = $0; + $0 = $0 >>> 7 | 0; + $6_1 = __wasm_rotl_i64($6_1, $4_1, 63) ^ ((($4_1 & 127) << 25 | $6_1 >>> 7) ^ $9_1); + $4_1 = $2_1 + $6_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ ($0 ^ $16_1)) + $5_1 | 0; + HEAP322[$3_1 >> 2] = $4_1; + HEAP322[$3_1 + 4 >> 2] = $4_1 >>> 0 < $6_1 >>> 0 ? $0 + 1 | 0 : $0; + $26_1 = $26_1 + 1 | 0; + if (($26_1 | 0) != 80) { + continue; + } + break; + } + $26_1 = 0; + $0 = $1_1; + $3_1 = HEAP322[$0 + 4 >> 2]; + $28_1 = HEAP322[$0 >> 2]; + $7_1 = $28_1; + $36_1 = $3_1; + $10_1 = $3_1; + $9_1 = HEAP322[$0 + 12 >> 2]; + $37_1 = $9_1; + $29_1 = HEAP322[$0 + 8 >> 2]; + $15_1 = $29_1; + $16_1 = HEAP322[$0 + 20 >> 2]; + $38_1 = $16_1; + $30_1 = HEAP322[$0 + 16 >> 2]; + $17_1 = $30_1; + $14_1 = HEAP322[$0 + 28 >> 2]; + $39_1 = $14_1; + $31_1 = HEAP322[$0 + 24 >> 2]; + $18_1 = $31_1; + $3_1 = HEAP322[$0 + 36 >> 2]; + $40_1 = $3_1; + $32_1 = HEAP322[$0 + 32 >> 2]; + $8_1 = $32_1; + $5_1 = HEAP322[$0 + 44 >> 2]; + $41_1 = $5_1; + $33_1 = HEAP322[$0 + 40 >> 2]; + $11_1 = $33_1; + $4_1 = HEAP322[$0 + 52 >> 2]; + $42_1 = $4_1; + $34_1 = HEAP322[$0 + 48 >> 2]; + $12_1 = $34_1; + $6_1 = HEAP322[$0 + 60 >> 2]; + $43_1 = $6_1; + $35_1 = HEAP322[$0 + 56 >> 2]; + $20_1 = $35_1; + while (1) { + $25_1 = $26_1 << 3; + $0 = $25_1 + 1264 | 0; + $13_1 = HEAP322[$0 >> 2]; + $2_1 = HEAP322[$0 + 4 >> 2]; + $0 = __wasm_rotl_i64($8_1, $3_1, 50); + $21_1 = i64toi32_i32$HIGH_BITS; + $19 = __wasm_rotl_i64($8_1, $3_1, 46) ^ $0; + $21_1 = i64toi32_i32$HIGH_BITS ^ $21_1; + $0 = $6_1 + ($4_1 ^ $3_1 & ($4_1 ^ $5_1)) | 0; + $6_1 = $20_1 + ($12_1 ^ $8_1 & ($11_1 ^ $12_1)) | 0; + if ($6_1 >>> 0 < $20_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $20_1 = __wasm_rotl_i64($8_1, $3_1, 23) ^ $19; + $6_1 = $20_1 + $6_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $21_1) + $0 | 0; + $0 = $6_1 >>> 0 < $20_1 >>> 0 ? $0 + 1 | 0 : $0; + $20_1 = $6_1; + $6_1 = $6_1 + $13_1 | 0; + $0 = $0 + $2_1 | 0; + $0 = $6_1 >>> 0 < $20_1 >>> 0 ? $0 + 1 | 0 : $0; + $20_1 = $24_1 + $25_1 | 0; + $13_1 = HEAP322[$20_1 >> 2]; + $6_1 = $13_1 + $6_1 | 0; + $0 = HEAP322[$20_1 + 4 >> 2] + $0 | 0; + $0 = $6_1 >>> 0 < $13_1 >>> 0 ? $0 + 1 | 0 : $0; + $13_1 = $0; + $0 = __wasm_rotl_i64($7_1, $10_1, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $0 = __wasm_rotl_i64($7_1, $10_1, 30) ^ $0; + $21_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $19 = __wasm_rotl_i64($7_1, $10_1, 25) ^ $0; + $2_1 = $19 + ($17_1 & ($7_1 | $15_1) | $7_1 & $15_1) | 0; + $0 = ($16_1 & ($9_1 | $10_1) | $9_1 & $10_1) + (i64toi32_i32$HIGH_BITS ^ $21_1) | 0; + $0 = $2_1 >>> 0 < $19 >>> 0 ? $0 + 1 | 0 : $0; + $21_1 = $2_1; + $2_1 = $2_1 + $6_1 | 0; + $0 = $0 + $13_1 | 0; + $0 = $2_1 >>> 0 < $21_1 >>> 0 ? $0 + 1 | 0 : $0; + $21_1 = $2_1; + $20_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $22_1 = $20_1; + $20_1 = $0; + $19 = $22_1 ^ __wasm_rotl_i64($21_1, $0, 30); + $22_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($21_1, $0, 25) ^ $19; + $19 = $15_1 & ($7_1 | $21_1) | $7_1 & $21_1; + $2_1 = $2_1 + $19 | 0; + $0 = ($9_1 & ($0 | $10_1) | $0 & $10_1) + (i64toi32_i32$HIGH_BITS ^ $22_1) | 0; + $22_1 = $2_1; + $2_1 = $2_1 >>> 0 < $19 >>> 0 ? $0 + 1 | 0 : $0; + $23_1 = $25_1 | 8; + $0 = $23_1 + 1264 | 0; + $19 = $12_1 + HEAP322[$0 >> 2] | 0; + $0 = $4_1 + HEAP322[$0 + 4 >> 2] | 0; + $0 = $19 >>> 0 < $12_1 >>> 0 ? $0 + 1 | 0 : $0; + $4_1 = $19; + $12_1 = $23_1 + $24_1 | 0; + $19 = HEAP322[$12_1 >> 2]; + $4_1 = $4_1 + $19 | 0; + $0 = HEAP322[$12_1 + 4 >> 2] + $0 | 0; + $12_1 = $4_1; + $4_1 = $4_1 >>> 0 < $19 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $13_1 + $14_1 | 0; + $14_1 = $6_1 + $18_1 | 0; + if ($14_1 >>> 0 < $6_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $6_1 = $14_1; + $14_1 = $0; + $0 = ($5_1 ^ $0 & ($3_1 ^ $5_1)) + $4_1 | 0; + $4_1 = $11_1 ^ ($8_1 ^ $11_1) & $6_1; + $12_1 = $4_1 + $12_1 | 0; + if ($12_1 >>> 0 < $4_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $4_1 = $12_1; + $12_1 = __wasm_rotl_i64($6_1, $14_1, 50); + $13_1 = i64toi32_i32$HIGH_BITS; + $12_1 = __wasm_rotl_i64($6_1, $14_1, 46) ^ $12_1; + $13_1 = i64toi32_i32$HIGH_BITS ^ $13_1; + $12_1 = __wasm_rotl_i64($6_1, $14_1, 23) ^ $12_1; + $4_1 = $12_1 + $4_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $13_1) + $0 | 0; + $0 = $4_1 >>> 0 < $12_1 >>> 0 ? $0 + 1 | 0 : $0; + $13_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $4_1 + $22_1 | 0; + if ($2_1 >>> 0 < $4_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $19 = $2_1; + $12_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $18_1 = $12_1; + $12_1 = $0; + $18_1 = $18_1 ^ __wasm_rotl_i64($19, $0, 30); + $22_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($19, $0, 25) ^ $18_1; + $18_1 = $7_1 & ($19 | $21_1) | $19 & $21_1; + $2_1 = $2_1 + $18_1 | 0; + $0 = ($10_1 & ($0 | $20_1) | $0 & $20_1) + (i64toi32_i32$HIGH_BITS ^ $22_1) | 0; + $22_1 = $2_1; + $2_1 = $2_1 >>> 0 < $18_1 >>> 0 ? $0 + 1 | 0 : $0; + $23_1 = $25_1 | 16; + $0 = $23_1 + 1264 | 0; + $18_1 = $11_1 + HEAP322[$0 >> 2] | 0; + $0 = $5_1 + HEAP322[$0 + 4 >> 2] | 0; + $0 = $18_1 >>> 0 < $11_1 >>> 0 ? $0 + 1 | 0 : $0; + $5_1 = $18_1; + $11_1 = $23_1 + $24_1 | 0; + $18_1 = HEAP322[$11_1 >> 2]; + $5_1 = $5_1 + $18_1 | 0; + $0 = HEAP322[$11_1 + 4 >> 2] + $0 | 0; + $11_1 = $5_1; + $5_1 = $5_1 >>> 0 < $18_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $13_1 + $16_1 | 0; + $16_1 = $4_1 + $17_1 | 0; + if ($16_1 >>> 0 < $4_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $4_1 = $16_1; + $16_1 = $0; + $0 = ($3_1 ^ $0 & ($3_1 ^ $14_1)) + $5_1 | 0; + $5_1 = $8_1 ^ ($6_1 ^ $8_1) & $4_1; + $11_1 = $5_1 + $11_1 | 0; + if ($11_1 >>> 0 < $5_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $5_1 = $11_1; + $11_1 = __wasm_rotl_i64($4_1, $16_1, 50); + $13_1 = i64toi32_i32$HIGH_BITS; + $11_1 = __wasm_rotl_i64($4_1, $16_1, 46) ^ $11_1; + $13_1 = i64toi32_i32$HIGH_BITS ^ $13_1; + $11_1 = __wasm_rotl_i64($4_1, $16_1, 23) ^ $11_1; + $5_1 = $11_1 + $5_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $13_1) + $0 | 0; + $0 = $5_1 >>> 0 < $11_1 >>> 0 ? $0 + 1 | 0 : $0; + $13_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $5_1 + $22_1 | 0; + if ($2_1 >>> 0 < $5_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $22_1 = $2_1; + $11_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $17_1 = $11_1; + $11_1 = $0; + $17_1 = $17_1 ^ __wasm_rotl_i64($22_1, $0, 30); + $18_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($22_1, $0, 25) ^ $17_1; + $17_1 = $21_1 & ($19 | $22_1) | $19 & $22_1; + $2_1 = $2_1 + $17_1 | 0; + $0 = ($20_1 & ($0 | $12_1) | $0 & $12_1) + (i64toi32_i32$HIGH_BITS ^ $18_1) | 0; + $18_1 = $2_1; + $2_1 = $2_1 >>> 0 < $17_1 >>> 0 ? $0 + 1 | 0 : $0; + $23_1 = $25_1 | 24; + $0 = $23_1 + 1264 | 0; + $17_1 = $8_1 + HEAP322[$0 >> 2] | 0; + $0 = $3_1 + HEAP322[$0 + 4 >> 2] | 0; + $0 = $17_1 >>> 0 < $8_1 >>> 0 ? $0 + 1 | 0 : $0; + $3_1 = $17_1; + $8_1 = $23_1 + $24_1 | 0; + $17_1 = HEAP322[$8_1 >> 2]; + $3_1 = $3_1 + $17_1 | 0; + $0 = HEAP322[$8_1 + 4 >> 2] + $0 | 0; + $8_1 = $3_1; + $3_1 = $3_1 >>> 0 < $17_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $9_1 + $13_1 | 0; + $9_1 = $5_1 + $15_1 | 0; + if ($9_1 >>> 0 < $5_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $5_1 = $9_1; + $9_1 = $0; + $0 = ($14_1 ^ $0 & ($16_1 ^ $14_1)) + $3_1 | 0; + $3_1 = $6_1 ^ ($4_1 ^ $6_1) & $5_1; + $8_1 = $3_1 + $8_1 | 0; + if ($8_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $8_1; + $8_1 = __wasm_rotl_i64($5_1, $9_1, 50); + $13_1 = i64toi32_i32$HIGH_BITS; + $8_1 = __wasm_rotl_i64($5_1, $9_1, 46) ^ $8_1; + $13_1 = i64toi32_i32$HIGH_BITS ^ $13_1; + $8_1 = __wasm_rotl_i64($5_1, $9_1, 23) ^ $8_1; + $3_1 = $8_1 + $3_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $13_1) + $0 | 0; + $0 = $3_1 >>> 0 < $8_1 >>> 0 ? $0 + 1 | 0 : $0; + $8_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $3_1 + $18_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $23_1 = $2_1; + $13_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $15_1 = $13_1; + $13_1 = $0; + $15_1 = $15_1 ^ __wasm_rotl_i64($23_1, $0, 30); + $17_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($23_1, $0, 25) ^ $15_1; + $15_1 = $19 & ($22_1 | $23_1) | $22_1 & $23_1; + $2_1 = $2_1 + $15_1 | 0; + $0 = ($12_1 & ($0 | $11_1) | $0 & $11_1) + (i64toi32_i32$HIGH_BITS ^ $17_1) | 0; + $17_1 = $2_1; + $2_1 = $2_1 >>> 0 < $15_1 >>> 0 ? $0 + 1 | 0 : $0; + $18_1 = $25_1 | 32; + $0 = $18_1 + 1264 | 0; + $15_1 = $6_1 + HEAP322[$0 >> 2] | 0; + $0 = $14_1 + HEAP322[$0 + 4 >> 2] | 0; + $0 = $15_1 >>> 0 < $6_1 >>> 0 ? $0 + 1 | 0 : $0; + $6_1 = $15_1; + $14_1 = $18_1 + $24_1 | 0; + $15_1 = HEAP322[$14_1 >> 2]; + $6_1 = $6_1 + $15_1 | 0; + $0 = HEAP322[$14_1 + 4 >> 2] + $0 | 0; + $14_1 = $6_1; + $6_1 = $6_1 >>> 0 < $15_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $8_1 + $10_1 | 0; + $10_1 = $3_1 + $7_1 | 0; + if ($10_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $8_1 = $0; + $0 = ($16_1 ^ $0 & ($9_1 ^ $16_1)) + $6_1 | 0; + $3_1 = $4_1 ^ ($4_1 ^ $5_1) & $10_1; + $6_1 = $3_1 + $14_1 | 0; + if ($6_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $6_1; + $6_1 = __wasm_rotl_i64($10_1, $8_1, 50); + $14_1 = i64toi32_i32$HIGH_BITS; + $6_1 = __wasm_rotl_i64($10_1, $8_1, 46) ^ $6_1; + $14_1 = i64toi32_i32$HIGH_BITS ^ $14_1; + $6_1 = __wasm_rotl_i64($10_1, $8_1, 23) ^ $6_1; + $3_1 = $6_1 + $3_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $14_1) + $0 | 0; + $0 = $3_1 >>> 0 < $6_1 >>> 0 ? $0 + 1 | 0 : $0; + $6_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $3_1 + $17_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $18_1 = $2_1; + $14_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $14_1; + $14_1 = $0; + $7_1 = $7_1 ^ __wasm_rotl_i64($18_1, $0, 30); + $15_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($18_1, $0, 25) ^ $7_1; + $7_1 = $22_1 & ($18_1 | $23_1) | $18_1 & $23_1; + $2_1 = $2_1 + $7_1 | 0; + $0 = ($11_1 & ($0 | $13_1) | $0 & $13_1) + (i64toi32_i32$HIGH_BITS ^ $15_1) | 0; + $15_1 = $2_1; + $2_1 = $2_1 >>> 0 < $7_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $25_1 | 40; + $17_1 = $0 + $24_1 | 0; + $0 = $0 + 1264 | 0; + $27_1 = HEAP322[$0 >> 2]; + $7_1 = HEAP322[$17_1 >> 2] + $27_1 | 0; + $0 = HEAP322[$17_1 + 4 >> 2] + HEAP322[$0 + 4 >> 2] | 0; + $0 = $7_1 >>> 0 < $27_1 >>> 0 ? $0 + 1 | 0 : $0; + $7_1 = $4_1 + $7_1 | 0; + $0 = $0 + $16_1 | 0; + $16_1 = $7_1; + $4_1 = $7_1 >>> 0 < $4_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $6_1 + $20_1 | 0; + $6_1 = $3_1 + $21_1 | 0; + if ($6_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $20_1 = $6_1; + $6_1 = $0; + $0 = ($9_1 ^ $0 & ($8_1 ^ $9_1)) + $4_1 | 0; + $3_1 = $5_1 ^ ($5_1 ^ $10_1) & $20_1; + $4_1 = $3_1 + $16_1 | 0; + if ($4_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $4_1; + $4_1 = __wasm_rotl_i64($20_1, $6_1, 50); + $16_1 = i64toi32_i32$HIGH_BITS; + $4_1 = __wasm_rotl_i64($20_1, $6_1, 46) ^ $4_1; + $16_1 = i64toi32_i32$HIGH_BITS ^ $16_1; + $4_1 = __wasm_rotl_i64($20_1, $6_1, 23) ^ $4_1; + $3_1 = $4_1 + $3_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $16_1) + $0 | 0; + $0 = $3_1 >>> 0 < $4_1 >>> 0 ? $0 + 1 | 0 : $0; + $4_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $3_1 + $15_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $17_1 = $2_1; + $16_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $16_1; + $16_1 = $0; + $7_1 = $7_1 ^ __wasm_rotl_i64($17_1, $0, 30); + $15_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($17_1, $0, 25) ^ $7_1; + $7_1 = $23_1 & ($17_1 | $18_1) | $17_1 & $18_1; + $2_1 = $2_1 + $7_1 | 0; + $0 = ($13_1 & ($0 | $14_1) | $0 & $14_1) + (i64toi32_i32$HIGH_BITS ^ $15_1) | 0; + $15_1 = $2_1; + $2_1 = $2_1 >>> 0 < $7_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $25_1 | 48; + $21_1 = $0 + $24_1 | 0; + $0 = $0 + 1264 | 0; + $27_1 = HEAP322[$0 >> 2]; + $7_1 = HEAP322[$21_1 >> 2] + $27_1 | 0; + $0 = HEAP322[$21_1 + 4 >> 2] + HEAP322[$0 + 4 >> 2] | 0; + $0 = $7_1 >>> 0 < $27_1 >>> 0 ? $0 + 1 | 0 : $0; + $7_1 = $5_1 + $7_1 | 0; + $0 = $0 + $9_1 | 0; + $9_1 = $7_1; + $5_1 = $7_1 >>> 0 < $5_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $4_1 + $12_1 | 0; + $4_1 = $3_1 + $19 | 0; + if ($4_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $12_1 = $4_1; + $4_1 = $0; + $0 = ($8_1 ^ $0 & ($6_1 ^ $8_1)) + $5_1 | 0; + $3_1 = $10_1 ^ ($10_1 ^ $20_1) & $12_1; + $5_1 = $3_1 + $9_1 | 0; + if ($5_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $5_1; + $5_1 = __wasm_rotl_i64($12_1, $4_1, 50); + $9_1 = i64toi32_i32$HIGH_BITS; + $5_1 = __wasm_rotl_i64($12_1, $4_1, 46) ^ $5_1; + $9_1 = i64toi32_i32$HIGH_BITS ^ $9_1; + $5_1 = __wasm_rotl_i64($12_1, $4_1, 23) ^ $5_1; + $3_1 = $5_1 + $3_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $9_1) + $0 | 0; + $0 = $3_1 >>> 0 < $5_1 >>> 0 ? $0 + 1 | 0 : $0; + $5_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $3_1 + $15_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $15_1 = $2_1; + $9_1 = __wasm_rotl_i64($2_1, $0, 36); + $2_1 = i64toi32_i32$HIGH_BITS; + $7_1 = $9_1; + $9_1 = $0; + $7_1 = $7_1 ^ __wasm_rotl_i64($15_1, $0, 30); + $21_1 = i64toi32_i32$HIGH_BITS ^ $2_1; + $2_1 = __wasm_rotl_i64($15_1, $0, 25) ^ $7_1; + $7_1 = $18_1 & ($15_1 | $17_1) | $15_1 & $17_1; + $2_1 = $2_1 + $7_1 | 0; + $0 = ($14_1 & ($0 | $16_1) | $0 & $16_1) + (i64toi32_i32$HIGH_BITS ^ $21_1) | 0; + $21_1 = $2_1; + $2_1 = $2_1 >>> 0 < $7_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $25_1 | 56; + $25_1 = $0 + $24_1 | 0; + $0 = $0 + 1264 | 0; + $19 = HEAP322[$0 >> 2]; + $7_1 = HEAP322[$25_1 >> 2] + $19 | 0; + $0 = HEAP322[$25_1 + 4 >> 2] + HEAP322[$0 + 4 >> 2] | 0; + $0 = $7_1 >>> 0 < $19 >>> 0 ? $0 + 1 | 0 : $0; + $7_1 = $7_1 + $10_1 | 0; + $0 = $0 + $8_1 | 0; + $8_1 = $7_1; + $10_1 = $8_1 >>> 0 < $10_1 >>> 0 ? $0 + 1 | 0 : $0; + $0 = $5_1 + $11_1 | 0; + $5_1 = $3_1 + $22_1 | 0; + if ($5_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $11_1 = $5_1; + $5_1 = $0; + $0 = ($6_1 ^ $0 & ($4_1 ^ $6_1)) + $10_1 | 0; + $3_1 = $20_1 ^ ($12_1 ^ $20_1) & $11_1; + $10_1 = $3_1 + $8_1 | 0; + if ($10_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $10_1; + $10_1 = __wasm_rotl_i64($11_1, $5_1, 50); + $8_1 = i64toi32_i32$HIGH_BITS; + $10_1 = __wasm_rotl_i64($11_1, $5_1, 46) ^ $10_1; + $8_1 = i64toi32_i32$HIGH_BITS ^ $8_1; + $10_1 = __wasm_rotl_i64($11_1, $5_1, 23) ^ $10_1; + $3_1 = $10_1 + $3_1 | 0; + $0 = (i64toi32_i32$HIGH_BITS ^ $8_1) + $0 | 0; + $0 = $3_1 >>> 0 < $10_1 >>> 0 ? $0 + 1 | 0 : $0; + $8_1 = $0; + $0 = $0 + $2_1 | 0; + $2_1 = $3_1 + $21_1 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $7_1 = $2_1; + $10_1 = $0; + $0 = $8_1 + $13_1 | 0; + $8_1 = $3_1 + $23_1 | 0; + if ($8_1 >>> 0 < $3_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $0; + $0 = $26_1 >>> 0 < 72; + $26_1 = $26_1 + 8 | 0; + if ($0) { + continue; + } + break; + } + $0 = $6_1 + $43_1 | 0; + $6_1 = $20_1 + $35_1 | 0; + if ($6_1 >>> 0 < $35_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $13_1 = $1_1; + HEAP322[$13_1 + 56 >> 2] = $6_1; + HEAP322[$13_1 + 60 >> 2] = $0; + $0 = $4_1 + $42_1 | 0; + $4_1 = $12_1 + $34_1 | 0; + if ($4_1 >>> 0 < $34_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $6_1 = $1_1; + HEAP322[$6_1 + 48 >> 2] = $4_1; + HEAP322[$6_1 + 52 >> 2] = $0; + $0 = $5_1 + $41_1 | 0; + $5_1 = $11_1 + $33_1 | 0; + if ($5_1 >>> 0 < $33_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $4_1 = $1_1; + HEAP322[$4_1 + 40 >> 2] = $5_1; + HEAP322[$4_1 + 44 >> 2] = $0; + $0 = $3_1 + $40_1 | 0; + $3_1 = $8_1 + $32_1 | 0; + if ($3_1 >>> 0 < $32_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $5_1 = $1_1; + HEAP322[$5_1 + 32 >> 2] = $3_1; + HEAP322[$5_1 + 36 >> 2] = $0; + $0 = $14_1 + $39_1 | 0; + $5_1 = $18_1 + $31_1 | 0; + if ($5_1 >>> 0 < $31_1 >>> 0) { + $0 = $0 + 1 | 0; + } + $3_1 = $1_1; + HEAP322[$3_1 + 24 >> 2] = $5_1; + HEAP322[$3_1 + 28 >> 2] = $0; + $0 = $16_1 + $38_1 | 0; + $5_1 = $17_1 + $30_1 | 0; + if ($5_1 >>> 0 < $30_1 >>> 0) { + $0 = $0 + 1 | 0; + } + HEAP322[$1_1 + 16 >> 2] = $5_1; + HEAP322[$3_1 + 20 >> 2] = $0; + $0 = $9_1 + $37_1 | 0; + $5_1 = $15_1 + $29_1 | 0; + if ($5_1 >>> 0 < $29_1 >>> 0) { + $0 = $0 + 1 | 0; + } + HEAP322[$1_1 + 8 >> 2] = $5_1; + HEAP322[$3_1 + 12 >> 2] = $0; + $0 = $10_1 + $36_1 | 0; + $3_1 = $7_1 + $28_1 | 0; + if ($3_1 >>> 0 < $28_1 >>> 0) { + $0 = $0 + 1 | 0; + } + HEAP322[$1_1 >> 2] = $3_1; + HEAP322[$1_1 + 4 >> 2] = $0; + global$0 = $24_1 + 640 | 0; + } + function $73($0) { + var $1_1 = 0, $2_1 = 0, $3_1 = 0; + $1_1 = HEAPU82[$0 | 0] | HEAPU82[$0 + 1 | 0] << 8 | (HEAPU82[$0 + 2 | 0] << 16 | HEAPU82[$0 + 3 | 0] << 24); + $0 = HEAPU82[$0 + 4 | 0] | HEAPU82[$0 + 5 | 0] << 8 | (HEAPU82[$0 + 6 | 0] << 16 | HEAPU82[$0 + 7 | 0] << 24); + $2_1 = $0 << 24 | $1_1 >>> 8; + $2_1 = $2_1 & 65280 | ($0 << 8 | $1_1 >>> 24) & 255 | ($1_1 << 8 & 16711680 | $1_1 << 24); + $0 = (($0 & 255) << 24 | $1_1 >>> 8) & -16777216 | (($0 & 16777215) << 8 | $1_1 >>> 24) & 16711680 | ($0 >>> 8 & 65280 | $0 >>> 24) | $3_1; + i64toi32_i32$HIGH_BITS = $2_1; + return $0; + } + function $75($0, $1_1) { + var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; + $3_1 = HEAP322[$0 + 192 >> 2] & 127; + $2_1 = $3_1 + $0 | 0; + HEAP82[$2_1 | 0] = 128; + $2_1 = $2_1 + 1 | 0; + label$1: { + if ($3_1 >>> 0 >= 112) { + $79($2_1, $3_1 ^ 127); + $72($0, $0 + 128 | 0); + $79($0, 112); + break label$1; + } + $79($2_1, 111 - $3_1 | 0); + } + $76($0 + 112 | 0, HEAP322[$0 + 196 >> 2] >>> 29 | 0, 0); + $5_1 = $0 + 120 | 0; + $2_1 = HEAP322[$0 + 192 >> 2]; + $3_1 = HEAP322[$0 + 196 >> 2] << 3 | $2_1 >>> 29; + $2_1 = $2_1 << 3; + $4_1 = $2_1; + if ($2_1 >>> 0 < $2_1 >>> 0) { + $3_1 = $3_1 + 1 | 0; + } + $76($5_1, $4_1, $3_1); + $3_1 = $0 + 128 | 0; + $72($0, $3_1); + $0 = 0; + while (1) { + $2_1 = $0 << 3; + $4_1 = $2_1 + $1_1 | 0; + $2_1 = $2_1 + $3_1 | 0; + $76($4_1, HEAP322[$2_1 >> 2], HEAP322[$2_1 + 4 >> 2]); + $0 = $0 + 1 | 0; + if (($0 | 0) != 8) { + continue; + } + break; + } + } + function $76($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $3_1 = $1_1 << 8 & 16711680 | $1_1 << 24; + $4_1 = $2_1 << 24 | $1_1 >>> 8; + $5_1 = $4_1 & 65280; + $4_1 = $2_1 << 8 | $1_1 >>> 24; + $3_1 = $4_1 & 255 | $5_1 | $3_1; + $1_1 = (($2_1 & 255) << 24 | $1_1 >>> 8) & -16777216 | (($2_1 & 16777215) << 8 | $1_1 >>> 24) & 16711680 | ($2_1 >>> 8 & 65280 | $2_1 >>> 24) | $6_1; + HEAP82[$0 | 0] = $1_1; + HEAP82[$0 + 1 | 0] = $1_1 >>> 8; + HEAP82[$0 + 2 | 0] = $1_1 >>> 16; + HEAP82[$0 + 3 | 0] = $1_1 >>> 24; + $1_1 = $3_1; + HEAP82[$0 + 4 | 0] = $1_1; + HEAP82[$0 + 5 | 0] = $1_1 >>> 8; + HEAP82[$0 + 6 | 0] = $1_1 >>> 16; + HEAP82[$0 + 7 | 0] = $1_1 >>> 24; + } + function $78($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0; + if ($2_1 >>> 0 >= 512) { + fimport$0($0 | 0, $1_1 | 0, $2_1 | 0) | 0; + return $0; + } + $4_1 = $0 + $2_1 | 0; + label$2: { + if (!(($0 ^ $1_1) & 3)) { + label$4: { + if (($2_1 | 0) < 1) { + $2_1 = $0; + break label$4; + } + if (!($0 & 3)) { + $2_1 = $0; + break label$4; + } + $2_1 = $0; + while (1) { + HEAP82[$2_1 | 0] = HEAPU82[$1_1 | 0]; + $1_1 = $1_1 + 1 | 0; + $2_1 = $2_1 + 1 | 0; + if ($2_1 >>> 0 >= $4_1 >>> 0) { + break label$4; + } + if ($2_1 & 3) { + continue; + } + break; + } + } + $3_1 = $4_1 & -4; + label$8: { + if ($3_1 >>> 0 < 64) { + break label$8; + } + $5_1 = $3_1 + -64 | 0; + if ($2_1 >>> 0 > $5_1 >>> 0) { + break label$8; + } + while (1) { + HEAP322[$2_1 >> 2] = HEAP322[$1_1 >> 2]; + HEAP322[$2_1 + 4 >> 2] = HEAP322[$1_1 + 4 >> 2]; + HEAP322[$2_1 + 8 >> 2] = HEAP322[$1_1 + 8 >> 2]; + HEAP322[$2_1 + 12 >> 2] = HEAP322[$1_1 + 12 >> 2]; + HEAP322[$2_1 + 16 >> 2] = HEAP322[$1_1 + 16 >> 2]; + HEAP322[$2_1 + 20 >> 2] = HEAP322[$1_1 + 20 >> 2]; + HEAP322[$2_1 + 24 >> 2] = HEAP322[$1_1 + 24 >> 2]; + HEAP322[$2_1 + 28 >> 2] = HEAP322[$1_1 + 28 >> 2]; + HEAP322[$2_1 + 32 >> 2] = HEAP322[$1_1 + 32 >> 2]; + HEAP322[$2_1 + 36 >> 2] = HEAP322[$1_1 + 36 >> 2]; + HEAP322[$2_1 + 40 >> 2] = HEAP322[$1_1 + 40 >> 2]; + HEAP322[$2_1 + 44 >> 2] = HEAP322[$1_1 + 44 >> 2]; + HEAP322[$2_1 + 48 >> 2] = HEAP322[$1_1 + 48 >> 2]; + HEAP322[$2_1 + 52 >> 2] = HEAP322[$1_1 + 52 >> 2]; + HEAP322[$2_1 + 56 >> 2] = HEAP322[$1_1 + 56 >> 2]; + HEAP322[$2_1 + 60 >> 2] = HEAP322[$1_1 + 60 >> 2]; + $1_1 = $1_1 - -64 | 0; + $2_1 = $2_1 - -64 | 0; + if ($2_1 >>> 0 <= $5_1 >>> 0) { + continue; + } + break; + } + } + if ($2_1 >>> 0 >= $3_1 >>> 0) { + break label$2; + } + while (1) { + HEAP322[$2_1 >> 2] = HEAP322[$1_1 >> 2]; + $1_1 = $1_1 + 4 | 0; + $2_1 = $2_1 + 4 | 0; + if ($2_1 >>> 0 < $3_1 >>> 0) { + continue; + } + break; + } + break label$2; + } + if ($4_1 >>> 0 < 4) { + $2_1 = $0; + break label$2; + } + $3_1 = $4_1 + -4 | 0; + if ($3_1 >>> 0 < $0 >>> 0) { + $2_1 = $0; + break label$2; + } + $2_1 = $0; + while (1) { + HEAP82[$2_1 | 0] = HEAPU82[$1_1 | 0]; + HEAP82[$2_1 + 1 | 0] = HEAPU82[$1_1 + 1 | 0]; + HEAP82[$2_1 + 2 | 0] = HEAPU82[$1_1 + 2 | 0]; + HEAP82[$2_1 + 3 | 0] = HEAPU82[$1_1 + 3 | 0]; + $1_1 = $1_1 + 4 | 0; + $2_1 = $2_1 + 4 | 0; + if ($2_1 >>> 0 <= $3_1 >>> 0) { + continue; + } + break; + } + } + if ($2_1 >>> 0 < $4_1 >>> 0) { + while (1) { + HEAP82[$2_1 | 0] = HEAPU82[$1_1 | 0]; + $1_1 = $1_1 + 1 | 0; + $2_1 = $2_1 + 1 | 0; + if (($4_1 | 0) != ($2_1 | 0)) { + continue; + } + break; + } + } + return $0; + } + function $79($0, $1_1) { + var $2_1 = 0, $3_1 = 0; + label$1: { + if (!$1_1) { + break label$1; + } + $2_1 = $0 + $1_1 | 0; + HEAP82[$2_1 + -1 | 0] = 0; + HEAP82[$0 | 0] = 0; + if ($1_1 >>> 0 < 3) { + break label$1; + } + HEAP82[$2_1 + -2 | 0] = 0; + HEAP82[$0 + 1 | 0] = 0; + HEAP82[$2_1 + -3 | 0] = 0; + HEAP82[$0 + 2 | 0] = 0; + if ($1_1 >>> 0 < 7) { + break label$1; + } + HEAP82[$2_1 + -4 | 0] = 0; + HEAP82[$0 + 3 | 0] = 0; + if ($1_1 >>> 0 < 9) { + break label$1; + } + $3_1 = 0 - $0 & 3; + $2_1 = $3_1 + $0 | 0; + HEAP322[$2_1 >> 2] = 0; + $3_1 = $1_1 - $3_1 & -4; + $1_1 = $3_1 + $2_1 | 0; + HEAP322[$1_1 + -4 >> 2] = 0; + if ($3_1 >>> 0 < 9) { + break label$1; + } + HEAP322[$2_1 + 8 >> 2] = 0; + HEAP322[$2_1 + 4 >> 2] = 0; + HEAP322[$1_1 + -8 >> 2] = 0; + HEAP322[$1_1 + -12 >> 2] = 0; + if ($3_1 >>> 0 < 25) { + break label$1; + } + HEAP322[$2_1 + 24 >> 2] = 0; + HEAP322[$2_1 + 20 >> 2] = 0; + HEAP322[$2_1 + 16 >> 2] = 0; + HEAP322[$2_1 + 12 >> 2] = 0; + HEAP322[$1_1 + -16 >> 2] = 0; + HEAP322[$1_1 + -20 >> 2] = 0; + HEAP322[$1_1 + -24 >> 2] = 0; + HEAP322[$1_1 + -28 >> 2] = 0; + $1_1 = $3_1; + $3_1 = $2_1 & 4 | 24; + $1_1 = $1_1 - $3_1 | 0; + if ($1_1 >>> 0 < 32) { + break label$1; + } + $2_1 = $2_1 + $3_1 | 0; + while (1) { + HEAP322[$2_1 + 24 >> 2] = 0; + HEAP322[$2_1 + 28 >> 2] = 0; + HEAP322[$2_1 + 16 >> 2] = 0; + HEAP322[$2_1 + 20 >> 2] = 0; + HEAP322[$2_1 + 8 >> 2] = 0; + HEAP322[$2_1 + 12 >> 2] = 0; + HEAP322[$2_1 >> 2] = 0; + HEAP322[$2_1 + 4 >> 2] = 0; + $2_1 = $2_1 + 32 | 0; + $1_1 = $1_1 + -32 | 0; + if ($1_1 >>> 0 > 31) { + continue; + } + break; + } + } + return $0; + } + function $80($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0; + label$1: { + if (($0 | 0) == ($1_1 | 0)) { + break label$1; + } + label$2: { + if ($1_1 + $2_1 >>> 0 > $0 >>> 0) { + $4_1 = $0 + $2_1 | 0; + if ($4_1 >>> 0 > $1_1 >>> 0) { + break label$2; + } + } + return $78($0, $1_1, $2_1); + } + $3_1 = ($0 ^ $1_1) & 3; + label$4: { + label$5: { + if ($0 >>> 0 < $1_1 >>> 0) { + if ($3_1) { + $3_1 = $0; + break label$4; + } + if (!($0 & 3)) { + $3_1 = $0; + break label$5; + } + $3_1 = $0; + while (1) { + if (!$2_1) { + break label$1; + } + HEAP82[$3_1 | 0] = HEAPU82[$1_1 | 0]; + $1_1 = $1_1 + 1 | 0; + $2_1 = $2_1 + -1 | 0; + $3_1 = $3_1 + 1 | 0; + if ($3_1 & 3) { + continue; + } + break; + } + break label$5; + } + label$10: { + if ($3_1) { + break label$10; + } + if ($4_1 & 3) { + while (1) { + if (!$2_1) { + break label$1; + } + $2_1 = $2_1 + -1 | 0; + $3_1 = $2_1 + $0 | 0; + HEAP82[$3_1 | 0] = HEAPU82[$1_1 + $2_1 | 0]; + if ($3_1 & 3) { + continue; + } + break; + } + } + if ($2_1 >>> 0 <= 3) { + break label$10; + } + while (1) { + $2_1 = $2_1 + -4 | 0; + HEAP322[$2_1 + $0 >> 2] = HEAP322[$1_1 + $2_1 >> 2]; + if ($2_1 >>> 0 > 3) { + continue; + } + break; + } + } + if (!$2_1) { + break label$1; + } + while (1) { + $2_1 = $2_1 + -1 | 0; + HEAP82[$2_1 + $0 | 0] = HEAPU82[$1_1 + $2_1 | 0]; + if ($2_1) { + continue; + } + break; + } + break label$1; + } + if ($2_1 >>> 0 <= 3) { + break label$4; + } + while (1) { + HEAP322[$3_1 >> 2] = HEAP322[$1_1 >> 2]; + $1_1 = $1_1 + 4 | 0; + $3_1 = $3_1 + 4 | 0; + $2_1 = $2_1 + -4 | 0; + if ($2_1 >>> 0 > 3) { + continue; + } + break; + } + } + if (!$2_1) { + break label$1; + } + while (1) { + HEAP82[$3_1 | 0] = HEAPU82[$1_1 | 0]; + $3_1 = $3_1 + 1 | 0; + $1_1 = $1_1 + 1 | 0; + $2_1 = $2_1 + -1 | 0; + if ($2_1) { + continue; + } + break; + } + } + return $0; + } + function $81() { + return 33584; + } + function $82($0) { + var $1_1 = 0, $2_1 = 0; + $1_1 = HEAP322[8524]; + $2_1 = $0 + 3 & -4; + $0 = $1_1 + $2_1 | 0; + label$1: { + if ($0 >>> 0 <= $1_1 >>> 0 ? ($2_1 | 0) >= 1 : 0) { + break label$1; + } + if ($0 >>> 0 > __wasm_memory_size() << 16 >>> 0) { + if (!fimport$1($0 | 0)) { + break label$1; + } + } + HEAP322[8524] = $0; + return $1_1; + } + HEAP322[8396] = 48; + return -1; + } + function $83($0) { + $0 = $0 | 0; + var $1_1 = 0, $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10_1 = 0, $11_1 = 0; + $11_1 = global$0 - 16 | 0; + global$0 = $11_1; + label$1: { + label$2: { + label$3: { + label$4: { + label$5: { + label$6: { + label$7: { + label$8: { + label$9: { + label$10: { + label$11: { + if ($0 >>> 0 <= 244) { + $6_1 = HEAP322[8397]; + $5_1 = $0 >>> 0 < 11 ? 16 : $0 + 11 & -8; + $0 = $5_1 >>> 3 | 0; + $1_1 = $6_1 >>> $0 | 0; + if ($1_1 & 3) { + $2_1 = $0 + (($1_1 ^ -1) & 1) | 0; + $5_1 = $2_1 << 3; + $1_1 = HEAP322[$5_1 + 33636 >> 2]; + $0 = $1_1 + 8 | 0; + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = $5_1 + 33628 | 0; + label$14: { + if (($3_1 | 0) == ($5_1 | 0)) { + HEAP322[8397] = __wasm_rotl_i32($2_1) & $6_1; + break label$14; + } + HEAP322[$3_1 + 12 >> 2] = $5_1; + HEAP322[$5_1 + 8 >> 2] = $3_1; + } + $2_1 = $2_1 << 3; + HEAP322[$1_1 + 4 >> 2] = $2_1 | 3; + $1_1 = $1_1 + $2_1 | 0; + HEAP322[$1_1 + 4 >> 2] = HEAP322[$1_1 + 4 >> 2] | 1; + break label$1; + } + $7_1 = HEAP322[8399]; + if ($5_1 >>> 0 <= $7_1 >>> 0) { + break label$11; + } + if ($1_1) { + $2_1 = 2 << $0; + $0 = (0 - $2_1 | $2_1) & $1_1 << $0; + $0 = (0 - $0 & $0) + -1 | 0; + $1_1 = $0 >>> 12 & 16; + $2_1 = $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 5 & 8; + $2_1 = $2_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 2 & 4; + $2_1 = $2_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 1 & 2; + $2_1 = $2_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 1 & 1; + $2_1 = ($2_1 | $1_1) + ($0 >>> $1_1 | 0) | 0; + $3_1 = $2_1 << 3; + $1_1 = HEAP322[$3_1 + 33636 >> 2]; + $0 = HEAP322[$1_1 + 8 >> 2]; + $3_1 = $3_1 + 33628 | 0; + label$17: { + if (($0 | 0) == ($3_1 | 0)) { + $6_1 = __wasm_rotl_i32($2_1) & $6_1; + HEAP322[8397] = $6_1; + break label$17; + } + HEAP322[$0 + 12 >> 2] = $3_1; + HEAP322[$3_1 + 8 >> 2] = $0; + } + $0 = $1_1 + 8 | 0; + HEAP322[$1_1 + 4 >> 2] = $5_1 | 3; + $4_1 = $1_1 + $5_1 | 0; + $2_1 = $2_1 << 3; + $3_1 = $2_1 - $5_1 | 0; + HEAP322[$4_1 + 4 >> 2] = $3_1 | 1; + HEAP322[$1_1 + $2_1 >> 2] = $3_1; + if ($7_1) { + $5_1 = $7_1 >>> 3 | 0; + $1_1 = ($5_1 << 3) + 33628 | 0; + $2_1 = HEAP322[8402]; + $5_1 = 1 << $5_1; + label$20: { + if (!($5_1 & $6_1)) { + HEAP322[8397] = $5_1 | $6_1; + $5_1 = $1_1; + break label$20; + } + $5_1 = HEAP322[$1_1 + 8 >> 2]; + } + HEAP322[$1_1 + 8 >> 2] = $2_1; + HEAP322[$5_1 + 12 >> 2] = $2_1; + HEAP322[$2_1 + 12 >> 2] = $1_1; + HEAP322[$2_1 + 8 >> 2] = $5_1; + } + HEAP322[8402] = $4_1; + HEAP322[8399] = $3_1; + break label$1; + } + $10_1 = HEAP322[8398]; + if (!$10_1) { + break label$11; + } + $0 = ($10_1 & 0 - $10_1) + -1 | 0; + $1_1 = $0 >>> 12 & 16; + $2_1 = $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 5 & 8; + $2_1 = $2_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 2 & 4; + $2_1 = $2_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 1 & 2; + $2_1 = $2_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 1 & 1; + $1_1 = HEAP322[(($2_1 | $1_1) + ($0 >>> $1_1 | 0) << 2) + 33892 >> 2]; + $3_1 = (HEAP322[$1_1 + 4 >> 2] & -8) - $5_1 | 0; + $2_1 = $1_1; + while (1) { + label$23: { + $0 = HEAP322[$2_1 + 16 >> 2]; + if (!$0) { + $0 = HEAP322[$2_1 + 20 >> 2]; + if (!$0) { + break label$23; + } + } + $4_1 = (HEAP322[$0 + 4 >> 2] & -8) - $5_1 | 0; + $2_1 = $4_1 >>> 0 < $3_1 >>> 0; + $3_1 = $2_1 ? $4_1 : $3_1; + $1_1 = $2_1 ? $0 : $1_1; + $2_1 = $0; + continue; + } + break; + } + $9_1 = HEAP322[$1_1 + 24 >> 2]; + $4_1 = HEAP322[$1_1 + 12 >> 2]; + if (($4_1 | 0) != ($1_1 | 0)) { + $0 = HEAP322[$1_1 + 8 >> 2]; + HEAP322[$0 + 12 >> 2] = $4_1; + HEAP322[$4_1 + 8 >> 2] = $0; + break label$2; + } + $2_1 = $1_1 + 20 | 0; + $0 = HEAP322[$2_1 >> 2]; + if (!$0) { + $0 = HEAP322[$1_1 + 16 >> 2]; + if (!$0) { + break label$10; + } + $2_1 = $1_1 + 16 | 0; + } + while (1) { + $8_1 = $2_1; + $4_1 = $0; + $2_1 = $0 + 20 | 0; + $0 = HEAP322[$2_1 >> 2]; + if ($0) { + continue; + } + $2_1 = $4_1 + 16 | 0; + $0 = HEAP322[$4_1 + 16 >> 2]; + if ($0) { + continue; + } + break; + } + HEAP322[$8_1 >> 2] = 0; + break label$2; + } + $5_1 = -1; + if ($0 >>> 0 > 4294967231) { + break label$11; + } + $0 = $0 + 11 | 0; + $5_1 = $0 & -8; + $8_1 = HEAP322[8398]; + if (!$8_1) { + break label$11; + } + $2_1 = 0 - $5_1 | 0; + $0 = $0 >>> 8 | 0; + $7_1 = 0; + label$29: { + if (!$0) { + break label$29; + } + $7_1 = 31; + if ($5_1 >>> 0 > 16777215) { + break label$29; + } + $3_1 = $0 + 1048320 >>> 16 & 8; + $1_1 = $0 << $3_1; + $0 = $1_1 + 520192 >>> 16 & 4; + $6_1 = $1_1 << $0; + $1_1 = $6_1 + 245760 >>> 16 & 2; + $0 = ($6_1 << $1_1 >>> 15 | 0) - ($1_1 | ($0 | $3_1)) | 0; + $7_1 = ($0 << 1 | $5_1 >>> $0 + 21 & 1) + 28 | 0; + } + $3_1 = HEAP322[($7_1 << 2) + 33892 >> 2]; + label$30: { + label$31: { + label$32: { + if (!$3_1) { + $0 = 0; + break label$32; + } + $1_1 = $5_1 << (($7_1 | 0) == 31 ? 0 : 25 - ($7_1 >>> 1 | 0) | 0); + $0 = 0; + while (1) { + label$35: { + $6_1 = (HEAP322[$3_1 + 4 >> 2] & -8) - $5_1 | 0; + if ($6_1 >>> 0 >= $2_1 >>> 0) { + break label$35; + } + $4_1 = $3_1; + $2_1 = $6_1; + if ($2_1) { + break label$35; + } + $2_1 = 0; + $0 = $3_1; + break label$31; + } + $6_1 = HEAP322[$3_1 + 20 >> 2]; + $3_1 = HEAP322[(($1_1 >>> 29 & 4) + $3_1 | 0) + 16 >> 2]; + $0 = $6_1 ? ($6_1 | 0) == ($3_1 | 0) ? $0 : $6_1 : $0; + $1_1 = $1_1 << (($3_1 | 0) != 0); + if ($3_1) { + continue; + } + break; + } + } + if (!($0 | $4_1)) { + $0 = 2 << $7_1; + $0 = (0 - $0 | $0) & $8_1; + if (!$0) { + break label$11; + } + $0 = ($0 & 0 - $0) + -1 | 0; + $1_1 = $0 >>> 12 & 16; + $3_1 = $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 5 & 8; + $3_1 = $3_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 2 & 4; + $3_1 = $3_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 1 & 2; + $3_1 = $3_1 | $1_1; + $0 = $0 >>> $1_1 | 0; + $1_1 = $0 >>> 1 & 1; + $0 = HEAP322[(($3_1 | $1_1) + ($0 >>> $1_1 | 0) << 2) + 33892 >> 2]; + } + if (!$0) { + break label$30; + } + } + while (1) { + $3_1 = (HEAP322[$0 + 4 >> 2] & -8) - $5_1 | 0; + $1_1 = $3_1 >>> 0 < $2_1 >>> 0; + $2_1 = $1_1 ? $3_1 : $2_1; + $4_1 = $1_1 ? $0 : $4_1; + $1_1 = HEAP322[$0 + 16 >> 2]; + if ($1_1) { + $0 = $1_1; + } else { + $0 = HEAP322[$0 + 20 >> 2]; + } + if ($0) { + continue; + } + break; + } + } + if (!$4_1 | $2_1 >>> 0 >= HEAP322[8399] - $5_1 >>> 0) { + break label$11; + } + $7_1 = HEAP322[$4_1 + 24 >> 2]; + $1_1 = HEAP322[$4_1 + 12 >> 2]; + if (($4_1 | 0) != ($1_1 | 0)) { + $0 = HEAP322[$4_1 + 8 >> 2]; + HEAP322[$0 + 12 >> 2] = $1_1; + HEAP322[$1_1 + 8 >> 2] = $0; + break label$3; + } + $3_1 = $4_1 + 20 | 0; + $0 = HEAP322[$3_1 >> 2]; + if (!$0) { + $0 = HEAP322[$4_1 + 16 >> 2]; + if (!$0) { + break label$9; + } + $3_1 = $4_1 + 16 | 0; + } + while (1) { + $6_1 = $3_1; + $1_1 = $0; + $3_1 = $0 + 20 | 0; + $0 = HEAP322[$3_1 >> 2]; + if ($0) { + continue; + } + $3_1 = $1_1 + 16 | 0; + $0 = HEAP322[$1_1 + 16 >> 2]; + if ($0) { + continue; + } + break; + } + HEAP322[$6_1 >> 2] = 0; + break label$3; + } + $1_1 = HEAP322[8399]; + if ($1_1 >>> 0 >= $5_1 >>> 0) { + $0 = HEAP322[8402]; + $2_1 = $1_1 - $5_1 | 0; + label$45: { + if ($2_1 >>> 0 >= 16) { + HEAP322[8399] = $2_1; + $3_1 = $0 + $5_1 | 0; + HEAP322[8402] = $3_1; + HEAP322[$3_1 + 4 >> 2] = $2_1 | 1; + HEAP322[$0 + $1_1 >> 2] = $2_1; + HEAP322[$0 + 4 >> 2] = $5_1 | 3; + break label$45; + } + HEAP322[8402] = 0; + HEAP322[8399] = 0; + HEAP322[$0 + 4 >> 2] = $1_1 | 3; + $1_1 = $0 + $1_1 | 0; + HEAP322[$1_1 + 4 >> 2] = HEAP322[$1_1 + 4 >> 2] | 1; + } + $0 = $0 + 8 | 0; + break label$1; + } + $1_1 = HEAP322[8400]; + if ($1_1 >>> 0 > $5_1 >>> 0) { + $1_1 = $1_1 - $5_1 | 0; + HEAP322[8400] = $1_1; + $0 = HEAP322[8403]; + $2_1 = $0 + $5_1 | 0; + HEAP322[8403] = $2_1; + HEAP322[$2_1 + 4 >> 2] = $1_1 | 1; + HEAP322[$0 + 4 >> 2] = $5_1 | 3; + $0 = $0 + 8 | 0; + break label$1; + } + $0 = 0; + $4_1 = $5_1 + 47 | 0; + $3_1 = $4_1; + if (HEAP322[8515]) { + $2_1 = HEAP322[8517]; + } else { + HEAP322[8518] = -1; + HEAP322[8519] = -1; + HEAP322[8516] = 4096; + HEAP322[8517] = 4096; + HEAP322[8515] = $11_1 + 12 & -16 ^ 1431655768; + HEAP322[8520] = 0; + HEAP322[8508] = 0; + $2_1 = 4096; + } + $6_1 = $3_1 + $2_1 | 0; + $8_1 = 0 - $2_1 | 0; + $2_1 = $6_1 & $8_1; + if ($2_1 >>> 0 <= $5_1 >>> 0) { + break label$1; + } + $3_1 = HEAP322[8507]; + if ($3_1) { + $7_1 = HEAP322[8505]; + $9_1 = $7_1 + $2_1 | 0; + if ($9_1 >>> 0 <= $7_1 >>> 0 | $9_1 >>> 0 > $3_1 >>> 0) { + break label$1; + } + } + if (HEAPU82[34032] & 4) { + break label$6; + } + label$51: { + label$52: { + $3_1 = HEAP322[8403]; + if ($3_1) { + $0 = 34036; + while (1) { + $7_1 = HEAP322[$0 >> 2]; + if ($7_1 + HEAP322[$0 + 4 >> 2] >>> 0 > $3_1 >>> 0 ? $7_1 >>> 0 <= $3_1 >>> 0 : 0) { + break label$52; + } + $0 = HEAP322[$0 + 8 >> 2]; + if ($0) { + continue; + } + break; + } + } + $1_1 = $82(0); + if (($1_1 | 0) == -1) { + break label$7; + } + $6_1 = $2_1; + $0 = HEAP322[8516]; + $3_1 = $0 + -1 | 0; + if ($3_1 & $1_1) { + $6_1 = ($2_1 - $1_1 | 0) + ($1_1 + $3_1 & 0 - $0) | 0; + } + if ($6_1 >>> 0 <= $5_1 >>> 0 | $6_1 >>> 0 > 2147483646) { + break label$7; + } + $0 = HEAP322[8507]; + if ($0) { + $3_1 = HEAP322[8505]; + $8_1 = $3_1 + $6_1 | 0; + if ($8_1 >>> 0 <= $3_1 >>> 0 | $8_1 >>> 0 > $0 >>> 0) { + break label$7; + } + } + $0 = $82($6_1); + if (($1_1 | 0) != ($0 | 0)) { + break label$51; + } + break label$5; + } + $6_1 = $8_1 & $6_1 - $1_1; + if ($6_1 >>> 0 > 2147483646) { + break label$7; + } + $1_1 = $82($6_1); + if (($1_1 | 0) == (HEAP322[$0 >> 2] + HEAP322[$0 + 4 >> 2] | 0)) { + break label$8; + } + $0 = $1_1; + } + if (!(($0 | 0) == -1 | $5_1 + 48 >>> 0 <= $6_1 >>> 0)) { + $1_1 = HEAP322[8517]; + $1_1 = $1_1 + ($4_1 - $6_1 | 0) & 0 - $1_1; + if ($1_1 >>> 0 > 2147483646) { + $1_1 = $0; + break label$5; + } + if (($82($1_1) | 0) != -1) { + $6_1 = $1_1 + $6_1 | 0; + $1_1 = $0; + break label$5; + } + $82(0 - $6_1 | 0); + break label$7; + } + $1_1 = $0; + if (($0 | 0) != -1) { + break label$5; + } + break label$7; + } + $4_1 = 0; + break label$2; + } + $1_1 = 0; + break label$3; + } + if (($1_1 | 0) != -1) { + break label$5; + } + } + HEAP322[8508] = HEAP322[8508] | 4; + } + if ($2_1 >>> 0 > 2147483646) { + break label$4; + } + $1_1 = $82($2_1); + $0 = $82(0); + if ($1_1 >>> 0 >= $0 >>> 0 | ($1_1 | 0) == -1 | ($0 | 0) == -1) { + break label$4; + } + $6_1 = $0 - $1_1 | 0; + if ($6_1 >>> 0 <= $5_1 + 40 >>> 0) { + break label$4; + } + } + $0 = HEAP322[8505] + $6_1 | 0; + HEAP322[8505] = $0; + if ($0 >>> 0 > HEAPU322[8506]) { + HEAP322[8506] = $0; + } + label$62: { + label$63: { + label$64: { + $3_1 = HEAP322[8403]; + if ($3_1) { + $0 = 34036; + while (1) { + $2_1 = HEAP322[$0 >> 2]; + $4_1 = HEAP322[$0 + 4 >> 2]; + if (($2_1 + $4_1 | 0) == ($1_1 | 0)) { + break label$64; + } + $0 = HEAP322[$0 + 8 >> 2]; + if ($0) { + continue; + } + break; + } + break label$63; + } + $0 = HEAP322[8401]; + if (!($1_1 >>> 0 >= $0 >>> 0 ? $0 : 0)) { + HEAP322[8401] = $1_1; + } + $0 = 0; + HEAP322[8510] = $6_1; + HEAP322[8509] = $1_1; + HEAP322[8405] = -1; + HEAP322[8406] = HEAP322[8515]; + HEAP322[8512] = 0; + while (1) { + $2_1 = $0 << 3; + $3_1 = $2_1 + 33628 | 0; + HEAP322[$2_1 + 33636 >> 2] = $3_1; + HEAP322[$2_1 + 33640 >> 2] = $3_1; + $0 = $0 + 1 | 0; + if (($0 | 0) != 32) { + continue; + } + break; + } + $0 = $6_1 + -40 | 0; + $2_1 = $1_1 + 8 & 7 ? -8 - $1_1 & 7 : 0; + $3_1 = $0 - $2_1 | 0; + HEAP322[8400] = $3_1; + $2_1 = $1_1 + $2_1 | 0; + HEAP322[8403] = $2_1; + HEAP322[$2_1 + 4 >> 2] = $3_1 | 1; + HEAP322[($0 + $1_1 | 0) + 4 >> 2] = 40; + HEAP322[8404] = HEAP322[8519]; + break label$62; + } + if (HEAPU82[$0 + 12 | 0] & 8 | $1_1 >>> 0 <= $3_1 >>> 0 | $2_1 >>> 0 > $3_1 >>> 0) { + break label$63; + } + HEAP322[$0 + 4 >> 2] = $4_1 + $6_1; + $0 = $3_1 + 8 & 7 ? -8 - $3_1 & 7 : 0; + $1_1 = $0 + $3_1 | 0; + HEAP322[8403] = $1_1; + $2_1 = HEAP322[8400] + $6_1 | 0; + $0 = $2_1 - $0 | 0; + HEAP322[8400] = $0; + HEAP322[$1_1 + 4 >> 2] = $0 | 1; + HEAP322[($2_1 + $3_1 | 0) + 4 >> 2] = 40; + HEAP322[8404] = HEAP322[8519]; + break label$62; + } + $0 = HEAP322[8401]; + if ($1_1 >>> 0 < $0 >>> 0) { + HEAP322[8401] = $1_1; + $0 = 0; + } + $2_1 = $1_1 + $6_1 | 0; + $0 = 34036; + label$70: { + label$71: { + label$72: { + label$73: { + label$74: { + label$75: { + while (1) { + if (($2_1 | 0) != HEAP322[$0 >> 2]) { + $0 = HEAP322[$0 + 8 >> 2]; + if ($0) { + continue; + } + break label$75; + } + break; + } + if (!(HEAPU82[$0 + 12 | 0] & 8)) { + break label$74; + } + } + $0 = 34036; + while (1) { + $2_1 = HEAP322[$0 >> 2]; + if ($2_1 >>> 0 <= $3_1 >>> 0) { + $4_1 = $2_1 + HEAP322[$0 + 4 >> 2] | 0; + if ($4_1 >>> 0 > $3_1 >>> 0) { + break label$73; + } + } + $0 = HEAP322[$0 + 8 >> 2]; + continue; + } + } + HEAP322[$0 >> 2] = $1_1; + HEAP322[$0 + 4 >> 2] = HEAP322[$0 + 4 >> 2] + $6_1; + $7_1 = ($1_1 + 8 & 7 ? -8 - $1_1 & 7 : 0) + $1_1 | 0; + HEAP322[$7_1 + 4 >> 2] = $5_1 | 3; + $1_1 = $2_1 + ($2_1 + 8 & 7 ? -8 - $2_1 & 7 : 0) | 0; + $0 = ($1_1 - $7_1 | 0) - $5_1 | 0; + $4_1 = $5_1 + $7_1 | 0; + if (($1_1 | 0) == ($3_1 | 0)) { + HEAP322[8403] = $4_1; + $0 = HEAP322[8400] + $0 | 0; + HEAP322[8400] = $0; + HEAP322[$4_1 + 4 >> 2] = $0 | 1; + break label$71; + } + if (HEAP322[8402] == ($1_1 | 0)) { + HEAP322[8402] = $4_1; + $0 = HEAP322[8399] + $0 | 0; + HEAP322[8399] = $0; + HEAP322[$4_1 + 4 >> 2] = $0 | 1; + HEAP322[$0 + $4_1 >> 2] = $0; + break label$71; + } + $2_1 = HEAP322[$1_1 + 4 >> 2]; + if (($2_1 & 3) == 1) { + $9_1 = $2_1 & -8; + label$83: { + if ($2_1 >>> 0 <= 255) { + $3_1 = HEAP322[$1_1 + 8 >> 2]; + $5_1 = $2_1 >>> 3 | 0; + $2_1 = HEAP322[$1_1 + 12 >> 2]; + if (($2_1 | 0) == ($3_1 | 0)) { + HEAP322[8397] = HEAP322[8397] & __wasm_rotl_i32($5_1); + break label$83; + } + HEAP322[$3_1 + 12 >> 2] = $2_1; + HEAP322[$2_1 + 8 >> 2] = $3_1; + break label$83; + } + $8_1 = HEAP322[$1_1 + 24 >> 2]; + $6_1 = HEAP322[$1_1 + 12 >> 2]; + label$86: { + if (($6_1 | 0) != ($1_1 | 0)) { + $2_1 = HEAP322[$1_1 + 8 >> 2]; + HEAP322[$2_1 + 12 >> 2] = $6_1; + HEAP322[$6_1 + 8 >> 2] = $2_1; + break label$86; + } + label$89: { + $3_1 = $1_1 + 20 | 0; + $5_1 = HEAP322[$3_1 >> 2]; + if ($5_1) { + break label$89; + } + $3_1 = $1_1 + 16 | 0; + $5_1 = HEAP322[$3_1 >> 2]; + if ($5_1) { + break label$89; + } + $6_1 = 0; + break label$86; + } + while (1) { + $2_1 = $3_1; + $6_1 = $5_1; + $3_1 = $5_1 + 20 | 0; + $5_1 = HEAP322[$3_1 >> 2]; + if ($5_1) { + continue; + } + $3_1 = $6_1 + 16 | 0; + $5_1 = HEAP322[$6_1 + 16 >> 2]; + if ($5_1) { + continue; + } + break; + } + HEAP322[$2_1 >> 2] = 0; + } + if (!$8_1) { + break label$83; + } + $2_1 = HEAP322[$1_1 + 28 >> 2]; + $3_1 = ($2_1 << 2) + 33892 | 0; + label$91: { + if (HEAP322[$3_1 >> 2] == ($1_1 | 0)) { + HEAP322[$3_1 >> 2] = $6_1; + if ($6_1) { + break label$91; + } + HEAP322[8398] = HEAP322[8398] & __wasm_rotl_i32($2_1); + break label$83; + } + HEAP322[$8_1 + (HEAP322[$8_1 + 16 >> 2] == ($1_1 | 0) ? 16 : 20) >> 2] = $6_1; + if (!$6_1) { + break label$83; + } + } + HEAP322[$6_1 + 24 >> 2] = $8_1; + $2_1 = HEAP322[$1_1 + 16 >> 2]; + if ($2_1) { + HEAP322[$6_1 + 16 >> 2] = $2_1; + HEAP322[$2_1 + 24 >> 2] = $6_1; + } + $2_1 = HEAP322[$1_1 + 20 >> 2]; + if (!$2_1) { + break label$83; + } + HEAP322[$6_1 + 20 >> 2] = $2_1; + HEAP322[$2_1 + 24 >> 2] = $6_1; + } + $1_1 = $1_1 + $9_1 | 0; + $0 = $0 + $9_1 | 0; + } + HEAP322[$1_1 + 4 >> 2] = HEAP322[$1_1 + 4 >> 2] & -2; + HEAP322[$4_1 + 4 >> 2] = $0 | 1; + HEAP322[$0 + $4_1 >> 2] = $0; + if ($0 >>> 0 <= 255) { + $1_1 = $0 >>> 3 | 0; + $0 = ($1_1 << 3) + 33628 | 0; + $2_1 = HEAP322[8397]; + $1_1 = 1 << $1_1; + label$95: { + if (!($2_1 & $1_1)) { + HEAP322[8397] = $1_1 | $2_1; + $1_1 = $0; + break label$95; + } + $1_1 = HEAP322[$0 + 8 >> 2]; + } + HEAP322[$0 + 8 >> 2] = $4_1; + HEAP322[$1_1 + 12 >> 2] = $4_1; + HEAP322[$4_1 + 12 >> 2] = $0; + HEAP322[$4_1 + 8 >> 2] = $1_1; + break label$71; + } + $6_1 = $4_1; + $1_1 = $0 >>> 8 | 0; + $2_1 = 0; + label$97: { + if (!$1_1) { + break label$97; + } + $2_1 = 31; + if ($0 >>> 0 > 16777215) { + break label$97; + } + $3_1 = $1_1 + 1048320 >>> 16 & 8; + $2_1 = $1_1 << $3_1; + $1_1 = $2_1 + 520192 >>> 16 & 4; + $5_1 = $2_1 << $1_1; + $2_1 = $5_1 + 245760 >>> 16 & 2; + $1_1 = ($5_1 << $2_1 >>> 15 | 0) - ($2_1 | ($1_1 | $3_1)) | 0; + $2_1 = ($1_1 << 1 | $0 >>> $1_1 + 21 & 1) + 28 | 0; + } + $1_1 = $2_1; + HEAP322[$6_1 + 28 >> 2] = $1_1; + HEAP322[$4_1 + 16 >> 2] = 0; + HEAP322[$4_1 + 20 >> 2] = 0; + $2_1 = ($1_1 << 2) + 33892 | 0; + $3_1 = HEAP322[8398]; + $5_1 = 1 << $1_1; + label$98: { + if (!($3_1 & $5_1)) { + HEAP322[8398] = $3_1 | $5_1; + HEAP322[$2_1 >> 2] = $4_1; + break label$98; + } + $3_1 = $0 << (($1_1 | 0) == 31 ? 0 : 25 - ($1_1 >>> 1 | 0) | 0); + $1_1 = HEAP322[$2_1 >> 2]; + while (1) { + $2_1 = $1_1; + if ((HEAP322[$1_1 + 4 >> 2] & -8) == ($0 | 0)) { + break label$72; + } + $1_1 = $3_1 >>> 29 | 0; + $3_1 = $3_1 << 1; + $5_1 = ($2_1 + ($1_1 & 4) | 0) + 16 | 0; + $1_1 = HEAP322[$5_1 >> 2]; + if ($1_1) { + continue; + } + break; + } + HEAP322[$5_1 >> 2] = $4_1; + } + HEAP322[$4_1 + 24 >> 2] = $2_1; + HEAP322[$4_1 + 12 >> 2] = $4_1; + HEAP322[$4_1 + 8 >> 2] = $4_1; + break label$71; + } + $0 = $6_1 + -40 | 0; + $2_1 = $1_1 + 8 & 7 ? -8 - $1_1 & 7 : 0; + $8_1 = $0 - $2_1 | 0; + HEAP322[8400] = $8_1; + $2_1 = $1_1 + $2_1 | 0; + HEAP322[8403] = $2_1; + HEAP322[$2_1 + 4 >> 2] = $8_1 | 1; + HEAP322[($0 + $1_1 | 0) + 4 >> 2] = 40; + HEAP322[8404] = HEAP322[8519]; + $0 = ($4_1 + ($4_1 + -39 & 7 ? 39 - $4_1 & 7 : 0) | 0) + -47 | 0; + $2_1 = $0 >>> 0 < $3_1 + 16 >>> 0 ? $3_1 : $0; + HEAP322[$2_1 + 4 >> 2] = 27; + $0 = HEAP322[8512]; + HEAP322[$2_1 + 16 >> 2] = HEAP322[8511]; + HEAP322[$2_1 + 20 >> 2] = $0; + $0 = HEAP322[8510]; + HEAP322[$2_1 + 8 >> 2] = HEAP322[8509]; + HEAP322[$2_1 + 12 >> 2] = $0; + HEAP322[8511] = $2_1 + 8; + HEAP322[8510] = $6_1; + HEAP322[8509] = $1_1; + HEAP322[8512] = 0; + $0 = $2_1 + 24 | 0; + while (1) { + HEAP322[$0 + 4 >> 2] = 7; + $1_1 = $0 + 8 | 0; + $0 = $0 + 4 | 0; + if ($4_1 >>> 0 > $1_1 >>> 0) { + continue; + } + break; + } + if (($2_1 | 0) == ($3_1 | 0)) { + break label$62; + } + HEAP322[$2_1 + 4 >> 2] = HEAP322[$2_1 + 4 >> 2] & -2; + $6_1 = $2_1 - $3_1 | 0; + HEAP322[$3_1 + 4 >> 2] = $6_1 | 1; + HEAP322[$2_1 >> 2] = $6_1; + if ($6_1 >>> 0 <= 255) { + $1_1 = $6_1 >>> 3 | 0; + $0 = ($1_1 << 3) + 33628 | 0; + $2_1 = HEAP322[8397]; + $1_1 = 1 << $1_1; + label$103: { + if (!($2_1 & $1_1)) { + HEAP322[8397] = $1_1 | $2_1; + $1_1 = $0; + break label$103; + } + $1_1 = HEAP322[$0 + 8 >> 2]; + } + HEAP322[$0 + 8 >> 2] = $3_1; + HEAP322[$1_1 + 12 >> 2] = $3_1; + HEAP322[$3_1 + 12 >> 2] = $0; + HEAP322[$3_1 + 8 >> 2] = $1_1; + break label$62; + } + HEAP322[$3_1 + 16 >> 2] = 0; + HEAP322[$3_1 + 20 >> 2] = 0; + $7_1 = $3_1; + $0 = $6_1 >>> 8 | 0; + $1_1 = 0; + label$105: { + if (!$0) { + break label$105; + } + $1_1 = 31; + if ($6_1 >>> 0 > 16777215) { + break label$105; + } + $2_1 = $0 + 1048320 >>> 16 & 8; + $1_1 = $0 << $2_1; + $0 = $1_1 + 520192 >>> 16 & 4; + $4_1 = $1_1 << $0; + $1_1 = $4_1 + 245760 >>> 16 & 2; + $0 = ($4_1 << $1_1 >>> 15 | 0) - ($1_1 | ($0 | $2_1)) | 0; + $1_1 = ($0 << 1 | $6_1 >>> $0 + 21 & 1) + 28 | 0; + } + $0 = $1_1; + HEAP322[$7_1 + 28 >> 2] = $0; + $1_1 = ($0 << 2) + 33892 | 0; + $2_1 = HEAP322[8398]; + $4_1 = 1 << $0; + label$106: { + if (!($2_1 & $4_1)) { + HEAP322[8398] = $2_1 | $4_1; + HEAP322[$1_1 >> 2] = $3_1; + HEAP322[$3_1 + 24 >> 2] = $1_1; + break label$106; + } + $0 = $6_1 << (($0 | 0) == 31 ? 0 : 25 - ($0 >>> 1 | 0) | 0); + $1_1 = HEAP322[$1_1 >> 2]; + while (1) { + $2_1 = $1_1; + if (($6_1 | 0) == (HEAP322[$1_1 + 4 >> 2] & -8)) { + break label$70; + } + $1_1 = $0 >>> 29 | 0; + $0 = $0 << 1; + $4_1 = ($2_1 + ($1_1 & 4) | 0) + 16 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + continue; + } + break; + } + HEAP322[$4_1 >> 2] = $3_1; + HEAP322[$3_1 + 24 >> 2] = $2_1; + } + HEAP322[$3_1 + 12 >> 2] = $3_1; + HEAP322[$3_1 + 8 >> 2] = $3_1; + break label$62; + } + $0 = HEAP322[$2_1 + 8 >> 2]; + HEAP322[$0 + 12 >> 2] = $4_1; + HEAP322[$2_1 + 8 >> 2] = $4_1; + HEAP322[$4_1 + 24 >> 2] = 0; + HEAP322[$4_1 + 12 >> 2] = $2_1; + HEAP322[$4_1 + 8 >> 2] = $0; + } + $0 = $7_1 + 8 | 0; + break label$1; + } + $0 = HEAP322[$2_1 + 8 >> 2]; + HEAP322[$0 + 12 >> 2] = $3_1; + HEAP322[$2_1 + 8 >> 2] = $3_1; + HEAP322[$3_1 + 24 >> 2] = 0; + HEAP322[$3_1 + 12 >> 2] = $2_1; + HEAP322[$3_1 + 8 >> 2] = $0; + } + $0 = HEAP322[8400]; + if ($0 >>> 0 <= $5_1 >>> 0) { + break label$4; + } + $1_1 = $0 - $5_1 | 0; + HEAP322[8400] = $1_1; + $0 = HEAP322[8403]; + $2_1 = $0 + $5_1 | 0; + HEAP322[8403] = $2_1; + HEAP322[$2_1 + 4 >> 2] = $1_1 | 1; + HEAP322[$0 + 4 >> 2] = $5_1 | 3; + $0 = $0 + 8 | 0; + break label$1; + } + HEAP322[8396] = 48; + $0 = 0; + break label$1; + } + label$109: { + if (!$7_1) { + break label$109; + } + $0 = HEAP322[$4_1 + 28 >> 2]; + $3_1 = ($0 << 2) + 33892 | 0; + label$110: { + if (HEAP322[$3_1 >> 2] == ($4_1 | 0)) { + HEAP322[$3_1 >> 2] = $1_1; + if ($1_1) { + break label$110; + } + $8_1 = __wasm_rotl_i32($0) & $8_1; + HEAP322[8398] = $8_1; + break label$109; + } + HEAP322[$7_1 + (HEAP322[$7_1 + 16 >> 2] == ($4_1 | 0) ? 16 : 20) >> 2] = $1_1; + if (!$1_1) { + break label$109; + } + } + HEAP322[$1_1 + 24 >> 2] = $7_1; + $0 = HEAP322[$4_1 + 16 >> 2]; + if ($0) { + HEAP322[$1_1 + 16 >> 2] = $0; + HEAP322[$0 + 24 >> 2] = $1_1; + } + $0 = HEAP322[$4_1 + 20 >> 2]; + if (!$0) { + break label$109; + } + HEAP322[$1_1 + 20 >> 2] = $0; + HEAP322[$0 + 24 >> 2] = $1_1; + } + label$113: { + if ($2_1 >>> 0 <= 15) { + $0 = $2_1 + $5_1 | 0; + HEAP322[$4_1 + 4 >> 2] = $0 | 3; + $0 = $0 + $4_1 | 0; + HEAP322[$0 + 4 >> 2] = HEAP322[$0 + 4 >> 2] | 1; + break label$113; + } + HEAP322[$4_1 + 4 >> 2] = $5_1 | 3; + $1_1 = $4_1 + $5_1 | 0; + HEAP322[$1_1 + 4 >> 2] = $2_1 | 1; + HEAP322[$1_1 + $2_1 >> 2] = $2_1; + if ($2_1 >>> 0 <= 255) { + $2_1 = $2_1 >>> 3 | 0; + $0 = ($2_1 << 3) + 33628 | 0; + $3_1 = HEAP322[8397]; + $2_1 = 1 << $2_1; + label$116: { + if (!($3_1 & $2_1)) { + HEAP322[8397] = $2_1 | $3_1; + $2_1 = $0; + break label$116; + } + $2_1 = HEAP322[$0 + 8 >> 2]; + } + HEAP322[$0 + 8 >> 2] = $1_1; + HEAP322[$2_1 + 12 >> 2] = $1_1; + HEAP322[$1_1 + 12 >> 2] = $0; + HEAP322[$1_1 + 8 >> 2] = $2_1; + break label$113; + } + $7_1 = $1_1; + $0 = $2_1 >>> 8 | 0; + $3_1 = 0; + label$118: { + if (!$0) { + break label$118; + } + $3_1 = 31; + if ($2_1 >>> 0 > 16777215) { + break label$118; + } + $5_1 = $0 + 1048320 >>> 16 & 8; + $3_1 = $0 << $5_1; + $0 = $3_1 + 520192 >>> 16 & 4; + $6_1 = $3_1 << $0; + $3_1 = $6_1 + 245760 >>> 16 & 2; + $0 = ($6_1 << $3_1 >>> 15 | 0) - ($3_1 | ($0 | $5_1)) | 0; + $3_1 = ($0 << 1 | $2_1 >>> $0 + 21 & 1) + 28 | 0; + } + $0 = $3_1; + HEAP322[$7_1 + 28 >> 2] = $0; + HEAP322[$1_1 + 16 >> 2] = 0; + HEAP322[$1_1 + 20 >> 2] = 0; + $3_1 = ($0 << 2) + 33892 | 0; + label$119: { + $5_1 = 1 << $0; + label$120: { + if (!($5_1 & $8_1)) { + HEAP322[8398] = $5_1 | $8_1; + HEAP322[$3_1 >> 2] = $1_1; + break label$120; + } + $0 = $2_1 << (($0 | 0) == 31 ? 0 : 25 - ($0 >>> 1 | 0) | 0); + $5_1 = HEAP322[$3_1 >> 2]; + while (1) { + $3_1 = $5_1; + if ((HEAP322[$3_1 + 4 >> 2] & -8) == ($2_1 | 0)) { + break label$119; + } + $5_1 = $0 >>> 29 | 0; + $0 = $0 << 1; + $6_1 = ($3_1 + ($5_1 & 4) | 0) + 16 | 0; + $5_1 = HEAP322[$6_1 >> 2]; + if ($5_1) { + continue; + } + break; + } + HEAP322[$6_1 >> 2] = $1_1; + } + HEAP322[$1_1 + 24 >> 2] = $3_1; + HEAP322[$1_1 + 12 >> 2] = $1_1; + HEAP322[$1_1 + 8 >> 2] = $1_1; + break label$113; + } + $0 = HEAP322[$3_1 + 8 >> 2]; + HEAP322[$0 + 12 >> 2] = $1_1; + HEAP322[$3_1 + 8 >> 2] = $1_1; + HEAP322[$1_1 + 24 >> 2] = 0; + HEAP322[$1_1 + 12 >> 2] = $3_1; + HEAP322[$1_1 + 8 >> 2] = $0; + } + $0 = $4_1 + 8 | 0; + break label$1; + } + label$123: { + if (!$9_1) { + break label$123; + } + $0 = HEAP322[$1_1 + 28 >> 2]; + $2_1 = ($0 << 2) + 33892 | 0; + label$124: { + if (HEAP322[$2_1 >> 2] == ($1_1 | 0)) { + HEAP322[$2_1 >> 2] = $4_1; + if ($4_1) { + break label$124; + } + HEAP322[8398] = __wasm_rotl_i32($0) & $10_1; + break label$123; + } + HEAP322[(HEAP322[$9_1 + 16 >> 2] == ($1_1 | 0) ? 16 : 20) + $9_1 >> 2] = $4_1; + if (!$4_1) { + break label$123; + } + } + HEAP322[$4_1 + 24 >> 2] = $9_1; + $0 = HEAP322[$1_1 + 16 >> 2]; + if ($0) { + HEAP322[$4_1 + 16 >> 2] = $0; + HEAP322[$0 + 24 >> 2] = $4_1; + } + $0 = HEAP322[$1_1 + 20 >> 2]; + if (!$0) { + break label$123; + } + HEAP322[$4_1 + 20 >> 2] = $0; + HEAP322[$0 + 24 >> 2] = $4_1; + } + label$127: { + if ($3_1 >>> 0 <= 15) { + $0 = $3_1 + $5_1 | 0; + HEAP322[$1_1 + 4 >> 2] = $0 | 3; + $0 = $0 + $1_1 | 0; + HEAP322[$0 + 4 >> 2] = HEAP322[$0 + 4 >> 2] | 1; + break label$127; + } + HEAP322[$1_1 + 4 >> 2] = $5_1 | 3; + $5_1 = $1_1 + $5_1 | 0; + HEAP322[$5_1 + 4 >> 2] = $3_1 | 1; + HEAP322[$3_1 + $5_1 >> 2] = $3_1; + if ($7_1) { + $4_1 = $7_1 >>> 3 | 0; + $0 = ($4_1 << 3) + 33628 | 0; + $2_1 = HEAP322[8402]; + $4_1 = 1 << $4_1; + label$130: { + if (!($4_1 & $6_1)) { + HEAP322[8397] = $4_1 | $6_1; + $6_1 = $0; + break label$130; + } + $6_1 = HEAP322[$0 + 8 >> 2]; + } + HEAP322[$0 + 8 >> 2] = $2_1; + HEAP322[$6_1 + 12 >> 2] = $2_1; + HEAP322[$2_1 + 12 >> 2] = $0; + HEAP322[$2_1 + 8 >> 2] = $6_1; + } + HEAP322[8402] = $5_1; + HEAP322[8399] = $3_1; + } + $0 = $1_1 + 8 | 0; + } + global$0 = $11_1 + 16 | 0; + return $0 | 0; + } + function $84($0) { + $0 = $0 | 0; + var $1_1 = 0, $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0; + label$1: { + if (!$0) { + break label$1; + } + $3_1 = $0 + -8 | 0; + $2_1 = HEAP322[$0 + -4 >> 2]; + $0 = $2_1 & -8; + $5_1 = $3_1 + $0 | 0; + label$2: { + if ($2_1 & 1) { + break label$2; + } + if (!($2_1 & 3)) { + break label$1; + } + $2_1 = HEAP322[$3_1 >> 2]; + $3_1 = $3_1 - $2_1 | 0; + if ($3_1 >>> 0 < HEAPU322[8401]) { + break label$1; + } + $0 = $0 + $2_1 | 0; + if (HEAP322[8402] != ($3_1 | 0)) { + if ($2_1 >>> 0 <= 255) { + $4_1 = HEAP322[$3_1 + 8 >> 2]; + $2_1 = $2_1 >>> 3 | 0; + $1_1 = HEAP322[$3_1 + 12 >> 2]; + if (($1_1 | 0) == ($4_1 | 0)) { + HEAP322[8397] = HEAP322[8397] & __wasm_rotl_i32($2_1); + break label$2; + } + HEAP322[$4_1 + 12 >> 2] = $1_1; + HEAP322[$1_1 + 8 >> 2] = $4_1; + break label$2; + } + $7_1 = HEAP322[$3_1 + 24 >> 2]; + $2_1 = HEAP322[$3_1 + 12 >> 2]; + label$6: { + if (($2_1 | 0) != ($3_1 | 0)) { + $1_1 = HEAP322[$3_1 + 8 >> 2]; + HEAP322[$1_1 + 12 >> 2] = $2_1; + HEAP322[$2_1 + 8 >> 2] = $1_1; + break label$6; + } + label$9: { + $4_1 = $3_1 + 20 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + break label$9; + } + $4_1 = $3_1 + 16 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + break label$9; + } + $2_1 = 0; + break label$6; + } + while (1) { + $6_1 = $4_1; + $2_1 = $1_1; + $4_1 = $2_1 + 20 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + continue; + } + $4_1 = $2_1 + 16 | 0; + $1_1 = HEAP322[$2_1 + 16 >> 2]; + if ($1_1) { + continue; + } + break; + } + HEAP322[$6_1 >> 2] = 0; + } + if (!$7_1) { + break label$2; + } + $4_1 = HEAP322[$3_1 + 28 >> 2]; + $1_1 = ($4_1 << 2) + 33892 | 0; + label$11: { + if (HEAP322[$1_1 >> 2] == ($3_1 | 0)) { + HEAP322[$1_1 >> 2] = $2_1; + if ($2_1) { + break label$11; + } + HEAP322[8398] = HEAP322[8398] & __wasm_rotl_i32($4_1); + break label$2; + } + HEAP322[$7_1 + (HEAP322[$7_1 + 16 >> 2] == ($3_1 | 0) ? 16 : 20) >> 2] = $2_1; + if (!$2_1) { + break label$2; + } + } + HEAP322[$2_1 + 24 >> 2] = $7_1; + $1_1 = HEAP322[$3_1 + 16 >> 2]; + if ($1_1) { + HEAP322[$2_1 + 16 >> 2] = $1_1; + HEAP322[$1_1 + 24 >> 2] = $2_1; + } + $1_1 = HEAP322[$3_1 + 20 >> 2]; + if (!$1_1) { + break label$2; + } + HEAP322[$2_1 + 20 >> 2] = $1_1; + HEAP322[$1_1 + 24 >> 2] = $2_1; + break label$2; + } + $2_1 = HEAP322[$5_1 + 4 >> 2]; + if (($2_1 & 3) != 3) { + break label$2; + } + HEAP322[8399] = $0; + HEAP322[$5_1 + 4 >> 2] = $2_1 & -2; + HEAP322[$3_1 + 4 >> 2] = $0 | 1; + HEAP322[$0 + $3_1 >> 2] = $0; + return; + } + if ($5_1 >>> 0 <= $3_1 >>> 0) { + break label$1; + } + $2_1 = HEAP322[$5_1 + 4 >> 2]; + if (!($2_1 & 1)) { + break label$1; + } + label$14: { + if (!($2_1 & 2)) { + if (($5_1 | 0) == HEAP322[8403]) { + HEAP322[8403] = $3_1; + $0 = HEAP322[8400] + $0 | 0; + HEAP322[8400] = $0; + HEAP322[$3_1 + 4 >> 2] = $0 | 1; + if (HEAP322[8402] != ($3_1 | 0)) { + break label$1; + } + HEAP322[8399] = 0; + HEAP322[8402] = 0; + return; + } + if (($5_1 | 0) == HEAP322[8402]) { + HEAP322[8402] = $3_1; + $0 = HEAP322[8399] + $0 | 0; + HEAP322[8399] = $0; + HEAP322[$3_1 + 4 >> 2] = $0 | 1; + HEAP322[$0 + $3_1 >> 2] = $0; + return; + } + $0 = ($2_1 & -8) + $0 | 0; + label$18: { + if ($2_1 >>> 0 <= 255) { + $1_1 = HEAP322[$5_1 + 8 >> 2]; + $2_1 = $2_1 >>> 3 | 0; + $4_1 = HEAP322[$5_1 + 12 >> 2]; + if (($1_1 | 0) == ($4_1 | 0)) { + HEAP322[8397] = HEAP322[8397] & __wasm_rotl_i32($2_1); + break label$18; + } + HEAP322[$1_1 + 12 >> 2] = $4_1; + HEAP322[$4_1 + 8 >> 2] = $1_1; + break label$18; + } + $7_1 = HEAP322[$5_1 + 24 >> 2]; + $2_1 = HEAP322[$5_1 + 12 >> 2]; + label$23: { + if (($5_1 | 0) != ($2_1 | 0)) { + $1_1 = HEAP322[$5_1 + 8 >> 2]; + HEAP322[$1_1 + 12 >> 2] = $2_1; + HEAP322[$2_1 + 8 >> 2] = $1_1; + break label$23; + } + label$26: { + $4_1 = $5_1 + 20 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + break label$26; + } + $4_1 = $5_1 + 16 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + break label$26; + } + $2_1 = 0; + break label$23; + } + while (1) { + $6_1 = $4_1; + $2_1 = $1_1; + $4_1 = $2_1 + 20 | 0; + $1_1 = HEAP322[$4_1 >> 2]; + if ($1_1) { + continue; + } + $4_1 = $2_1 + 16 | 0; + $1_1 = HEAP322[$2_1 + 16 >> 2]; + if ($1_1) { + continue; + } + break; + } + HEAP322[$6_1 >> 2] = 0; + } + if (!$7_1) { + break label$18; + } + $4_1 = HEAP322[$5_1 + 28 >> 2]; + $1_1 = ($4_1 << 2) + 33892 | 0; + label$28: { + if (($5_1 | 0) == HEAP322[$1_1 >> 2]) { + HEAP322[$1_1 >> 2] = $2_1; + if ($2_1) { + break label$28; + } + HEAP322[8398] = HEAP322[8398] & __wasm_rotl_i32($4_1); + break label$18; + } + HEAP322[$7_1 + (($5_1 | 0) == HEAP322[$7_1 + 16 >> 2] ? 16 : 20) >> 2] = $2_1; + if (!$2_1) { + break label$18; + } + } + HEAP322[$2_1 + 24 >> 2] = $7_1; + $1_1 = HEAP322[$5_1 + 16 >> 2]; + if ($1_1) { + HEAP322[$2_1 + 16 >> 2] = $1_1; + HEAP322[$1_1 + 24 >> 2] = $2_1; + } + $1_1 = HEAP322[$5_1 + 20 >> 2]; + if (!$1_1) { + break label$18; + } + HEAP322[$2_1 + 20 >> 2] = $1_1; + HEAP322[$1_1 + 24 >> 2] = $2_1; + } + HEAP322[$3_1 + 4 >> 2] = $0 | 1; + HEAP322[$0 + $3_1 >> 2] = $0; + if (HEAP322[8402] != ($3_1 | 0)) { + break label$14; + } + HEAP322[8399] = $0; + return; + } + HEAP322[$5_1 + 4 >> 2] = $2_1 & -2; + HEAP322[$3_1 + 4 >> 2] = $0 | 1; + HEAP322[$0 + $3_1 >> 2] = $0; + } + if ($0 >>> 0 <= 255) { + $0 = $0 >>> 3 | 0; + $2_1 = ($0 << 3) + 33628 | 0; + $1_1 = HEAP322[8397]; + $0 = 1 << $0; + label$32: { + if (!($1_1 & $0)) { + HEAP322[8397] = $0 | $1_1; + $0 = $2_1; + break label$32; + } + $0 = HEAP322[$2_1 + 8 >> 2]; + } + HEAP322[$2_1 + 8 >> 2] = $3_1; + HEAP322[$0 + 12 >> 2] = $3_1; + HEAP322[$3_1 + 12 >> 2] = $2_1; + HEAP322[$3_1 + 8 >> 2] = $0; + return; + } + HEAP322[$3_1 + 16 >> 2] = 0; + HEAP322[$3_1 + 20 >> 2] = 0; + $5_1 = $3_1; + $4_1 = $0 >>> 8 | 0; + $1_1 = 0; + label$34: { + if (!$4_1) { + break label$34; + } + $1_1 = 31; + if ($0 >>> 0 > 16777215) { + break label$34; + } + $2_1 = $4_1; + $4_1 = $4_1 + 1048320 >>> 16 & 8; + $1_1 = $2_1 << $4_1; + $7_1 = $1_1 + 520192 >>> 16 & 4; + $1_1 = $1_1 << $7_1; + $6_1 = $1_1 + 245760 >>> 16 & 2; + $1_1 = ($1_1 << $6_1 >>> 15 | 0) - ($6_1 | ($4_1 | $7_1)) | 0; + $1_1 = ($1_1 << 1 | $0 >>> $1_1 + 21 & 1) + 28 | 0; + } + HEAP322[$5_1 + 28 >> 2] = $1_1; + $6_1 = ($1_1 << 2) + 33892 | 0; + label$35: { + label$36: { + $4_1 = HEAP322[8398]; + $2_1 = 1 << $1_1; + label$37: { + if (!($4_1 & $2_1)) { + HEAP322[8398] = $2_1 | $4_1; + HEAP322[$6_1 >> 2] = $3_1; + HEAP322[$3_1 + 24 >> 2] = $6_1; + break label$37; + } + $4_1 = $0 << (($1_1 | 0) == 31 ? 0 : 25 - ($1_1 >>> 1 | 0) | 0); + $2_1 = HEAP322[$6_1 >> 2]; + while (1) { + $1_1 = $2_1; + if ((HEAP322[$2_1 + 4 >> 2] & -8) == ($0 | 0)) { + break label$36; + } + $2_1 = $4_1 >>> 29 | 0; + $4_1 = $4_1 << 1; + $6_1 = ($1_1 + ($2_1 & 4) | 0) + 16 | 0; + $2_1 = HEAP322[$6_1 >> 2]; + if ($2_1) { + continue; + } + break; + } + HEAP322[$6_1 >> 2] = $3_1; + HEAP322[$3_1 + 24 >> 2] = $1_1; + } + HEAP322[$3_1 + 12 >> 2] = $3_1; + HEAP322[$3_1 + 8 >> 2] = $3_1; + break label$35; + } + $0 = HEAP322[$1_1 + 8 >> 2]; + HEAP322[$0 + 12 >> 2] = $3_1; + HEAP322[$1_1 + 8 >> 2] = $3_1; + HEAP322[$3_1 + 24 >> 2] = 0; + HEAP322[$3_1 + 12 >> 2] = $1_1; + HEAP322[$3_1 + 8 >> 2] = $0; + } + $0 = HEAP322[8405] + -1 | 0; + HEAP322[8405] = $0; + if ($0) { + break label$1; + } + $3_1 = 34044; + while (1) { + $0 = HEAP322[$3_1 >> 2]; + $3_1 = $0 + 8 | 0; + if ($0) { + continue; + } + break; + } + HEAP322[8405] = -1; + } + } + function $85() { + return global$0 | 0; + } + function $86($0) { + $0 = $0 | 0; + $0 = global$0 - $0 & -16; + global$0 = $0; + return $0 | 0; + } + function $87($0) { + $0 = $0 | 0; + global$0 = $0; + } + function $88($0) { + $0 = $0 | 0; + return abort2() | 0; + } + function _ZN17compiler_builtins3int3mul3Mul3mul17h070e9a1c69faec5bE($0, $1_1, $2_1, $3_1) { + var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0; + $4_1 = $2_1 >>> 16 | 0; + $5_1 = $0 >>> 16 | 0; + $9_1 = Math_imul2($4_1, $5_1); + $6_1 = $2_1 & 65535; + $7_1 = $0 & 65535; + $8_1 = Math_imul2($6_1, $7_1); + $5_1 = ($8_1 >>> 16 | 0) + Math_imul2($5_1, $6_1) | 0; + $4_1 = ($5_1 & 65535) + Math_imul2($4_1, $7_1) | 0; + $0 = (Math_imul2($1_1, $2_1) + $9_1 | 0) + Math_imul2($0, $3_1) + ($5_1 >>> 16) + ($4_1 >>> 16) | 0; + $1_1 = $8_1 & 65535 | $4_1 << 16; + i64toi32_i32$HIGH_BITS = $0; + return $1_1; + } + function __wasm_i64_mul($0, $1_1, $2_1, $3_1) { + $0 = _ZN17compiler_builtins3int3mul3Mul3mul17h070e9a1c69faec5bE($0, $1_1, $2_1, $3_1); + return $0; + } + function __wasm_rotl_i32($0) { + var $1_1 = 0; + $1_1 = $0 & 31; + $0 = 0 - $0 & 31; + return (-1 >>> $1_1 & -2) << $1_1 | (-1 << $0 & -2) >>> $0; + } + function __wasm_rotl_i64($0, $1_1, $2_1) { + var $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; + $6_1 = $2_1 & 63; + $5_1 = $6_1; + $3_1 = $5_1 & 31; + if (32 <= $5_1 >>> 0) { + $3_1 = -1 >>> $3_1 | 0; + } else { + $4_1 = -1 >>> $3_1 | 0; + $3_1 = (1 << $3_1) - 1 << 32 - $3_1 | -1 >>> $3_1; + } + $5_1 = $3_1 & $0; + $3_1 = $1_1 & $4_1; + $4_1 = $6_1 & 31; + if (32 <= $6_1 >>> 0) { + $3_1 = $5_1 << $4_1; + $6_1 = 0; + } else { + $3_1 = (1 << $4_1) - 1 & $5_1 >>> 32 - $4_1 | $3_1 << $4_1; + $6_1 = $5_1 << $4_1; + } + $5_1 = $3_1; + $4_1 = 0 - $2_1 & 63; + $3_1 = $4_1; + $2_1 = $3_1 & 31; + if (32 <= $3_1 >>> 0) { + $3_1 = -1 << $2_1; + $2_1 = 0; + } else { + $3_1 = (1 << $2_1) - 1 & -1 >>> 32 - $2_1 | -1 << $2_1; + $2_1 = -1 << $2_1; + } + $0 = $2_1 & $0; + $3_1 = $1_1 & $3_1; + $1_1 = $4_1 & 31; + if (32 <= $4_1 >>> 0) { + $2_1 = 0; + $0 = $3_1 >>> $1_1 | 0; + } else { + $2_1 = $3_1 >>> $1_1 | 0; + $0 = ((1 << $1_1) - 1 & $3_1) << 32 - $1_1 | $0 >>> $1_1; + } + $0 = $0 | $6_1; + i64toi32_i32$HIGH_BITS = $2_1 | $5_1; + return $0; + } + var FUNCTION_TABLE = []; + function __wasm_memory_size() { + return buffer2.byteLength / 65536 | 0; + } + return { + __wasm_call_ctors: $1, + curve25519_sign: $3, + curve25519_verify: $4, + curve25519_donna: $7, + __errno_location: $81, + malloc: $83, + free: $84, + stackSave: $85, + stackAlloc: $86, + stackRestore: $87, + __growWasmMemory: $88 + }; + } + for (var base64ReverseLookup = new Uint8Array( + 123 + /*'z'+1*/ + ), i2 = 25; i2 >= 0; --i2) { + base64ReverseLookup[48 + i2] = 52 + i2; + base64ReverseLookup[65 + i2] = i2; + base64ReverseLookup[97 + i2] = 26 + i2; + } + base64ReverseLookup[43] = 62; + base64ReverseLookup[47] = 63; + function base64DecodeToExistingUint8Array(uint8Array, offset, b64) { + var b1, b2, i3 = 0, j = offset, bLength = b64.length, end = offset + (bLength * 3 >> 2); + if (b64[bLength - 2] == "=") + --end; + if (b64[bLength - 1] == "=") + --end; + for (; i3 < bLength; i3 += 4, j += 3) { + b1 = base64ReverseLookup[b64.charCodeAt(i3 + 1)]; + b2 = base64ReverseLookup[b64.charCodeAt(i3 + 2)]; + uint8Array[j] = base64ReverseLookup[b64.charCodeAt(i3)] << 2 | b1 >> 4; + if (j + 1 < end) + uint8Array[j + 1] = b1 << 4 | b2 >> 2; + if (j + 2 < end) + uint8Array[j + 2] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i3 + 3)]; + } + } + var bufferView = new Uint8Array(wasmMemory2.buffer); + base64DecodeToExistingUint8Array(bufferView, 1056, "tnhZ/4Vy0wC9bhX/DwpqACnAAQCY6Hn/vDyg/5lxzv8At+L+tA1I/wAAAAAAAAAAsKAO/tPJhv+eGI8Af2k1AGAMvQCn1/v/n0yA/mpl4f8e/AQAkgyu"); + base64DecodeToExistingUint8Array(bufferView, 1152, "WfGy/grlpv973Sr+HhTUAFKAAwAw0fMAd3lA/zLjnP8AbsUBZxuQ"); + base64DecodeToExistingUint8Array(bufferView, 1200, "CMm882fmCWo7p8qEha5nuyv4lP5y82488TYdXzr1T6XRguatf1IOUR9sPiuMaAWba71B+6vZgx95IX4TGc3gWyKuKNeYL4pCzWXvI5FEN3EvO03sz/vAtbzbiYGl27XpOLVI81vCVjkZ0AW28RHxWZtPGa+kgj+SGIFt2tVeHKtCAgOjmKoH2L5vcEUBW4MSjLLkTr6FMSTitP/Vw30MVW+Je/J0Xb5ysZYWO/6x3oA1Esclpwbcm5Qmac908ZvB0krxnsFpm+TjJU84hke+77XVjIvGncEPZZysd8yhDCR1AitZbyzpLYPkpm6qhHRK1PtBvdypsFy1UxGD2oj5dqvfZu5SUT6YEDK0LW3GMag/IfuYyCcDsOQO777Hf1m/wo+oPfML4MYlpwqTR5Gn1W+CA+BRY8oGcG4OCmcpKRT8L9JGhQq3JybJJlw4IRsu7SrEWvxtLE3fs5WdEw04U95jr4tUcwplqLJ3PLsKanbmru1HLsnCgTs1ghSFLHKSZAPxTKHov6IBMEK8S2YaqJGX+NBwi0vCML5UBqNRbMcYUu/WGeiS0RCpZVUkBpnWKiBxV4U1DvS40bsycKBqEMjQ0rgWwaQZU6tBUQhsNx6Z647fTHdIJ6hIm+G1vLA0Y1rJxbMMHDnLikHjSqrYTnPjY3dPypxbo7iy1vNvLmj8su9d7oKPdGAvF0NvY6V4cqvwoRR4yITsOWQaCALHjCgeYyP6/76Q6b2C3utsUKQVecay96P5vitTcuPyeHHGnGEm6s4+J8oHwsAhx7iG0R7r4M3WfdrqeNFu7n9PffW6bxdyqmfwBqaYyKLFfWMKrg35vgSYPxEbRxwTNQtxG4R9BCP1d9sokyTHQHuryjK8vskVCr6ePEwNEJzEZx1DtkI+y77UxUwqfmX8nCl/Wez61jqrb8tfF1hHSowZRGw="); + base64DecodeToExistingUint8Array(bufferView, 1904, "hTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqYAJsr8f6boGj/M7ulAAIRrwBCVKAB9zoeACNBNf5F7L8ALYb1AaN73QAgbhT/NBelALrWRwDpsGAA8u82ATlZigBTAFT/iKBkAFyOeP5ofL4AtbE+//opVQCYgioBYPz2AJeXP/7vhT4AIDicAC2nvf+OhbMBg1bTALuzlv76qg7/0qNOACU0lwBjTRoA7pzV/9XA0QFJLlQAFEEpATbOTwDJg5L+qm8Y/7EhMv6rJsv/Tvd0ANHdmQCFgLIBOiwZAMknOwG9E/wAMeXSAXW7dQC1s7gBAHLbADBekwD1KTgAfQ3M/vStdwAs3SD+VOoUAPmgxgHsfur/L2Oo/qrimf9ms9gA4o16/3pCmf629YYA4+QZAdY56//YrTj/tefSAHeAnf+BX4j/bn4zAAKpt/8HgmL+RbBe/3QE4wHZ8pH/yq0fAWkBJ/8ur0UA5C86/9fgRf7POEX/EP6L/xfP1P/KFH7/X9Vg/wmwIQDIBc//8SqA/iMhwP/45cQBgRF4APtnl/8HNHD/jDhC/yji9f/ZRiX+rNYJ/0hDhgGSwNb/LCZwAES4S//OWvsAleuNALWqOgB09O8AXJ0CAGatYgDpiWABfzHLAAWblAAXlAn/03oMACKGGv/bzIgAhggp/+BTK/5VGfcAbX8A/qmIMADud9v/563VAM4S/v4Iugf/fgkHAW8qSABvNOz+YD+NAJO/f/7NTsD/DmrtAbvbTACv87v+aVmtAFUZWQGi85QAAnbR/iGeCQCLoy7/XUYoAGwqjv5v/I7/m9+QADPlp/9J/Jv/XnQM/5ig2v+c7iX/s+rP/8UAs/+apI0A4cRoAAojGf7R1PL/Yf3e/rhl5QDeEn8BpIiH/x7PjP6SYfMAgcAa/slUIf9vCk7/k1Gy/wQEGACh7tf/Bo0hADXXDv8ptdD/54udALPL3f//uXEAveKs/3FC1v/KPi3/ZkAI/06uEP6FdUT/hTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/6nE8/yX/Of9Fsrb+gNCzAHYaff4DB9b/8TJN/1XLxf/Th/r/GTBk/7vVtP4RWGkAU9GeAQVzYgAErjz+qzdu/9m1Ef8UvKoAkpxm/lfWrv9yepsB6SyqAH8I7wHW7OoArwXbADFqPf8GQtD/Ampu/1HqE//Xa8D/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqYAJsr8f6boGj/sgn8/mRu1AAOBacA6e+j/xyXnQFlkgr//p5G/kf55ABYHjIARDqg/78YaAGBQoH/wDJV/wiziv8m+skAc1CgAIPmcQB9WJMAWkTHAP1MngAc/3YAcfr+AEJLLgDm2isA5Xi6AZREKwCIfO4Bu2vF/1Q19v8zdP7/M7ulAAIRrwBCVKAB9zoeACNBNf5F7L8ALYb1AaN73QAgbhT/NBelALrWRwDpsGAA8u82ATlZigBTAFT/iKBkAFyOeP5ofL4AtbE+//opVQCYgioBYPz2AJeXP/7vhT4AIDicAC2nvf+OhbMBg1bTALuzlv76qg7/RHEV/966O/9CB/EBRQZIAFacbP43p1kAbTTb/g2wF//ELGr/75VH/6SMff+frQEAMynnAJE+IQCKb10BuVNFAJBzLgBhlxD/GOQaADHZ4gBxS+r+wZkM/7YwYP8ODRoAgMP5/kXBOwCEJVH+fWo8ANbwqQGk40IA0qNOACU0lwBjTRoA7pzV/9XA0QFJLlQAFEEpATbOTwDJg5L+qm8Y/7EhMv6rJsv/Tvd0ANHdmQCFgLIBOiwZAMknOwG9E/wAMeXSAXW7dQC1s7gBAHLbADBekwD1KTgAfQ3M/vStdwAs3SD+VOoUAPmgxgHsfur/jz7dAIFZ1v83iwX+RBS//w7MsgEjw9kALzPOASb2pQDOGwb+nlckANk0kv99e9f/VTwf/6sNBwDa9Vj+/CM8ADfWoP+FZTgA4CAT/pNA6gAakaIBcnZ9APj8+gBlXsT/xo3i/jMqtgCHDAn+bazS/8XswgHxQZoAMJwv/5lDN//apSL+SrSzANpCRwFYemMA1LXb/1wq5//vAJoA9U23/15RqgES1dgAq11HADRe+AASl6H+xdFC/670D/6iMLcAMT3w/rZdwwDH5AYByAUR/4kt7f9slAQAWk/t/yc/Tf81Us8BjhZ2/2XoEgFcGkMABchY/yGoiv+V4UgAAtEb/yz1qAHc7RH/HtNp/o3u3QCAUPX+b/4OAN5fvgHfCfEAkkzU/2zNaP8/dZkAkEUwACPkbwDAIcH/cNa+/nOYlwAXZlgAM0r4AOLHj/7MomX/0GG9AfVoEgDm9h7/F5RFAG5YNP7itVn/0C9a/nKhUP8hdPgAs5hX/0WQsQFY7hr/OiBxAQFNRQA7eTT/mO5TADQIwQDnJ+n/xyKKAN5ErQBbOfL+3NJ//8AH9v6XI7sAw+ylAG9dzgDU94UBmoXR/5vnCgBATiYAevlkAR4TYf8+W/kB+IVNAMU/qP50ClIAuOxx/tTLwv89ZPz+JAXK/3dbmf+BTx0AZ2er/u3Xb//YNUUA7/AXAMKV3f8m4d4A6P+0/nZShf850bEBi+iFAJ6wLv7Ccy4AWPflARxnvwDd3q/+lessAJfkGf7aaWcAjlXSAJWBvv/VQV7+dYbg/1LGdQCd3dwAo2UkAMVyJQBorKb+C7YAAFFIvP9hvBD/RQYKAMeTkf8ICXMBQdav/9mt0QBQf6YA9+UE/qe3fP9aHMz+rzvw/wsp+AFsKDP/kLHD/pb6fgCKW0EBeDze//XB7wAd1r3/gAIZAFCaogBN3GsB6s1K/zamZ/90SAkA5F4v/x7IGf8j1ln/PbCM/1Pio/9LgqwAgCYRAF+JmP/XfJ8BT10AAJRSnf7Dgvv/KMpM//t+4ACdYz7+zwfh/2BEwwCMup3/gxPn/yqA/gA02z3+ZstIAI0HC/+6pNUAH3p3AIXykQDQ/Oj/W9W2/48E+v7510oApR5vAasJ3wDleyIBXIIa/02bLQHDixz/O+BOAIgR9wBseSAAT/q9/2Dj/P4m8T4APq59/5tvXf8K5s4BYcUo/wAxOf5B+g0AEvuW/9xt0v8Frqb+LIG9AOsjk/8l943/SI0E/2dr/wD3WgQANSwqAAIe8AAEOz8AWE4kAHGntAC+R8H/x56k/zoIrABNIQwAQT8DAJlNIf+s/mYB5N0E/1ce/gGSKVb/iszv/myNEf+78ocA0tB/AEQtDv5JYD4AUTwY/6oGJP8D+RoAI9VtABaBNv8VI+H/6j04/zrZBgCPfFgA7H5CANEmt/8i7gb/rpFmAF8W0wDED5n+LlTo/3UikgHn+kr/G4ZkAVy7w/+qxnAAeBwqANFGQwAdUR8AHahkAamtoABrI3UAPmA7/1EMRQGH777/3PwSAKPcOv+Jibz/U2ZtAGAGTADq3tL/ua7NATye1f8N8dYArIGMAF1o8gDAnPsAK3UeAOFRngB/6NoA4hzLAOkbl/91KwX/8g4v/yEUBgCJ+yz+Gx/1/7fWff4oeZUAup7V/1kI4wBFWAD+y4fhAMmuywCTR7gAEnkp/l4FTgDg1vD+JAW0APuH5wGjitQA0vl0/liBuwATCDH+Pg6Q/59M0wDWM1IAbXXk/mffy/9L/A8Bmkfc/xcNWwGNqGD/tbaFAPozNwDq6tT+rz+eACfwNAGevST/1ShVASC09/8TZhoBVBhh/0UV3gCUi3r/3NXrAejL/wB5OZMA4weaADUWkwFIAeEAUoYw/lM8nf+RSKkAImfvAMbpLwB0EwT/uGoJ/7eBUwAksOYBImdIANuihgD1Kp4AIJVg/qUskADK70j+15YFACpCJAGE168AVq5W/xrFnP8x6If+Z7ZSAP2AsAGZsnoA9foKAOwYsgCJaoQAKB0pADIemP98aSYA5r9LAI8rqgAsgxT/LA0X/+3/mwGfbWT/cLUY/2jcbAA304MAYwzV/5iXkf/uBZ8AYZsIACFsUQABA2cAPm0i//qbtAAgR8P/JkaRAZ9f9QBF5WUBiBzwAE/gGQBObnn/+Kh8ALuA9wACk+v+TwuEAEY6DAG1CKP/T4mF/yWqC/+N81X/sOfX/8yWpP/v1yf/Llec/gijWP+sIugAQixm/xs2Kf7sY1f/KXupATRyKwB1higAm4YaAOfPW/4jhCb/E2Z9/iTjhf92A3H/HQ18AJhgSgFYks7/p7/c/qISWP+2ZBcAH3U0AFEuagEMAgcARVDJAdH2rAAMMI0B4NNYAHTinwB6YoIAQezqAeHiCf/P4nsBWdY7AHCHWAFa9Mv/MQsmAYFsugBZcA8BZS7M/3/MLf5P/93/M0kS/38qZf/xFcoAoOMHAGky7ABPNMX/aMrQAbQPEABlxU7/Yk3LACm58QEjwXwAI5sX/881wAALfaMB+Z65/wSDMAAVXW//PXnnAUXIJP+5MLn/b+4V/ycyGf9j16P/V9Qe/6STBf+ABiMBbN9u/8JMsgBKZbQA8y8wAK4ZK/9Srf0BNnLA/yg3WwDXbLD/CzgHAODpTADRYsr+8hl9ACzBXf7LCLEAh7ATAHBH1f/OO7ABBEMaAA6P1f4qN9D/PEN4AMEVowBjpHMAChR2AJzU3v6gB9n/cvVMAXU7ewCwwlb+1Q+wAE7Oz/7VgTsA6fsWAWA3mP/s/w//xVlU/12VhQCuoHEA6mOp/5h0WACQpFP/Xx3G/yIvD/9jeIb/BezBAPn3fv+Tux4AMuZ1/2zZ2/+jUab/SBmp/pt5T/8cm1n+B34RAJNBIQEv6v0AGjMSAGlTx/+jxOYAcfikAOL+2gC90cv/pPfe/v8jpQAEvPMBf7NHACXt/v9kuvAABTlH/mdISf/0ElH+5dKE/+4GtP8L5a7/493AARExHACj18T+CXYE/zPwRwBxgW3/TPDnALyxfwB9RywBGq/zAF6pGf4b5h0AD4t3Aaiquv+sxUz//Eu8AIl8xABIFmD/LZf5AdyRZABAwJ//eO/iAIGykgAAwH0A64rqALedkgBTx8D/uKxI/0nhgABNBvr/ukFDAGj2zwC8IIr/2hjyAEOKUf7tgXn/FM+WASnHEP8GFIAAn3YFALUQj//cJg8AF0CT/kkaDQBX5DkBzHyAACsY3wDbY8cAFksU/xMbfgCdPtcAbh3mALOn/wE2/L4A3cy2/rOeQf9RnQMAwtqfAKrfAADgCyD/JsViAKikJQAXWAcBpLpuAGAkhgDq8uUA+nkTAPL+cP8DL14BCe8G/1GGmf7W/aj/Q3zgAPVfSgAcHiz+AW3c/7JZWQD8JEwAGMYu/0xNbwCG6oj/J14dALlI6v9GRIf/52YH/k3njACnLzoBlGF2/xAb4QGmzo//brLW/7SDogCPjeEBDdpO/3KZIQFiaMwAr3J1AafOSwDKxFMBOkBDAIovbwHE94D/ieDg/p5wzwCaZP8BhiVrAMaAT/9/0Zv/o/65/jwO8wAf23D+HdlBAMgNdP57PMT/4Du4/vJZxAB7EEv+lRDOAEX+MAHndN//0aBBAchQYgAlwrj+lD8iAIvwQf/ZkIT/OCYt/sd40gBssab/oN4EANx+d/6la6D/Utz4AfGviACQjRf/qYpUAKCJTv/idlD/NBuE/z9gi/+Y+icAvJsPAOgzlv4oD+j/8OUJ/4mvG/9LSWEB2tQLAIcFogFrudUAAvlr/yjyRgDbyBkAGZ0NAENSUP/E+Rf/kRSVADJIkgBeTJQBGPtBAB/AFwC41Mn/e+miAfetSACiV9v+foZZAJ8LDP6maR0ASRvkAXF4t/9Co20B1I8L/5/nqAH/gFoAOQ46/lk0Cv/9CKMBAJHS/wqBVQEutRsAZ4ig/n680f8iI28A19sY/9QL1v5lBXYA6MWF/9+nbf/tUFb/RoteAJ7BvwGbDzP/D75zAE6Hz//5ChsBtX3pAF+sDf6q1aH/J+yK/19dV/++gF8AfQ/OAKaWnwDjD57/zp54/yqNgABlsngBnG2DANoOLP73qM7/1HAcAHAR5P9aECUBxd5sAP7PU/8JWvP/8/SsABpYc//NdHoAv+bBALRkCwHZJWD/mk6cAOvqH//OsrL/lcD7ALb6hwD2FmkAfMFt/wLSlf+pEaoAAGBu/3UJCAEyeyj/wb1jACLjoAAwUEb+0zPsAC169f4srggArSXp/55BqwB6Rdf/WlAC/4NqYP7jcocAzTF3/rA+QP9SMxH/8RTz/4INCP6A2fP/ohsB/lp28QD2xvb/NxB2/8ifnQCjEQEAjGt5AFWhdv8mAJUAnC/uAAmmpgFLYrX/MkoZAEIPLwCL4Z8ATAOO/w7uuAALzzX/t8C6Aasgrv+/TN0B96rbABmsMv7ZCekAy35E/7dcMAB/p7cBQTH+ABA/fwH+Far/O+B//hYwP/8bToL+KMMdAPqEcP4jy5AAaKmoAM/9Hv9oKCb+XuRYAM4QgP/UN3r/3xbqAN/FfwD9tbUBkWZ2AOyZJP/U2Uj/FCYY/oo+PgCYjAQA5txj/wEV1P+UyecA9HsJ/gCr0gAzOiX/Af8O//S3kf4A8qYAFkqEAHnYKQBfw3L+hRiX/5zi5//3BU3/9pRz/uFcUf/eUPb+qntZ/0rHjQAdFAj/iohG/11LXADdkzH+NH7iAOV8FwAuCbUAzUA0AYP+HACXntQAg0BOAM4ZqwAA5osAv/1u/mf3pwBAKCgBKqXx/ztL5P58873/xFyy/4KMVv+NWTgBk8YF/8v4nv6Qoo0AC6ziAIIqFf8Bp4//kCQk/zBYpP6oqtwAYkfWAFvQTwCfTMkBpirW/0X/AP8GgH3/vgGMAJJT2v/X7kgBen81AL10pf9UCEL/1gPQ/9VuhQDDqCwBnudFAKJAyP5bOmgAtjq7/vnkiADLhkz+Y93pAEv+1v5QRZoAQJj4/uyIyv+daZn+la8UABYjE/98eekAuvrG/oTliwCJUK7/pX1EAJDKlP7r7/gAh7h2AGVeEf96SEb+RYKSAH/e+AFFf3b/HlLX/rxKE//lp8L+dRlC/0HqOP7VFpwAlztd/i0cG/+6fqT/IAbvAH9yYwHbNAL/Y2Cm/j6+fv9s3qgBS+KuAObixwA8ddr//PgUAda8zAAfwob+e0XA/6mtJP43YlsA3ypm/okBZgCdWhkA73pA//wG6QAHNhT/UnSuAIclNv8Pun0A43Cv/2S04f8q7fT/9K3i/vgSIQCrY5b/Susy/3VSIP5qqO0Az23QAeQJugCHPKn+s1yPAPSqaP/rLXz/RmO6AHWJtwDgH9cAKAlkABoQXwFE2VcACJcU/xpkOv+wpcsBNHZGAAcg/v70/vX/p5DC/31xF/+webUAiFTRAIoGHv9ZMBwAIZsO/xnwmgCNzW0BRnM+/xQoa/6Kmsf/Xt/i/52rJgCjsRn+LXYD/w7eFwHRvlH/dnvoAQ3VZf97N3v+G/alADJjTP+M1iD/YUFD/xgMHACuVk4BQPdgAKCHQwBCN/P/k8xg/xoGIf9iM1MBmdXQ/wK4Nv8Z2gsAMUP2/hKVSP8NGUgAKk/WACoEJgEbi5D/lbsXABKkhAD1VLj+eMZo/37aYAA4der/DR3W/kQvCv+nmoT+mCbGAEKyWf/ILqv/DWNT/9K7/f+qLSoBitF8ANaijQAM5pwAZiRw/gOTQwA013v/6as2/2KJPgD32if/59rsAPe/fwDDklQApbBc/xPUXv8RSuMAWCiZAcaTAf/OQ/X+8APa/z2N1f9ht2oAw+jr/l9WmgDRMM3+dtHx//B43wHVHZ8Ao3+T/w3aXQBVGET+RhRQ/70FjAFSYf7/Y2O//4RUhf9r2nT/cHouAGkRIADCoD//RN4nAdj9XACxac3/lcnDACrhC/8oonMACQdRAKXa2wC0FgD+HZL8/5LP4QG0h2AAH6NwALEL2/+FDMH+K04yAEFxeQE72Qb/bl4YAXCsbwAHD2AAJFV7AEeWFf/QSbwAwAunAdX1IgAJ5lwAoo4n/9daGwBiYVkAXk/TAFqd8ABf3H4BZrDiACQe4P4jH38A5+hzAVVTggDSSfX/L49y/0RBxQA7SD7/t4Wt/l15dv87sVH/6kWt/82AsQDc9DMAGvTRAUneTf+jCGD+lpXTAJ7+ywE2f4sAoeA7AARtFv/eKi3/0JJm/+yOuwAyzfX/CkpZ/jBPjgDeTIL/HqY/AOwMDf8xuPQAu3FmANpl/QCZObb+IJYqABnGkgHt8TgAjEQFAFukrP9Okbr+QzTNANvPgQFtcxEANo86ARX4eP+z/x4AwexC/wH/B//9wDD/E0XZAQPWAP9AZZIB330j/+tJs//5p+IA4a8KAWGiOgBqcKsBVKwF/4WMsv+G9Y4AYVp9/7rLuf/fTRf/wFxqAA/Gc//ZmPgAq7J4/+SGNQCwNsEB+vs1ANUKZAEix2oAlx/0/qzgV/8O7Rf//VUa/38ndP+saGQA+w5G/9TQiv/90/oAsDGlAA9Me/8l2qD/XIcQAQp+cv9GBeD/9/mNAEQUPAHx0r3/w9m7AZcDcQCXXK4A5z6y/9u34QAXFyH/zbVQADm4+P9DtAH/Wntd/ycAov9g+DT/VEKMACJ/5P/CigcBpm68ABURmwGavsb/1lA7/xIHjwBIHeIBx9n5AOihRwGVvskA2a9f/nGTQ/+Kj8f/f8wBAB22UwHO5pv/usw8AAp9Vf/oYBn//1n3/9X+rwHowVEAHCuc/gxFCACTGPgAEsYxAIY8IwB29hL/MVj+/uQVuv+2QXAB2xYB/xZ+NP+9NTH/cBmPACZ/N//iZaP+0IU9/4lFrgG+dpH/PGLb/9kN9f/6iAoAVP7iAMkffQHwM/v/H4OC/wKKMv/X17EB3wzu//yVOP98W0T/SH6q/nf/ZACCh+j/Dk+yAPqDxQCKxtAAediL/ncSJP8dwXoAECot/9Xw6wHmvqn/xiPk/m6tSADW3fH/OJSHAMB1Tv6NXc//j0GVABUSYv9fLPQBar9NAP5VCP7WbrD/Sa0T/qDEx//tWpAAwaxx/8ibiP7kWt0AiTFKAaTd1//RvQX/aew3/yofgQHB/+wALtk8AIpYu//iUuz/UUWX/46+EAENhggAf3ow/1FAnACr84sA7SP2AHqPwf7UepIAXyn/AVeETQAE1B8AER9OACctrf4Yjtn/XwkG/+NTBgBiO4L+Ph4hAAhz0wGiYYD/B7gX/nQcqP/4ipf/YvTwALp2ggBy+Ov/aa3IAaB8R/9eJKQBr0GS/+7xqv7KxsUA5EeK/i32bf/CNJ4AhbuwAFP8mv5Zvd3/qkn8AJQ6fQAkRDP+KkWx/6hMVv8mZMz/JjUjAK8TYQDh7v3/UVGHANIb//7rSWsACM9zAFJ/iABUYxX+zxOIAGSkZQBQ0E3/hM/t/w8DD/8hpm4AnF9V/yW5bwGWaiP/ppdMAHJXh/+fwkAADHof/+gHZf6td2IAmkfc/r85Nf+o6KD/4CBj/9qcpQCXmaMA2Q2UAcVxWQCVHKH+zxceAGmE4/825l7/ha3M/1y3nf9YkPz+ZiFaAJ9hAwC12pv/8HJ3AGrWNf+lvnMBmFvh/1hqLP/QPXEAlzR8AL8bnP9uNuwBDh6m/yd/zwHlxxwAvOS8/mSd6wD22rcBaxbB/86gXwBM75MAz6F1ADOmAv80dQr+STjj/5jB4QCEXoj/Zb/RACBr5f/GK7QBZNJ2AHJDmf8XWBr/WZpcAdx4jP+Qcs///HP6/yLOSACKhX//CLJ8AVdLYQAP5Vz+8EOD/3Z74/6SeGj/kdX/AYG7Rv/bdzYAAROtAC2WlAH4U0gAy+mpAY5rOAD3+SYBLfJQ/x7pZwBgUkYAF8lvAFEnHv+ht07/wuoh/0TjjP7YznQARhvr/2iQTwCk5l3+1oecAJq78v68FIP/JG2uAJ9w8QAFbpUBJKXaAKYdEwGyLkkAXSsg/vi97QBmm40AyV3D//GL/f8Pb2L/bEGj/ptPvv9JrsH+9igw/2tYC/7KYVX//cwS/3HyQgBuoML+0BK6AFEVPAC8aKf/fKZh/tKFjgA48on+KW+CAG+XOgFv1Y3/t6zx/yYGxP+5B3v/Lgv2APVpdwEPAqH/CM4t/xLKSv9TfHMB1I2dAFMI0f6LD+j/rDat/jL3hADWvdUAkLhpAN/++AD/k/D/F7xIAAczNgC8GbT+3LQA/1OgFACjvfP/OtHC/1dJPABqGDEA9fncABatpwB2C8P/E37tAG6fJf87Ui8AtLtWALyU0AFkJYX/B3DBAIG8nP9UaoH/heHKAA7sb/8oFGUArKwx/jM2Sv/7ubj/XZvg/7T54AHmspIASDk2/rI+uAB3zUgAue/9/z0P2gDEQzj/6iCrAS7b5ADQbOr/FD/o/6U1xwGF5AX/NM1rAErujP+WnNv+76yy//u93/4gjtP/2g+KAfHEUAAcJGL+FurHAD3t3P/2OSUAjhGO/50+GgAr7l/+A9kG/9UZ8AEn3K7/ms0w/hMNwP/0Ijb+jBCbAPC1Bf6bwTwApoAE/ySROP+W8NsAeDORAFKZKgGM7JIAa1z4Ab0KAwA/iPIA0ycYABPKoQGtG7r/0szv/inRov+2/p//rHQ0AMNn3v7NRTsANRYpAdowwgBQ0vIA0rzPALuhof7YEQEAiOFxAPq4PwDfHmL+TaiiADs1rwATyQr/i+DCAJPBmv/UvQz+Aciu/zKFcQFes1oArbaHAF6xcQArWdf/iPxq/3uGU/4F9UL/UjEnAdwC4ABhgbEATTtZAD0dmwHLq9z/XE6LAJEhtf+pGI0BN5azAIs8UP/aJ2EAApNr/zz4SACt5i8BBlO2/xBpov6J1FH/tLiGASfepP/dafsB73B9AD8HYQA/aOP/lDoMAFo84P9U1PwAT9eoAPjdxwFzeQEAJKx4ACCiu/85azH/kyoVAGrGKwE5SlcAfstR/4GHwwCMH7EA3YvCAAPe1wCDROcAsVay/nyXtAC4fCYBRqMRAPn7tQEqN+MA4qEsABfsbgAzlY4BXQXsANq3av5DGE0AKPXR/955mQClOR4AU308AEYmUgHlBrwAbd6d/zd2P//Nl7oA4yGV//6w9gHjseMAImqj/rArTwBqX04BufF6/7kOPQAkAcoADbKi//cLhACh5lwBQQG5/9QypQGNkkD/nvLaABWkfQDVi3oBQ0dXAMuesgGXXCsAmG8F/ycD7//Z//r/sD9H/0r1TQH6rhL/IjHj//Yu+/+aIzABfZ09/2okTv9h7JkAiLt4/3GGq/8T1dn+2F7R//wFPQBeA8oAAxq3/0C/K/8eFxUAgY1N/2Z4BwHCTIwAvK80/xFRlADoVjcB4TCsAIYqKv/uMi8AqRL+ABSTV/8Ow+//RfcXAO7lgP+xMXAAqGL7/3lH+ADzCJH+9uOZ/9upsf77i6X/DKO5/6Qoq/+Znxv+821b/94YcAES1ucAa521/sOTAP/CY2j/WYy+/7FCfv5quUIAMdofAPyungC8T+YB7ingANTqCAGIC7UApnVT/0TDXgAuhMkA8JhYAKQ5Rf6g4Cr/O9dD/3fDjf8ktHn+zy8I/67S3wBlxUT//1KNAfqJ6QBhVoUBEFBFAISDnwB0XWQALY2LAJisnf9aK1sAR5kuACcQcP/ZiGH/3MYZ/rE1MQDeWIb/gA88AM/Aqf/AdNH/ak7TAcjVt/8HDHr+3ss8/yFux/77anUA5OEEAXg6B//dwVT+cIUbAL3Iyf+Lh5YA6jew/z0yQQCYbKn/3FUB/3CH4wCiGroAz2C5/vSIawBdmTIBxmGXAG4LVv+Pda7/c9TIAAXKtwDtpAr+ue8+AOx4Ev5ie2P/qMnC/i7q1gC/hTH/Y6l3AL67IwFzFS3/+YNIAHAGe//WMbX+pukiAFzFZv795M3/AzvJASpiLgDbJSP/qcMmAF58wQGcK98AX0iF/njOvwB6xe//sbtP//4uAgH6p74AVIETAMtxpv/5H73+SJ3K/9BHSf/PGEgAChASAdJRTP9Y0MD/fvNr/+6NeP/Heer/iQw7/yTce/+Uszz+8AwdAEIAYQEkHib/cwFd/2Bn5//FnjsBwKTwAMrKOf8YrjAAWU2bASpM1wD0l+kAFzBRAO9/NP7jgiX/+HRdAXyEdgCt/sABButT/26v5wH7HLYAgfld/lS4gABMtT4Ar4C6AGQ1iP5tHeIA3ek6ARRjSgAAFqAAhg0VAAk0N/8RWYwAryI7AFSld//g4ur/B0im/3tz/wES1vYA+gdHAdncuQDUI0z/Jn2vAL1h0gBy7iz/Kbyp/i26mgBRXBYAhKDBAHnQYv8NUSz/y5xSAEc6Ff/Qcr/+MiaTAJrYwwBlGRIAPPrX/+mE6/9nr44BEA5cAI0fbv7u8S3/mdnvAWGoL//5VRABHK8+/zn+NgDe534Api11/hK9YP/kTDIAyPReAMaYeAFEIkX/DEGg/mUTWgCnxXj/RDa5/ynavABxqDAAWGm9ARpSIP+5XaQB5PDt/0K2NQCrxVz/awnpAcd4kP9OMQr/bapp/1oEH/8c9HH/SjoLAD7c9v95msj+kNKy/345gQEr+g7/ZW8cAS9W8f89Rpb/NUkF/x4angDRGlYAiu1KAKRfvACOPB3+onT4/7uvoACXEhAA0W9B/suGJ/9YbDH/gxpH/90b1/5oaV3/H+wf/ocA0/+Pf24B1EnlAOlDp/7DAdD/hBHd/zPZWgBD6zL/39KPALM1ggHpasYA2a3c/3DlGP+vml3+R8v2/zBChf8DiOb/F91x/utv1QCqeF/++90CAC2Cnv5pXtn/8jS0/tVELf9oJhwA9J5MAKHIYP/PNQ3/u0OUAKo2+AB3orL/UxQLACoqwAGSn6P/t+hvAE3lFf9HNY8AG0wiAPaIL//bJ7b/XODJAROODv9FtvH/o3b1AAltagGqtff/Ti/u/1TSsP/Va4sAJyYLAEgVlgBIgkUAzU2b/o6FFQBHb6z+4io7/7MA1wEhgPEA6vwNAbhPCABuHkn/9o29AKrP2gFKmkX/ivYx/5sgZAB9Smn/WlU9/yPlsf8+fcH/mVa8AUl41ADRe/b+h9Em/5c6LAFcRdb/DgxY//yZpv/9z3D/PE5T/+N8bgC0YPz/NXUh/qTcUv8pARv/JqSm/6Rjqf49kEb/wKYSAGv6QgDFQTIAAbMS//9oAf8rmSP/UG+oAG6vqAApaS3/2w7N/6TpjP4rAXYA6UPDALJSn/+KV3r/1O5a/5AjfP4ZjKQA+9cs/oVGa/9l41D+XKk3ANcqMQBytFX/IegbAazVGQA+sHv+IIUY/+G/PgBdRpkAtSpoARa/4P/IyIz/+eolAJU5jQDDOND//oJG/yCt8P8d3McAbmRz/4Tl+QDk6d//JdjR/rKx0f+3LaX+4GFyAIlhqP/h3qwApQ0xAdLrzP/8BBz+RqCXAOi+NP5T+F3/PtdNAa+vs/+gMkIAeTDQAD+p0f8A0sgA4LssAUmiUgAJsI//E0zB/x07pwEYK5oAHL6+AI28gQDo68v/6gBt/zZBnwA8WOj/ef2W/vzpg//GbikBU01H/8gWO/5q/fL/FQzP/+1CvQBaxsoB4ax/ADUWygA45oQAAVa3AG2+KgDzRK4BbeSaAMixegEjoLf/sTBV/1raqf/4mE4Ayv5uAAY0KwCOYkH/P5EWAEZqXQDoimsBbrM9/9OB2gHy0VwAI1rZAbaPav90Zdn/cvrd/63MBgA8lqMASaws/+9uUP/tTJn+oYz5AJXo5QCFHyj/rqR3AHEz1gCB5AL+QCLzAGvj9P+uasj/VJlGATIjEAD6Stj+7L1C/5n5DQDmsgT/3SnuAHbjef9eV4z+/ndcAEnv9v51V4AAE9OR/7Eu/ADlW/YBRYD3/8pNNgEICwn/mWCmANnWrf+GwAIBAM8AAL2uawGMhmQAnsHzAbZmqwDrmjMAjgV7/zyoWQHZDlz/E9YFAdOn/gAsBsr+eBLs/w9xuP+434sAKLF3/rZ7Wv+wpbAA903CABvqeADnANb/OyceAH1jkf+WREQBjd74AJl70v9uf5j/5SHWAYfdxQCJYQIADI/M/1EpvABzT4L/XgOEAJivu/98jQr/fsCz/wtnxgCVBi0A21W7AeYSsv9ItpgAA8a4/4Bw4AFhoeYA/mMm/zqfxQCXQtsAO0WP/7lw+QB3iC//e4KEAKhHX/9xsCgB6LmtAM9ddQFEnWz/ZgWT/jFhIQBZQW/+9x6j/3zZ3QFm+tgAxq5L/jk3EgDjBewB5dWtAMlt2gEx6e8AHjeeARmyagCbb7wBXn6MANcf7gFN8BAA1fIZASZHqADNul3+MdOM/9sAtP+GdqUAoJOG/266I//G8yoA85J3AIbrowEE8Yf/wS7B/me0T//hBLj+8naCAJKHsAHqbx4ARULV/ilgewB5Xir/sr/D/y6CKgB1VAj/6THW/u56bQAGR1kB7NN7APQNMP53lA4AchxW/0vtGf+R5RD+gWQ1/4aWeP6onTIAF0ho/+AxDgD/exb/l7mX/6pQuAGGthQAKWRlAZkhEABMmm8BVs7q/8CgpP6le13/Adik/kMRr/+pCzv/nik9/0m8Dv/DBon/FpMd/xRnA//2guP/eiiAAOIvGP4jJCAAmLq3/0XKFADDhcMA3jP3AKmrXgG3AKD/QM0SAZxTD//FOvn++1lu/zIKWP4zK9gAYvLGAfWXcQCr7MIBxR/H/+VRJgEpOxQA/WjmAJhdDv/28pL+1qnw//BmbP6gp+wAmtq8AJbpyv8bE/oBAkeF/68MPwGRt8YAaHhz/4L79wAR1Kf/PnuE//dkvQCb35gAj8UhAJs7LP+WXfABfwNX/19HzwGnVQH/vJh0/woXFwCJw10BNmJhAPAAqP+UvH8AhmuXAEz9qwBahMAAkhY2AOBCNv7muuX/J7bEAJT7gv9Bg2z+gAGgAKkxp/7H/pT/+waDALv+gf9VUj4Ashc6//6EBQCk1ScAhvyS/iU1Uf+bhlIAzafu/14ttP+EKKEA/m9wATZL2QCz5t0B616//xfzMAHKkcv/J3Yq/3WN/QD+AN4AK/syADap6gFQRNAAlMvz/pEHhwAG/gAA/Ll/AGIIgf8mI0j/0yTcASgaWQCoQMX+A97v/wJT1/60n2kAOnPCALp0av/l99v/gXbBAMqutwGmoUgAyWuT/u2ISgDp5moBaW+oAEDgHgEB5QMAZpev/8Lu5P/++tQAu+15AEP7YAHFHgsAt1/MAM1ZigBA3SUB/98e/7Iw0//xyFr/p9Fg/zmC3QAucsj/PbhCADe2GP5utiEAq77o/3JeHwAS3QgAL+f+AP9wUwB2D9f/rRko/sDBH//uFZL/q8F2/2XqNf6D1HAAWcBrAQjQGwC12Q//55XoAIzsfgCQCcf/DE+1/pO2yv8Tbbb/MdThAEqjywCv6ZQAGnAzAMHBCf8Ph/kAluOCAMwA2wEY8s0A7tB1/xb0cAAa5SIAJVC8/yYtzv7wWuH/HQMv/yrgTAC686cAIIQP/wUzfQCLhxgABvHbAKzlhf/21jIA5wvP/79+UwG0o6r/9TgYAbKk0/8DEMoBYjl2/42DWf4hMxgA85Vb//00DgAjqUP+MR5Y/7MbJP+ljLcAOr2XAFgfAABLqUIAQmXH/xjYxwF5xBr/Dk/L/vDiUf9eHAr/U8Hw/8zBg/9eD1YA2iidADPB0QAA8rEAZrn3AJ5tdAAmh1sA36+VANxCAf9WPOgAGWAl/+F6ogHXu6j/np0uADirogDo8GUBehYJADMJFf81Ge7/2R7o/n2plAAN6GYAlAklAKVhjQHkgykA3g/z//4SEQAGPO0BagNxADuEvQBccB4AadDVADBUs/+7eef+G9ht/6Lda/5J78P/+h85/5WHWf+5F3MBA6Od/xJw+gAZObv/oWCkAC8Q8wAMjfv+Q+q4/ykSoQCvBmD/oKw0/hiwt//GwVUBfHmJ/5cycv/cyzz/z+8FAQAma/837l7+RpheANXcTQF4EUX/VaS+/8vqUQAmMSX+PZB8AIlOMf6o9zAAX6T8AGmphwD95IYAQKZLAFFJFP/P0goA6mqW/14iWv/+nzn+3IVjAIuTtP4YF7kAKTke/71hTABBu9//4Kwl/yI+XwHnkPAATWp+/kCYWwAdYpsA4vs1/+rTBf+Qy97/pLDd/gXnGACzes0AJAGG/31Gl/5h5PwArIEX/jBa0f+W4FIBVIYeAPHELgBncer/LmV5/ih8+v+HLfL+Cfmo/4xsg/+Po6sAMq3H/1jejv/IX54AjsCj/wd1hwBvfBYA7AxB/kQmQf/jrv4A9PUmAPAy0P+hP/oAPNHvAHojEwAOIeb+Ap9xAGoUf//kzWAAidKu/rTUkP9ZYpoBIliLAKeicAFBbsUA8SWpAEI4g/8KyVP+hf27/7FwLf7E+wAAxPqX/+7o1v+W0c0AHPB2AEdMUwHsY1sAKvqDAWASQP923iMAcdbL/3p3uP9CEyQAzED5AJJZiwCGPocBaOllALxUGgAx+YEA0NZL/8+CTf9zr+sAqwKJ/6+RugE39Yf/mla1AWQ69v9txzz/UsyG/9cx5gGM5cD/3sH7/1GID/+zlaL/Fycd/wdfS/6/Ud4A8VFa/2sxyf/0050A3oyV/0HbOP699lr/sjudATDbNABiItcAHBG7/6+pGABcT6H/7MjCAZOP6gDl4QcBxagOAOszNQH9eK4AxQao/8p1qwCjFc4AclVa/w8pCv/CE2MAQTfY/qKSdAAyztT/QJId/56egwFkpYL/rBeB/301Cf8PwRIBGjEL/7WuyQGHyQ7/ZBOVANtiTwAqY4/+YAAw/8X5U/5olU//626I/lKALP9BKST+WNMKALt5uwBihscAq7yz/tIL7v9Ce4L+NOo9ADBxF/4GVnj/d7L1AFeByQDyjdEAynJVAJQWoQBnwzAAGTGr/4pDggC2SXr+lBiCANPlmgAgm54AVGk9ALHCCf+mWVYBNlO7APkodf9tA9f/NZIsAT8vswDC2AP+DlSIAIixDf9I87r/dRF9/9M60/9dT98AWlj1/4vRb/9G3i8ACvZP/8bZsgDj4QsBTn6z/z4rfgBnlCMAgQil/vXwlAA9M44AUdCGAA+Jc//Td+z/n/X4/wKGiP/mizoBoKT+AHJVjf8xprb/kEZUAVW2BwAuNV0ACaah/zeisv8tuLwAkhws/qlaMQB4svEBDnt//wfxxwG9QjL/xo9l/r3zh/+NGBj+S2FXAHb7mgHtNpwAq5LP/4PE9v+IQHEBl+g5APDacwAxPRv/QIFJAfypG/8ohAoBWsnB//x58AG6zikAK8ZhAJFktwDM2FD+rJZBAPnlxP5oe0n/TWhg/oK0CABoezkA3Mrl/2b50wBWDuj/tk7RAO/hpABqDSD/eEkR/4ZD6QBT/rUAt+xwATBAg//x2PP/QcHiAM7xZP5khqb/7crFADcNUQAgfGb/KOSxAHa1HwHnoIb/d7vKAACOPP+AJr3/psmWAM94GgE2uKwADPLM/oVC5gAiJh8BuHBQACAzpf6/8zcAOkmS/punzf9kaJj/xf7P/60T9wDuCsoA75fyAF47J//wHWb/Clya/+VU2/+hgVAA0FrMAfDbrv+eZpEBNbJM/zRsqAFT3msA0yRtAHY6OAAIHRYA7aDHAKrRnQCJRy8Aj1YgAMbyAgDUMIgBXKy6AOaXaQFgv+UAilC//vDYgv9iKwb+qMQxAP0SWwGQSXkAPZInAT9oGP+4pXD+futiAFDVYv97PFf/Uoz1Ad94rf8PxoYBzjzvAOfqXP8h7hP/pXGOAbB3JgCgK6b+71tpAGs9wgEZBEQAD4szAKSEav8idC7+qF/FAInUFwBInDoAiXBF/pZpmv/syZ0AF9Sa/4hS4/7iO93/X5XAAFF2NP8hK9cBDpNL/1mcef4OEk8Ak9CLAZfaPv+cWAgB0rhi/xSve/9mU+UA3EF0AZb6BP9cjtz/IvdC/8zhs/6XUZcARyjs/4o/PgAGT/D/t7m1AHYyGwA/48AAe2M6ATLgm/8R4d/+3OBN/w4sewGNgK8A+NTIAJY7t/+TYR0Alsy1AP0lRwCRVXcAmsi6AAKA+f9TGHwADlePAKgz9QF8l+f/0PDFAXy+uQAwOvYAFOnoAH0SYv8N/h//9bGC/2yOIwCrffL+jAwi/6WhogDOzWUA9xkiAWSROQAnRjkAdszL//IAogCl9B4AxnTiAIBvmf+MNrYBPHoP/5s6OQE2MsYAq9Md/2uKp/+ta8f/baHBAFlI8v/Oc1n/+v6O/rHKXv9RWTIAB2lC/xn+//7LQBf/T95s/yf5SwDxfDIA75iFAN3xaQCTl2IA1aF5/vIxiQDpJfn+KrcbALh35v/ZIKP/0PvkAYk+g/9PQAn+XjBxABGKMv7B/xYA9xLFAUM3aAAQzV//MCVCADecPwFAUkr/yDVH/u9DfQAa4N4A34ld/x7gyv8J3IQAxibrAWaNVgA8K1EBiBwaAOkkCP7P8pQApKI/ADMu4P9yME//Ca/iAN4Dwf8voOj//11p/g4q5gAailIB0Cv0ABsnJv9i0H//QJW2/wX60QC7PBz+MRna/6l0zf93EngAnHST/4Q1bf8NCsoAblOnAJ3bif8GA4L/Mqce/zyfL/+BgJ3+XgO9AAOmRABT39cAllrCAQ+oQQDjUzP/zatC/za7PAGYZi3/d5rhAPD3iABkxbL/i0ff/8xSEAEpzir/nMDd/9h79P/a2rn/u7rv//ysoP/DNBYAkK61/rtkc//TTrD/GwfBAJPVaP9ayQr/UHtCARYhugABB2P+Hs4KAOXqBQA1HtIAigjc/kc3pwBI4VYBdr68AP7BZQGr+az/Xp63/l0CbP+wXUz/SWNP/0pAgf72LkEAY/F//vaXZv8sNdD+O2bqAJqvpP9Y8iAAbyYBAP+2vv9zsA/+qTyBAHrt8QBaTD8APkp4/3rDbgB3BLIA3vLSAIIhLv6cKCkAp5JwATGjb/95sOsATM8O/wMZxgEp69UAVSTWATFcbf/IGB7+qOzDAJEnfAHsw5UAWiS4/0NVqv8mIxr+g3xE/++bI/82yaQAxBZ1/zEPzQAY4B0BfnGQAHUVtgDLn40A34dNALDmsP++5df/YyW1/zMViv8ZvVn/MTCl/pgt9wCqbN4AUMoFABtFZ/7MFoH/tPw+/tIBW/+Sbv7/26IcAN/81QE7CCEAzhD0AIHTMABroNAAcDvRAG1N2P4iFbn/9mM4/7OLE/+5HTL/VFkTAEr6Yv/hKsj/wNnN/9IQpwBjhF8BK+Y5AP4Ly/9jvD//d8H7/lBpNgDotb0Bt0Vw/9Crpf8vbbT/e1OlAJKiNP+aCwT/l+Na/5KJYf496Sn/Xio3/2yk7ACYRP4ACoyD/wpqT/7znokAQ7JC/rF7xv8PPiIAxVgq/5Vfsf+YAMb/lf5x/+Fao/992fcAEhHgAIBCeP7AGQn/Mt3NADHURgDp/6QAAtEJAN002/6s4PT/XjjOAfKzAv8fW6QB5i6K/73m3AA5Lz3/bwudALFbmAAc5mIAYVd+AMZZkf+nT2sA+U2gAR3p5v+WFVb+PAvBAJclJP65lvP/5NRTAayXtADJqZsA9DzqAI7rBAFD2jwAwHFLAXTzz/9BrJsAUR6c/1BIIf4S523/jmsV/n0ahP+wEDv/lsk6AM6pyQDQeeIAKKwO/5Y9Xv84OZz/jTyR/y1slf/ukZv/0VUf/sAM0gBjYl3+mBCXAOG53ACN6yz/oKwV/kcaH/8NQF3+HDjGALE++AG2CPEApmWU/05Rhf+B3tcBvKmB/+gHYQAxcDz/2eX7AHdsigAnE3v+gzHrAIRUkQCC5pT/GUq7AAX1Nv+52/EBEsLk//HKZgBpccoAm+tPABUJsv+cAe8AyJQ9AHP30v8x3YcAOr0IASMuCQBRQQX/NJ65/310Lv9KjA3/0lys/pMXRwDZ4P3+c2y0/5E6MP7bsRj/nP88AZqT8gD9hlcANUvlADDD3v8frzL/nNJ4/9Aj3v8S+LMBAgpl/53C+P+ezGX/aP7F/08+BACyrGUBYJL7/0EKnAACiaX/dATnAPLXAQATIx3/K6FPADuV9gH7QrAAyCED/1Bujv/DoREB5DhC/3svkf6EBKQAQ66sABn9cgBXYVcB+txUAGBbyP8lfTsAE0F2AKE08f/trAb/sL///wFBgv7fvuYAZf3n/5IjbQD6HU0BMQATAHtamwEWViD/2tVBAG9dfwA8Xan/CH+2ABG6Dv79ifb/1Rkw/kzuAP/4XEb/Y+CLALgJ/wEHpNAAzYPGAVfWxwCC1l8A3ZXeABcmq/7FbtUAK3OM/texdgBgNEIBdZ7tAA5Atv8uP67/nl++/+HNsf8rBY7/rGPU//S7kwAdM5n/5HQY/h5lzwAT9pb/hucFAH2G4gFNQWIA7IIh/wVuPgBFbH//B3EWAJEUU/7Coef/g7U8ANnRsf/llNT+A4O4AHWxuwEcDh//sGZQADJUl/99Hzb/FZ2F/xOziwHg6BoAInWq/6f8q/9Jjc7+gfojAEhP7AHc5RT/Kcqt/2NM7v/GFuD/bMbD/ySNYAHsnjv/amRXAG7iAgDj6t4Aml13/0pwpP9DWwL/FZEh/2bWif+v5mf+o/amAF33dP6n4Bz/3AI5AavOVAB75BH/G3h3AHcLkwG0L+H/aMi5/qUCcgBNTtQALZqx/xjEef5SnbYAWhC+AQyTxQBf75j/C+tHAFaSd/+shtYAPIPEAKHhgQAfgnj+X8gzAGnn0v86CZT/K6jd/3ztjgDG0zL+LvVnAKT4VACYRtD/tHWxAEZPuQDzSiAAlZzPAMXEoQH1Ne8AD132/ovwMf/EWCT/oiZ7AIDInQGuTGf/raki/tgBq/9yMxEAiOTCAG6WOP5q9p8AE7hP/5ZN8P+bUKIAADWp/x2XVgBEXhAAXAdu/mJ1lf/5Teb//QqMANZ8XP4jdusAWTA5ARY1pgC4kD3/s//CANb4Pf47bvYAeRVR/qYD5ABqQBr/ReiG//LcNf4u3FUAcZX3/2GzZ/++fwsAh9G2AF80gQGqkM7/esjM/6hkkgA8kJX+RjwoAHo0sf/202X/ru0IAAczeAATH60Afu+c/4+9ywDEgFj/6YXi/x59rf/JbDIAe2Q7//6jAwHdlLX/1og5/t60if/PWDb/HCH7/0PWNAHS0GQAUapeAJEoNQDgb+f+Ixz0/+LHw/7uEeYA2dmk/qmd3QDaLqIBx8+j/2xzogEOYLv/djxMALifmADR50f+KqS6/7qZM/7dq7b/oo6tAOsvwQAHixABX6RA/xDdpgDbxRAAhB0s/2RFdf8861j+KFGtAEe+Pf+7WJ0A5wsXAO11pADhqN//mnJ0/6OY8gEYIKoAfWJx/qgTTAARndz+mzQFABNvof9HWvz/rW7wAArGef/9//D/QnvSAN3C1/55oxH/4QdjAL4xtgBzCYUB6BqK/9VEhAAsd3r/s2IzAJVaagBHMub/Cpl2/7FGGQClV80AN4rqAO4eYQBxm88AYpl/ACJr2/51cqz/TLT//vI5s//dIqz+OKIx/1MD//9x3b3/vBnk/hBYWf9HHMb+FhGV//N5/v9rymP/Cc4OAdwvmQBriScBYTHC/5Uzxf66Ogv/ayvoAcgGDv+1hUH+3eSr/3s+5wHj6rP/Ir3U/vS7+QC+DVABglkBAN+FrQAJ3sb/Qn9KAKfYXf+bqMYBQpEAAERmLgGsWpoA2IBL/6AoMwCeERsBfPAxAOzKsP+XfMD/JsG+AF+2PQCjk3z//6Uz/xwoEf7XYE4AVpHa/h8kyv9WCQUAbynI/+1sYQA5PiwAdbgPAS3xdACYAdz/naW8APoPgwE8LH3/Qdz7/0syuAA1WoD/51DC/4iBfwEVErv/LTqh/0eTIgCu+Qv+I40dAO9Esf9zbjoA7r6xAVf1pv++Mff/klO4/60OJ/+S12gAjt94AJXIm//Uz5EBELXZAK0gV///I7UAd9+hAcjfXv9GBrr/wENV/zKpmACQGnv/OPOz/hREiAAnjLz+/dAF/8hzhwErrOX/nGi7AJf7pwA0hxcAl5lIAJPFa/6UngX/7o/OAH6Zif9YmMX+B0SnAPyfpf/vTjb/GD83/ybeXgDttwz/zszSABMn9v4eSucAh2wdAbNzAAB1dnQBhAb8/5GBoQFpQ40AUiXi/+7i5P/M1oH+ontk/7l56gAtbOcAQgg4/4SIgACs4EL+r528AObf4v7y20UAuA53AVKiOAByexQAomdV/zHvY/6ch9cAb/+n/ifE1gCQJk8B+ah9AJthnP8XNNv/lhaQACyVpf8of7cAxE3p/3aB0v+qh+b/1nfGAOnwIwD9NAf/dWYw/xXMmv+ziLH/FwIDAZWCWf/8EZ8BRjwaAJBrEQC0vjz/OLY7/25HNv/GEoH/leBX/98VmP+KFrb/+pzNAOwt0P9PlPIBZUbRAGdOrgBlkKz/mIjtAb/CiABxUH0BmASNAJuWNf/EdPUA73JJ/hNSEf98fer/KDS/ACrSnv+bhKUAsgUqAUBcKP8kVU3/suR2AIlCYP5z4kIAbvBF/pdvUACnruz/42xr/7zyQf+3Uf8AOc61/y8itf/V8J4BR0tfAJwoGP9m0lEAq8fk/5oiKQDjr0sAFe/DAIrlXwFMwDEAdXtXAePhggB9Pj//AsarAP4kDf6Rus4AlP/0/yMApgAeltsBXOTUAFzGPP4+hcj/ySk7AH3ubf+0o+4BjHpSAAkWWP/FnS//mV45AFgetgBUoVUAspJ8AKamB/8V0N8AnLbyAJt5uQBTnK7+mhB2/7pT6AHfOnn/HRdYACN9f/+qBZX+pAyC/5vEHQChYIgAByMdAaIl+wADLvL/ANm8ADmu4gHO6QIAObuI/nu9Cf/JdX//uiTMAOcZ2ABQTmkAE4aB/5TLRACNUX3++KXI/9aQhwCXN6b/JutbABUumgDf/pb/I5m0/32wHQErYh7/2Hrm/+mgDAA5uQz+8HEH/wUJEP4aW2wAbcbLAAiTKACBhuT/fLoo/3JihP6mhBcAY0UsAAny7v+4NTsAhIFm/zQg8/6T38j/e1Oz/oeQyf+NJTgBlzzj/1pJnAHLrLsAUJcv/16J5/8kvzv/4dG1/0rX1f4GdrP/mTbBATIA5wBonUgBjOOa/7biEP5g4Vz/cxSq/gb6TgD4S63/NVkG/wC0dgBIrQEAQAjOAa6F3wC5PoX/1gtiAMUf0ACrp/T/Fue1AZbauQD3qWEBpYv3/y94lQFn+DMAPEUc/hmzxAB8B9r+OmtRALjpnP/8SiQAdrxDAI1fNf/eXqX+Lj01AM47c/8v7Pr/SgUgAYGa7v9qIOIAebs9/wOm8f5Dqqz/Hdiy/xfJ/AD9bvMAyH05AG3AYP80c+4AJnnz/8k4IQDCdoIAS2AZ/6oe5v4nP/0AJC36//sB7wCg1FwBLdHtAPMhV/7tVMn/1BKd/tRjf//ZYhD+i6zvAKjJgv+Pwan/7pfBAddoKQDvPaX+AgPyABbLsf6xzBYAlYHV/h8LKf8An3n+oBly/6JQyACdlwsAmoZOAdg2/AAwZ4UAadzFAP2oTf41sxcAGHnwAf8uYP9rPIf+Ys35/z/5d/94O9P/crQ3/ltV7QCV1E0BOEkxAFbGlgBd0aAARc22//RaKwAUJLAAenTdADOnJwHnAT//DcWGAAPRIv+HO8oAp2ROAC/fTAC5PD4AsqZ7AYQMof89risAw0WQAH8vvwEiLE4AOeo0Af8WKP/2XpIAU+SAADxO4P8AYNL/ma/sAJ8VSQC0c8T+g+FqAP+nhgCfCHD/eETC/7DExv92MKj/XakBAHDIZgFKGP4AE40E/o4+PwCDs7v/TZyb/3dWpACq0JL/0IWa/5SbOv+ieOj+/NWbAPENKgBeMoMAs6pwAIxTl/83d1QBjCPv/5ktQwHsrycANpdn/54qQf/E74f+VjXLAJVhL/7YIxH/RgNGAWckWv8oGq0AuDANAKPb2f9RBgH/3aps/unQXQBkyfn+ViQj/9GaHgHjyfv/Ar2n/mQ5AwANgCkAxWRLAJbM6/+RrjsAePiV/1U34QBy0jX+x8x3AA73SgE/+4EAQ2iXAYeCUABPWTf/dead/xlgjwDVkQUARfF4AZXzX/9yKhQAg0gCAJo1FP9JPm0AxGaYACkMzP96JgsB+gqRAM99lAD29N7/KSBVAXDVfgCi+VYBR8Z//1EJFQFiJwT/zEctAUtviQDqO+cAIDBf/8wfcgEdxLX/M/Gn/l1tjgBokC0A6wy1/zRwpABM/sr/rg6iAD3rk/8rQLn+6X3ZAPNYp/5KMQgAnMxCAHzWewAm3XYBknDsAHJisQCXWccAV8VwALmVoQAsYKUA+LMU/7zb2P4oPg0A846NAOXjzv+syiP/dbDh/1JuJgEq9Q7/FFNhADGrCgDyd3gAGeg9ANTwk/8Eczj/kRHv/soR+//5EvX/Y3XvALgEs//27TP/Je+J/6Zwpv9RvCH/ufqO/za7rQDQcMkA9ivkAWi4WP/UNMT/M3Vs//51mwAuWw//Vw6Q/1fjzABTGlMBn0zjAJ8b1QEYl2wAdZCz/onRUgAmnwoAc4XJAN+2nAFuxF3/OTzpAAWnaf+axaQAYCK6/5OFJQHcY74AAadU/xSRqwDCxfv+X06F//z48//hXYP/u4bE/9iZqgAUdp7+jAF2AFaeDwEt0yn/kwFk/nF0TP/Tf2wBZw8wAMEQZgFFM1//a4CdAImr6QBafJABaqG2AK9M7AHIjaz/ozpoAOm0NP/w/Q7/onH+/ybviv40LqYA8WUh/oO6nABv0D7/fF6g/x+s/gBwrjj/vGMb/0OK+wB9OoABnJiu/7IM9//8VJ4AUsUO/qzIU/8lJy4Bas+nABi9IgCDspAAztUEAKHi0gBIM2n/YS27/0643/+wHfsAT6BW/3QlsgBSTdUBUlSN/+Jl1AGvWMf/9V73Aax2bf+mub4Ag7V4AFf+Xf+G8En/IPWP/4uiZ/+zYhL+2cxwAJPfeP81CvMApoyWAH1QyP8Obdv/W9oB//z8L/5tnHT/czF/AcxX0/+Uytn/GlX5/w71hgFMWan/8i3mADtirP9ySYT+Tpsx/55+VAAxryv/ELZU/51nIwBowW3/Q92aAMmsAf4IolgApQEd/32b5f8emtwBZ+9cANwBbf/KxgEAXgKOASQ2LADr4p7/qvvW/7lNCQBhSvIA26OV//Ajdv/fclj+wMcDAGolGP/JoXb/YVljAeA6Z/9lx5P+3jxjAOoZOwE0hxsAZgNb/qjY6wDl6IgAaDyBAC6o7gAnv0MAS6MvAI9hYv842KgBqOn8/yNvFv9cVCsAGshXAVv9mADKOEYAjghNAFAKrwH8x0wAFm5S/4EBwgALgD0BVw6R//3evgEPSK4AVaNW/jpjLP8tGLz+Gs0PABPl0v74Q8MAY0e4AJrHJf+X83n/JjNL/8lVgv4sQfoAOZPz/pIrO/9ZHDUAIVQY/7MzEv69RlMAC5yzAWKGdwCeb28Ad5pJ/8g/jP4tDQ3/msAC/lFIKgAuoLn+LHAGAJLXlQEasGgARBxXAewymf+zgPr+zsG//6Zcif41KO8A0gHM/qitIwCN8y0BJDJt/w/ywv/jn3r/sK/K/kY5SAAo3zgA0KI6/7diXQAPbwwAHghM/4R/9v8t8mcARbUP/wrRHgADs3kA8ejaAXvHWP8C0soBvIJR/15l0AFnJC0ATMEYAV8a8f+lorsAJHKMAMpCBf8lOJMAmAvzAX9V6P/6h9QBubFxAFrcS/9F+JIAMm8yAFwWUAD0JHP+o2RS/xnBBgF/PSQA/UMe/kHsqv+hEdf+P6+MADd/BABPcOkAbaAoAI9TB/9BGu7/2amM/05evf8Ak77/k0e6/mpNf//pnekBh1ft/9AN7AGbbST/tGTaALSjEgC+bgkBET97/7OItP+le3v/kLxR/kfwbP8ZcAv/49oz/6cy6v9yT2z/HxNz/7fwYwDjV4//SNn4/2apXwGBlZUA7oUMAePMIwDQcxoBZgjqAHBYjwGQ+Q4A8J6s/mRwdwDCjZn+KDhT/3mwLgAqNUz/nr+aAFvRXACtDRABBUji/8z+lQBQuM8AZAl6/nZlq//8ywD+oM82ADhI+QE4jA3/CkBr/ltlNP/htfgBi/+EAOaREQDpOBcAdwHx/9Wpl/9jYwn+uQ+//61nbQGuDfv/slgH/hs7RP8KIQL/+GE7ABoekgGwkwoAX3nPAbxYGAC5Xv7+czfJABgyRgB4NQYAjkKSAOTi+f9owN4BrUTbAKK4JP+PZon/nQsXAH0tYgDrXeH+OHCg/0Z08wGZ+Tf/gScRAfFQ9ABXRRUBXuRJ/05CQf/C4+cAPZJX/62bF/9wdNv+2CYL/4O6hQBe1LsAZC9bAMz+r//eEtf+rURs/+PkT/8m3dUAo+OW/h++EgCgswsBClpe/9yuWACj0+X/x4g0AIJf3f+MvOf+i3GA/3Wr7P4x3BT/OxSr/+RtvAAU4SD+wxCuAOP+iAGHJ2kAlk3O/9Lu4gA31IT+7zl8AKrCXf/5EPf/GJc+/wqXCgBPi7L/ePLKABrb1QA+fSP/kAJs/+YhU/9RLdgB4D4RANbZfQBimZn/s7Bq/oNdiv9tPiT/snkg/3j8RgDc+CUAzFhnAYDc+//s4wcBajHG/zw4awBjcu4A3MxeAUm7AQBZmiIATtml/w7D+f8J5v3/zYf1ABr8B/9UzRsBhgJwACWeIADnW+3/v6rM/5gH3gBtwDEAwaaS/+gTtf9pjjT/ZxAbAf3IpQDD2QT/NL2Q/3uboP5Xgjb/Tng9/w44KQAZKX3/V6j1ANalRgDUqQb/29PC/khdpP/FIWf/K46NAIPhrAD0aRwAREThAIhUDf+COSj+i004AFSWNQA2X50AkA2x/l9zugB1F3b/9Kbx/wu6hwCyasv/YdpdACv9LQCkmAQAi3bvAGABGP7rmdP/qG4U/zLvsAByKegAwfo1AP6gb/6Iein/YWxDANeYF/+M0dQAKr2jAMoqMv9qar3/vkTZ/+k6dQDl3PMBxQMEACV4Nv4EnIb/JD2r/qWIZP/U6A4AWq4KANjGQf8MA0AAdHFz//hnCADnfRL/oBzFAB64IwHfSfn/exQu/oc4Jf+tDeUBd6Ei//U9SQDNfXAAiWiGANn2Hv/tjo8AQZ9m/2ykvgDbda3/IiV4/shFUAAffNr+Shug/7qax/9Hx/wAaFGfARHIJwDTPcABGu5bAJTZDAA7W9X/C1G3/4Hmev9yy5EBd7RC/0iKtADglWoAd1Jo/9CMKwBiCbb/zWWG/xJlJgBfxab/y/GTAD7Qkf+F9vsAAqkOAA33uACOB/4AJMgX/1jN3wBbgTT/FboeAI/k0gH36vj/5kUf/rC6h//uzTQBi08rABGw2f4g80MA8m/pACwjCf/jclEBBEcM/yZpvwAHdTL/UU8QAD9EQf+dJG7/TfED/+It+wGOGc4AeHvRARz+7v8FgH7/W97X/6IPvwBW8EkAh7lR/izxowDU29L/cKKbAM9ldgCoSDj/xAU0AEis8v9+Fp3/kmA7/6J5mP6MEF8Aw/7I/lKWogB3K5H+zKxO/6bgnwBoE+3/9X7Q/+I71QB12cUAmEjtANwfF/4OWuf/vNRAATxl9v9VGFYAAbFtAJJTIAFLtsAAd/HgALntG/+4ZVIB6yVN//2GEwDo9noAPGqzAMMLDABtQusBfXE7AD0opACvaPAAAi+7/zIMjQDCi7X/h/poAGFc3v/Zlcn/y/F2/0+XQwB6jtr/lfXvAIoqyP5QJWH/fHCn/ySKV/+CHZP/8VdO/8xhEwGx0Rb/9+N//mN3U//UGcYBELOzAJFNrP5ZmQ7/2r2nAGvpO/8jIfP+LHBw/6F/TwHMrwoAKBWK/mh05ADHX4n/hb6o/5Kl6gG3YycAt9w2/v/ehQCi23n+P+8GAOFmNv/7EvYABCKBAYckgwDOMjsBD2G3AKvYh/9lmCv/lvtbACaRXwAizCb+soxT/xmB8/9MkCUAaiQa/naQrP9EuuX/a6HV/y6jRP+Vqv0AuxEPANqgpf+rI/YBYA0TAKXLdQDWa8D/9HuxAWQDaACy8mH/+0yC/9NNKgH6T0b/P/RQAWll9gA9iDoB7lvVAA47Yv+nVE0AEYQu/jmvxf+5PrgATEDPAKyv0P6vSiUAihvT/pR9wgAKWVEAqMtl/yvV0QHr9TYAHiPi/wl+RgDifV7+nHUU/zn4cAHmMED/pFymAeDW5v8keI8ANwgr//sB9QFqYqUASmtq/jUENv9aspYBA3h7//QFWQFy+j3//plSAU0PEQA57loBX9/mAOw0L/5nlKT/ec8kARIQuf9LFEoAuwtlAC4wgf8W79L/TeyB/29NzP89SGH/x9n7/yrXzACFkcn/OeaSAetkxgCSSSP+bMYU/7ZP0v9SZ4gA9mywACIRPP8TSnL+qKpO/53vFP+VKagAOnkcAE+zhv/neYf/rtFi//N6vgCrps0A1HQwAB1sQv+i3rYBDncVANUn+f/+3+T/t6XGAIW+MAB80G3/d69V/wnReQEwq73/w0eGAYjbM/+2W43+MZ9IACN29f9wuuP/O4kfAIksowByZzz+CNWWAKIKcf/CaEgA3IN0/7JPXADL+tX+XcG9/4L/Iv7UvJcAiBEU/xRlU//UzqYA5e5J/5dKA/+oV9cAm7yF/6aBSQDwT4X/stNR/8tIo/7BqKUADqTH/h7/zABBSFsBpkpm/8gqAP/CceP/QhfQAOXYZP8Y7xoACuk+/3sKsgEaJK7/d9vHAS2jvgAQqCoApjnG/xwaGgB+pecA+2xk/z3lef86dooATM8RAA0icP5ZEKgAJdBp/yPJ1/8oamX+Bu9yAChn4v72f27/P6c6AITwjgAFnlj/gUme/15ZkgDmNpIACC2tAE+pAQBzuvcAVECDAEPg/f/PvUAAmhxRAS24Nv9X1OD/AGBJ/4Eh6wE0QlD/+66b/wSzJQDqpF3+Xa/9AMZFV//gai4AYx3SAD68cv8s6ggAqa/3/xdtif/lticAwKVe/vVl2QC/WGAAxF5j/2ruC/41fvMAXgFl/y6TAgDJfHz/jQzaAA2mnQEw++3/m/p8/2qUkv+2DcoAHD2nANmYCP7cgi3/yOb/ATdBV/9dv2H+cvsOACBpXAEaz40AGM8N/hUyMP+6lHT/0yvhACUiov6k0ir/RBdg/7bWCP/1dYn/QsMyAEsMU/5QjKQACaUkAeRu4wDxEVoBGTTUAAbfDP+L8zkADHFLAfa3v//Vv0X/5g+OAAHDxP+Kqy//QD9qARCp1v/PrjgBWEmF/7aFjACxDhn/k7g1/wrjof942PT/SU3pAJ3uiwE7QekARvvYASm4mf8gy3AAkpP9AFdlbQEsUoX/9JY1/16Y6P87XSf/WJPc/05RDQEgL/z/oBNy/11rJ/92ENMBuXfR/+Pbf/5Yaez/om4X/ySmbv9b7N3/Qup0AG8T9P4K6RoAILcG/gK/8gDanDX+KTxG/6jsbwB5uX7/7o7P/zd+NADcgdD+UMyk/0MXkP7aKGz/f8qkAMshA/8CngAAJWC8/8AxSgBtBAAAb6cK/lvah//LQq3/lsLiAMn9Bv+uZnkAzb9uADXCBABRKC3+I2aP/wxsxv8QG+j//Ee6AbBucgCOA3UBcU2OABOcxQFcL/wANegWATYS6wAuI73/7NSBAAJg0P7I7sf/O6+k/5Ir5wDC2TT/A98MAIo2sv5V688A6M8iADE0Mv+mcVn/Ci3Y/z6tHABvpfYAdnNb/4BUPACnkMsAVw3zABYe5AGxcZL/garm/vyZgf+R4SsARucF/3ppfv5W9pT/biWa/tEDWwBEkT4A5BCl/zfd+f6y0lsAU5Li/kWSugBd0mj+EBmtAOe6JgC9eoz/+w1w/2luXQD7SKoAwBff/xgDygHhXeQAmZPH/m2qFgD4Zfb/snwM/7L+Zv43BEEAfda0ALdgkwAtdRf+hL/5AI+wy/6Itzb/kuqxAJJlVv8se48BIdGYAMBaKf5TD33/1axSANepkAAQDSIAINFk/1QS+QHFEez/2brmADGgsP9vdmH/7WjrAE87XP5F+Qv/I6xKARN2RADefKX/tEIj/1au9gArSm//fpBW/+TqWwDy1Rj+RSzr/9y0IwAI+Af/Zi9c//DNZv9x5qsBH7nJ/8L2Rv96EbsAhkbH/5UDlv91P2cAQWh7/9Q2EwEGjVgAU4bz/4g1ZwCpG7QAsTEYAG82pwDDPdf/HwFsATwqRgC5A6L/wpUo//Z/Jv6+dyb/PXcIAWCh2/8qy90BsfKk//WfCgB0xAAABV3N/oB/swB97fb/laLZ/1clFP6M7sAACQnBAGEB4gAdJgoAAIg//+VI0v4mhlz/TtrQAWgkVP8MBcH/8q89/7+pLgGzk5P/cb6L/n2sHwADS/z+1yQPAMEbGAH/RZX/boF2AMtd+QCKiUD+JkYGAJl03gChSnsAwWNP/3Y7Xv89DCsBkrGdAC6TvwAQ/yYACzMfATw6Yv9vwk0Bmlv0AIwokAGtCvsAy9Ey/myCTgDktFoArgf6AB+uPAApqx4AdGNS/3bBi/+7rcb+2m84ALl72AD5njQANLRd/8kJW/84Lab+hJvL/zrobgA001n//QCiAQlXtwCRiCwBXnr1AFW8qwGTXMYAAAhoAB5frgDd5jQB9/fr/4muNf8jFcz/R+PWAehSwgALMOP/qkm4/8b7/P4scCIAg2WD/0iouwCEh33/imhh/+64qP/zaFT/h9ji/4uQ7QC8iZYBUDiM/1app//CThn/3BG0/xENwQB1idT/jeCXADH0rwDBY6//E2OaAf9BPv+c0jf/8vQD//oOlQCeWNn/nc+G/vvoHAAunPv/qzi4/+8z6gCOioP/Gf7zAQrJwgA/YUsA0u+iAMDIHwF11vMAGEfe/jYo6P9Mt2/+kA5X/9ZPiP/YxNQAhBuM/oMF/QB8bBP/HNdLAEzeN/7ptj8ARKu//jRv3v8KaU3/UKrrAI8YWP8t53kAlIHgAT32VAD9Ltv/70whADGUEv7mJUUAQ4YW/o6bXgAfndP+1Soe/wTk9/78sA3/JwAf/vH0//+qLQr+/d75AN5yhAD/Lwb/tKOzAVRel/9Z0VL+5TSp/9XsAAHWOOT/h3eX/3DJwQBToDX+BpdCABKiEQDpYVsAgwVOAbV4Nf91Xz//7XW5AL9+iP+Qd+kAtzlhAS/Ju/+npXcBLWR+ABViBv6Rll//eDaYANFiaACPbx7+uJT5AOvYLgD4ypT/OV8WAPLhowDp9+j/R6sT/2f0Mf9UZ13/RHn0AVLgDQApTyv/+c6n/9c0Ff7AIBb/9288AGVKJv8WW1T+HRwN/8bn1/70msgA34ntANOEDgBfQM7/ET73/+mDeQFdF00Azcw0/lG9iAC024oBjxJeAMwrjP68r9sAb2KP/5c/ov/TMkf+E5I1AJItU/6yUu7/EIVU/+LGXf/JYRT/eHYj/3Iy5/+i5Zz/0xoMAHInc//O1IYAxdmg/3SBXv7H19v/S9/5Af10tf/o12j/5IL2/7l1VgAOBQgA7x09Ae1Xhf99kon+zKjfAC6o9QCaaRYA3NSh/2tFGP+J2rX/8VTG/4J60/+NCJn/vrF2AGBZsgD/EDD+emBp/3U26P8ifmn/zEOmAOg0iv/TkwwAGTYHACwP1/4z7C0AvkSBAWqT4QAcXS3+7I0P/xE9oQDcc8AA7JEY/m+oqQDgOj//f6S8AFLqSwHgnoYA0URuAdmm2QBG4aYBu8GP/xAHWP8KzYwAdcCcARE4JgAbfGwBq9c3/1/91ACbh6j/9rKZ/ppESgDoPWD+aYQ7ACFMxwG9sIL/CWgZ/kvGZv/pAXAAbNwU/3LmRgCMwoX/OZ6k/pIGUP+pxGEBVbeCAEae3gE77er/YBka/+ivYf8Lefj+WCPCANu0/P5KCOMAw+NJAbhuof8x6aQBgDUvAFIOef/BvjoAMK51/4QXIAAoCoYBFjMZ//ALsP9uOZIAdY/vAZ1ldv82VEwAzbgS/y8ESP9OcFX/wTJCAV0QNP8IaYYADG1I/zqc+wCQI8wALKB1/jJrwgABRKX/b26iAJ5TKP5M1uoAOtjN/6tgk/8o43IBsOPxAEb5twGIVIv/PHr3/o8Jdf+xron+SfePAOy5fv8+Gff/LUA4/6H0BgAiOTgBacpTAICT0AAGZwr/SopB/2FQZP/WriH/MoZK/26Xgv5vVKwAVMdL/vg7cP8I2LIBCbdfAO4bCP6qzdwAw+WHAGJM7f/iWxoBUtsn/+G+xwHZyHn/UbMI/4xBzgCyz1f++vwu/2hZbgH9vZ7/kNae/6D1Nv81t1wBFcjC/5IhcQHRAf8A62or/6c06ACd5d0AMx4ZAPrdGwFBk1f/T3vEAEHE3/9MLBEBVfFEAMq3+f9B1NT/CSGaAUc7UACvwjv/jUgJAGSg9ADm0DgAOxlL/lDCwgASA8j+oJ9zAISP9wFvXTn/Ou0LAYbeh/96o2wBeyu+//u9zv5Qtkj/0PbgARE8CQChzyYAjW1bANgP0/+ITm4AYqNo/xVQef+tsrcBf48EAGg8Uv7WEA3/YO4hAZ6U5v9/gT7/M//S/z6N7P6dN+D/cif0AMC8+v/kTDUAYlRR/63LPf6TMjf/zOu/ADTF9ABYK9P+G793ALznmgBCUaEAXMGgAfrjeAB7N+IAuBFIAIWoCv4Wh5z/KRln/zDKOgC6lVH/vIbvAOu1vf7Zi7z/SjBSAC7a5QC9/fsAMuUM/9ONvwGA9Bn/qed6/lYvvf+Etxf/JbKW/zOJ/QDITh8AFmkyAII8AACEo1v+F+e7AMBP7wCdZqT/wFIUARi1Z//wCeoAAXuk/4XpAP/K8vIAPLr1APEQx//gdJ7+v31b/+BWzwB5Jef/4wnG/w+Z7/956Nn+S3BSAF8MOf4z1mn/lNxhAcdiJACc0Qz+CtQ0ANm0N/7Uquj/2BRU/536hwCdY3/+Ac4pAJUkRgE2xMn/V3QA/uurlgAbo+oAyoe0ANBfAP57nF0Atz5LAInrtgDM4f//1ovS/wJzCP8dDG8ANJwBAP0V+/8lpR/+DILTAGoSNf4qY5oADtk9/tgLXP/IxXD+kybHACT8eP5rqU0AAXuf/89LZgCjr8QALAHwAHi6sP4NYkz/7Xzx/+iSvP/IYOAAzB8pANDIDQAV4WD/r5zEAPfQfgA+uPT+AqtRAFVzngA2QC3/E4pyAIdHzQDjL5MB2udCAP3RHAD0D63/Bg92/hCW0P+5FjL/VnDP/0tx1wE/kiv/BOET/uMXPv8O/9b+LQjN/1fFl/7SUtf/9fj3/4D4RgDh91cAWnhGANX1XAANheIAL7UFAVyjaf8GHoX+6LI9/+aVGP8SMZ4A5GQ9/nTz+/9NS1wBUduT/0yj/v6N1fYA6CWY/mEsZADJJTIB1PQ5AK6rt//5SnAAppweAN7dYf/zXUn++2Vk/9jZXf/+irv/jr40/zvLsf/IXjQAc3Ke/6WYaAF+Y+L/dp30AWvIEADBWuUAeQZYAJwgXf598dP/Du2d/6WaFf+44Bb/+hiY/3FNHwD3qxf/7bHM/zSJkf/CtnIA4OqVAApvZwHJgQQA7o5OADQGKP9u1aX+PM/9AD7XRQBgYQD/MS3KAHh5Fv/rizABxi0i/7YyGwGD0lv/LjaAAK97af/GjU7+Q/Tv//U2Z/5OJvL/Alz5/vuuV/+LP5AAGGwb/yJmEgEiFpgAQuV2/jKPYwCQqZUBdh6YALIIeQEInxIAWmXm/4EddwBEJAsB6Lc3ABf/YP+hKcH/P4veAA+z8wD/ZA//UjWHAIk5lQFj8Kr/Fubk/jG0Uv89UisAbvXZAMd9PQAu/TQAjcXbANOfwQA3eWn+txSBAKl3qv/Lsov/hyi2/6wNyv9BspQACM8rAHo1fwFKoTAA49aA/lYL8/9kVgcB9USG/z0rFQGYVF7/vjz6/u926P/WiCUBcUxr/11oZAGQzhf/bpaaAeRnuQDaMTL+h02L/7kBTgAAoZT/YR3p/8+Ulf+gqAAAW4Cr/wYcE/4Lb/cAJ7uW/4rolQB1PkT/P9i8/+vqIP4dOaD/GQzxAak8vwAgg43/7Z97/17FXv50/gP/XLNh/nlhXP+qcA4AFZX4APjjAwBQYG0AS8BKAQxa4v+hakQB0HJ//3Iq//5KGkr/97OW/nmMPACTRsj/1iih/6G8yf+NQYf/8nP8AD4vygC0lf/+gjftAKURuv8KqcIAnG3a/3CMe/9ogN/+sY5s/3kl2/+ATRL/b2wXAVvASwCu9Rb/BOw+/ytAmQHjrf4A7XqEAX9Zuv+OUoD+/FSuAFqzsQHz1lf/Zzyi/9CCDv8LgosAzoHb/17Znf/v5ub/dHOf/qRrXwAz2gIB2H3G/4zKgP4LX0T/Nwld/q6ZBv/MrGAARaBuANUmMf4bUNUAdn1yAEZGQ/8Pjkn/g3q5//MUMv6C7SgA0p+MAcWXQf9UmUIAw35aABDu7AF2u2b/AxiF/7tF5gA4xVwB1UVe/1CK5QHOB+YA3m/mAVvpd/8JWQcBAmIBAJRKhf8z9rT/5LFwATq9bP/Cy+3+FdHDAJMKIwFWneIAH6OL/jgHS/8+WnQAtTypAIqi1P5Rpx8AzVpw/yFw4wBTl3UBseBJ/66Q2f/mzE//Fk3o/3JO6gDgOX7+CTGNAPKTpQFotoz/p4QMAXtEfwDhVycB+2wIAMbBjwF5h8//rBZGADJEdP9lryj/+GnpAKbLBwBuxdoA1/4a/qji/QAfj2AAC2cpALeBy/5k90r/1X6EANKTLADH6hsBlC+1AJtbngE2aa//Ak6R/maaXwCAz3/+NHzs/4JURwDd89MAmKrPAN5qxwC3VF7+XMg4/4q2cwGOYJIAhYjkAGESlgA3+0IAjGYEAMpnlwAeE/j/M7jPAMrGWQA3xeH+qV/5/0JBRP+86n4Apt9kAXDv9ACQF8IAOie2APQsGP6vRLP/mHaaAbCiggDZcsz+rX5O/yHeHv8kAlv/Ao/zAAnr1wADq5cBGNf1/6gvpP7xks8ARYG0AETzcQCQNUj++y0OABduqABERE//bkZf/q5bkP8hzl//iSkH/xO7mf4j/3D/CZG5/jKdJQALcDEBZgi+/+rzqQE8VRcASie9AHQx7wCt1dIALqFs/5+WJQDEeLn/ImIG/5nDPv9h5kf/Zj1MABrU7P+kYRAAxjuSAKMXxAA4GD0AtWLBAPuT5f9ivRj/LjbO/+pS9gC3ZyYBbT7MAArw4ACSFnX/jpp4AEXUIwDQY3YBef8D/0gGwgB1EcX/fQ8XAJpPmQDWXsX/uTeT/z7+Tv5/UpkAbmY//2xSof9pu9QBUIonADz/Xf9IDLoA0vsfAb6nkP/kLBP+gEPoANb5a/6IkVb/hC6wAL274//QFowA2dN0ADJRuv6L+h8AHkDGAYebZACgzhf+u6LT/xC8PwD+0DEAVVS/APHA8v+ZfpEB6qKi/+Zh2AFAh34AvpTfATQAK/8cJ70BQIjuAK/EuQBi4tX/f5/0AeKvPACg6Y4BtPPP/0WYWQEfZRUAkBmk/ou/0QBbGXkAIJMFACe6e/8/c+b/XafG/4/V3P+znBP/GUJ6ANag2f8CLT7/ak+S/jOJY/9XZOf/r5Ho/2W4Af+uCX0AUiWhASRyjf8w3o7/9bqaAAWu3f4/cpv/hzegAVAfhwB++rMB7NotABQckQEQk0kA+b2EARG9wP/fjsb/SBQP//o17f4PCxIAG9Nx/tVrOP+uk5L/YH4wABfBbQElol4Ax535/hiAu//NMbL+XaQq/yt36wFYt+3/2tIB/2v+KgDmCmP/ogDiANvtWwCBsssA0DJf/s7QX//3v1n+bupP/6U98wAUenD/9va5/mcEewDpY+YB21v8/8feFv+z9en/0/HqAG/6wP9VVIgAZToy/4OtnP53LTP/dukQ/vJa1gBen9sBAwPq/2JMXP5QNuYABeTn/jUY3/9xOHYBFIQB/6vS7AA48Z7/unMT/wjlrgAwLAABcnKm/wZJ4v/NWfQAieNLAfitOABKePb+dwML/1F4xv+IemL/kvHdAW3CTv/f8UYB1sip/2G+L/8vZ67/Y1xI/nbptP/BI+n+GuUg/978xgDMK0f/x1SsAIZmvgBv7mH+5ijmAOPNQP7IDOEAphneAHFFM/+PnxgAp7hKAB3gdP6e0OkAwXR+/9QLhf8WOowBzCQz/+geKwDrRrX/QDiS/qkSVP/iAQ3/yDKw/zTV9f6o0WEAv0c3ACJOnADokDoBuUq9ALqOlf5ARX//ocuT/7CXvwCI58v+o7aJAKF++/7pIEIARM9CAB4cJQBdcmAB/lz3/yyrRQDKdwv/vHYyAf9TiP9HUhoARuMCACDreQG1KZoAR4bl/sr/JAApmAUAmj9J/yK2fAB53Zb/GszVASmsVwBanZL/bYIUAEdryP/zZr0AAcOR/i5YdQAIzuMAv279/22AFP6GVTP/ibFwAdgiFv+DEND/eZWqAHITFwGmUB//cfB6AOiz+gBEbrT+0qp3AN9spP/PT+n/G+Xi/tFiUf9PRAcAg7lkAKodov8Romv/ORULAWTItf9/QaYBpYbMAGinqAABpE8Akoc7AUYygP9mdw3+4waHAKKOs/+gZN4AG+DbAZ5dw//qjYkAEBh9/+7OL/9hEWL/dG4M/2BzTQBb4+j/+P5P/1zlBv5YxosAzkuBAPpNzv+N9HsBikXcACCXBgGDpxb/7USn/se9lgCjq4r/M7wG/18dif6U4rMAtWvQ/4YfUv+XZS3/gcrhAOBIkwAwipf/w0DO/u3angBqHYn+/b3p/2cPEf/CYf8Asi2p/sbhmwAnMHX/h2pzAGEmtQCWL0H/U4Ll/vYmgQBc75r+W2N/AKFvIf/u2fL/g7nD/9W/nv8pltoAhKmDAFlU/AGrRoD/o/jL/gEytP98TFUB+29QAGNC7/+a7bb/3X6F/krMY/9Bk3f/Yzin/0/4lf90m+T/7SsO/kWJC/8W+vEBW3qP/8358wDUGjz/MLawATAXv//LeZj+LUrV/z5aEv71o+b/uWp0/1MjnwAMIQL/UCI+ABBXrv+tZVUAyiRR/qBFzP9A4bsAOs5eAFaQLwDlVvUAP5G+ASUFJwBt+xoAiZPqAKJ5kf+QdM7/xei5/7e+jP9JDP7/ixTy/6pa7/9hQrv/9bWH/t6INAD1BTP+yy9OAJhl2ABJF30A/mAhAevSSf8r0VgBB4FtAHpo5P6q8ssA8syH/8oc6f9BBn8An5BHAGSMXwBOlg0A+2t2AbY6ff8BJmz/jb3R/wibfQFxo1v/eU++/4bvbP9ML/gAo+TvABFvCgBYlUv/1+vvAKefGP8vl2z/a9G8AOnnY/4cypT/riOK/24YRP8CRbUAa2ZSAGbtBwBcJO3/3aJTATfKBv+H6of/GPreAEFeqP71+NL/p2zJ/v+hbwDNCP4AiA10AGSwhP8r137/sYWC/55PlABD4CUBDM4V/z4ibgHtaK//UIRv/46uSABU5bT+abOMAED4D//pihAA9UN7/tp51P8/X9oB1YWJ/4+2Uv8wHAsA9HKNAdGvTP+dtZb/uuUD/6SdbwHnvYsAd8q+/9pqQP9E6z/+YBqs/7svCwHXEvv/UVRZAEQ6gABecQUBXIHQ/2EPU/4JHLwA7wmkADzNmADAo2L/uBI8ANm2iwBtO3j/BMD7AKnS8P8lrFz+lNP1/7NBNAD9DXMAua7OAXK8lf/tWq0AK8fA/1hscQA0I0wAQhmU/90EB/+X8XL/vtHoAGIyxwCXltX/EkokATUoBwATh0H/GqxFAK7tVQBjXykAAzgQACegsf/Iatr+uURU/1u6Pf5Dj43/DfSm/2NyxgDHbqP/wRK6AHzv9gFuRBYAAusuAdQ8awBpKmkBDuaYAAcFgwCNaJr/1QMGAIPkov+zZBwB53tV/84O3wH9YOYAJpiVAWKJegDWzQP/4piz/waFiQCeRYz/caKa/7TzrP8bvXP/jy7c/9WG4f9+HUUAvCuJAfJGCQBazP//56qTABc4E/44fZ3/MLPa/0+2/f8m1L8BKet8AGCXHACHlL4Azfkn/jRgiP/ULIj/Q9GD//yCF//bgBT/xoF2AGxlCwCyBZIBPgdk/7XsXv4cGqQATBZw/3hmTwDKwOUByLDXAClA9P/OuE4Apy0/AaAjAP87DI7/zAmQ/9te5QF6G3AAvWlt/0DQSv/7fzcBAuLGACxM0QCXmE3/0hcuAcmrRf8s0+cAviXg//XEPv+ptd7/ItMRAHfxxf/lI5gBFUUo/7LioQCUs8EA28L+ASjOM//nXPoBQ5mqABWU8QCqRVL/eRLn/1xyAwC4PuYA4clX/5Jgov+18twArbvdAeI+qv84ftkBdQ3j/7Ms7wCdjZv/kN1TAOvR0AAqEaUB+1GFAHz1yf5h0xj/U9amAJokCf/4L38AWtuM/6HZJv7Ukz//QlSUAc8DAQDmhlkBf056/+CbAf9SiEoAspzQ/7oZMf/eA9IB5Za+/1WiNP8pVI3/SXtU/l0RlgB3ExwBIBbX/xwXzP+O8TT/5DR9AB1MzwDXp/r+r6TmADfPaQFtu/X/oSzcASllgP+nEF4AXdZr/3ZIAP5QPer/ea99AIup+wBhJ5P++sQx/6Wzbv7fRrv/Fo59AZqziv92sCoBCq6ZAJxcZgCoDaH/jxAgAPrFtP/LoywBVyAkAKGZFP97/A8AGeNQADxYjgARFskBms1N/yc/LwAIeo0AgBe2/swnE/8EcB3/FySM/9LqdP41Mj//eato/6DbXgBXUg7+5yoFAKWLf/5WTiYAgjxC/sseLf8uxHoB+TWi/4iPZ/7X0nIA5weg/qmYKv9vLfYAjoOH/4NHzP8k4gsAABzy/+GK1f/3Ltj+9QO3AGz8SgHOGjD/zTb2/9PGJP95IzIANNjK/yaLgf7ySZQAQ+eN/yovzABOdBkBBOG//waT5AA6WLEAeqXl//xTyf/gp2ABsbie//JpswH4xvAAhULLAf4kLwAtGHP/dz7+AMThuv57jawAGlUp/+JvtwDV55cABDsH/+6KlABCkyH/H/aN/9GNdP9ocB8AWKGsAFPX5v4vb5cALSY0AYQtzACKgG3+6XWG//O+rf7x7PAAUn/s/ijfof9utuH/e67vAIfykQEz0ZoAlgNz/tmk/P83nEUBVF7//+hJLQEUE9T/YMU7/mD7IQAmx0kBQKz3/3V0OP/kERIAPopnAfblpP/0dsn+ViCf/20iiQFV07oACsHB/nrCsQB67mb/otqrAGzZoQGeqiIAsC+bAbXkC/8InAAAEEtdAM5i/wE6miMADPO4/kN1Qv/m5XsAySpuAIbksv66bHb/OhOa/1KpPv9yj3MB78Qy/60wwf+TAlT/loaT/l/oSQBt4zT+v4kKACjMHv5MNGH/pOt+AP58vABKthUBeR0j//EeB/5V2tb/B1SW/lEbdf+gn5j+Qhjd/+MKPAGNh2YA0L2WAXWzXACEFoj/eMccABWBT/62CUEA2qOpAPaTxv9rJpABTq/N/9YF+v4vWB3/pC/M/ys3Bv+Dhs/+dGTWAGCMSwFq3JAAwyAcAaxRBf/HszT/JVTLAKpwrgALBFsARfQbAXWDXAAhmK//jJlr//uHK/5XigT/xuqT/nmYVP/NZZsBnQkZAEhqEf5smQD/veW6AMEIsP+uldEA7oIdAOnWfgE94mYAOaMEAcZvM/8tT04Bc9IK/9oJGf+ei8b/01K7/lCFUwCdgeYB84WG/yiIEABNa0//t1VcAbHMygCjR5P/mEW+AKwzvAH60qz/0/JxAVlZGv9AQm/+dJgqAKEnG/82UP4AatFzAWd8YQDd5mL/H+cGALLAeP4P2cv/fJ5PAHCR9wBc+jABo7XB/yUvjv6QvaX/LpLwAAZLgAApncj+V3nVAAFx7AAFLfoAkAxSAB9s5wDh73f/pwe9/7vkhP9uvSIAXizMAaI0xQBOvPH+ORSNAPSSLwHOZDMAfWuU/hvDTQCY/VoBB4+Q/zMlHwAidyb/B8V2AJm80wCXFHT+9UE0/7T9bgEvsdEAoWMR/3beygB9s/wBezZ+/5E5vwA3unkACvOKAM3T5f99nPH+lJy5/+MTvP98KSD/HyLO/hE5UwDMFiX/KmBiAHdmuAEDvhwAblLa/8jMwP/JkXYAdcySAIQgYgHAwnkAaqH4Ae1YfAAX1BoAzata//gw2AGNJeb/fMsA/p6oHv/W+BUAcLsH/0uF7/9K4/P/+pNGANZ4ogCnCbP/Fp4SANpN0QFhbVH/9CGz/zk0Of9BrNL/+UfR/46p7gCevZn/rv5n/mIhDgCNTOb/cYs0/w861ACo18n/+MzXAd9EoP85mrf+L+d5AGqmiQBRiIoApSszAOeLPQA5Xzv+dmIZ/5c/7AFevvr/qblyAQX6Ov9LaWEB19+GAHFjowGAPnAAY2qTAKPDCgAhzbYA1g6u/4Em5/81tt8AYiqf//cNKAC80rEBBhUA//89lP6JLYH/WRp0/n4mcgD7MvL+eYaA/8z5p/6l69cAyrHzAIWNPgDwgr4Bbq//AAAUkgEl0nn/ByeCAI76VP+NyM8ACV9o/wv0rgCG6H4ApwF7/hDBlf/o6e8B1UZw//x0oP7y3tz/zVXjAAe5OgB29z8BdE2x/z71yP4/EiX/azXo/jLd0wCi2wf+Al4rALY+tv6gTsj/h4yqAOu45ACvNYr+UDpN/5jJAgE/xCIABR64AKuwmgB5O84AJmMnAKxQTf4AhpcAuiHx/l793/8scvwAbH45/8koDf8n5Rv/J+8XAZd5M/+ZlvgACuqu/3b2BP7I9SYARaHyARCylgBxOIIAqx9pABpYbP8xKmoA+6lCAEVdlQAUOf4ApBlvAFq8Wv/MBMUAKNUyAdRghP9YirT+5JJ8/7j29wBBdVb//WbS/v55JACJcwP/PBjYAIYSHQA74mEAsI5HAAfRoQC9VDP+m/pIANVU6/8t3uAA7pSP/6oqNf9Op3UAugAo/32xZ/9F4UIA4wdYAUusBgCpLeMBECRG/zICCf+LwRYAj7fn/tpFMgDsOKEB1YMqAIqRLP6I5Sj/MT8j/z2R9f9lwAL+6KdxAJhoJgF5udoAeYvT/nfwIwBBvdn+u7Oi/6C75gA++A7/PE5hAP/3o//hO1v/a0c6//EvIQEydewA27E//vRaswAjwtf/vUMy/xeHgQBovSX/uTnCACM+5//c+GwADOeyAI9QWwGDXWX/kCcCAf/6sgAFEez+iyAuAMy8Jv71czT/v3FJ/r9sRf8WRfUBF8uyAKpjqgBB+G8AJWyZ/0AlRQAAWD7+WZSQ/79E4AHxJzUAKcvt/5F+wv/dKv3/GWOXAGH93wFKczH/Bq9I/zuwywB8t/kB5ORjAIEMz/6owMP/zLAQ/pjqqwBNJVX/IXiH/47C4wEf1joA1bt9/+guPP++dCr+l7IT/zM+7f7M7MEAwug8AKwinf+9ELj+ZwNf/43pJP4pGQv/FcOmAHb1LQBD1ZX/nwwS/7uk4wGgGQUADE7DASvF4QAwjin+xJs8/9/HEgGRiJwA/HWp/pHi7gDvF2sAbbW8/+ZwMf5Jqu3/57fj/1DcFADCa38Bf81lAC40xQHSqyT/WANa/ziXjQBgu///Kk7IAP5GRgH0fagAzESKAXzXRgBmQsj+ETTkAHXcj/7L+HsAOBKu/7qXpP8z6NABoOQr//kdGQFEvj8="); + return asmFunc({ + Int8Array, + Int16Array, + Int32Array, + Uint8Array, + Uint16Array, + Uint32Array, + Float32Array, + Float64Array, + NaN: NaN, + Infinity: Infinity, + Math + }, asmLibraryArg2, wasmMemory2.buffer); + })(asmLibraryArg, wasmMemory, wasmTable); + return { + exports: exports2 + }; + }, + instantiate: ( + /** @suppress{checkTypes} */ + function(binary, info) { + return { + then: function(ok) { + ok({ + instance: new WebAssembly2.Instance(new WebAssembly2.Module(binary)) + }); + } + }; + } + ), + RuntimeError: Error + }; + wasmBinary = []; + if (typeof WebAssembly2 !== "object") { + err("no native wasm support detected"); + } + function setValue(ptr, value, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") + type = "i32"; + switch (type) { + case "i1": + HEAP8[ptr >> 0] = value; + break; + case "i8": + HEAP8[ptr >> 0] = value; + break; + case "i16": + HEAP16[ptr >> 1] = value; + break; + case "i32": + HEAP32[ptr >> 2] = value; + break; + case "i64": + ; + tempI64 = [ + value >>> 0, + (tempDouble = value, +Math_abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math_min(+Math_floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) + ], HEAP32[ptr >> 2] = tempI64[0], HEAP32[ptr + 4 >> 2] = tempI64[1]; + break; + case "float": + HEAPF32[ptr >> 2] = value; + break; + case "double": + HEAPF64[ptr >> 3] = value; + break; + default: + abort("invalid type for setValue: " + type); + } + } + function getValue(ptr, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") + type = "i32"; + switch (type) { + case "i1": + return HEAP8[ptr >> 0]; + case "i8": + return HEAP8[ptr >> 0]; + case "i16": + return HEAP16[ptr >> 1]; + case "i32": + return HEAP32[ptr >> 2]; + case "i64": + return HEAP32[ptr >> 2]; + case "float": + return HEAPF32[ptr >> 2]; + case "double": + return HEAPF64[ptr >> 3]; + default: + abort("invalid type for getValue: " + type); + } + return null; + } + var wasmMemory; + var wasmTable = new WebAssembly2.Table({ + initial: 1, + maximum: 1 + 0, + element: "anyfunc" + }); + var ABORT = false; + var EXITSTATUS = 0; + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text); + } + } + function getCFunc(ident) { + var func = Module2["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func; + } + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + string: function(str) { + var ret2 = 0; + if (str !== null && str !== void 0 && str !== 0) { + var len = (str.length << 2) + 1; + ret2 = stackAlloc(len); + stringToUTF8(str, ret2, len); + } + return ret2; + }, + array: function(arr) { + var ret2 = stackAlloc(arr.length); + writeArrayToMemory(arr, ret2); + return ret2; + } + }; + function convertReturnValue(ret2) { + if (returnType === "string") + return UTF8ToString(ret2); + if (returnType === "boolean") + return Boolean(ret2); + return ret2; + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + if (args) { + for (var i2 = 0; i2 < args.length; i2++) { + var converter = toC[argTypes[i2]]; + if (converter) { + if (stack === 0) + stack = stackSave(); + cArgs[i2] = converter(args[i2]); + } else { + cArgs[i2] = args[i2]; + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) + stackRestore(stack); + return ret; + } + function cwrap(ident, returnType, argTypes, opts) { + argTypes = argTypes || []; + var numericArgs = argTypes.every(function(type) { + return type === "number"; + }); + var numericRet = returnType !== "string"; + if (numericRet && numericArgs && !opts) { + return getCFunc(ident); + } + return function() { + return ccall(ident, returnType, argTypes, arguments, opts); + }; + } + var ALLOC_NORMAL = 0; + var ALLOC_STACK = 1; + var ALLOC_DYNAMIC = 2; + var ALLOC_NONE = 3; + function allocate(slab, types, allocator, ptr) { + var zeroinit, size; + if (typeof slab === "number") { + zeroinit = true; + size = slab; + } else { + zeroinit = false; + size = slab.length; + } + var singleType = typeof types === "string" ? types : null; + var ret; + if (allocator == ALLOC_NONE) { + ret = ptr; + } else { + ret = [_malloc, stackAlloc, dynamicAlloc][allocator](Math.max(size, singleType ? 1 : types.length)); + } + if (zeroinit) { + var stop; + ptr = ret; + assert((ret & 3) == 0); + stop = ret + (size & ~3); + for (; ptr < stop; ptr += 4) { + HEAP32[ptr >> 2] = 0; + } + stop = ret + size; + while (ptr < stop) { + HEAP8[ptr++ >> 0] = 0; + } + return ret; + } + if (singleType === "i8") { + if (slab.subarray || slab.slice) { + HEAPU8.set( + /** @type {!Uint8Array} */ + slab, + ret + ); + } else { + HEAPU8.set(new Uint8Array(slab), ret); + } + return ret; + } + var i2 = 0, type, typeSize, previousType; + while (i2 < size) { + var curr = slab[i2]; + type = singleType || types[i2]; + if (type === 0) { + i2++; + continue; + } + if (type == "i64") + type = "i32"; + setValue(ret + i2, curr, type); + if (previousType !== type) { + typeSize = getNativeTypeSize(type); + previousType = type; + } + i2 += typeSize; + } + return ret; + } + function getMemory(size) { + if (!runtimeInitialized) + return dynamicAlloc(size); + return _malloc(size); + } + var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : void 0; + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (heap[endPtr] && !(endPtr >= endIdx)) + ++endPtr; + if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) { + return UTF8Decoder.decode(heap.subarray(idx, endPtr)); + } else { + var str = ""; + while (idx < endPtr) { + var u0 = heap[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue; + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue; + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2; + } else { + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63; + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); + } + } + } + return str; + } + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; + } + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) + return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i2 = 0; i2 < str.length; ++i2) { + var u = str.charCodeAt(i2); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i2); + u = 65536 + ((u & 1023) << 10) | u1 & 1023; + } + if (u <= 127) { + if (outIdx >= endIdx) + break; + heap[outIdx++] = u; + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) + break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63; + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) + break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } else { + if (outIdx + 3 >= endIdx) + break; + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } + } + heap[outIdx] = 0; + return outIdx - startIdx; + } + function stringToUTF8(str, outPtr, maxBytesToWrite) { + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); + } + function lengthBytesUTF8(str) { + var len = 0; + for (var i2 = 0; i2 < str.length; ++i2) { + var u = str.charCodeAt(i2); + if (u >= 55296 && u <= 57343) + u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i2) & 1023; + if (u <= 127) + ++len; + else if (u <= 2047) + len += 2; + else if (u <= 65535) + len += 3; + else + len += 4; + } + return len; + } + function AsciiToString(ptr) { + var str = ""; + while (1) { + var ch = HEAPU8[ptr++ >> 0]; + if (!ch) + return str; + str += String.fromCharCode(ch); + } + } + function stringToAscii(str, outPtr) { + return writeAsciiToMemory(str, outPtr, false); + } + var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : void 0; + function UTF16ToString(ptr, maxBytesToRead) { + var endPtr = ptr; + var idx = endPtr >> 1; + var maxIdx = idx + maxBytesToRead / 2; + while (!(idx >= maxIdx) && HEAPU16[idx]) + ++idx; + endPtr = idx << 1; + if (endPtr - ptr > 32 && UTF16Decoder) { + return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)); + } else { + var i2 = 0; + var str = ""; + while (1) { + var codeUnit = HEAP16[ptr + i2 * 2 >> 1]; + if (codeUnit == 0 || i2 == maxBytesToRead / 2) + return str; + ++i2; + str += String.fromCharCode(codeUnit); + } + } + } + function stringToUTF16(str, outPtr, maxBytesToWrite) { + if (maxBytesToWrite === void 0) { + maxBytesToWrite = 2147483647; + } + if (maxBytesToWrite < 2) + return 0; + maxBytesToWrite -= 2; + var startPtr = outPtr; + var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; + for (var i2 = 0; i2 < numCharsToWrite; ++i2) { + var codeUnit = str.charCodeAt(i2); + HEAP16[outPtr >> 1] = codeUnit; + outPtr += 2; + } + HEAP16[outPtr >> 1] = 0; + return outPtr - startPtr; + } + function lengthBytesUTF16(str) { + return str.length * 2; + } + function UTF32ToString(ptr, maxBytesToRead) { + var i2 = 0; + var str = ""; + while (!(i2 >= maxBytesToRead / 4)) { + var utf32 = HEAP32[ptr + i2 * 4 >> 2]; + if (utf32 == 0) + break; + ++i2; + if (utf32 >= 65536) { + var ch = utf32 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); + } else { + str += String.fromCharCode(utf32); + } + } + return str; + } + function stringToUTF32(str, outPtr, maxBytesToWrite) { + if (maxBytesToWrite === void 0) { + maxBytesToWrite = 2147483647; + } + if (maxBytesToWrite < 4) + return 0; + var startPtr = outPtr; + var endPtr = startPtr + maxBytesToWrite - 4; + for (var i2 = 0; i2 < str.length; ++i2) { + var codeUnit = str.charCodeAt(i2); + if (codeUnit >= 55296 && codeUnit <= 57343) { + var trailSurrogate = str.charCodeAt(++i2); + codeUnit = 65536 + ((codeUnit & 1023) << 10) | trailSurrogate & 1023; + } + HEAP32[outPtr >> 2] = codeUnit; + outPtr += 4; + if (outPtr + 4 > endPtr) + break; + } + HEAP32[outPtr >> 2] = 0; + return outPtr - startPtr; + } + function lengthBytesUTF32(str) { + var len = 0; + for (var i2 = 0; i2 < str.length; ++i2) { + var codeUnit = str.charCodeAt(i2); + if (codeUnit >= 55296 && codeUnit <= 57343) + ++i2; + len += 4; + } + return len; + } + function allocateUTF8(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = _malloc(size); + if (ret) + stringToUTF8Array(str, HEAP8, ret, size); + return ret; + } + function allocateUTF8OnStack(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = stackAlloc(size); + stringToUTF8Array(str, HEAP8, ret, size); + return ret; + } + function writeStringToMemory(string, buffer2, dontAddNull) { + warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"); + var lastChar, end; + if (dontAddNull) { + end = buffer2 + lengthBytesUTF8(string); + lastChar = HEAP8[end]; + } + stringToUTF8(string, buffer2, Infinity); + if (dontAddNull) + HEAP8[end] = lastChar; + } + function writeArrayToMemory(array, buffer2) { + HEAP8.set(array, buffer2); + } + function writeAsciiToMemory(str, buffer2, dontAddNull) { + for (var i2 = 0; i2 < str.length; ++i2) { + HEAP8[buffer2++ >> 0] = str.charCodeAt(i2); + } + if (!dontAddNull) + HEAP8[buffer2 >> 0] = 0; + } + var PAGE_SIZE = 16384; + var WASM_PAGE_SIZE = 65536; + var ASMJS_PAGE_SIZE = 16777216; + function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple; + } + return x; + } + var HEAP, buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module2["HEAP8"] = HEAP8 = new Int8Array(buf); + Module2["HEAP16"] = HEAP16 = new Int16Array(buf); + Module2["HEAP32"] = HEAP32 = new Int32Array(buf); + Module2["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module2["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module2["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module2["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module2["HEAPF64"] = HEAPF64 = new Float64Array(buf); + } + var STATIC_BASE = 1024, STACK_BASE = 5277136, STACKTOP = STACK_BASE, STACK_MAX = 34256, DYNAMIC_BASE = 5277136, DYNAMICTOP_PTR = 34096; + var TOTAL_STACK = 5242880; + var INITIAL_INITIAL_MEMORY = Module2["INITIAL_MEMORY"] || 16777216; + if (Module2["wasmMemory"]) { + wasmMemory = Module2["wasmMemory"]; + } else { + wasmMemory = new WebAssembly2.Memory({ + initial: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + maximum: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE + }); + } + if (wasmMemory) { + buffer = wasmMemory.buffer; + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + updateGlobalBufferAndViews(buffer); + HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE; + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module2); + continue; + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === void 0) { + Module2["dynCall_v"](func); + } else { + Module2["dynCall_vi"](func, callback.arg); + } + } else { + func(callback.arg === void 0 ? null : callback.arg); + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATEXIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + function preRun() { + if (Module2["preRun"]) { + if (typeof Module2["preRun"] == "function") + Module2["preRun"] = [Module2["preRun"]]; + while (Module2["preRun"].length) { + addOnPreRun(Module2["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); + } + function initRuntime() { + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__); + } + function preMain() { + callRuntimeCallbacks(__ATMAIN__); + } + function exitRuntime() { + runtimeExited = true; + } + function postRun() { + if (Module2["postRun"]) { + if (typeof Module2["postRun"] == "function") + Module2["postRun"] = [Module2["postRun"]]; + while (Module2["postRun"].length) { + addOnPostRun(Module2["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); + } + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); + } + function addOnInit(cb) { + __ATINIT__.unshift(cb); + } + function addOnPreMain(cb) { + __ATMAIN__.unshift(cb); + } + function addOnExit(cb) { + } + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); + } + function unSign(value, bits, ignore) { + if (value >= 0) { + return value; + } + return bits <= 32 ? 2 * Math.abs(1 << bits - 1) + value : Math.pow(2, bits) + value; + } + function reSign(value, bits, ignore) { + if (value <= 0) { + return value; + } + var half = bits <= 32 ? Math.abs(1 << bits - 1) : Math.pow(2, bits - 1); + if (value >= half && (bits <= 32 || value > half)) { + value = -2 * half + value; + } + return value; + } + var Math_abs = Math.abs; + var Math_cos = Math.cos; + var Math_sin = Math.sin; + var Math_tan = Math.tan; + var Math_acos = Math.acos; + var Math_asin = Math.asin; + var Math_atan = Math.atan; + var Math_atan2 = Math.atan2; + var Math_exp = Math.exp; + var Math_log = Math.log; + var Math_sqrt = Math.sqrt; + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var Math_pow = Math.pow; + var Math_imul = Math.imul; + var Math_fround = Math.fround; + var Math_round = Math.round; + var Math_min = Math.min; + var Math_max = Math.max; + var Math_clz32 = Math.clz32; + var Math_trunc = Math.trunc; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + function getUniqueRunDependency(id) { + return id; + } + function addRunDependency(id) { + runDependencies++; + if (Module2["monitorRunDependencies"]) { + Module2["monitorRunDependencies"](runDependencies); + } + } + function removeRunDependency(id) { + runDependencies--; + if (Module2["monitorRunDependencies"]) { + Module2["monitorRunDependencies"](runDependencies); + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } + } + Module2["preloadedImages"] = {}; + Module2["preloadedAudios"] = {}; + function abort(what) { + if (Module2["onAbort"]) { + Module2["onAbort"](what); + } + what += ""; + out(what); + err(what); + ABORT = true; + EXITSTATUS = 1; + what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; + throw new WebAssembly2.RuntimeError(what); + } + var memoryInitializer = null; + function hasPrefix(str, prefix) { + return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0; + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix); + } + var fileURIPrefix = "file://"; + function isFileURI(filename) { + return hasPrefix(filename, fileURIPrefix); + } + var wasmBinaryFile = "curveasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile); + } + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(wasmBinaryFile); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(wasmBinaryFile); + } else { + throw "both async and sync fetching of the wasm failed"; + } + } catch (err2) { + abort(err2); + } + } + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && // Let's not use fetch to get objects over file:// as it's most likely Cordova which doesn't support fetch for file:// + !isFileURI(wasmBinaryFile)) { + return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'"; + } + return response["arrayBuffer"](); + }).catch(function() { + return getBinary(); + }); + } + return new Promise(function(resolve, reject) { + resolve(getBinary()); + }); + } + function createWasm() { + var info = { + env: asmLibraryArg, + wasi_snapshot_preview1: asmLibraryArg + }; + function receiveInstance(instance, module2) { + var exports3 = instance.exports; + Module2["asm"] = exports3; + removeRunDependency("wasm-instantiate"); + } + addRunDependency("wasm-instantiate"); + function receiveInstantiatedSource(output) { + receiveInstance(output["instance"]); + } + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function(binary) { + return WebAssembly2.instantiate(binary, info); + }).then(receiver, function(reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason); + }); + } + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly2.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously. + !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(response) { + var result = WebAssembly2.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function(reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource); + }); + }); + } else { + return instantiateArrayBuffer(receiveInstantiatedSource); + } + } + if (Module2["instantiateWasm"]) { + try { + var exports2 = Module2["instantiateWasm"](info, receiveInstance); + return exports2; + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false; + } + } + instantiateAsync(); + return {}; + } + var tempDouble; + var tempI64; + var ASM_CONSTS = {}; + __ATINIT__.push({ + func: function() { + ___wasm_call_ctors(); + } + }); + function demangle(func) { + return func; + } + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function(x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]"; + }); + } + function jsStackTrace() { + var err2 = new Error(); + if (!err2.stack) { + try { + throw new Error(); + } catch (e) { + err2 = e; + } + if (!err2.stack) { + return "(no stack trace available)"; + } + } + return err2.stack.toString(); + } + function stackTrace() { + var js = jsStackTrace(); + if (Module2["extraStackTrace"]) + js += "\n" + Module2["extraStackTrace"](); + return demangleAll(js); + } + function _emscripten_get_sbrk_ptr() { + return 34096; + } + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num); + } + function _emscripten_get_heap_size() { + return HEAPU8.length; + } + function abortOnCannotGrowMemory(requestedSize) { + abort("OOM"); + } + function _emscripten_resize_heap(requestedSize) { + requestedSize = requestedSize >>> 0; + abortOnCannotGrowMemory(requestedSize); + } + var ASSERTIONS = false; + function intArrayFromString(stringy, dontAddNull, length) { + var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; + var u8array = new Array(len); + var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); + if (dontAddNull) + u8array.length = numBytesWritten; + return u8array; + } + function intArrayToString(array) { + var ret = []; + for (var i2 = 0; i2 < array.length; i2++) { + var chr = array[i2]; + if (chr > 255) { + if (ASSERTIONS) { + assert(false, "Character code " + chr + " (" + String.fromCharCode(chr) + ") at offset " + i2 + " not in 0x00-0xFF."); + } + chr &= 255; + } + ret.push(String.fromCharCode(chr)); + } + return ret.join(""); + } + var decodeBase64 = typeof atob === "function" ? atob : function(input) { + var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i2 = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + do { + enc1 = keyStr.indexOf(input.charAt(i2++)); + enc2 = keyStr.indexOf(input.charAt(i2++)); + enc3 = keyStr.indexOf(input.charAt(i2++)); + enc4 = keyStr.indexOf(input.charAt(i2++)); + chr1 = enc1 << 2 | enc2 >> 4; + chr2 = (enc2 & 15) << 4 | enc3 >> 2; + chr3 = (enc3 & 3) << 6 | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 !== 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 !== 64) { + output = output + String.fromCharCode(chr3); + } + } while (i2 < input.length); + return output; + }; + function intArrayFromBase64(s) { + if (typeof ENVIRONMENT_IS_NODE === "boolean" && ENVIRONMENT_IS_NODE) { + var buf; + try { + buf = import_buffer.Buffer.from(s, "base64"); + } catch (_) { + buf = new import_buffer.Buffer(s, "base64"); + } + return new Uint8Array(buf["buffer"], buf["byteOffset"], buf["byteLength"]); + } + try { + var decoded = decodeBase64(s); + var bytes = new Uint8Array(decoded.length); + for (var i2 = 0; i2 < decoded.length; ++i2) { + bytes[i2] = decoded.charCodeAt(i2); + } + return bytes; + } catch (_) { + throw new Error("Converting base64 string to bytes failed."); + } + } + function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); + } + var asmGlobalArg = {}; + var asmLibraryArg = { + emscripten_get_sbrk_ptr: _emscripten_get_sbrk_ptr, + emscripten_memcpy_big: _emscripten_memcpy_big, + emscripten_resize_heap: _emscripten_resize_heap, + getTempRet0, + memory: wasmMemory, + setTempRet0, + table: wasmTable + }; + var asm = createWasm(); + Module2["asm"] = asm; + var ___wasm_call_ctors = Module2["___wasm_call_ctors"] = function() { + return (___wasm_call_ctors = Module2["___wasm_call_ctors"] = Module2["asm"]["__wasm_call_ctors"]).apply(null, arguments); + }; + var _curve25519_sign = Module2["_curve25519_sign"] = function() { + return (_curve25519_sign = Module2["_curve25519_sign"] = Module2["asm"]["curve25519_sign"]).apply(null, arguments); + }; + var _curve25519_verify = Module2["_curve25519_verify"] = function() { + return (_curve25519_verify = Module2["_curve25519_verify"] = Module2["asm"]["curve25519_verify"]).apply(null, arguments); + }; + var _curve25519_donna = Module2["_curve25519_donna"] = function() { + return (_curve25519_donna = Module2["_curve25519_donna"] = Module2["asm"]["curve25519_donna"]).apply(null, arguments); + }; + var ___errno_location = Module2["___errno_location"] = function() { + return (___errno_location = Module2["___errno_location"] = Module2["asm"]["__errno_location"]).apply(null, arguments); + }; + var _malloc = Module2["_malloc"] = function() { + return (_malloc = Module2["_malloc"] = Module2["asm"]["malloc"]).apply(null, arguments); + }; + var _free = Module2["_free"] = function() { + return (_free = Module2["_free"] = Module2["asm"]["free"]).apply(null, arguments); + }; + var stackSave = Module2["stackSave"] = function() { + return (stackSave = Module2["stackSave"] = Module2["asm"]["stackSave"]).apply(null, arguments); + }; + var stackAlloc = Module2["stackAlloc"] = function() { + return (stackAlloc = Module2["stackAlloc"] = Module2["asm"]["stackAlloc"]).apply(null, arguments); + }; + var stackRestore = Module2["stackRestore"] = function() { + return (stackRestore = Module2["stackRestore"] = Module2["asm"]["stackRestore"]).apply(null, arguments); + }; + var __growWasmMemory = Module2["__growWasmMemory"] = function() { + return (__growWasmMemory = Module2["__growWasmMemory"] = Module2["asm"]["__growWasmMemory"]).apply(null, arguments); + }; + Module2["asm"] = asm; + var calledRun; + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status; + } + var calledMain = false; + dependenciesFulfilled = function runCaller() { + if (!calledRun) + run(); + if (!calledRun) + dependenciesFulfilled = runCaller; + }; + function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return; + } + preRun(); + if (runDependencies > 0) + return; + function doRun() { + if (calledRun) + return; + calledRun = true; + Module2["calledRun"] = true; + if (ABORT) + return; + initRuntime(); + preMain(); + readyPromiseResolve(Module2); + if (Module2["onRuntimeInitialized"]) + Module2["onRuntimeInitialized"](); + postRun(); + } + if (Module2["setStatus"]) { + Module2["setStatus"]("Running..."); + setTimeout(function() { + setTimeout(function() { + Module2["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } + } + Module2["run"] = run; + function exit(status, implicit) { + if (implicit && noExitRuntime && status === 0) { + return; + } + if (noExitRuntime) { + } else { + ABORT = true; + EXITSTATUS = status; + exitRuntime(); + if (Module2["onExit"]) + Module2["onExit"](status); + } + quit_(status, new ExitStatus(status)); + } + if (Module2["preInit"]) { + if (typeof Module2["preInit"] == "function") + Module2["preInit"] = [Module2["preInit"]]; + while (Module2["preInit"].length > 0) { + Module2["preInit"].pop()(); + } + } + noExitRuntime = true; + run(); + return Module2.ready; + }; + })(); + if (typeof exports === "object" && typeof module === "object") + module.exports = Module; + else if (typeof define === "function" && define["amd"]) + define([], function() { + return Module; + }); + else if (typeof exports === "object") + exports["Module"] = Module; + } +}); + +// node_modules/@privacyresearch/curve25519-typescript/lib/curve-wrapper.js +var require_curve_wrapper = __commonJS({ + "node_modules/@privacyresearch/curve25519-typescript/lib/curve-wrapper.js"(exports) { + "use strict"; + init_inject_buffer(); + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncCurve25519Wrapper = exports.Curve25519Wrapper = void 0; + var curveasm_1 = __importDefault(require_curveasm()); + var instancePromise = (0, curveasm_1.default)(); + var Curve25519Wrapper = class _Curve25519Wrapper { + constructor(module2) { + this._module = module2; + this.basepoint = new Uint8Array(32).fill(0); + this.basepoint[0] = 9; + } + static create() { + return __awaiter(this, void 0, void 0, function* () { + const instance = yield instancePromise; + return new _Curve25519Wrapper(instance); + }); + } + _allocate(bytes) { + const address = this._module._malloc(bytes.length); + this._module.HEAPU8.set(bytes, address); + return address; + } + _readBytes(address, length, array) { + array.set(this._module.HEAPU8.subarray(address, address + length)); + } + keyPair(privKey) { + const priv = new Uint8Array(privKey); + priv[0] &= 248; + priv[31] &= 127; + priv[31] |= 64; + const publicKey_ptr = this._module._malloc(32); + const privateKey_ptr = this._allocate(priv); + const basepoint_ptr = this._allocate(this.basepoint); + const err = this._module._curve25519_donna(publicKey_ptr, privateKey_ptr, basepoint_ptr); + if (err !== 0) { + throw new Error(`Error performing curve scalar multiplication: ${err}`); + } + const res = new Uint8Array(32); + this._readBytes(publicKey_ptr, 32, res); + this._module._free(publicKey_ptr); + this._module._free(privateKey_ptr); + this._module._free(basepoint_ptr); + return { pubKey: res.buffer, privKey: priv.buffer }; + } + sharedSecret(pubKey, privKey) { + const sharedKey_ptr = this._module._malloc(32); + const privateKey_ptr = this._allocate(new Uint8Array(privKey)); + const basepoint_ptr = this._allocate(new Uint8Array(pubKey)); + const err = this._module._curve25519_donna(sharedKey_ptr, privateKey_ptr, basepoint_ptr); + if (err !== 0) { + throw new Error(`Error performing curve scalar multiplication: ${err}`); + } + const res = new Uint8Array(32); + this._readBytes(sharedKey_ptr, 32, res); + this._module._free(sharedKey_ptr); + this._module._free(privateKey_ptr); + this._module._free(basepoint_ptr); + return res.buffer; + } + sign(privKey, message) { + const signature_ptr = this._module._malloc(64); + const privateKey_ptr = this._allocate(new Uint8Array(privKey)); + const message_ptr = this._allocate(new Uint8Array(message)); + this._module._curve25519_sign(signature_ptr, privateKey_ptr, message_ptr, message.byteLength); + const res = new Uint8Array(64); + this._readBytes(signature_ptr, 64, res); + this._module._free(signature_ptr); + this._module._free(privateKey_ptr); + this._module._free(message_ptr); + return res.buffer; + } + verify(pubKey, message, sig) { + const publicKey_ptr = this._allocate(new Uint8Array(pubKey)); + const signature_ptr = this._allocate(new Uint8Array(sig)); + const message_ptr = this._allocate(new Uint8Array(message)); + const res = this._module._curve25519_verify(signature_ptr, publicKey_ptr, message_ptr, message.byteLength); + this._module._free(publicKey_ptr); + this._module._free(signature_ptr); + this._module._free(message_ptr); + return res !== 0; + } + /** + * Syntactic sugar for verify with explicit semantics. The fact that verify returns true when + * a signature is invalid could be confusing. The meaning of this function should be clear. + * + * @param pubKey + * @param message + * @param sig + */ + signatureIsValid(pubKey, message, sig) { + return !this.verify(pubKey, message, sig); + } + }; + exports.Curve25519Wrapper = Curve25519Wrapper; + var AsyncCurve25519Wrapper = class { + constructor() { + this.curvePromise = Curve25519Wrapper.create(); + } + keyPair(privKey) { + return __awaiter(this, void 0, void 0, function* () { + return (yield this.curvePromise).keyPair(privKey); + }); + } + sharedSecret(pubKey, privKey) { + return __awaiter(this, void 0, void 0, function* () { + return (yield this.curvePromise).sharedSecret(pubKey, privKey); + }); + } + sign(privKey, message) { + return __awaiter(this, void 0, void 0, function* () { + return (yield this.curvePromise).sign(privKey, message); + }); + } + verify(pubKey, message, sig) { + return __awaiter(this, void 0, void 0, function* () { + return (yield this.curvePromise).verify(pubKey, message, sig); + }); + } + }; + exports.AsyncCurve25519Wrapper = AsyncCurve25519Wrapper; + } +}); + +// node_modules/@privacyresearch/curve25519-typescript/lib/types.js +var require_types = __commonJS({ + "node_modules/@privacyresearch/curve25519-typescript/lib/types.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + } +}); + +// node_modules/@privacyresearch/curve25519-typescript/lib/index.js +var require_lib = __commonJS({ + "node_modules/@privacyresearch/curve25519-typescript/lib/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_curve_wrapper(), exports); + __exportStar(require_types(), exports); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/helpers.js +var require_helpers = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/helpers.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.uint8ArrayToArrayBuffer = exports.isEqual = exports.binaryStringToArrayBuffer = exports.uint8ArrayToString = exports.arrayBufferToString = void 0; + function arrayBufferToString(b) { + return uint8ArrayToString(new Uint8Array(b)); + } + exports.arrayBufferToString = arrayBufferToString; + function uint8ArrayToString(arr) { + const end = arr.length; + let begin = 0; + if (begin === end) + return ""; + let chars = []; + const parts = []; + while (begin < end) { + chars.push(arr[begin++]); + if (chars.length >= 1024) { + parts.push(String.fromCharCode(...chars)); + chars = []; + } + } + return parts.join("") + String.fromCharCode(...chars); + } + exports.uint8ArrayToString = uint8ArrayToString; + function binaryStringToArrayBuffer(str) { + let i2 = 0; + const k = str.length; + let charCode; + const bb = []; + while (i2 < k) { + charCode = str.charCodeAt(i2); + if (charCode > 255) + throw RangeError("illegal char code: " + charCode); + bb[i2++] = charCode; + } + return Uint8Array.from(bb).buffer; + } + exports.binaryStringToArrayBuffer = binaryStringToArrayBuffer; + function isEqual(a, b) { + if (a === void 0 || b === void 0) { + return false; + } + const a1 = arrayBufferToString(a); + const b1 = arrayBufferToString(b); + const maxLength = Math.max(a1.length, b1.length); + if (maxLength < 5) { + throw new Error("a/b compare too short"); + } + return a1.substring(0, Math.min(maxLength, a1.length)) == b1.substring(0, Math.min(maxLength, b1.length)); + } + exports.isEqual = isEqual; + function uint8ArrayToArrayBuffer(arr) { + return arr.buffer.slice(arr.byteOffset, arr.byteLength + arr.byteOffset); + } + exports.uint8ArrayToArrayBuffer = uint8ArrayToArrayBuffer; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/internal/curve.js +var require_curve = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/internal/curve.js"(exports) { + "use strict"; + init_inject_buffer(); + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncCurve = exports.Curve = void 0; + var curve25519_typescript_1 = require_lib(); + var helpers_1 = require_helpers(); + var Curve = class { + constructor(curve25519) { + this._curve25519 = curve25519; + this.async = new AsyncCurve(); + } + set curve(c) { + this._curve25519 = c; + } + createKeyPair(privKey) { + validatePrivKey(privKey); + const raw_keys = this._curve25519.keyPair(privKey); + return processKeys(raw_keys); + } + ECDHE(pubKey, privKey) { + pubKey = validatePubKeyFormat(pubKey); + validatePrivKey(privKey); + if (pubKey === void 0 || pubKey.byteLength != 32) { + throw new Error("Invalid public key"); + } + return this._curve25519.sharedSecret(pubKey, privKey); + } + Ed25519Sign(privKey, message) { + validatePrivKey(privKey); + if (message === void 0) { + throw new Error("Invalid message"); + } + return this._curve25519.sign(privKey, message); + } + Ed25519Verify(pubKey, msg, sig) { + pubKey = validatePubKeyFormat(pubKey); + if (pubKey === void 0 || pubKey.byteLength != 32) { + throw new Error("Invalid public key"); + } + if (msg === void 0) { + throw new Error("Invalid message"); + } + if (sig === void 0 || sig.byteLength != 64) { + throw new Error("Invalid signature"); + } + return this._curve25519.verify(pubKey, msg, sig); + } + }; + exports.Curve = Curve; + var AsyncCurve = class { + constructor() { + this._curve25519 = new curve25519_typescript_1.AsyncCurve25519Wrapper(); + } + set curve(c) { + this._curve25519 = c; + } + createKeyPair(privKey) { + return __awaiter(this, void 0, void 0, function* () { + validatePrivKey(privKey); + const raw_keys = yield this._curve25519.keyPair(privKey); + return processKeys(raw_keys); + }); + } + ECDHE(pubKey, privKey) { + pubKey = validatePubKeyFormat(pubKey); + validatePrivKey(privKey); + if (pubKey === void 0 || pubKey.byteLength != 32) { + throw new Error("Invalid public key"); + } + return this._curve25519.sharedSecret(pubKey, privKey); + } + Ed25519Sign(privKey, message) { + validatePrivKey(privKey); + if (message === void 0) { + throw new Error("Invalid message"); + } + return this._curve25519.sign(privKey, message); + } + Ed25519Verify(pubKey, msg, sig) { + return __awaiter(this, void 0, void 0, function* () { + pubKey = validatePubKeyFormat(pubKey); + if (pubKey === void 0 || pubKey.byteLength != 32) { + throw new Error("Invalid public key"); + } + if (msg === void 0) { + throw new Error("Invalid message"); + } + if (sig === void 0 || sig.byteLength != 64) { + throw new Error("Invalid signature"); + } + const verifyResult = yield this._curve25519.verify(pubKey, msg, sig); + if (verifyResult) { + throw new Error("Invalid signature"); + } + return verifyResult; + }); + } + }; + exports.AsyncCurve = AsyncCurve; + function validatePrivKey(privKey) { + if (privKey === void 0 || !(privKey instanceof ArrayBuffer) || privKey.byteLength != 32) { + throw new Error("Invalid private key"); + } + } + function validatePubKeyFormat(pubKey) { + if (pubKey === void 0 || (pubKey.byteLength != 33 || new Uint8Array(pubKey)[0] != 5) && pubKey.byteLength != 32) { + console.warn(`Invalid public key`, { pubKey }); + throw new Error(`Invalid public key: ${pubKey} ${pubKey === null || pubKey === void 0 ? void 0 : pubKey.byteLength}`); + } + if (pubKey.byteLength == 33) { + return pubKey.slice(1); + } else { + console.error("WARNING: Expected pubkey of length 33, please report the ST and client that generated the pubkey"); + return pubKey; + } + } + function processKeys(raw_keys) { + const origPub = new Uint8Array(raw_keys.pubKey); + const pub = new Uint8Array(33); + pub.set(origPub, 1); + pub[0] = 5; + return { pubKey: (0, helpers_1.uint8ArrayToArrayBuffer)(pub), privKey: raw_keys.privKey }; + } + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/msrcrypto.js +var require_msrcrypto = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/msrcrypto.js"(exports, module) { + "use strict"; + init_inject_buffer(); + var msrCryptoVersion = "1.6.1"; + (function(root, factory) { + if (typeof define === "function" && define.amd) { + define([], function() { + return root.msrCrypto = factory(root); + }); + } else if (typeof exports === "object") { + module.exports = factory(root); + } else { + root.msrCrypto = factory(root); + } + })(exports, function(global2) { + global2 = global2 || {}; + var msrCrypto = function() { + var operations = {}; + operations.register = function(operationType, algorithmName, functionToCall) { + if (!operations[operationType]) { + operations[operationType] = {}; + } + var op = operations[operationType]; + if (!op[algorithmName]) { + op[algorithmName] = functionToCall; + } + }; + operations.exists = function(operationType, algorithmName) { + if (!operations[operationType]) { + return false; + } + return operations[operationType][algorithmName] ? true : false; + }; + var scriptUrl = /* @__PURE__ */ (function() { + return null; + })(); + var fprngEntropyProvided = false; + var webWorkerSupport = typeof Worker !== "undefined"; + var runningInWorkerInstance = typeof importScripts === "function" && self instanceof WorkerGlobalScope; + var workerInitialized = false; + var typedArraySupport = typeof ArrayBuffer !== "undefined"; + var setterSupport = (function() { + try { + Object.defineProperty({}, "oncomplete", {}); + return true; + } catch (ex) { + return false; + } + })(); + var asyncMode = false; + var createProperty = function(parentObject, propertyName, initialValue, getterFunction, setterFunction) { + if (!setterSupport) { + parentObject[propertyName] = initialValue; + return; + } + var setGet = {}; + getterFunction && (setGet.get = getterFunction); + setterFunction && (setGet.set = setterFunction); + Object.defineProperty(parentObject, propertyName, setGet); + }; + var msrcryptoHashFunctions = {}; + var msrcryptoUtilities = /* @__PURE__ */ (function() { + var encodingChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + function consoleLog(text) { + if ("console" in self && "log" in console) { + console.log(text); + } + } + function toBase64(data, base64Url) { + var dataType = getObjectType(data); + if (dataType !== "Array" && dataType !== "Uint8Array" && dataType !== "ArrayBuffer") { + throw new Error("invalid input"); + } + var output = ""; + var input = toArray(data); + if (!base64Url) { + base64Url = false; + } + var char1, char2, char3, enc1, enc2, enc3, enc4; + var i2; + for (i2 = 0; i2 < input.length; i2 += 3) { + char1 = input[i2]; + char2 = input[i2 + 1]; + char3 = input[i2 + 2]; + enc1 = char1 >> 2; + enc2 = (char1 & 3) << 4 | char2 >> 4; + enc3 = (char2 & 15) << 2 | char3 >> 6; + enc4 = char3 & 63; + if (isNaN(char2)) { + enc3 = enc4 = 64; + } else if (isNaN(char3)) { + enc4 = 64; + } + output = output + encodingChars.charAt(enc1) + encodingChars.charAt(enc2) + encodingChars.charAt(enc3) + encodingChars.charAt(enc4); + } + if (base64Url) { + return output.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, ""); + } + return output; + } + function base64ToBytes(encodedString) { + encodedString = encodedString.replace(/-/g, "+").replace(/_/g, "/"); + while (encodedString.length % 4 !== 0) { + encodedString += "="; + } + var output = []; + var char1, char2, char3; + var enc1, enc2, enc3, enc4; + var i2; + encodedString = encodedString.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + for (i2 = 0; i2 < encodedString.length; i2 += 4) { + enc1 = encodingChars.indexOf(encodedString.charAt(i2)); + enc2 = encodingChars.indexOf(encodedString.charAt(i2 + 1)); + enc3 = encodingChars.indexOf(encodedString.charAt(i2 + 2)); + enc4 = encodingChars.indexOf(encodedString.charAt(i2 + 3)); + char1 = enc1 << 2 | enc2 >> 4; + char2 = (enc2 & 15) << 4 | enc3 >> 2; + char3 = (enc3 & 3) << 6 | enc4; + output.push(char1); + if (enc3 !== 64) { + output.push(char2); + } + if (enc4 !== 64) { + output.push(char3); + } + } + return output; + } + function getObjectType(object) { + return Object.prototype.toString.call(object).slice(8, -1); + } + function bytesToHexString2(bytes, separate) { + var result = ""; + if (typeof separate === "undefined") { + separate = false; + } + for (var i2 = 0; i2 < bytes.length; i2++) { + if (separate && i2 % 4 === 0 && i2 !== 0) { + result += "-"; + } + var hexval = bytes[i2].toString(16).toUpperCase(); + if (hexval.length === 1) { + result += "0"; + } + result += hexval; + } + return result; + } + function bytesToInt32(bytes, index) { + index = index || 0; + return bytes[index] << 24 | bytes[index + 1] << 16 | bytes[index + 2] << 8 | bytes[index + 3]; + } + function hexToBytesArray(hexString) { + hexString = hexString.replace(/\-/g, ""); + var result = []; + while (hexString.length >= 2) { + result.push(parseInt(hexString.substring(0, 2), 16)); + hexString = hexString.substring(2, hexString.length); + } + return result; + } + function clone(object) { + var newObject = {}; + for (var propertyName in object) { + if (object.hasOwnProperty(propertyName)) { + newObject[propertyName] = object[propertyName]; + } + } + return newObject; + } + function unpackData(base64String, arraySize, toUint32s) { + var bytes = base64ToBytes(base64String), data = [], i2; + if (isNaN(arraySize)) { + return bytes; + } else { + for (i2 = 0; i2 < bytes.length; i2 += arraySize) { + data.push(bytes.slice(i2, i2 + arraySize)); + } + } + if (toUint32s) { + for (i2 = 0; i2 < data.length; i2++) { + data[i2] = (data[i2][0] << 24) + (data[i2][1] << 16) + (data[i2][2] << 8) + data[i2][3]; + } + } + return data; + } + function int32ToBytes(int32) { + return [int32 >>> 24 & 255, int32 >>> 16 & 255, int32 >>> 8 & 255, int32 & 255]; + } + function int32ArrayToBytes(int32Array) { + var result = []; + for (var i2 = 0; i2 < int32Array.length; i2++) { + result = result.concat(int32ToBytes(int32Array[i2])); + } + return result; + } + function xorVectors(a, b, res) { + var length = Math.min(a.length, b.length), res = res || new Array(length); + for (var i2 = 0; i2 < length; i2 += 1) { + res[i2] = a[i2] ^ b[i2]; + } + return res; + } + function getVector(length, fillValue) { + if (isNaN(fillValue)) { + fillValue = 0; + } + var res = new Array(length); + for (var i2 = 0; i2 < length; i2 += 1) { + res[i2] = fillValue; + } + return res; + } + function toArray(typedArray) { + if (!typedArray) { + return []; + } + if (typedArray.pop) { + return typedArray; + } + if (getObjectType(typedArray) === "ArrayBuffer") { + typedArray = new Uint8Array(typedArray); + } else if (typedArray.BYTES_PER_ELEMENT > 1) { + typedArray = new Uint8Array(typedArray.buffer); + } + if (typedArray.length === 1) { + return [typedArray[0]]; + } + if (typedArray.length < 65536) { + return Array.apply(null, typedArray); + } + var returnArray = new Array(typedArray.length); + for (var i2 = 0; i2 < typedArray.length; i2++) { + returnArray[i2] = typedArray[i2]; + } + return returnArray; + } + function padEnd(array, value, finalLength) { + while (array.length < finalLength) { + array.push(value); + } + return array; + } + function padFront(array, value, finalLength) { + while (array.length < finalLength) { + array.unshift(value); + } + return array; + } + function arraysEqual(array1, array2) { + var result = true; + if (array1.length !== array2.length) { + result = false; + } + for (var i2 = 0; i2 < array1.length; i2++) { + if (array1[i2] !== array2[i2]) { + result = false; + } + } + return result; + } + function verifyByteArray(array) { + if (getObjectType(array) !== "Array") { + return false; + } + var element; + for (var i2 = 0; i2 < array.length; i2++) { + element = array[i2]; + if (isNaN(element) || element < 0 || element > 255) { + return false; + } + } + return true; + } + function checkParam(param, type, errorMessage) { + if (!param) { + throw new Error(errorMessage); + } + if (type && getObjectType(param) !== type) { + throw new Error(errorMessage); + } + return true; + } + function stringToBytes(text) { + var encodedBytes = []; + for (var i2 = 0, j = 0; i2 < text.length; i2++) { + var charCode = text.charCodeAt(i2); + if (charCode < 128) { + encodedBytes[j++] = charCode; + } else if (charCode < 2048) { + encodedBytes[j++] = charCode >>> 6 | 192; + encodedBytes[j++] = charCode & 63 | 128; + } else if (charCode < 55296 || charCode > 57343) { + encodedBytes[j++] = charCode >>> 12 | 224; + encodedBytes[j++] = charCode >>> 6 & 63 | 128; + encodedBytes[j++] = charCode & 63 | 128; + } else { + charCode = (charCode - 55296) * 1024 + (text.charCodeAt(++i2) - 56320) + 65536; + encodedBytes[j++] = charCode >>> 18 | 240; + encodedBytes[j++] = charCode >>> 12 & 63 | 128; + encodedBytes[j++] = charCode >>> 6 & 63 | 128; + encodedBytes[j++] = charCode & 63 | 128; + } + } + return encodedBytes; + } + function bytesToString(textBytes) { + var result = "", charCode; + textBytes = toArray(textBytes); + for (var i2 = 0; i2 < textBytes.length; ) { + var encodedChar = textBytes[i2++]; + if (encodedChar < 128) { + charCode = encodedChar; + } else if (encodedChar < 224) { + charCode = (encodedChar << 6) + textBytes[i2++] - 12416; + } else if (encodedChar < 240) { + charCode = (encodedChar << 12) + (textBytes[i2++] << 6) + textBytes[i2++] - 925824; + } else { + charCode = (encodedChar << 18) + (textBytes[i2++] << 12) + (textBytes[i2++] << 6) + textBytes[i2++] - 63447168; + } + if (charCode > 65535) { + var surrogateHigh = Math.floor((charCode - 65536) / 1024) + 55296; + var surrogateLow = (charCode - 65536) % 1024 + 56320; + result += String.fromCharCode(surrogateHigh, surrogateLow); + continue; + } + result += String.fromCharCode(charCode); + } + return result; + } + return { + consoleLog, + toBase64, + fromBase64: base64ToBytes, + checkParam, + getObjectType, + bytesToHexString: bytesToHexString2, + bytesToInt32, + stringToBytes, + bytesToString, + unpackData, + hexToBytesArray, + int32ToBytes, + int32ArrayToBytes, + toArray, + arraysEqual, + clone, + xorVectors, + padEnd, + padFront, + getVector, + verifyByteArray + }; + })(); + var asn1 = /* @__PURE__ */ (function() { + var asn1Types = { + 0: "CUSTOM", + 1: "BOOLEAN", + 2: "INTEGER", + 3: "BIT STRING", + 4: "OCTET STRING", + 5: "NULL", + 6: "OBJECT IDENTIFIER", + 16: "SEQUENCE", + 17: "SET", + 19: "PRINTABLE STRING", + 23: "UTCTime" + }; + var asn1Classes = { + 0: "UNIVERSAL", + 1: "APPLICATION", + 2: "Context-Defined", + 3: "PRIVATE" + }; + function parse(bytes, force) { + force = !!force; + var type = asn1Types[bytes[0] & 31], dataLen = bytes[1], i2 = 0, constructed = !!(bytes[0] & 32), remainder, child, header; + if (dataLen & 128) { + for (i2 = 0, dataLen = 0; i2 < (bytes[1] & 127); i2++) { + dataLen = (dataLen << 8) + bytes[2 + i2]; + } + } + header = 2 + i2; + if (type === void 0 || dataLen > bytes.length) { + return null; + } + var obj = constructed ? [] : {}; + obj.type = type; + obj.header = header; + obj.data = bytes.slice(0, dataLen + header); + if (constructed || force) { + if (obj.type === "BIT STRING" && bytes[header] === 0) { + i2++; + } + remainder = bytes.slice(header, obj.data.length); + while (remainder.length > 0) { + child = parse(remainder); + if (child === null) { + break; + } + obj.push(child); + remainder = remainder.slice(child.data.length); + } + } + return obj; + } + function encode(asn1tree) { + throw new Error("not implemented"); + } + function toString(objTree, indent) { + var output = new Array(indent + 1).join(" ") + objTree.type + " (" + objTree.length + ") " + bytesToHexString(objTree.data).substring(0, 16) + "\n"; + if (!objTree.children) { + return output; + } + for (var i2 = 0; i2 < objTree.children.length; i2++) { + output += toString(objTree.children[i2], indent + 4) + ""; + } + return output; + } + return { + parse, + encode, + toString: function(objTree) { + return toString(objTree, 0); + } + }; + })(); + var msrcryptoWorker = /* @__PURE__ */ (function() { + function returnResult(result) { + if (workerInitialized && runningInWorkerInstance) { + self.postMessage(result); + } + return result; + } + var workerId, operationType, operationSubType; + return { + jsCryptoRunner: function(e) { + workerId = e.data.workerid; + operationType = e.data.operationType; + operationSubType = e.data.operationSubType; + var operation = e.data.operationType, result, func = operations[operation][e.data.algorithm.name], p = e.data; + if (!operations.exists(operation, e.data.algorithm.name)) { + throw new Error("unregistered algorithm."); + } + if (p.operationSubType) { + result = returnResult({ + type: p.operationSubType, + result: func(p) + }); + } else { + result = returnResult(func(p)); + } + return result; + }, + returnResult + }; + })(); + if (runningInWorkerInstance) { + self.onmessage = function(e) { + if (!workerInitialized && e.data.prngSeed) { + var entropy = e.data.prngSeed; + msrcryptoPseudoRandom.init(entropy); + workerInitialized = true; + return msrcryptoWorker.returnResult({ + initialized: true + }); + } + if (workerInitialized === true) { + msrcryptoWorker.jsCryptoRunner(e); + } + }; + } + var msrcryptoJwk = /* @__PURE__ */ (function() { + var utils2 = msrcryptoUtilities; + function stringToArray(stringData) { + var result = []; + for (var i2 = 0; i2 < stringData.length; i2++) { + result[i2] = stringData.charCodeAt(i2); + } + if (result[result.length - 1] === 0) { + result.pop(); + } + return result; + } + function getKeyType(keyHandle) { + var algType = keyHandle.algorithm.name.slice(0, 3).toUpperCase(); + if (algType === "RSA") { + return "RSA"; + } + if (algType === "ECD") { + return "EC"; + } + return "oct"; + } + function hashSize(algorithm) { + return algorithm.hash.name.substring(algorithm.hash.name.indexOf("-") + 1); + } + var algorithmMap = { + HMAC: function(algorithm) { + return "HS" + hashSize(algorithm); + }, + "AES-CBC": function(algorithm) { + return "A" + algorithm.length.toString() + "CBC"; + }, + "AES-GCM": function(algorithm) { + return "A" + algorithm.length.toString() + "GCM"; + }, + "RSAES-PKCS1-V1_5": function(algorithm) { + return "RSA1_5"; + }, + "RSASSA-PKCS1-V1_5": function(algorithm) { + return "RS" + hashSize(algorithm); + }, + "RSA-OAEP": function(algorithm) { + if (algorithm.hash.name.toUpperCase() === "SHA-1") { + return "RSA-OAEP"; + } + return "RSA-OAEP-" + hashSize(algorithm); + }, + "RSA-PSS": function(algorithm) { + return "PS" + hashSize(algorithm); + }, + ECDSA: function(algorithm) { + return "EC-" + algorithm.namedCurve.substring(algorithm.namedCurve.indexOf("-") + 1); + } + }; + function keyToJwk(keyHandle, keyData) { + var key = {}; + key.kty = getKeyType(keyHandle); + key.ext = keyHandle.extractable; + if (algorithmMap[keyHandle.algorithm.name.toUpperCase()]) { + key.alg = algorithmMap[keyHandle.algorithm.name.toUpperCase()](keyHandle.algorithm); + } + key.key_ops = keyHandle.usages; + if (keyData.pop) { + key.k = utils2.toBase64(keyData, true); + } else { + for (var property in keyData) { + if (keyData[property].pop && property !== "key_ops") { + key[property] = utils2.toBase64(keyData[property], true); + } + } + } + if (keyHandle.algorithm.namedCurve) { + key.crv = keyHandle.algorithm.namedCurve; + } + return key; + } + function findUsage(usage, usages) { + for (var i2 = 0; i2 < usages.length; i2++) { + if (usage.toUpperCase() === usages[i2].toUpperCase()) { + return true; + } + } + return false; + } + function keyToJwkOld(keyHandle, keyData) { + var key = {}; + key.kty = getKeyType(keyHandle); + key.extractable = keyHandle.extractable; + if (keyData.pop) { + key.k = utils2.toBase64(keyData, true); + } else { + for (var property in keyData) { + if (keyData[property].pop) { + key[property] = utils2.toBase64(keyData[property], true); + } + } + } + if (keyHandle.algorithm.namedCurve) { + key.crv = keyHandle.algorithm.namedCurve; + } + var stringData = JSON.stringify(key, null, " "); + return stringToArray(stringData); + } + function jwkToKey(keyData, algorithm, propsToArray) { + var jsonKeyObject = JSON.parse(JSON.stringify(keyData)); + for (var i2 = 0; i2 < propsToArray.length; i2 += 1) { + var propValue = jsonKeyObject[propsToArray[i2]]; + if (propValue) { + jsonKeyObject[propsToArray[i2]] = utils2.fromBase64(propValue); + } + } + return jsonKeyObject; + } + return { + keyToJwkOld, + keyToJwk, + jwkToKey + }; + })(); + function msrcryptoMath() { + var DIGIT_BITS = 24; + var DIGIT_NUM_BYTES = Math.floor(DIGIT_BITS / 8); + var DIGIT_MASK = (1 << DIGIT_BITS) - 1; + var DIGIT_BASE = 1 << DIGIT_BITS; + var DIGIT_MAX = DIGIT_MASK; + var DIG_INV = 1 / DIGIT_BASE; + var DIGIT_MAX_ADDS = 31; + var DIGIT_SCALER = [1, 256]; + for (var ds = 2; ds <= DIGIT_NUM_BYTES; ds++) { + DIGIT_SCALER[ds] = DIGIT_SCALER[ds - 1] * 256; + } + var Zero = [0]; + var One = [1]; + function createArray(parameter) { + var i2, array = null; + if (!arguments.length || typeof arguments[0] === "number") { + array = new Array(parameter); + for (i2 = 0; i2 < parameter; i2 += 1) { + array[i2] = 0; + } + } else if (typeof arguments[0] === "object") { + array = new Array(parameter.length); + for (i2 = 0; i2 < parameter.length; i2 += 1) { + array[i2] = parameter[i2]; + } + } + return array; + } + function stringToDigits(numberStr, radix) { + numberStr = numberStr.replace(/^\s+|\s+$/g, ""); + var num = [0]; + var buffer = [0]; + radix = radix || 10; + for (var i2 = 0; i2 < numberStr.length; i2 += 1) { + var char = parseInt(numberStr[i2], radix); + if (isNaN(char)) { + throw new Error("Failed to convert string to integer in radix " + radix.toString()); + } + multiply(num, radix, buffer); + add(buffer, [char], num); + normalizeDigitArray(num); + } + return num; + } + function digitsToString(digits, radix) { + radix = radix || 10; + if (DIGIT_BASE <= radix) { + throw new Error("DIGIT_BASE is smaller than RADIX; cannot convert."); + } + var wordLength = digits.length; + var quotient = []; + var remainder = []; + var temp1 = []; + var temp2 = []; + var divisor = []; + var a = []; + var i2; + var sb = ""; + var pad = "0"; + divisor[0] = radix; + while (Math.floor(DIGIT_BASE / divisor[0]) >= radix) { + divisor[0] = divisor[0] * radix; + pad = pad.concat("0"); + } + for (i2 = 0; i2 < wordLength; i2 += 1) { + a[i2] = digits[i2]; + } + do { + var allZeros = true; + for (i2 = 0; i2 < a.length; i2 += 1) { + if (a[i2] !== 0) { + allZeros = false; + break; + } + } + if (allZeros) { + break; + } + divRem(a, divisor, quotient, remainder, temp1, temp2); + normalizeDigitArray(quotient, a.length, true); + var newDigits = remainder[0].toString(radix); + sb = pad.substring(0, pad.length - newDigits.length) + newDigits + sb; + var swap = a; + a = quotient; + quotient = swap; + } while (true); + while (sb.length !== 0 && sb[0] === "0") { + sb = sb.substring(1, sb.length); + } + if (sb.length === 0) { + sb = "0"; + } + return sb; + } + function computeBitArray(bytes) { + var out = createArray(bytes.length * 8); + var bitLength = 0; + var i2 = bytes.length - 1; + while (i2 >= 0) { + var j = 0; + while (j < 8) { + var mask = 1 << j; + var bit = (bytes[i2] & mask) === mask ? 1 : 0; + var thisBitIndex = 8 * (bytes.length - i2 - 1) + j; + if (bit === 1) { + bitLength = thisBitIndex + 1; + } + out[thisBitIndex] = bit; + j += 1; + } + i2--; + } + return out.slice(0, bitLength); + } + function bitScanForward(digit) { + var index = 0; + for (var i2 = 0; i2 < DIGIT_BITS; i2++) { + index = Math.max(index, -(digit >>> i2 & 1) & i2); + } + return index; + } + function highestSetBit(bytes) { + var i2 = 0; + var bitLength = 0; + while (i2 < bytes.length) { + if (bitLength === 0) { + var j = 7; + while (j >= 0 && bitLength === 0) { + var mask = 1 << j; + if ((bytes[i2] & mask) === mask) { + bitLength = j + 1; + } + j--; + } + } else { + bitLength += 8; + } + i2 += 1; + } + return bitLength; + } + function fixedWindowRecode(digits, windowSize, t) { + digits = digits.slice(); + var recodedDigits = [], windowSizeBits = Math.pow(2, windowSize), windowSizeMinus1Bits = Math.pow(2, windowSize - 1); + for (var i2 = 0; i2 < t; i2++) { + recodedDigits[i2] = digits[0] % windowSizeBits - windowSizeMinus1Bits; + digits[0] = digits[0] - recodedDigits[i2]; + cryptoMath.shiftRight(digits, digits, windowSize - 1); + } + recodedDigits[i2] = digits[0]; + return recodedDigits; + } + function fixedWindowRecode2(digits, windowSize) { + var digLen = digits.length, bits = new Array(digLen * DIGIT_BITS), i2 = 0, j = 0, k = 0, r = 0, dig, result = new Array(Math.ceil(digLen * DIGIT_BITS / windowSize)); + for (k = 0, result[0] = 0; i2 < digLen; i2++) { + for (j = 0, dig = digits[i2]; j < DIGIT_BITS; j++, dig >>>= 1) { + if (k === windowSize) { + result[++r] = 0; + k = 0; + } + result[r] += (dig & 1) << k++; + } + } + return result; + } + function fetchBits(digits, startBit, count) { + var startDigit = Math.floor(startBit / cryptoMath.DIGIT_BITS); + var endDigit = startDigit + 1; + var shiftRight2 = startBit % cryptoMath.DIGIT_BITS; + var shiftLeft2 = cryptoMath.DIGIT_BITS - shiftRight2; + var bits = digits[startDigit] >>> shiftRight2 | digits[endDigit] << shiftLeft2; + return bits & cryptoMath.DIGIT_MASK >>> cryptoMath.DIGIT_BITS - count; + } + function fetchBits2(digits, startBit, count) { + var startDigit = Math.floor(startBit / DIGIT_BITS), shiftRight2 = startBit % DIGIT_BITS; + return digits[startDigit] >>> shiftRight2 | digits[startDigit + 1] << DIGIT_BITS - shiftRight2 & DIGIT_MASK >>> DIGIT_BITS - count; + } + function copyArray(source, sourceIndex, destination, destIndex, length) { + while (length-- > 0) { + destination[destIndex + length] = source[sourceIndex + length]; + } + } + function isZero(array) { + var i2, result = 0; + for (i2 = 0; i2 < array.length; i2 += 1) { + result = result | array[i2]; + } + return !result; + } + function isEven(array) { + return (array[0] & 1) === 0; + } + function sequenceEqual(left, right) { + var equal = left.length === right.length; + for (var i2 = 0; i2 < Math.min(left.length, right.length); i2 += 1) { + if (left[i2] !== right[i2]) { + equal = false; + } + } + return equal; + } + function bytesToDigits(bytes) { + var arrayLength = Math.floor((bytes.length + DIGIT_NUM_BYTES - 1) / DIGIT_NUM_BYTES); + var array = new Array(arrayLength); + array[0] = 0; + var digit = 0, index = 0, scIndex = 0; + for (var i2 = bytes.length - 1; i2 >= 0; i2--) { + digit = digit + DIGIT_SCALER[scIndex++] * (bytes[i2] & 255); + if (DIGIT_SCALER[scIndex] === DIGIT_BASE) { + scIndex = 0; + array[index++] = digit; + digit = 0; + } + } + if (digit !== 0) { + array[index] = digit; + } + while (array[--arrayLength] == null) { + array[arrayLength] = 0; + } + return array; + } + function digitsToBytes(digits, trim, minTrimLength) { + var i2, j, byte1; + var bytes = [0]; + if (typeof trim === "undefined") { + trim = true; + } + for (i2 = 0; i2 < digits.length; i2 += 1) { + byte1 = digits[i2]; + for (j = 0; j < DIGIT_NUM_BYTES; j += 1) { + bytes[i2 * DIGIT_NUM_BYTES + j] = byte1 & 255; + byte1 = Math.floor(byte1 / 256); + } + } + bytes.reverse(); + if (minTrimLength === void 0) { + minTrimLength = 1; + } + if (trim) { + while (bytes.length > minTrimLength && bytes[0] === 0) { + bytes.shift(); + } + } + return bytes; + } + function intToDigits(value, numDigits) { + if (typeof numDigits === "undefined") { + if (value <= 1) { + numDigits = 1; + } else { + var numBits = Math.log(value) / Math.LN2; + numDigits = Math.ceil(numBits / DIGIT_BITS); + } + } + var digitRepresentation = []; + while (value > 0) { + digitRepresentation.push(value % DIGIT_BASE); + value = Math.floor(value / DIGIT_BASE); + } + while (digitRepresentation.length < numDigits) { + digitRepresentation.push(0); + } + return digitRepresentation; + } + function mswIndex(digits) { + for (var i2 = digits.length - 1; i2 >= 0; i2--) { + if (digits[i2] !== void 0 && digits[i2] !== 0) { + return i2; + } + } + return digits[0] === 0 ? -1 : 0; + } + function compareDigits(left, right) { + var result = 0, val, i2; + for (i2 = 0; i2 < Math.max(left.length, right.length); i2++) { + val = ~~left[i2] - ~~right[i2]; + result = val + (result & -!val); + } + return result; + } + function normalizeDigitArray(digits, length, pad) { + var i2 = mswIndex(digits); + digits.length = length || i2 + 1; + if (pad) { + while (++i2 < digits.length) { + digits[i2] = 0; + } + } + if (digits.length <= 0) { + digits[0] = 0; + digits.length = 1; + } + return digits; + } + function shiftRight(source, destination, bits, length) { + if (bits === void 0) { + bits = 1; + } else if (bits >= DIGIT_BITS || bits < 0) { + throw new Error("Invalid bit count for shiftRight"); + } + if (length === void 0) { + length = source.length; + } + var n = length - 1; + var leftShiftBitCount = DIGIT_BITS - bits; + for (var i2 = 0; i2 < n; i2++) { + destination[i2] = (source[i2 + 1] << leftShiftBitCount | source[i2] >>> bits) & DIGIT_MASK; + } + destination[n] = source[n] >>> bits; + } + function shiftLeft(source, destination, bits, length) { + if (bits === void 0) { + bits = 1; + } else if (bits >= DIGIT_BITS || bits < 0) { + throw new Error("bit count must be smaller than DIGIT_BITS and positive in shiftLeft"); + } + if (length === void 0) { + length = source.length; + } + var rightShiftBitCount = DIGIT_BITS - bits; + destination[length] = source[length - 1] >>> DIGIT_BITS - bits || destination[length]; + for (var i2 = length - 1; i2 > 0; i2--) { + destination[i2] = (source[i2] << bits | source[i2 - 1] >>> rightShiftBitCount) & DIGIT_MASK; + } + destination[0] = source[0] << bits & DIGIT_MASK; + } + function add(addend1, addend2, sum) { + var shortArray = addend1; + var longArray = addend2; + if (addend2.length < addend1.length) { + shortArray = addend2; + longArray = addend1; + } + var s = shortArray.length; + var carry = 0; + var i2; + for (i2 = 0; i2 < s; i2 += 1) { + carry += shortArray[i2] + longArray[i2]; + sum[i2] = carry & DIGIT_MASK; + carry = carry >> DIGIT_BITS; + } + for (i2 = s; i2 < longArray.length; i2 += 1) { + carry += longArray[i2]; + sum[i2] = carry & DIGIT_MASK; + carry = carry >> DIGIT_BITS; + } + sum.length = longArray.length; + if (carry !== 0) { + sum[i2] = carry & DIGIT_MASK; + } + return carry; + } + function subtract(minuend, subtrahend, difference) { + var s = subtrahend.length; + if (minuend.length < subtrahend.length) { + s = mswIndex(subtrahend) + 1; + if (minuend.length < s) { + throw new Error("Subtrahend is longer than minuend, not supported."); + } + } + var i2, carry = 0; + for (i2 = 0; i2 < s; i2 += 1) { + carry += minuend[i2] - subtrahend[i2]; + difference[i2] = carry & DIGIT_MASK; + carry = carry >> DIGIT_BITS; + } + while (i2 < minuend.length) { + carry += minuend[i2]; + difference[i2++] = carry & DIGIT_MASK; + carry = carry >> DIGIT_BITS; + } + return carry; + } + function multiply(a, b, p) { + b = typeof b === "number" ? [b] : b; + var i2, j, k, l, c, t1, t2, alen = a.length, blen = b.length, bi; + for (i2 = 0; i2 < alen + blen; i2 += 1) { + p[i2] = 0; + } + i2 = 0; + l = 0; + var maxRounds = 31; + var ks = 0; + while (i2 < blen) { + l = Math.min(l + maxRounds, blen); + for (; i2 < l; i2++) { + bi = b[i2]; + for (j = 0; j < alen; j++) { + p[i2 + j] += a[j] * bi; + } + } + c = 0; + for (k = ks; k < i2 + alen; k++) { + t1 = p[k] + c; + t2 = t1 & DIGIT_MASK; + p[k] = t2; + c = (t1 - t2) * DIG_INV; + } + p[k] = c; + ks += maxRounds; + } + p.length = alen + blen; + return p; + } + function divRem(dividend, divisor, quotient, remainder, temp1, temp2) { + var m = mswIndex(dividend) + 1; + var n = mswIndex(divisor) + 1; + var qhat, rhat, carry, p, t, i2, j; + if (m < n) { + copyArray(dividend, 0, remainder, 0, dividend.length); + remainder.length = dividend.length; + normalizeDigitArray(remainder); + quotient[0] = 0; + quotient.length = 1; + return; + } else if (n === 0 || n === 1 && divisor[n - 1] === 0) { + throw new Error("Division by zero."); + } else if (n === 1) { + t = divisor[0]; + rhat = 0; + for (j = m - 1; j >= 0; j--) { + p = rhat * DIGIT_BASE + dividend[j]; + quotient[j] = p / t & DIGIT_MASK; + rhat = p - quotient[j] * t & DIGIT_MASK; + } + quotient.length = m; + normalizeDigitArray(quotient); + remainder[0] = rhat; + remainder.length = 1; + return; + } + var s = DIGIT_BITS - 1 - bitScanForward(divisor[n - 1]); + var vn = temp1 || []; + vn.length = n; + shiftLeft(divisor, vn, s, n); + var un = temp2 || []; + un.length = m; + shiftLeft(dividend, un, s, m); + un[m] = un[m] || 0; + quotient.length = m - n + 1; + remainder.length = n; + for (j = m - n; j >= 0; j--) { + qhat = Math.floor((un[j + n] * DIGIT_BASE + un[j + n - 1]) / vn[n - 1]); + rhat = un[j + n] * DIGIT_BASE + un[j + n - 1] - qhat * vn[n - 1]; + while (true) { + if (qhat >= DIGIT_BASE || qhat * vn[n - 2] > rhat * DIGIT_BASE + un[j + n - 2]) { + qhat = qhat - 1; + rhat = rhat + vn[n - 1]; + if (rhat < DIGIT_BASE) { + continue; + } + } + break; + } + carry = 0; + for (i2 = 0; i2 < n; i2++) { + p = qhat * vn[i2]; + t = un[i2 + j] - carry - (p & DIGIT_MASK); + un[i2 + j] = t & DIGIT_MASK; + carry = Math.floor(p / DIGIT_BASE) - Math.floor(t / DIGIT_BASE); + } + t = un[j + n] - carry; + un[j + n] = t & DIGIT_MASK; + quotient[j] = qhat & DIGIT_MASK; + if (t < 0) { + quotient[j] = quotient[j] - 1; + carry = 0; + for (i2 = 0; i2 < n; i2++) { + t = un[i2 + j] + vn[i2] + carry; + un[i2 + j] = t & DIGIT_MASK; + carry = t >> DIGIT_BITS; + } + un[j + n] = un[j + n] + carry & DIGIT_MASK; + } + } + for (i2 = 0; i2 < n; i2++) { + remainder[i2] = (un[i2] >>> s | un[i2 + 1] << DIGIT_BITS - s) & DIGIT_MASK; + } + normalizeDigitArray(quotient); + normalizeDigitArray(remainder); + } + function reduce(number, modulus, remainder, temp1, temp2) { + var quotient = []; + divRem(number, modulus, quotient, remainder, temp1, temp2); + return remainder; + } + function modMul(multiplicand, multiplier, modulus, product, temp1, temp2) { + var quotient = []; + multiply(multiplicand, multiplier, quotient); + divRem(quotient, modulus, quotient, product, temp1, temp2); + return product; + } + function eea(a, b, upp, vpp, rpp) { + var rp; + if (isZero(a)) { + copyArray(b, 0, rpp, 0, b.length); + rpp.length = b.length; + return 0; + } else if (isZero(b)) { + copyArray(a, 0, rpp, 0, a.length); + rpp.length = a.length; + return 0; + } else if (compareDigits(a, b) < 0) { + rp = a.slice(0); + copyArray(b, 0, rpp, 0, b.length); + rpp.length = b.length; + } else { + rp = b.slice(0); + copyArray(a, 0, rpp, 0, a.length); + rpp.length = a.length; + } + normalizeDigitArray(rpp); + normalizeDigitArray(rp); + var q = new Array(rpp.length); + var r = new Array(rpp.length); + var v = new Array(rpp.length); + var vppPresent = vpp !== void 0; + var vp; + if (vppPresent) { + vp = new Array(rpp.length); + vp[0] = 1; + vp.length = 1; + vpp[0] = 0; + vpp.length = 1; + } + var up; + var u = new Array(rpp.length); + var uppPresent = upp !== void 0; + if (uppPresent) { + up = new Array(rpp.length); + up[0] = 0; + up.length = 1; + upp[0] = 1; + upp.length = 1; + } + var k = -1; + var upp_out = upp; + var vpp_out = vpp; + var rpp_out = rpp; + var save; + while (!isZero(rp)) { + divRem(rpp, rp, q, r, u, v); + if (uppPresent) { + multiply(q, up, u); + add(u, upp, u); + normalizeDigitArray(u); + save = upp; + upp = up; + up = u; + u = save; + } + if (vppPresent) { + multiply(q, vp, v); + add(v, vpp, v); + normalizeDigitArray(v); + save = vpp; + vpp = vp; + vp = v; + v = save; + } + save = rpp; + rpp = rp; + rp = r; + r = save; + k++; + } + if (uppPresent) { + copyArray(upp, 0, upp_out, 0, upp.length); + upp_out.length = upp.length; + } + if (vppPresent) { + copyArray(vpp, 0, vpp_out, 0, vpp.length); + vpp_out.length = vpp.length; + } + copyArray(rpp, 0, rpp_out, 0, rpp.length); + rpp_out.length = rpp.length; + return k; + } + function gcd(a, b, output) { + var aa = a; + var bb = b; + if (compareDigits(a, b) > 0) { + aa = b; + bb = a; + } + eea(aa, bb, void 0, void 0, output); + return normalizeDigitArray(output); + } + function modInv(a, n, aInv, pad) { + var upp = new Array(n.length); + var vpp = new Array(n.length); + var rpp = new Array(n.length); + var k = eea(a, n, vpp, upp, rpp); + aInv = aInv || []; + if (compareDigits(rpp, One) !== 0) { + aInv[0] = NaN; + aInv.length = 1; + } else { + if ((k & 1) === 1) { + subtract(n, upp, aInv); + } else { + copyArray(upp, 0, aInv, 0, upp.length); + aInv.length = upp.length; + } + if (pad) { + normalizeDigitArray(aInv, n.length, true); + } else { + normalizeDigitArray(aInv); + } + } + return aInv; + } + function modInvCT(a, n, aInv, pad) { + var nMinus2 = []; + aInv = aInv || []; + subtract(n, [2], nMinus2); + modExp(a, nMinus2, n, aInv); + normalizeDigitArray(aInv); + return aInv; + } + function modExp(base, exponent, modulus, result) { + result = result || []; + if (compareDigits(exponent, Zero) === 0) { + result[0] = 1; + } else if (compareDigits(exponent, One) === 0) { + copyArray(base, 0, result, 0, base.length); + result.length = base.length; + } else { + var montmul = new MontgomeryMultiplier(modulus); + normalizeDigitArray(base, montmul.s, true); + montmul.modExp(base, exponent, result); + result.length = modulus.length; + } + return result; + } + function MontgomeryMultiplier(modulus, context) { + function computeM0Prime(m02) { + var m0Pr = 1; + var a = 2; + var b = 3; + var c = b & m02; + for (var i2 = 2; i2 <= DIGIT_BITS; i2 += 1) { + if (a < c) { + m0Pr += a; + } + a = a << 1; + b = b << 1 | 1; + c = m02 * m0Pr & b; + } + var result = (~m0Pr & DIGIT_MASK) + 1; + return result; + } + function montgomeryReduction(t, m2, result) { + var m02 = m2[0]; + var mPrime2 = computeM0Prime(m02); + var n = m2.length; + var A = t.slice(0); + var ui = []; + var uimbi = []; + var uim = []; + var bi = [1]; + for (var i2 = 0; i2 < n; i2++) { + ui = A[i2] * mPrime2 % DIGIT_BASE; + multiply(m2, [ui], uim); + multiply(uim, bi, uimbi); + add(A, uimbi, A); + bi.unshift(0); + } + A = A.slice(n); + for (i2 = 0; i2 < A.length; i2++) { + result[i2] = A[i2]; + } + } + function montgomeryMultiply(multiplicand, multiplier, result, ctx) { + ctx = ctx || this; + var m2 = ctx.m, s2 = m2.length, mPrime2 = ctx.mPrime, m02 = ctx.m0, rightI, r0, q, i2 = 0, j, jm1, t1, t2, carry, rounds = 0; + var temp = createArray(s2 + 2); + while (i2 < s2) { + rounds = Math.min(s2, rounds + 16); + for (; i2 < rounds; ) { + rightI = ~~multiplier[i2]; + r0 = temp[0] + multiplicand[0] * rightI; + q = (r0 & DIGIT_MASK) * mPrime2 & DIGIT_MASK; + temp[1] += (m02 * q + r0) * DIG_INV | 0; + for (j = 1, jm1 = 0; j < s2; jm1 = j, j += 1) { + temp[jm1] = temp[j] + m2[j] * q + multiplicand[j] * rightI; + } + temp[jm1] = temp[j]; + temp[j] = 0; + i2++; + } + carry = 0; + for (j = 0; j < s2; j++) { + t1 = temp[j] + carry; + t2 = t1 & DIGIT_MASK; + temp[j] = t2; + carry = (t1 - t2) * DIG_INV; + } + temp[j] = carry; + } + for (i2 = 0; i2 < s2; i2 += 1) { + result[i2] = temp[i2]; + } + result.length = s2; + var needSubtract = +(cryptoMath.compareDigits(temp, m2) > 0); + cryptoMath.subtract(result, m2, ctx.temp2); + ctSetArray(needSubtract, result, ctx.temp2); + return; + } + function convertToMontgomeryForm(digits) { + if (digits.length < this.s) { + digits.length = this.s; + for (var i2 = 0; i2 < this.s; i2++) { + digits[i2] = isNaN(digits[i2]) ? 0 : digits[i2]; + } + } + var result = createArray(digits.length); + this.montgomeryMultiply(digits, this.rSquaredModm, result); + for (i2 = 0; i2 < this.s; i2 += 1) { + digits[i2] = result[i2]; + } + } + function convertToStandardForm(digits) { + this.montgomeryMultiply(digits, this.one, this.temp1); + for (var i2 = 0; i2 < this.s; i2 += 1) { + digits[i2] = this.temp1[i2]; + } + } + function optimalWindowSize(length) { + var i2 = 2, t1, t0, bits = length * DIGIT_BITS; + t0 = 4 + Math.ceil(bits / 2) * 3 + 1; + do { + i2++; + t1 = t0; + t0 = Math.pow(2, i2) + Math.ceil(bits / i2) * (i2 + 1) + 1; + } while (t0 < t1); + return i2 - 1; + } + function modExp2(base, exponent, result, skipSideChannel) { + skipSideChannel = !!skipSideChannel; + var windowBits = optimalWindowSize(exponent.length); + var i2, j, expBits = fixedWindowRecode2(exponent, windowBits).reverse(), partialResult = this.rModM.slice(0), baseTableLen = Math.pow(2, windowBits), bt = baseTable; + bt.length = baseTableLen; + bt[0] = this.rModM; + for (i2 = 1; i2 < baseTableLen; i2++) { + bt[i2] = []; + multiply(bt[i2 - 1], base, bt[i2]); + this.reduce(bt[i2]); + } + var tableVal = []; + var exp; + for (i2 = 0; i2 < expBits.length; i2++) { + for (j = 0; j < windowBits; j++) { + this.montgomeryMultiply(partialResult, partialResult, partialResult); + } + exp = expBits[i2]; + skipSideChannel ? tableVal = bt[exp] : getTableEntry(bt, exp, tableVal); + this.montgomeryMultiply(partialResult, tableVal, partialResult); + } + this.montgomeryMultiply(partialResult, this.one, result); + return result; + } + function getTableEntry(bt, exp, tableVal) { + var z, t, mask, tableEntry, k; + for (z = 0; z < bt[0].length; z++) { + tableVal[z] = 0; + } + for (t = 0; t < bt.length; t++) { + tableEntry = bt[t]; + mask = -(exp === t); + for (k = 0; k < tableEntry.length; k++) { + tableVal[k] = tableVal[k] | tableEntry[k] & mask; + } + } + } + function ctSetArray(condition, a, b) { + var bMask = -condition; + var aMask = ~bMask; + for (var i2 = 0; i2 < a.length; i2++) { + a[i2] = a[i2] & aMask | b[i2] & bMask; + } + } + function reduce2(x, result) { + var k = this.m.length, q1, q2, q3, r1, r2, i2, needSubtract, temp = []; + result = result || x; + q1 = x.slice(k - 1); + q2 = []; + multiply(q1, this.mu, q2); + q3 = q2.slice(k + 1); + r1 = x.slice(0, k + 1); + r2 = []; + multiply(q3, m, r2); + r2 = r2.slice(0, k + 1); + r1[k + 1] = compareDigits(r1, r2) >>> 31; + for (i2 = 0; i2 < result.length; i2++) { + result[i2] = 0; + } + subtract(r1, r2, result); + needSubtract = +(compareDigits(result, m) > 0); + cryptoMath.subtract(result, m, temp); + ctSetArray(needSubtract, result, temp); + normalizeDigitArray(result); + return; + } + function computeContext(modulus2) { + var s2 = modulus2.length; + var m02 = modulus2[0]; + var ctx = { + m: modulus2, + mPrime: computeM0Prime(m02), + m0: m02, + temp1: createArray(2 * s2 + 1), + temp2: createArray(2 * s2 + 1) + }; + var R = createArray(modulus2.length * 2); + R[R.length] = 1; + ctx.mu = []; + divRem(R, modulus2, ctx.mu, []); + var quotient = createArray(2 * s2 + 1); + var rRemainder = createArray(s2 + 1); + var temp12 = createArray(2 * s2 + 1); + var temp22 = createArray(2 * s2 + 1); + var rDigits = rRemainder; + rDigits[s2] = 1; + divRem(rDigits, modulus2, quotient, rRemainder, temp12, temp22); + ctx.rModM = normalizeDigitArray(rRemainder, s2, true); + var rSquaredModm2 = createArray(2 * s2 + 1); + var rSquaredDigits = rSquaredModm2; + rSquaredDigits[s2 * 2] = 1; + divRem(rSquaredDigits, modulus2, quotient, rSquaredModm2, temp12, temp22); + ctx.rSquaredModm = normalizeDigitArray(rSquaredModm2, s2, true); + ctx.rCubedModm = createArray(s2); + montgomeryMultiply(rSquaredModm2, rSquaredModm2, ctx.rCubedModm, ctx); + return ctx; + } + context = context || computeContext(modulus); + var m = context.m; + var mu = context.mu; + var m0 = context.m0; + var s = m.length; + var zeros = createArray(s + 1); + var one = zeros.slice(0, s); + one[0] = 1; + var mPrime = context.mPrime; + var rModM = context.rModM; + var rSquaredModm = context.rSquaredModm; + var rCubedModm = context.rCubedModm; + var temp1 = createArray(2 * s + 1); + var temp2 = createArray(2 * s + 1); + var baseTable = new Array(4); + baseTable[0] = rModM; + baseTable[1] = new Array(s); + baseTable[2] = new Array(s); + baseTable[3] = new Array(s); + return { + m, + m0, + mPrime, + mu, + rSquaredModm, + s, + rModM, + rCubedModm, + one, + temp1, + temp2, + convertToMontgomeryForm, + convertToStandardForm, + montgomeryMultiply, + modExp: modExp2, + reduce: reduce2, + ctx: context + }; + } + function IntegerGroup(modulusBytes) { + var m_modulus = bytesToDigits(modulusBytes); + var m_digitWidth = m_modulus.length; + var m_zero = intToDigits(0, m_digitWidth); + var m_one = intToDigits(1, m_digitWidth); + var temp0 = createArray(m_digitWidth); + var temp1 = createArray(m_digitWidth); + var montmul = new MontgomeryMultiplier(m_modulus); + function createElementFromBytes(bytes) { + var digits = bytesToDigits(bytes); + if (cryptoMath.compareDigits(digits, this.m_modulus) >= 0) { + throw new Error("The number provided is not an element of this group"); + } + normalizeDigitArray(digits, this.m_digitWidth, true); + return integerGroupElement(digits, this); + } + function createElementFromInteger(integer) { + var digits = intToDigits(integer, this.m_digitWidth); + return integerGroupElement(digits, this); + } + function createElementFromDigits(digits) { + cryptoMath.normalizeDigitArray(digits, this.m_digitWidth, true); + return integerGroupElement(digits, this); + } + function equals(otherGroup) { + return compareDigits(this.m_modulus, otherGroup.m_modulus) === 0; + } + function add2(addend1, addend2, sum) { + var i2; + var s = this.m_digitWidth; + var result = sum.m_digits; + cryptoMath.add(addend1.m_digits, addend2.m_digits, result); + var mask = (compareDigits(result, this.m_modulus) >>> 31) - 1 & DIGIT_MASK; + var carry = 0; + for (i2 = 0; i2 < s; i2 += 1) { + carry = result[i2] - (this.m_modulus[i2] & mask) + carry; + result[i2] = carry & DIGIT_MASK; + carry = carry >> DIGIT_BITS; + } + result.length = s; + } + function subtract2(leftElement, rightElement, outputElement) { + var i2, s = this.m_digitWidth; + var result = outputElement.m_digits; + var carry = cryptoMath.subtract(leftElement.m_digits, rightElement.m_digits, outputElement.m_digits); + if (carry === -1) { + carry = 0; + for (i2 = 0; i2 < s; i2 += 1) { + carry += result[i2] + this.m_modulus[i2]; + result[i2] = carry & DIGIT_MASK; + carry = carry >> DIGIT_BITS; + } + } + } + function inverse(element, outputElement) { + cryptoMath.modInv(element.m_digits, this.m_modulus, outputElement.m_digits); + } + function multiply2(multiplicand, multiplier, product) { + return cryptoMath.modMul( + multiplicand.m_digits, + multiplier.m_digits, + this.m_modulus, + product.m_digits, + temp0, + temp1 + ); + } + function modexp(valueElement, exponent, outputElement) { + outputElement = outputElement || integerGroupElement([], this); + if (compareDigits(exponent, m_zero) === 0) { + outputElement.m_digits = intToDigits(1, this.m_digitWidth); + } else if (compareDigits(exponent, m_one) === 0) { + for (var i2 = 0; i2 < valueElement.m_digits.length; i2++) { + outputElement.m_digits[i2] = valueElement.m_digits[i2]; + } + outputElement.m_digits.length = valueElement.m_digits.length; + } else { + this.montmul.modExp(valueElement.m_digits, exponent, outputElement.m_digits); + outputElement.m_digits.length = this.montmul.s; + } + return outputElement; + } + function integerGroupElement(digits, group) { + return { + m_digits: digits, + m_group: group, + equals: function(element) { + return compareDigits(this.m_digits, element.m_digits) === 0 && this.m_group.equals(this.m_group, element.m_group); + } + }; + } + return { + m_modulus, + m_digitWidth, + montmul, + createElementFromInteger, + createElementFromBytes, + createElementFromDigits, + equals, + add: add2, + subtract: subtract2, + multiply: multiply2, + inverse, + modexp + }; + } + return { + DIGIT_BITS, + DIGIT_NUM_BYTES, + DIGIT_MASK, + DIGIT_BASE, + DIGIT_MAX, + Zero, + One, + normalizeDigitArray, + bytesToDigits, + stringToDigits, + digitsToString, + intToDigits, + digitsToBytes, + isZero, + isEven, + shiftRight, + shiftLeft, + compareDigits, + bitLength: highestSetBit, + fixedWindowRecode, + IntegerGroup, + add, + subtract, + multiply, + divRem, + reduce, + modInv, + modInvCT, + modExp, + modMul, + MontgomeryMultiplier, + gcd, + sequenceEqual, + swapEndianness: function(bytes) { + return bytes.reverse(); + }, + computeBitArray + }; + } + var cryptoMath = cryptoMath || msrcryptoMath(); + function MsrcryptoECC() { + var btd = cryptoMath.bytesToDigits; + function createArray(parameter) { + var i2, array = null; + if (!arguments.length || typeof arguments[0] === "number") { + array = []; + for (i2 = 0; i2 < parameter; i2 += 1) { + array[i2] = 0; + } + } else if (typeof arguments[0] === "object") { + array = []; + for (i2 = 0; i2 < parameter.length; i2 += 1) { + array[i2] = parameter[i2]; + } + } + return array; + } + var EllipticCurveFp = function(p1, a1, b1, order, gx, gy) { + var fieldStorageBitLength = p1.length; + var generator = EllipticCurvePointFp(this, false, gx, gy, null, false); + return { + p: p1, + a: a1, + b: b1, + order, + generator, + allocatePointStorage: function() { + return EllipticCurvePointFp( + this, + false, + cryptoMath.intToDigits(0, fieldStorageBitLength), + cryptoMath.intToDigits(0, fieldStorageBitLength) + ); + }, + createPointAtInfinity: function() { + return EllipticCurvePointFp( + this, + true, + cryptoMath.intToDigits(0, fieldStorageBitLength), + cryptoMath.intToDigits(0, fieldStorageBitLength) + ); + } + }; + }; + var createWeierstrassCurve = function(curveData) { + var newCurve = new EllipticCurveFp( + btd(curveData.p), + btd(curveData.a), + btd(curveData.b), + btd(curveData.order), + btd(curveData.gx), + btd(curveData.gy) + ); + newCurve.type = curveData.type; + newCurve.name = curveData.name; + newCurve.generator.curve = newCurve; + return newCurve; + }; + var createTedCurve = function(curveData) { + var newCurve = new EllipticCurveFp( + btd(curveData.p), + btd(curveData.a), + btd(curveData.d), + btd(curveData.order), + btd(curveData.gx), + btd(curveData.gy) + ); + newCurve.type = curveData.type; + if (newCurve.type === 1) { + newCurve.d = newCurve.b.slice(); + delete newCurve.b; + } + newCurve.rbits = curveData.info[2]; + newCurve.name = curveData.name; + newCurve.generator.curve = newCurve; + return newCurve; + }; + var EllipticCurvePointFp = function(curve, isInfinity, x, y, z, isInMontgomeryForm) { + var returnObj; + if (typeof z === "undefined") { + z = null; + } + if (typeof isInMontgomeryForm === "undefined") { + isInMontgomeryForm = false; + } + function equals(ellipticCurvePointFp) { + if (!ellipticCurvePointFp) { + return false; + } + if (returnObj.isInfinity && ellipticCurvePointFp.isInfinity) { + return true; + } + if (returnObj.z === null && ellipticCurvePointFp.z !== null) { + return false; + } + if (returnObj.z !== null && ellipticCurvePointFp.z === null) { + return false; + } + if (returnObj.z === null) { + return cryptoMath.compareDigits(returnObj.x, ellipticCurvePointFp.x) === 0 && cryptoMath.compareDigits(returnObj.y, ellipticCurvePointFp.y) === 0 && returnObj.isInMontgomeryForm === ellipticCurvePointFp.isInMontgomeryForm; + } + return cryptoMath.compareDigits(returnObj.x, ellipticCurvePointFp.x) === 0 && cryptoMath.compareDigits(returnObj.y, ellipticCurvePointFp.y) === 0 && cryptoMath.compareDigits(returnObj.z, ellipticCurvePointFp.z) === 0 && returnObj.isInMontgomeryForm === ellipticCurvePointFp.isInMontgomeryForm; + } + function copyTo(source, destination) { + destination.curve = source.curve; + destination.x = source.x.slice(); + destination.y = source.y.slice(); + if (source.z !== null) { + destination.z = source.z.slice(); + } else { + destination.z = null; + } + setterSupport || (destination.isAffine = source.isAffine); + destination.isInMontgomeryForm = source.isInMontgomeryForm; + destination.isInfinity = source.isInfinity; + if (!destination.equals(source)) { + throw new Error("Instances should be equal."); + } + } + function clone() { + var clonePoint = EllipticCurvePointFp( + returnObj.curve, + returnObj.isInfinity, + createArray(returnObj.x), + createArray(returnObj.y), + returnObj.z ? createArray(returnObj.z) : null, + returnObj.isInMontgomeryForm + ); + returnObj.ta && (clonePoint.ta = createArray(returnObj.ta)); + returnObj.tb && (clonePoint.tb = createArray(returnObj.tb)); + return clonePoint; + } + returnObj = { + equals: function(ellipticCurvePointFp) { + return equals(ellipticCurvePointFp); + }, + copy: function(destination) { + copyTo(this, destination); + return; + }, + clone: function() { + return clone(); + } + }; + createProperty( + returnObj, + "curve", + curve, + function() { + return curve; + }, + function(val) { + curve = val; + } + ); + createProperty( + returnObj, + "x", + x, + function() { + return x; + }, + function(val) { + x = val; + } + ); + createProperty( + returnObj, + "y", + y, + function() { + return y; + }, + function(val) { + y = val; + } + ); + createProperty( + returnObj, + "z", + z, + function() { + return z; + }, + function(val) { + z = val; + } + ); + createProperty( + returnObj, + "isInMontgomeryForm", + isInMontgomeryForm, + function() { + return isInMontgomeryForm; + }, + function(val) { + isInMontgomeryForm = val; + } + ); + createProperty( + returnObj, + "isInfinity", + isInfinity, + function() { + return isInfinity; + }, + function(val) { + isInfinity = val; + } + ); + createProperty(returnObj, "isAffine", z === null, function() { + return z === null; + }); + return returnObj; + }; + var EllipticCurveOperatorFp = function(curve) { + var m_curve = curve; + var tedCurve = curve.type === 1; + var fieldElementWidth = curve.p.length; + var montgomeryMultiplier = cryptoMath.MontgomeryMultiplier(curve.p); + var montgomerizedA = curve.a.slice(); + montgomeryMultiplier.convertToMontgomeryForm(montgomerizedA); + var aequalsZero = cryptoMath.isZero(curve.a); + var one = cryptoMath.One; + var onemontgomery = createArray(fieldElementWidth); + onemontgomery[0] = 1; + montgomeryMultiplier.convertToMontgomeryForm(onemontgomery); + var group = cryptoMath.IntegerGroup(cryptoMath.digitsToBytes(montgomeryMultiplier.m), true); + var temp0 = createArray(fieldElementWidth); + var temp1 = createArray(fieldElementWidth); + var temp2 = createArray(fieldElementWidth); + var temp3 = createArray(fieldElementWidth); + var temp4 = createArray(fieldElementWidth); + var temp5 = createArray(fieldElementWidth); + var temp6 = createArray(fieldElementWidth); + var temp7 = createArray(fieldElementWidth); + var swap0 = createArray(fieldElementWidth); + var conversionTemp0 = createArray(fieldElementWidth); + var conversionTemp1 = createArray(fieldElementWidth); + var conversionTemp2 = createArray(fieldElementWidth); + function modSub(left, right, result) { + var resultElement = group.createElementFromInteger(0); + resultElement.m_digits = result; + group.subtract(group.createElementFromDigits(left), group.createElementFromDigits(right), resultElement); + } + function modAdd(left, right, result) { + var resultElement = group.createElementFromInteger(0); + resultElement.m_digits = result; + group.add(group.createElementFromDigits(left), group.createElementFromDigits(right), resultElement); + } + function modInv(number, result) { + cryptoMath.modInv(number, m_curve.p, result); + } + function modDivByTwo(dividend, result) { + var s = dividend.length; + var modulus = curve.p; + if ((dividend[0] & 1) === 1) { + var carry = 0; + for (var i2 = 0; i2 < s; i2 += 1) { + carry += dividend[i2] + modulus[i2]; + result[i2] = carry & cryptoMath.DIGIT_MASK; + carry = carry >>> cryptoMath.DIGIT_BITS; + } + carry = carry << cryptoMath.DIGIT_BITS - 1; + cryptoMath.shiftRight(result, result); + result[s - 1] |= carry; + } else { + cryptoMath.shiftRight(dividend, result); + } + } + function montgomeryMultiply(left, right, result) { + montgomeryMultiplier.montgomeryMultiply(left, right, result); + } + function montgomerySquare(left, result) { + montgomeryMultiplier.montgomeryMultiply(left, left, result); + } + function correctInversion(digits) { + var results = createArray(digits.length); + montgomeryMultiply(digits, montgomeryMultiplier.rCubedModm, results); + for (var i2 = 0; i2 < results.length; i2 += 1) { + digits[i2] = results[i2]; + } + } + function doubleAequalsNeg3(point, outputPoint) { + if (point.isInfinity) { + outputPoint.isInfinity = true; + return; + } + montgomerySquare(point.z, temp1); + montgomeryMultiply(point.z, point.y, temp4); + modAdd(point.x, temp1, temp2); + modSub(point.x, temp1, temp1); + outputPoint.z = temp4.slice(); + montgomeryMultiply(temp1, temp2, temp3); + modDivByTwo(temp3, temp2); + modAdd(temp3, temp2, temp1); + montgomerySquare(point.y, temp2); + montgomerySquare(temp1, temp4); + montgomeryMultiply(point.x, temp2, temp3); + modSub(temp4, temp3, temp4); + modSub(temp4, temp3, outputPoint.x); + modSub(temp3, outputPoint.x, temp4); + montgomerySquare(temp2, temp3); + montgomeryMultiply(temp1, temp4, temp2); + modSub(temp2, temp3, outputPoint.y); + outputPoint.isInfinity = false; + outputPoint.isInMontgomeryForm = true; + } + function doubleAequals0(point, outputPoint) { + if (point.isInfinity) { + outputPoint.isInfinity = true; + return; + } + montgomerySquare(point.y, temp3); + montgomerySquare(point.x, temp4); + modAdd(temp4, temp4, temp0); + modAdd(temp0, temp4, temp4); + montgomeryMultiply(point.x, temp3, temp5); + montgomerySquare(temp3, temp0); + modDivByTwo(temp4, temp1); + montgomerySquare(temp1, temp3); + montgomeryMultiply(point.y, point.z, swap0); + for (var i2 = 0; i2 < swap0.length; i2 += 1) { + outputPoint.z[i2] = swap0[i2]; + } + modSub(temp3, temp5, outputPoint.x); + modSub(outputPoint.x, temp5, outputPoint.x); + modSub(temp5, outputPoint.x, temp4); + montgomeryMultiply(temp1, temp4, temp2); + modSub(temp2, temp0, outputPoint.y); + outputPoint.isInfinity = false; + outputPoint.isInMontgomeryForm = true; + } + function generatePrecomputationTable(w, generatorPoint) { + var validationPoint = generatorPoint.clone(); + convertToStandardForm(validationPoint); + if (!validatePoint(validationPoint)) { + throw new Error("Invalid Parameter"); + } + var pointJac = generatorPoint.clone(); + convertToJacobianForm(pointJac); + var tablePos = [generatorPoint.clone()]; + var qJac = pointJac.clone(); + var px2 = pointJac.clone(); + double(pointJac, px2); + convertToAffineForm(px2); + var qAff; + for (var i2 = 1; i2 < Math.pow(2, w - 2); i2++) { + mixedAdd(qJac, px2, qJac); + qAff = qJac.clone(); + convertToAffineForm(qAff); + tablePos[i2] = qAff; + } + return tablePos; + } + function double(point, outputPoint) { + if (typeof point === "undefined") { + throw new Error("point undefined"); + } + if (typeof outputPoint === "undefined") { + throw new Error("outputPoint undefined"); + } + if (point.isAffine) { + throw new Error("Given point was in Affine form. Use convertToJacobian() first."); + } + if (!point.isInMontgomeryForm) { + throw new Error("Given point must be in Montgomery form. Use montgomeryize() first."); + } + if (aequalsZero) { + doubleAequals0(point, outputPoint); + } else { + doubleAequalsNeg3(point, outputPoint); + } + } + function mixedDoubleAdd(jacobianPoint, affinePoint, outputPoint) { + if (jacobianPoint.isInfinity) { + affinePoint.copy(outputPoint); + this.convertToJacobianForm(outputPoint); + return; + } + if (affinePoint.isInfinity) { + jacobianPoint.copy(outputPoint); + return; + } + montgomerySquare(jacobianPoint.z, temp5); + montgomeryMultiply(jacobianPoint.z, temp5, temp6); + montgomeryMultiply(affinePoint.x, temp5, temp4); + montgomeryMultiply(affinePoint.y, temp6, temp5); + modSub(temp4, jacobianPoint.x, temp1); + modSub(temp5, jacobianPoint.y, temp2); + if (cryptoMath.isZero(temp1)) { + if (cryptoMath.isZero(temp2)) { + double(jacobianPoint, outputPoint); + mixedAdd(outputPoint, affinePoint, outputPoint); + return; + } else { + outputPoint.x = jacobianPoint.x.slice(0); + outputPoint.y = jacobianPoint.y.slice(0); + outputPoint.z = jacobianPoint.z.slice(0); + return; + } + } + montgomerySquare(temp2, temp4); + montgomerySquare(temp1, temp6); + montgomeryMultiply(temp6, jacobianPoint.x, temp5); + montgomeryMultiply(temp1, temp6, temp0); + modSub(temp4, temp5, temp3); + modSub(temp3, temp5, temp3); + montgomeryMultiply(jacobianPoint.z, temp1, temp4); + modSub(temp3, temp5, temp3); + montgomeryMultiply(temp0, jacobianPoint.y, temp6); + modSub(temp3, temp0, temp3); + if (cryptoMath.isZero(temp3)) { + for (i = 0; i < outputPoint.x.length; i++) { + outputPoint.x[i] = 0; + outputPoint.y[i] = 0; + outputPoint.z[i] = 0; + } + outputPoint.y[0] = 1; + return; + } + modAdd(temp6, temp6, temp1); + montgomeryMultiply(temp4, temp3, outputPoint.z); + montgomeryMultiply(temp2, temp3, temp4); + montgomerySquare(temp3, temp0); + modAdd(temp1, temp4, temp1); + montgomeryMultiply(temp0, temp5, temp4); + montgomerySquare(temp1, temp7); + montgomeryMultiply(temp0, temp3, temp5); + modSub(temp7, temp4, outputPoint.x); + modSub(outputPoint.x, temp4, outputPoint.x); + modSub(outputPoint.x, temp5, outputPoint.x); + modSub(outputPoint.x, temp4, temp3); + montgomeryMultiply(temp5, temp6, temp0); + montgomeryMultiply(temp1, temp3, temp4); + modSub(temp4, temp0, outputPoint.y); + outputPoint.isInfinity = false; + outputPoint.isInMontgomeryForm = true; + } + function mixedAdd(jacobianPoint, affinePoint, outputPoint) { + if (jacobianPoint === null) { + throw new Error("jacobianPoint"); + } + if (affinePoint === null) { + throw new Error("affinePoint"); + } + if (outputPoint === null) { + throw new Error("outputPoint"); + } + if (jacobianPoint.curve !== affinePoint.curve || jacobianPoint.curve !== outputPoint.curve) { + throw new Error("All points must be from the same curve object."); + } + if (jacobianPoint.isAffine) { + throw new Error( + "Given jacobianPoint was in Affine form. Use ConvertToJacobian() before calling DoubleJacobianAddAffinePoints()." + ); + } + if (!affinePoint.isAffine) { + throw new Error( + "Given affinePoint was in Jacobian form. Use ConvertToAffine() before calling DoubleJacobianAddAffinePoints()." + ); + } + if (outputPoint.isAffine) { + throw new Error( + "Given jacobianPoint was in Jacobian form. Use ConvertToJacobian() before calling DoubleJacobianAddAffinePoints()." + ); + } + if (!jacobianPoint.isInMontgomeryForm) { + throw new Error("Jacobian point must be in Montgomery form"); + } + if (!affinePoint.isInMontgomeryForm) { + throw new Error("Affine point must be in Montgomery form"); + } + if (jacobianPoint.isInfinity) { + affinePoint.copy(outputPoint); + this.convertToJacobianForm(outputPoint); + return; + } + if (affinePoint.isInfinity) { + jacobianPoint.copy(outputPoint); + return; + } + montgomerySquare(jacobianPoint.z, temp1); + montgomeryMultiply(temp1, jacobianPoint.z, temp2); + montgomeryMultiply(temp1, affinePoint.x, temp3); + montgomeryMultiply(temp2, affinePoint.y, temp4); + modSub(temp3, jacobianPoint.x, temp1); + modSub(temp4, jacobianPoint.y, temp2); + var i2; + for (i2 = 0; i2 < temp1.length; i2 += 1) { + if (temp1[i2] !== 0) { + montgomeryMultiply(jacobianPoint.z, temp1, temp0); + for (var j = 0; j < fieldElementWidth; j += 1) { + outputPoint.z[j] = temp0[j]; + } + montgomerySquare(temp1, temp3); + montgomeryMultiply(temp3, temp1, temp4); + montgomeryMultiply(temp3, jacobianPoint.x, temp5); + modAdd(temp5, temp5, temp1); + montgomerySquare(temp2, outputPoint.x); + modSub(outputPoint.x, temp1, outputPoint.x); + modSub(outputPoint.x, temp4, outputPoint.x); + modSub(temp5, outputPoint.x, temp3); + montgomeryMultiply(temp2, temp3, temp5); + montgomeryMultiply(jacobianPoint.y, temp4, temp6); + modSub(temp5, temp6, outputPoint.y); + outputPoint.isInfinity = false; + outputPoint.isInMontgomeryForm = true; + return; + } + } + for (i2 = 0; i2 < temp2.length; i2 += 1) { + if (temp2[i2] !== 0) { + outputPoint.isInfinity = true; + outputPoint.isInMontgomeryForm = true; + return; + } + } + affinePoint.copy(outputPoint); + this.convertToJacobianForm(outputPoint); + this.double(outputPoint, outputPoint); + outputPoint.isInMontgomeryForm = true; + } + function scalarMultiply(k, point, outputPoint, multiplyBy4) { + if (point.isInfinity || cryptoMath.isZero(k)) { + outputPoint.isInfinity = true; + return; + } + if (cryptoMath.compareDigits(k, curve.order) >= 0) { + throw new Error("The scalar k must be in the range 1 <= k < order."); + } + k = k.slice(); + if (point.curve.type === 1) { + var pointIsEP = typeof point.ta !== "undefined"; + if (!pointIsEP) { + convertToExtendedProjective(point); + } + scalarMultiplyTed(k, point, outputPoint, multiplyBy4); + if (!pointIsEP) { + normalizeTed(point); + } + } else { + var pointIsMF = point.isInMontgomeryForm, outputIsMF = outputPoint.isInMontgomeryForm, outputIsAffine = outputPoint.isAffine; + if (!pointIsMF) { + convertToMontgomeryForm(point); + } + if (!outputIsMF) { + convertToMontgomeryForm(outputPoint); + } + scalarMultiplyW(k, point, outputPoint); + if (outputIsAffine) { + convertToAffineForm(outputPoint); + } + if (!pointIsMF) { + convertToStandardForm(point); + } + if (!outputIsMF) { + convertToStandardForm(outputPoint); + } + } + return; + } + function scalarMultiplyW(k, point, outputPoint) { + var validationPoint = point.clone(); + convertToStandardForm(validationPoint); + if (!validatePoint(validationPoint)) { + throw new Error("Invalid Parameters."); + } + var odd = k[0] & 1, tempk = []; + modSub(point.curve.order, k, tempk); + for (i2 = 0; i2 < k.length; i2++) { + k[i2] = odd - 1 & (k[i2] ^ tempk[i2]) ^ k[i2]; + } + var w = fieldElementWidth <= 8 ? 5 : 6; + var m = point.curve.p.length * cryptoMath.DIGIT_BITS; + var t = Math.ceil(m / (w - 1)); + var kDigits = cryptoMath.fixedWindowRecode(k, w, t); + var Tm = generatePrecomputationTable(w, point); + var position = Math.floor(Math.abs(kDigits[t]) - 1) / 2; + var Q = Tm[position].clone(); + convertToJacobianForm(Q); + for (var i2 = t - 1; i2 >= 0; i2--) { + for (var j = 0; j < w - 2; j++) { + double(Q, Q); + } + position = Math.floor((Math.abs(kDigits[i2]) - 1) / 2); + var L = tableLookupW(Tm, position); + modSub(L.curve.p, L.y, tempk); + var mask = -(kDigits[i2] >>> 31); + for (var n = 0; n < L.y.length; n++) { + L.y[n] = L.y[n] & ~mask | tempk[n] & mask; + } + mixedDoubleAdd(Q, L, Q); + } + modSub(point.curve.p, Q.y, tempk); + for (i2 = 0; i2 < Q.y.length; i2++) { + Q.y[i2] = odd - 1 & (Q.y[i2] ^ tempk[i2]) ^ Q.y[i2]; + } + Q.copy(outputPoint); + return; + } + function tableLookupW(table, index) { + var mask, L; + for (var i2 = 0; i2 < table.length; i2++) { + mask = +(i2 === index); + L = [L, table[i2].clone()][mask]; + } + return L; + } + function tableLookupW0(table, index) { + var pos = (index + 1) % table.length; + for (var i2 = 0; i2 < table.length; i2++) { + var L = table[pos].clone(); + pos = (pos + 1) % table.length; + } + return L; + } + function negate(point, outputPoint) { + if (point !== outputPoint) { + point.copy(outputPoint); + } + modSub(point.curve.p, point.y, outputPoint.y); + } + function convertToMontgomeryForm(point) { + if (point.isInMontgomeryForm) { + throw new Error("The given point is already in Montgomery form."); + } + if (!point.isInfinity) { + montgomeryMultiplier.convertToMontgomeryForm(point.x); + montgomeryMultiplier.convertToMontgomeryForm(point.y); + if (point.z !== null) { + montgomeryMultiplier.convertToMontgomeryForm(point.z); + } + if (typeof point.ta !== "undefined") { + montgomeryMultiplier.convertToMontgomeryForm(point.ta); + montgomeryMultiplier.convertToMontgomeryForm(point.tb); + } + } + point.isInMontgomeryForm = true; + } + function convertToStandardForm(point) { + if (!point.isInMontgomeryForm) { + throw new Error("The given point is not in montgomery form."); + } + if (!point.isInfinity) { + montgomeryMultiplier.convertToStandardForm(point.x); + montgomeryMultiplier.convertToStandardForm(point.y); + if (point.z !== null) { + montgomeryMultiplier.convertToStandardForm(point.z); + } + if (typeof point.ta !== "undefined") { + montgomeryMultiplier.convertToStandardForm(point.ta); + montgomeryMultiplier.convertToStandardForm(point.tb); + } + } + point.isInMontgomeryForm = false; + } + function convertToAffineForm(point) { + if (point.isInfinity) { + point.z = null; + setterSupport || (point.isAffine = true); + return; + } + cryptoMath.modInv(point.z, curve.p, conversionTemp2, true); + if (point.isInMontgomeryForm) { + montgomeryMultiply(conversionTemp2, montgomeryMultiplier.rCubedModm, conversionTemp1); + var swap = conversionTemp2; + conversionTemp2 = conversionTemp1; + conversionTemp1 = swap; + } + montgomerySquare(conversionTemp2, conversionTemp0); + montgomeryMultiply(point.x, conversionTemp0, conversionTemp1); + for (var i2 = 0; i2 < fieldElementWidth; i2 += 1) { + point.x[i2] = conversionTemp1[i2]; + } + montgomeryMultiply(point.y, conversionTemp0, conversionTemp1); + montgomeryMultiply(conversionTemp1, conversionTemp2, point.y); + point.z = null; + delete point.ta; + delete point.tb; + setterSupport || (point.isAffine = true); + } + function convertToJacobianForm(point) { + if (!point.isAffine) { + throw new Error("The given point is not in Affine form."); + } + setterSupport || (point.isAffine = false); + var clonedDigits, i2, zOne = point.isInMontgomeryForm ? onemontgomery : one; + clonedDigits = createArray(zOne.length); + for (i2 = 0; i2 < zOne.length; i2 += 1) { + clonedDigits[i2] = zOne[i2]; + } + point.z = clonedDigits; + return; + } + function validatePoint(point) { + if (point.isInfinity) { + return false; + } + cryptoMath.modMul(point.y, point.y, point.curve.p, temp1); + cryptoMath.modMul(point.x, point.x, point.curve.p, temp2); + cryptoMath.modMul(point.x, temp2, point.curve.p, temp3); + modAdd(temp3, point.curve.b, temp2); + cryptoMath.modMul(point.x, point.curve.a, point.curve.p, temp3); + modAdd(temp2, temp3, temp2); + modSub(temp1, temp2, temp1); + if (cryptoMath.isZero(temp1) === false) { + return false; + } + return true; + } + function validatePointTed(point) { + if (point.ta) { + point = point.clone(); + normalizeTed(point); + } + cryptoMath.modMul(point.y, point.y, point.curve.p, temp3); + cryptoMath.modMul(point.x, point.x, point.curve.p, temp2); + cryptoMath.add(temp2, temp3, temp1); + cryptoMath.reduce(temp4, point.curve.p, temp4); + cryptoMath.modMul(temp2, temp3, point.curve.p, temp4); + cryptoMath.modMul(point.curve.d, temp4, point.curve.p, temp3); + cryptoMath.add(temp3, [1], temp2); + cryptoMath.reduce(temp2, point.curve.p, temp2); + cryptoMath.subtract(temp1, temp2, temp1); + if (cryptoMath.isZero(temp1) === false) { + cryptoMath.reduce(temp1, point.curve.p, temp1); + if (cryptoMath.isZero(temp1) === false) { + return false; + } + } + return true; + } + function generatePrecomputationTableTed(npoints, point) { + var Q = point.clone(), P2 = Q.clone(), T = []; + T[0] = convert_R1_to_R2(point); + doubleTed(Q, Q); + P2 = convert_R1_to_R2(Q); + Q = point.clone(); + for (var i2 = 1; i2 < npoints; i2++) { + addTedExtended(P2, Q, Q); + T[i2] = convert_R1_to_R2(Q); + } + return T; + } + function convertToExtendedProjective(affinePoint) { + affinePoint.ta = affinePoint.x.slice(); + affinePoint.tb = affinePoint.y.slice(); + affinePoint.z = [1]; + } + function scalarMultiplyTed(k, point, outputPoint, multiplyBy4) { + if (!validatePointTed(point)) { + throw new Error("Invalid Parameter"); + } + var rbits = point.curve.rbits; + multiplyBy4 = typeof multiplyBy4 === "undefined" ? true : multiplyBy4; + var w = fieldElementWidth <= 8 ? 5 : 6; + var t = Math.floor((rbits + (w - 2)) / (w - 1)); + var i2, j; + k = k.slice(); + var T = point.clone(); + convertToExtendedProjective(T); + if (multiplyBy4) { + doubleTed(T, T); + doubleTed(T, T); + } + var precomputationTable = generatePrecomputationTableTed(1 << w - 2, T); + var odd = k[0] & 1, tempk = [], kisNeg; + modSub(point.curve.order, k, tempk); + for (i2 = 0; i2 < k.length; i2++) { + k[i2] = odd - 1 & (k[i2] ^ tempk[i2]) ^ k[i2]; + } + var kDigits = cryptoMath.fixedWindowRecode(k, w, t); + var position = Math.floor(Math.abs(kDigits[t]) - 1) / 2; + var R = precomputationTable[position]; + T.x = R.x.slice(); + T.y = R.y.slice(); + T.z = R.z.slice(); + for (i2 = t - 1; i2 >= 0; i2--) { + for (j = 0; j < w - 1; j++) { + doubleTed(T, T); + } + position = Math.floor((Math.abs(kDigits[i2]) - 1) / 2); + var L = tableLookupTed(precomputationTable, position); + var mask = -(kDigits[i2] >>> 31); + modSub(point.curve.p, L.x, tempk); + for (var m = 0; m < L.x.length; m++) { + L.x[m] = L.x[m] & ~mask | tempk[m] & mask; + } + modSub(point.curve.p, L.td, tempk); + for (m = 0; m < L.td.length; m++) { + L.td[m] = L.td[m] & ~mask | tempk[m] & mask; + } + addTedExtended(L, T, T); + } + modSub(point.curve.p, T.x, tempk); + for (i2 = 0; i2 < T.x.length; i2++) { + T.x[i2] = odd - 1 & (T.x[i2] ^ tempk[i2]) ^ T.x[i2]; + } + normalizeTed(T); + outputPoint.x = T.x.slice(); + outputPoint.y = T.y.slice(); + return; + } + function tableLookupTed(table, index) { + var pos = (index + 1) % table.length; + for (var i2 = 0; i2 < table.length; i2++) { + var L = { + x: table[pos].x.slice(), + y: table[pos].y.slice(), + z: table[pos].z.slice(), + td: table[pos].td.slice() + }; + pos = (pos + 1) % table.length; + } + return L; + } + function normalizeTed(point) { + cryptoMath.modInv(point.z, curve.p, conversionTemp2, true); + cryptoMath.modMul(point.x, conversionTemp2, curve.p, point.x); + cryptoMath.modMul(point.y, conversionTemp2, curve.p, point.y); + delete point.ta; + delete point.tb; + point.z = null; + return; + } + function doubleTed(point, outputPoint) { + if (typeof point.ta === "undefined") { + throw new Error("Point should be in Extended Projective form."); + } + cryptoMath.modMul(point.x, point.x, point.curve.p, temp0); + cryptoMath.modMul(point.y, point.y, point.curve.p, temp1); + cryptoMath.modMul(point.z, point.z, point.curve.p, point.ta); + modSub(temp1, temp0, outputPoint.tb); + modAdd(temp0, temp1, temp0); + modAdd(point.ta, point.ta, point.ta); + modAdd(point.y, point.y, point.y); + modSub(point.ta, temp0, temp1); + cryptoMath.modMul(point.x, point.y, point.curve.p, outputPoint.ta); + cryptoMath.modMul(temp0, outputPoint.tb, point.curve.p, outputPoint.y); + cryptoMath.modMul(temp1, outputPoint.ta, point.curve.p, outputPoint.x); + cryptoMath.modMul(temp0, temp1, point.curve.p, outputPoint.z); + return; + } + function addTed(point1, point2, outputPoint) { + var cm = cryptoMath; + if (typeof point1.ta === "undefined") { + throw new Error("Point1 should be in Extended Projective form."); + } + if (typeof point2.ta === "undefined") { + throw new Error("Point2 should be in Extended Projective form."); + } + var qq = convert_R1_to_R2(point1); + addTedExtended(qq, point2, outputPoint); + return; + } + function convert_R1_to_R2(point) { + var curve2 = point.curve, modulus = curve2.p, qq = { + x: point.x.slice(), + y: point.y.slice(), + z: point.z.slice(), + td: [], + curve: point.curve + }; + cryptoMath.modMul(point.ta, point.tb, modulus, conversionTemp0); + cryptoMath.modMul(conversionTemp0, curve2.d, modulus, qq.td); + return qq; + } + function addTedExtended(qq, point2, outputPoint) { + var cm = cryptoMath; + var modulus = point2.curve.p; + temp1 = []; + temp2 = []; + temp3 = []; + cm.modMul(point2.z, qq.z, modulus, temp3); + cm.modMul(point2.ta, point2.tb, modulus, temp1); + modAdd(point2.x, point2.y, point2.ta); + cm.modMul(temp1, qq.td, modulus, temp2); + modAdd(qq.x, qq.y, point2.tb); + modSub(temp3, temp2, temp1); + modAdd(temp3, temp2, temp3); + cm.modMul(point2.ta, point2.tb, modulus, temp2); + cm.modMul(point2.x, qq.x, modulus, point2.z); + cm.modMul(point2.y, qq.y, modulus, point2.x); + modSub(temp2, point2.z, temp2); + modSub(point2.x, point2.z, outputPoint.ta); + modSub(temp2, point2.x, outputPoint.tb); + cm.modMul(outputPoint.ta, temp3, modulus, outputPoint.y); + cm.modMul(outputPoint.tb, temp1, modulus, outputPoint.x); + cm.modMul(temp3, temp1, modulus, outputPoint.z); + return; + } + function convertTedToWeierstrass(tedPoint, wPoint) { + var a = tedPoint.curve.a.slice(), d = tedPoint.curve.d.slice(), p = tedPoint.curve.p, modMul = cryptoMath.modMul, modInv2 = cryptoMath.modInv; + temp1 = [5]; + modMul(a, temp1, p, temp2); + modSub(temp2, d, temp2); + modMul(d, temp1, p, temp3); + modSub(a, temp3, temp1); + modMul(tedPoint.y, temp1, p, temp3); + modAdd(temp3, temp2, temp2); + temp1 = [1]; + modSub(temp1, tedPoint.y, temp3); + temp1 = [12]; + modMul(temp1, temp3, p, temp4); + modInv2(temp4, p, temp4, true); + modMul(tedPoint.x, temp3, p, temp1); + modAdd(temp1, temp1, temp3); + modAdd(temp3, temp3, temp3); + modInv2(temp3, p, temp3, true); + modMul(temp4, temp2, p, wPoint.x); + temp1 = [1]; + modAdd(tedPoint.y, temp1, temp1); + modSub(a, d, temp2); + modMul(temp1, temp2, p, temp4); + modMul(temp4, temp3, p, wPoint.y); + return; + } + function convertWeierstrassToTed(wPoint, tedPoint) { + var a = tedPoint.curve.a.slice(), d = tedPoint.curve.d.slice(), p = tedPoint.curve.p, modMul = cryptoMath.modMul, modInv2 = cryptoMath.modInv; + modAdd(wPoint.x, wPoint.x, temp1); + modAdd(wPoint.x, temp1, temp1); + modAdd(temp1, temp1, temp1); + modSub(temp1, a, temp2); + modSub(temp2, d, temp2); + modAdd(wPoint.y, wPoint.y, temp3); + modAdd(wPoint.y, temp3, temp3); + modAdd(temp3, temp3, temp3); + modInv2(temp3, p, temp3, true); + modMul(temp2, temp3, p, tedPoint.x); + modAdd(temp1, temp1, temp1); + modAdd(temp1, d, temp2); + modAdd(temp1, a, temp1); + modAdd(a, a, temp3); + modSub(temp2, temp3, temp2); + modSub(temp2, temp3, temp2); + modSub(temp2, a, temp2); + modAdd(d, d, temp3); + modSub(temp1, temp3, temp1); + modSub(temp1, temp3, temp1); + modSub(temp1, d, temp1); + modInv2(temp1, p, temp1, true); + modMul(temp1, temp2, p, tedPoint.y); + return; + } + var methods = { + convertToMontgomeryForm, + convertToStandardForm, + convertToAffineForm, + convertToJacobianForm, + generatePrecomputationTable: function(w, generatorPoint) { + return generatePrecomputationTable(w, generatorPoint); + } + }; + if (tedCurve) { + methods.double = doubleTed; + methods.add = addTed; + methods.scalarMultiply = scalarMultiply; + methods.normalize = normalizeTed; + methods.convertToExtendedProjective = convertToExtendedProjective; + methods.convertTedToWeierstrass = convertTedToWeierstrass; + methods.convertWeierstrassToTed = convertWeierstrassToTed; + methods.validatePoint = validatePointTed; + methods.generatePrecomputationTable = function(w, generatorPoint) { + return generatePrecomputationTableTed(w, generatorPoint); + }; + } else { + methods.double = double; + methods.mixedDoubleAdd = mixedDoubleAdd; + methods.mixedAdd = mixedAdd; + methods.scalarMultiply = scalarMultiply; + methods.negate = negate; + methods.validatePoint = validatePoint; + } + return methods; + }; + var sec1EncodingFp = function() { + return { + encodePoint: function(point) { + if (!point) { + throw new Error("point"); + } + if (!point.isAffine) { + throw new Error("Point must be in affine form."); + } + if (point.isInMontgomeryForm) { + throw new Error("Point must not be in Montgomery form."); + } + if (point.isInfinity) { + return createArray(1); + } else { + var xOctetString = cryptoMath.digitsToBytes(point.x); + var yOctetString = cryptoMath.digitsToBytes(point.y); + var pOctetString = cryptoMath.digitsToBytes(point.curve.p); + var mlen = pOctetString.length; + if (mlen < xOctetString.length || mlen < yOctetString.length) { + throw new Error("Point coordinate(s) are bigger than the field order."); + } + var output = createArray(2 * mlen + 1); + output[0] = 4; + var offset = mlen - xOctetString.length; + for (var i2 = 0; i2 < xOctetString.length; i2++) { + output[i2 + 1 + offset] = xOctetString[i2]; + } + offset = mlen - yOctetString.length; + for (i2 = 0; i2 < yOctetString.length; i2++) { + output[mlen + i2 + 1 + offset] = yOctetString[i2]; + } + return output; + } + }, + decodePoint: function(encoded, curve) { + if (encoded.length < 1) { + throw new Error("Byte array must have non-zero length"); + } + var pOctetString = cryptoMath.digitsToBytes(curve.p); + var mlen = pOctetString.length; + if (encoded[0] === 0 && encoded.length === 1) { + return curve.createPointAtInfinity(); + } else if (encoded[0] === 4 && encoded.length === 1 + 2 * mlen) { + var xbytes = createArray(mlen); + var ybytes = createArray(mlen); + for (var i2 = 0; i2 < mlen; i2++) { + xbytes[i2] = encoded[i2 + 1]; + ybytes[i2] = encoded[mlen + i2 + 1]; + } + var x = cryptoMath.bytesToDigits(xbytes); + var y = cryptoMath.bytesToDigits(ybytes); + return EllipticCurvePointFp(curve, false, x, y); + } else { + throw new Error("Unsupported encoding format"); + } + } + }; + }; + var ModularSquareRootSolver = function(modulus) { + var p = modulus; + var specialK = []; + if (typeof modulus === "undefined") { + throw new Error("modulus"); + } + if (cryptoMath.isEven(modulus)) { + throw new Error("Only odd moduli are supported"); + } + var mul = cryptoMath.MontgomeryMultiplier(p); + if (p[0] % 4 === 3) { + cryptoMath.add(p, cryptoMath.One, specialK); + cryptoMath.shiftRight(specialK, specialK, 2); + } else { + specialK = null; + } + var temp0 = new Array(p.length); + var temp1 = new Array(p.length); + function squareRootNistCurves(a) { + var beta = cryptoMath.intToDigits(0, 16); + mul.modExp(a, specialK, beta); + var aPrime = [0]; + cryptoMath.modMul(beta, beta, mul.m, aPrime); + if (cryptoMath.compareDigits(a, aPrime) !== 0) { + return null; + } + return beta; + } + var publicMethods2 = { + squareRoot: function(a) { + if (specialK !== null) { + return squareRootNistCurves(a); + } else { + throw new Error("GeneralCase not supported."); + } + }, + jacobiSymbol: function(a) { + var modEightMask = 7, modFourMask = 3, aPrime, pPrime; + aPrime = a.slice(); + pPrime = p.slice(); + cryptoMath.reduce(aPrime, pPrime, aPrime, temp0, temp1); + var t = 1; + while (!cryptoMath.isZero(aPrime)) { + while (cryptoMath.isEven(aPrime)) { + cryptoMath.shiftRight(aPrime, aPrime); + var pMod8 = pPrime[0] & modEightMask; + if (pMod8 === 3 || pMod8 === 5) { + t = -t; + } + } + var tmp = aPrime; + aPrime = pPrime; + pPrime = tmp; + var aMod4 = aPrime[0] & modFourMask; + var pMod4 = pPrime[0] & modFourMask; + if (aMod4 === 3 && pMod4 === 3) { + t = -t; + } + cryptoMath.reduce(aPrime, pPrime, aPrime, temp0, temp1); + } + if (cryptoMath.compareDigits(pPrime, cryptoMath.One) === 0) { + return t; + } else { + return 0; + } + } + }; + return publicMethods2; + }; + var curvesInternal = {}; + var createCurve = function(curveName) { + var curveData = curvesInternal[curveName.toUpperCase()]; + if (!curveData) { + throw new Error(curveName + " Unsupported curve."); + } + if (curveData.type === 0) { + return createWeierstrassCurve(curveData); + } + if (curveData.type === 1) { + return createTedCurve(curveData); + } + throw new Error(curveName + " Unsupported curve type."); + }; + var validateEccPoint = function(curveName, x, y, z) { + var curve = createCurve(curveName); + var point = new EllipticCurvePointFp(curve, false, btd(x), btd(y), z && btd(z), false); + var opp = new EllipticCurveOperatorFp(curve); + return opp.validatePoint(point); + }; + return { + createCurve, + curves: curvesInternal, + sec1EncodingFp, + validatePoint: validateEccPoint, + EllipticCurvePointFp, + EllipticCurveOperatorFp, + ModularSquareRootSolver + }; + } + var cryptoECC = cryptoECC || MsrcryptoECC(); + var curve_P256 = { + name: "P-256", + type: 0, + p: [ + 255, + 255, + 255, + 255, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ], + a: [ + 255, + 255, + 255, + 255, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 252 + ], + b: [ + 90, + 198, + 53, + 216, + 170, + 58, + 147, + 231, + 179, + 235, + 189, + 85, + 118, + 152, + 134, + 188, + 101, + 29, + 6, + 176, + 204, + 83, + 176, + 246, + 59, + 206, + 60, + 62, + 39, + 210, + 96, + 75 + ], + order: [ + 255, + 255, + 255, + 255, + 0, + 0, + 0, + 0, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 188, + 230, + 250, + 173, + 167, + 23, + 158, + 132, + 243, + 185, + 202, + 194, + 252, + 99, + 37, + 81 + ], + gx: [ + 107, + 23, + 209, + 242, + 225, + 44, + 66, + 71, + 248, + 188, + 230, + 229, + 99, + 164, + 64, + 242, + 119, + 3, + 125, + 129, + 45, + 235, + 51, + 160, + 244, + 161, + 57, + 69, + 216, + 152, + 194, + 150 + ], + gy: [ + 79, + 227, + 66, + 226, + 254, + 26, + 127, + 155, + 142, + 231, + 235, + 74, + 124, + 15, + 158, + 22, + 43, + 206, + 51, + 87, + 107, + 49, + 94, + 206, + 203, + 182, + 64, + 104, + 55, + 191, + 81, + 245 + ], + cf: 1 + }; + var curve_P384 = { + name: "P-384", + type: 0, + p: [ + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 254, + 255, + 255, + 255, + 255, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 255, + 255, + 255, + 255 + ], + a: [ + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 254, + 255, + 255, + 255, + 255, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 255, + 255, + 255, + 252 + ], + b: [ + 179, + 49, + 47, + 167, + 226, + 62, + 231, + 228, + 152, + 142, + 5, + 107, + 227, + 248, + 45, + 25, + 24, + 29, + 156, + 110, + 254, + 129, + 65, + 18, + 3, + 20, + 8, + 143, + 80, + 19, + 135, + 90, + 198, + 86, + 57, + 141, + 138, + 46, + 209, + 157, + 42, + 133, + 200, + 237, + 211, + 236, + 42, + 239 + ], + order: [ + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 199, + 99, + 77, + 129, + 244, + 55, + 45, + 223, + 88, + 26, + 13, + 178, + 72, + 176, + 167, + 122, + 236, + 236, + 25, + 106, + 204, + 197, + 41, + 115 + ], + gx: [ + 170, + 135, + 202, + 34, + 190, + 139, + 5, + 55, + 142, + 177, + 199, + 30, + 243, + 32, + 173, + 116, + 110, + 29, + 59, + 98, + 139, + 167, + 155, + 152, + 89, + 247, + 65, + 224, + 130, + 84, + 42, + 56, + 85, + 2, + 242, + 93, + 191, + 85, + 41, + 108, + 58, + 84, + 94, + 56, + 114, + 118, + 10, + 183 + ], + gy: [ + 54, + 23, + 222, + 74, + 150, + 38, + 44, + 111, + 93, + 158, + 152, + 191, + 146, + 146, + 220, + 41, + 248, + 244, + 29, + 189, + 40, + 154, + 20, + 124, + 233, + 218, + 49, + 19, + 181, + 240, + 184, + 192, + 10, + 96, + 177, + 206, + 29, + 126, + 129, + 157, + 122, + 67, + 29, + 124, + 144, + 234, + 14, + 95 + ], + cf: 1 + }; + var curve_P521 = { + name: "P-521", + type: 0, + p: [ + 1, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ], + a: [ + 1, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 252 + ], + b: [ + 0, + 81, + 149, + 62, + 185, + 97, + 142, + 28, + 154, + 31, + 146, + 154, + 33, + 160, + 182, + 133, + 64, + 238, + 162, + 218, + 114, + 91, + 153, + 179, + 21, + 243, + 184, + 180, + 137, + 145, + 142, + 241, + 9, + 225, + 86, + 25, + 57, + 81, + 236, + 126, + 147, + 123, + 22, + 82, + 192, + 189, + 59, + 177, + 191, + 7, + 53, + 115, + 223, + 136, + 61, + 44, + 52, + 241, + 239, + 69, + 31, + 212, + 107, + 80, + 63, + 0 + ], + order: [ + 1, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 250, + 81, + 134, + 135, + 131, + 191, + 47, + 150, + 107, + 127, + 204, + 1, + 72, + 247, + 9, + 165, + 208, + 59, + 181, + 201, + 184, + 137, + 156, + 71, + 174, + 187, + 111, + 183, + 30, + 145, + 56, + 100, + 9 + ], + gx: [ + 0, + 198, + 133, + 142, + 6, + 183, + 4, + 4, + 233, + 205, + 158, + 62, + 203, + 102, + 35, + 149, + 180, + 66, + 156, + 100, + 129, + 57, + 5, + 63, + 181, + 33, + 248, + 40, + 175, + 96, + 107, + 77, + 61, + 186, + 161, + 75, + 94, + 119, + 239, + 231, + 89, + 40, + 254, + 29, + 193, + 39, + 162, + 255, + 168, + 222, + 51, + 72, + 179, + 193, + 133, + 106, + 66, + 155, + 249, + 126, + 126, + 49, + 194, + 229, + 189, + 102 + ], + gy: [ + 1, + 24, + 57, + 41, + 106, + 120, + 154, + 59, + 192, + 4, + 92, + 138, + 95, + 180, + 44, + 125, + 27, + 217, + 152, + 245, + 68, + 73, + 87, + 155, + 68, + 104, + 23, + 175, + 189, + 23, + 39, + 62, + 102, + 44, + 151, + 238, + 114, + 153, + 94, + 244, + 38, + 64, + 197, + 80, + 185, + 1, + 63, + 173, + 7, + 97, + 53, + 60, + 112, + 134, + 162, + 114, + 194, + 64, + 136, + 190, + 148, + 118, + 159, + 209, + 102, + 80 + ], + cf: 1 + }; + if (typeof cryptoECC !== "undefined") { + cryptoECC.curves["P-256"] = curve_P256; + cryptoECC.curves["P-384"] = curve_P384; + cryptoECC.curves["P-521"] = curve_P521; + } + var curve_BN254 = { + name: "BN-254", + type: 0, + p: [ + 37, + 35, + 100, + 130, + 64, + 0, + 0, + 1, + 186, + 52, + 77, + 128, + 0, + 0, + 0, + 8, + 97, + 33, + 0, + 0, + 0, + 0, + 0, + 19, + 167, + 0, + 0, + 0, + 0, + 0, + 0, + 19 + ], + a: [0], + b: [2], + order: [ + 37, + 35, + 100, + 130, + 64, + 0, + 0, + 1, + 186, + 52, + 77, + 128, + 0, + 0, + 0, + 7, + 255, + 159, + 128, + 0, + 0, + 0, + 0, + 16, + 161, + 0, + 0, + 0, + 0, + 0, + 0, + 13 + ], + gx: [ + 37, + 35, + 100, + 130, + 64, + 0, + 0, + 1, + 186, + 52, + 77, + 128, + 0, + 0, + 0, + 8, + 97, + 33, + 0, + 0, + 0, + 0, + 0, + 19, + 167, + 0, + 0, + 0, + 0, + 0, + 0, + 18 + ], + gy: [1], + cf: 1 + }; + if (typeof cryptoECC !== "undefined") { + cryptoECC.curves["BN-254"] = curve_BN254; + } + var curve_numsp256d1 = { + info: ["numsp256d1", 256, 256, 256], + type: 0, + p: [ + 67, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + a: [ + 64, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + b: [129, 85, 2].reverse(), + order: [ + 37, + 168, + 81, + 71, + 41, + 32, + 171, + 32, + 96, + 92, + 38, + 234, + 117, + 130, + 60, + 228, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + gx: [ + 177, + 172, + 26, + 178, + 30, + 238, + 82, + 188, + 58, + 199, + 212, + 3, + 9, + 155, + 87, + 131, + 9, + 203, + 66, + 79, + 160, + 149, + 122, + 41, + 97, + 219, + 170, + 90, + 182, + 214, + 158, + 188 + ].reverse(), + gy: [ + 159, + 222, + 132, + 33, + 203, + 185, + 181, + 128, + 187, + 15, + 49, + 21, + 209, + 195, + 85, + 201, + 53, + 224, + 4, + 126, + 247, + 139, + 68, + 115, + 166, + 182, + 153, + 51, + 241, + 192, + 143, + 208 + ].reverse(), + cf: 1 + }; + var curve_numsp256t1 = { + info: ["numsp256t1", 256, 255, 256], + name: "numsp256t1", + type: 1, + p: [ + 67, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + a: [1], + d: [ + 85, + 195, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + order: [ + 245, + 74, + 221, + 238, + 144, + 177, + 71, + 26, + 155, + 67, + 89, + 47, + 165, + 90, + 149, + 65, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 64 + ].reverse(), + gx: [ + 218, + 19, + 237, + 46, + 144, + 192, + 222, + 160, + 134, + 53, + 8, + 227, + 14, + 138, + 57, + 12, + 214, + 155, + 32, + 105, + 95, + 61, + 30, + 205, + 125, + 35, + 234, + 106, + 251, + 20, + 117, + 138 + ].reverse(), + gy: [ + 230, + 137, + 138, + 121, + 231, + 22, + 166, + 47, + 211, + 110, + 133, + 16, + 216, + 97, + 95, + 113, + 16, + 128, + 75, + 166, + 217, + 101, + 150, + 206, + 199, + 37, + 217, + 217, + 159, + 62, + 213, + 68 + ].reverse(), + cf: 4 + }; + var curve_numsp384d1 = { + info: ["numsp384d1", 384, 384, 384], + name: "numsp384d1", + type: 0, + p: [ + 195, + 254, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + a: [ + 192, + 254, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + b: [ + 187, + 119, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + order: [ + 185, + 97, + 14, + 123, + 246, + 129, + 77, + 96, + 122, + 226, + 55, + 76, + 61, + 157, + 218, + 190, + 129, + 104, + 93, + 235, + 30, + 175, + 30, + 214, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + gx: [ + 42, + 21, + 152, + 32, + 4, + 186, + 156, + 235, + 123, + 196, + 97, + 15, + 16, + 237, + 46, + 82, + 66, + 199, + 108, + 42, + 27, + 41, + 189, + 243, + 244, + 249, + 129, + 251, + 205, + 193, + 37, + 2, + 166, + 241, + 5, + 65, + 34, + 202, + 128, + 72, + 28, + 24, + 111, + 177, + 240, + 86, + 121, + 117 + ].reverse(), + gy: [ + 22, + 7, + 24, + 102, + 236, + 184, + 116, + 92, + 38, + 173, + 244, + 191, + 219, + 180, + 214, + 188, + 126, + 131, + 26, + 18, + 125, + 131, + 32, + 185, + 156, + 115, + 127, + 248, + 119, + 105, + 4, + 176, + 126, + 207, + 132, + 5, + 48, + 61, + 227, + 215, + 56, + 142, + 155, + 225, + 104, + 227, + 222, + 172 + ].reverse(), + cf: 1 + }; + var curve_numsp384t1 = { + info: ["numsp384t1", 384, 382, 384], + name: "numsp384t1", + type: 1, + p: [ + 195, + 254, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + a: [1], + d: [ + 159, + 209, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + order: [ + 125, + 137, + 163, + 230, + 196, + 220, + 185, + 32, + 121, + 200, + 53, + 171, + 90, + 85, + 228, + 97, + 207, + 225, + 107, + 180, + 28, + 26, + 71, + 226, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 63 + ].reverse(), + gx: [ + 222, + 107, + 32, + 108, + 228, + 64, + 213, + 80, + 19, + 148, + 69, + 101, + 177, + 146, + 242, + 111, + 64, + 99, + 49, + 243, + 168, + 255, + 99, + 87, + 0, + 76, + 190, + 229, + 70, + 244, + 11, + 179, + 181, + 93, + 229, + 154, + 18, + 162, + 182, + 192, + 108, + 38, + 169, + 69, + 251, + 17, + 177, + 97 + ].reverse(), + gy: [ + 146, + 147, + 114, + 240, + 225, + 3, + 141, + 157, + 220, + 72, + 236, + 70, + 249, + 176, + 114, + 0, + 75, + 150, + 69, + 246, + 247, + 152, + 15, + 131, + 86, + 95, + 66, + 241, + 116, + 130, + 173, + 22, + 215, + 13, + 177, + 35, + 164, + 177, + 56, + 135, + 176, + 238, + 166, + 185, + 103, + 62, + 152, + 130 + ].reverse(), + cf: 4 + }; + var curve_numsp512d1 = { + info: ["numsp512d1", 512, 512, 512], + name: "numsp512d1", + type: 0, + p: [ + 199, + 253, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + a: [ + 196, + 253, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + b: [155, 217, 1].reverse(), + order: [ + 93, + 85, + 51, + 4, + 57, + 63, + 21, + 206, + 67, + 210, + 124, + 96, + 54, + 139, + 86, + 59, + 198, + 189, + 208, + 151, + 237, + 88, + 194, + 79, + 27, + 131, + 231, + 148, + 251, + 164, + 60, + 91, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + gx: [ + 87, + 174, + 171, + 140, + 149, + 135, + 130, + 220, + 226, + 93, + 111, + 125, + 19, + 96, + 93, + 29, + 131, + 21, + 86, + 37, + 134, + 66, + 121, + 147, + 158, + 53, + 107, + 7, + 81, + 161, + 33, + 80, + 249, + 217, + 6, + 83, + 194, + 224, + 6, + 69, + 133, + 246, + 1, + 181, + 59, + 216, + 202, + 152, + 82, + 59, + 61, + 160, + 2, + 112, + 43, + 218, + 147, + 10, + 29, + 20, + 71, + 52, + 192, + 58 + ].reverse(), + gy: [ + 166, + 39, + 53, + 56, + 96, + 135, + 160, + 35, + 233, + 15, + 253, + 76, + 30, + 92, + 43, + 207, + 2, + 86, + 90, + 178, + 64, + 168, + 33, + 193, + 233, + 237, + 14, + 139, + 218, + 21, + 132, + 162, + 20, + 79, + 209, + 123, + 12, + 38, + 75, + 143, + 140, + 187, + 188, + 171, + 222, + 219, + 151, + 75, + 0, + 177, + 235, + 99, + 220, + 238, + 14, + 206, + 179, + 86, + 173, + 41, + 202, + 84, + 58, + 148 + ].reverse(), + cf: 4 + }; + var curve_numsp512t1 = { + info: ["numsp512t1", 512, 510, 512], + name: "numsp512t1", + type: 1, + p: [ + 199, + 253, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + a: [1].reverse(), + d: [ + 239, + 203, + 254, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 + ].reverse(), + order: [ + 109, + 212, + 238, + 27, + 245, + 140, + 70, + 103, + 255, + 236, + 239, + 109, + 120, + 5, + 70, + 42, + 245, + 134, + 182, + 112, + 201, + 216, + 63, + 158, + 186, + 145, + 207, + 47, + 109, + 99, + 240, + 180, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 63 + ].reverse(), + gx: [ + 254, + 87, + 236, + 153, + 41, + 171, + 185, + 197, + 21, + 240, + 196, + 124, + 66, + 37, + 229, + 15, + 173, + 4, + 137, + 86, + 146, + 201, + 189, + 120, + 15, + 115, + 70, + 238, + 78, + 193, + 33, + 70, + 71, + 129, + 59, + 39, + 190, + 126, + 161, + 39, + 130, + 163, + 196, + 77, + 159, + 231, + 209, + 47, + 51, + 197, + 211, + 136, + 120, + 203, + 24, + 122, + 156, + 182, + 141, + 18, + 109, + 49, + 142, + 223 + ].reverse(), + gy: [ + 225, + 245, + 226, + 193, + 192, + 222, + 109, + 50, + 31, + 208, + 241, + 155, + 138, + 211, + 102, + 2, + 253, + 193, + 236, + 42, + 134, + 6, + 26, + 96, + 98, + 53, + 150, + 233, + 242, + 83, + 202, + 32, + 65, + 131, + 158, + 144, + 149, + 107, + 43, + 169, + 34, + 157, + 37, + 216, + 38, + 247, + 118, + 228, + 110, + 37, + 42, + 168, + 119, + 245, + 176, + 152, + 113, + 202, + 73, + 157, + 243, + 191, + 9, + 109 + ].reverse(), + cf: 4 + }; + if (typeof cryptoECC !== "undefined") { + cryptoECC.curves.NUMSP256D1 = curve_numsp256d1; + cryptoECC.curves.NUMSP384D1 = curve_numsp384d1; + cryptoECC.curves.NUMSP512D1 = curve_numsp512d1; + cryptoECC.curves.NUMSP256T1 = curve_numsp256t1; + cryptoECC.curves.NUMSP384T1 = curve_numsp384t1; + cryptoECC.curves.NUMSP512T1 = curve_numsp512t1; + } + var msrcryptoSha = function(name, der, h, k, blockBytes, blockFunction, truncateTo) { + var utils2 = msrcryptoUtilities; + var hv = h.slice(), w = new Array(blockBytes), buffer = [], blocksProcessed = 0; + function hashBlocks(message) { + var blockCount = Math.floor(message.length / blockBytes); + for (var block = 0; block < blockCount; block++) { + blockFunction(message, block, hv, k, w); + } + blocksProcessed += blockCount; + return message.slice(blockCount * blockBytes); + } + function hashToBytes() { + var hash = []; + for (var i2 = 0; i2 < hv.length; i2++) { + hash = hash.concat(utils2.int32ToBytes(hv[i2])); + } + hash.length = truncateTo / 8; + return hash; + } + function addPadding(messageBytes) { + var padLen = blockBytes - messageBytes.length % blockBytes; + padLen <= blockBytes / 8 && (padLen += blockBytes); + var padding = utils2.getVector(padLen); + padding[0] = 128; + var messageLenBits = (messageBytes.length + blocksProcessed * blockBytes) * 8; + for (var i2 = 1; i2 <= 8; i2++) { + padding[padLen - i2] = messageLenBits % 256; + messageLenBits = Math.floor(messageLenBits / 256); + } + return messageBytes.concat(padding); + } + function computeHash(messageBytes) { + buffer = hashBlocks(messageBytes); + return finish(); + } + function process2(messageBytes) { + buffer = buffer.concat(messageBytes); + if (buffer.length >= blockBytes) { + buffer = hashBlocks(buffer); + } + return; + } + function finish() { + if (hashBlocks(addPadding(buffer)).length !== 0) { + throw new Error("buffer.length !== 0"); + } + var result = hashToBytes(); + buffer = []; + hv = h.slice(); + blocksProcessed = 0; + return result; + } + return { + name, + computeHash, + process: process2, + finish, + der, + hashLen: truncateTo, + maxMessageSize: 4294967295 + }; + }; + var msrcryptoSha1 = (function() { + function hashBlock(message, blockIndex, hv, k2, w) { + var t, i2, temp, x0, blockSize = 64, mask = 4294967295; + var ra = hv[0], rb = hv[1], rc = hv[2], rd = hv[3], re = hv[4]; + for (i2 = 0; i2 < 16; i2++) { + w[i2] = utils2.bytesToInt32(message, blockIndex * blockSize + i2 * 4); + } + for (t = 16; t < 80; t++) { + x0 = w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16]; + w[t] = x0 << 1 | x0 >>> 31; + } + for (i2 = 0; i2 < 80; i2++) { + temp = ra << 5 | ra >>> 27; + temp += i2 >= 60 ? rb ^ rc ^ rd : i2 >= 40 ? rb & rc ^ rb & rd ^ rc & rd : i2 >= 20 ? rb ^ rc ^ rd : rb & rc ^ ~rb & rd; + temp += re + k2[i2] + w[i2]; + re = rd; + rd = rc; + rc = rb << 30 | rb >>> 2; + rb = ra; + ra = temp; + } + hv[0] += ra & mask; + hv[1] += rb & mask; + hv[2] += rc & mask; + hv[3] += rd & mask; + hv[4] += re & mask; + return hv; + } + var utils2 = msrcryptoUtilities, upd = utils2.unpackData, h = upd("Z0UjAe/Nq4mYutz+EDJUdsPS4fA=", 4, 1), k = upd( + "WoJ5mVqCeZlagnmZWoJ5mVqCeZlagnmZWoJ5mVqCeZlagnmZWoJ5mVqCeZlagnmZWoJ5mVqCeZlagnmZWoJ5mVqCeZlagnmZWoJ5mVqCeZlu2euhbtnroW7Z66Fu2euhbtnroW7Z66Fu2euhbtnroW7Z66Fu2euhbtnroW7Z66Fu2euhbtnroW7Z66Fu2euhbtnroW7Z66Fu2euhbtnroY8bvNyPG7zcjxu83I8bvNyPG7zcjxu83I8bvNyPG7zcjxu83I8bvNyPG7zcjxu83I8bvNyPG7zcjxu83I8bvNyPG7zcjxu83I8bvNyPG7zcymLB1spiwdbKYsHWymLB1spiwdbKYsHWymLB1spiwdbKYsHWymLB1spiwdbKYsHWymLB1spiwdbKYsHWymLB1spiwdbKYsHWymLB1spiwdY", + 4, + 1 + ), der = upd("MCEwCQYFKw4DAhoFAAQU"); + return { + sha1: function() { + return msrcryptoSha("SHA-1", der, h, k, 64, hashBlock, 160); + } + }; + })(); + if (typeof operations !== "undefined") { + msrcryptoSha1.instances = {}; + msrcryptoSha1.getInstance = function(id) { + return msrcryptoSha1.instances[id] || (msrcryptoSha1.instances[id] = msrcryptoSha1.sha1()); + }; + msrcryptoSha1.deleteInstance = function(id) { + msrcryptoSha1.instances[id] = null; + delete msrcryptoSha1.instances[id]; + }; + msrcryptoSha1.hash = function(p) { + if (p.operationSubType === "process") { + msrcryptoSha1.sha1.process(p.buffer); + return; + } + if (p.operationSubType === "finish") { + return msrcryptoSha1.sha1.finish(); + } + return msrcryptoSha1.sha1().computeHash(p.buffer); + }; + operations.register("digest", "SHA-1", msrcryptoSha1.hash); + } + msrcryptoHashFunctions["SHA-1"] = msrcryptoSha1.sha1; + var msrcryptoSha256 = (function() { + var utils2 = msrcryptoUtilities; + function hashBlock(message, blockIndex, hv, k, w) { + var t, i2, temp, x0, x1, blockSize = 64, mask = 4294967295; + var ra = hv[0], rb = hv[1], rc = hv[2], rd = hv[3], re = hv[4], rf = hv[5], rg = hv[6], rh = hv[7]; + for (i2 = 0; i2 < 16; i2++) { + w[i2] = utils2.bytesToInt32(message, blockIndex * blockSize + i2 * 4); + } + for (t = 16; t < 64; t++) { + x0 = w[t - 15]; + x1 = w[t - 2]; + w[t] = ((x1 >>> 17 | x1 << 15) ^ (x1 >>> 19 | x1 << 13) ^ x1 >>> 10) + w[t - 7] + ((x0 >>> 7 | x0 << 25) ^ (x0 >>> 18 | x0 << 14) ^ x0 >>> 3) + w[t - 16]; + w[t] = w[t] & mask; + } + for (i2 = 0; i2 < 64; i2++) { + temp = rh + ((re >>> 6 | re << 26) ^ (re >>> 11 | re << 21) ^ (re >>> 25 | re << 7)) + (re & rf ^ ~re & rg) + k[i2] + w[i2]; + rd += temp; + temp += ((ra >>> 2 | ra << 30) ^ (ra >>> 13 | ra << 19) ^ (ra >>> 22 | ra << 10)) + (ra & (rb ^ rc) ^ rb & rc); + rh = rg; + rg = rf; + rf = re; + re = rd; + rd = rc; + rc = rb; + rb = ra; + ra = temp; + } + hv[0] = hv[0] + ra >>> 0; + hv[1] = hv[1] + rb >>> 0; + hv[2] = hv[2] + rc >>> 0; + hv[3] = hv[3] + rd >>> 0; + hv[4] = hv[4] + re >>> 0; + hv[5] = hv[5] + rf >>> 0; + hv[6] = hv[6] + rg >>> 0; + hv[7] = hv[7] + rh >>> 0; + return hv; + } + var k256, h224, h256, der224, der256, upd = utils2.unpackData; + h224 = upd("wQWe2DZ81QcwcN0X9w5ZOf/ACzFoWBURZPmPp776T6Q", 4, 1); + h256 = upd("agnmZ7tnroU8bvNypU/1OlEOUn+bBWiMH4PZq1vgzRk", 4, 1); + k256 = upd( + "QoovmHE3RJG1wPvP6bXbpTlWwltZ8RHxkj+CpKscXtXYB6qYEoNbASQxhb5VDH3Dcr5ddIDesf6b3AanwZvxdOSbacHvvkeGD8GdxiQMocwt6SxvSnSEqlywqdx2+YjamD5RUqgxxm2wAyfIv1l/x8bgC/PVp5FHBspjURQpKWcntwqFLhshOE0sbfxTOA0TZQpzVHZqCruBwskuknIshaK/6KGoGmZLwkuLcMdsUaPRkugZ1pkGJPQONYUQaqBwGaTBFh43bAgnSHdMNLC8tTkcDLNO2KpKW5zKT2gub/N0j4LueKVjb4TIeBSMxwIIkL7/+qRQbOu++aP3xnF48g", + 4, + 1 + ); + der224 = upd("MC0wDQYJYIZIAWUDBAIEBQAEHA"); + der256 = upd("MDEwDQYJYIZIAWUDBAIBBQAEIA"); + return { + sha224: function() { + return msrcryptoSha("SHA-224", der224, h224, k256, 64, hashBlock, 224); + }, + sha256: function() { + return msrcryptoSha("SHA-256", der256, h256, k256, 64, hashBlock, 256); + } + }; + })(); + if (typeof operations !== "undefined") { + msrcryptoSha256.instance224 = msrcryptoSha256.instance224 || msrcryptoSha256.sha224(); + msrcryptoSha256.instance256 = msrcryptoSha256.instance256 || msrcryptoSha256.sha256(); + msrcryptoSha256.instances = {}; + msrcryptoSha256.getInstance224 = function(id) { + return msrcryptoSha256.instances[id] || (msrcryptoSha256.instances[id] = msrcryptoSha256.sha224()); + }; + msrcryptoSha256.getInstance256 = function(id) { + return msrcryptoSha256.instances[id] || (msrcryptoSha256.instances[id] = msrcryptoSha256.sha256()); + }; + msrcryptoSha256.deleteInstance = function(id) { + msrcryptoSha256.instances[id] = null; + delete msrcryptoSha256.instances[id]; + }; + msrcryptoSha256.hash256 = function(p) { + if (p.operationSubType === "process") { + msrcryptoSha256.getInstance256(p.workerid).process(p.buffer); + return null; + } + if (p.operationSubType === "finish") { + var result = msrcryptoSha256.getInstance256(p.workerid).finish(); + msrcryptoSha256.deleteInstance(p.workerid); + return result; + } + if (p.operationSubType === "abort") { + msrcryptoSha256.deleteInstance(p.workerid); + return; + } + return msrcryptoSha256.instance256.computeHash(p.buffer); + }; + msrcryptoSha256.hash224 = function(p) { + if (p.operationSubType === "process") { + msrcryptoSha256.getInstance224(p.workerid).process(p.buffer); + return; + } + if (p.operationSubType === "finish") { + var result = msrcryptoSha256.getInstance224(p.workerid).finish(); + } + if (p.operationSubType === "abort") { + msrcryptoSha224.deleteInstance(p.workerid); + return; + } + return msrcryptoSha256.instance224.computeHash(p.buffer); + }; + operations.register("digest", "SHA-224", msrcryptoSha256.hash224); + operations.register("digest", "SHA-256", msrcryptoSha256.hash256); + } + msrcryptoHashFunctions["SHA-224"] = msrcryptoSha256.sha224; + msrcryptoHashFunctions["SHA-256"] = msrcryptoSha256.sha256; + var msrcryptoSha512 = (function() { + var utils2 = msrcryptoUtilities; + function add(x0, x1, y0, y1, resultArray) { + var lowSum = x1 + y1 | 0; + var carry = lowSum >>> 0 < y1 >>> 0; + resultArray[0] = x0 + y0 + carry | 0; + resultArray[1] = lowSum; + return; + } + function hashBlock(message, blockIndex, hv, k, w) { + var t, i2, blockBytes = 128, tah, tal, tbh, tbl, xh, xl, tc = [], td = [], te = [], index; + var ah = hv[0], al = hv[1], bh = hv[2], bl = hv[3], ch = hv[4], cl = hv[5], dh = hv[6], dl = hv[7], eh = hv[8], el = hv[9], fh = hv[10], fl = hv[11], gh = hv[12], gl = hv[13], hh = hv[14], hl = hv[15]; + for (t = 0; t < 32; t++) { + index = blockIndex * blockBytes + t * 4; + w[t] = message.slice(index, index + 4); + w[t] = w[t][0] << 24 | w[t][1] << 16 | w[t][2] << 8 | w[t][3]; + } + for (t = 32; t < 160; t += 2) { + xh = w[t - 30]; + xl = w[t - 29]; + tah = (xh >>> 1 | xl << 31) ^ (xh >>> 8 | xl << 24) ^ xh >>> 7; + tal = (xl >>> 1 | xh << 31) ^ (xl >>> 8 | xh << 24) ^ (xl >>> 7 | xh << 25); + xh = w[t - 4]; + xl = w[t - 3]; + tbh = (xh >>> 19 | xl << 13) ^ (xl >>> 29 | xh << 3) ^ xh >>> 6; + tbl = (xl >>> 19 | xh << 13) ^ (xh >>> 29 | xl << 3) ^ (xl >>> 6 | xh << 26); + add(tbh, tbl, w[t - 14], w[t - 13], tc); + add(tah, tal, tc[0], tc[1], tc); + add(w[t - 32], w[t - 31], tc[0], tc[1], tc); + w[t] = tc[0]; + w[t + 1] = tc[1]; + } + for (i2 = 0; i2 < 160; i2 += 2) { + tah = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (el >>> 9 | eh << 23); + tal = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (eh >>> 9 | el << 23); + tbh = eh & fh ^ gh & ~eh; + tbl = el & fl ^ gl & ~el; + add(hh, hl, tah, tal, tc); + add(tbh, tbl, k[i2], k[i2 + 1], td); + add(tc[0], tc[1], w[i2], w[i2 + 1], te); + add(td[0], td[1], te[0], te[1], te); + add(te[0], te[1], dh, dl, tc); + dh = tc[0]; + dl = tc[1]; + tal = (al >>> 28 | ah << 4) ^ (ah >>> 2 | al << 30) ^ (ah >>> 7 | al << 25); + tah = (ah >>> 28 | al << 4) ^ (al >>> 2 | ah << 30) ^ (al >>> 7 | ah << 25); + tbl = al & (bl ^ cl) ^ bl & cl; + tbh = ah & (bh ^ ch) ^ bh & ch; + add(te[0], te[1], tah, tal, tc); + tah = tc[0]; + tal = tc[1]; + add(tbh, tbl, tah, tal, tc); + tah = tc[0]; + tal = tc[1]; + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + eh = dh; + el = dl; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + ah = tah; + al = tal; + } + add(hv[0], hv[1], ah, al, tc); + hv[0] = tc[0]; + hv[1] = tc[1]; + add(hv[2], hv[3], bh, bl, tc); + hv[2] = tc[0]; + hv[3] = tc[1]; + add(hv[4], hv[5], ch, cl, tc); + hv[4] = tc[0]; + hv[5] = tc[1]; + add(hv[6], hv[7], dh, dl, tc); + hv[6] = tc[0]; + hv[7] = tc[1]; + add(hv[8], hv[9], eh, el, tc); + hv[8] = tc[0]; + hv[9] = tc[1]; + add(hv[10], hv[11], fh, fl, tc); + hv[10] = tc[0]; + hv[11] = tc[1]; + add(hv[12], hv[13], gh, gl, tc); + hv[12] = tc[0]; + hv[13] = tc[1]; + add(hv[14], hv[15], hh, hl, tc); + hv[14] = tc[0]; + hv[15] = tc[1]; + return hv; + } + var h384, h512, k512, der384, der512, der512_224, der512_256, upd = utils2.unpackData; + h384 = upd("y7udXcEFnthimikqNnzVB5FZAVowcN0XFS/s2PcOWTlnMyZn/8ALMY60SodoWBUR2wwuDWT5j6dHtUgdvvpPpA==", 4, 1); + h512 = upd("agnmZ/O8yQi7Z66FhMqnOzxu83L+lPgrpU/1Ol8dNvFRDlJ/reaC0ZsFaIwrPmwfH4PZq/tBvWtb4M0ZE34heQ", 4, 1); + k512 = upd( + "QoovmNcoriJxN0SRI+9lzbXA+8/sTTsv6bXbpYGJ27w5VsJb80i1OFnxEfG2BdAZkj+CpK8ZT5urHF7V2m2BGNgHqpijAwJCEoNbAUVwb74kMYW+TuSyjFUMfcPV/7Ticr5ddPJ7iW+A3rH+OxaWsZvcBqclxxI1wZvxdM9pJpTkm2nBnvFK0u++R4Y4TyXjD8GdxouM1bUkDKHMd6ycZS3pLG9ZKwJ1SnSEqm6m5INcsKncvUH71Hb5iNqDEVO1mD5RUu5m36uoMcZtLbQyELADJ8iY+yE/v1l/x77vDuTG4AvzPaiPwtWnkUeTCqclBspjUeADgm8UKSlnCg5ucCe3CoVG0i/8LhshOFwmySZNLG38WsQq7VM4DROdlbPfZQpzVIuvY952agq7PHeyqIHCyS5H7a7mknIshRSCNTuiv+ihTPEDZKgaZku8QjABwkuLcND4l5HHbFGjBlS+MNGS6BnW71IY1pkGJFVlqRD0DjWFV3EgKhBqoHAyu9G4GaTBFrjS0MgeN2wIUUGrUydId0zfjuuZNLC8teGbSKg5HAyzxclaY07YqkrjQYrLW5zKT3dj43NoLm/z1rK4o3SPgu5d77L8eKVjb0MXL2CEyHgUofCrcozHAggaZDnskL7/+iNjHiikUGzr3oK96b75o/eyxnkVxnF48uNyUyvKJz7O6iZhnNGGuMchwMIH6tp91s3g6x71fU9/7m7ReAbwZ6pyF2+6CmN9xaLImKYRP5gEvvkNrhtxCzUTHEcbKNt39SMEfYQyyqt7QMckkzyevgoVyb68Qx1nxJwQDUxMxdS+yz5Ctll/KZz8ZX4qX8tvqzrW+uxsRBmMSkdYFw==", + 4, + 1 + ); + der384 = upd("MEEwDQYJYIZIAWUDBAICBQAEMA"); + der512 = upd("MFEwDQYJYIZIAWUDBAIDBQAEQA"); + der512_224 = upd("MC0wDQYJYIZIAWUDBAIFBQAEHA"); + der512_256 = upd("MDEwDQYJYIZIAWUDBAIGBQAEIA"); + return { + sha384: function() { + return msrcryptoSha("SHA-384", der384, h384, k512, 128, hashBlock, 384); + }, + sha512: function() { + return msrcryptoSha("SHA-512", der512, h512, k512, 128, hashBlock, 512); + }, + sha512_224: function() { + return msrcryptoSha("SHA-512.224", der512_224, h512, k512, 128, hashBlock, 224); + }, + sha512_256: function() { + return msrcryptoSha("SHA-512.256", der512_256, h512, k512, 128, hashBlock, 256); + } + }; + })(); + if (typeof operations !== "undefined") { + msrcryptoSha512.instances = {}; + msrcryptoSha512.getInstance384 = function(id) { + return msrcryptoSha512.instances[id] || (msrcryptoSha512.instances[id] = msrcryptoSha512.sha384()); + }; + msrcryptoSha512.getInstance512 = function(id) { + return msrcryptoSha512.instances[id] || (msrcryptoSha512.instances[id] = msrcryptoSha512.sha512()); + }; + msrcryptoSha512.deleteInstance = function(id) { + msrcryptoSha512.instances[id] = null; + delete msrcryptoSha512.instances[id]; + }; + msrcryptoSha512.hash384 = function(p) { + if (p.operationSubType === "process") { + msrcryptoSha512.sha384.process(p.buffer); + return; + } + if (p.operationSubType === "finish") { + return msrcryptoSha512.sha384.finish(); + } + return msrcryptoSha512.sha384().computeHash(p.buffer); + }; + msrcryptoSha512.hash512 = function(p) { + if (p.operationSubType === "process") { + msrcryptoSha512.sha512.process(p.buffer); + return; + } + if (p.operationSubType === "finish") { + return msrcryptoSha512.sha512.finish(); + } + return msrcryptoSha512.sha512().computeHash(p.buffer); + }; + operations.register("digest", "SHA-384", msrcryptoSha512.hash384); + operations.register("digest", "SHA-512", msrcryptoSha512.hash512); + } + msrcryptoHashFunctions["SHA-384"] = msrcryptoSha512.sha384; + msrcryptoHashFunctions["SHA-512"] = msrcryptoSha512.sha512; + var msrcryptoHmac = function(keyBytes, hashFunction) { + var blockSize = { + 384: 128, + 512: 128 + }[hashFunction.name.replace(/SHA-/, "")] || 64; + var ipad; + var opad; + var paddedKey = padKey(); + var keyXorOpad; + var keyXorIpad; + var k0IpadText; + function xorArrays(array1, array2) { + var newArray = new Array(array1); + for (var j = 0; j < array1.length; j++) { + newArray[j] = array1[j] ^ array2[j]; + } + return newArray; + } + function padZeros(bytes, paddedLength) { + var paddedArray = bytes.slice(); + for (var j = bytes.length; j < paddedLength; j++) { + paddedArray.push(0); + } + return paddedArray; + } + function padKey() { + if (keyBytes.length === blockSize) { + return keyBytes; + } + if (keyBytes.length > blockSize) { + return padZeros(hashFunction.computeHash(keyBytes), blockSize); + } + return padZeros(keyBytes, blockSize); + } + function processHmac(messageBytes) { + if (!k0IpadText) { + k0IpadText = keyXorIpad.concat(messageBytes); + hashFunction.process(k0IpadText); + } else { + hashFunction.process(messageBytes); + } + return; + } + function finishHmac() { + var hashK0IpadText = hashFunction.finish(); + var k0IpadK0OpadText = keyXorOpad.concat(hashK0IpadText); + return hashFunction.computeHash(k0IpadK0OpadText); + } + function clearState() { + keyBytes = null; + hashFunction = null; + paddedKey = null; + } + ipad = new Array(blockSize); + opad = new Array(blockSize); + for (var i2 = 0; i2 < blockSize; i2++) { + ipad[i2] = 54; + opad[i2] = 92; + } + keyXorIpad = xorArrays(paddedKey, ipad); + keyXorOpad = xorArrays(paddedKey, opad); + return { + computeHmac: function(dataBytes, key, hashAlgorithm) { + processHmac(dataBytes); + var result = finishHmac(); + clearState(); + return result; + }, + process: function(dataBytes, key, hashAlgorithm) { + processHmac(dataBytes); + return null; + }, + finish: function(key, hashAlgorithm) { + var result = finishHmac(); + clearState(); + return result; + } + }; + }; + if (typeof operations !== "undefined") { + var hmacInstances = {}; + msrcryptoHmac.signHmac = function(p) { + var hashName = p.keyHandle.algorithm.hash.name.toUpperCase(), hashAlg = msrcryptoHashFunctions[hashName](), result, id = p.workerid; + if (!hmacInstances[id]) { + hmacInstances[id] = msrcryptoHmac(p.keyData, hashAlg); + } + if (p.operationSubType === "process") { + hmacInstances[id].process(p.buffer); + return null; + } + if (p.operationSubType === "finish") { + result = hmacInstances[id].finish(); + hmacInstances[id] = null; + return result; + } + result = hmacInstances[id].computeHmac(p.buffer); + hmacInstances[id] = null; + return result; + }; + msrcryptoHmac.verifyHmac = function(p) { + var hashName = p.keyHandle.algorithm.hash.name.toUpperCase(), hashAlg = msrcryptoHashFunctions[hashName](), result, id = p.workerid; + if (!hmacInstances[id]) { + hmacInstances[id] = msrcryptoHmac(p.keyData, hashAlg); + } + if (p.operationSubType === "process") { + hmacInstances[id].process(p.buffer); + return null; + } + if (p.operationSubType === "finish") { + result = hmacInstances[id].finish(); + result = msrcryptoUtilities.arraysEqual(result, p.signature); + hmacInstances[id] = null; + return result; + } + result = hmacInstances[id].computeHmac(p.buffer); + result = msrcryptoUtilities.arraysEqual(result, p.signature); + hmacInstances[id] = null; + return result; + }; + msrcryptoHmac.generateKey = function(p) { + var defaultKeyLengths = { + "SHA-1": 64, + "SHA-224": 64, + "SHA-256": 64, + "SHA-384": 128, + "SHA-512": 128 + }; + var keyLength = p.algorithm.length; + if (!keyLength) { + keyLength = defaultKeyLengths[p.algorithm.hash.name.toUpperCase()]; + } + return { + type: "keyGeneration", + keyData: msrcryptoPseudoRandom.getBytes(keyLength), + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: p.usages, + type: "secret" + } + }; + }; + msrcryptoHmac.importKey = function(p) { + var keyObject, keyBits = p.keyData.length * 8; + if (p.format === "jwk") { + keyObject = msrcryptoJwk.jwkToKey(p.keyData, p.algorithm, ["k"]); + keyObject.alg = keyObject.alg.replace("HS", "SHA-"); + } else if (p.format === "raw") { + keyObject = { + k: msrcryptoUtilities.toArray(p.keyData) + }; + } else { + throw new Error("unsupported import format"); + } + return { + type: "keyImport", + keyData: keyObject.k, + keyHandle: { + algorithm: { + name: "HMAC", + hash: { + name: p.algorithm.hash.name + } + }, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: "secret" + } + }; + }; + msrcryptoHmac.exportKey = function(p) { + if (p.format === "jwk") { + return { + type: "keyExport", + keyHandle: msrcryptoJwk.keyToJwk(p.keyHandle, p.keyData) + }; + } + if (p.format === "raw") { + return { + type: "keyExport", + keyHandle: p.keyData + }; + } + throw new Error("unsupported export format"); + }; + operations.register("importKey", "HMAC", msrcryptoHmac.importKey); + operations.register("exportKey", "HMAC", msrcryptoHmac.exportKey); + operations.register("generateKey", "HMAC", msrcryptoHmac.generateKey); + operations.register("sign", "HMAC", msrcryptoHmac.signHmac); + operations.register("verify", "HMAC", msrcryptoHmac.verifyHmac); + } + var msrcryptoBlockCipher = /* @__PURE__ */ (function() { + var aesConstants, x2, x3, x14, x13, x11, x9, sBoxTable, invSBoxTable, rConTable; + return { + aes: function(keyBytes) { + if (!aesConstants) { + aesConstants = msrcryptoUtilities.unpackData( + "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v0CjnoHz1/t84zmCmy//hzSOQ0TE3unLVHuUMqbCIz3uTJULQvrDTgguoWYo2SSydluiSW2L0SVy+PZkhmiYFtSkXMxdZbaSbHBIUP3tudpeFUZXp42dhJDYqwCMvNMK9+RYBbizRQbQLB6Pyj8PAsGvvQMBE4prOpERQU9n3OqX8s/O8LTmc5asdCLnrTWF4vk36Bx1325H8RpxHSnFiW+3Yg6qGL4b/FY+S8bSeSCa28D+eM1a9B/dqDOIB8cxsRIQWSeA7F9gUX+pGbVKDS3lep+TyZzvoOA7Ta4q9bDI67s8g1OZYRcrBH66d9Ym4WkUY1UhDH2NAQIECBAgQIAbNmzYq02aL168Y8aXNWrUs33678WROXLk071hwp8lSpQzZsyDHTp06MuNAQIECBAgQIAbNmzYq02aL168Y8aXNWrUs33678WROXLk071hwp8lSpQzZsyDHTp06MuNAQIECBAgQIAbNmzYq02aL168Y8aXNWrUs33678WROXLk071hwp8lSpQzZsyDHTp06MuNAQIECBAgQIAbNmzYq02aL168Y8aXNWrUs33678WROXLk071hwp8lSpQzZsyDHTp06MuNAQIECBAgQIAbNmzYq02aL168Y8aXNWrUs33678WROXLk071hwp8lSpQzZsyDHTp06MuN", + 256, + false + ); + x2 = aesConstants[0]; + x3 = aesConstants[1]; + x14 = aesConstants[2]; + x13 = aesConstants[3]; + x11 = aesConstants[4]; + x9 = aesConstants[5]; + sBoxTable = aesConstants[6]; + invSBoxTable = aesConstants[7]; + rConTable = aesConstants[8]; + } + var blockSize = 128, keyLength, nK, nB = 4, nR, key; + keyLength = keyBytes.length * 8; + switch (keyLength) { + case 128: + case 192: + case 256: + break; + default: + throw new Error("Unsupported keyLength"); + } + nK = keyLength / 32; + nR = nK + 6; + var shiftRows = function(a) { + var tmp = a[1]; + a[1] = a[5]; + a[5] = a[9]; + a[9] = a[13]; + a[13] = tmp; + tmp = a[2]; + a[2] = a[10]; + a[10] = tmp; + tmp = a[6]; + a[6] = a[14]; + a[14] = tmp; + tmp = a[15]; + a[15] = a[11]; + a[11] = a[7]; + a[7] = a[3]; + a[3] = tmp; + }; + var invShiftRows = function(a) { + var tmp = a[13]; + a[13] = a[9]; + a[9] = a[5]; + a[5] = a[1]; + a[1] = tmp; + tmp = a[10]; + a[10] = a[2]; + a[2] = tmp; + tmp = a[14]; + a[14] = a[6]; + a[6] = tmp; + tmp = a[3]; + a[3] = a[7]; + a[7] = a[11]; + a[11] = a[15]; + a[15] = tmp; + }; + var mixColumns = function(state) { + var a = state[0], b = state[1], c = state[2], d = state[3], e = state[4], f = state[5], g = state[6], h = state[7], i2 = state[8], j = state[9], k = state[10], l = state[11], m = state[12], n = state[13], o = state[14], p = state[15]; + state[0] = x2[a] ^ x3[b] ^ c ^ d; + state[1] = a ^ x2[b] ^ x3[c] ^ d; + state[2] = a ^ b ^ x2[c] ^ x3[d]; + state[3] = x3[a] ^ b ^ c ^ x2[d]; + state[4] = x2[e] ^ x3[f] ^ g ^ h; + state[5] = e ^ x2[f] ^ x3[g] ^ h; + state[6] = e ^ f ^ x2[g] ^ x3[h]; + state[7] = x3[e] ^ f ^ g ^ x2[h]; + state[8] = x2[i2] ^ x3[j] ^ k ^ l; + state[9] = i2 ^ x2[j] ^ x3[k] ^ l; + state[10] = i2 ^ j ^ x2[k] ^ x3[l]; + state[11] = x3[i2] ^ j ^ k ^ x2[l]; + state[12] = x2[m] ^ x3[n] ^ o ^ p; + state[13] = m ^ x2[n] ^ x3[o] ^ p; + state[14] = m ^ n ^ x2[o] ^ x3[p]; + state[15] = x3[m] ^ n ^ o ^ x2[p]; + }; + var invMixColumns = function(state) { + var a = state[0], b = state[1], c = state[2], d = state[3], e = state[4], f = state[5], g = state[6], h = state[7], i2 = state[8], j = state[9], k = state[10], l = state[11], m = state[12], n = state[13], o = state[14], p = state[15]; + state[0] = x14[a] ^ x11[b] ^ x13[c] ^ x9[d]; + state[1] = x9[a] ^ x14[b] ^ x11[c] ^ x13[d]; + state[2] = x13[a] ^ x9[b] ^ x14[c] ^ x11[d]; + state[3] = x11[a] ^ x13[b] ^ x9[c] ^ x14[d]; + state[4] = x14[e] ^ x11[f] ^ x13[g] ^ x9[h]; + state[5] = x9[e] ^ x14[f] ^ x11[g] ^ x13[h]; + state[6] = x13[e] ^ x9[f] ^ x14[g] ^ x11[h]; + state[7] = x11[e] ^ x13[f] ^ x9[g] ^ x14[h]; + state[8] = x14[i2] ^ x11[j] ^ x13[k] ^ x9[l]; + state[9] = x9[i2] ^ x14[j] ^ x11[k] ^ x13[l]; + state[10] = x13[i2] ^ x9[j] ^ x14[k] ^ x11[l]; + state[11] = x11[i2] ^ x13[j] ^ x9[k] ^ x14[l]; + state[12] = x14[m] ^ x11[n] ^ x13[o] ^ x9[p]; + state[13] = x9[m] ^ x14[n] ^ x11[o] ^ x13[p]; + state[14] = x13[m] ^ x9[n] ^ x14[o] ^ x11[p]; + state[15] = x11[m] ^ x13[n] ^ x9[o] ^ x14[p]; + }; + var xorWord = function(a, b) { + return [a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3]]; + }; + var addRoundKey = function(state, keySchedule, offset) { + for (var i2 = 0; i2 < state.length; i2 += 1) { + state[i2] ^= keySchedule[i2 + offset]; + } + }; + var rotWord = function(word) { + var a = word[0]; + word[0] = word[1]; + word[1] = word[2]; + word[2] = word[3]; + word[3] = a; + }; + var subWord = function(word) { + for (var i2 = 0; i2 < word.length; i2 += 1) { + word[i2] = sBoxTable[word[i2]]; + } + }; + var invSubWord = function(word) { + for (var i2 = 0; i2 < word.length; i2 += 1) { + word[i2] = invSBoxTable[word[i2]]; + } + }; + var getWord = function(tab, i2) { + return [tab[4 * i2], tab[4 * i2 + 1], tab[4 * i2 + 2], tab[4 * i2 + 3]]; + }; + var setWord = function(left, right, indexL, indexR) { + left[4 * indexL] = right[4 * indexR]; + left[4 * indexL + 1] = right[4 * indexR + 1]; + left[4 * indexL + 2] = right[4 * indexR + 2]; + left[4 * indexL + 3] = right[4 * indexR + 3]; + }; + var expandKey = function(keyIn) { + var temp, res = [], i2 = 0; + while (i2 < 4 * nK) { + res.push(keyIn[i2++]); + } + i2 = nK; + while (i2 < nB * (nR + 1)) { + temp = getWord(res, i2 - 1); + if (i2 % nK === 0) { + var index = i2 / nK; + var rcon = [rConTable[index], 0, 0, 0]; + rotWord(temp); + subWord(temp); + temp = xorWord(temp, rcon); + } else if (nK > 6 && i2 % nK === 4) { + subWord(temp); + } + var newWord = xorWord(getWord(res, i2 - nK), temp); + setWord(res, newWord, i2, 0); + i2 += 1; + } + return res; + }; + key = expandKey(keyBytes); + return { + encrypt: function(dataBytes) { + var state = dataBytes, round; + addRoundKey(state, key, 0); + for (round = 1; round <= nR - 1; round += 1) { + subWord(state); + shiftRows(state); + mixColumns(state); + addRoundKey(state, key, 4 * round * nB); + } + subWord(state); + shiftRows(state); + addRoundKey(state, key, 4 * nR * nB); + return state; + }, + decrypt: function(dataBytes) { + var state = dataBytes, round; + addRoundKey(state, key, 4 * nR * nB); + for (round = nR - 1; round >= 1; round -= 1) { + invShiftRows(state); + invSubWord(state); + addRoundKey(state, key, 4 * round * nB); + invMixColumns(state); + } + invShiftRows(state); + invSubWord(state); + addRoundKey(state, key, 0); + return state; + }, + clear: function() { + }, + keyLength, + blockSize + }; + } + }; + })(); + var msrcryptoPadding = msrcryptoPadding || {}; + msrcryptoPadding.pkcsv7 = function(blockSize) { + function pad(messageBlocks) { + var lastIndex = messageBlocks.length - 1 >= 0 ? messageBlocks.length - 1 : 0; + var lastBlock = messageBlocks[lastIndex]; + var lastBlockLength = lastBlock.length; + var createNewBlock = lastBlockLength === blockSize; + if (createNewBlock) { + var newBlock = []; + var i2; + for (i2 = 0; i2 < blockSize; i2 += 1) { + newBlock.push(blockSize); + } + messageBlocks.push(newBlock); + } else { + var byteToAdd = blockSize - lastBlockLength & 255; + while (lastBlock.length !== blockSize) { + lastBlock.push(byteToAdd); + } + } + } + function unpad(messageBytes) { + var verified = true; + if (messageBytes.length % blockSize !== 0) { + verified = false; + } + var lastBlock = messageBytes.slice(-blockSize); + var padLen = lastBlock[lastBlock.length - 1]; + for (var i2 = 0; i2 < blockSize; i2++) { + var isPaddingElement = blockSize - i2 <= padLen; + var isCorrectValue = lastBlock[i2] === padLen; + verified = (isPaddingElement ? isCorrectValue : true) && verified; + } + var trimLen = verified ? padLen : 0; + messageBytes.length -= trimLen; + return verified; + } + return { + pad, + unpad + }; + }; + var msrcryptoCbc = function(blockCipher) { + var blockSize = blockCipher.blockSize / 8; + var paddingScheme = msrcryptoPadding.pkcsv7(blockSize); + var mergeBlocks = function(tab) { + var res = [], i2, j; + for (i2 = 0; i2 < tab.length; i2 += 1) { + var block = tab[i2]; + for (j = 0; j < block.length; j += 1) { + res.push(block[j]); + } + } + return res; + }; + function getBlocks(dataBytes) { + var blocks = []; + mBuffer = mBuffer.concat(dataBytes); + var blockCount = Math.floor(mBuffer.length / blockSize); + for (var i2 = 0; i2 < blockCount; i2++) { + blocks.push(mBuffer.slice(i2 * blockSize, (i2 + 1) * blockSize)); + } + mBuffer = mBuffer.slice(blockCount * blockSize); + return blocks; + } + function encryptBlocks(blocks) { + var result = [], toEncrypt; + for (var i2 = 0; i2 < blocks.length; i2++) { + toEncrypt = msrcryptoUtilities.xorVectors(mIvBytes, blocks[i2]); + result.push(blockCipher.encrypt(toEncrypt)); + mIvBytes = result[i2]; + } + return result; + } + function decryptBlocks(blocks) { + var result = [], toDecrypt, decrypted; + for (var i2 = 0; i2 < blocks.length; i2 += 1) { + toDecrypt = blocks[i2].slice(0, blocks[i2].length); + decrypted = blockCipher.decrypt(toDecrypt); + result.push(msrcryptoUtilities.xorVectors(mIvBytes, decrypted)); + mIvBytes = blocks[i2]; + } + return result; + } + function clearState() { + mBuffer = []; + mResultBuffer = []; + mIvBytes = null; + } + var mBuffer = [], mResultBuffer = [], mIvBytes; + return { + init: function(ivBytes) { + if (ivBytes.length !== blockSize) { + throw new Error("Invalid iv size"); + } + mIvBytes = ivBytes.slice(); + }, + encrypt: function(plainBytes) { + var result = encryptBlocks(getBlocks(plainBytes)); + mResultBuffer = mResultBuffer.concat(mergeBlocks(result)); + return this.finishEncrypt(); + }, + processEncrypt: function(plainBytes) { + var result = mergeBlocks(encryptBlocks(getBlocks(plainBytes))); + return result; + }, + finishEncrypt: function() { + var blocks = mBuffer.length === 1 ? [[mBuffer[0]]] : [mBuffer]; + paddingScheme.pad(blocks); + var result = mResultBuffer.concat(mergeBlocks(encryptBlocks(blocks))); + clearState(); + return result; + }, + decrypt: function(cipherBytes) { + this.processDecrypt(cipherBytes); + return this.finishDecrypt(); + }, + processDecrypt: function(cipherBytes) { + var result = decryptBlocks(getBlocks(cipherBytes)); + mResultBuffer = mResultBuffer.concat(mergeBlocks(result)); + return; + }, + finishDecrypt: function() { + var result = mResultBuffer; + var verified = paddingScheme.unpad(result); + clearState(); + return result; + } + }; + }; + if (typeof operations !== "undefined") { + var cbcInstances = {}; + msrcryptoCbc.workerEncrypt = function(p) { + var result, id = p.workerid; + if (!cbcInstances[id]) { + cbcInstances[id] = msrcryptoCbc(msrcryptoBlockCipher.aes(p.keyData)); + cbcInstances[id].init(p.algorithm.iv); + } + if (p.operationSubType === "process") { + return cbcInstances[id].processEncrypt(p.buffer); + } + if (p.operationSubType === "finish") { + result = cbcInstances[id].finishEncrypt(); + cbcInstances[id] = null; + return result; + } + result = cbcInstances[id].encrypt(p.buffer); + cbcInstances[id] = null; + return result; + }; + msrcryptoCbc.workerDecrypt = function(p) { + var result, id = p.workerid; + if (!cbcInstances[id]) { + cbcInstances[id] = msrcryptoCbc(msrcryptoBlockCipher.aes(p.keyData)); + cbcInstances[id].init(p.algorithm.iv); + } + if (p.operationSubType === "process") { + cbcInstances[id].processDecrypt(p.buffer); + return; + } + if (p.operationSubType === "finish") { + result = cbcInstances[id].finishDecrypt(); + cbcInstances[id] = null; + return result; + } + result = cbcInstances[id].decrypt(p.buffer); + cbcInstances[id] = null; + return result; + }; + msrcryptoCbc.generateKey = function(p) { + if (p.algorithm.length % 8 !== 0) { + throw new Error(); + } + return { + type: "keyGeneration", + keyData: msrcryptoPseudoRandom.getBytes(Math.floor(p.algorithm.length / 8)), + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: p.usages, + type: "secret" + } + }; + }; + msrcryptoCbc.importKey = function(p) { + var keyObject; + var keyBits = p.keyData.length * 8; + if (p.format === "jwk") { + keyObject = msrcryptoJwk.jwkToKey(p.keyData, p.algorithm, ["k"]); + } else if (p.format === "raw") { + if (keyBits !== 128 && keyBits !== 192 && keyBits !== 256) { + throw new Error("invalid key length (should be 128, 192, or 256 bits)"); + } + keyObject = { + k: msrcryptoUtilities.toArray(p.keyData) + }; + } else { + throw new Error("unsupported import format"); + } + p.algorithm.length = keyObject.k.length * 8; + return { + keyData: keyObject.k, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: "secret" + }, + type: "keyImport" + }; + }; + msrcryptoCbc.exportKey = function(p) { + if (p.format === "jwk") { + return { + type: "keyExport", + keyHandle: msrcryptoJwk.keyToJwk(p.keyHandle, p.keyData) + }; + } + if (p.format === "raw") { + return { + type: "keyExport", + keyHandle: p.keyData + }; + } + throw new Error("unsupported export format"); + }; + operations.register("importKey", "AES-CBC", msrcryptoCbc.importKey); + operations.register("exportKey", "AES-CBC", msrcryptoCbc.exportKey); + operations.register("generateKey", "AES-CBC", msrcryptoCbc.generateKey); + operations.register("encrypt", "AES-CBC", msrcryptoCbc.workerEncrypt); + operations.register("decrypt", "AES-CBC", msrcryptoCbc.workerDecrypt); + } + var msrcryptoGcm = function(blockCipher) { + var utils2 = msrcryptoUtilities; + var mBuffer = [], mIvBytes, mAdditionalBytes, mTagLength, mJ0, mJ0inc, mH = blockCipher.encrypt(utils2.getVector(16)), mGHashState = utils2.getVector(16), mGHashBuffer = [], mCipherText = [], mGctrCb, mBytesProcessed = 0; + function ghash(hashSubkey, dataBytes) { + var blockCount = Math.floor(dataBytes.length / 16), dataBlock; + for (var i2 = 0; i2 < blockCount; i2++) { + dataBlock = dataBytes.slice(i2 * 16, i2 * 16 + 16); + mGHashState = blockMultiplication(utils2.xorVectors(mGHashState, dataBlock), hashSubkey); + } + mGHashBuffer = dataBytes.slice(blockCount * 16); + return mGHashState; + } + function finishGHash() { + var u = 16 * Math.ceil(mBytesProcessed / 16) - mBytesProcessed; + var lenA = numberTo8Bytes(mAdditionalBytes.length * 8), lenC = numberTo8Bytes(mBytesProcessed * 8); + var p = mGHashBuffer.concat(utils2.getVector(u)).concat(lenA).concat(lenC); + return ghash(mH, p); + } + function blockMultiplication(blockX, blockY) { + var z = utils2.getVector(16), v = blockY.slice(0), mask, j, i2; + for (i2 = 0; i2 < 128; i2++) { + mask = -getBit(blockX, i2) & 255; + for (j = 0; j < 16; j++) { + z[j] = z[j] ^ v[j] & mask; + } + mask = -(v[15] & 1) & 255; + shiftRight(v); + v[0] ^= 225 & mask; + } + return z; + } + function shiftRight(dataBytes) { + for (var i2 = dataBytes.length - 1; i2 > 0; i2--) { + dataBytes[i2] = (dataBytes[i2 - 1] & 1) << 7 | dataBytes[i2] >>> 1; + } + dataBytes[0] = dataBytes[0] >>> 1; + return dataBytes; + } + function getBit(byteArray, bitNumber) { + var byteIndex = Math.floor(bitNumber / 8); + return byteArray[byteIndex] >> 7 - bitNumber % 8 & 1; + } + function inc(dataBytes) { + var carry = 256; + for (var i2 = 1; i2 <= 4; i2++) { + carry = (carry >>> 8) + dataBytes[dataBytes.length - i2]; + dataBytes[dataBytes.length - i2] = carry & 255; + } + return dataBytes; + } + function gctr(icb, dataBytes) { + var blockCount = Math.ceil(dataBytes.length / 16), dataBlock, result = []; + if (mGctrCb !== icb) { + mGctrCb = icb.slice(); + } + for (var block = 0; block < blockCount; block++) { + dataBlock = dataBytes.slice(block * 16, block * 16 + 16); + var e = blockCipher.encrypt(mGctrCb.slice()); + result = result.concat(utils2.xorVectors(dataBlock, e)); + mGctrCb = inc(mGctrCb); + } + return result; + } + function numberTo8Bytes(integer) { + return [0, 0, 0, 0, integer >>> 24 & 255, integer >>> 16 & 255, integer >>> 8 & 255, integer & 255]; + } + function padBlocks(dataBytes) { + var padLen = 16 * Math.ceil(mAdditionalBytes.length / 16) - mAdditionalBytes.length; + return dataBytes.concat(utils2.getVector(padLen)); + } + function clearState() { + mBytesProcessed = 0; + mBuffer = []; + mCipherText = []; + mGHashState = utils2.getVector(16); + mGHashBuffer = []; + mGctrCb = mIvBytes = mAdditionalBytes = null; + } + function init(ivBytes, additionalBytes, tagLength) { + mAdditionalBytes = additionalBytes || []; + mTagLength = isNaN(tagLength) ? 128 : tagLength; + if (mTagLength % 8 !== 0) { + throw new Error("DataError"); + } + mIvBytes = ivBytes; + if (mIvBytes.length === 12) { + mJ0 = mIvBytes.concat([0, 0, 0, 1]); + } else { + var l = 16 * Math.ceil(mIvBytes.length / 16) - mIvBytes.length; + mJ0 = ghash(mH, mIvBytes.concat(utils2.getVector(l + 8)).concat(numberTo8Bytes(mIvBytes.length * 8))); + mGHashState = utils2.getVector(16); + } + mJ0inc = inc(mJ0.slice()); + ghash(mH, padBlocks(mAdditionalBytes)); + } + function encrypt(plainBytes) { + mBytesProcessed = plainBytes.length; + var c = gctr(mJ0inc, plainBytes); + ghash(mH, c); + var s = finishGHash(); + var t = gctr(mJ0, s).slice(0, mTagLength / 8); + clearState(); + return c.slice().concat(t); + } + function decrypt(cipherBytes, tagBytes) { + mBytesProcessed = cipherBytes.length; + var p = gctr(mJ0inc, cipherBytes); + ghash(mH, cipherBytes); + var s = finishGHash(); + var t = gctr(mJ0, s).slice(0, mTagLength / 8); + clearState(); + if (utils2.arraysEqual(t, tagBytes)) { + return p; + } else { + return null; + } + } + function processEncrypt(plainBytes) { + mBuffer = mBuffer.concat(plainBytes); + var fullBlocks = mBuffer.slice(0, Math.floor(mBuffer.length / 16) * 16); + mBytesProcessed += fullBlocks.length; + mBuffer = mBuffer.slice(fullBlocks.length); + var c = gctr(mGctrCb || mJ0inc, fullBlocks); + mCipherText = mCipherText.concat(c); + ghash(mH, c); + } + function processDecrypt(cipherBytes) { + mBuffer = mBuffer.concat(cipherBytes); + var fullBlocks = mBuffer.slice(0, Math.floor((mBuffer.length - mTagLength / 8) / 16) * 16); + mBytesProcessed += fullBlocks.length; + mBuffer = mBuffer.slice(fullBlocks.length); + var c = gctr(mGctrCb || mJ0inc, fullBlocks); + mCipherText = mCipherText.concat(c); + ghash(mH, fullBlocks); + } + function finishEncrypt() { + var c = gctr(mGctrCb, mBuffer); + mCipherText = mCipherText.concat(c); + mBytesProcessed += mBuffer.length; + var s = finishGHash(); + var t = gctr(mJ0, s).slice(0, mTagLength / 8); + var result = mCipherText.slice().concat(t); + clearState(); + return result; + } + function finishDecrypt() { + var tagLength = Math.floor(mTagLength / 8); + var tagBytes = mBuffer.slice(-tagLength); + mBuffer = mBuffer.slice(0, mBuffer.length - tagLength); + var c = gctr(mGctrCb, mBuffer); + mCipherText = mCipherText.concat(c); + mBytesProcessed += mBuffer.length; + var s = finishGHash(); + var t = gctr(mJ0, s).slice(0, mTagLength / 8); + var result = mCipherText.slice(); + clearState(); + if (utils2.arraysEqual(t, tagBytes)) { + return result; + } else { + return null; + } + } + return { + init, + encrypt, + decrypt, + processEncrypt, + processDecrypt, + finishEncrypt, + finishDecrypt + }; + }; + if (typeof operations !== "undefined") { + var gcmInstances = {}; + msrcryptoGcm.encrypt = function(p) { + var result, id = p.workerid; + if (!gcmInstances[id]) { + gcmInstances[id] = msrcryptoGcm(msrcryptoBlockCipher.aes(p.keyData)); + gcmInstances[id].init(p.algorithm.iv, p.algorithm.additionalData, p.algorithm.tagLength); + } + if (p.operationSubType === "process") { + gcmInstances[id].processEncrypt(p.buffer); + return; + } + if (p.operationSubType === "finish") { + result = gcmInstances[id].finishEncrypt(); + gcmInstances[id] = null; + return result; + } + result = gcmInstances[id].encrypt(p.buffer); + gcmInstances[id] = null; + return result; + }; + msrcryptoGcm.decrypt = function(p) { + var result, id = p.workerid; + if (!gcmInstances[id]) { + gcmInstances[id] = msrcryptoGcm(msrcryptoBlockCipher.aes(p.keyData)); + gcmInstances[id].init(p.algorithm.iv, p.algorithm.additionalData, p.algorithm.tagLength); + } + if (p.operationSubType === "process") { + gcmInstances[id].processDecrypt(p.buffer); + return; + } + if (p.operationSubType === "finish") { + result = gcmInstances[id].finishDecrypt(); + gcmInstances[id] = null; + if (result === null) { + throw new Error("OperationError"); + } + return result; + } + var tagLength = p.algorithm.tagLength ? Math.floor(p.algorithm.tagLength / 8) : 16; + var cipherBytes = p.buffer.slice(0, p.buffer.length - tagLength); + var tagBytes = p.buffer.slice(-tagLength); + result = gcmInstances[id].decrypt(cipherBytes, tagBytes); + gcmInstances[id] = null; + if (result === null) { + throw new Error("OperationError"); + } + return result; + }; + msrcryptoGcm.generateKey = function(p) { + if (p.algorithm.length % 8 !== 0) { + throw new Error(); + } + return { + type: "keyGeneration", + keyData: msrcryptoPseudoRandom.getBytes(Math.floor(p.algorithm.length / 8)), + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: p.usages, + type: "secret" + } + }; + }; + msrcryptoGcm.importKey = function(p) { + var keyObject, keyBits = p.keyData.length * 8; + if (p.format === "jwk") { + keyObject = msrcryptoJwk.jwkToKey(p.keyData, p.algorithm, ["k"]); + } else if (p.format === "raw") { + if (keyBits !== 128 && keyBits !== 192 && keyBits !== 256) { + throw new Error("invalid key length (should be 128, 192, or 256 bits)"); + } + keyObject = { + k: msrcryptoUtilities.toArray(p.keyData) + }; + } else { + throw new Error("unsupported import format"); + } + return { + type: "keyImport", + keyData: keyObject.k, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: "secret" + } + }; + }; + msrcryptoGcm.exportKey = function(p) { + if (p.format === "jwk") { + return { + type: "keyExport", + keyHandle: msrcryptoJwk.keyToJwk(p.keyHandle, p.keyData) + }; + } + if (p.format === "raw") { + return { + type: "keyExport", + keyHandle: p.keyData + }; + } + throw new Error("unsupported export format"); + }; + operations.register("importKey", "AES-GCM", msrcryptoGcm.importKey); + operations.register("exportKey", "AES-GCM", msrcryptoGcm.exportKey); + operations.register("generateKey", "AES-GCM", msrcryptoGcm.generateKey); + operations.register("encrypt", "AES-GCM", msrcryptoGcm.encrypt); + operations.register("decrypt", "AES-GCM", msrcryptoGcm.decrypt); + } + function MsrcryptoPrng() { + if (!(this instanceof MsrcryptoPrng)) { + throw new Error("create MsrcryptoPrng object with new keyword"); + } + var initialized = false; + var key; + var v; + var keyLen; + var seedLen; + var reseedCounter = 1; + var reseedInterval = Math.pow(2, 48); + initialize(); + function addOne(counter) { + var i2; + for (i2 = counter.length - 1; i2 >= 0; i2 -= 1) { + counter[i2] += 1; + if (counter[i2] >= 256) { + counter[i2] = 0; + } + if (counter[i2]) { + break; + } + } + } + function initialize() { + key = msrcryptoUtilities.getVector(32); + v = msrcryptoUtilities.getVector(16); + keyLen = 32; + seedLen = 48; + reseedCounter = 1; + } + function reseed(entropy, additionalEntropy) { + additionalEntropy = additionalEntropy || [0]; + if (additionalEntropy.length > seedLen) { + throw new Error("Incorrect entropy or additionalEntropy length"); + } + additionalEntropy = additionalEntropy.concat(msrcryptoUtilities.getVector(seedLen - additionalEntropy.length)); + entropy = entropy.concat(msrcryptoUtilities.getVector((seedLen - entropy.length % seedLen) % seedLen)); + for (var i2 = 0; i2 < entropy.length; i2 += seedLen) { + var seedMaterial = msrcryptoUtilities.xorVectors(entropy.slice(i2, i2 + seedLen), additionalEntropy); + update(seedMaterial); + } + reseedCounter = 1; + } + function update(providedData) { + var temp = []; + var blockCipher = new msrcryptoBlockCipher.aes(key); + while (temp.length < seedLen) { + addOne(v); + var toEncrypt = v.slice(0, 16); + var outputBlock = blockCipher.encrypt(toEncrypt); + temp = temp.concat(outputBlock); + } + temp = msrcryptoUtilities.xorVectors(temp, providedData); + key = temp.slice(0, keyLen); + v = temp.slice(keyLen); + } + function generate(requestedBytes, additionalInput) { + if (requestedBytes >= 65536) { + throw new Error("too much random requested"); + } + if (reseedCounter > reseedInterval) { + throw new Error("Reseeding is required"); + } + if (additionalInput && additionalInput.length > 0) { + while (additionalInput.length < seedLen) { + additionalInput = additionalInput.concat(msrcryptoUtilities.getVector(seedLen - additionalInput.length)); + } + update(additionalInput); + } else { + additionalInput = msrcryptoUtilities.getVector(seedLen); + } + var temp = []; + var blockCipher = new msrcryptoBlockCipher.aes(key); + while (temp.length < requestedBytes) { + addOne(v); + var toEncrypt = v.slice(0, v.length); + var outputBlock = blockCipher.encrypt(toEncrypt); + temp = temp.concat(outputBlock); + } + temp = temp.slice(0, requestedBytes); + update(additionalInput); + reseedCounter += 1; + return temp; + } + return { + reseed, + getBytes: function(length, additionalInput) { + if (!initialized) { + throw new Error("can't get randomness before initialization"); + } + return generate(length, additionalInput); + }, + getNonZeroBytes: function(length, additionalInput) { + if (!initialized) { + throw new Error("can't get randomness before initialization"); + } + var result = []; + var buff; + while (result.length < length) { + buff = generate(length, additionalInput); + for (var i2 = 0; i2 < buff.length; i2 += 1) { + if (buff[i2] !== 0) { + result.push(buff[i2]); + } + } + } + return result.slice(0, length); + }, + init: function(entropy, personalization) { + if (entropy.length < seedLen) { + throw new Error("Initial entropy length too short"); + } + initialize(); + reseed(entropy, personalization); + initialized = true; + } + }; + } + var msrcryptoPseudoRandom = new MsrcryptoPrng(); + function MsrcryptoEntropy() { + var poolLength = 48; + var collectorPool = []; + var collectorPoolLength = 128; + var collectorsRegistered = 0; + var entropyPoolPrng = new MsrcryptoPrng(); + var initialized = false; + var cryptographicPRNGPresent = false; + function collectEntropy() { + var headerList = [ + "Cookie", + "RedirectUri", + "ETag", + "x-ms-client-antiforgery-id", + "x-ms-client-request-id", + "x-ms-client-session-id", + "SubscriptionPool" + ]; + var i2, pool = []; + for (i2 = 0; i2 < poolLength; i2 += 1) { + pool[i2] = Math.floor(Math.random() * 256); + } + var prngCrypto = global2.crypto || global2.msCrypto; + if (prngCrypto && typeof prngCrypto.getRandomValues === "function") { + if (global2.Uint8Array) { + var res = new global2.Uint8Array(poolLength); + prngCrypto.getRandomValues(res); + pool = pool.concat(Array.apply(null, res)); + cryptographicPRNGPresent = true; + } + } + if (typeof XMLHttpRequest !== "undefined") { + var req = new XMLHttpRequest(); + for (i2 = 0; i2 < headerList.length; i2 += 1) { + try { + var header = req.getResponseHeader(headerList[i2]); + if (header) { + var arr = msrcryptoUtilities.stringToBytes(header); + pool = pool.concat(arr); + } + } catch (err) { + } + } + } + if (!cryptographicPRNGPresent && canCollect) { + pool = pool.concat(collectorPool.splice(0, collectorPool.length)); + collectors.startCollectors(); + } + initialized ? entropyPoolPrng.reseed(pool) : entropyPoolPrng.init(pool); + initialized = true; + } + function updatePool(entropyData) { + for (var i2 = 0; i2 < entropyData.length; ++i2) { + collectorPool.push(entropyData[i2]); + } + if (collectorPool.length >= collectorPoolLength) { + collectors.stopCollectors(); + } + } + var canCollect = global2 && global2.addEventListener || typeof document !== "undefined" && document.attachEvent; + var collectors = /* @__PURE__ */ (function() { + return { + startCollectors: function() { + if (!this.collectorsRegistered) { + if (global2.addEventListener) { + global2.addEventListener("mousemove", this.MouseEventCallBack, true); + global2.addEventListener("load", this.LoadTimeCallBack, true); + } else if (document.attachEvent) { + document.attachEvent("onmousemove", this.MouseEventCallBack); + document.attachEvent("onload", this.LoadTimeCallBack); + } else { + throw new Error("Can't attach events for entropy collection"); + } + this.collectorsRegistered = 1; + } + }, + stopCollectors: function() { + if (this.collectorsRegistered) { + if (global2.removeEventListener) { + global2.removeEventListener("mousemove", this.MouseEventCallBack, 1); + global2.removeEventListener("load", this.LoadTimeCallBack, 1); + } else if (global2.detachEvent) { + global2.detachEvent("onmousemove", this.MouseEventCallBack); + global2.detachEvent("onload", this.LoadTimeCallBack); + } + this.collectorsRegistered = 0; + } + }, + MouseEventCallBack: function(eventData) { + var d = (/* @__PURE__ */ new Date()).valueOf(); + var x = eventData.x || eventData.clientX || eventData.offsetX || 0; + var y = eventData.y || eventData.clientY || eventData.offsetY || 0; + var arr = [ + d & 255, + d >> 8 & 255, + d >> 16 & 255, + d >> 24 & 255, + x & 255, + x >> 8 & 255, + y & 255, + y >> 8 & 255 + ]; + updatePool(arr); + }, + LoadTimeCallBack: function() { + var d = (/* @__PURE__ */ new Date()).valueOf(); + var dateArray = [d & 255, d >> 8 & 255, d >> 16 & 255, d >> 24 & 255]; + updatePool(dateArray); + } + }; + })(); + return { + init: function() { + collectEntropy(); + if (!cryptographicPRNGPresent && !collectorsRegistered && canCollect) { + try { + collectors.startCollectors(); + } catch (e) { + } + } + }, + reseed: function(entropy) { + entropyPoolPrng.reseed(entropy); + }, + read: function(length) { + if (!initialized) { + throw new Error("Entropy pool is not initialized."); + } + var ret = entropyPoolPrng.getBytes(length); + collectEntropy(); + return ret; + } + }; + } + var prime = (function() { + var smallPrimes = []; + var trialValues = []; + var MAX_SMALL_PRIMES = 4096 * 4; + function primeSieve(max) { + var numbers = new Array(max + 1), results = [], i2, j, limit = Math.sqrt(max) | 0; + for (i2 = 3; i2 <= limit; i2 += 2) { + for (j = i2 * i2; j <= max; j += i2 * 2) { + numbers[j] = 0; + } + } + for (i2 = 3; i2 <= max; i2 += 2) { + if (numbers[i2] !== 0) { + results.push(i2); + } + } + return results; + } + function incrementalTrialDivision(increment) { + var i2, len = trialValues.length; + for (i2 = 0; i2 < len; i2++) { + if ((trialValues[i2] + increment) % smallPrimes[i2] === 0) { + return false; + } + } + return true; + } + function setupIncrementalTrialDivision(candidate) { + var i2, j, r, p, y, primeCount, len = candidate.length - 1, db = cryptoMath.DIGIT_BASE, h = candidate[len]; + if (smallPrimes.length === 0) { + smallPrimes = primeSieve(MAX_SMALL_PRIMES); + } + primeCount = smallPrimes.length; + trialValues = new Array(primeCount); + for (i2 = 0; i2 < primeCount; i2++) { + j = len; + y = smallPrimes[i2]; + if (h < y) { + r = h; + j--; + } else { + r = 0; + } + while (j >= 0) { + p = r * db + candidate[j--]; + r = p - (p / y | 0) * y; + } + trialValues[i2] = r; + } + return; + } + function largestDivisibleByPowerOfTwo(number) { + var k = 0, i2 = 0, s = 0, j; + if (cryptoMath.isZero(number)) { + return 0; + } + for (k = 0; number[k] === 0; k++) { + } + for (i2 = 0, j = 2; number[k] % j === 0; j *= 2, i2++) { + } + return k * cryptoMath.DIGIT_BITS + i2; + } + function sizeInBits(digits) { + var k = 0, i2 = 0, j = 0; + if (cryptoMath.isZero(digits)) { + return 0; + } + for (k = digits.length - 1; digits[k] === 0; k--) { + } + for (i2 = cryptoMath.DIGIT_BITS - 1, j = 1 << i2; i2 > 0; j = j >>> 1, i2--) { + if ((digits[k] & j) !== 0) { + break; + } + } + return k * cryptoMath.DIGIT_BITS + i2; + } + function millerRabin(number, iterations) { + var w = number; + var wminus1 = []; + cryptoMath.subtract(w, [1], wminus1); + var a = largestDivisibleByPowerOfTwo(wminus1); + var m = []; + cryptoMath.shiftRight(wminus1, m, a); + var wlen = sizeInBits(w); + var b; + var montmul = cryptoMath.MontgomeryMultiplier(w); + for (var i2 = 1; i2 <= iterations; i2++) { + var status = false; + do { + b = getRandomOddNumber(wlen); + } while (cryptoMath.compareDigits(b, wminus1) >= 0); + var z = []; + montmul.modExp(b, m, z, true); + if (cryptoMath.compareDigits(z, [1]) === 0 || cryptoMath.compareDigits(z, wminus1) === 0) { + continue; + } + for (var j = 1; j < a; j++) { + montmul.montgomeryMultiply(z, z, z); + if (cryptoMath.compareDigits(z, wminus1) === 0) { + status = true; + break; + } + if (cryptoMath.compareDigits(z, [1]) === 0) { + return false; + } + } + if (status === false) { + return false; + } + } + return true; + } + function generatePrime(bits) { + var candidate = getRandomOddNumber(bits), inc = 0, possiblePrime, isPrime = false, candidatePlusInc = []; + setupIncrementalTrialDivision(candidate); + while (true) { + possiblePrime = incrementalTrialDivision(inc); + if (possiblePrime) { + cryptoMath.add(candidate, [inc], candidatePlusInc); + if (millerRabin(candidatePlusInc, 6) === true) { + return candidatePlusInc; + } + } + inc += 2; + } + } + function getRandomOddNumber(bits) { + var numBytes = Math.ceil(bits / 8), bytes = msrcryptoPseudoRandom.getBytes(numBytes), digits; + bytes[0] |= 128; + bytes[bytes.length - 1] |= 1; + return cryptoMath.bytesToDigits(bytes); + } + return { + generatePrime + }; + })(); + var msrcryptoRsaBase = function(keyStruct) { + var utils2 = msrcryptoUtilities, keyIsPrivate = keyStruct.hasOwnProperty("n") && keyStruct.hasOwnProperty("d"), keyIsCrt = keyStruct.hasOwnProperty("p") && keyStruct.hasOwnProperty("q"), modulusLength = keyStruct.n.length; + function toBytes(digits) { + var bytes = cryptoMath.digitsToBytes(digits); + utils2.padFront(bytes, 0, modulusLength); + return bytes; + } + function modExp(dataBytes, expBytes, modulusBytes) { + var exponent = cryptoMath.bytesToDigits(expBytes); + var group = cryptoMath.IntegerGroup(modulusBytes); + var base = group.createElementFromBytes(dataBytes); + var result = group.modexp(base, exponent); + return result.m_digits; + } + function decryptModExp(cipherBytes) { + var resultElement = modExp(cipherBytes, keyStruct.d, keyStruct.n); + return toBytes(resultElement); + } + function decryptCrt(cipherBytes) { + var b2d = cryptoMath.bytesToDigits, p = keyStruct.p, q = keyStruct.q, dp = keyStruct.dp, dq = keyStruct.dq, invQ = keyStruct.qi, pDigits = b2d(p), qDigits = b2d(q), temp = new Array(pDigits.length + qDigits.length), m1Digits = new Array(pDigits.length + 1), m2Digits = new Array(qDigits.length + 1), cDigits = b2d(cipherBytes), mm = cryptoMath.MontgomeryMultiplier, mmp = new mm(keyStruct.ctxp ? void 0 : pDigits, keyStruct.ctxp), mmq = new mm(keyStruct.ctxq ? void 0 : qDigits, keyStruct.ctxq); + mmp.reduce(cDigits, temp); + mmp.modExp(temp, b2d(dp), m1Digits); + mmq.reduce(cDigits, temp); + mmq.modExp(temp, b2d(dq), m2Digits); + var carry = cryptoMath.subtract(m1Digits, m2Digits, temp); + if (carry !== 0) { + cryptoMath.subtract(m2Digits, m1Digits, temp); + } + cryptoMath.modMul(temp, b2d(invQ), pDigits, cDigits); + if (carry !== 0) { + cryptoMath.subtract(pDigits, cDigits, cDigits); + } + cryptoMath.multiply(cDigits, qDigits, temp); + cryptoMath.add(m2Digits, temp, m1Digits); + return toBytes(m1Digits); + } + return { + encrypt: function(messageBytes) { + var bytes = toBytes(modExp(messageBytes, keyStruct.e, keyStruct.n, true)); + return bytes; + }, + decrypt: function(cipherBytes) { + if (keyIsCrt) { + return decryptCrt(cipherBytes); + } + if (keyIsPrivate) { + return decryptModExp(cipherBytes); + } + throw new Error("missing private key"); + } + }; + }; + var rsaShared = { + mgf1: function(seedBytes, maskLen, hashFunction) { + var t = [], bytes, hash, counter, hashByteLen = hashFunction.hashLen / 8; + for (counter = 0; counter <= Math.floor(maskLen / hashByteLen); counter += 1) { + bytes = [counter >>> 24 & 255, counter >>> 16 & 255, counter >>> 8 & 255, counter & 255]; + hash = hashFunction.computeHash(seedBytes.concat(bytes)); + t = t.concat(hash); + } + return t.slice(0, maskLen); + }, + checkMessageVsMaxHash: function(messageBytes, hashFunction) { + if (messageBytes.length > (hashFunction.maxMessageSize || 4294967295)) { + throw new Error("message too long"); + } + return; + } + }; + var rsaMode = rsaMode || {}; + rsaMode.oaep = function(keyStruct, hashFunction) { + var utils2 = msrcryptoUtilities, random = msrcryptoPseudoRandom, size = keyStruct.n.length; + if (hashFunction === null) { + throw new Error("must supply hashFunction"); + } + function pad(message, label) { + var lHash, psLen, psArray, i2, db, seed; + var dbMask, maskeddb, seedMask, maskedSeed; + var encodedMessage; + if (message.length > size - 2 * (hashFunction.hashLen / 8) - 2) { + throw new Error("Message too long."); + } + if (label == null) { + label = []; + } + lHash = hashFunction.computeHash(label); + psLen = size - message.length - 2 * lHash.length - 2; + psArray = utils2.getVector(psLen); + db = lHash.concat(psArray, [1], message); + seed = random.getBytes(lHash.length); + dbMask = rsaShared.mgf1(seed, size - lHash.length - 1, hashFunction); + maskeddb = utils2.xorVectors(db, dbMask); + seedMask = rsaShared.mgf1(maskeddb, lHash.length, hashFunction); + maskedSeed = utils2.xorVectors(seed, seedMask); + encodedMessage = [0].concat(maskedSeed).concat(maskeddb); + message = encodedMessage.slice(); + return message; + } + function unpad(encodedBytes, labelBytes) { + var lHash, maskedSeed, maskeddb, seedMask; + var seed, dbMask, db; + var lHashp, i2 = 0; + var valid = encodedBytes[0] === 0; + if (!labelBytes) { + labelBytes = []; + } + lHash = hashFunction.computeHash(labelBytes); + maskedSeed = encodedBytes.slice(1, lHash.length + 1); + maskeddb = encodedBytes.slice(lHash.length + 1); + seedMask = rsaShared.mgf1(maskeddb, lHash.length, hashFunction); + seed = utils2.xorVectors(maskedSeed, seedMask); + dbMask = rsaShared.mgf1(seed, size - lHash.length - 1, hashFunction); + db = utils2.xorVectors(maskeddb, dbMask); + lHashp = db.slice(0, lHash.length); + valid = valid && utils2.arraysEqual(lHash, lHashp); + db = db.slice(lHash.length); + while (!db[i2++]) { + } + return { + valid, + data: db.slice(i2) + }; + } + return { + pad: function(messageBytes, labelBytes) { + return pad(messageBytes, labelBytes); + }, + unpad: function(encodedBytes, labelBytes) { + return unpad(encodedBytes, labelBytes); + } + }; + }; + var rsaMode = rsaMode || {}; + rsaMode.pkcs1Encrypt = function(keyStruct) { + var random = msrcryptoPseudoRandom, size = keyStruct.n.length; + function pad(data) { + var randomness; + if (data.length > size - 11) { + throw new Error("message too long"); + } + randomness = random.getNonZeroBytes(size - data.length - 3); + return [0, 2].concat(randomness, [0], data); + } + function validatePadding(paddedData) { + var paddingValid = paddedData[0] === 0 && paddedData[1] === 2; + for (var i2 = 2; i2 < 10; i2++) { + paddingValid = paddingValid && !!paddedData[i2]; + } + return paddingValid; + } + function unpad(paddedData) { + var i2, paddingIsValid = validatePadding(paddedData), startOfData = 0; + for (i2 = 1; i2 < paddedData.length; i2 += 1) { + startOfData = startOfData || +!paddedData[i2] && i2 + 1; + } + startOfData = -paddingIsValid && startOfData; + return { + data: paddedData.slice(startOfData), + valid: paddingIsValid + }; + } + return { + pad: function(messageBytes) { + return pad(messageBytes); + }, + unpad: function(encodedBytes) { + return unpad(encodedBytes); + } + }; + }; + rsaMode.pkcs1Sign = function(keyStruct, hashFunction) { + var utils2 = msrcryptoUtilities, size = keyStruct.n.length; + function emsa_pkcs1_v15_encode(messageBytes) { + var paddedData, hash, tlen; + hash = hashFunction.computeHash(messageBytes.slice()); + paddedData = hashFunction.der.concat(hash); + tlen = paddedData.length; + if (size < tlen + 11) { + throw new Error("intended encoded message length too short"); + } + return [0, 1].concat(utils2.getVector(size - tlen - 3, 255), [0], paddedData); + } + return { + sign: function(messageBytes) { + return emsa_pkcs1_v15_encode(messageBytes); + }, + verify: function(signatureBytes, messageBytes) { + var emp = emsa_pkcs1_v15_encode(messageBytes); + return utils2.arraysEqual(signatureBytes, emp); + } + }; + }; + var rsaMode = rsaMode || {}; + rsaMode.pss = function(keyStruct, hashFunction) { + var utils2 = msrcryptoUtilities, random = msrcryptoPseudoRandom; + function emsa_pss_encode(messageBytes, saltLength, salt) { + var modulusBits = cryptoMath.bitLength(keyStruct.n), emBits = modulusBits - 1, emLen = Math.ceil(emBits / 8), mHash = hashFunction.computeHash(messageBytes); + saltLength = salt ? salt.length : saltLength == null ? mHash.length : saltLength; + if (emLen < mHash.length + saltLength + 2) { + throw new Error("encoding error"); + } + salt = salt || random.getBytes(saltLength); + var mp = [0, 0, 0, 0, 0, 0, 0, 0].concat(mHash, salt); + var h = hashFunction.computeHash(mp); + var ps = utils2.getVector(emLen - salt.length - h.length - 2); + var db = ps.concat([1], salt); + var dbMask = rsaShared.mgf1(h, emLen - h.length - 1, hashFunction); + var maskedDb = utils2.xorVectors(db, dbMask); + var mask = 0; + for (var i2 = 0; i2 < 8 - (8 * emLen - emBits); i2++) { + mask += 1 << i2; + } + maskedDb[0] &= mask; + var em = maskedDb.concat(h, [188]); + return em; + } + function emsa_pss_verify(signatureBytes, messageBytes, saltLength) { + var modulusBits = cryptoMath.bitLength(keyStruct.n); + var emBits = modulusBits - 1; + var emLen = Math.ceil(emBits / 8); + var mHash = hashFunction.computeHash(messageBytes); + var hLen = mHash.length; + saltLength = saltLength == null ? hLen : saltLength; + if (emLen < hLen + saltLength + 2) { + return false; + } + var maskedDb = signatureBytes.slice(0, emLen - hLen - 1); + var h = signatureBytes.slice(maskedDb.length, maskedDb.length + hLen); + var dbMask = rsaShared.mgf1(h, emLen - hLen - 1, hashFunction); + var db = utils2.xorVectors(maskedDb, dbMask); + db[0] &= 255 >>> 8 - (8 * emLen - emBits); + for (var i2 = 0; i2 < emLen - hLen - saltLength - 2; i2++) { + if (db[i2] !== 0) { + return false; + } + } + if (db[emLen - hLen - saltLength - 2] !== 1) { + return false; + } + var salt = db.slice(db.length - saltLength); + var mp = [0, 0, 0, 0, 0, 0, 0, 0].concat(mHash, salt); + var hp = hashFunction.computeHash(mp); + return utils2.arraysEqual(hp, h); + } + return { + sign: function(messageBytes, saltLength, salt) { + return emsa_pss_encode(messageBytes, saltLength, salt); + }, + verify: function(signatureBytes, messageBytes, saltLength) { + return emsa_pss_verify(signatureBytes, messageBytes, saltLength); + } + }; + }; + var msrcryptoRsa = function(keyStruct, mode, hashFunction) { + var rsaBase = msrcryptoRsaBase(keyStruct); + if (!mode) { + throw new Error("padding mode"); + } + function checkHash() { + if (!hashFunction || !hashFunction.computeHash) { + throw new Error("missing hash function"); + } + } + var paddingFunction = null, unPaddingFunction = null; + var padding; + switch (mode) { + case "RSAES-PKCS1-V1_5": + padding = rsaMode.pkcs1Encrypt(keyStruct); + break; + case "RSASSA-PKCS1-V1_5": + checkHash(); + padding = rsaMode.pkcs1Sign(keyStruct, hashFunction); + break; + case "RSA-OAEP": + checkHash(); + padding = rsaMode.oaep(keyStruct, hashFunction); + break; + case "RSA-PSS": + checkHash(); + padding = rsaMode.pss(keyStruct, hashFunction); + break; + case "raw": + padding = { + pad: function(mb) { + return mb; + }, + unpad: function(eb) { + return eb; + } + }; + break; + default: + throw new Error("invalid mode"); + } + if (padding) { + paddingFunction = padding.pad || padding.sign; + unPaddingFunction = padding.unpad || padding.verify; + } + var returnObj = { + encrypt: function(dataBytes, labelBytes) { + var paddedData; + var encryptedData; + if (paddingFunction !== null) { + paddedData = paddingFunction(dataBytes, labelBytes); + } else { + paddedData = dataBytes.slice(); + } + encryptedData = rsaBase.encrypt(paddedData); + return encryptedData; + }, + decrypt: function(cipherBytes, labelBytes) { + var decryptedData = rsaBase.decrypt(cipherBytes); + if (unPaddingFunction !== null) { + decryptedData = unPaddingFunction(decryptedData, labelBytes); + if (decryptedData.valid === false) { + throw new Error("OperationError"); + } + decryptedData = decryptedData.data; + } else { + decryptedData = decryptedData.slice(0); + } + return decryptedData; + }, + signData: function(messageBytes, saltLength, salt) { + return rsaBase.decrypt(paddingFunction(messageBytes, saltLength, salt)); + }, + verifySignature: function(signature, messageBytes, saltLength) { + var decryptedSig = rsaBase.encrypt(signature); + return unPaddingFunction(decryptedSig, messageBytes, saltLength); + }, + generateKeyPair: function(bits) { + var keyPair = genRsaKeyFromRandom(bits); + }, + mode + }; + return returnObj; + }; + if (typeof operations !== "undefined") { + msrcryptoRsa.sign = function(p) { + var rsaObj, hashName = p.keyHandle.algorithm.hash.name, hashFunc = msrcryptoHashFunctions[hashName.toUpperCase()](), saltLength = p.algorithm.saltLength, salt = p.algorithm.salt; + rsaObj = msrcryptoRsa(p.keyData, p.algorithm.name, hashFunc); + return rsaObj.signData(p.buffer, saltLength, salt); + }; + msrcryptoRsa.verify = function(p) { + var hashName = p.keyHandle.algorithm.hash.name, hashFunc = msrcryptoHashFunctions[hashName.toUpperCase()](), rsaObj, saltLength = p.algorithm.saltLength; + rsaObj = msrcryptoRsa(p.keyData, p.algorithm.name, hashFunc); + return rsaObj.verifySignature(p.signature, p.buffer, saltLength); + }; + msrcryptoRsa.workerEncrypt = function(p) { + var result, rsaObj, hashFunc, hashName; + switch (p.algorithm.name) { + case "RSAES-PKCS1-V1_5": + rsaObj = msrcryptoRsa(p.keyData, p.algorithm.name); + result = rsaObj.encrypt(p.buffer); + break; + case "RSA-OAEP": + hashName = p.keyHandle.algorithm.hash.name; + if (!hashName) { + throw new Error("unsupported hash algorithm"); + } + hashFunc = msrcryptoHashFunctions[hashName.toUpperCase()](); + rsaObj = msrcryptoRsa(p.keyData, p.algorithm.name, hashFunc); + result = rsaObj.encrypt(p.buffer); + break; + default: + throw new Error("unsupported algorithm"); + } + return result; + }; + msrcryptoRsa.workerDecrypt = function(p) { + var result, rsaObj, hashFunc; + switch (p.algorithm.name) { + case "RSAES-PKCS1-V1_5": + rsaObj = msrcryptoRsa(p.keyData, p.algorithm.name); + result = rsaObj.decrypt(p.buffer); + break; + case "RSA-OAEP": + var hashName = p.keyHandle.algorithm.hash.name; + if (!hashName) { + throw new Error("unsupported hash algorithm"); + } + hashFunc = msrcryptoHashFunctions[hashName.toUpperCase()](); + rsaObj = msrcryptoRsa(p.keyData, p.algorithm.name, hashFunc); + result = rsaObj.decrypt(p.buffer); + break; + default: + throw new Error("unsupported algorithm"); + } + return result; + }; + msrcryptoRsa.importKey = function(p) { + var keyObject; + if (p.format === "jwk") { + keyObject = msrcryptoJwk.jwkToKey(p.keyData, p.algorithm, ["n", "e", "d", "q", "p", "dq", "dp", "qi"]); + if (keyObject.d) { + keyObject.ctxp = new cryptoMath.MontgomeryMultiplier(cryptoMath.bytesToDigits(keyObject.p)).ctx; + keyObject.ctxq = new cryptoMath.MontgomeryMultiplier(cryptoMath.bytesToDigits(keyObject.q)).ctx; + } + } else if (p.format === "spki") { + var publicKeyInfo = asn1.parse(p.keyData); + if (publicKeyInfo == null) { + throw new Error("invalid key data."); + } + var bitString = publicKeyInfo[1]; + var keySequence = asn1.parse(bitString.data.slice(bitString.header + 1), true); + if (keySequence == null) { + throw new Error("invalid key data."); + } + var n = keySequence[0], e = keySequence[1]; + if (n.type !== "INTEGER" || e.type !== "INTEGER") { + throw new Error("invalid key data."); + } + n = n.data.slice(n.header); + e = e.data.slice(e.header); + if (n[0] === 0 && n[1] & 128) { + n = n.slice(1); + } + if (e[0] === 0 && e[1] & 128) { + e = e.slice(1); + } + keyObject = { + n, + e + }; + } else { + throw new Error("unsupported key import format."); + } + return { + type: "keyImport", + keyData: keyObject, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: p.usages, + type: keyObject.d || keyObject.dq ? "private" : "public" + } + }; + }; + msrcryptoRsa.exportKey = function(p) { + var jsonKeyStringArray = msrcryptoJwk.keyToJwk(p.keyHandle, p.keyData); + return { + type: "keyExport", + keyHandle: jsonKeyStringArray + }; + }; + msrcryptoRsa.genRsaKeyFromRandom = function(bits, e) { + var exp = e ? cryptoMath.bytesToDigits(e) : [65537]; + do { + var p = prime.generatePrime(bits / 2); + var q = prime.generatePrime(bits / 2); + if (cryptoMath.compareDigits(q, p) > 0) { + var t = p; + p = q; + q = t; + } + var n = []; + cryptoMath.multiply(p, q, n); + var p_1 = []; + cryptoMath.subtract(p, [1], p_1); + var q_1 = []; + cryptoMath.subtract(q, [1], q_1); + var p_1q_1 = []; + cryptoMath.multiply(p_1, q_1, p_1q_1); + var gcd = []; + cryptoMath.gcd(exp, p_1q_1, gcd); + var gcdEqual1 = cryptoMath.compareDigits(gcd, cryptoMath.One) === 0; + } while (!gcdEqual1); + var d = []; + cryptoMath.modInv(exp, p_1q_1, d); + var dp = []; + cryptoMath.reduce(d, p_1, dp); + var dq = []; + cryptoMath.reduce(d, q_1, dq); + var qi = []; + cryptoMath.modInv(q, p, qi); + var d2b = cryptoMath.digitsToBytes; + return { + privateKey: { + n: d2b(n), + e: d2b(exp), + d: d2b(d), + p: d2b(p), + q: d2b(q), + dp: d2b(dp), + dq: d2b(dq), + qi: d2b(qi) + }, + publicKey: { + n: d2b(n), + e: d2b(exp) + } + }; + }; + msrcryptoRsa.generateKeyPair = function(p) { + if (typeof p.algorithm.modulusLength === "undefined") { + throw new Error("missing modulusLength"); + } + var keyPair; + var b2d = cryptoMath.bytesToDigits; + switch (p.algorithm.modulusLength) { + case 1024: + case 2048: + case 4096: + keyPair = msrcryptoRsa.genRsaKeyFromRandom(p.algorithm.modulusLength, p.algorithm.publicExponent); + break; + default: + throw new Error("invalid modulusLength"); + } + var pk = keyPair.privateKey; + pk.ctxp = new cryptoMath.MontgomeryMultiplier(b2d(pk.p)).ctx; + pk.ctxq = new cryptoMath.MontgomeryMultiplier(b2d(pk.q)).ctx; + var algName = p.algorithm.name; + var rsaKeyType = algName.slice(algName.indexOf("-") + 1).toUpperCase(); + var publicUsage, privateUsage; + if (algName === "RSASSA-PKCS1-V1_5" || algName === "RSA-PSS") { + publicUsage = ["verify"]; + privateUsage = ["sign"]; + } else { + publicUsage = ["encrypt"]; + privateUsage = ["decrypt"]; + } + return { + type: "keyGeneration", + keyPair: { + publicKey: { + keyData: keyPair.publicKey, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: publicUsage, + type: "public" + } + }, + privateKey: { + keyData: keyPair.privateKey, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: privateUsage, + type: "private" + } + } + } + }; + }; + operations.register("sign", "RSASSA-PKCS1-V1_5", msrcryptoRsa.sign); + operations.register("sign", "RSA-PSS", msrcryptoRsa.sign); + operations.register("verify", "RSASSA-PKCS1-V1_5", msrcryptoRsa.verify); + operations.register("verify", "RSA-PSS", msrcryptoRsa.verify); + operations.register("encrypt", "RSAES-PKCS1-V1_5", msrcryptoRsa.workerEncrypt); + operations.register("decrypt", "RSAES-PKCS1-V1_5", msrcryptoRsa.workerDecrypt); + operations.register("encrypt", "RSA-OAEP", msrcryptoRsa.workerEncrypt); + operations.register("decrypt", "RSA-OAEP", msrcryptoRsa.workerDecrypt); + operations.register("importKey", "RSA-OAEP", msrcryptoRsa.importKey); + operations.register("importKey", "RSAES-PKCS1-V1_5", msrcryptoRsa.importKey); + operations.register("importKey", "RSASSA-PKCS1-V1_5", msrcryptoRsa.importKey); + operations.register("importKey", "RSA-PSS", msrcryptoRsa.importKey); + operations.register("exportKey", "RSA-OAEP", msrcryptoRsa.exportKey); + operations.register("exportKey", "RSAES-PKCS1-V1_5", msrcryptoRsa.exportKey); + operations.register("exportKey", "RSASSA-PKCS1-V1_5", msrcryptoRsa.exportKey); + operations.register("exportKey", "RSA-PSS", msrcryptoRsa.exportKey); + operations.register("generateKey", "RSA-OAEP", msrcryptoRsa.generateKeyPair); + operations.register("generateKey", "RSAES-PKCS1-V1_5", msrcryptoRsa.generateKeyPair); + operations.register("generateKey", "RSASSA-PKCS1-V1_5", msrcryptoRsa.generateKeyPair); + operations.register("generateKey", "RSA-PSS", msrcryptoRsa.generateKeyPair); + } + var msrcryptoKdf = function(hashFunction) { + var utils2 = msrcryptoUtilities; + function deriveKey(secretBytes2, otherInfo, keyOutputLength) { + var reps = Math.ceil(keyOutputLength / (hashFunction.hashLen / 8)), counter = 1, digest = secretBytes2.concat(otherInfo), output = []; + for (var i2 = 0; i2 < reps; i2++) { + var data = utils2.int32ToBytes(counter++).concat(digest); + var h = hashFunction.computeHash(data); + output = output.concat(h); + } + return output.slice(0, keyOutputLength); + } + return { + deriveKey + }; + }; + var msrcryptoKdfInstance = null; + if (typeof operations !== "undefined") { + msrcryptoKdf.deriveKey = function(p) { + var utils2 = msrcryptoUtilities; + var hashName = p.algorithm.hash.name; + var hashFunction = msrcryptoHashFunctions[hashName.toUpperCase()](); + msrcryptoKdfInstance = msrcryptoKdf(hashFunction); + var alg = p.algorithm; + var otherInfo = utils2.toArray(alg.algorithmId).concat( + utils2.toArray(alg.partyUInfo), + utils2.toArray(alg.partyVInfo), + utils2.toArray(alg.publicInfo), + utils2.toArray(alg.privateInfo) + ); + var result = msrcryptoKdfInstance.deriveKey(p.keyData, otherInfo, p.derivedKeyType.length); + msrcryptoKdfInstance = null; + return { + type: "keyDerive", + keyData: result, + keyHandle: { + algorithm: p.derivedKeyType, + extractable: p.extractable, + usages: p.usages, + type: "secret" + } + }; + }; + msrcryptoKdf.deriveBits = function(p) { + var hashName = p.algorithm.hash.name; + var hashFunction = msrcryptoHashFunctions[hashName.toUpperCase()](); + msrcryptoKdfInstance = msrcryptoKdf(hashFunction); + var alg = p.algorithm; + var otherInfo = alg.algorithmId.concat( + alg.partyUInfo, + alg.partyVInfo, + alg.publicInfo || [], + alg.privateInfo || [] + ); + var result = msrcryptoKdfInstance.deriveKey(p.keyData, otherInfo, p.length); + msrcryptoKdfInstance = null; + return result; + }; + operations.register("deriveKey", "concat", msrcryptoKdf.deriveKey); + operations.register("deriveBits", "concat", msrcryptoKdf.deriveBits); + } + var msrcryptoPbkdf2 = /* @__PURE__ */ (function() { + function deriveBits(p) { + var algorithm = p.algorithm, keyBytes = p.keyData, bits = p.length, iterations = algorithm.iterations, saltBytes = Array.apply(null, algorithm.salt), byteLen = Math.ceil(bits / 8), hLen, blockCount, output = []; + switch (algorithm.hash.name.toUpperCase()) { + case "SHA-1": + hLen = 20; + break; + case "SHA-256": + hLen = 32; + break; + case "SHA-384": + hLen = 48; + break; + case "SHA-512": + hLen = 64; + break; + default: + throw new Error("Unsupported hash algorithm"); + } + blockCount = Math.ceil(byteLen / hLen); + var hmacKey = msrcryptoHmac.importKey({ + format: "raw", + keyData: keyBytes, + algorithm: { + name: "HMAC", + hash: algorithm.hash + } + }); + var hmacContext = { + algorithm, + keyHandle: hmacKey.keyHandle, + keyData: hmacKey.keyData, + workerid: 0, + buffer: null + }; + function F(S, c, i2) { + var result = [], u = S.concat([i2 >>> 24 & 255, i2 >>> 16 & 255, i2 >>> 8 & 255, i2 & 255]); + for (var j = 0; j < c; j++) { + hmacContext.buffer = u; + u = msrcryptoHmac.signHmac(hmacContext); + for (var k = 0; k < hLen; k++) { + result[k] = ~~result[k] ^ u[k]; + } + } + return result; + } + for (var block = 1; block <= blockCount; block++) { + output = output.concat(F(saltBytes, iterations, block)); + } + output.length = byteLen; + return output; + } + return { + deriveBits + }; + })(); + var msrcryptoKdfInstance = null; + if (typeof operations !== "undefined") { + msrcryptoPbkdf2.importKey = function(p) { + var keyData; + if (p.format === "raw") { + keyData = msrcryptoUtilities.toArray(p.keyData); + } else { + throw new Error("unsupported import format"); + } + if (p.extractable !== false) { + throw new Error("only extractable=false is supported."); + } + return { + type: "keyImport", + keyData, + keyHandle: { + algorithm: { + name: "PBKDF2" + }, + extractable: false, + usages: p.usages, + type: "secret" + } + }; + }; + operations.register("deriveBits", "PBKDF2", msrcryptoPbkdf2.deriveBits); + operations.register("importKey", "PBKDF2", msrcryptoPbkdf2.importKey); + } + var msrcryptoEcdh = function(curve) { + var btd = cryptoMath.bytesToDigits, dtb = cryptoMath.digitsToBytes, e = curve, ecop = new cryptoECC.EllipticCurveOperatorFp(curve); + function generateKey(privateKeyBytes) { + var privateKey = [], randomBytes = msrcryptoPseudoRandom.getBytes(curve.order.length * cryptoMath.DIGIT_NUM_BYTES); + cryptoMath.reduce(cryptoMath.bytesToDigits(randomBytes), e.order, privateKey); + var publicKey = e.allocatePointStorage(); + ecop.scalarMultiply(privateKey, e.generator, publicKey); + return { + privateKey: { + x: dtb(publicKey.x), + y: dtb(publicKey.y), + d: dtb(privateKey) + }, + publicKey: { + x: dtb(publicKey.x), + y: dtb(publicKey.y) + } + }; + } + function deriveBits(privateKey, publicKey, length) { + var publicPoint = new cryptoECC.EllipticCurvePointFp(e, false, btd(publicKey.x), btd(publicKey.y), null, false); + var sharedSecretPoint = e.allocatePointStorage(); + ecop.convertToJacobianForm(sharedSecretPoint); + ecop.convertToMontgomeryForm(sharedSecretPoint); + ecop.scalarMultiply(btd(privateKey.d), publicPoint, sharedSecretPoint); + ecop.convertToAffineForm(sharedSecretPoint); + ecop.convertToStandardForm(sharedSecretPoint); + var secretBytes2 = cryptoMath.digitsToBytes(sharedSecretPoint.x, true, publicKey.x.length); + if (length && secretBytes2.length * 8 < length) { + throw new Error("DataError"); + } + secretBytes2 = length ? secretBytes2.slice(0, Math.ceil(length / 8)) : secretBytes2; + var bits = length % 8; + var mask = bits === 0 ? 255 : 65280 >>> bits; + secretBytes2[secretBytes2.length - 1] = secretBytes2[secretBytes2.length - 1] & mask; + return secretBytes2; + } + function computePublicKey(privateKeyBytes) { + if (!e.generator.isInMontgomeryForm) { + ecop.convertToMontgomeryForm(e.generator); + } + var publicKey = e.allocatePointStorage(); + ecop.convertToJacobianForm(publicKey); + ecop.convertToMontgomeryForm(publicKey); + ecop.scalarMultiply(btd(privateKeyBytes), e.generator, publicKey); + return { + x: dtb(publicKey.x), + y: dtb(publicKey.y) + }; + } + return { + generateKey, + deriveBits, + computePublicKey + }; + }; + var ecdhInstance = null; + if (typeof operations !== "undefined") { + msrcryptoEcdh.deriveBits = function(p) { + var curve = cryptoECC.createCurve(p.algorithm.namedCurve.toUpperCase()); + var privateKey = p.keyData; + var publicKey = p.additionalKeyData; + ecdhInstance = msrcryptoEcdh(curve); + var secretBytes2 = ecdhInstance.deriveBits(privateKey, publicKey, p.length); + return secretBytes2; + }; + msrcryptoEcdh.deriveKey = function(p) { + throw new Error("not supported"); + return secretBytes; + }; + msrcryptoEcdh.generateKey = function(p) { + var curve = cryptoECC.createCurve(p.algorithm.namedCurve.toUpperCase()); + ecdhInstance = msrcryptoEcdh(curve); + var keyPairData = ecdhInstance.generateKey(); + return { + type: "keyPairGeneration", + keyPair: { + publicKey: { + keyData: keyPairData.publicKey, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: [], + type: "public" + } + }, + privateKey: { + keyData: keyPairData.privateKey, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: p.usages, + type: "private" + } + } + } + }; + }; + msrcryptoEcdh.importKey = function(p) { + if (p.format === "raw") { + var keyData = p.keyData; + if (keyData[0] !== 4) { + throw new Error("DataError"); + } + var elementSize = ~~((keyData.length - 1) / 2); + var curveName = p.algorithm.namedCurve.toUpperCase(); + var x = keyData.slice(1, elementSize + 1), y = keyData.slice(elementSize + 1); + if (cryptoECC.validatePoint(curveName, x, y) === false) { + throw new Error("DataError"); + } + return { + type: "keyImport", + keyData: { + x, + y + }, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: "public" + } + }; + } + if (p.format === "jwk") { + var keyObject = msrcryptoJwk.jwkToKey(p.keyData, p.algorithm, ["x", "y", "d", "crv"]); + if (keyObject.d && (!keyObject.x || !keyObject.y)) { + var curve = cryptoECC.createCurve(p.algorithm.namedCurve.toUpperCase()); + ecdhInstance = msrcryptoEcdh(curve); + var publicKey = ecdhInstance.computePublicKey(keyObject.d); + keyObject.x = publicKey.x; + keyObject.y = publicKey.y; + } + if (cryptoECC.validatePoint(p.algorithm.namedCurve.toUpperCase(), keyObject.x, keyObject.y) === false) { + throw new Error("DataError"); + } + return { + type: "keyImport", + keyData: keyObject, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: keyObject.d ? "private" : "public" + } + }; + } + }; + msrcryptoEcdh.exportKey = function(p) { + if (p.format === "raw" && p.keyHandle.type === "public") { + var keyData = [4].concat(p.keyData.x, p.keyData.y); + return { + type: "keyExport", + keyHandle: keyData + }; + } + if (p.format === "jwk") { + var jsonKeyStringArray = msrcryptoJwk.keyToJwk(p.keyHandle, p.keyData); + return { + type: "keyExport", + keyHandle: jsonKeyStringArray + }; + } + throw new Error("unsupported export format."); + }; + operations.register("importKey", "ECDH", msrcryptoEcdh.importKey); + operations.register("exportKey", "ECDH", msrcryptoEcdh.exportKey); + operations.register("generateKey", "ECDH", msrcryptoEcdh.generateKey); + operations.register("deriveBits", "ECDH", msrcryptoEcdh.deriveBits); + operations.register("deriveKey", "ECDH", msrcryptoEcdh.deriveKey); + } + var msrcryptoEcdsa = function(curve) { + var btd = cryptoMath.bytesToDigits, dtb = cryptoMath.digitsToBytes, ecop = new cryptoECC.EllipticCurveOperatorFp(curve), orderByteLength = dtb(curve.order).length, tedCurve = curve.type === 1; + function createKey(privateKeyBytes) { + return createKeyInternal(btd(privateKeyBytes)); + } + function createKeyInternal(privateKeyDigits) { + var publicKey = curve.allocatePointStorage(); + ecop.scalarMultiply(privateKeyDigits, curve.generator, publicKey); + return { + publicKey, + privateKey: privateKeyDigits + }; + } + function generateKey(randomBytes) { + var privateKey = []; + if (!randomBytes) { + randomBytes = msrcryptoPseudoRandom.getBytes(curve.order.length * cryptoMath.DIGIT_NUM_BYTES); + } + cryptoMath.reduce(cryptoMath.bytesToDigits(randomBytes), curve.order, privateKey); + return createKeyInternal(privateKey); + } + function getDigest(messageBytes) { + if (messageBytes.length > orderByteLength) { + messageBytes.length = orderByteLength; + } + var digest = btd(messageBytes); + if (tedCurve) { + var shift = 8 - curve.rbits % 8; + cryptoMath.shiftRight(digest, digest, shift); + } + cryptoMath.reduce(digest, curve.order, digest); + return digest; + } + function sign(privateKey, messageBytes, ephemeralKey) { + if (!ephemeralKey) { + ephemeralKey = generateKey(); + } + var r = ephemeralKey.publicKey.x, k = ephemeralKey.privateKey, d = btd(privateKey.d), digest = getDigest(messageBytes.slice()), s = [], tmp = [], signature = null; + cryptoMath.reduce(r, curve.order, r); + cryptoMath.modMul(r, d, curve.order, s); + cryptoMath.add(s, digest, s); + cryptoMath.reduce(s, curve.order, s); + cryptoMath.modInvCT(k, curve.order, tmp); + cryptoMath.modMul(s, tmp, curve.order, s); + var rBytes = msrcryptoUtilities.padFront(dtb(r, true, orderByteLength), 0, orderByteLength); + var sBytes = msrcryptoUtilities.padFront(dtb(s, true, orderByteLength), 0, orderByteLength); + signature = rBytes.concat(sBytes); + return signature; + } + function verify(publicKey, signatureBytes, messageBytes) { + var split = Math.floor(signatureBytes.length / 2), r = btd(signatureBytes.slice(0, split)), s = btd(signatureBytes.slice(split)), digest = getDigest(messageBytes.slice()), u1 = [], u2 = []; + var publicPoint = new cryptoECC.EllipticCurvePointFp( + curve, + false, + btd(publicKey.x), + btd(publicKey.y), + null, + false + ); + cryptoMath.modInv(s, curve.order, s); + cryptoMath.modMul(digest, s, curve.order, u1); + cryptoMath.modMul(r, s, curve.order, u2); + var r0 = curve.allocatePointStorage(); + var r1 = curve.allocatePointStorage(); + if (tedCurve) { + cryptoMath.add(u1, u1, u1); + cryptoMath.add(u1, u1, u1); + cryptoMath.reduce(u1, curve.order, u1); + ecop.scalarMultiply(u1, curve.generator, r0, false); + ecop.scalarMultiply(u2, publicPoint, r1, false); + ecop.convertToExtendedProjective(r0); + ecop.convertToExtendedProjective(r1); + ecop.add(r1, r0, r0); + ecop.normalize(r0); + } else { + ecop.scalarMultiply(u1, curve.generator, r0); + ecop.scalarMultiply(u2, publicPoint, r1); + ecop.convertToJacobianForm(r0); + ecop.convertToMontgomeryForm(r0); + ecop.convertToMontgomeryForm(r1); + ecop.mixedAdd(r0, r1, r0); + ecop.convertToAffineForm(r0); + ecop.convertToStandardForm(r0); + } + if (r0.isInfinity) { + return false; + } + cryptoMath.reduce(r0.x, curve.order, r0.x); + return cryptoMath.compareDigits(r0.x, r) === 0; + } + return { + createKey, + generateKey, + sign, + verify + }; + }; + if (typeof operations !== "undefined") { + msrcryptoEcdsa.sign = function(p) { + msrcryptoUtilities.checkParam(p.algorithm.hash, "Object", "algorithm.hash"); + msrcryptoUtilities.checkParam(p.algorithm.hash.name, "String", "algorithm.hash.name"); + msrcryptoUtilities.checkParam(p.keyHandle.algorithm.namedCurve, "String", "p.keyHandle.algorithm.namedCurve"); + var hashName = p.algorithm.hash.name, curve = cryptoECC.createCurve(p.keyHandle.algorithm.namedCurve.toUpperCase()), hashFunc = msrcryptoHashFunctions[hashName.toUpperCase()](), digest = hashFunc.computeHash(p.buffer); + var ecdsa = msrcryptoEcdsa(curve); + return ecdsa.sign(p.keyData, digest); + }; + msrcryptoEcdsa.verify = function(p) { + var hashName = p.algorithm.hash.name, curve = cryptoECC.createCurve(p.keyHandle.algorithm.namedCurve.toUpperCase()), hashFunc = msrcryptoHashFunctions[hashName.toUpperCase()](), digest = hashFunc.computeHash(p.buffer); + var ecdsa = msrcryptoEcdsa(curve); + return ecdsa.verify(p.keyData, p.signature, digest); + }; + msrcryptoEcdsa.generateKey = function(p) { + var curve = cryptoECC.createCurve(p.algorithm.namedCurve.toUpperCase()); + var ecdsa = msrcryptoEcdsa(curve); + var keyPairData = ecdsa.generateKey(); + var dtb = cryptoMath.digitsToBytes; + function padTo8BytesIncrement(array) { + return array; + } + var x = padTo8BytesIncrement(dtb(keyPairData.publicKey.x)); + var y = padTo8BytesIncrement(dtb(keyPairData.publicKey.y)); + var d = padTo8BytesIncrement(dtb(keyPairData.privateKey)); + return { + type: "keyPairGeneration", + keyPair: { + publicKey: { + keyData: { + x, + y + }, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: ["verify"], + type: "public" + } + }, + privateKey: { + keyData: { + x, + y, + d + }, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable, + usages: ["sign"], + type: "private" + } + } + } + }; + }; + msrcryptoEcdsa.importKey = function(p) { + if (p.format === "raw") { + var keyData = p.keyData; + if (keyData[0] !== 4) { + throw new Error("DataError"); + } + var elementSize = ~~((keyData.length - 1) / 2); + var curveName = p.algorithm.namedCurve.toUpperCase(); + var x = keyData.slice(1, elementSize + 1), y = keyData.slice(elementSize + 1); + if (cryptoECC.validatePoint(curveName, x, y) === false) { + throw new Error("DataError"); + } + return { + type: "keyImport", + keyData: { + x, + y + }, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: "public" + } + }; + } + if (p.format === "jwk") { + var keyObject = msrcryptoJwk.jwkToKey(p.keyData, p.algorithm, ["x", "y", "d", "crv"]); + if (keyObject.d && (!keyObject.x || !keyObject.y)) { + var curve = msrcryptoEcdsa.curves[p.algorithm.namedCurve](); + var ecdsa = msrcryptoEcdsa(curve); + var publicKey = ecdsa.computePublicKey(keyObject.d); + keyObject.x = publicKey.x; + keyObject.y = publicKey.y; + } + if (cryptoECC.validatePoint(p.algorithm.namedCurve.toUpperCase(), keyObject.x, keyObject.y) === false) { + throw new Error("DataError"); + } + return { + type: "keyImport", + keyData: keyObject, + keyHandle: { + algorithm: p.algorithm, + extractable: p.extractable || keyObject.extractable, + usages: p.usages, + type: keyObject.d ? "private" : "public" + } + }; + } + }; + msrcryptoEcdsa.exportKey = function(p) { + if (p.format === "raw" && p.keyHandle.type === "public") { + var keyData = [4].concat(p.keyData.x, p.keyData.y); + return { + type: "keyExport", + keyHandle: keyData + }; + } + if (p.format === "jwk") { + var jsonKeyStringArray = msrcryptoJwk.keyToJwk(p.keyHandle, p.keyData); + return { + type: "keyExport", + keyHandle: jsonKeyStringArray + }; + } + throw new Error("unsupported export format."); + }; + operations.register("sign", "ECDSA", msrcryptoEcdsa.sign); + operations.register("verify", "ECDSA", msrcryptoEcdsa.verify); + operations.register("generateKey", "ECDSA", msrcryptoEcdsa.generateKey); + operations.register("importKey", "ECDSA", msrcryptoEcdsa.importKey); + operations.register("exportKey", "ECDSA", msrcryptoEcdsa.exportKey); + } + var msrcryptoSubtle; + var utils = msrcryptoUtilities; + msrcryptoSubtle = (function() { + function syncWorker() { + var result; + function postMessage(data) { + try { + data.workerid = this.id; + result = msrcryptoWorker.jsCryptoRunner({ + data + }); + } catch (ex) { + this.onerror({ + data: ex, + type: "error" + }); + return; + } + this.onmessage({ + data: result + }); + } + return { + postMessage, + onmessage: null, + onerror: null, + terminate: function() { + } + }; + } + var streamObject = function(op) { + return { + process: function(buffer) { + return op.process(buffer); + }, + finish: function() { + return op.finish(); + }, + abort: function() { + return op.abort(); + } + }; + }; + function baseOperation(processResults) { + var result = null, oncompleteCallback = null, onerrorCallback = null, retObj, promise, resolveFunc, rejectFunc; + promise = new Promise(function(resolve, reject) { + resolveFunc = resolve; + rejectFunc = reject; + }); + function opDispatchEvent(e) { + if (e.type === "error") { + if (rejectFunc) { + rejectFunc.apply(promise, [e]); + } + return; + } + if (e.data.type === "process") { + processResults(e.data.result, true); + return; + } + if (e.data.type === "finish") { + processResults(e.data.result, true); + return; + } + this.result = processResults(e.data); + resolveFunc.apply(promise, [this.result]); + return; + } + retObj = { + dispatchEvent: opDispatchEvent, + promise, + result: null + }; + return retObj; + } + function keyOperation() { + function processResult(result) { + var publicKey, privateKey; + switch (result.type) { + case "keyGeneration": + case "keyImport": + case "keyDerive": + if (result.keyPair) { + keys.add(result.keyPair.publicKey.keyHandle, result.keyPair.publicKey.keyData); + keys.add(result.keyPair.privateKey.keyHandle, result.keyPair.privateKey.keyData); + return { + publicKey: result.keyPair.publicKey.keyHandle, + privateKey: result.keyPair.privateKey.keyHandle + }; + } else { + keys.add(result.keyHandle, result.keyData); + return result.keyHandle; + } + case "keyExport": + return result.keyHandle; + case "keyPairGeneration": + privateKey = result.keyPair.privateKey; + publicKey = result.keyPair.publicKey; + keys.add(publicKey.keyHandle, publicKey.keyData); + keys.add(privateKey.keyHandle, privateKey.keyData); + return { + publicKey: publicKey.keyHandle, + privateKey: privateKey.keyHandle + }; + default: + throw new Error("Unknown key operation"); + } + } + return baseOperation(processResult); + } + function toArrayBufferIfSupported(dataArray) { + if (typedArraySupport && dataArray.pop) { + return new Uint8Array(dataArray).buffer; + } + return dataArray; + } + function cryptoOperation(cryptoContext) { + function processResult(result, isProcessCall) { + result = result && toArrayBufferIfSupported(result); + if (isProcessCall) { + promiseQueue.resolve(result); + return; + } + return result; + } + var promiseQueue = [], op = baseOperation(processResult); + op.stream = cryptoContext.algorithm.stream; + promiseQueue.add = function(label) { + var resolveFunc, rejectFunc, promise = new Promise(function(resolve, reject) { + resolveFunc = resolve; + rejectFunc = reject; + }); + promise.label = label; + promiseQueue.push({ + resolve: resolveFunc, + reject: rejectFunc, + promise + }); + return promise; + }; + promiseQueue.resolve = function(result) { + var queueItem = promiseQueue.shift(); + queueItem.resolve.apply(queueItem.promise, [result]); + }; + op.process = function(buffer) { + cryptoContext.operationSubType = "process"; + cryptoContext.buffer = utils.toArray(buffer); + workerManager.continueJob(this, utils.clone(cryptoContext)); + return promiseQueue.add("process"); + }; + op.finish = function() { + cryptoContext.operationSubType = "finish"; + cryptoContext.buffer = []; + workerManager.continueJob(this, utils.clone(cryptoContext)); + return promiseQueue.add("finish"); + }; + op.abort = function() { + workerManager.abortJob(this); + }; + op.algorithm = cryptoContext.algorithm || null; + op.key = cryptoContext.keyHandle || null; + return op; + } + var keys = []; + keys.add = function(keyHandle, keyData) { + keys.push({ + keyHandle, + keyData + }); + }; + keys.remove = function(keyHandle) { + for (var i2 = 0; i2 < keys.length; i2 += 1) { + if (keys[i2].keyHandle === keyHandle) { + keys = keys.splice(i2, 1); + return; + } + } + }; + keys.lookup = function(keyHandle) { + for (var i2 = 0; i2 < keys.length; i2 += 1) { + if (keys[i2].keyHandle === keyHandle) { + return keys[i2].keyData; + } + } + return null; + }; + var workerManager = /* @__PURE__ */ (function() { + var maxWorkers = 12; + var maxFreeWorkers = 2; + var workerPool = []; + var jobQueue = []; + var jobId = 0; + var workerId = 0; + var callbackQueue = []; + var setFunction = typeof setImmediate === "undefined" ? setTimeout : setImmediate; + function executeNextCallback() { + callbackQueue.shift()(); + } + function queueCallback(callback) { + callbackQueue.push(callback); + setFunction(executeNextCallback, 0); + } + var workerStatus = webWorkerSupport ? "available" : "unavailable"; + function getFreeWorker() { + purgeWorkerType(!asyncMode); + for (var i2 = 0; i2 < workerPool.length; i2++) { + if (!workerPool[i2].busy) { + return workerPool[i2]; + } + } + return null; + } + function purgeWorkerType(webWorker) { + for (var i2 = workerPool.length - 1; i2 >= 0; i2 -= 1) { + if (workerPool[i2].isWebWorker === webWorker) { + workerPool[i2].terminate(); + workerPool.splice(i2, 1); + } + } + } + function freeWorkerCount() { + var freeWorkers = 0; + for (var i2 = 0; i2 < workerPool.length; i2++) { + if (!workerPool[i2].busy) { + freeWorkers += 1; + } + } + return freeWorkers; + } + function addWorkerToPool(worker) { + workerPool.push(worker); + } + function removeWorkerFromPool(worker) { + for (var i2 = 0; i2 < workerPool.length; i2++) { + if (workerPool[i2] === worker) { + worker.terminate(); + workerPool.splice(i2, 1); + return; + } + } + } + function lookupWorkerByOperation(operation) { + for (var i2 = 0; i2 < workerPool.length; i2++) { + if (workerPool[i2].operation === operation) { + return workerPool[i2]; + } + } + return null; + } + function queueJob(operation, data) { + jobQueue.push({ + operation, + data, + id: jobId++ + }); + } + function jobCompleted(worker) { + worker.busy = false; + if (asyncMode) { + if (jobQueue.length > 0) { + var job = jobQueue.shift(), i2; + continueJob(job.operation, job.data); + if (job.data.operationSubType === "process") { + for (i2 = 0; i2 < jobQueue.length; i2++) { + if (job.operation === jobQueue[i2].operation) { + continueJob(jobQueue[i2].operation, jobQueue[i2].data); + } + } + for (i2 = jobQueue.length - 1; i2 >= 0; i2--) { + if (job.operation === jobQueue[i2].operation) { + jobQueue.splice(i2, 1); + } + } + } + } else if (freeWorkerCount() > maxFreeWorkers) { + removeWorkerFromPool(worker); + } + } + } + function createNewWorker(operation) { + var worker; + if (workerStatus === "pending") { + throw new Error("Creating new worker while workerstatus=pending"); + } + if (workerStatus === "ready") { + try { + worker = new Worker(scriptUrl); + worker.postMessage({ + prngSeed: msrcryptoPseudoRandom.getBytes(48) + }); + worker.isWebWorker = true; + } catch (ex) { + asyncMode = false; + workerStatus = "failed"; + worker.terminate(); + worker = syncWorker(); + worker.isWebWorker = false; + } + } else { + worker = syncWorker(); + worker.isWebWorker = false; + } + worker.operation = operation; + worker.id = workerId++; + worker.busy = false; + worker.onmessage = function(e) { + if (e.data.initialized === true) { + return; + } + var op = worker.operation; + e.target || (e.target = { + data: worker.data + }); + for (var i2 = 0; i2 < jobQueue.length; i2++) { + if (jobQueue[i2].operation === worker.operation) { + var job = jobQueue[i2]; + jobQueue.splice(i2, 1); + postMessageToWorker(worker, job.data); + return; + } + } + if (!(e.data.hasOwnProperty("type") && e.data.type === "process")) { + jobCompleted(worker); + } + op.dispatchEvent(e); + }; + worker.onerror = function(e) { + var op = worker.operation; + jobCompleted(worker); + op.dispatchEvent(e); + }; + addWorkerToPool(worker); + return worker; + } + function useWebWorkers(enable) { + if (workerStatus === "unavailable") { + utils.consoleLog("web workers not available in this browser."); + return; + } + if (enable === true && workerStatus === "ready") { + return; + } + if (enable === false && workerStatus === "available") { + return; + } + if (enable === false && workerStatus === "ready") { + asyncMode = false; + workerStatus = "available"; + utils.consoleLog("web workers disabled."); + return; + } + if (workerStatus === "pending") { + return; + } + workerStatus = "pending"; + var worker = new Worker(scriptUrl); + function setWorkerStatus(e) { + var succeeded = !!(e.data && e.data.initialized === true); + worker.removeEventListener("message", setWorkerStatus, false); + worker.removeEventListener("error", setWorkerStatus, false); + worker.terminate(); + workerStatus = succeeded ? "ready" : "failed"; + asyncMode = succeeded; + utils.consoleLog( + "web worker initialization " + (succeeded ? "succeeded. Now using web workers." : "failed. running synchronously." + (e.message || "")) + ); + if (jobQueue.length > 0) { + var job = jobQueue.shift(); + runJob(job.operation, job.data); + } + return; + } + worker.addEventListener("message", setWorkerStatus, false); + worker.addEventListener("error", setWorkerStatus, false); + worker.postMessage({ + prngSeed: msrcryptoPseudoRandom.getBytes(48) + }); + return; + } + function abortJob(cryptoOperationObject) { + var worker = lookupWorkerByOperation(cryptoOperationObject); + if (worker) { + removeWorkerFromPool(worker); + } + } + function runJob(operation, data) { + var worker = null; + if (workerStatus === "pending") { + queueJob(operation, data); + return; + } + worker = getFreeWorker(); + if (asyncMode && worker === null && workerPool.length >= maxWorkers) { + queueJob(operation, data); + return; + } + if (worker === null) { + worker = createNewWorker(operation); + } + if (worker === null) { + queueJob(operation, data); + throw new Error("could not create new worker"); + } + worker.operation = operation; + worker.busy = true; + data.workerid = worker.id; + postMessageToWorker(worker, data); + } + function continueJob(operation, data) { + var worker = lookupWorkerByOperation(operation); + if (worker) { + postMessageToWorker(worker, data); + return; + } + runJob(operation, data); + } + function postMessageToWorker(worker, data) { + data.workerid = worker.id; + if (asyncMode) { + worker.postMessage(data); + } else { + var func = /* @__PURE__ */ (function(postData) { + return function() { + return worker.postMessage(postData); + }; + })(data); + queueCallback(func); + } + return; + } + return { + runJob, + continueJob, + abortJob, + useWebWorkers + }; + })(); + function checkOperation(operationType, algorithmName) { + if (!operations.exists(operationType, algorithmName)) { + throw new Error("unsupported algorithm"); + } + } + var subtleParameters = [ + { + name: "algorithm", + type: "Object", + required: true + }, + { + name: "keyHandle", + type: "Object", + required: true + }, + { + name: "buffer", + type: "Array", + required: false + }, + { + name: "signature", + type: "Array", + required: true + }, + { + name: "format", + type: "String", + required: true + }, + { + name: "keyData", + type: "Object", + required: true + }, + { + name: "extractable", + type: "Boolean", + required: false + }, + { + name: "usages", + type: "Array", + required: false + }, + { + name: "derivedKeyType", + type: "Object", + required: true + }, + { + name: "length", + type: "Number", + required: false + }, + { + name: "extractable", + type: "Boolean", + required: true + }, + { + name: "usages", + type: "Array", + required: true + }, + { + name: "keyData", + type: "Array", + required: true + } + ]; + var subtleParametersSets = { + encrypt: [0, 1, 2], + decrypt: [0, 1, 2], + sign: [0, 1, 2], + verify: [0, 1, 3, 2], + digest: [0, 2], + generateKey: [0, 6, 7], + importKeyRaw: [4, 12, 0, 10, 11], + importKeyJwk: [4, 5, 0, 10, 11], + exportKey: [0, 4, 1, 6, 7], + deriveKey: [0, 1, 8, 6, 7], + deriveBits: [0, 1, 9], + wrapKey: [1, 1, 0], + unwrapKey: [2, 0, 1, 6, 7] + }; + function lookupKeyData(handle) { + var data = keys.lookup(handle); + if (!data) { + throw new Error("key not found"); + } + return data; + } + function buildParameterCollection(operationName, parameterSet) { + var parameterCollection = { + operationType: operationName + }, operationParameterSet, expectedParam, actualParam, i2; + if (operationName === "importKey" && (parameterSet[0] === "raw" || parameterSet[0] === "spki")) { + operationName = "importKeyRaw"; + } + if (operationName === "importKey" && parameterSet[0] === "jwk") { + operationName = "importKeyJwk"; + } + operationParameterSet = subtleParametersSets[operationName]; + for (i2 = 0; i2 < operationParameterSet.length; i2 += 1) { + expectedParam = subtleParameters[operationParameterSet[i2]]; + actualParam = parameterSet[i2]; + if (actualParam == null) { + if (expectedParam.required) { + throw new Error(expectedParam.name); + } else { + continue; + } + } + if (actualParam.subarray) { + actualParam = utils.toArray(actualParam); + } + if (utils.getObjectType(actualParam) === "ArrayBuffer") { + actualParam = utils.toArray(actualParam); + } + if (msrcryptoUtilities.getObjectType(actualParam) !== expectedParam.type) { + throw new Error(expectedParam.name); + } + if (expectedParam.name === "algorithm") { + actualParam.name = actualParam.name.toUpperCase(); + if (actualParam.iv) { + actualParam.iv = utils.toArray(actualParam.iv); + } + if (actualParam.publicExponent) { + actualParam.publicExponent = utils.toArray(actualParam.publicExponent); + } + if (actualParam.salt) { + actualParam.salt = utils.toArray(actualParam.salt); + } + if (actualParam.additionalData) { + actualParam.additionalData = utils.toArray(actualParam.additionalData); + } + if (actualParam.hash && !actualParam.hash.name && utils.getObjectType(actualParam.hash) === "String") { + actualParam.hash = { + name: actualParam.hash + }; + } + } + if (parameterCollection.hasOwnProperty(expectedParam.name)) { + parameterCollection[expectedParam.name + "1"] = actualParam; + } else { + parameterCollection[expectedParam.name] = actualParam; + } + } + return parameterCollection; + } + function executeOperation(operationName, parameterSet, keyFunc) { + var pc = buildParameterCollection(operationName, parameterSet); + checkOperation(operationName, pc.algorithm.name); + if (pc.keyHandle) { + pc.keyData = lookupKeyData(pc.keyHandle); + } + if (pc.keyHandle1) { + pc.keyData1 = lookupKeyData(pc.keyHandle1); + } + if (pc.algorithm && pc.algorithm.public) { + pc.additionalKeyData = lookupKeyData(pc.algorithm.public); + } + var op = keyFunc ? keyOperation(pc) : cryptoOperation(pc); + if (keyFunc || pc.buffer || operationName === "deriveBits" || operationName === "wrapKey") { + workerManager.runJob(op, pc); + } + if (op.stream) { + return Promise.resolve(streamObject(op)); + } + return op.promise; + } + var publicMethods2 = { + encrypt: function(algorithm, keyHandle, buffer) { + return executeOperation("encrypt", arguments, 0); + }, + decrypt: function(algorithm, keyHandle, buffer) { + return executeOperation("decrypt", arguments, 0); + }, + sign: function(algorithm, keyHandle, buffer) { + return executeOperation("sign", arguments, 0); + }, + verify: function(algorithm, keyHandle, signature, buffer) { + return executeOperation("verify", arguments, 0); + }, + digest: function(algorithm, buffer) { + return executeOperation("digest", arguments, 0); + }, + generateKey: function(algorithm, extractable, keyUsage) { + return executeOperation("generateKey", arguments, 1); + }, + deriveKey: function(algorithm, baseKey, derivedKeyType, extractable, keyUsage) { + var deriveBits = this.deriveBits, importKey = this.importKey; + return new Promise(function(resolve, reject) { + var keyLength; + switch (derivedKeyType.name.toUpperCase()) { + case "AES-CBC": + case "AES-GCM": + keyLength = derivedKeyType.length; + break; + case "HMAC": + keyLength = derivedKeyType.length || { + "SHA-1": 512, + "SHA-224": 512, + "SHA-256": 512, + "SHA-384": 1024, + "SHA-512": 1024 + }[derivedKeyType.hash.name.toUpperCase()]; + break; + default: + reject(new Error("No Supported")); + return; + } + deriveBits(algorithm, baseKey, keyLength).then(function(bits) { + return importKey("raw", bits, derivedKeyType, extractable, keyUsage); + }).then(function(key) { + resolve(key); + })["catch"](function(err) { + reject(err); + }); + }); + }, + deriveBits: function(algorithm, baseKey, length) { + return executeOperation("deriveBits", arguments, 0); + }, + importKey: function(format, keyData, algorithm, extractable, keyUsage) { + return executeOperation("importKey", arguments, 1); + }, + exportKey: function(format, keyHandle) { + return executeOperation("exportKey", [keyHandle.algorithm, format, keyHandle], 1); + }, + wrapKey: function(format, key, wrappingKey, wrappingKeyAlgorithm) { + var encrypt = this.encrypt, exportKey = this.exportKey; + return new Promise(function(resolve, reject) { + if (key.extractable === false || key.usages.indexOf("wrapKey") < 0 || wrappingKey.algorithm.name.toUpperCase() !== wrappingKeyAlgorithm.name) { + reject(new Error("InvalidAccessError")); + return; + } + exportKey(format, key).then(function(keyData) { + return encrypt( + wrappingKeyAlgorithm, + wrappingKey, + format === "jwk" ? utils.stringToBytes(JSON.stringify(keyData, null, 0)) : keyData + ); + }).then(function(cipherArrayBuffer) { + resolve(cipherArrayBuffer); + })["catch"](function(err) { + reject(err); + }); + }); + }, + unwrapKey: function(format, wrappedKey, unwrappingKey, unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages) { + var decrypt = this.decrypt, importKey = this.importKey; + return new Promise(function(resolve, reject) { + if (unwrappingKey.usages.indexOf("unwrapKey") < 0 || unwrappingKey.algorithm.name.toUpperCase() !== unwrapAlgorithm.name) { + reject(new Error("InvalidAccessError")); + return; + } + decrypt(unwrapAlgorithm, unwrappingKey, wrappedKey).then(function(keyPlain) { + return importKey( + format, + format === "jwk" ? JSON.parse(utils.bytesToString(keyPlain)) : keyPlain, + unwrappedKeyAlgorithm, + extractable, + keyUsages + ); + }).then(function(key) { + resolve(key); + })["catch"](function(err) { + reject(err); + }); + }); + } + }; + var internalMethods = { + useWebWorkers: workerManager.useWebWorkers + }; + return { + publicMethods: publicMethods2, + internalMethods + }; + })(); + var msrcryptoWrapKey = /* @__PURE__ */ (function() { + var utils2 = msrcryptoUtilities; + function wrapKey(params) { + var rsaObj = msrcryptoRsa(params.keyData1, params.keyHandle1.algorithm.name, msrcryptoHashFunctions["SHA-1"])(); + var tagLength = 128; + var keyToWrapJwk = msrcryptoJwk.keyToJwkOld(params.keyHandle, params.keyData); + var jweHeader = { + alg: params.keyHandle1.algorithm.name.toUpperCase(), + enc: "A128GCM" + }; + var encodedJweHeader = utils2.toBase64(JSON.stringify(jweHeader), true); + var cmk = msrcryptoPseudoRandom.getBytes(32); + var jweEncryptedKey = rsaObj.encrypt(cmk); + var encodedJweEncryptedKey = utils2.toBase64(jweEncryptedKey, true); + var jweIv = msrcryptoPseudoRandom.getBytes(12); + var encodedJweIv = utils2.toBase64(jweIv, true); + var additionalData = encodedJweHeader.concat(".", encodedJweEncryptedKey, ".", encodedJweIv); + var gcm = msrcryptoGcm(msrcryptoBlockCipher.aes(cmk)); + gcm.init(jweIv, utils2.stringToBytes(additionalData), tagLength); + var ciphertextPlusTag = gcm.encrypt(keyToWrapJwk); + var tag = ciphertextPlusTag.slice(-(tagLength / 8)); + var encodedIntegrityValue = utils2.toBase64(tag, true); + var encodedCiphertext = utils2.toBase64(ciphertextPlusTag.slice(0, ciphertextPlusTag.length - tag.length), true); + var jwe = { + recipients: [ + { + header: encodedJweHeader, + encrypted_key: encodedJweEncryptedKey, + integrity_value: encodedIntegrityValue + } + ], + initialization_vector: encodedJweIv, + ciphertext: encodedCiphertext + }; + return utils2.stringToBytes(JSON.stringify(jwe)); + } + function unwrapKey(params) { + var b64Tobytes = utils2.fromBase64; + var keyDataJwk = JSON.parse(String.fromCharCode.apply(null, params.buffer)); + var header = utils2.fromBase64(keyDataJwk.recipients[0].header); + var encrypted_key = b64Tobytes(keyDataJwk.recipients[0].encrypted_key); + var integrity_value = b64Tobytes(keyDataJwk.recipients[0].integrity_value); + var initialization_vector = b64Tobytes(keyDataJwk.initialization_vector); + var ciphertext = b64Tobytes(keyDataJwk.ciphertext); + var hashFunc = msrcryptoHashFunctions["SHA-1"](); + var rsaObj = msrcryptoRsa(params.keyData, params.keyHandle.algorithm.name, hashFunc); + var inKey = rsaObj.decrypt(encrypted_key); + var additionalData = keyDataJwk.recipients[0].header.concat( + ".", + keyDataJwk.recipients[0].encrypted_key, + ".", + keyDataJwk.initialization_vector + ); + var gcm = msrcryptoGcm(msrcryptoBlockCipher.aes(inKey)); + gcm.init(initialization_vector, utils2.stringToBytes(additionalData), 128); + var result = gcm.decrypt(ciphertext, integrity_value); + var keyObject = msrcryptoJwk.jwkToKey(result, params.algorithm, ["k"]); + return { + type: "keyImport", + keyData: keyObject.k, + keyHandle: { + algorithm: { + name: params.algorithm.name + }, + extractable: params.extractable || keyObject.extractable, + usages: params.usages, + type: "secret" + } + }; + } + return { + wrapKey, + unwrapKey + }; + })(); + if (typeof operations !== "undefined") { + operations.register("wrapKey", "AES-GCM", msrcryptoWrapKey.wrapKey); + operations.register("unwrapKey", "AES-CBC", msrcryptoWrapKey.unwrapKey); + } + var publicMethods = { + subtle: msrcryptoSubtle ? msrcryptoSubtle.publicMethods : null, + getRandomValues: function(array) { + var i2; + var randomValues = msrcryptoPseudoRandom.getBytes(array.length); + for (i2 = 0; i2 < array.length; i2 += 1) { + array[i2] = randomValues[i2]; + } + return array; + }, + initPrng: function(entropyData) { + var entropyDataType = Object.prototype.toString.call(entropyData); + if (entropyDataType !== "[object Array]" && entropyDataType !== "[object Uint8Array]") { + throw new Error("entropyData must be a Array or Uint8Array"); + } + entropyPool && entropyPool.reseed(entropyData); + msrcryptoPseudoRandom.reseed(entropyPool.read(48)); + fprngEntropyProvided = true; + }, + toBase64: function(data, base64Url) { + return msrcryptoUtilities.toBase64(data, base64Url); + }, + fromBase64: function(base64String) { + return msrcryptoUtilities.fromBase64(base64String); + }, + textToBytes: function(text) { + return msrcryptoUtilities.stringToBytes(text); + }, + bytesToText: function(byteArray) { + return msrcryptoUtilities.bytesToString(byteArray); + }, + asn1, + url: scriptUrl, + version: msrCryptoVersion, + useWebWorkers: function(useWebWorkers) { + return msrcryptoSubtle ? msrcryptoSubtle.internalMethods.useWebWorkers(useWebWorkers) : null; + } + }; + var entropyPool; + entropyPool = entropyPool || new MsrcryptoEntropy(global2); + entropyPool.init(); + var localEntropy = entropyPool.read(48); + msrcryptoPseudoRandom.init(localEntropy); + return publicMethods; + }; + return msrCrypto(); + }); + (function(root, factory) { + if (typeof Promise !== "undefined") { + return; + } + root.Promise = factory(); + })(exports, function() { + var Promise2 = function(executor, id) { + if (!(this instanceof Promise2)) { + throw new Error("use 'new' keyword with Promise constructor"); + } + var successResult = null, failReason = null, thenResolved = [], thenRejected = [], rejectThenPromise = [], resolveThenPromise = []; + this.then = function(onCompleted, onRejected) { + var thenFunctionResult; + if (successResult) { + thenFunctionResult = onCompleted(successResult.result); + if (thenFunctionResult && thenFunctionResult.then) { + return thenFunctionResult; + } + return Promise2.resolve(thenFunctionResult); + } + if (failReason) { + thenFunctionResult = onRejected ? onRejected(failReason.result) : failReason.result; + if (thenFunctionResult && thenFunctionResult.then) { + return thenFunctionResult; + } + return Promise2.resolve(thenFunctionResult); + } + thenResolved.push(onCompleted); + if (onRejected) { + thenRejected.push(onRejected); + } + return new Promise2(function(resolve2, reject2) { + resolveThenPromise.push(resolve2); + rejectThenPromise.push(reject2); + }); + }; + this["catch"] = function(onRejected) { + var catchFunctionResult; + if (failReason) { + catchFunctionResult = onRejected(failReason.result); + if (catchFunctionResult && catchFunctionResult.then) { + return catchFunctionResult; + } + return Promise2.resolve(catchFunctionResult); + } + thenRejected.push(onRejected); + return new Promise2(function(resolve2, reject2) { + resolveThenPromise.push(resolve2); + rejectThenPromise.push(reject2); + }); + }; + function resolve(param) { + var result, i2; + for (i2 = 0; i2 < thenResolved.length; i2 += 1) { + result = thenResolved[i2](param); + if (result && result.then) { + result.then(resolveThenPromise[i2]); + if (rejectThenPromise[i2]) { + result["catch"](rejectThenPromise[i2]); + } + } else { + if (resolveThenPromise[i2]) { + resolveThenPromise[i2](result); + } + } + } + successResult = { + result: param + }; + return; + } + function reject(param) { + var reason, i2; + for (i2 = 0; i2 < thenRejected.length; i2 += 1) { + reason = thenRejected[i2](param); + if (reason && reason.then) { + reason.then(resolveThenPromise[i2], rejectThenPromise[i2]); + } else { + if (resolveThenPromise[i2]) { + resolveThenPromise[i2](reason); + } + } + } + failReason = { + result: param + }; + return; + } + executor(resolve, reject); + return; + }; + Promise2.all = function(promiseArray) { + var results = [], resultCount = 0, promiseAll; + function then(index, resolve) { + return function(result) { + results[index] = result; + resultCount += 1; + if (resultCount === promiseArray.length) { + resolve(results); + } + }; + } + promiseAll = new Promise2(function(resolve, reject) { + var i2; + function r(reason) { + reject(reason); + } + for (i2 = 0; i2 < promiseArray.length; i2 += 1) { + if (promiseArray[i2].then) { + promiseArray[i2].then(then(i2, resolve)); + promiseArray[i2]["catch"](r); + continue; + } + Promise2.resolve(promiseArray[i2]).then(then(i2, resolve)); + } + }); + return promiseAll; + }; + Promise2.race = function(promiseArray) { + var resolved = false, promiseRace; + function then(resolveFunction) { + return function(result) { + if (!resolved) { + resolved = true; + resolveFunction(result); + } + }; + } + promiseRace = new Promise2(function(resolve, reject) { + for (var i2 = 0; i2 < promiseArray.length; i2 += 1) { + promiseArray[i2].then(then(resolve), then(reject)); + } + }); + return promiseRace; + }; + Promise2.reject = function(rejectReason) { + return new Promise2(function(resolve, reject) { + reject(rejectReason); + }); + }; + Promise2.resolve = function(resolveResult) { + return new Promise2(function(resolve, reject) { + resolve(resolveResult); + }); + }; + return Promise2; + }); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/internal/crypto.js +var require_crypto = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/internal/crypto.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.calculateMAC = exports.verifyMAC = exports.HKDF = exports.setCurve = exports.setWebCrypto = exports.crypto = exports.Crypto = void 0; + var Internal = __importStar(require_internal()); + var util = __importStar(require_helpers()); + var webcrypto = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) || require_msrcrypto(); + var Crypto = class { + constructor(crypto) { + this._curve = new Internal.AsyncCurve(); + this._webcrypto = crypto || webcrypto; + } + set webcrypto(wc) { + this._webcrypto = wc; + } + set curve(c) { + this._curve.curve = c; + } + getRandomBytes(n) { + const array = new Uint8Array(n); + this._webcrypto.getRandomValues(array); + return util.uint8ArrayToArrayBuffer(array); + } + encrypt(key, data, iv) { + return __awaiter(this, void 0, void 0, function* () { + const impkey = yield this._webcrypto.subtle.importKey("raw", key, { name: "AES-CBC" }, false, ["encrypt"]); + return this._webcrypto.subtle.encrypt({ name: "AES-CBC", iv: new Uint8Array(iv) }, impkey, data); + }); + } + decrypt(key, data, iv) { + return __awaiter(this, void 0, void 0, function* () { + const impkey = yield this._webcrypto.subtle.importKey("raw", key, { name: "AES-CBC" }, false, ["decrypt"]); + return this._webcrypto.subtle.decrypt({ name: "AES-CBC", iv: new Uint8Array(iv) }, impkey, data); + }); + } + sign(key, data) { + return __awaiter(this, void 0, void 0, function* () { + const impkey = yield this._webcrypto.subtle.importKey("raw", key, { name: "HMAC", hash: { name: "SHA-256" } }, false, ["sign"]); + try { + return this._webcrypto.subtle.sign({ name: "HMAC", hash: "SHA-256" }, impkey, data); + } catch (e) { + throw e; + } + }); + } + hash(data) { + return __awaiter(this, void 0, void 0, function* () { + return this._webcrypto.subtle.digest({ name: "SHA-512" }, data); + }); + } + HKDF(input, salt, info) { + return __awaiter(this, void 0, void 0, function* () { + if (typeof info === "string") { + throw new Error(`HKDF info was a string`); + } + const PRK = yield Internal.crypto.sign(salt, input); + const infoBuffer = new ArrayBuffer(info.byteLength + 1 + 32); + const infoArray = new Uint8Array(infoBuffer); + infoArray.set(new Uint8Array(info), 32); + infoArray[infoArray.length - 1] = 1; + const T1 = yield Internal.crypto.sign(PRK, infoBuffer.slice(32)); + infoArray.set(new Uint8Array(T1)); + infoArray[infoArray.length - 1] = 2; + const T2 = yield Internal.crypto.sign(PRK, infoBuffer); + infoArray.set(new Uint8Array(T2)); + infoArray[infoArray.length - 1] = 3; + const T3 = yield Internal.crypto.sign(PRK, infoBuffer); + return [T1, T2, T3]; + }); + } + // Curve25519 crypto + createKeyPair(privKey) { + if (!privKey) { + privKey = this.getRandomBytes(32); + } + return this._curve.createKeyPair(privKey); + } + ECDHE(pubKey, privKey) { + return this._curve.ECDHE(pubKey, privKey); + } + Ed25519Sign(privKey, message) { + return this._curve.Ed25519Sign(privKey, message); + } + Ed25519Verify(pubKey, msg, sig) { + return this._curve.Ed25519Verify(pubKey, msg, sig); + } + }; + exports.Crypto = Crypto; + exports.crypto = new Crypto(); + function setWebCrypto(webcrypto2) { + exports.crypto.webcrypto = webcrypto2; + } + exports.setWebCrypto = setWebCrypto; + function setCurve(curve) { + exports.crypto.curve = curve; + } + exports.setCurve = setCurve; + function HKDF(input, salt, info) { + if (salt.byteLength != 32) { + throw new Error("Got salt of incorrect length"); + } + const abInfo = util.binaryStringToArrayBuffer(info); + if (!abInfo) { + throw new Error(`Invalid HKDF info`); + } + return exports.crypto.HKDF(input, salt, abInfo); + } + exports.HKDF = HKDF; + function verifyMAC(data, key, mac, length) { + return __awaiter(this, void 0, void 0, function* () { + const calculated_mac = yield exports.crypto.sign(key, data); + if (mac.byteLength != length || calculated_mac.byteLength < length) { + throw new Error("Bad MAC length"); + } + const a = new Uint8Array(calculated_mac); + const b = new Uint8Array(mac); + let result = 0; + for (let i2 = 0; i2 < mac.byteLength; ++i2) { + result = result | a[i2] ^ b[i2]; + } + if (result !== 0) { + throw new Error("Bad MAC"); + } + }); + } + exports.verifyMAC = verifyMAC; + function calculateMAC(key, data) { + return exports.crypto.sign(key, data); + } + exports.calculateMAC = calculateMAC; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/internal/index.js +var require_internal = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/internal/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_curve(), exports); + __exportStar(require_crypto(), exports); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/curve.js +var require_curve2 = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/curve.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncCurve = exports.Curve = void 0; + var Internal = __importStar(require_internal()); + var Curve = class { + constructor(curve) { + this._curve = curve; + this.async = new AsyncCurve(curve.async); + } + generateKeyPair() { + const privKey = Internal.crypto.getRandomBytes(32); + return this._curve.createKeyPair(privKey); + } + createKeyPair(privKey) { + return this._curve.createKeyPair(privKey); + } + calculateAgreement(pubKey, privKey) { + return this._curve.ECDHE(pubKey, privKey); + } + verifySignature(pubKey, msg, sig) { + return this._curve.Ed25519Verify(pubKey, msg, sig); + } + calculateSignature(privKey, message) { + return this._curve.Ed25519Sign(privKey, message); + } + }; + exports.Curve = Curve; + var AsyncCurve = class { + constructor(curve) { + this._curve = curve; + } + generateKeyPair() { + const privKey = Internal.crypto.getRandomBytes(32); + return this._curve.createKeyPair(privKey); + } + createKeyPair(privKey) { + return this._curve.createKeyPair(privKey); + } + calculateAgreement(pubKey, privKey) { + return this._curve.ECDHE(pubKey, privKey); + } + verifySignature(pubKey, msg, sig) { + return this._curve.Ed25519Verify(pubKey, msg, sig); + } + calculateSignature(privKey, message) { + return this._curve.Ed25519Sign(privKey, message); + } + }; + exports.AsyncCurve = AsyncCurve; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/types.js +var require_types2 = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/types.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Direction = void 0; + var Direction; + (function(Direction2) { + Direction2[Direction2["SENDING"] = 1] = "SENDING"; + Direction2[Direction2["RECEIVING"] = 2] = "RECEIVING"; + })(Direction = exports.Direction || (exports.Direction = {})); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/signal-protocol-address.js +var require_signal_protocol_address = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/signal-protocol-address.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SignalProtocolAddress = void 0; + var SignalProtocolAddress3 = class _SignalProtocolAddress { + constructor(_name, _deviceId) { + this._name = _name; + this._deviceId = _deviceId; + } + static fromString(s) { + if (!s.match(/.*\.\d+/)) { + throw new Error(`Invalid SignalProtocolAddress string: ${s}`); + } + const parts = s.split("."); + return new _SignalProtocolAddress(parts[0], parseInt(parts[1])); + } + // Readonly properties + get name() { + return this._name; + } + get deviceId() { + return this._deviceId; + } + // Expose properties as fuynctions for compatibility + getName() { + return this._name; + } + getDeviceId() { + return this._deviceId; + } + toString() { + return `${this._name}.${this._deviceId}`; + } + equals(other) { + return other.name === this._name && other.deviceId == this._deviceId; + } + }; + exports.SignalProtocolAddress = SignalProtocolAddress3; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/key-helper.js +var require_key_helper = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/key-helper.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyHelper = void 0; + var Internal = __importStar(require_internal()); + var KeyHelper3 = class { + static generateIdentityKeyPair() { + return Internal.crypto.createKeyPair(); + } + static generateRegistrationId() { + const registrationId = new Uint16Array(Internal.crypto.getRandomBytes(2))[0]; + return registrationId & 16383; + } + static generateSignedPreKey(identityKeyPair, signedKeyId) { + return __awaiter(this, void 0, void 0, function* () { + if (!(identityKeyPair.privKey instanceof ArrayBuffer) || identityKeyPair.privKey.byteLength !== 32 || !(identityKeyPair.pubKey instanceof ArrayBuffer) || identityKeyPair.pubKey.byteLength !== 33) { + throw new TypeError("Invalid argument for identityKeyPair"); + } + if (!isNonNegativeInteger(signedKeyId)) { + throw new TypeError("Invalid argument for signedKeyId: " + signedKeyId); + } + const keyPair = yield Internal.crypto.createKeyPair(); + const sig = yield Internal.crypto.Ed25519Sign(identityKeyPair.privKey, keyPair.pubKey); + return { + keyId: signedKeyId, + keyPair, + signature: sig + }; + }); + } + static generatePreKey(keyId) { + return __awaiter(this, void 0, void 0, function* () { + if (!isNonNegativeInteger(keyId)) { + throw new TypeError("Invalid argument for keyId: " + keyId); + } + const keyPair = yield Internal.crypto.createKeyPair(); + return { keyId, keyPair }; + }); + } + }; + exports.KeyHelper = KeyHelper3; + function isNonNegativeInteger(n) { + return typeof n === "number" && n % 1 === 0 && n >= 0; + } + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/fingerprint-generator.js +var require_fingerprint_generator = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/fingerprint-generator.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.FingerprintGenerator = void 0; + var utils = __importStar(require_helpers()); + var msrcrypto = require_msrcrypto(); + var FingerprintGenerator3 = class { + constructor(_iterations) { + this._iterations = _iterations; + } + createFor(localIdentifier, localIdentityKey, remoteIdentifier, remoteIdentityKey) { + return __awaiter(this, void 0, void 0, function* () { + const localStr = yield getDisplayStringFor(localIdentifier, localIdentityKey, this._iterations); + const remoteStr = yield getDisplayStringFor(remoteIdentifier, remoteIdentityKey, this._iterations); + return [localStr, remoteStr].sort().join(""); + }); + } + }; + exports.FingerprintGenerator = FingerprintGenerator3; + FingerprintGenerator3.VERSION = 0; + function getDisplayStringFor(identifier, key, iterations) { + return __awaiter(this, void 0, void 0, function* () { + const bytes = concatArrayBuffers([ + shortToArrayBuffer(FingerprintGenerator3.VERSION), + key, + utils.binaryStringToArrayBuffer(identifier) + ]); + const hash = yield iterateHash(bytes, key, iterations); + const output = new Uint8Array(hash); + return getEncodedChunk(output, 0) + getEncodedChunk(output, 5) + getEncodedChunk(output, 10) + getEncodedChunk(output, 15) + getEncodedChunk(output, 20) + getEncodedChunk(output, 25); + }); + } + function iterateHash(data, key, count) { + return __awaiter(this, void 0, void 0, function* () { + const data1 = concatArrayBuffers([data, key]); + const result = yield msrcrypto.subtle.digest({ name: "SHA-512" }, data1); + if (--count === 0) { + return result; + } else { + return iterateHash(result, key, count); + } + }); + } + function getEncodedChunk(hash, offset) { + const chunk = (hash[offset] * Math.pow(2, 32) + hash[offset + 1] * Math.pow(2, 24) + hash[offset + 2] * Math.pow(2, 16) + hash[offset + 3] * Math.pow(2, 8) + hash[offset + 4]) % 1e5; + let s = chunk.toString(); + while (s.length < 5) { + s = "0" + s; + } + return s; + } + function shortToArrayBuffer(number) { + return new Uint16Array([number]).buffer; + } + function concatArrayBuffers(bufs) { + const lengths = bufs.map((b) => b.byteLength); + const totalLength = lengths.reduce((p, c) => p + c, 0); + const result = new Uint8Array(totalLength); + lengths.reduce((p, c, i2) => { + result.set(new Uint8Array(bufs[i2]), p); + return p + c; + }, 0); + return result.buffer; + } + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-types.js +var require_session_types = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-types.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EncryptionResultMessageType = exports.BaseKeyType = exports.ChainType = void 0; + var ChainType; + (function(ChainType2) { + ChainType2[ChainType2["SENDING"] = 1] = "SENDING"; + ChainType2[ChainType2["RECEIVING"] = 2] = "RECEIVING"; + })(ChainType = exports.ChainType || (exports.ChainType = {})); + var BaseKeyType; + (function(BaseKeyType2) { + BaseKeyType2[BaseKeyType2["OURS"] = 1] = "OURS"; + BaseKeyType2[BaseKeyType2["THEIRS"] = 2] = "THEIRS"; + })(BaseKeyType = exports.BaseKeyType || (exports.BaseKeyType = {})); + var EncryptionResultMessageType; + (function(EncryptionResultMessageType2) { + EncryptionResultMessageType2[EncryptionResultMessageType2["WhisperMessage"] = 1] = "WhisperMessage"; + EncryptionResultMessageType2[EncryptionResultMessageType2["PreKeyWhisperMessage"] = 3] = "PreKeyWhisperMessage"; + })(EncryptionResultMessageType = exports.EncryptionResultMessageType || (exports.EncryptionResultMessageType = {})); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-record.js +var require_session_record = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-record.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sessionTypeArrayBufferToString = exports.sessionTypeStringToArrayBuffer = exports.indexInfoArrayBufferToString = exports.indexInfoStringToArrayBuffer = exports.ratchetArrayBufferToString = exports.ratchetStringToArrayBuffer = exports.oldRatchetInfoArrayBufferToString = exports.oldRatchetInfoStringToArrayBuffer = exports.chainArrayBufferToString = exports.chainStringToArrayBuffer = exports.pendingPreKeyArrayBufferToString = exports.pendingPreKeyStringToArrayBuffer = exports.keyPairArrayBufferToString = exports.keyPairStirngToArrayBuffer = exports.SessionRecord = void 0; + var base64_js_1 = __importDefault(require_base64_js()); + var util = __importStar(require_helpers()); + var session_types_1 = require_session_types(); + var ARCHIVED_STATES_MAX_LENGTH = 40; + var OLD_RATCHETS_MAX_LENGTH = 10; + var SESSION_RECORD_VERSION = "v1"; + var SessionRecord = class _SessionRecord { + constructor(registrationId) { + this.sessions = {}; + this.version = SESSION_RECORD_VERSION; + this.registrationId = registrationId; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + static migrate(data) { + let run = data.version === void 0; + for (let i2 = 0; i2 < _SessionRecord.migrations.length; ++i2) { + if (run) { + _SessionRecord.migrations[i2].migrate(data); + } else if (_SessionRecord.migrations[i2].version === data.version) { + run = true; + } + } + if (!run) { + throw new Error("Error migrating SessionRecord"); + } + } + static deserialize(serialized) { + const data = JSON.parse(serialized); + if (data.version !== SESSION_RECORD_VERSION) { + _SessionRecord.migrate(data); + } + const record = new _SessionRecord(); + record.sessions = {}; + for (const k of Object.keys(data.sessions)) { + record.sessions[k] = sessionTypeStringToArrayBuffer(data.sessions[k]); + } + if (record.sessions === void 0 || record.sessions === null || typeof record.sessions !== "object" || Array.isArray(record.sessions)) { + throw new Error("Error deserializing SessionRecord"); + } + return record; + } + serialize() { + const sessions = {}; + for (const k of Object.keys(this.sessions)) { + sessions[k] = sessionTypeArrayBufferToString(this.sessions[k]); + } + const json = { + sessions, + version: this.version + }; + return JSON.stringify(json); + } + haveOpenSession() { + const openSession = this.getOpenSession(); + return !!openSession && typeof openSession.registrationId === "number"; + } + getSessionByBaseKey(baseKey) { + const idx = util.arrayBufferToString(baseKey); + if (!idx) { + return void 0; + } + const session = this.sessions[idx]; + if (session && session.indexInfo.baseKeyType === session_types_1.BaseKeyType.OURS) { + return void 0; + } + return session; + } + getSessionByRemoteEphemeralKey(remoteEphemeralKey) { + this.detectDuplicateOpenSessions(); + const sessions = this.sessions; + const searchKey = util.arrayBufferToString(remoteEphemeralKey); + if (searchKey) { + let openSession; + for (const key in sessions) { + if (sessions[key].indexInfo.closed == -1) { + openSession = sessions[key]; + } + if (sessions[key].chains[searchKey] !== void 0) { + return sessions[key]; + } + } + if (openSession !== void 0) { + return openSession; + } + } + return void 0; + } + getOpenSession() { + const sessions = this.sessions; + if (sessions === void 0) { + return void 0; + } + this.detectDuplicateOpenSessions(); + for (const key in sessions) { + if (sessions[key].indexInfo.closed == -1) { + return sessions[key]; + } + } + return void 0; + } + detectDuplicateOpenSessions() { + let openSession = null; + const sessions = this.sessions; + for (const key in sessions) { + if (sessions[key].indexInfo.closed == -1) { + if (openSession !== null) { + throw new Error("Datastore inconsistensy: multiple open sessions"); + } + openSession = sessions[key]; + } + } + } + updateSessionState(session) { + const sessions = this.sessions; + this.removeOldChains(session); + const idx = session.indexInfo.baseKey && util.arrayBufferToString(session.indexInfo.baseKey); + if (!idx) { + throw new Error(`invalid index for session`); + } + sessions[idx] = session; + this.removeOldSessions(); + } + getSessions() { + let list = []; + let openSession = null; + for (const k in this.sessions) { + if (this.sessions[k].indexInfo.closed === -1) { + openSession = this.sessions[k]; + } else { + list.push(this.sessions[k]); + } + } + list = list.sort(function(s1, s2) { + return s1.indexInfo.closed - s2.indexInfo.closed; + }); + if (openSession) { + list.push(openSession); + } + return list; + } + archiveCurrentState() { + const open_session = this.getOpenSession(); + if (open_session !== void 0) { + open_session.indexInfo.closed = Date.now(); + this.updateSessionState(open_session); + } + } + promoteState(session) { + session.indexInfo.closed = -1; + } + removeOldChains(session) { + while (session.oldRatchetList.length > OLD_RATCHETS_MAX_LENGTH) { + let index = 0; + let oldest = session.oldRatchetList[0]; + for (let i2 = 0; i2 < session.oldRatchetList.length; i2++) { + if (session.oldRatchetList[i2].added < oldest.added) { + oldest = session.oldRatchetList[i2]; + index = i2; + } + } + const idx = util.arrayBufferToString(oldest.ephemeralKey); + if (!idx) { + throw new Error(`invalid index for chain`); + } + delete session[idx]; + session.oldRatchetList.splice(index, 1); + } + } + removeOldSessions() { + const { sessions } = this; + let oldestBaseKey = null; + let oldestSession = null; + while (Object.keys(sessions).length > ARCHIVED_STATES_MAX_LENGTH) { + for (const key in sessions) { + const session = sessions[key]; + if (session.indexInfo.closed > -1 && // session is closed + (!oldestSession || session.indexInfo.closed < oldestSession.indexInfo.closed)) { + oldestBaseKey = key; + oldestSession = session; + } + } + if (oldestBaseKey) { + delete sessions[oldestBaseKey]; + } + } + } + deleteAllSessions() { + this.sessions = {}; + } + }; + exports.SessionRecord = SessionRecord; + SessionRecord.migrations = [ + { + version: "v1", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + migrate: function migrateV1(data) { + const sessions = data.sessions; + let key; + if (data.registrationId) { + for (key in sessions) { + if (!sessions[key].registrationId) { + sessions[key].registrationId = data.registrationId; + } + } + } else { + for (key in sessions) { + if (sessions[key].indexInfo.closed === -1) { + } + } + } + } + } + ]; + function toAB(s) { + return util.uint8ArrayToArrayBuffer(base64_js_1.default.toByteArray(s)); + } + function abToS(b) { + return base64_js_1.default.fromByteArray(new Uint8Array(b)); + } + function keyPairStirngToArrayBuffer(kp) { + return { + pubKey: toAB(kp.pubKey), + privKey: toAB(kp.privKey) + }; + } + exports.keyPairStirngToArrayBuffer = keyPairStirngToArrayBuffer; + function keyPairArrayBufferToString(kp) { + return { + pubKey: abToS(kp.pubKey), + privKey: abToS(kp.privKey) + }; + } + exports.keyPairArrayBufferToString = keyPairArrayBufferToString; + function pendingPreKeyStringToArrayBuffer(ppk) { + const { preKeyId, signedKeyId } = ppk; + return { + baseKey: toAB(ppk.baseKey), + preKeyId, + signedKeyId + }; + } + exports.pendingPreKeyStringToArrayBuffer = pendingPreKeyStringToArrayBuffer; + function pendingPreKeyArrayBufferToString(ppk) { + const { preKeyId, signedKeyId } = ppk; + return { + baseKey: abToS(ppk.baseKey), + preKeyId, + signedKeyId + }; + } + exports.pendingPreKeyArrayBufferToString = pendingPreKeyArrayBufferToString; + function chainStringToArrayBuffer(c) { + const { chainType, chainKey, messageKeys } = c; + const { key, counter } = chainKey; + const newMessageKeys = {}; + for (const k of Object.keys(messageKeys)) { + newMessageKeys[k] = toAB(messageKeys[k]); + } + return { + chainType, + chainKey: { + key: key ? util.uint8ArrayToArrayBuffer(base64_js_1.default.toByteArray(key)) : void 0, + counter + }, + messageKeys: newMessageKeys + }; + } + exports.chainStringToArrayBuffer = chainStringToArrayBuffer; + function chainArrayBufferToString(c) { + const { chainType, chainKey, messageKeys } = c; + const { key, counter } = chainKey; + const newMessageKeys = {}; + for (const k of Object.keys(messageKeys)) { + newMessageKeys[k] = abToS(messageKeys[k]); + } + return { + chainType, + chainKey: { + key: key ? abToS(key) : void 0, + counter + }, + messageKeys: newMessageKeys + }; + } + exports.chainArrayBufferToString = chainArrayBufferToString; + function oldRatchetInfoStringToArrayBuffer(ori) { + return { + ephemeralKey: toAB(ori.ephemeralKey), + added: ori.added + }; + } + exports.oldRatchetInfoStringToArrayBuffer = oldRatchetInfoStringToArrayBuffer; + function oldRatchetInfoArrayBufferToString(ori) { + return { + ephemeralKey: abToS(ori.ephemeralKey), + added: ori.added + }; + } + exports.oldRatchetInfoArrayBufferToString = oldRatchetInfoArrayBufferToString; + function ratchetStringToArrayBuffer(r) { + return { + rootKey: toAB(r.rootKey), + ephemeralKeyPair: r.ephemeralKeyPair && keyPairStirngToArrayBuffer(r.ephemeralKeyPair), + lastRemoteEphemeralKey: toAB(r.lastRemoteEphemeralKey), + previousCounter: r.previousCounter, + added: r.added + }; + } + exports.ratchetStringToArrayBuffer = ratchetStringToArrayBuffer; + function ratchetArrayBufferToString(r) { + return { + rootKey: abToS(r.rootKey), + ephemeralKeyPair: r.ephemeralKeyPair && keyPairArrayBufferToString(r.ephemeralKeyPair), + lastRemoteEphemeralKey: abToS(r.lastRemoteEphemeralKey), + previousCounter: r.previousCounter, + added: r.added + }; + } + exports.ratchetArrayBufferToString = ratchetArrayBufferToString; + function indexInfoStringToArrayBuffer(ii) { + const { closed, remoteIdentityKey, baseKey, baseKeyType } = ii; + return { + closed, + remoteIdentityKey: toAB(remoteIdentityKey), + baseKey: baseKey ? toAB(baseKey) : void 0, + baseKeyType + }; + } + exports.indexInfoStringToArrayBuffer = indexInfoStringToArrayBuffer; + function indexInfoArrayBufferToString(ii) { + const { closed, remoteIdentityKey, baseKey, baseKeyType } = ii; + return { + closed, + remoteIdentityKey: abToS(remoteIdentityKey), + baseKey: baseKey ? abToS(baseKey) : void 0, + baseKeyType + }; + } + exports.indexInfoArrayBufferToString = indexInfoArrayBufferToString; + function sessionTypeStringToArrayBuffer(sess) { + const { indexInfo, registrationId, currentRatchet, pendingPreKey, oldRatchetList, chains } = sess; + const newChains = {}; + for (const k of Object.keys(chains)) { + newChains[k] = chainStringToArrayBuffer(chains[k]); + } + return { + indexInfo: indexInfoStringToArrayBuffer(indexInfo), + registrationId, + currentRatchet: ratchetStringToArrayBuffer(currentRatchet), + pendingPreKey: pendingPreKey ? pendingPreKeyStringToArrayBuffer(pendingPreKey) : void 0, + oldRatchetList: oldRatchetList.map(oldRatchetInfoStringToArrayBuffer), + chains: newChains + }; + } + exports.sessionTypeStringToArrayBuffer = sessionTypeStringToArrayBuffer; + function sessionTypeArrayBufferToString(sess) { + const { indexInfo, registrationId, currentRatchet, pendingPreKey, oldRatchetList, chains } = sess; + const newChains = {}; + for (const k of Object.keys(chains)) { + newChains[k] = chainArrayBufferToString(chains[k]); + } + return { + indexInfo: indexInfoArrayBufferToString(indexInfo), + registrationId, + currentRatchet: ratchetArrayBufferToString(currentRatchet), + pendingPreKey: pendingPreKey ? pendingPreKeyArrayBufferToString(pendingPreKey) : void 0, + oldRatchetList: oldRatchetList.map(oldRatchetInfoArrayBufferToString), + chains: newChains + }; + } + exports.sessionTypeArrayBufferToString = sessionTypeArrayBufferToString; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-lock.js +var require_session_lock = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-lock.js"(exports) { + "use strict"; + init_inject_buffer(); + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SessionLock = void 0; + var jobQueue = {}; + var SessionLock = class _SessionLock { + static queueJobForNumber(id, runJob) { + const runPrevious = jobQueue[id] || Promise.resolve(); + const runCurrent = jobQueue[id] = runPrevious.then(runJob, runJob); + const promise = runCurrent.then(function() { + if (jobQueue[id] === runCurrent) { + delete jobQueue[id]; + } + }).catch((e) => { + _SessionLock.errors.push(e); + }); + _SessionLock._promises.push(promise); + return runCurrent; + } + static clearQueue() { + return __awaiter(this, void 0, void 0, function* () { + yield Promise.all(_SessionLock._promises); + }); + } + }; + exports.SessionLock = SessionLock; + SessionLock.errors = []; + SessionLock._promises = []; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-builder.js +var require_session_builder = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-builder.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SessionBuilder = void 0; + var types_1 = require_types2(); + var session_types_1 = require_session_types(); + var Internal = __importStar(require_internal()); + var base64 = __importStar(require_base64_js()); + var session_record_1 = require_session_record(); + var session_lock_1 = require_session_lock(); + var helpers_1 = require_helpers(); + var SessionBuilder3 = class { + constructor(storage, remoteAddress) { + this.processPreKeyJob = (device) => __awaiter(this, void 0, void 0, function* () { + var _a; + const trusted = yield this.storage.isTrustedIdentity(this.remoteAddress.name, device.identityKey, types_1.Direction.SENDING); + if (!trusted) { + throw new Error("Identity key changed"); + } + yield Internal.crypto.Ed25519Verify(device.identityKey, device.signedPreKey.publicKey, device.signedPreKey.signature); + const ephemeralKey = yield Internal.crypto.createKeyPair(); + const deviceOneTimePreKey = (_a = device.preKey) === null || _a === void 0 ? void 0 : _a.publicKey; + const session = yield this.startSessionAsInitiator(ephemeralKey, device.identityKey, device.signedPreKey.publicKey, deviceOneTimePreKey, device.registrationId); + session.pendingPreKey = { + signedKeyId: device.signedPreKey.keyId, + baseKey: ephemeralKey.pubKey + }; + if (device.preKey) { + session.pendingPreKey.preKeyId = device.preKey.keyId; + } + const address = this.remoteAddress.toString(); + const serialized = yield this.storage.loadSession(address); + let record; + if (serialized !== void 0) { + record = session_record_1.SessionRecord.deserialize(serialized); + } else { + record = new session_record_1.SessionRecord(); + } + record.archiveCurrentState(); + record.updateSessionState(session); + yield Promise.all([ + this.storage.storeSession(address, record.serialize()), + this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey) + ]); + return session; + }); + this.startSessionAsInitiator = (EKa, IKb, SPKb, OPKb, registrationId) => __awaiter(this, void 0, void 0, function* () { + const IKa = yield this.storage.getIdentityKeyPair(); + if (!IKa) { + throw new Error(`No identity key. Cannot initiate session.`); + } + let sharedSecret; + if (OPKb === void 0) { + sharedSecret = new Uint8Array(32 * 4); + } else { + sharedSecret = new Uint8Array(32 * 5); + } + for (let i2 = 0; i2 < 32; i2++) { + sharedSecret[i2] = 255; + } + if (!SPKb) { + throw new Error(`theirSignedPubKey is undefined. Cannot proceed with ECDHE`); + } + const ecRes = yield Promise.all([ + Internal.crypto.ECDHE(SPKb, IKa.privKey), + Internal.crypto.ECDHE(IKb, EKa.privKey), + Internal.crypto.ECDHE(SPKb, EKa.privKey) + ]); + sharedSecret.set(new Uint8Array(ecRes[0]), 32); + sharedSecret.set(new Uint8Array(ecRes[1]), 32 * 2); + sharedSecret.set(new Uint8Array(ecRes[2]), 32 * 3); + if (OPKb !== void 0) { + const ecRes4 = yield Internal.crypto.ECDHE(OPKb, EKa.privKey); + sharedSecret.set(new Uint8Array(ecRes4), 32 * 4); + } + const masterKey = yield Internal.HKDF((0, helpers_1.uint8ArrayToArrayBuffer)(sharedSecret), new ArrayBuffer(32), "WhisperText"); + const session = { + registrationId, + currentRatchet: { + rootKey: masterKey[0], + lastRemoteEphemeralKey: SPKb, + previousCounter: 0 + }, + indexInfo: { + remoteIdentityKey: IKb, + closed: -1 + }, + oldRatchetList: [], + chains: {} + }; + session.indexInfo.baseKey = EKa.pubKey; + session.indexInfo.baseKeyType = session_types_1.BaseKeyType.OURS; + const ourSendingEphemeralKey = yield Internal.crypto.createKeyPair(); + session.currentRatchet.ephemeralKeyPair = ourSendingEphemeralKey; + yield this.calculateSendingRatchet(session, SPKb); + return session; + }); + this.startSessionWthPreKeyMessage = (OPKb, SPKb, message) => __awaiter(this, void 0, void 0, function* () { + const IKb = yield this.storage.getIdentityKeyPair(); + const IKa = message.identityKey; + const EKa = message.baseKey; + if (!IKb) { + throw new Error(`No identity key. Cannot initiate session.`); + } + let sharedSecret; + if (!OPKb) { + sharedSecret = new Uint8Array(32 * 4); + } else { + sharedSecret = new Uint8Array(32 * 5); + } + for (let i2 = 0; i2 < 32; i2++) { + sharedSecret[i2] = 255; + } + const ecRes = yield Promise.all([ + Internal.crypto.ECDHE(IKa, SPKb.privKey), + Internal.crypto.ECDHE(EKa, IKb.privKey), + Internal.crypto.ECDHE(EKa, SPKb.privKey) + ]); + sharedSecret.set(new Uint8Array(ecRes[0]), 32); + sharedSecret.set(new Uint8Array(ecRes[1]), 32 * 2); + sharedSecret.set(new Uint8Array(ecRes[2]), 32 * 3); + if (OPKb) { + const ecRes4 = yield Internal.crypto.ECDHE(EKa, OPKb.privKey); + sharedSecret.set(new Uint8Array(ecRes4), 32 * 4); + } + const masterKey = yield Internal.HKDF((0, helpers_1.uint8ArrayToArrayBuffer)(sharedSecret), new ArrayBuffer(32), "WhisperText"); + const session = { + registrationId: message.registrationId, + currentRatchet: { + rootKey: masterKey[0], + lastRemoteEphemeralKey: EKa, + previousCounter: 0 + }, + indexInfo: { + remoteIdentityKey: IKa, + closed: -1 + }, + oldRatchetList: [], + chains: {} + }; + session.indexInfo.baseKey = EKa; + session.indexInfo.baseKeyType = session_types_1.BaseKeyType.THEIRS; + session.currentRatchet.ephemeralKeyPair = SPKb; + return session; + }); + this.remoteAddress = remoteAddress; + this.storage = storage; + } + calculateSendingRatchet(session, remoteKey) { + return __awaiter(this, void 0, void 0, function* () { + const ratchet = session.currentRatchet; + if (!ratchet.ephemeralKeyPair) { + throw new Error(`Invalid ratchet - ephemeral key pair is missing`); + } + const ephPrivKey = ratchet.ephemeralKeyPair.privKey; + const rootKey = ratchet.rootKey; + const ephPubKey = base64.fromByteArray(new Uint8Array(ratchet.ephemeralKeyPair.pubKey)); + if (!(ephPrivKey && ephPubKey && rootKey)) { + throw new Error(`Missing key, cannot calculate sending ratchet`); + } + const sharedSecret = yield Internal.crypto.ECDHE(remoteKey, ephPrivKey); + const masterKey = yield Internal.HKDF(sharedSecret, rootKey, "WhisperRatchet"); + session.chains[ephPubKey] = { + messageKeys: {}, + chainKey: { counter: -1, key: masterKey[1] }, + chainType: session_types_1.ChainType.SENDING + }; + ratchet.rootKey = masterKey[0]; + }); + } + processPreKey(device) { + return __awaiter(this, void 0, void 0, function* () { + const runJob = () => __awaiter(this, void 0, void 0, function* () { + const sess = yield this.processPreKeyJob(device); + return sess; + }); + return session_lock_1.SessionLock.queueJobForNumber(this.remoteAddress.toString(), runJob); + }); + } + processV3(record, message) { + return __awaiter(this, void 0, void 0, function* () { + const trusted = this.storage.isTrustedIdentity(this.remoteAddress.name, (0, helpers_1.uint8ArrayToArrayBuffer)(message.identityKey), types_1.Direction.RECEIVING); + if (!trusted) { + throw new Error(`Unknown identity key: ${(0, helpers_1.uint8ArrayToArrayBuffer)(message.identityKey)}`); + } + const [preKeyPair, signedPreKeyPair] = yield Promise.all([ + this.storage.loadPreKey(message.preKeyId), + this.storage.loadSignedPreKey(message.signedPreKeyId) + ]); + if (record.getSessionByBaseKey(message.baseKey)) { + return; + } + const session = record.getOpenSession(); + if (signedPreKeyPair === void 0) { + if (session !== void 0 && session.currentRatchet !== void 0) { + return; + } else { + throw new Error("Missing Signed PreKey for PreKeyWhisperMessage"); + } + } + if (session !== void 0) { + record.archiveCurrentState(); + } + if (message.preKeyId && !preKeyPair) { + } + const new_session = yield this.startSessionWthPreKeyMessage(preKeyPair, signedPreKeyPair, message); + record.updateSessionState(new_session); + yield this.storage.saveIdentity(this.remoteAddress.toString(), (0, helpers_1.uint8ArrayToArrayBuffer)(message.identityKey)); + return message.preKeyId; + }); + } + }; + exports.SessionBuilder = SessionBuilder3; + } +}); + +// node_modules/@protobufjs/aspromise/index.js +var require_aspromise = __commonJS({ + "node_modules/@protobufjs/aspromise/index.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = asPromise; + function asPromise(fn, ctx) { + var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params2 = new Array(arguments.length - 1), offset2 = 0; + while (offset2 < params2.length) + params2[offset2++] = arguments[offset2]; + resolve.apply(null, params2); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); + } + } +}); + +// node_modules/@protobufjs/base64/index.js +var require_base64 = __commonJS({ + "node_modules/@protobufjs/base64/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var base64 = exports; + base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; + }; + var b64 = new Array(64); + var s64 = new Array(123); + for (i2 = 0; i2 < 64; ) + s64[b64[i2] = i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 - 59 | 43] = i2++; + var i2; + base64.encode = function encode(buffer, start, end) { + var parts = null, chunk = []; + var i3 = 0, j = 0, t; + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i3++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i3++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i3++] = b64[t | b >> 6]; + chunk[i3++] = b64[b & 63]; + j = 0; + break; + } + if (i3 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i3 = 0; + } + } + if (j) { + chunk[i3++] = b64[t]; + chunk[i3++] = 61; + if (j === 1) + chunk[i3++] = 61; + } + if (parts) { + if (i3) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i3))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i3)); + }; + var invalidEncoding = "invalid encoding"; + base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, t; + for (var i3 = 0; i3 < string.length; ) { + var c = string.charCodeAt(i3++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === void 0) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; + }; + base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); + }; + } +}); + +// node_modules/@protobufjs/eventemitter/index.js +var require_eventemitter = __commonJS({ + "node_modules/@protobufjs/eventemitter/index.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = EventEmitter; + function EventEmitter() { + this._listeners = /* @__PURE__ */ Object.create(null); + } + EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn, + ctx: ctx || this + }); + return this; + }; + EventEmitter.prototype.off = function off(evt, fn) { + if (evt === void 0) + this._listeners = /* @__PURE__ */ Object.create(null); + else { + if (fn === void 0) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + if (!listeners) + return this; + for (var i2 = 0; i2 < listeners.length; ) + if (listeners[i2].fn === fn) + listeners.splice(i2, 1); + else + ++i2; + } + } + return this; + }; + EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], i2 = 1; + for (; i2 < arguments.length; ) + args.push(arguments[i2++]); + for (i2 = 0; i2 < listeners.length; ) + listeners[i2].fn.apply(listeners[i2++].ctx, args); + } + return this; + }; + } +}); + +// node_modules/@protobufjs/float/index.js +var require_float = __commonJS({ + "node_modules/@protobufjs/float/index.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = factory(factory); + function factory(exports2) { + if (typeof Float32Array !== "undefined") (function() { + var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + exports2.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + exports2.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + exports2.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + exports2.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + })(); + else (function() { + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? ( + /* positive */ + 0 + ) : ( + /* negative 0 */ + 2147483648 + ), buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 34028234663852886e22) + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 11754943508222875e-54) + writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + exports2.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports2.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; + return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + exports2.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports2.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + })(); + if (typeof Float64Array !== "undefined") (function() { + var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + exports2.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + exports2.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + exports2.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + exports2.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + })(); + else (function() { + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? ( + /* positive */ + 0 + ) : ( + /* negative 0 */ + 2147483648 + ), buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 17976931348623157e292) { + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 22250738585072014e-324) { + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + exports2.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports2.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + exports2.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports2.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + })(); + return exports2; + } + function writeUintLE(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + function writeUintBE(val, buf, pos) { + buf[pos] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; + } + function readUintLE(buf, pos) { + return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; + } + function readUintBE(buf, pos) { + return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; + } + } +}); + +// node_modules/@protobufjs/utf8/index.js +var require_utf8 = __commonJS({ + "node_modules/@protobufjs/utf8/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var utf8 = exports; + var replacementCharCode = 65533; + utf8.length = function utf8_length(string) { + var len = 0, c = 0; + for (var i2 = 0; i2 < string.length; ++i2) { + c = string.charCodeAt(i2); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 64512) === 55296 && (string.charCodeAt(i2 + 1) & 64512) === 56320) { + ++i2; + len += 4; + } else + len += 3; + } + return len; + }; + utf8.read = function utf8_read(buffer, start, end) { + if (end - start < 1) + return ""; + var parts = null, chunk = [], i2 = 0, t, t2, c2, c3; + while (start < end) { + t = buffer[start++]; + if (t <= 127) { + chunk[i2++] = t; + } else if (t >= 192 && t < 224) { + c2 = (t & 31) << 6 | buffer[start++] & 63; + chunk[i2++] = c2 >= 128 ? c2 : replacementCharCode; + } else if (t >= 224 && t < 240) { + c3 = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + chunk[i2++] = c3 >= 2048 ? c3 : replacementCharCode; + } else if (t >= 240) { + t2 = (t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (t2 < 65536 || t2 > 1114111) + chunk[i2++] = replacementCharCode; + else { + t2 -= 65536; + chunk[i2++] = 55296 + (t2 >> 10); + chunk[i2++] = 56320 + (t2 & 1023); + } + } + if (i2 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk.slice(0, i2))); + i2 = 0; + } + } + if (parts) { + if (i2) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i2))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i2)); + }; + utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, c1, c2; + for (var i2 = 0; i2 < string.length; ++i2) { + c1 = string.charCodeAt(i2); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c2 = string.charCodeAt(i2 + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); + ++i2; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; + }; + } +}); + +// node_modules/@protobufjs/pool/index.js +var require_pool = __commonJS({ + "node_modules/@protobufjs/pool/index.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = pool; + function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size2) { + if (size2 < 1 || size2 > MAX) + return alloc(size2); + if (offset + size2 > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size2); + if (offset & 7) + offset = (offset | 7) + 1; + return buf; + }; + } + } +}); + +// node_modules/protobufjs/src/util/longbits.js +var require_longbits = __commonJS({ + "node_modules/protobufjs/src/util/longbits.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = LongBits; + var util = require_minimal(); + function LongBits(lo, hi) { + this.lo = lo >>> 0; + this.hi = hi >>> 0; + } + var zero = LongBits.zero = new LongBits(0, 0); + zero.toNumber = function() { + return 0; + }; + zero.zzEncode = zero.zzDecode = function() { + return this; + }; + zero.length = function() { + return 1; + }; + var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); + }; + LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; + }; + LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; + }; + LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; + }; + var charCodeAt = String.prototype.charCodeAt; + LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + (charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0, + (charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0 + ); + }; + LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24, + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); + }; + LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = (this.lo << 1 ^ mask) >>> 0; + return this; + }; + LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = (this.hi >>> 1 ^ mask) >>> 0; + return this; + }; + LongBits.prototype.length = function length() { + var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; + return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; + }; + } +}); + +// node_modules/long/umd/index.js +var require_umd = __commonJS({ + "node_modules/long/umd/index.js"(exports, module) { + init_inject_buffer(); + (function(global2, factory) { + function preferDefault(exports2) { + return exports2.default || exports2; + } + if (typeof define === "function" && define.amd) { + define([], function() { + var exports2 = {}; + factory(exports2); + return preferDefault(exports2); + }); + } else if (typeof exports === "object") { + factory(exports); + if (typeof module === "object") module.exports = preferDefault(exports); + } else { + (function() { + var exports2 = {}; + factory(exports2); + global2.Long = preferDefault(exports2); + })(); + } + })( + typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports, + function(_exports) { + "use strict"; + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.default = void 0; + var wasm = null; + try { + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + new Uint8Array([ + // \0asm + 0, + 97, + 115, + 109, + // version 1 + 1, + 0, + 0, + 0, + // section "type" + 1, + 13, + 2, + // 0, () => i32 + 96, + 0, + 1, + 127, + // 1, (i32, i32, i32, i32) => i32 + 96, + 4, + 127, + 127, + 127, + 127, + 1, + 127, + // section "function" + 3, + 7, + 6, + // 0, type 0 + 0, + // 1, type 1 + 1, + // 2, type 1 + 1, + // 3, type 1 + 1, + // 4, type 1 + 1, + // 5, type 1 + 1, + // section "global" + 6, + 6, + 1, + // 0, "high", mutable i32 + 127, + 1, + 65, + 0, + 11, + // section "export" + 7, + 50, + 6, + // 0, "mul" + 3, + 109, + 117, + 108, + 0, + 1, + // 1, "div_s" + 5, + 100, + 105, + 118, + 95, + 115, + 0, + 2, + // 2, "div_u" + 5, + 100, + 105, + 118, + 95, + 117, + 0, + 3, + // 3, "rem_s" + 5, + 114, + 101, + 109, + 95, + 115, + 0, + 4, + // 4, "rem_u" + 5, + 114, + 101, + 109, + 95, + 117, + 0, + 5, + // 5, "get_high" + 8, + 103, + 101, + 116, + 95, + 104, + 105, + 103, + 104, + 0, + 0, + // section "code" + 10, + 191, + 1, + 6, + // 0, "get_high" + 4, + 0, + 35, + 0, + 11, + // 1, "mul" + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 126, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + // 2, "div_s" + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 127, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + // 3, "div_u" + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 128, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + // 4, "rem_s" + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 129, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + // 5, "rem_u" + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 130, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11 + ]) + ), + {} + ).exports; + } catch { + } + function Long(low, high, unsigned) { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Long.prototype.__isLong__; + Object.defineProperty(Long.prototype, "__isLong__", { + value: true + }); + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; + } + Long.isLong = isLong; + var INT_CACHE = {}; + var UINT_CACHE = {}; + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = 0 <= value && value < 256) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = -128 <= value && value < 128) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } + Long.fromInt = fromInt; + function fromNumber(value, unsigned) { + if (isNaN(value)) return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) return UZERO; + if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; + } + if (value < 0) return fromNumber(-value, unsigned).neg(); + return fromBits( + value % TWO_PWR_32_DBL | 0, + value / TWO_PWR_32_DBL | 0, + unsigned + ); + } + Long.fromNumber = fromNumber; + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + Long.fromBits = fromBits; + var pow_dbl = Math.pow; + function fromString(str, unsigned, radix) { + if (str.length === 0) throw Error("empty string"); + if (typeof unsigned === "number") { + radix = unsigned; + unsigned = false; + } else { + unsigned = !!unsigned; + } + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + var p; + if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i2 = 0; i2 < str.length; i2 += 8) { + var size = Math.min(8, str.length - i2), value = parseInt(str.substring(i2, i2 + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + Long.fromString = fromString; + function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); + return fromBits( + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned + ); + } + Long.fromValue = fromValue; + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + var ZERO = fromInt(0); + Long.ZERO = ZERO; + var UZERO = fromInt(0, true); + Long.UZERO = UZERO; + var ONE = fromInt(1); + Long.ONE = ONE; + var UONE = fromInt(1, true); + Long.UONE = UONE; + var NEG_ONE = fromInt(-1); + Long.NEG_ONE = NEG_ONE; + var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); + Long.MAX_VALUE = MAX_VALUE; + var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + var MIN_VALUE = fromBits(0, 2147483648 | 0, false); + Long.MIN_VALUE = MIN_VALUE; + var LongPrototype = Long.prototype; + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + if (this.isZero()) return "0"; + if (this.isNegative()) { + if (this.eq(MIN_VALUE)) { + var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return "-" + this.neg().toString(radix); + } + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; + var result = ""; + while (true) { + var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) return digits + result; + else { + while (digits.length < 6) digits = "0" + digits; + result = "" + digits + result; + } + } + }; + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + LongPrototype.isSafeInteger = function isSafeInteger() { + var top11Bits = this.high >> 21; + if (!top11Bits) return true; + if (this.unsigned) return false; + return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); + }; + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + LongPrototype.eqz = LongPrototype.isZero; + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + LongPrototype.equals = function equals(other) { + if (!isLong(other)) other = fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + LongPrototype.eq = LongPrototype.equals; + LongPrototype.notEquals = function notEquals(other) { + return !this.eq( + /* validates */ + other + ); + }; + LongPrototype.neq = LongPrototype.notEquals; + LongPrototype.ne = LongPrototype.notEquals; + LongPrototype.lessThan = function lessThan(other) { + return this.comp( + /* validates */ + other + ) < 0; + }; + LongPrototype.lt = LongPrototype.lessThan; + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp( + /* validates */ + other + ) <= 0; + }; + LongPrototype.lte = LongPrototype.lessThanOrEqual; + LongPrototype.le = LongPrototype.lessThanOrEqual; + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp( + /* validates */ + other + ) > 0; + }; + LongPrototype.gt = LongPrototype.greaterThan; + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp( + /* validates */ + other + ) >= 0; + }; + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + LongPrototype.ge = LongPrototype.greaterThanOrEqual; + LongPrototype.compare = function compare(other) { + if (!isLong(other)) other = fromValue(other); + if (this.eq(other)) return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; + }; + LongPrototype.comp = LongPrototype.compare; + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; + return this.not().add(ONE); + }; + LongPrototype.neg = LongPrototype.negate; + LongPrototype.add = function add(addend) { + if (!isLong(addend)) addend = fromValue(addend); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = addend.high >>> 16; + var b32 = addend.high & 65535; + var b16 = addend.low >>> 16; + var b00 = addend.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 + b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + LongPrototype.sub = LongPrototype.subtract; + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) return this; + if (!isLong(multiplier)) multiplier = fromValue(multiplier); + if (wasm) { + var low = wasm["mul"]( + this.low, + this.high, + multiplier.low, + multiplier.high + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; + if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber( + this.toNumber() * multiplier.toNumber(), + this.unsigned + ); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 65535; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 65535; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + LongPrototype.mul = LongPrototype.multiply; + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (divisor.isZero()) throw Error("division by zero"); + if (wasm) { + if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { + return this; + } + var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( + this.low, + this.high, + divisor.low, + divisor.high + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + if (this.isZero()) return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; + else if (divisor.eq(MIN_VALUE)) return ONE; + else { + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return UZERO; + if (divisor.gt(this.shru(1))) + return UONE; + res = UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) approxRes = ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + LongPrototype.div = LongPrototype.divide; + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (wasm) { + var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( + this.low, + this.high, + divisor.low, + divisor.high + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + LongPrototype.mod = LongPrototype.modulo; + LongPrototype.rem = LongPrototype.modulo; + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + LongPrototype.countLeadingZeros = function countLeadingZeros() { + return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; + }; + LongPrototype.clz = LongPrototype.countLeadingZeros; + LongPrototype.countTrailingZeros = function countTrailingZeros() { + return this.low ? ctz32(this.low) : ctz32(this.high) + 32; + }; + LongPrototype.ctz = LongPrototype.countTrailingZeros; + LongPrototype.and = function and(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits( + this.low & other.low, + this.high & other.high, + this.unsigned + ); + }; + LongPrototype.or = function or(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits( + this.low | other.low, + this.high | other.high, + this.unsigned + ); + }; + LongPrototype.xor = function xor(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits( + this.low ^ other.low, + this.high ^ other.high, + this.unsigned + ); + }; + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return fromBits( + this.low << numBits, + this.high << numBits | this.low >>> 32 - numBits, + this.unsigned + ); + else return fromBits(0, this.low << numBits - 32, this.unsigned); + }; + LongPrototype.shl = LongPrototype.shiftLeft; + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return fromBits( + this.low >>> numBits | this.high << 32 - numBits, + this.high >> numBits, + this.unsigned + ); + else + return fromBits( + this.high >> numBits - 32, + this.high >= 0 ? 0 : -1, + this.unsigned + ); + }; + LongPrototype.shr = LongPrototype.shiftRight; + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits < 32) + return fromBits( + this.low >>> numBits | this.high << 32 - numBits, + this.high >>> numBits, + this.unsigned + ); + if (numBits === 32) return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> numBits - 32, 0, this.unsigned); + }; + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + this.low << numBits | this.high >>> b, + this.high << numBits | this.low >>> b, + this.unsigned + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + this.high << numBits | this.low >>> b, + this.low << numBits | this.high >>> b, + this.unsigned + ); + }; + LongPrototype.rotl = LongPrototype.rotateLeft; + LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + this.high << b | this.low >>> numBits, + this.low << b | this.high >>> numBits, + this.unsigned + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + this.low << b | this.high >>> numBits, + this.high << b | this.low >>> numBits, + this.unsigned + ); + }; + LongPrototype.rotr = LongPrototype.rotateRight; + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) return this; + return fromBits(this.low, this.high, false); + }; + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) return this; + return fromBits(this.low, this.high, true); + }; + LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, lo = this.low; + return [ + lo & 255, + lo >>> 8 & 255, + lo >>> 16 & 255, + lo >>> 24, + hi & 255, + hi >>> 8 & 255, + hi >>> 16 & 255, + hi >>> 24 + ]; + }; + LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + hi >>> 16 & 255, + hi >>> 8 & 255, + hi & 255, + lo >>> 24, + lo >>> 16 & 255, + lo >>> 8 & 255, + lo & 255 + ]; + }; + Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long( + bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, + bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, + unsigned + ); + }; + Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long( + bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], + bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], + unsigned + ); + }; + if (typeof BigInt === "function") { + Long.fromBigInt = function fromBigInt(value, unsigned) { + var lowBits = Number(BigInt.asIntN(32, value)); + var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); + return fromBits(lowBits, highBits, unsigned); + }; + Long.fromValue = function fromValueWithBigInt(value, unsigned) { + if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); + return fromValue(value, unsigned); + }; + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); + return highBigInt << BigInt(32) | lowBigInt; + }; + } + var _default = _exports.default = Long; + } + ); + } +}); + +// node_modules/protobufjs/src/util/minimal.js +var require_minimal = __commonJS({ + "node_modules/protobufjs/src/util/minimal.js"(exports) { + "use strict"; + init_inject_buffer(); + var util = exports; + util.asPromise = require_aspromise(); + util.base64 = require_base64(); + util.EventEmitter = require_eventemitter(); + util.float = require_float(); + util.utf8 = require_utf8(); + util.pool = require_pool(); + util.LongBits = require_longbits(); + function isUnsafeProperty(key) { + return key === "__proto__" || key === "prototype" || key === "constructor"; + } + util.isUnsafeProperty = isUnsafeProperty; + util.isNode = Boolean(typeof globalThis !== "undefined" && globalThis && globalThis.process && globalThis.process.versions && globalThis.process.versions.node); + util.global = util.isNode && globalThis || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; + util.emptyArray = Object.freeze ? Object.freeze([]) : ( + /* istanbul ignore next */ + [] + ); + util.emptyObject = Object.freeze ? Object.freeze({}) : ( + /* istanbul ignore next */ + {} + ); + util.isInteger = Number.isInteger || /* istanbul ignore next */ + function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; + }; + util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; + }; + util.isObject = function isObject(value) { + return value && typeof value === "object"; + }; + util.isset = /** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ + util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && Object.hasOwnProperty.call(obj, prop)) + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; + }; + util.Buffer = (function() { + try { + var Buffer2 = util.global.Buffer; + return Buffer2.prototype.utf8Write ? Buffer2 : ( + /* istanbul ignore next */ + null + ); + } catch (e) { + return null; + } + })(); + util._Buffer_from = null; + util._Buffer_allocUnsafe = null; + util.newBuffer = function newBuffer(sizeOrArray) { + return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); + }; + util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + util.Long = /* istanbul ignore next */ + util.global.dcodeIO && /* istanbul ignore next */ + util.global.dcodeIO.Long || /* istanbul ignore next */ + util.global.Long || (function() { + try { + var Long = require_umd(); + return Long && Long.isLong ? Long : null; + } catch (e) { + return null; + } + })(); + util.key2Re = /^true|false|0|1$/; + util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + util.longToHash = function longToHash(value) { + return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; + }; + util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); + }; + function merge(dst) { + var ifNotSet = typeof arguments[arguments.length - 1] === "boolean", limit = ifNotSet ? arguments.length - 1 : arguments.length; + ifNotSet = ifNotSet && arguments[arguments.length - 1]; + for (var a = 1; a < limit; ++a) { + var src = arguments[a]; + if (!src) + continue; + for (var keys = Object.keys(src), i2 = 0; i2 < keys.length; ++i2) + if (!isUnsafeProperty(keys[i2]) && (dst[keys[i2]] === void 0 || !ifNotSet)) + dst[keys[i2]] = src[keys[i2]]; + } + return dst; + } + util.merge = merge; + util.nestingLimit = 32; + util.recursionLimit = 100; + util.makeProp = function makeProp(obj, key) { + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + writable: true + }); + }; + util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); + }; + function newError(name) { + function CustomError(message, properties) { + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + Object.defineProperty(this, "message", { get: function() { + return message; + } }); + if (Error.captureStackTrace) + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + if (properties) + merge(this, properties); + } + CustomError.prototype = Object.create(Error.prototype, { + constructor: { + value: CustomError, + writable: true, + enumerable: false, + configurable: true + }, + name: { + get: function get() { + return name; + }, + set: void 0, + enumerable: false, + // configurable: false would accurately preserve the behavior of + // the original, but I'm guessing that was not intentional. + // For an actual error subclass, this property would + // be configurable. + configurable: true + }, + toString: { + value: function value() { + return this.name + ": " + this.message; + }, + writable: true, + enumerable: false, + configurable: true + } + }); + return CustomError; + } + util.newError = newError; + util.ProtocolError = newError("ProtocolError"); + util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i2 = 0; i2 < fieldNames.length; ++i2) + fieldMap[fieldNames[i2]] = 1; + return function() { + for (var keys = Object.keys(this), i3 = keys.length - 1; i3 > -1; --i3) + if (fieldMap[keys[i3]] === 1 && this[keys[i3]] !== void 0 && this[keys[i3]] !== null) + return keys[i3]; + }; + }; + util.oneOfSetter = function setOneOf(fieldNames) { + return function(name) { + for (var i2 = 0; i2 < fieldNames.length; ++i2) + if (fieldNames[i2] !== name) + delete this[fieldNames[i2]]; + }; + }; + util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true + }; + util._configure = function() { + var Buffer2 = util.Buffer; + if (!Buffer2) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + util._Buffer_from = Buffer2.from !== Uint8Array.from && Buffer2.from || /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer2(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer2.allocUnsafe || /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer2(size); + }; + }; + } +}); + +// node_modules/protobufjs/src/writer.js +var require_writer = __commonJS({ + "node_modules/protobufjs/src/writer.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = Writer; + var util = require_minimal(); + var BufferWriter; + var LongBits = util.LongBits; + var base64 = util.base64; + var utf8 = util.utf8; + function Op(fn, len, val) { + this.fn = fn; + this.len = len; + this.next = void 0; + this.val = val; + } + function noop() { + } + function State(writer) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } + function Writer() { + this.len = 0; + this.head = new Op(noop, 0, 0); + this.tail = this.head; + this.states = null; + } + var create = function create2() { + return util.Buffer ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } : function create_array() { + return new Writer(); + }; + }; + Writer.create = create(); + Writer.alloc = function alloc(size) { + return new util.Array(size); + }; + if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + }; + function writeByte(val, buf, pos) { + buf[pos] = val & 255; + } + function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; + } + function VarintOp(len, val) { + this.len = len; + this.next = void 0; + this.val = val; + } + VarintOp.prototype = Object.create(Op.prototype); + VarintOp.prototype.fn = writeVarint32; + Writer.prototype.uint32 = function write_uint32(value) { + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, + value + )).len; + return this; + }; + Writer.prototype.int32 = function write_int32(value) { + return (value |= 0) < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value); + }; + Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); + }; + function writeVarint64(val, buf, pos) { + var lo = val.lo, hi = val.hi; + while (hi) { + buf[pos++] = lo & 127 | 128; + lo = (lo >>> 7 | hi << 25) >>> 0; + hi >>>= 7; + } + while (lo > 127) { + buf[pos++] = lo & 127 | 128; + lo = lo >>> 7; + } + buf[pos++] = lo; + } + Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); + }; + Writer.prototype.int64 = Writer.prototype.uint64; + Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + }; + Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); + }; + function writeFixed32(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); + }; + Writer.prototype.sfixed32 = Writer.prototype.fixed32; + Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + }; + Writer.prototype.sfixed64 = Writer.prototype.fixed64; + Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); + }; + Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); + }; + var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytes_for(val, buf, pos) { + for (var i2 = 0; i2 < val.length; ++i2) + buf[pos + i2] = val[i2]; + }; + Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); + }; + Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); + }; + Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; + }; + Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; + }; + Writer.prototype.ldelim = function ldelim() { + var head = this.head, tail = this.tail, len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; + this.tail = tail; + this.len += len; + } + return this; + }; + Writer.prototype.finish = function finish() { + var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + return buf; + }; + Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); + }; + } +}); + +// node_modules/protobufjs/src/writer_buffer.js +var require_writer_buffer = __commonJS({ + "node_modules/protobufjs/src/writer_buffer.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = BufferWriter; + var Writer = require_writer(); + (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + var util = require_minimal(); + function BufferWriter() { + Writer.call(this); + } + BufferWriter._configure = function() { + BufferWriter.alloc = util._Buffer_allocUnsafe; + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) + val.copy(buf, pos, 0, val.length); + else for (var i2 = 0; i2 < val.length; ) + buf[pos++] = val[i2++]; + }; + }; + BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; + }; + function writeStringBuffer(val, buf, pos) { + if (val.length < 40) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); + } + BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; + }; + BufferWriter._configure(); + } +}); + +// node_modules/protobufjs/src/reader.js +var require_reader = __commonJS({ + "node_modules/protobufjs/src/reader.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = Reader; + var util = require_minimal(); + var BufferReader; + var LongBits = util.LongBits; + var utf8 = util.utf8; + function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); + } + function Reader(buffer) { + this.buf = buffer; + this.pos = 0; + this.len = buffer.length; + } + var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } : function create_array2(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + var create = function create2() { + return util.Buffer ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer2) { + return util.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2); + })(buffer); + } : create_array; + }; + Reader.create = create(); + Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ + util.Array.prototype.slice; + Reader.prototype.uint32 = /* @__PURE__ */ (function read_uint32_setup() { + var value = 4294967295; + return function read_uint32() { + value = (this.buf[this.pos] & 127) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; + if (this.buf[this.pos++] < 128) return value; + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; + })(); + Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; + }; + Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; + }; + function readLongVarint() { + var bits = new LongBits(0, 0); + var i2 = 0; + if (this.len - this.pos > 4) { + for (; i2 < 4; ++i2) { + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i2 * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i2 = 0; + } else { + for (; i2 < 3; ++i2) { + if (this.pos >= this.len) + throw indexOutOfRange(this); + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i2 * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i2 * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { + for (; i2 < 5; ++i2) { + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i2 * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i2 < 5; ++i2) { + if (this.pos >= this.len) + throw indexOutOfRange(this); + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i2 * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + throw Error("invalid varint encoding"); + } + Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; + }; + function readFixed32_end(buf, end) { + return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; + } + Reader.prototype.fixed32 = function read_fixed32() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4); + }; + Reader.prototype.sfixed32 = function read_sfixed32() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4) | 0; + }; + function readFixed64() { + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); + } + Reader.prototype.float = function read_float() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; + }; + Reader.prototype.double = function read_double() { + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; + }; + Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), start = this.pos, end = this.pos + length; + if (end > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + if (Array.isArray(this.buf)) + return this.buf.slice(start, end); + if (start === end) { + var nativeBuffer = util.Buffer; + return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); + } + return this._slice.call(this.buf, start, end); + }; + Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); + }; + Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + }; + Reader.recursionLimit = util.recursionLimit; + Reader.prototype.skipType = function(wireType, depth) { + if (depth === void 0) depth = 0; + if (depth > Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType, depth + 1); + } + break; + case 5: + this.skip(4); + break; + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + }; + Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); + var fn = util.Long ? "toLong" : ( + /* istanbul ignore next */ + "toNumber" + ); + util.merge(Reader.prototype, { + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + }); + }; + } +}); + +// node_modules/protobufjs/src/reader_buffer.js +var require_reader_buffer = __commonJS({ + "node_modules/protobufjs/src/reader_buffer.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = BufferReader; + var Reader = require_reader(); + (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + var util = require_minimal(); + function BufferReader(buffer) { + Reader.call(this, buffer); + } + BufferReader._configure = function() { + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + }; + BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); + return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); + }; + BufferReader._configure(); + } +}); + +// node_modules/protobufjs/src/rpc/service.js +var require_service = __commonJS({ + "node_modules/protobufjs/src/rpc/service.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = Service; + var util = require_minimal(); + (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + function Service(rpcImpl, requestDelimited, responseDelimited) { + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + util.EventEmitter.call(this); + this.rpcImpl = rpcImpl; + this.requestDelimited = Boolean(requestDelimited); + this.responseDelimited = Boolean(responseDelimited); + } + Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + if (!request) + throw TypeError("request must be specified"); + var self2 = this; + if (!callback) + return util.asPromise(rpcCall, self2, method, requestCtor, responseCtor, request); + if (!self2.rpcImpl) { + setTimeout(function() { + callback(Error("already ended")); + }, 0); + return void 0; + } + try { + return self2.rpcImpl( + method, + requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { + if (err) { + self2.emit("error", err, method); + return callback(err); + } + if (response === null) { + self2.end( + /* endedByRPC */ + true + ); + return void 0; + } + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err2) { + self2.emit("error", err2, method); + return callback(err2); + } + } + self2.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self2.emit("error", err, method); + setTimeout(function() { + callback(err); + }, 0); + return void 0; + } + }; + Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; + }; + } +}); + +// node_modules/protobufjs/src/rpc.js +var require_rpc = __commonJS({ + "node_modules/protobufjs/src/rpc.js"(exports) { + "use strict"; + init_inject_buffer(); + var rpc = exports; + rpc.Service = require_service(); + } +}); + +// node_modules/protobufjs/src/roots.js +var require_roots = __commonJS({ + "node_modules/protobufjs/src/roots.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = /* @__PURE__ */ Object.create(null); + } +}); + +// node_modules/protobufjs/src/index-minimal.js +var require_index_minimal = __commonJS({ + "node_modules/protobufjs/src/index-minimal.js"(exports) { + "use strict"; + init_inject_buffer(); + var protobuf = exports; + protobuf.build = "minimal"; + protobuf.Writer = require_writer(); + protobuf.BufferWriter = require_writer_buffer(); + protobuf.Reader = require_reader(); + protobuf.BufferReader = require_reader_buffer(); + protobuf.util = require_minimal(); + protobuf.rpc = require_rpc(); + protobuf.roots = require_roots(); + protobuf.configure = configure; + function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); + } + configure(); + } +}); + +// node_modules/protobufjs/minimal.js +var require_minimal2 = __commonJS({ + "node_modules/protobufjs/minimal.js"(exports, module) { + "use strict"; + init_inject_buffer(); + module.exports = require_index_minimal(); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/generated/protos/PushMessages.js +var require_PushMessages = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/generated/protos/PushMessages.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PushMessageContent_GroupContext = exports.PushMessageContent_AttachmentPointer = exports.PushMessageContent = exports.IncomingPushMessageSignal = exports.PushMessageContent_GroupContext_Type = exports.PushMessageContent_Flags = exports.IncomingPushMessageSignal_Type = void 0; + var minimal_1 = require_minimal2(); + var baseIncomingPushMessageSignal = { + type: 0, + source: "", + sourceDevice: 0, + relay: "", + timestamp: 0 + }; + var basePushMessageContent = { + body: "", + flags: 0 + }; + var basePushMessageContent_AttachmentPointer = { + id: 0, + contentType: "" + }; + var basePushMessageContent_GroupContext = { + type: 0, + name: "", + members: "" + }; + function longToNumber(long) { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); + } + exports.IncomingPushMessageSignal_Type = { + UNKNOWN: 0, + CIPHERTEXT: 1, + KEY_EXCHANGE: 2, + PREKEY_BUNDLE: 3, + PLAINTEXT: 4, + RECEIPT: 5, + PREKEY_BUNDLE_DEVICE_CONTROL: 6, + DEVICE_CONTROL: 7, + UNRECOGNIZED: -1, + fromJSON(object) { + switch (object) { + case 0: + case "UNKNOWN": + return exports.IncomingPushMessageSignal_Type.UNKNOWN; + case 1: + case "CIPHERTEXT": + return exports.IncomingPushMessageSignal_Type.CIPHERTEXT; + case 2: + case "KEY_EXCHANGE": + return exports.IncomingPushMessageSignal_Type.KEY_EXCHANGE; + case 3: + case "PREKEY_BUNDLE": + return exports.IncomingPushMessageSignal_Type.PREKEY_BUNDLE; + case 4: + case "PLAINTEXT": + return exports.IncomingPushMessageSignal_Type.PLAINTEXT; + case 5: + case "RECEIPT": + return exports.IncomingPushMessageSignal_Type.RECEIPT; + case 6: + case "PREKEY_BUNDLE_DEVICE_CONTROL": + return exports.IncomingPushMessageSignal_Type.PREKEY_BUNDLE_DEVICE_CONTROL; + case 7: + case "DEVICE_CONTROL": + return exports.IncomingPushMessageSignal_Type.DEVICE_CONTROL; + case -1: + case "UNRECOGNIZED": + default: + return exports.IncomingPushMessageSignal_Type.UNRECOGNIZED; + } + }, + toJSON(object) { + switch (object) { + case exports.IncomingPushMessageSignal_Type.UNKNOWN: + return "UNKNOWN"; + case exports.IncomingPushMessageSignal_Type.CIPHERTEXT: + return "CIPHERTEXT"; + case exports.IncomingPushMessageSignal_Type.KEY_EXCHANGE: + return "KEY_EXCHANGE"; + case exports.IncomingPushMessageSignal_Type.PREKEY_BUNDLE: + return "PREKEY_BUNDLE"; + case exports.IncomingPushMessageSignal_Type.PLAINTEXT: + return "PLAINTEXT"; + case exports.IncomingPushMessageSignal_Type.RECEIPT: + return "RECEIPT"; + case exports.IncomingPushMessageSignal_Type.PREKEY_BUNDLE_DEVICE_CONTROL: + return "PREKEY_BUNDLE_DEVICE_CONTROL"; + case exports.IncomingPushMessageSignal_Type.DEVICE_CONTROL: + return "DEVICE_CONTROL"; + default: + return "UNKNOWN"; + } + } + }; + exports.PushMessageContent_Flags = { + END_SESSION: 1, + UNRECOGNIZED: -1, + fromJSON(object) { + switch (object) { + case 1: + case "END_SESSION": + return exports.PushMessageContent_Flags.END_SESSION; + case -1: + case "UNRECOGNIZED": + default: + return exports.PushMessageContent_Flags.UNRECOGNIZED; + } + }, + toJSON(object) { + switch (object) { + case exports.PushMessageContent_Flags.END_SESSION: + return "END_SESSION"; + default: + return "UNKNOWN"; + } + } + }; + exports.PushMessageContent_GroupContext_Type = { + UNKNOWN: 0, + UPDATE: 1, + DELIVER: 2, + QUIT: 3, + UNRECOGNIZED: -1, + fromJSON(object) { + switch (object) { + case 0: + case "UNKNOWN": + return exports.PushMessageContent_GroupContext_Type.UNKNOWN; + case 1: + case "UPDATE": + return exports.PushMessageContent_GroupContext_Type.UPDATE; + case 2: + case "DELIVER": + return exports.PushMessageContent_GroupContext_Type.DELIVER; + case 3: + case "QUIT": + return exports.PushMessageContent_GroupContext_Type.QUIT; + case -1: + case "UNRECOGNIZED": + default: + return exports.PushMessageContent_GroupContext_Type.UNRECOGNIZED; + } + }, + toJSON(object) { + switch (object) { + case exports.PushMessageContent_GroupContext_Type.UNKNOWN: + return "UNKNOWN"; + case exports.PushMessageContent_GroupContext_Type.UPDATE: + return "UPDATE"; + case exports.PushMessageContent_GroupContext_Type.DELIVER: + return "DELIVER"; + case exports.PushMessageContent_GroupContext_Type.QUIT: + return "QUIT"; + default: + return "UNKNOWN"; + } + } + }; + exports.IncomingPushMessageSignal = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(8).int32(message.type); + writer.uint32(18).string(message.source); + writer.uint32(56).uint32(message.sourceDevice); + writer.uint32(26).string(message.relay); + writer.uint32(40).uint64(message.timestamp); + writer.uint32(50).bytes(message.message); + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, baseIncomingPushMessageSignal); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.source = reader.string(); + break; + case 7: + message.sourceDevice = reader.uint32(); + break; + case 3: + message.relay = reader.string(); + break; + case 5: + message.timestamp = longToNumber(reader.uint64()); + break; + case 6: + message.message = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, baseIncomingPushMessageSignal); + if (object.type !== void 0 && object.type !== null) { + message.type = exports.IncomingPushMessageSignal_Type.fromJSON(object.type); + } else { + message.type = 0; + } + if (object.source !== void 0 && object.source !== null) { + message.source = String(object.source); + } else { + message.source = ""; + } + if (object.sourceDevice !== void 0 && object.sourceDevice !== null) { + message.sourceDevice = Number(object.sourceDevice); + } else { + message.sourceDevice = 0; + } + if (object.relay !== void 0 && object.relay !== null) { + message.relay = String(object.relay); + } else { + message.relay = ""; + } + if (object.timestamp !== void 0 && object.timestamp !== null) { + message.timestamp = Number(object.timestamp); + } else { + message.timestamp = 0; + } + if (object.message !== void 0 && object.message !== null) { + message.message = bytesFromBase64(object.message); + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, baseIncomingPushMessageSignal); + if (object.type !== void 0 && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.source !== void 0 && object.source !== null) { + message.source = object.source; + } else { + message.source = ""; + } + if (object.sourceDevice !== void 0 && object.sourceDevice !== null) { + message.sourceDevice = object.sourceDevice; + } else { + message.sourceDevice = 0; + } + if (object.relay !== void 0 && object.relay !== null) { + message.relay = object.relay; + } else { + message.relay = ""; + } + if (object.timestamp !== void 0 && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = 0; + } + if (object.message !== void 0 && object.message !== null) { + message.message = object.message; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.type = exports.IncomingPushMessageSignal_Type.toJSON(message.type); + obj.source = message.source || ""; + obj.sourceDevice = message.sourceDevice || 0; + obj.relay = message.relay || ""; + obj.timestamp = message.timestamp || 0; + obj.message = message.message !== void 0 ? base64FromBytes(message.message) : void 0; + return obj; + } + }; + exports.PushMessageContent = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(10).string(message.body); + for (const v of message.attachments) { + exports.PushMessageContent_AttachmentPointer.encode(v, writer.uint32(18).fork()).ldelim(); + } + if (message.group !== void 0 && message.group !== void 0) { + exports.PushMessageContent_GroupContext.encode(message.group, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(32).uint32(message.flags); + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, basePushMessageContent); + message.attachments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = reader.string(); + break; + case 2: + message.attachments.push(exports.PushMessageContent_AttachmentPointer.decode(reader, reader.uint32())); + break; + case 3: + message.group = exports.PushMessageContent_GroupContext.decode(reader, reader.uint32()); + break; + case 4: + message.flags = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, basePushMessageContent); + message.attachments = []; + if (object.body !== void 0 && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.attachments !== void 0 && object.attachments !== null) { + for (const e of object.attachments) { + message.attachments.push(exports.PushMessageContent_AttachmentPointer.fromJSON(e)); + } + } + if (object.group !== void 0 && object.group !== null) { + message.group = exports.PushMessageContent_GroupContext.fromJSON(object.group); + } else { + message.group = void 0; + } + if (object.flags !== void 0 && object.flags !== null) { + message.flags = Number(object.flags); + } else { + message.flags = 0; + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, basePushMessageContent); + message.attachments = []; + if (object.body !== void 0 && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.attachments !== void 0 && object.attachments !== null) { + for (const e of object.attachments) { + message.attachments.push(exports.PushMessageContent_AttachmentPointer.fromPartial(e)); + } + } + if (object.group !== void 0 && object.group !== null) { + message.group = exports.PushMessageContent_GroupContext.fromPartial(object.group); + } else { + message.group = void 0; + } + if (object.flags !== void 0 && object.flags !== null) { + message.flags = object.flags; + } else { + message.flags = 0; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.body = message.body || ""; + if (message.attachments) { + obj.attachments = message.attachments.map((e) => e ? exports.PushMessageContent_AttachmentPointer.toJSON(e) : void 0); + } else { + obj.attachments = []; + } + obj.group = message.group ? exports.PushMessageContent_GroupContext.toJSON(message.group) : void 0; + obj.flags = message.flags || 0; + return obj; + } + }; + exports.PushMessageContent_AttachmentPointer = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(9).fixed64(message.id); + writer.uint32(18).string(message.contentType); + writer.uint32(26).bytes(message.key); + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, basePushMessageContent_AttachmentPointer); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = longToNumber(reader.fixed64()); + break; + case 2: + message.contentType = reader.string(); + break; + case 3: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, basePushMessageContent_AttachmentPointer); + if (object.id !== void 0 && object.id !== null) { + message.id = Number(object.id); + } else { + message.id = 0; + } + if (object.contentType !== void 0 && object.contentType !== null) { + message.contentType = String(object.contentType); + } else { + message.contentType = ""; + } + if (object.key !== void 0 && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, basePushMessageContent_AttachmentPointer); + if (object.id !== void 0 && object.id !== null) { + message.id = object.id; + } else { + message.id = 0; + } + if (object.contentType !== void 0 && object.contentType !== null) { + message.contentType = object.contentType; + } else { + message.contentType = ""; + } + if (object.key !== void 0 && object.key !== null) { + message.key = object.key; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.id = message.id || 0; + obj.contentType = message.contentType || ""; + obj.key = message.key !== void 0 ? base64FromBytes(message.key) : void 0; + return obj; + } + }; + exports.PushMessageContent_GroupContext = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(10).bytes(message.id); + writer.uint32(16).int32(message.type); + writer.uint32(26).string(message.name); + for (const v of message.members) { + writer.uint32(34).string(v); + } + if (message.avatar !== void 0 && message.avatar !== void 0) { + exports.PushMessageContent_AttachmentPointer.encode(message.avatar, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, basePushMessageContent_GroupContext); + message.members = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.type = reader.int32(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.members.push(reader.string()); + break; + case 5: + message.avatar = exports.PushMessageContent_AttachmentPointer.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, basePushMessageContent_GroupContext); + message.members = []; + if (object.id !== void 0 && object.id !== null) { + message.id = bytesFromBase64(object.id); + } + if (object.type !== void 0 && object.type !== null) { + message.type = exports.PushMessageContent_GroupContext_Type.fromJSON(object.type); + } else { + message.type = 0; + } + if (object.name !== void 0 && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.members !== void 0 && object.members !== null) { + for (const e of object.members) { + message.members.push(String(e)); + } + } + if (object.avatar !== void 0 && object.avatar !== null) { + message.avatar = exports.PushMessageContent_AttachmentPointer.fromJSON(object.avatar); + } else { + message.avatar = void 0; + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, basePushMessageContent_GroupContext); + message.members = []; + if (object.id !== void 0 && object.id !== null) { + message.id = object.id; + } + if (object.type !== void 0 && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.name !== void 0 && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.members !== void 0 && object.members !== null) { + for (const e of object.members) { + message.members.push(e); + } + } + if (object.avatar !== void 0 && object.avatar !== null) { + message.avatar = exports.PushMessageContent_AttachmentPointer.fromPartial(object.avatar); + } else { + message.avatar = void 0; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.id = message.id !== void 0 ? base64FromBytes(message.id) : void 0; + obj.type = exports.PushMessageContent_GroupContext_Type.toJSON(message.type); + obj.name = message.name || ""; + if (message.members) { + obj.members = message.members.map((e) => e || ""); + } else { + obj.members = []; + } + obj.avatar = message.avatar ? exports.PushMessageContent_AttachmentPointer.toJSON(message.avatar) : void 0; + return obj; + } + }; + var windowBase64 = globalThis; + var atob2 = windowBase64.atob || ((b64) => import_buffer.Buffer.from(b64, "base64").toString("binary")); + var btoa = windowBase64.btoa || ((bin) => import_buffer.Buffer.from(bin, "binary").toString("base64")); + function bytesFromBase64(b64) { + const bin = atob2(b64); + const arr = new Uint8Array(bin.length); + for (let i2 = 0; i2 < bin.length; ++i2) { + arr[i2] = bin.charCodeAt(i2); + } + return arr; + } + function base64FromBytes(arr) { + const bin = []; + for (let i2 = 0; i2 < arr.byteLength; ++i2) { + bin.push(String.fromCharCode(arr[i2])); + } + return btoa(bin.join("")); + } + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/generated/protos/WhisperTextProtocol.js +var require_WhisperTextProtocol = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/generated/protos/WhisperTextProtocol.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyExchangeMessage = exports.PreKeyWhisperMessage = exports.WhisperMessage = void 0; + var minimal_1 = require_minimal2(); + var baseWhisperMessage = { + counter: 0, + previousCounter: 0 + }; + var basePreKeyWhisperMessage = { + registrationId: 0, + preKeyId: 0, + signedPreKeyId: 0 + }; + var baseKeyExchangeMessage = { + id: 0 + }; + exports.WhisperMessage = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(10).bytes(message.ephemeralKey); + writer.uint32(16).uint32(message.counter); + writer.uint32(24).uint32(message.previousCounter); + writer.uint32(34).bytes(message.ciphertext); + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, baseWhisperMessage); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ephemeralKey = reader.bytes(); + break; + case 2: + message.counter = reader.uint32(); + break; + case 3: + message.previousCounter = reader.uint32(); + break; + case 4: + message.ciphertext = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, baseWhisperMessage); + if (object.ephemeralKey !== void 0 && object.ephemeralKey !== null) { + message.ephemeralKey = bytesFromBase64(object.ephemeralKey); + } + if (object.counter !== void 0 && object.counter !== null) { + message.counter = Number(object.counter); + } else { + message.counter = 0; + } + if (object.previousCounter !== void 0 && object.previousCounter !== null) { + message.previousCounter = Number(object.previousCounter); + } else { + message.previousCounter = 0; + } + if (object.ciphertext !== void 0 && object.ciphertext !== null) { + message.ciphertext = bytesFromBase64(object.ciphertext); + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, baseWhisperMessage); + if (object.ephemeralKey !== void 0 && object.ephemeralKey !== null) { + message.ephemeralKey = object.ephemeralKey; + } + if (object.counter !== void 0 && object.counter !== null) { + message.counter = object.counter; + } else { + message.counter = 0; + } + if (object.previousCounter !== void 0 && object.previousCounter !== null) { + message.previousCounter = object.previousCounter; + } else { + message.previousCounter = 0; + } + if (object.ciphertext !== void 0 && object.ciphertext !== null) { + message.ciphertext = object.ciphertext; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.ephemeralKey = message.ephemeralKey !== void 0 ? base64FromBytes(message.ephemeralKey) : void 0; + obj.counter = message.counter || 0; + obj.previousCounter = message.previousCounter || 0; + obj.ciphertext = message.ciphertext !== void 0 ? base64FromBytes(message.ciphertext) : void 0; + return obj; + } + }; + exports.PreKeyWhisperMessage = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(40).uint32(message.registrationId); + writer.uint32(8).uint32(message.preKeyId); + writer.uint32(48).uint32(message.signedPreKeyId); + writer.uint32(18).bytes(message.baseKey); + writer.uint32(26).bytes(message.identityKey); + writer.uint32(34).bytes(message.message); + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, basePreKeyWhisperMessage); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.registrationId = reader.uint32(); + break; + case 1: + message.preKeyId = reader.uint32(); + break; + case 6: + message.signedPreKeyId = reader.uint32(); + break; + case 2: + message.baseKey = reader.bytes(); + break; + case 3: + message.identityKey = reader.bytes(); + break; + case 4: + message.message = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, basePreKeyWhisperMessage); + if (object.registrationId !== void 0 && object.registrationId !== null) { + message.registrationId = Number(object.registrationId); + } else { + message.registrationId = 0; + } + if (object.preKeyId !== void 0 && object.preKeyId !== null) { + message.preKeyId = Number(object.preKeyId); + } else { + message.preKeyId = 0; + } + if (object.signedPreKeyId !== void 0 && object.signedPreKeyId !== null) { + message.signedPreKeyId = Number(object.signedPreKeyId); + } else { + message.signedPreKeyId = 0; + } + if (object.baseKey !== void 0 && object.baseKey !== null) { + message.baseKey = bytesFromBase64(object.baseKey); + } + if (object.identityKey !== void 0 && object.identityKey !== null) { + message.identityKey = bytesFromBase64(object.identityKey); + } + if (object.message !== void 0 && object.message !== null) { + message.message = bytesFromBase64(object.message); + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, basePreKeyWhisperMessage); + if (object.registrationId !== void 0 && object.registrationId !== null) { + message.registrationId = object.registrationId; + } else { + message.registrationId = 0; + } + if (object.preKeyId !== void 0 && object.preKeyId !== null) { + message.preKeyId = object.preKeyId; + } else { + message.preKeyId = 0; + } + if (object.signedPreKeyId !== void 0 && object.signedPreKeyId !== null) { + message.signedPreKeyId = object.signedPreKeyId; + } else { + message.signedPreKeyId = 0; + } + if (object.baseKey !== void 0 && object.baseKey !== null) { + message.baseKey = object.baseKey; + } + if (object.identityKey !== void 0 && object.identityKey !== null) { + message.identityKey = object.identityKey; + } + if (object.message !== void 0 && object.message !== null) { + message.message = object.message; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.registrationId = message.registrationId || 0; + obj.preKeyId = message.preKeyId || 0; + obj.signedPreKeyId = message.signedPreKeyId || 0; + obj.baseKey = message.baseKey !== void 0 ? base64FromBytes(message.baseKey) : void 0; + obj.identityKey = message.identityKey !== void 0 ? base64FromBytes(message.identityKey) : void 0; + obj.message = message.message !== void 0 ? base64FromBytes(message.message) : void 0; + return obj; + } + }; + exports.KeyExchangeMessage = { + encode(message, writer = minimal_1.Writer.create()) { + writer.uint32(8).uint32(message.id); + writer.uint32(18).bytes(message.baseKey); + writer.uint32(26).bytes(message.ephemeralKey); + writer.uint32(34).bytes(message.identityKey); + writer.uint32(42).bytes(message.baseKeySignature); + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + let end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, baseKeyExchangeMessage); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.baseKey = reader.bytes(); + break; + case 3: + message.ephemeralKey = reader.bytes(); + break; + case 4: + message.identityKey = reader.bytes(); + break; + case 5: + message.baseKeySignature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, baseKeyExchangeMessage); + if (object.id !== void 0 && object.id !== null) { + message.id = Number(object.id); + } else { + message.id = 0; + } + if (object.baseKey !== void 0 && object.baseKey !== null) { + message.baseKey = bytesFromBase64(object.baseKey); + } + if (object.ephemeralKey !== void 0 && object.ephemeralKey !== null) { + message.ephemeralKey = bytesFromBase64(object.ephemeralKey); + } + if (object.identityKey !== void 0 && object.identityKey !== null) { + message.identityKey = bytesFromBase64(object.identityKey); + } + if (object.baseKeySignature !== void 0 && object.baseKeySignature !== null) { + message.baseKeySignature = bytesFromBase64(object.baseKeySignature); + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, baseKeyExchangeMessage); + if (object.id !== void 0 && object.id !== null) { + message.id = object.id; + } else { + message.id = 0; + } + if (object.baseKey !== void 0 && object.baseKey !== null) { + message.baseKey = object.baseKey; + } + if (object.ephemeralKey !== void 0 && object.ephemeralKey !== null) { + message.ephemeralKey = object.ephemeralKey; + } + if (object.identityKey !== void 0 && object.identityKey !== null) { + message.identityKey = object.identityKey; + } + if (object.baseKeySignature !== void 0 && object.baseKeySignature !== null) { + message.baseKeySignature = object.baseKeySignature; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.id = message.id || 0; + obj.baseKey = message.baseKey !== void 0 ? base64FromBytes(message.baseKey) : void 0; + obj.ephemeralKey = message.ephemeralKey !== void 0 ? base64FromBytes(message.ephemeralKey) : void 0; + obj.identityKey = message.identityKey !== void 0 ? base64FromBytes(message.identityKey) : void 0; + obj.baseKeySignature = message.baseKeySignature !== void 0 ? base64FromBytes(message.baseKeySignature) : void 0; + return obj; + } + }; + var windowBase64 = globalThis; + var atob2 = windowBase64.atob || ((b64) => import_buffer.Buffer.from(b64, "base64").toString("binary")); + var btoa = windowBase64.btoa || ((bin) => import_buffer.Buffer.from(bin, "binary").toString("base64")); + function bytesFromBase64(b64) { + const bin = atob2(b64); + const arr = new Uint8Array(bin.length); + for (let i2 = 0; i2 < bin.length; ++i2) { + arr[i2] = bin.charCodeAt(i2); + } + return arr; + } + function base64FromBytes(arr) { + const bin = []; + for (let i2 = 0; i2 < arr.byteLength; ++i2) { + bin.push(String.fromCharCode(arr[i2])); + } + return btoa(bin.join("")); + } + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/push-message-content-compatible.js +var require_push_message_content_compatible = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/push-message-content-compatible.js"(exports) { + "use strict"; + init_inject_buffer(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PushMessageContentCompatible = void 0; + var minimal_1 = require_minimal2(); + var _1 = require_lib2(); + var basePushMessageContent = {}; + exports.PushMessageContentCompatible = { + encode(message, writer = minimal_1.Writer.create()) { + if (!("body" in message) && !("flags" in message)) { + throw new Error("Invalid protobuf"); + } + if (message.body) { + writer.uint32(10).string(message.body); + } + for (const v of message.attachments) { + _1.PushMessageContent_AttachmentPointer.encode(v, writer.uint32(18).fork()).ldelim(); + } + if (message.group !== void 0 && message.group !== void 0) { + _1.PushMessageContent_GroupContext.encode(message.group, writer.uint32(26).fork()).ldelim(); + } + if (message.flags) { + writer.uint32(32).uint32(message.flags); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input; + const end = length === void 0 ? reader.len : reader.pos + length; + const message = Object.assign({}, basePushMessageContent); + message.attachments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = reader.string(); + break; + case 2: + message.attachments.push(_1.PushMessageContent_AttachmentPointer.decode(reader, reader.uint32())); + break; + case 3: + message.group = _1.PushMessageContent_GroupContext.decode(reader, reader.uint32()); + break; + case 4: + message.flags = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object) { + const message = Object.assign({}, basePushMessageContent); + message.attachments = []; + if (object.body !== void 0 && object.body !== null) { + message.body = String(object.body); + } else { + message.body = object.flags ? void 0 : ""; + } + if (object.attachments !== void 0 && object.attachments !== null) { + for (const e of object.attachments) { + message.attachments.push(_1.PushMessageContent_AttachmentPointer.fromJSON(e)); + } + } + if (object.group !== void 0 && object.group !== null) { + message.group = _1.PushMessageContent_GroupContext.fromJSON(object.group); + } else { + message.group = void 0; + } + if (object.flags !== void 0 && object.flags !== null) { + message.flags = Number(object.flags); + } else { + message.flags = 0; + } + return message; + }, + fromPartial(object) { + const message = Object.assign({}, basePushMessageContent); + message.attachments = []; + if (object.body !== void 0 && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.attachments !== void 0 && object.attachments !== null) { + for (const e of object.attachments) { + message.attachments.push(_1.PushMessageContent_AttachmentPointer.fromPartial(e)); + } + } + if (object.group !== void 0 && object.group !== null) { + message.group = _1.PushMessageContent_GroupContext.fromPartial(object.group); + } else { + message.group = void 0; + } + if (object.flags !== void 0 && object.flags !== null) { + message.flags = object.flags; + } else { + message.flags = 0; + } + return message; + }, + toJSON(message) { + const obj = {}; + obj.body = message.body || ""; + if (message.attachments) { + obj.attachments = message.attachments.map((e) => e ? _1.PushMessageContent_AttachmentPointer.toJSON(e) : void 0); + } else { + obj.attachments = []; + } + obj.group = message.group ? _1.PushMessageContent_GroupContext.toJSON(message.group) : void 0; + obj.flags = message.flags || 0; + return obj; + } + }; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-protobuf-ts/lib/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_PushMessages(), exports); + __exportStar(require_WhisperTextProtocol(), exports); + __exportStar(require_push_message_content_compatible(), exports); + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-cipher.js +var require_session_cipher = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/session-cipher.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SessionCipher = void 0; + var types_1 = require_types2(); + var session_types_1 = require_session_types(); + var signal_protocol_address_1 = require_signal_protocol_address(); + var libsignal_protocol_protobuf_ts_1 = require_lib2(); + var base64 = __importStar(require_base64_js()); + var util = __importStar(require_helpers()); + var Internal = __importStar(require_internal()); + var session_record_1 = require_session_record(); + var session_lock_1 = require_session_lock(); + var session_builder_1 = require_session_builder(); + var helpers_1 = require_helpers(); + var SessionCipher3 = class { + constructor(storage, remoteAddress) { + this.encryptJob = (buffer) => __awaiter(this, void 0, void 0, function* () { + if (!(buffer instanceof ArrayBuffer)) { + throw new Error("Expected buffer to be an ArrayBuffer"); + } + const address = this.remoteAddress.toString(); + const msg = libsignal_protocol_protobuf_ts_1.WhisperMessage.fromJSON({}); + const [ourIdentityKey, myRegistrationId, record] = yield this.loadKeysAndRecord(address); + if (!record) { + throw new Error("No record for " + address); + } + if (!ourIdentityKey) { + throw new Error(`cannot encrypt without identity key`); + } + const { session, chain } = yield this.prepareChain(address, record, msg); + const keys = yield Internal.HKDF(chain.messageKeys[chain.chainKey.counter], new ArrayBuffer(32), "WhisperMessageKeys"); + delete chain.messageKeys[chain.chainKey.counter]; + msg.counter = chain.chainKey.counter; + msg.previousCounter = session.currentRatchet.previousCounter; + const ciphertext = yield Internal.crypto.encrypt(keys[0], buffer, keys[2].slice(0, 16)); + msg.ciphertext = new Uint8Array(ciphertext); + const encodedMsg = libsignal_protocol_protobuf_ts_1.WhisperMessage.encode(msg).finish(); + const macInput = new Uint8Array(encodedMsg.byteLength + 33 * 2 + 1); + macInput.set(new Uint8Array(ourIdentityKey.pubKey)); + macInput.set(new Uint8Array(session.indexInfo.remoteIdentityKey), 33); + macInput[33 * 2] = 3 << 4 | 3; + macInput.set(new Uint8Array(encodedMsg), 33 * 2 + 1); + const mac = yield Internal.crypto.sign(keys[1], macInput.buffer); + const encodedMsgWithMAC = new Uint8Array(encodedMsg.byteLength + 9); + encodedMsgWithMAC[0] = 3 << 4 | 3; + encodedMsgWithMAC.set(new Uint8Array(encodedMsg), 1); + encodedMsgWithMAC.set(new Uint8Array(mac, 0, 8), encodedMsg.byteLength + 1); + const trusted = yield this.storage.isTrustedIdentity(this.remoteAddress.getName(), session.indexInfo.remoteIdentityKey, types_1.Direction.SENDING); + if (!trusted) { + throw new Error("Identity key changed"); + } + this.storage.saveIdentity(this.remoteAddress.toString(), session.indexInfo.remoteIdentityKey); + record.updateSessionState(session); + yield this.storage.storeSession(address, record.serialize()); + if (session.pendingPreKey !== void 0) { + const preKeyMsg = libsignal_protocol_protobuf_ts_1.PreKeyWhisperMessage.fromJSON({}); + preKeyMsg.identityKey = new Uint8Array(ourIdentityKey.pubKey); + preKeyMsg.registrationId = myRegistrationId; + preKeyMsg.baseKey = new Uint8Array(session.pendingPreKey.baseKey); + if (session.pendingPreKey.preKeyId) { + preKeyMsg.preKeyId = session.pendingPreKey.preKeyId; + } + preKeyMsg.signedPreKeyId = session.pendingPreKey.signedKeyId; + preKeyMsg.message = encodedMsgWithMAC; + const encodedPreKeyMsg = libsignal_protocol_protobuf_ts_1.PreKeyWhisperMessage.encode(preKeyMsg).finish(); + const result = String.fromCharCode(3 << 4 | 3) + util.uint8ArrayToString(encodedPreKeyMsg); + return { + type: 3, + body: result, + registrationId: session.registrationId + }; + } else { + return { + type: 1, + body: util.uint8ArrayToString(encodedMsgWithMAC), + registrationId: session.registrationId + }; + } + }); + this.loadKeysAndRecord = (address) => { + return Promise.all([ + this.storage.getIdentityKeyPair(), + this.storage.getLocalRegistrationId(), + this.getRecord(address) + ]); + }; + this.prepareChain = (address, record, msg) => __awaiter(this, void 0, void 0, function* () { + const session = record.getOpenSession(); + if (!session) { + throw new Error("No session to encrypt message for " + address); + } + if (!session.currentRatchet.ephemeralKeyPair) { + throw new Error(`ratchet missing ephemeralKeyPair`); + } + msg.ephemeralKey = new Uint8Array(session.currentRatchet.ephemeralKeyPair.pubKey); + const searchKey = base64.fromByteArray(msg.ephemeralKey); + const chain = session.chains[searchKey]; + if ((chain === null || chain === void 0 ? void 0 : chain.chainType) === session_types_1.ChainType.RECEIVING) { + throw new Error("Tried to encrypt on a receiving chain"); + } + yield this.fillMessageKeys(chain, chain.chainKey.counter + 1); + return { session, chain }; + }); + this.fillMessageKeys = (chain, counter) => __awaiter(this, void 0, void 0, function* () { + if (chain.chainKey.counter >= counter) { + return Promise.resolve(); + } + if (counter - chain.chainKey.counter > 2e3) { + throw new Error("Over 2000 messages into the future!"); + } + if (chain.chainKey.key === void 0) { + throw new Error("Got invalid request to extend chain after it was already closed"); + } + const ckey = chain.chainKey.key; + if (!ckey) { + throw new Error(`chain key is missing`); + } + const byteArray = new Uint8Array(1); + byteArray[0] = 1; + const mac = yield Internal.crypto.sign(ckey, byteArray.buffer); + byteArray[0] = 2; + const key = yield Internal.crypto.sign(ckey, byteArray.buffer); + chain.messageKeys[chain.chainKey.counter + 1] = mac; + chain.chainKey.key = key; + chain.chainKey.counter += 1; + yield this.fillMessageKeys(chain, counter); + }); + this.storage = storage; + this.remoteAddress = typeof remoteAddress === "string" ? signal_protocol_address_1.SignalProtocolAddress.fromString(remoteAddress) : remoteAddress; + } + getRecord(encodedNumber) { + return __awaiter(this, void 0, void 0, function* () { + const serialized = yield this.storage.loadSession(encodedNumber); + if (serialized === void 0) { + return void 0; + } + return session_record_1.SessionRecord.deserialize(serialized); + }); + } + encrypt(buffer) { + return session_lock_1.SessionLock.queueJobForNumber(this.remoteAddress.toString(), () => this.encryptJob(buffer)); + } + calculateRatchet(session, remoteKey, sending) { + return __awaiter(this, void 0, void 0, function* () { + const ratchet = session.currentRatchet; + if (!ratchet.ephemeralKeyPair) { + throw new Error(`currentRatchet has no ephemeral key. Cannot calculateRatchet.`); + } + const sharedSecret = yield Internal.crypto.ECDHE(remoteKey, ratchet.ephemeralKeyPair.privKey); + const masterKey = yield Internal.HKDF(sharedSecret, ratchet.rootKey, "WhisperRatchet"); + let ephemeralPublicKey; + if (sending) { + ephemeralPublicKey = ratchet.ephemeralKeyPair.pubKey; + } else { + ephemeralPublicKey = remoteKey; + } + session.chains[base64.fromByteArray(new Uint8Array(ephemeralPublicKey))] = { + messageKeys: {}, + chainKey: { counter: -1, key: masterKey[1] }, + chainType: sending ? session_types_1.ChainType.SENDING : session_types_1.ChainType.RECEIVING + }; + ratchet.rootKey = masterKey[0]; + }); + } + decryptPreKeyWhisperMessage(buff, encoding) { + return __awaiter(this, void 0, void 0, function* () { + encoding = encoding || "binary"; + if (encoding !== "binary") { + throw new Error(`unsupported encoding: ${encoding}`); + } + const buffer = typeof buff === "string" ? util.binaryStringToArrayBuffer(buff) : buff; + const view = new Uint8Array(buffer); + const version = view[0]; + const messageData = view.slice(1); + if ((version & 15) > 3 || version >> 4 < 3) { + throw new Error("Incompatible version number on PreKeyWhisperMessage"); + } + const address = this.remoteAddress.toString(); + const job = () => __awaiter(this, void 0, void 0, function* () { + let record = yield this.getRecord(address); + const preKeyProto = libsignal_protocol_protobuf_ts_1.PreKeyWhisperMessage.decode(messageData); + if (!record) { + if (preKeyProto.registrationId === void 0) { + throw new Error("No registrationId"); + } + record = new session_record_1.SessionRecord(); + } + const builder = new session_builder_1.SessionBuilder(this.storage, this.remoteAddress); + const preKeyId = yield builder.processV3(record, preKeyProto); + const session = record.getSessionByBaseKey((0, helpers_1.uint8ArrayToArrayBuffer)(preKeyProto.baseKey)); + if (!session) { + throw new Error(`unable to find session for base key ${base64.fromByteArray(preKeyProto.baseKey)}, ${preKeyProto.baseKey.byteLength}`); + } + const plaintext = yield this.doDecryptWhisperMessage(preKeyProto.message, session); + record.updateSessionState(session); + yield this.storage.storeSession(address, record.serialize()); + if (preKeyId !== void 0 && preKeyId !== null) { + yield this.storage.removePreKey(preKeyId); + } + return plaintext; + }); + return session_lock_1.SessionLock.queueJobForNumber(address, job); + }); + } + decryptWithSessionList(buffer, sessionList, errors) { + return __awaiter(this, void 0, void 0, function* () { + if (sessionList.length === 0) { + return Promise.reject(errors[0]); + } + const session = sessionList.pop(); + if (!session) { + return Promise.reject(errors[0]); + } + try { + const plaintext = yield this.doDecryptWhisperMessage(buffer, session); + return { plaintext, session }; + } catch (e) { + if (e.name === "MessageCounterError") { + return Promise.reject(e); + } + errors.push(e); + return this.decryptWithSessionList(buffer, sessionList, errors); + } + }); + } + decryptWhisperMessage(buff, encoding) { + encoding = encoding || "binary"; + if (encoding !== "binary") { + throw new Error(`unsupported encoding: ${encoding}`); + } + const buffer = typeof buff === "string" ? util.binaryStringToArrayBuffer(buff) : buff; + const address = this.remoteAddress.toString(); + const job = () => __awaiter(this, void 0, void 0, function* () { + var _a; + const record = yield this.getRecord(address); + if (!record) { + throw new Error("No record for device " + address); + } + const errors = []; + const result = yield this.decryptWithSessionList(buffer, record.getSessions(), errors); + if (result.session.indexInfo.baseKey !== ((_a = record.getOpenSession()) === null || _a === void 0 ? void 0 : _a.indexInfo.baseKey)) { + record.archiveCurrentState(); + record.promoteState(result.session); + } + const trusted = yield this.storage.isTrustedIdentity(this.remoteAddress.getName(), result.session.indexInfo.remoteIdentityKey, types_1.Direction.RECEIVING); + if (!trusted) { + throw new Error("Identity key changed"); + } + yield this.storage.saveIdentity(address, result.session.indexInfo.remoteIdentityKey); + record.updateSessionState(result.session); + yield this.storage.storeSession(address, record.serialize()); + return result.plaintext; + }); + return session_lock_1.SessionLock.queueJobForNumber(address, job); + } + doDecryptWhisperMessage(messageBytes, session) { + return __awaiter(this, void 0, void 0, function* () { + const version = new Uint8Array(messageBytes)[0]; + if ((version & 15) > 3 || version >> 4 < 3) { + throw new Error("Incompatible version number on WhisperMessage " + version); + } + const messageProto = messageBytes.slice(1, messageBytes.byteLength - 8); + const mac = messageBytes.slice(messageBytes.byteLength - 8, messageBytes.byteLength); + const message = libsignal_protocol_protobuf_ts_1.WhisperMessage.decode(new Uint8Array(messageProto)); + const remoteEphemeralKey = (0, helpers_1.uint8ArrayToArrayBuffer)(message.ephemeralKey); + if (session === void 0) { + return Promise.reject(new Error("No session found to decrypt message from " + this.remoteAddress.toString())); + } + if (session.indexInfo.closed != -1) { + } + yield this.maybeStepRatchet(session, remoteEphemeralKey, message.previousCounter); + const chain = session.chains[base64.fromByteArray(message.ephemeralKey)]; + if (!chain) { + console.warn(`no chain found for key`, { key: base64.fromByteArray(message.ephemeralKey), session }); + } + if ((chain === null || chain === void 0 ? void 0 : chain.chainType) === session_types_1.ChainType.SENDING) { + throw new Error("Tried to decrypt on a sending chain"); + } + yield this.fillMessageKeys(chain, message.counter); + const messageKey = chain.messageKeys[message.counter]; + if (messageKey === void 0) { + const e = new Error("Message key not found. The counter was repeated or the key was not filled."); + e.name = "MessageCounterError"; + throw e; + } + delete chain.messageKeys[message.counter]; + const keys = yield Internal.HKDF(messageKey, new ArrayBuffer(32), "WhisperMessageKeys"); + const ourIdentityKey = yield this.storage.getIdentityKeyPair(); + if (!ourIdentityKey) { + throw new Error(`Our identity key is missing. Cannot decrypt.`); + } + const macInput = new Uint8Array(messageProto.byteLength + 33 * 2 + 1); + macInput.set(new Uint8Array(session.indexInfo.remoteIdentityKey)); + macInput.set(new Uint8Array(ourIdentityKey.pubKey), 33); + macInput[33 * 2] = 3 << 4 | 3; + macInput.set(new Uint8Array(messageProto), 33 * 2 + 1); + yield Internal.verifyMAC(macInput.buffer, keys[1], mac, 8); + const plaintext = yield Internal.crypto.decrypt(keys[0], (0, helpers_1.uint8ArrayToArrayBuffer)(message.ciphertext), keys[2].slice(0, 16)); + delete session.pendingPreKey; + return plaintext; + }); + } + maybeStepRatchet(session, remoteKey, previousCounter) { + return __awaiter(this, void 0, void 0, function* () { + const remoteKeyString = base64.fromByteArray(new Uint8Array(remoteKey)); + if (session.chains[remoteKeyString] !== void 0) { + return Promise.resolve(); + } + const ratchet = session.currentRatchet; + if (!ratchet.ephemeralKeyPair) { + throw new Error(`attempting to step reatchet without ephemeral key`); + } + const previousRatchet = session.chains[base64.fromByteArray(new Uint8Array(ratchet.lastRemoteEphemeralKey))]; + if (previousRatchet !== void 0) { + yield this.fillMessageKeys(previousRatchet, previousCounter).then(function() { + delete previousRatchet.chainKey.key; + session.oldRatchetList[session.oldRatchetList.length] = { + added: Date.now(), + ephemeralKey: ratchet.lastRemoteEphemeralKey + }; + }); + } + yield this.calculateRatchet(session, remoteKey, false); + const previousRatchetKey = base64.fromByteArray(new Uint8Array(ratchet.ephemeralKeyPair.pubKey)); + if (session.chains[previousRatchetKey] !== void 0) { + ratchet.previousCounter = session.chains[previousRatchetKey].chainKey.counter; + delete session.chains[previousRatchetKey]; + } + const keyPair = yield Internal.crypto.createKeyPair(); + ratchet.ephemeralKeyPair = keyPair; + yield this.calculateRatchet(session, remoteKey, true); + ratchet.lastRemoteEphemeralKey = remoteKey; + }); + } + ///////////////////////////////////////// + // session management and storage access + getRemoteRegistrationId() { + return session_lock_1.SessionLock.queueJobForNumber(this.remoteAddress.toString(), () => __awaiter(this, void 0, void 0, function* () { + const record = yield this.getRecord(this.remoteAddress.toString()); + if (record === void 0) { + return void 0; + } + const openSession = record.getOpenSession(); + if (openSession === void 0) { + return void 0; + } + return openSession.registrationId; + })); + } + hasOpenSession() { + const job = () => __awaiter(this, void 0, void 0, function* () { + const record = yield this.getRecord(this.remoteAddress.toString()); + if (record === void 0) { + return false; + } + return record.haveOpenSession(); + }); + return session_lock_1.SessionLock.queueJobForNumber(this.remoteAddress.toString(), job); + } + closeOpenSessionForDevice() { + const address = this.remoteAddress.toString(); + const job = () => __awaiter(this, void 0, void 0, function* () { + const record = yield this.getRecord(this.remoteAddress.toString()); + if (record === void 0 || record.getOpenSession() === void 0) { + return; + } + record.archiveCurrentState(); + return this.storage.storeSession(address, record.serialize()); + }); + return session_lock_1.SessionLock.queueJobForNumber(address, job); + } + deleteAllSessionsForDevice() { + const address = this.remoteAddress.toString(); + const job = () => __awaiter(this, void 0, void 0, function* () { + const record = yield this.getRecord(this.remoteAddress.toString()); + if (record === void 0) { + return; + } + record.deleteAllSessions(); + return this.storage.storeSession(address, record.serialize()); + }); + return session_lock_1.SessionLock.queueJobForNumber(address, job); + } + }; + exports.SessionCipher = SessionCipher3; + } +}); + +// node_modules/@privacyresearch/libsignal-protocol-typescript/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/@privacyresearch/libsignal-protocol-typescript/lib/index.js"(exports) { + "use strict"; + init_inject_buffer(); + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p); + }; + var __importStar = exports && exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.setCurve = exports.setWebCrypto = void 0; + var curve25519_typescript_1 = require_lib(); + var curve_1 = require_curve2(); + __exportStar(require_types2(), exports); + __exportStar(require_signal_protocol_address(), exports); + __exportStar(require_key_helper(), exports); + __exportStar(require_fingerprint_generator(), exports); + __exportStar(require_session_builder(), exports); + __exportStar(require_session_cipher(), exports); + __exportStar(require_session_types(), exports); + __exportStar(require_curve2(), exports); + var Internal = __importStar(require_internal()); + var internal_1 = require_internal(); + Object.defineProperty(exports, "setWebCrypto", { enumerable: true, get: function() { + return internal_1.setWebCrypto; + } }); + Object.defineProperty(exports, "setCurve", { enumerable: true, get: function() { + return internal_1.setCurve; + } }); + exports.default = () => __awaiter(void 0, void 0, void 0, function* () { + const cw = yield curve25519_typescript_1.Curve25519Wrapper.create(); + return { + Curve: new curve_1.Curve(new Internal.Curve(cw)) + }; + }); + } +}); + +// _vendor-entry.js +init_inject_buffer(); +var lib = __toESM(require_lib3(), 1); +var KeyHelper2 = lib.KeyHelper; +var SignalProtocolAddress2 = lib.SignalProtocolAddress; +var SessionBuilder2 = lib.SessionBuilder; +var SessionCipher2 = lib.SessionCipher; +var FingerprintGenerator2 = lib.FingerprintGenerator; +export { + FingerprintGenerator2 as FingerprintGenerator, + KeyHelper2 as KeyHelper, + SessionBuilder2 as SessionBuilder, + SessionCipher2 as SessionCipher, + SignalProtocolAddress2 as SignalProtocolAddress +}; +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +@privacyresearch/curve25519-typescript/lib/built/curveasm.js: + (** + * @license + * Copyright 2010 The Emscripten Authors + * SPDX-License-Identifier: MIT + *) + (** + * @license + * Copyright 2019 The Emscripten Authors + * SPDX-License-Identifier: MIT + *) + (** + * @license + * Copyright 2017 The Emscripten Authors + * SPDX-License-Identifier: MIT + *) + (** + * @license + * Copyright 2020 The Emscripten Authors + * SPDX-License-Identifier: MIT + *) + (** + * @license + * Copyright 2015 The Emscripten Authors + * SPDX-License-Identifier: MIT + *) + +long/umd/index.js: + (** + * @license + * Copyright 2009 The Closure Library Authors + * Copyright 2020 Daniel Wirtz / The long.js Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + *) +*/ diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 0000000..d6a876d --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1,12 @@ +{ + "name": "Cipher", + "short_name": "Cipher", + "description": "End-to-end encrypted messaging", + "start_url": "/", + "display": "standalone", + "background_color": "#0b141a", + "theme_color": "#0b141a", + "icons": [ + { "src": "/icons/icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any maskable" } + ] +} diff --git a/public/sw.js b/public/sw.js new file mode 100644 index 0000000..99c7109 --- /dev/null +++ b/public/sw.js @@ -0,0 +1,59 @@ +// Service worker: offline app shell + Web Push wake-up. +// It never touches message plaintext — decryption happens only in the page. + +const CACHE = "cipher-v1"; +const SHELL = [ + "/", + "/index.html", + "/manifest.webmanifest", + "/js/app.js", + "/js/api.js", + "/js/crypto.js", + "/js/store.js", + "/js/vendor/libsignal.js", + "/icons/icon.svg", +]; + +self.addEventListener("install", (e) => { + e.waitUntil(caches.open(CACHE).then((c) => c.addAll(SHELL)).then(() => self.skipWaiting())); +}); + +self.addEventListener("activate", (e) => { + e.waitUntil( + caches.keys().then((keys) => + Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k))) + ).then(() => self.clients.claim()) + ); +}); + +self.addEventListener("fetch", (e) => { + const url = new URL(e.request.url); + // Never cache API or WebSocket traffic. + if (url.pathname.startsWith("/api/")) return; + // Cache-first for the shell, network fallback. + e.respondWith( + caches.match(e.request).then((hit) => hit || fetch(e.request)) + ); +}); + +// Payloadless push: just wake the client, which pulls ciphertext over the socket. +self.addEventListener("push", (e) => { + e.waitUntil( + self.registration.showNotification("Cipher", { + body: "New encrypted message", + icon: "/icons/icon.svg", + badge: "/icons/icon.svg", + tag: "cipher-msg", + }) + ); +}); + +self.addEventListener("notificationclick", (e) => { + e.notification.close(); + e.waitUntil( + self.clients.matchAll({ type: "window" }).then((cl) => { + for (const c of cl) if ("focus" in c) return c.focus(); + return self.clients.openWindow("/"); + }) + ); +}); diff --git a/src/do/mailbox.js b/src/do/mailbox.js new file mode 100644 index 0000000..ab592bc --- /dev/null +++ b/src/do/mailbox.js @@ -0,0 +1,152 @@ +// Mailbox: one Durable Object per USER. It is the store-and-forward relay. +// +// - Holds the user's live WebSocket connection(s) (one per device). +// - When an envelope arrives it delivers immediately if a matching device is +// online, otherwise persists it in DO SQLite storage. +// - On (re)connect it flushes everything queued for that device. +// - The client ACKs delivered envelopes by id; only then are they deleted. +// +// Everything stored here is ciphertext. The DO cannot read message contents. + +export class Mailbox { + constructor(state, env) { + this.state = state; + this.env = env; + this.sql = state.storage.sql; + // deviceId -> WebSocket (live connections in this DO instance) + this.sockets = new Map(); + + this.state.blockConcurrencyWhile(async () => { + this.sql.exec(` + CREATE TABLE IF NOT EXISTS queue ( + id TEXT PRIMARY KEY, + to_device TEXT NOT NULL, + envelope TEXT NOT NULL, + queued_at INTEGER NOT NULL + ); + CREATE INDEX IF NOT EXISTS idx_queue_device ON queue(to_device); + `); + }); + + // Re-attach hibernated WebSockets after the DO wakes. + for (const ws of this.state.getWebSockets()) { + const meta = ws.deserializeAttachment(); + if (meta?.deviceId) this.sockets.set(meta.deviceId, ws); + } + } + + async fetch(request) { + const url = new URL(request.url); + + if (url.pathname === "/deliver") { + const envelope = await request.json(); + return this.deliver(envelope); + } + + if (url.pathname === "/connect") { + const deviceId = url.searchParams.get("deviceId"); + if (!deviceId) return new Response("missing deviceId", { status: 400 }); + return this.connect(deviceId); + } + + return new Response("not found", { status: 404 }); + } + + async deliver(envelope) { + const ws = this.sockets.get(envelope.toDeviceId); + if (ws) { + try { + ws.send(JSON.stringify({ t: "message", envelope })); + // Delivered live, but keep queued until the client ACKs (survives drops). + } catch { + // fall through to queue + } + } + this.sql.exec( + "INSERT OR REPLACE INTO queue (id, to_device, envelope, queued_at) VALUES (?,?,?,?)", + envelope.id, + envelope.toDeviceId, + JSON.stringify(envelope), + Date.now() + ); + return new Response("ok"); + } + + async connect(deviceId) { + const pair = new WebSocketPair(); + const [client, server] = [pair[0], pair[1]]; + + this.state.acceptWebSocket(server); + server.serializeAttachment({ deviceId }); + + // Replace any stale socket for this device. + const prev = this.sockets.get(deviceId); + if (prev && prev !== server) { + try { prev.close(1000, "replaced"); } catch {} + } + this.sockets.set(deviceId, server); + + // Flush queued envelopes for this device. + this.flush(deviceId, server); + + return new Response(null, { status: 101, webSocket: client }); + } + + flush(deviceId, ws) { + const rows = this.sql + .exec("SELECT envelope FROM queue WHERE to_device = ? ORDER BY queued_at ASC", deviceId) + .toArray(); + for (const row of rows) { + try { + ws.send(JSON.stringify({ t: "message", envelope: JSON.parse(row.envelope) })); + } catch { + break; + } + } + } + + // --- Hibernation WebSocket handlers --- + + async webSocketMessage(ws, raw) { + let msg; + try { + msg = JSON.parse(raw); + } catch { + return; + } + const meta = ws.deserializeAttachment() || {}; + + if (msg.t === "ack" && Array.isArray(msg.ids)) { + // Client confirmed receipt — safe to drop from the queue. + for (const id of msg.ids) { + this.sql.exec("DELETE FROM queue WHERE id = ?", id); + } + return; + } + + if (msg.t === "ping") { + ws.send(JSON.stringify({ t: "pong" })); + return; + } + + if (msg.t === "pull") { + // Client explicitly requests a re-flush (e.g. after reconnect). + if (meta.deviceId) this.flush(meta.deviceId, ws); + return; + } + } + + async webSocketClose(ws) { + const meta = ws.deserializeAttachment() || {}; + if (meta.deviceId && this.sockets.get(meta.deviceId) === ws) { + this.sockets.delete(meta.deviceId); + } + } + + async webSocketError(ws) { + const meta = ws.deserializeAttachment() || {}; + if (meta.deviceId && this.sockets.get(meta.deviceId) === ws) { + this.sockets.delete(meta.deviceId); + } + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..1e615f4 --- /dev/null +++ b/src/index.js @@ -0,0 +1,25 @@ +// Cipher — end-to-end encrypted messenger on Cloudflare Workers. +// The Worker is a key directory + encrypted relay. It never sees plaintext. + +import { Hono } from "hono"; +import auth from "./routes/auth.js"; +import keys from "./routes/keys.js"; +import messages from "./routes/messages.js"; +import media from "./routes/media.js"; + +export { Mailbox } from "./do/mailbox.js"; + +const app = new Hono(); + +app.get("/api/health", (c) => c.json({ ok: true, service: "cipher" })); + +app.route("/api/auth", auth); +app.route("/api", keys); +app.route("/api", messages); +app.route("/api", media); + +// Everything else falls through to static assets (the PWA), handled by the +// ASSETS binding via not_found_handling: single-page-application. +app.all("/api/*", (c) => c.json({ error: "not found" }, 404)); + +export default app; diff --git a/src/lib/auth.js b/src/lib/auth.js new file mode 100644 index 0000000..82b4424 --- /dev/null +++ b/src/lib/auth.js @@ -0,0 +1,73 @@ +// Account-level authentication. This is SEPARATE from the E2E encryption: +// it only proves "you control this account" so the server knows whose prekeys +// to publish and whose mailbox to read. It never touches message plaintext. + +import { b64, randomToken, now } from "./util.js"; + +const PBKDF2_ITERS = 210000; + +async function pbkdf2(password, saltBytes) { + const enc = new TextEncoder(); + const key = await crypto.subtle.importKey( + "raw", + enc.encode(password), + "PBKDF2", + false, + ["deriveBits"] + ); + const bits = await crypto.subtle.deriveBits( + { name: "PBKDF2", hash: "SHA-256", salt: saltBytes, iterations: PBKDF2_ITERS }, + key, + 256 + ); + return b64(new Uint8Array(bits)); +} + +export async function hashPassword(password) { + const salt = new Uint8Array(16); + crypto.getRandomValues(salt); + const hash = await pbkdf2(password, salt); + return { pw_hash: hash, pw_salt: b64(salt) }; +} + +export async function verifyPassword(password, pw_hash, pw_salt) { + const salt = Uint8Array.from(atob(pw_salt), (c) => c.charCodeAt(0)); + const hash = await pbkdf2(password, salt); + // constant-time-ish compare + if (hash.length !== pw_hash.length) return false; + let diff = 0; + for (let i = 0; i < hash.length; i++) diff |= hash.charCodeAt(i) ^ pw_hash.charCodeAt(i); + return diff === 0; +} + +const SESSION_TTL = 1000 * 60 * 60 * 24 * 60; // 60 days + +export async function createSession(db, userId, deviceId) { + const token = randomToken(); + const ts = now(); + await db + .prepare( + "INSERT INTO sessions (token, user_id, device_id, created_at, expires_at) VALUES (?,?,?,?,?)" + ) + .bind(token, userId, deviceId, ts, ts + SESSION_TTL) + .run(); + return token; +} + +// Hono middleware: require a valid bearer token; attach { userId, deviceId } to context. +export function requireAuth() { + return async (c, next) => { + const auth = c.req.header("Authorization") || ""; + const token = auth.startsWith("Bearer ") ? auth.slice(7) : null; + if (!token) return c.json({ error: "unauthorized" }, 401); + const row = await c.env.DB.prepare( + "SELECT user_id, device_id, expires_at FROM sessions WHERE token = ?" + ) + .bind(token) + .first(); + if (!row || row.expires_at < now()) return c.json({ error: "unauthorized" }, 401); + c.set("userId", row.user_id); + c.set("deviceId", row.device_id); + await next(); + }; +} diff --git a/src/lib/util.js b/src/lib/util.js new file mode 100644 index 0000000..6d1f2a1 --- /dev/null +++ b/src/lib/util.js @@ -0,0 +1,32 @@ +// Small shared helpers. + +export function uuid() { + return crypto.randomUUID(); +} + +// URL-safe random token. +export function randomToken(bytes = 32) { + const b = new Uint8Array(bytes); + crypto.getRandomValues(b); + return b64url(b); +} + +export function b64(bytes) { + let bin = ""; + const arr = new Uint8Array(bytes); + for (let i = 0; i < arr.length; i++) bin += String.fromCharCode(arr[i]); + return btoa(bin); +} + +export function b64url(bytes) { + return b64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); +} + +export function now() { + return Date.now(); +} + +// Deterministic conversation id for a pair of users (sorted), for grouping. +export function pairId(a, b) { + return [a, b].sort().join(":"); +} diff --git a/src/routes/auth.js b/src/routes/auth.js new file mode 100644 index 0000000..8ce8340 --- /dev/null +++ b/src/routes/auth.js @@ -0,0 +1,102 @@ +// Registration & login. On register the client has already generated its Signal +// identity + prekeys locally and sends only the PUBLIC halves here. + +import { Hono } from "hono"; +import { uuid, now } from "../lib/util.js"; +import { hashPassword, verifyPassword, createSession } from "../lib/auth.js"; + +const app = new Hono(); + +// POST /api/auth/register +// body: { username, displayName, password, device: { registrationId, identityKey, +// signedPreKey:{id,pub,sig}, oneTimePreKeys:[{id,pub}...] } } +app.post("/register", async (c) => { + const body = await c.req.json().catch(() => null); + if (!body) return c.json({ error: "bad request" }, 400); + const { username, displayName, password, device } = body; + + const uname = String(username || "").trim().toLowerCase(); + if (!/^[a-z0-9_]{3,20}$/.test(uname)) + return c.json({ error: "username must be 3-20 chars: a-z 0-9 _" }, 400); + if (!password || password.length < 8) + return c.json({ error: "password must be at least 8 chars" }, 400); + if (!device?.identityKey || !device?.signedPreKey) + return c.json({ error: "missing device keys" }, 400); + + const existing = await c.env.DB.prepare("SELECT id FROM users WHERE username = ?") + .bind(uname) + .first(); + if (existing) return c.json({ error: "username taken" }, 409); + + const userId = uuid(); + const deviceId = uuid(); + const ts = now(); + const { pw_hash, pw_salt } = await hashPassword(password); + + const stmts = [ + c.env.DB.prepare( + "INSERT INTO users (id, username, display_name, pw_hash, pw_salt, created_at) VALUES (?,?,?,?,?,?)" + ).bind(userId, uname, displayName || uname, pw_hash, pw_salt, ts), + c.env.DB.prepare( + `INSERT INTO devices (id, user_id, registration_id, identity_key, + signed_prekey_id, signed_prekey_pub, signed_prekey_sig, created_at, last_seen) + VALUES (?,?,?,?,?,?,?,?,?)` + ).bind( + deviceId, + userId, + device.registrationId, + device.identityKey, + device.signedPreKey.id, + device.signedPreKey.pub, + device.signedPreKey.sig, + ts, + ts + ), + ]; + for (const otk of device.oneTimePreKeys || []) { + stmts.push( + c.env.DB.prepare( + "INSERT INTO one_time_prekeys (device_id, prekey_id, prekey_pub) VALUES (?,?,?)" + ).bind(deviceId, otk.id, otk.pub) + ); + } + await c.env.DB.batch(stmts); + + const token = await createSession(c.env.DB, userId, deviceId); + return c.json({ token, userId, deviceId, username: uname }); +}); + +// POST /api/auth/login body: { username, password } +// Note: login proves account control; the client still holds its own private keys. +app.post("/login", async (c) => { + const body = await c.req.json().catch(() => null); + if (!body) return c.json({ error: "bad request" }, 400); + const uname = String(body.username || "").trim().toLowerCase(); + const user = await c.env.DB.prepare( + "SELECT id, pw_hash, pw_salt, display_name FROM users WHERE username = ?" + ) + .bind(uname) + .first(); + if (!user) return c.json({ error: "invalid credentials" }, 401); + const ok = await verifyPassword(body.password || "", user.pw_hash, user.pw_salt); + if (!ok) return c.json({ error: "invalid credentials" }, 401); + + // Return the device on this account (MVP: single primary device). + const device = await c.env.DB.prepare( + "SELECT id FROM devices WHERE user_id = ? ORDER BY created_at ASC LIMIT 1" + ) + .bind(user.id) + .first(); + if (!device) return c.json({ error: "no device registered" }, 409); + + const token = await createSession(c.env.DB, user.id, device.id); + return c.json({ + token, + userId: user.id, + deviceId: device.id, + username: uname, + displayName: user.display_name, + }); +}); + +export default app; diff --git a/src/routes/keys.js b/src/routes/keys.js new file mode 100644 index 0000000..e7a2b8f --- /dev/null +++ b/src/routes/keys.js @@ -0,0 +1,121 @@ +// The key directory. This is what makes X3DH work: a sender fetches the +// recipient's "prekey bundle" (public keys) to establish a session without the +// recipient being online. The server hands out one-time prekeys and deletes them. + +import { Hono } from "hono"; +import { requireAuth } from "../lib/auth.js"; +import { now } from "../lib/util.js"; + +const app = new Hono(); + +// GET /api/users/:username -> directory lookup +app.get("/users/:username", requireAuth(), async (c) => { + const uname = c.req.param("username").toLowerCase(); + const user = await c.env.DB.prepare( + "SELECT id, username, display_name FROM users WHERE username = ?" + ) + .bind(uname) + .first(); + if (!user) return c.json({ error: "not found" }, 404); + return c.json({ userId: user.id, username: user.username, displayName: user.display_name }); +}); + +// POST /api/keys/prekeys — replenish one-time prekeys (client tops up when low) +// body: { oneTimePreKeys: [{id,pub}, ...] } +app.post("/keys/prekeys", requireAuth(), async (c) => { + const deviceId = c.get("deviceId"); + const body = await c.req.json().catch(() => null); + const otks = body?.oneTimePreKeys || []; + if (!Array.isArray(otks) || otks.length === 0) + return c.json({ error: "no prekeys" }, 400); + const stmts = otks.map((o) => + c.env.DB.prepare( + "INSERT OR IGNORE INTO one_time_prekeys (device_id, prekey_id, prekey_pub) VALUES (?,?,?)" + ).bind(deviceId, o.id, o.pub) + ); + await c.env.DB.batch(stmts); + return c.json({ ok: true, added: otks.length }); +}); + +// POST /api/keys/signed — rotate the signed prekey +// body: { signedPreKey: {id,pub,sig} } +app.post("/keys/signed", requireAuth(), async (c) => { + const deviceId = c.get("deviceId"); + const body = await c.req.json().catch(() => null); + const spk = body?.signedPreKey; + if (!spk) return c.json({ error: "missing signedPreKey" }, 400); + await c.env.DB.prepare( + "UPDATE devices SET signed_prekey_id=?, signed_prekey_pub=?, signed_prekey_sig=? WHERE id=?" + ) + .bind(spk.id, spk.pub, spk.sig, deviceId) + .run(); + return c.json({ ok: true }); +}); + +// GET /api/keys/count — how many one-time prekeys remain for my device +app.get("/keys/count", requireAuth(), async (c) => { + const deviceId = c.get("deviceId"); + const row = await c.env.DB.prepare( + "SELECT COUNT(*) AS n FROM one_time_prekeys WHERE device_id = ?" + ) + .bind(deviceId) + .first(); + return c.json({ count: row?.n ?? 0 }); +}); + +// GET /api/keys/bundle/:userId — fetch prekey bundle(s) for every device of a user. +// Consumes one one-time prekey per device (atomic delete-and-return). +app.get("/keys/bundle/:userId", requireAuth(), async (c) => { + const userId = c.req.param("userId"); + const devices = await c.env.DB.prepare( + `SELECT id, registration_id, identity_key, signed_prekey_id, + signed_prekey_pub, signed_prekey_sig FROM devices WHERE user_id = ?` + ) + .bind(userId) + .all(); + + if (!devices.results?.length) return c.json({ error: "no devices" }, 404); + + const bundles = []; + for (const d of devices.results) { + // Grab and consume one one-time prekey (best-effort; bundle still valid without one). + const otk = await c.env.DB.prepare( + "SELECT prekey_id, prekey_pub FROM one_time_prekeys WHERE device_id = ? LIMIT 1" + ) + .bind(d.id) + .first(); + if (otk) { + await c.env.DB.prepare( + "DELETE FROM one_time_prekeys WHERE device_id = ? AND prekey_id = ?" + ) + .bind(d.id, otk.prekey_id) + .run(); + } + bundles.push({ + deviceId: d.id, + registrationId: d.registration_id, + identityKey: d.identity_key, + signedPreKey: { id: d.signed_prekey_id, pub: d.signed_prekey_pub, sig: d.signed_prekey_sig }, + oneTimePreKey: otk ? { id: otk.prekey_id, pub: otk.prekey_pub } : null, + }); + } + return c.json({ userId, bundles }); +}); + +// POST /api/push/subscribe — register a Web Push subscription +app.post("/push/subscribe", requireAuth(), async (c) => { + const deviceId = c.get("deviceId"); + const sub = await c.req.json().catch(() => null); + if (!sub?.endpoint || !sub?.keys) return c.json({ error: "bad subscription" }, 400); + await c.env.DB.prepare( + `INSERT INTO push_subs (device_id, endpoint, p256dh, auth, created_at) + VALUES (?,?,?,?,?) + ON CONFLICT(device_id) DO UPDATE SET endpoint=excluded.endpoint, + p256dh=excluded.p256dh, auth=excluded.auth` + ) + .bind(deviceId, sub.endpoint, sub.keys.p256dh, sub.keys.auth, now()) + .run(); + return c.json({ ok: true }); +}); + +export default app; diff --git a/src/routes/media.js b/src/routes/media.js new file mode 100644 index 0000000..0672ecc --- /dev/null +++ b/src/routes/media.js @@ -0,0 +1,45 @@ +// Encrypted media. The client encrypts the file locally with a random key +// (AES-GCM) BEFORE upload, so R2 only ever holds ciphertext. The decryption key +// travels to the recipient inside the E2E-encrypted message, never to the server. + +import { Hono } from "hono"; +import { requireAuth } from "../lib/auth.js"; +import { uuid, now } from "../lib/util.js"; + +const app = new Hono(); + +const MAX_BYTES = 100 * 1024 * 1024; // 100 MB + +// POST /api/media — raw body is the ALREADY-ENCRYPTED blob. Returns an opaque key. +app.post("/media", requireAuth(), async (c) => { + const userId = c.get("userId"); + const len = Number(c.req.header("Content-Length") || 0); + if (len > MAX_BYTES) return c.json({ error: "too large" }, 413); + + const key = `${userId}/${now()}-${uuid()}`; + const body = c.req.raw.body; + if (!body) return c.json({ error: "empty body" }, 400); + + await c.env.MEDIA.put(key, body, { + httpMetadata: { contentType: "application/octet-stream" }, + customMetadata: { uploader: userId }, + }); + return c.json({ key }); +}); + +// GET /api/media/:key — fetch the ciphertext blob (recipient decrypts locally). +// Key contains a slash, so we match the rest of the path. +app.get("/media/*", requireAuth(), async (c) => { + const key = c.req.path.replace(/^\/api\/media\//, ""); + if (!key) return c.json({ error: "bad key" }, 400); + const obj = await c.env.MEDIA.get(key); + if (!obj) return c.json({ error: "not found" }, 404); + return new Response(obj.body, { + headers: { + "Content-Type": "application/octet-stream", + "Cache-Control": "private, max-age=31536000, immutable", + }, + }); +}); + +export default app; diff --git a/src/routes/messages.js b/src/routes/messages.js new file mode 100644 index 0000000..b510ca1 --- /dev/null +++ b/src/routes/messages.js @@ -0,0 +1,78 @@ +// Message relay. The Worker never inspects ciphertext — it just routes an +// encrypted envelope to the recipient's Mailbox Durable Object, which delivers +// live over WebSocket or queues until the recipient reconnects. + +import { Hono } from "hono"; +import { requireAuth } from "../lib/auth.js"; +import { now, uuid } from "../lib/util.js"; + +const app = new Hono(); + +function mailboxStub(env, userId) { + const id = env.MAILBOX.idFromName(userId); + return env.MAILBOX.get(id); +} + +// POST /api/messages/send +// body: { toUserId, messages: [{ toDeviceId, type, body }] } // one entry per recipient device +// `body` is Signal ciphertext (base64); `type` is the Signal message type (1=whisper,3=prekey). +app.post("/messages/send", requireAuth(), async (c) => { + const fromUserId = c.get("userId"); + const fromDeviceId = c.get("deviceId"); + const payload = await c.req.json().catch(() => null); + if (!payload?.toUserId || !Array.isArray(payload.messages)) + return c.json({ error: "bad request" }, 400); + + const ts = now(); + const results = []; + for (const m of payload.messages) { + const envelope = { + id: uuid(), + fromUserId, + fromDeviceId, + toDeviceId: m.toDeviceId, + type: m.type, + body: m.body, // ciphertext — opaque to the server + sentAt: ts, + }; + const stub = mailboxStub(c.env, payload.toUserId); + const res = await stub.fetch("https://mailbox/deliver", { + method: "POST", + body: JSON.stringify(envelope), + }); + results.push({ toDeviceId: m.toDeviceId, delivered: res.ok }); + } + + // Best-effort push wake-up (payloadless — client fetches the real ciphertext over WS). + c.executionCtx.waitUntil(wakeRecipient(c.env, payload.toUserId)); + + return c.json({ ok: true, id: uuid(), sentAt: ts, results }); +}); + +async function wakeRecipient(env, toUserId) { + // Placeholder for Web Push fan-out; wired up once VAPID keys are configured. + // Left intentionally minimal so message send never blocks on push. + return; +} + +// GET /api/ws — upgrade to WebSocket, routed to the caller's own Mailbox DO. +app.get("/ws", async (c) => { + // Auth via query token (browsers can't set headers on WebSocket handshakes). + const token = c.req.query("token"); + if (!token) return c.json({ error: "unauthorized" }, 401); + const sess = await c.env.DB.prepare( + "SELECT user_id, device_id, expires_at FROM sessions WHERE token = ?" + ) + .bind(token) + .first(); + if (!sess || sess.expires_at < now()) return c.json({ error: "unauthorized" }, 401); + + const stub = mailboxStub(c.env, sess.user_id); + const url = new URL("https://mailbox/connect"); + url.searchParams.set("deviceId", sess.device_id); + return stub.fetch(url.toString(), { + headers: { Upgrade: "websocket", Connection: "Upgrade" }, + }); +}); + +export default app; diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 0000000..f672427 --- /dev/null +++ b/wrangler.jsonc @@ -0,0 +1,38 @@ +{ + "$schema": "node_modules/wrangler/config-schema.json", + "name": "cipher", + "main": "src/index.js", + "compatibility_date": "2025-07-01", + "compatibility_flags": ["nodejs_compat"], + "observability": { "enabled": true }, + "assets": { + "directory": "./public", + "binding": "ASSETS", + "not_found_handling": "single-page-application" + }, + "d1_databases": [ + { + "binding": "DB", + "database_name": "cipher", + "database_id": "REPLACE_AFTER_CREATE", + "migrations_dir": "migrations" + } + ], + "r2_buckets": [ + { + "binding": "MEDIA", + "bucket_name": "cipher-media" + } + ], + "durable_objects": { + "bindings": [ + { "name": "MAILBOX", "class_name": "Mailbox" } + ] + }, + "migrations": [ + { + "tag": "v1", + "new_sqlite_classes": ["Mailbox"] + } + ] +}