diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 6d63155c..d0f7f6ed 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -6,6 +6,4 @@ -keep class io.flutter.view.** { *; } -keep class io.flutter.** { *; } -keep class io.flutter.plugins.** { *; } --dontwarn io.flutter.embedding.** -## Sqlite Encryption --keep class net.sqlcipher.** { *; } \ No newline at end of file +-dontwarn io.flutter.embedding.** \ No newline at end of file diff --git a/ios/Podfile b/ios/Podfile index fb925943..9411102b 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -30,7 +30,6 @@ flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! - pod 'SQLCipher' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end diff --git a/lib/main.dart b/lib/main.dart index b894d46f..f7211bc5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:adaptive_theme/adaptive_theme.dart'; -import 'package:fluffychat/utils/database/flutter_famedly_sdk_hive_database.dart'; import 'package:matrix/encryption/utils/key_verification.dart'; import 'package:matrix/matrix.dart'; import 'package:fluffychat/config/routes.dart'; @@ -12,7 +11,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'utils/famedlysdk_store.dart'; import 'utils/localized_exception_extension.dart'; import 'package:flutter_app_lock/flutter_app_lock.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; @@ -20,6 +18,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:universal_html/html.dart' as html; import 'package:vrouter/vrouter.dart'; +import 'utils/matrix_sdk_extensions.dart/flutter_famedly_sdk_hive_database.dart'; import 'widgets/layouts/wait_for_login.dart'; import 'widgets/lock_screen.dart'; import 'widgets/matrix.dart'; @@ -48,7 +47,6 @@ void main() async { 'im.ponies.room_emotes', // we want emotes to work properly }, databaseBuilder: FlutterFamedlySdkHiveDatabase.hiveDatabaseBuilder, - legacyDatabaseBuilder: getDatabase, supportedLoginTypes: { AuthenticationTypes.password, if (PlatformInfos.isMobile || PlatformInfos.isWeb) AuthenticationTypes.sso diff --git a/lib/utils/database/cipher_db.dart b/lib/utils/database/cipher_db.dart deleted file mode 100644 index 66863f05..00000000 --- a/lib/utils/database/cipher_db.dart +++ /dev/null @@ -1,121 +0,0 @@ -// file from https://gist.github.com/simolus3/5097bbd80ce59f9b957961fe851fd95a#file-cipher_db-dart - -import 'dart:async'; -import 'dart:ffi'; -import 'dart:io'; -import 'dart:math'; - -import 'package:moor/backends.dart'; -import 'package:moor/ffi.dart'; -import 'package:moor/moor.dart'; -import 'package:sqlite3/open.dart'; - -/// Tells `moor_ffi` to use `sqlcipher` instead of the regular `sqlite3`. -/// -/// This needs to be called before using `moor`, for instance in the `main` -/// method. -void init() { - const sharedLibraryName = 'libsqlcipher.so'; - - open.overrideFor(OperatingSystem.android, () { - try { - return DynamicLibrary.open(sharedLibraryName); - } catch (_) { - // On some (especially old) Android devices, we somehow can't dlopen - // libraries shipped with the apk. We need to find the full path of the - // library (/data/data//lib/libsqlite3.so) and open that one. - // For details, see https://github.com/simolus3/moor/issues/420 - final appIdAsBytes = File('/proc/self/cmdline').readAsBytesSync(); - - // app id ends with the first \0 character in here. - final endOfAppId = max(appIdAsBytes.indexOf(0), 0); - final appId = String.fromCharCodes(appIdAsBytes.sublist(0, endOfAppId)); - - return DynamicLibrary.open('/data/data/$appId/lib/$sharedLibraryName'); - } - }); - - open.overrideFor(OperatingSystem.iOS, () => DynamicLibrary.executable()); -} - -class VmDatabaseEncrypted extends DelegatedDatabase { - /// Creates a database that will store its result in the [file], creating it - /// if it doesn't exist. - factory VmDatabaseEncrypted( - File file, { - String password = '', - bool logStatements = false, - }) { - final vmDatabase = VmDatabase(file, logStatements: logStatements); - return VmDatabaseEncrypted._(vmDatabase, password); - } - - factory VmDatabaseEncrypted.memory({ - String password = '', - bool logStatements = false, - }) { - final vmDatabase = VmDatabase.memory(logStatements: logStatements); - return VmDatabaseEncrypted._(vmDatabase, password); - } - - VmDatabaseEncrypted._( - VmDatabase vmDatabase, - String password, - ) : super( - _VmEncryptedDelegate(vmDatabase.delegate, password), - logStatements: vmDatabase.logStatements, - isSequential: vmDatabase.isSequential, - ); -} - -class _VmEncryptedDelegate extends DatabaseDelegate { - final String password; - final DatabaseDelegate delegate; - - _VmEncryptedDelegate( - this.delegate, - this.password, - ); - - @override - Future open(QueryExecutorUser db) async { - await delegate.open(db); - final keyLiteral = const StringType().mapToSqlConstant(password); - await delegate.runCustom('PRAGMA KEY = $keyLiteral', const []); - return Future.value(); - } - - @override - FutureOr get isOpen => delegate.isOpen; - - @override - Future runBatched(BatchedStatements statements) { - return delegate.runBatched(statements); - } - - @override - Future runCustom(String statement, List args) { - return delegate.runCustom(statement, args); - } - - @override - Future runInsert(String statement, List args) { - return delegate.runInsert(statement, args); - } - - @override - Future runSelect(String statement, List args) { - return delegate.runSelect(statement, args); - } - - @override - Future runUpdate(String statement, List args) { - return delegate.runUpdate(statement, args); - } - - @override - TransactionDelegate get transactionDelegate => delegate.transactionDelegate; - - @override - DbVersionDelegate get versionDelegate => delegate.versionDelegate; -} diff --git a/lib/utils/database/mobile.dart b/lib/utils/database/mobile.dart deleted file mode 100644 index 3e0965fa..00000000 --- a/lib/utils/database/mobile.dart +++ /dev/null @@ -1,87 +0,0 @@ -import 'dart:ffi'; -import 'dart:io'; -import 'dart:isolate'; -import 'package:matrix/matrix.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:sqflite/sqflite.dart' show getDatabasesPath; -import 'package:path/path.dart' as p; -import 'package:moor/moor.dart'; -import 'package:moor/isolate.dart'; -import '../platform_infos.dart'; -import 'cipher_db.dart' as cipher; -import 'package:moor/ffi.dart' as moor; -import 'package:sqlite3/open.dart'; - -bool _inited = false; - -// see https://moor.simonbinder.eu/docs/advanced-features/isolates/ -void _startBackground(_IsolateStartRequest request) { - // this is the entry point from the background isolate! Let's create - // the database from the path we received - - if (!_inited) { - cipher.init(); - _inited = true; - } - final executor = cipher.VmDatabaseEncrypted(File(request.targetPath), - password: request.password, logStatements: request.logStatements); - // we're using MoorIsolate.inCurrent here as this method already runs on a - // background isolate. If we used MoorIsolate.spawn, a third isolate would be - // started which is not what we want! - final moorIsolate = MoorIsolate.inCurrent( - () => DatabaseConnection.fromExecutor(executor), - ); - // inform the starting isolate about this, so that it can call .connect() - request.sendMoorIsolate.send(moorIsolate); -} - -// used to bundle the SendPort and the target path, since isolate entry point -// functions can only take one parameter. -class _IsolateStartRequest { - final SendPort sendMoorIsolate; - final String targetPath; - final String password; - final bool logStatements; - - _IsolateStartRequest( - this.sendMoorIsolate, this.targetPath, this.password, this.logStatements); -} - -Future constructDb( - {bool logStatements = false, - String filename = 'database.sqlite', - String password = ''}) async { - if (PlatformInfos.isMobile || Platform.isMacOS) { - Logs().v('[Moor] using encrypted moor'); - final dbFolder = await getDatabasesPath(); - final targetPath = p.join(dbFolder, filename); - final receivePort = ReceivePort(); - await Isolate.spawn( - _startBackground, - _IsolateStartRequest( - receivePort.sendPort, targetPath, password, logStatements), - ); - final isolate = (await receivePort.first as MoorIsolate); - return Database.connect(await isolate.connect()); - } else if (Platform.isLinux) { - Logs().v('[Moor] using Linux desktop moor'); - final appDocDir = await getApplicationSupportDirectory(); - return Database(moor.VmDatabase(File('${appDocDir.path}/$filename'))); - } else if (Platform.isWindows) { - Logs().v('[Moor] using Windows desktop moor'); - open.overrideFor(OperatingSystem.windows, _openOnWindows); - return Database(moor.VmDatabase.memory()); - } - throw Exception('Platform not supported'); -} - -DynamicLibrary _openOnWindows() { - final exePath = - File(Platform.resolvedExecutable.replaceAll('fluffychat.exe', '')); - final libraryNextToScript = File('${exePath.path}/sqlite3.dll'); - return DynamicLibrary.open(libraryNextToScript.path); -} - -Future getLocalstorage(String key) async { - return null; -} diff --git a/lib/utils/database/shared.dart b/lib/utils/database/shared.dart deleted file mode 100644 index c7f9b8f3..00000000 --- a/lib/utils/database/shared.dart +++ /dev/null @@ -1,3 +0,0 @@ -export 'unsupported.dart' - if (dart.library.html) 'web.dart' - if (dart.library.io) 'mobile.dart'; diff --git a/lib/utils/database/unsupported.dart b/lib/utils/database/unsupported.dart deleted file mode 100644 index 945ca601..00000000 --- a/lib/utils/database/unsupported.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:matrix/matrix.dart'; - -Future constructDb( - {bool logStatements = false, - String filename = 'database.sqlite', - String password = ''}) async { - throw 'Platform not supported'; -} - -Future getLocalstorage(String key) async { - return null; -} diff --git a/lib/utils/database/web.dart b/lib/utils/database/web.dart deleted file mode 100644 index 9ffe689f..00000000 --- a/lib/utils/database/web.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:matrix/matrix.dart'; -import 'package:moor/moor_web.dart'; -import 'dart:html'; - -Future constructDb( - {bool logStatements = false, - String filename = 'database.sqlite', - String password = ''}) async { - Logs().v('[Moor] Using moor web'); - return Database(WebDatabase.withStorage( - await MoorWebStorage.indexedDbIfSupported(filename), - logStatements: logStatements)); -} - -Future getLocalstorage(String key) async { - return window.localStorage[key]; -} diff --git a/lib/utils/famedlysdk_store.dart b/lib/utils/famedlysdk_store.dart index c00684ef..2d5a2eab 100644 --- a/lib/utils/famedlysdk_store.dart +++ b/lib/utils/famedlysdk_store.dart @@ -1,44 +1,9 @@ -import 'package:matrix/matrix.dart'; import 'package:fluffychat/utils/platform_infos.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:localstorage/localstorage.dart'; import 'package:path_provider/path_provider.dart'; import 'dart:async'; import 'dart:core'; -import './database/shared.dart'; -import '../config/setting_keys.dart'; -import 'package:random_string/random_string.dart'; - -Future getDatabase(Client client) async { - while (_generateDatabaseLock) { - await Future.delayed(Duration(milliseconds: 50)); - } - _generateDatabaseLock = true; - try { - if (_db != null) return _db; - final store = Store(); - var password = await store.getItem(SettingKeys.databasePassword); - var newPassword = false; - if (password == null || password.isEmpty) { - newPassword = true; - password = randomString(255); - } - _db = await constructDb( - logStatements: false, - filename: 'moor.sqlite', - password: password, - ); - if (newPassword) { - await store.setItem(SettingKeys.databasePassword, password); - } - return _db; - } finally { - _generateDatabaseLock = false; - } -} - -Database _db; -bool _generateDatabaseLock = false; // see https://github.com/mogol/flutter_secure_storage/issues/161#issuecomment-704578453 class AsyncMutex { diff --git a/lib/utils/database/flutter_famedly_sdk_hive_database.dart b/lib/utils/matrix_sdk_extensions.dart/flutter_famedly_sdk_hive_database.dart similarity index 100% rename from lib/utils/database/flutter_famedly_sdk_hive_database.dart rename to lib/utils/matrix_sdk_extensions.dart/flutter_famedly_sdk_hive_database.dart diff --git a/pubspec.lock b/pubspec.lock index d966aeb3..b8d15c0a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -626,7 +626,7 @@ packages: source: hosted version: "1.0.0" moor: - dependency: "direct main" + dependency: transitive description: name: moor url: "https://pub.dartlang.org" @@ -1039,7 +1039,7 @@ packages: source: hosted version: "1.8.1" sqflite: - dependency: "direct main" + dependency: transitive description: name: sqflite url: "https://pub.dartlang.org" @@ -1053,7 +1053,7 @@ packages: source: hosted version: "2.0.0+2" sqlite3: - dependency: "direct main" + dependency: transitive description: name: sqlite3 url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index da81db6e..27f5e43e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,7 +43,6 @@ dependencies: localstorage: ^4.0.0+1 matrix: ^0.1.5 mime_type: ^1.0.0 - moor: ^4.2.1 native_imaging: git: url: https://gitlab.com/famedly/libraries/native_imaging.git @@ -60,8 +59,6 @@ dependencies: scroll_to_index: ^2.0.0 sentry: ^5.0.0 share: ^2.0.1 - sqflite: ^2.0.0+3 # Still used to obtain the database location - sqlite3: ^1.0.0 swipe_to_action: ^0.1.0 uni_links: ^0.5.1 unifiedpush: ^1.0.2 diff --git a/scripts/prepare-web.sh b/scripts/prepare-web.sh index 65703111..b7f088e6 100755 --- a/scripts/prepare-web.sh +++ b/scripts/prepare-web.sh @@ -3,8 +3,4 @@ rm -r assets/js/package cd assets/js/ && curl -L 'https://gitlab.com/famedly/libraries/olm/-/jobs/artifacts/master/download?job=build_js' > olm.zip && cd ../../ cd assets/js/ && unzip olm.zip && cd ../../ cd assets/js/ && rm olm.zip && cd ../../ -cd assets/js/ && mv javascript package && cd ../../ -cd web/ && rm sql-wasm.js sql-wasm.wasm && cd ../ -cd web/ && curl -L 'https://github.com/sql-js/sql.js/releases/latest/download/sqljs-wasm.zip' > sqljs-wasm.zip && cd ../ -cd web/ && unzip sqljs-wasm.zip && cd ../ -cd web/ && rm sqljs-wasm.zip && cd ../ +cd assets/js/ && mv javascript package && cd ../../ \ No newline at end of file diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index cea268d2..fe4a7c0a 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -34,8 +34,6 @@ parts: fluffychat: plugin: dump source: ./build/linux/x64/release/bundle/ - stage-packages: - - libsqlite3-dev slots: dbus-svc: diff --git a/test/utils/test_client.dart b/test/utils/test_client.dart index 2eaf7939..d3c91c60 100644 --- a/test/utils/test_client.dart +++ b/test/utils/test_client.dart @@ -1,4 +1,4 @@ -import 'package:fluffychat/utils/database/flutter_famedly_sdk_hive_database.dart'; +import 'package:fluffychat/utils/matrix_sdk_extensions.dart/flutter_famedly_sdk_hive_database.dart'; import 'package:matrix/encryption/utils/key_verification.dart'; import 'package:matrix/matrix.dart'; import 'package:matrix_api_lite/fake_matrix_api.dart'; diff --git a/web/index.html b/web/index.html index 8746b059..3d16ba07 100644 --- a/web/index.html +++ b/web/index.html @@ -25,7 +25,7 @@ - + fluffychat @@ -100,7 +100,6 @@ } - - + \ No newline at end of file diff --git a/web/sql-wasm.js b/web/sql-wasm.js deleted file mode 100644 index c0f637c9..00000000 --- a/web/sql-wasm.js +++ /dev/null @@ -1,202 +0,0 @@ - -// We are modularizing this manually because the current modularize setting in Emscripten has some issues: -// https://github.com/kripken/emscripten/issues/5820 -// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`, -// which is able to be used/called before the WASM is loaded. -// The modularization below exports a promise that loads and resolves to the actual sql.js module. -// That way, this module can't be used before the WASM is finished loading. - -// We are going to define a function that a user will call to start loading initializing our Sql.js library -// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module -// Instead, we want to return the previously loaded module - -// TODO: Make this not declare a global if used in the browser -var initSqlJsPromise = undefined; - -var initSqlJs = function (moduleConfig) { - - if (initSqlJsPromise){ - return initSqlJsPromise; - } - // If we're here, we've never called this function before - initSqlJsPromise = new Promise(function (resolveModule, reject) { - - // We are modularizing this manually because the current modularize setting in Emscripten has some issues: - // https://github.com/kripken/emscripten/issues/5820 - - // The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add - // properties to it, like `preRun`, `postRun`, etc - // We are using that to get notified when the WASM has finished loading. - // Only then will we return our promise - - // If they passed in a moduleConfig object, use that - // Otherwise, initialize Module to the empty object - var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {}; - - // EMCC only allows for a single onAbort function (not an array of functions) - // So if the user defined their own onAbort function, we remember it and call it - var originalOnAbortFunction = Module['onAbort']; - Module['onAbort'] = function (errorThatCausedAbort) { - reject(new Error(errorThatCausedAbort)); - if (originalOnAbortFunction){ - originalOnAbortFunction(errorThatCausedAbort); - } - }; - - Module['postRun'] = Module['postRun'] || []; - Module['postRun'].push(function () { - // When Emscripted calls postRun, this promise resolves with the built Module - resolveModule(Module); - }); - - // There is a section of code in the emcc-generated code below that looks like this: - // (Note that this is lowercase `module`) - // if (typeof module !== 'undefined') { - // module['exports'] = Module; - // } - // When that runs, it's going to overwrite our own modularization export efforts in shell-post.js! - // The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags, - // but that carries with it additional unnecessary baggage/bugs we don't want either. - // So, we have three options: - // 1) We undefine `module` - // 2) We remember what `module['exports']` was at the beginning of this function and we restore it later - // 3) We write a script to remove those lines of code as part of the Make process. - // - // Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward - // of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future. - // That's a nice side effect since we're handling the modularization efforts ourselves - module = undefined; - - // The emcc-generated code and shell-post.js code goes below, - // meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort - -var e;e||(e=typeof Module !== 'undefined' ? Module : {}); -e.onRuntimeInitialized=function(){function a(h,m){this.Na=h;this.db=m;this.Ma=1;this.eb=[]}function b(h){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=h){var m=this.filename,q=m?k("//"+m):"/";m=aa(!0,!0);q=ba(q,(void 0!==m?m:438)&4095|32768,0);if(h){if("string"===typeof h){for(var v=Array(h.length),B=0,Q=h.length;B>2];G[Ja>>2]=b+a+15&-16;return b}var Ka=[],La; -function ua(a){La.delete(I.get(a));Ka.push(a)} -function va(a){if(!La){La=new WeakMap;for(var b=0;bc;++c)f.parameters.push(d["viii"[c]]);c=new WebAssembly.Function(f,a)}else{d=[1,0,1,96];f={i:127,j:126,f:125,d:124};d.push(3);for(c=0;3>c;++c)d.push(f["iii"[c]]);d.push(0);d[1]=d.length-2;c=new Uint8Array([0,97,115,109,1,0,0,0].concat(d,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0]));c=new WebAssembly.Module(c);c=(new WebAssembly.Instance(c,{e:{f:a}})).exports.f}I.set(b,c)}La.set(a,b);a=b}return a}function ra(a){ua(a)}var Ma;e.wasmBinary&&(Ma=e.wasmBinary);var noExitRuntime; -e.noExitRuntime&&(noExitRuntime=e.noExitRuntime);"object"!==typeof WebAssembly&&E("no native wasm support detected"); -function oa(a){var b="i32";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":x[a>>0]=0;break;case "i8":x[a>>0]=0;break;case "i16":Na[a>>1]=0;break;case "i32":G[a>>2]=0;break;case "i64":J=[0,(K=0,1<=+Oa(K)?0>>0:~~+Ra((K-+(~~K>>>0))/4294967296)>>>0:0)];G[a>>2]=J[0];G[a+4>>2]=J[1];break;case "float":Sa[a>>2]=0;break;case "double":Ta[a>>3]=0;break;default:D("invalid type for setValue: "+b)}} -function p(a,b){b=b||"i8";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":return x[a>>0];case "i8":return x[a>>0];case "i16":return Na[a>>1];case "i32":return G[a>>2];case "i64":return G[a>>2];case "float":return Sa[a>>2];case "double":return Ta[a>>3];default:D("invalid type for getValue: "+b)}return null}var Ua,I=new WebAssembly.Table({initial:387,element:"anyfunc"}),Va=!1;function assert(a,b){a||D("Assertion failed: "+b)} -function Wa(a){var b=e["_"+a];assert(b,"Cannot call unknown function "+a+", make sure it is exported");return b} -function Xa(a,b,c,d){var f={string:function(u){var C=0;if(null!==u&&void 0!==u&&0!==u){var H=(u.length<<2)+1;C=t(H);la(u,L,C,H)}return C},array:function(u){var C=t(u.length);x.set(u,C);return C}},g=Wa(a),n=[];a=0;if(d)for(var r=0;r>2]=0;for(a=f+d;g>0]=0;return f}a.subarray||a.slice?L.set(a,f):L.set(new Uint8Array(a),f);return f}var ab="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0; -function bb(a,b,c){var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d}function N(a){return a?bb(L,a,void 0):""} -function la(a,b,c,d){if(!(0=n){var r=a.charCodeAt(++g);n=65536+((n&1023)<<10)|r&1023}if(127>=n){if(c>=d)break;b[c++]=n}else{if(2047>=n){if(c+1>=d)break;b[c++]=192|n>>6}else{if(65535>=n){if(c+2>=d)break;b[c++]=224|n>>12}else{if(c+3>=d)break;b[c++]=240|n>>18;b[c++]=128|n>>12&63}b[c++]=128|n>>6&63}b[c++]=128|n&63}}b[c]=0;return c-f} -function ka(a){for(var b=0,c=0;c=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:b+4}return b}function cb(a){var b=ka(a)+1,c=$a(b);c&&la(a,x,c,b);return c}var db,x,L,Na,G,Sa,Ta; -function eb(a){db=a;e.HEAP8=x=new Int8Array(a);e.HEAP16=Na=new Int16Array(a);e.HEAP32=G=new Int32Array(a);e.HEAPU8=L=new Uint8Array(a);e.HEAPU16=new Uint16Array(a);e.HEAPU32=new Uint32Array(a);e.HEAPF32=Sa=new Float32Array(a);e.HEAPF64=Ta=new Float64Array(a)}var Ja=63056,fb=e.INITIAL_MEMORY||16777216;e.wasmMemory?Ua=e.wasmMemory:Ua=new WebAssembly.Memory({initial:fb/65536,maximum:32768});Ua&&(db=Ua.buffer);fb=db.byteLength;eb(db);G[Ja>>2]=5306096; -function gb(a){for(;0>2]=a} -function Gb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Ab(a.split("/").filter(function(d){return!!d}),!b).join("/");return(b?"/":"")+a||"."}var Hb=[];function Ib(a,b){Hb[a]={input:[],output:[],Ya:b};Jb(a,Kb)} -var Kb={open:function(a){var b=Hb[a.node.rdev];if(!b)throw new O(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.Ya.flush(a.tty)},flush:function(a){a.tty.Ya.flush(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.Ya.ob)throw new O(60);for(var f=0,g=0;g=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Ia,a.Ia=new Uint8Array(b),0b)a.Ia.length=b;else for(;a.Ia.length=a.node.Oa)return 0;a=Math.min(a.node.Oa-f,d);if(8b)throw new O(28);return b},jb:function(a,b,c){P.mb(a.node,b+c);a.node.Oa=Math.max(a.node.Oa,b+c)},$a:function(a,b,c,d,f,g,n){if(32768!==(a.node.mode&61440))throw new O(43);a=a.node.Ia;if(n& -2||a.buffer!==b.buffer){if(0>>0)%U.length}function Yb(a){var b=Xb(a.parent.id,a.name);if(U[b]===a)U[b]=a.Xa;else for(b=U[b];b;){if(b.Xa===a){b.Xa=a.Xa;break}b=b.Xa}} -function Qb(a,b){var c;if(c=(c=Zb(a,"x"))?c:a.Ja.lookup?0:2)throw new O(c,a);for(c=U[Xb(a.id,b)];c;c=c.Xa){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.Ja.lookup(a,b)}function Ob(a,b,c,d){a=new $b(a,b,c,d);b=Xb(a.parent.id,a.name);a.Xa=U[b];return U[b]=a}function R(a){return 16384===(a&61440)}var ac={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218}; -function bc(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}function Zb(a,b){if(Ub)return 0;if(-1===b.indexOf("r")||a.mode&292){if(-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73))return 2}else return 2;return 0}function cc(a,b){try{return Qb(a,b),20}catch(c){}return Zb(a,"wx")}function dc(a,b,c){try{var d=Qb(a,b)}catch(f){return f.La}if(a=Zb(a,"wx"))return a;if(c){if(!R(d.mode))return 54;if(d===d.parent||"/"===Wb(d))return 10}else if(R(d.mode))return 31;return 0} -function ec(a){var b=4096;for(a=a||0;a<=b;a++)if(!T[a])return a;throw new O(33);}function fc(a,b){hc||(hc=function(){},hc.prototype={});var c=new hc,d;for(d in a)c[d]=a[d];a=c;b=ec(b);a.fd=b;return T[b]=a}var Nb={open:function(a){a.Ka=Sb[a.node.rdev].Ka;a.Ka.open&&a.Ka.open(a)},Va:function(){throw new O(70);}};function Jb(a,b){Sb[a]={Ka:b}} -function ic(a,b){var c="/"===b,d=!b;if(c&&Rb)throw new O(10);if(!c&&!d){var f=W(b,{nb:!1});b=f.path;f=f.node;if(f.Wa)throw new O(10);if(!R(f.mode))throw new O(54);}b={type:a,Lb:{},pb:b,Db:[]};a=a.Sa(b);a.Sa=b;b.root=a;c?Rb=a:f&&(f.Wa=b,f.Sa&&f.Sa.Db.push(b))}function ba(a,b,c){var d=W(a,{parent:!0}).node;a=Cb(a);if(!a||"."===a||".."===a)throw new O(28);var f=cc(d,a);if(f)throw new O(f);if(!d.Ja.Za)throw new O(63);return d.Ja.Za(d,a,b,c)}function X(a,b){ba(a,(void 0!==b?b:511)&1023|16384,0)} -function jc(a,b,c){"undefined"===typeof c&&(c=b,b=438);ba(a,b|8192,c)}function kc(a,b){if(!Gb(a))throw new O(44);var c=W(b,{parent:!0}).node;if(!c)throw new O(44);b=Cb(b);var d=cc(c,b);if(d)throw new O(d);if(!c.Ja.symlink)throw new O(63);c.Ja.symlink(c,b,a)} -function ta(a){var b=W(a,{parent:!0}).node,c=Cb(a),d=Qb(b,c),f=dc(b,c,!1);if(f)throw new O(f);if(!b.Ja.unlink)throw new O(63);if(d.Wa)throw new O(10);try{V.willDeletePath&&V.willDeletePath(a)}catch(g){E("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+g.message)}b.Ja.unlink(b,c);Yb(d);try{if(V.onDeletePath)V.onDeletePath(a)}catch(g){E("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}} -function Vb(a){a=W(a).node;if(!a)throw new O(44);if(!a.Ja.readlink)throw new O(28);return Gb(Wb(a.parent),a.Ja.readlink(a))}function lc(a,b){a=W(a,{Ua:!b}).node;if(!a)throw new O(44);if(!a.Ja.Qa)throw new O(63);return a.Ja.Qa(a)}function mc(a){return lc(a,!0)}function ca(a,b){var c;"string"===typeof a?c=W(a,{Ua:!0}).node:c=a;if(!c.Ja.Pa)throw new O(63);c.Ja.Pa(c,{mode:b&4095|c.mode&-4096,timestamp:Date.now()})} -function nc(a){var b;"string"===typeof a?b=W(a,{Ua:!0}).node:b=a;if(!b.Ja.Pa)throw new O(63);b.Ja.Pa(b,{timestamp:Date.now()})}function oc(a,b){if(0>b)throw new O(28);var c;"string"===typeof a?c=W(a,{Ua:!0}).node:c=a;if(!c.Ja.Pa)throw new O(63);if(R(c.mode))throw new O(31);if(32768!==(c.mode&61440))throw new O(28);if(a=Zb(c,"w"))throw new O(a);c.Ja.Pa(c,{size:b,timestamp:Date.now()})} -function l(a,b,c,d){if(""===a)throw new O(44);if("string"===typeof b){var f=ac[b];if("undefined"===typeof f)throw Error("Unknown file open mode: "+b);b=f}c=b&64?("undefined"===typeof c?438:c)&4095|32768:0;if("object"===typeof a)var g=a;else{a=k(a);try{g=W(a,{Ua:!(b&131072)}).node}catch(n){}}f=!1;if(b&64)if(g){if(b&128)throw new O(20);}else g=ba(a,c,0),f=!0;if(!g)throw new O(44);8192===(g.mode&61440)&&(b&=-513);if(b&65536&&!R(g.mode))throw new O(54);if(!f&&(c=g?40960===(g.mode&61440)?32:R(g.mode)&& -("r"!==bc(b)||b&512)?31:Zb(g,bc(b)):44))throw new O(c);b&512&&oc(g,0);b&=-131713;d=fc({node:g,path:Wb(g),flags:b,seekable:!0,position:0,Ka:g.Ka,Ib:[],error:!1},d);d.Ka.open&&d.Ka.open(d);!e.logReadFiles||b&1||(pc||(pc={}),a in pc||(pc[a]=1,E("FS.trackingDelegate error on read file: "+a)));try{V.onOpenFile&&(g=0,1!==(b&2097155)&&(g|=1),0!==(b&2097155)&&(g|=2),V.onOpenFile(a,g))}catch(n){E("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+n.message)}return d} -function ea(a){if(null===a.fd)throw new O(8);a.gb&&(a.gb=null);try{a.Ka.close&&a.Ka.close(a)}catch(b){throw b;}finally{T[a.fd]=null}a.fd=null}function qc(a,b,c){if(null===a.fd)throw new O(8);if(!a.seekable||!a.Ka.Va)throw new O(70);if(0!=c&&1!=c&&2!=c)throw new O(28);a.position=a.Ka.Va(a,b,c);a.Ib=[]} -function rc(a,b,c,d,f){if(0>d||0>f)throw new O(28);if(null===a.fd)throw new O(8);if(1===(a.flags&2097155))throw new O(8);if(R(a.node.mode))throw new O(31);if(!a.Ka.read)throw new O(28);var g="undefined"!==typeof f;if(!g)f=a.position;else if(!a.seekable)throw new O(70);b=a.Ka.read(a,b,c,d,f);g||(a.position+=b);return b} -function da(a,b,c,d,f,g){if(0>d||0>f)throw new O(28);if(null===a.fd)throw new O(8);if(0===(a.flags&2097155))throw new O(8);if(R(a.node.mode))throw new O(31);if(!a.Ka.write)throw new O(28);a.seekable&&a.flags&1024&&qc(a,0,2);var n="undefined"!==typeof f;if(!n)f=a.position;else if(!a.seekable)throw new O(70);b=a.Ka.write(a,b,c,d,f,g);n||(a.position+=b);try{if(a.path&&V.onWriteToFile)V.onWriteToFile(a.path)}catch(r){E("FS.trackingDelegate['onWriteToFile']('"+a.path+"') threw an exception: "+r.message)}return b} -function sa(a){var b={encoding:"binary"};b=b||{};b.flags=b.flags||"r";b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error('Invalid encoding type "'+b.encoding+'"');var c,d=l(a,b.flags);a=lc(a).size;var f=new Uint8Array(a);rc(d,f,0,a,0);"utf8"===b.encoding?c=bb(f,0):"binary"===b.encoding&&(c=f);ea(d);return c} -function sc(){O||(O=function(a,b){this.node=b;this.Hb=function(c){this.La=c};this.Hb(a);this.message="FS error"},O.prototype=Error(),O.prototype.constructor=O,[44].forEach(function(a){Pb[a]=new O(a);Pb[a].stack=""}))}var tc;function aa(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c} -function Rc(a,b,c){a=k("/dev/"+a);var d=aa(!!b,!!c);Sc||(Sc=64);var f=Sc++<<8|0;Jb(f,{open:function(g){g.seekable=!1},close:function(){c&&c.buffer&&c.buffer.length&&c(10)},read:function(g,n,r,w){for(var u=0,C=0;C>2]=d.dev;G[c+4>>2]=0;G[c+8>>2]=d.ino;G[c+12>>2]=d.mode;G[c+16>>2]=d.nlink;G[c+20>>2]=d.uid;G[c+24>>2]=d.gid;G[c+28>>2]=d.rdev;G[c+32>>2]=0;J=[d.size>>>0,(K=d.size,1<=+Oa(K)?0>>0:~~+Ra((K-+(~~K>>>0))/4294967296)>>>0:0)];G[c+40>>2]=J[0];G[c+44>>2]=J[1];G[c+48>>2]=4096;G[c+52>>2]=d.blocks;G[c+56>>2]=d.atime.getTime()/1E3|0;G[c+60>>2]=0;G[c+64>>2]=d.mtime.getTime()/ -1E3|0;G[c+68>>2]=0;G[c+72>>2]=d.ctime.getTime()/1E3|0;G[c+76>>2]=0;J=[d.ino>>>0,(K=d.ino,1<=+Oa(K)?0>>0:~~+Ra((K-+(~~K>>>0))/4294967296)>>>0:0)];G[c+80>>2]=J[0];G[c+84>>2]=J[1];return 0}var Wc=void 0;function Xc(){Wc+=4;return G[Wc-4>>2]}function Z(a){a=T[a];if(!a)throw new O(8);return a}var Yc={}; -function Zc(){if(!$c){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:xa||"./this.program"},b;for(b in Yc)a[b]=Yc[b];var c=[];for(b in a)c.push(b+"="+a[b]);$c=c}return $c}var $c;la("GMT",L,63120,4); -function ad(){function a(g){return(g=g.toTimeString().match(/\(([A-Za-z ]+)\)$/))?g[1]:"GMT"}if(!bd){bd=!0;G[cd()>>2]=60*(new Date).getTimezoneOffset();var b=(new Date).getFullYear(),c=new Date(b,0,1);b=new Date(b,6,1);G[dd()>>2]=Number(c.getTimezoneOffset()!=b.getTimezoneOffset());var d=a(c),f=a(b);d=cb(d);f=cb(f);b.getTimezoneOffset()>2]=d,G[ed()+4>>2]=f):(G[ed()>>2]=f,G[ed()+4>>2]=d)}}var bd,fd; -Aa?fd=function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:"undefined"!==typeof dateNow?fd=dateNow:fd=function(){return performance.now()};function gd(a){for(var b=fd();fd()-bf?-28:l(d.path,d.flags,0,f).fd;case 1:case 2:return 0;case 3:return d.flags; -case 4:return f=Xc(),d.flags|=f,0;case 12:return f=Xc(),Na[f+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return Eb(28),-1;default:return-28}}catch(g){return"undefined"!==typeof Y&&g instanceof O||D(g),-g.La}},t:function(a,b){try{var c=Z(a);return Vc(lc,c.path,b)}catch(d){return"undefined"!==typeof Y&&d instanceof O||D(d),-d.La}},J:function(a,b,c){try{var d=T[a];if(!d)throw new O(8);if(0===(d.flags&2097155))throw new O(28);oc(d.node,c);return 0}catch(f){return"undefined"!==typeof Y&& -f instanceof O||D(f),-f.La}},F:function(a,b){try{if(0===b)return-28;if(b=c)var d=-28;else{var f=Vb(a),g=Math.min(c,ka(f)),n=x[b+g];la(f,L,b,c+1);x[b+g]=n;d=g}return d}catch(r){return"undefined"!==typeof Y&&r instanceof O||D(r),-r.La}},D:function(a){try{a=N(a);var b=W(a,{parent:!0}).node,c=Cb(a),d=Qb(b,c),f=dc(b,c,!0);if(f)throw new O(f);if(!b.Ja.rmdir)throw new O(63);if(d.Wa)throw new O(10);try{V.willDeletePath&&V.willDeletePath(a)}catch(g){E("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+ -g.message)}b.Ja.rmdir(b,c);Yb(d);try{if(V.onDeletePath)V.onDeletePath(a)}catch(g){E("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof Y&&g instanceof O||D(g),-g.La}},e:function(a,b){try{return a=N(a),Vc(lc,a,b)}catch(c){return"undefined"!==typeof Y&&c instanceof O||D(c),-c.La}},h:function(a){try{return a=N(a),ta(a),0}catch(b){return"undefined"!==typeof Y&&b instanceof O||D(b),-b.La}},m:function(a,b,c){L.copyWithin(a,b,b+c)}, -c:function(a){a>>>=0;var b=L.length;if(2147483648=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);d=Math.max(16777216,a,d);0>>16);eb(Ua.buffer);var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},o:function(a,b){var c=0;Zc().forEach(function(d,f){var g=b+c;f=G[a+4*f>>2]=g;for(g=0;g>0]=d.charCodeAt(g);x[f>>0]=0;c+=d.length+1});return 0},p:function(a,b){var c= -Zc();G[a>>2]=c.length;var d=0;c.forEach(function(f){d+=f.length+1});G[b>>2]=d;return 0},f:function(a){try{var b=Z(a);ea(b);return 0}catch(c){return"undefined"!==typeof Y&&c instanceof O||D(c),c.La}},n:function(a,b){try{var c=Z(a);x[b>>0]=c.tty?2:R(c.mode)?3:40960===(c.mode&61440)?7:4;return 0}catch(d){return"undefined"!==typeof Y&&d instanceof O||D(d),d.La}},l:function(a,b,c,d,f){try{var g=Z(a);a=4294967296*c+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;qc(g,a,d);J=[g.position>>> -0,(K=g.position,1<=+Oa(K)?0>>0:~~+Ra((K-+(~~K>>>0))/4294967296)>>>0:0)];G[f>>2]=J[0];G[f+4>>2]=J[1];g.gb&&0===a&&0===d&&(g.gb=null);return 0}catch(n){return"undefined"!==typeof Y&&n instanceof O||D(n),n.La}},E:function(a){try{var b=Z(a);return b.Ka&&b.Ka.fsync?-b.Ka.fsync(b):0}catch(c){return"undefined"!==typeof Y&&c instanceof O||D(c),c.La}},i:function(a,b,c,d){try{a:{for(var f=Z(a),g=a=0;g>2],G[b+(8*g+4)>>2],void 0);if(0>n){var r= --1;break a}a+=n}r=a}G[d>>2]=r;return 0}catch(w){return"undefined"!==typeof Y&&w instanceof O||D(w),w.La}},g:function(a){var b=Date.now();G[a>>2]=b/1E3|0;G[a+4>>2]=b%1E3*1E3|0;return 0},k:function(a){ad();a=new Date(1E3*G[a>>2]);G[15768]=a.getSeconds();G[15769]=a.getMinutes();G[15770]=a.getHours();G[15771]=a.getDate();G[15772]=a.getMonth();G[15773]=a.getFullYear()-1900;G[15774]=a.getDay();var b=new Date(a.getFullYear(),0,1);G[15775]=(a.getTime()-b.getTime())/864E5|0;G[15777]=-(60*a.getTimezoneOffset()); -var c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();b=b.getTimezoneOffset();a=(c!=b&&a.getTimezoneOffset()==Math.min(b,c))|0;G[15776]=a;a=G[ed()+(a?4:0)>>2];G[15778]=a;return 63072},memory:Ua,z:function(a,b){if(0===a)return Eb(28),-1;var c=G[a>>2];a=G[a+4>>2];if(0>a||999999999c)return Eb(28),-1;0!==b&&(G[b>>2]=0,G[b+4>>2]=0);return gd(1E6*c+a/1E3)},A:function(a){switch(a){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809; -case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32; -case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1E3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"===typeof navigator?navigator.hardwareConcurrency||1:1}Eb(28);return-1}, -table:I,K:function(a){var b=Date.now()/1E3|0;a&&(G[a>>2]=b);return b},r:function(a,b){if(b){var c=1E3*G[b+8>>2];c+=G[b+12>>2]/1E3}else c=Date.now();a=N(a);try{b=c;var d=W(a,{Ua:!0}).node;d.Ja.Pa(d,{timestamp:Math.max(b,c)});return 0}catch(f){a=f;if(!(a instanceof O)){a+=" : ";a:{d=Error();if(!d.stack){try{throw Error();}catch(g){d=g}if(!d.stack){d="(no stack trace available)";break a}}d=d.stack.toString()}e.extraStackTrace&&(d+="\n"+e.extraStackTrace());d=zb(d);throw a+d;}Eb(a.La);return-1}}},kd= -function(){function a(f){e.asm=f.exports;mb--;e.monitorRunDependencies&&e.monitorRunDependencies(mb);0==mb&&(null!==nb&&(clearInterval(nb),nb=null),ob&&(f=ob,ob=null,f()))}function b(f){a(f.instance)}function c(f){return ub().then(function(g){return WebAssembly.instantiate(g,d)}).then(f,function(g){E("failed to asynchronously prepare wasm: "+g);D(g)})}var d={a:jd};mb++;e.monitorRunDependencies&&e.monitorRunDependencies(mb);if(e.instantiateWasm)try{return e.instantiateWasm(d,a)}catch(f){return E("Module.instantiateWasm callback failed with error: "+ -f),!1}(function(){if(Ma||"function"!==typeof WebAssembly.instantiateStreaming||rb()||pb("file://")||"function"!==typeof fetch)return c(b);fetch(qb,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(b,function(g){E("wasm streaming compile failed: "+g);E("falling back to ArrayBuffer instantiation");c(b)})})})();return{}}();e.asm=kd; -var vb=e.___wasm_call_ctors=function(){return(vb=e.___wasm_call_ctors=e.asm.L).apply(null,arguments)},id=e._memset=function(){return(id=e._memset=e.asm.M).apply(null,arguments)};e._sqlite3_free=function(){return(e._sqlite3_free=e.asm.N).apply(null,arguments)};var Fb=e.___errno_location=function(){return(Fb=e.___errno_location=e.asm.O).apply(null,arguments)};e._sqlite3_finalize=function(){return(e._sqlite3_finalize=e.asm.P).apply(null,arguments)}; -e._sqlite3_reset=function(){return(e._sqlite3_reset=e.asm.Q).apply(null,arguments)};e._sqlite3_clear_bindings=function(){return(e._sqlite3_clear_bindings=e.asm.R).apply(null,arguments)};e._sqlite3_value_blob=function(){return(e._sqlite3_value_blob=e.asm.S).apply(null,arguments)};e._sqlite3_value_text=function(){return(e._sqlite3_value_text=e.asm.T).apply(null,arguments)};e._sqlite3_value_bytes=function(){return(e._sqlite3_value_bytes=e.asm.U).apply(null,arguments)}; -e._sqlite3_value_double=function(){return(e._sqlite3_value_double=e.asm.V).apply(null,arguments)};e._sqlite3_value_int=function(){return(e._sqlite3_value_int=e.asm.W).apply(null,arguments)};e._sqlite3_value_type=function(){return(e._sqlite3_value_type=e.asm.X).apply(null,arguments)};e._sqlite3_result_blob=function(){return(e._sqlite3_result_blob=e.asm.Y).apply(null,arguments)};e._sqlite3_result_double=function(){return(e._sqlite3_result_double=e.asm.Z).apply(null,arguments)}; -e._sqlite3_result_error=function(){return(e._sqlite3_result_error=e.asm._).apply(null,arguments)};e._sqlite3_result_int=function(){return(e._sqlite3_result_int=e.asm.$).apply(null,arguments)};e._sqlite3_result_int64=function(){return(e._sqlite3_result_int64=e.asm.aa).apply(null,arguments)};e._sqlite3_result_null=function(){return(e._sqlite3_result_null=e.asm.ba).apply(null,arguments)};e._sqlite3_result_text=function(){return(e._sqlite3_result_text=e.asm.ca).apply(null,arguments)}; -e._sqlite3_step=function(){return(e._sqlite3_step=e.asm.da).apply(null,arguments)};e._sqlite3_data_count=function(){return(e._sqlite3_data_count=e.asm.ea).apply(null,arguments)};e._sqlite3_column_blob=function(){return(e._sqlite3_column_blob=e.asm.fa).apply(null,arguments)};e._sqlite3_column_bytes=function(){return(e._sqlite3_column_bytes=e.asm.ga).apply(null,arguments)};e._sqlite3_column_double=function(){return(e._sqlite3_column_double=e.asm.ha).apply(null,arguments)}; -e._sqlite3_column_text=function(){return(e._sqlite3_column_text=e.asm.ia).apply(null,arguments)};e._sqlite3_column_type=function(){return(e._sqlite3_column_type=e.asm.ja).apply(null,arguments)};e._sqlite3_column_name=function(){return(e._sqlite3_column_name=e.asm.ka).apply(null,arguments)};e._sqlite3_bind_blob=function(){return(e._sqlite3_bind_blob=e.asm.la).apply(null,arguments)};e._sqlite3_bind_double=function(){return(e._sqlite3_bind_double=e.asm.ma).apply(null,arguments)}; -e._sqlite3_bind_int=function(){return(e._sqlite3_bind_int=e.asm.na).apply(null,arguments)};e._sqlite3_bind_text=function(){return(e._sqlite3_bind_text=e.asm.oa).apply(null,arguments)};e._sqlite3_bind_parameter_index=function(){return(e._sqlite3_bind_parameter_index=e.asm.pa).apply(null,arguments)};e._sqlite3_errmsg=function(){return(e._sqlite3_errmsg=e.asm.qa).apply(null,arguments)};e._sqlite3_exec=function(){return(e._sqlite3_exec=e.asm.ra).apply(null,arguments)}; -e._sqlite3_prepare_v2=function(){return(e._sqlite3_prepare_v2=e.asm.sa).apply(null,arguments)};e._sqlite3_changes=function(){return(e._sqlite3_changes=e.asm.ta).apply(null,arguments)};e._sqlite3_close_v2=function(){return(e._sqlite3_close_v2=e.asm.ua).apply(null,arguments)};e._sqlite3_create_function_v2=function(){return(e._sqlite3_create_function_v2=e.asm.va).apply(null,arguments)};e._sqlite3_open=function(){return(e._sqlite3_open=e.asm.wa).apply(null,arguments)}; -var $a=e._malloc=function(){return($a=e._malloc=e.asm.xa).apply(null,arguments)},ia=e._free=function(){return(ia=e._free=e.asm.ya).apply(null,arguments)};e._RegisterExtensionFunctions=function(){return(e._RegisterExtensionFunctions=e.asm.za).apply(null,arguments)}; -var ed=e.__get_tzname=function(){return(ed=e.__get_tzname=e.asm.Aa).apply(null,arguments)},dd=e.__get_daylight=function(){return(dd=e.__get_daylight=e.asm.Ba).apply(null,arguments)},cd=e.__get_timezone=function(){return(cd=e.__get_timezone=e.asm.Ca).apply(null,arguments)},hd=e._memalign=function(){return(hd=e._memalign=e.asm.Da).apply(null,arguments)},ja=e.stackSave=function(){return(ja=e.stackSave=e.asm.Ea).apply(null,arguments)},t=e.stackAlloc=function(){return(t=e.stackAlloc=e.asm.Fa).apply(null, -arguments)},qa=e.stackRestore=function(){return(qa=e.stackRestore=e.asm.Ga).apply(null,arguments)};e.dynCall_vi=function(){return(e.dynCall_vi=e.asm.Ha).apply(null,arguments)};e.asm=kd;e.cwrap=function(a,b,c,d){c=c||[];var f=c.every(function(g){return"number"===g});return"string"!==b&&f&&!d?Wa(a):function(){return Xa(a,b,c,arguments)}};e.stackSave=ja;e.stackRestore=qa;e.stackAlloc=t;var ld;ob=function md(){ld||nd();ld||(ob=md)}; -function nd(){function a(){if(!ld&&(ld=!0,e.calledRun=!0,!Va)){e.noFSInit||tc||(tc=!0,sc(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?Rc("stdin",e.stdin):kc("/dev/tty","/dev/stdin"),e.stdout?Rc("stdout",null,e.stdout):kc("/dev/tty","/dev/stdout"),e.stderr?Rc("stderr",null,e.stderr):kc("/dev/tty1","/dev/stderr"),l("/dev/stdin","r"),l("/dev/stdout","w"),l("/dev/stderr","w"));gb(ib);Ub=!1;gb(jb);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for("function"==typeof e.postRun&& -(e.postRun=[e.postRun]);e.postRun.length;){var b=e.postRun.shift();kb.unshift(b)}gb(kb)}}if(!(0