diff --git a/experimental/http_get_cache/.flutter-plugins b/experimental/http_get_cache/.flutter-plugins new file mode 100644 index 0000000..762a32b --- /dev/null +++ b/experimental/http_get_cache/.flutter-plugins @@ -0,0 +1,7 @@ +# This is a generated file; do not edit or check into version control. +path_provider=/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider-2.1.4/ +path_provider_android=/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/ +path_provider_foundation=/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/ +path_provider_linux=/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/ +path_provider_windows=/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/ +sqlite3_flutter_libs=/Users/rodydavis/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.24/ diff --git a/experimental/http_get_cache/.flutter-plugins-dependencies b/experimental/http_get_cache/.flutter-plugins-dependencies new file mode 100644 index 0000000..bead3b5 --- /dev/null +++ b/experimental/http_get_cache/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.41/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"path_provider_android","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_android-2.2.22/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.41/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"path_provider_foundation","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.41/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.41/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"path_provider_windows","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/rodydavis/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.41/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqlite3_flutter_libs","dependencies":[]}],"date_created":"2026-01-20 22:45:38.501579","version":"3.38.5","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/experimental/http_get_cache/.gitignore b/experimental/http_get_cache/.gitignore new file mode 100644 index 0000000..134d6a8 --- /dev/null +++ b/experimental/http_get_cache/.gitignore @@ -0,0 +1,30 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ +temp/ diff --git a/experimental/http_get_cache/.metadata b/experimental/http_get_cache/.metadata new file mode 100644 index 0000000..8f7b6ac --- /dev/null +++ b/experimental/http_get_cache/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49" + channel: "stable" + +project_type: package diff --git a/experimental/http_get_cache/.vscode/settings.json b/experimental/http_get_cache/.vscode/settings.json new file mode 100644 index 0000000..65e20e7 --- /dev/null +++ b/experimental/http_get_cache/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [ + "Microtask", + "todos" + ] +} \ No newline at end of file diff --git a/experimental/http_get_cache/CHANGELOG.md b/experimental/http_get_cache/CHANGELOG.md new file mode 100644 index 0000000..e237bbc --- /dev/null +++ b/experimental/http_get_cache/CHANGELOG.md @@ -0,0 +1,11 @@ +## 0.1.0 + +* **Breaking**: Updated package dependencies to latest versions. +* **Feat**: Added support for `Vary` header caching. +* **Feat**: Added database schema migration strategy. +* **Docs**: Updated README with Native Networking guide and Web platform warning. +* **UI**: Modernized example application UI. + +## 0.0.1 + +* Initial release. diff --git a/experimental/http_get_cache/LICENSE b/experimental/http_get_cache/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/experimental/http_get_cache/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/experimental/http_get_cache/README.md b/experimental/http_get_cache/README.md new file mode 100644 index 0000000..9e5f67d --- /dev/null +++ b/experimental/http_get_cache/README.md @@ -0,0 +1,190 @@ +# http_get_cache + +[![Pub](https://img.shields.io/pub/v/http_get_cache.svg)](https://pub.dev/packages/http_get_cache) + +A robust, HTTP-compliant caching library for Flutter and Dart. `http_get_cache` wraps the standard [`http`](https://pub.dev/packages/http) package to automatically cache GET requests based on `Cache-Control`, `Vary`, `ETag`, and `Last-Modified` headers. + +It uses **SQLite** (via [`drift`](https://pub.dev/packages/drift)) for metadata storage and the file system for caching response bodies, ensuring separate, non-blocking storage. + +## Features + +- 🚀 **HTTP Client Wrapper**: Drop-in replacement for `http.Client`. +- 💾 **Persistent Caching**: Stores cache data in SQLite and files on disk. +- 🌍 **Vary Header Support**: Caches variations of responses based on request headers (e.g., `User-Agent`). +- 🔄 **Standard Compliant**: Respects `max-age`, `no-cache`, `no-store`, `stale-while-revalidate`, and more. +- 🖼️ **HttpImageProvider**: A cached `ImageProvider` for Flutter. +- 📱 **Cross Platform**: Works on Android, iOS, macOS, Windows, and Linux. + +> [!WARNING] +> This package **does not support Web**. On Web, `http_get_cache` logic is disabled. +> You should use the [`fetch_client`](https://pub.dev/packages/fetch_client) package instead, which leverages the browser's native caching capabilities. + +## Installation + +Add the dependency to your `pubspec.yaml`: + +```yaml +dependencies: + http_get_cache: ^latest_version +``` + +## Usage + +### 1. Initialization + +You must initialize the cache database before making requests. + +**Flutter:** + +```dart +import 'package:flutter/material.dart'; +import 'package:http_get_cache/http_get_cache_flutter.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + + // Initialize caching with default paths + await initFlutterHttpGetCache(); + + runApp(const MyApp()); +} +``` + +**Dart (Standalone):** + +```dart +import 'package:http_get_cache/http_get_cache.dart'; + +void main() async { + await initHttpGetCache( + cachePath: './.cache', + databasePath: './.db', + ); +} +``` + +### 2. Making Requests + +Use the global `httpClient()` helper to get a `Client` that handles caching automatically. + +```dart +import 'package:http_get_cache/http_get_cache.dart'; + +Future fetchData() async { + final client = httpClient(); + + // This request will be cached if headers allow it + final response = await client.get(Uri.parse('https://jsonplaceholder.typicode.com/posts/1')); + + if (response.statusCode == 200) { + print('Response: ${response.body}'); + } + + client.close(); +} +``` + +### 3. Caching Images in Flutter + +Use `HttpImageProvider` to load and cache images efficiently. + +```dart +import 'package:flutter/material.dart'; +import 'package:http_get_cache/http_image_provider.dart'; + +class MyImageWidget extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Image( + image: HttpImageProvider( + Uri.parse('https://via.placeholder.com/150'), + ), + ); + } +} +``` + +## How It Works + +This package implements most of [RFC 7234](https://httpwg.org/specs/rfc7234.html). + +1. **Cache-Control**: Checks `max-age` to determine if a cached response is still fresh. +2. **Stale-While-Revalidate**: Can return stale content while updating the cache in the background. +3. **Vary**: Stores distinct cache entries if the server response includes a `Vary` header (e.g. varying by `Accept-Language`). +4. **Revalidation**: Uses `ETag` and `Last-Modified` to check with the server if the cached content has changed (Returns `304 Not Modified` if valid). + +## Web Support + +This package is designed for native platforms where persistent HTTP caching is not built-in. + +**On Web**, browsers handle caching automatically via the `Fetch API`. Using this package on Web adds unnecessary overhead as the internal caching logic is disabled (`kIsWeb` checks). + +**Recommendation:** +Use [fetch_client](https://pub.dev/packages/fetch_client) directly for Web applications. + +## Advanced Usage + +### Custom Client +You can use a custom inner client (e.g. `http.Client`, `RetryClient`) with `HttpGetCache`. + +```dart +import 'package:http/http.dart' as http; +import 'package:http_get_cache/http_get_cache.dart'; + +void main() async { + final db = await initFlutterHttpGetCache(); + final store = SqliteHttpCacheStore(db); + + final client = HttpGetCache( + http.Client(), // Inner client + store, + ); + + // Use client... +} + +``` + +### Native Networking + +To improve performance on mobile devices (e.g. HTTP/3 support), you can provide a native HTTP client to `httpClient`: + +1. Add dependencies: `cronet_http` and `cupertino_http`. +2. Pass the native client as `innerClient`. + +```dart +import 'dart:io'; +import 'package:cronet_http/cronet_http.dart'; +import 'package:cupertino_http/cupertino_http.dart'; +import 'package:http/http.dart'; +import 'package:http_get_cache/http_get_cache.dart'; + +Client getNativeClient() { + if (Platform.isAndroid) { + return CronetClient.defaultCronetEngine(); + } + if (Platform.isIOS || Platform.isMacOS) { + return CupertinoClient.defaultSessionConfiguration(); + } + return Client(); +} + +void main() async { + await initFlutterHttpGetCache(); + + final client = httpClient( + innerClient: getNativeClient(), + ); +} +``` + +### Platform Support + +| Platform | Support | Storage | +| :--- | :--- | :--- | +| **Android** | ✅ | SQLite + File System | +| **iOS** | ✅ | SQLite + File System | +| **macOS** | ✅ | SQLite + File System | +| **Windows** | ✅ | SQLite + File System | +| **Linux** | ✅ | SQLite + File System | +| **Web** | ⚠️ | **Not Supported** (Use `fetch_client`) | diff --git a/experimental/http_get_cache/analysis_options.yaml b/experimental/http_get_cache/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/experimental/http_get_cache/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/experimental/http_get_cache/build.yaml b/experimental/http_get_cache/build.yaml new file mode 100644 index 0000000..01bede2 --- /dev/null +++ b/experimental/http_get_cache/build.yaml @@ -0,0 +1,30 @@ +# This configures how `build_runner` and associated builders should behave. +# For more information, see https://pub.dev/packages/build_config +targets: + $default: + # Reducing sources makes the build slightly faster (some of these are required + # to exist in the default target). + sources: + - lib/** + - web/** + - "tool/**" + - pubspec.yaml + - lib/$lib$ + - $package$ + builders: + drift_dev: + # These options change how drift generates code + options: + # Drift analyzes SQL queries at compile-time. For this purpose, it needs to know which sqlite3 + # features will be available. We depend on `sqlite3_flutter_libs`, which lets us use the latest + # version with fts5 enabled. + override_hash_and_equals_in_result_sets: true + apply_converters_on_variables: true + store_date_time_values_as_text: true + mutable_classes: true + named_parameters: true + sql: + dialect: sqlite + options: + version: "3.38" + modules: [fts5, json1] diff --git a/experimental/http_get_cache/example/.gitignore b/experimental/http_get_cache/example/.gitignore new file mode 100644 index 0000000..29a3a50 --- /dev/null +++ b/experimental/http_get_cache/example/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/experimental/http_get_cache/example/.metadata b/experimental/http_get_cache/example/.metadata new file mode 100644 index 0000000..6eb54a1 --- /dev/null +++ b/experimental/http_get_cache/example/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + - platform: android + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + - platform: ios + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + - platform: linux + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + - platform: macos + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + - platform: web + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + - platform: windows + create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/experimental/http_get_cache/example/README.md b/experimental/http_get_cache/example/README.md new file mode 100644 index 0000000..1b7a4e3 --- /dev/null +++ b/experimental/http_get_cache/example/README.md @@ -0,0 +1,3 @@ +# example + +A new Flutter project. diff --git a/experimental/http_get_cache/example/analysis_options.yaml b/experimental/http_get_cache/example/analysis_options.yaml new file mode 100644 index 0000000..f9b3034 --- /dev/null +++ b/experimental/http_get_cache/example/analysis_options.yaml @@ -0,0 +1 @@ +include: package:flutter_lints/flutter.yaml diff --git a/experimental/http_get_cache/example/android/.gitignore b/experimental/http_get_cache/example/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/experimental/http_get_cache/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/experimental/http_get_cache/example/android/app/build.gradle b/experimental/http_get_cache/example/android/app/build.gradle new file mode 100644 index 0000000..2a2d082 --- /dev/null +++ b/experimental/http_get_cache/example/android/app/build.gradle @@ -0,0 +1,58 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file("local.properties") +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader("UTF-8") { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") +if (flutterVersionCode == null) { + flutterVersionCode = "1" +} + +def flutterVersionName = localProperties.getProperty("flutter.versionName") +if (flutterVersionName == null) { + flutterVersionName = "1.0" +} + +android { + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.debug + } + } +} + +flutter { + source = "../.." +} diff --git a/experimental/http_get_cache/example/android/app/src/debug/AndroidManifest.xml b/experimental/http_get_cache/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/experimental/http_get_cache/example/android/app/src/main/AndroidManifest.xml b/experimental/http_get_cache/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..74a78b9 --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/experimental/http_get_cache/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 0000000..70f8f08 --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/experimental/http_get_cache/example/android/app/src/main/res/drawable-v21/launch_background.xml b/experimental/http_get_cache/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/experimental/http_get_cache/example/android/app/src/main/res/drawable/launch_background.xml b/experimental/http_get_cache/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/experimental/http_get_cache/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/experimental/http_get_cache/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/experimental/http_get_cache/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/experimental/http_get_cache/example/android/app/src/main/res/values-night/styles.xml b/experimental/http_get_cache/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/experimental/http_get_cache/example/android/app/src/main/res/values/styles.xml b/experimental/http_get_cache/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/experimental/http_get_cache/example/android/app/src/profile/AndroidManifest.xml b/experimental/http_get_cache/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/experimental/http_get_cache/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/experimental/http_get_cache/example/android/build.gradle b/experimental/http_get_cache/example/android/build.gradle new file mode 100644 index 0000000..d2ffbff --- /dev/null +++ b/experimental/http_get_cache/example/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = "../build" +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/experimental/http_get_cache/example/android/gradle.properties b/experimental/http_get_cache/example/android/gradle.properties new file mode 100644 index 0000000..3b5b324 --- /dev/null +++ b/experimental/http_get_cache/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/experimental/http_get_cache/example/android/gradle/wrapper/gradle-wrapper.properties b/experimental/http_get_cache/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..aa49780 --- /dev/null +++ b/experimental/http_get_cache/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip diff --git a/experimental/http_get_cache/example/android/settings.gradle b/experimental/http_get_cache/example/android/settings.gradle new file mode 100644 index 0000000..536165d --- /dev/null +++ b/experimental/http_get_cache/example/android/settings.gradle @@ -0,0 +1,25 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/experimental/http_get_cache/example/ios/.gitignore b/experimental/http_get_cache/example/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/experimental/http_get_cache/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/experimental/http_get_cache/example/ios/Flutter/AppFrameworkInfo.plist b/experimental/http_get_cache/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..7c56964 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/experimental/http_get_cache/example/ios/Flutter/Debug.xcconfig b/experimental/http_get_cache/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/experimental/http_get_cache/example/ios/Flutter/Release.xcconfig b/experimental/http_get_cache/example/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/experimental/http_get_cache/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/experimental/http_get_cache/example/ios/Podfile b/experimental/http_get_cache/example/ios/Podfile new file mode 100644 index 0000000..d97f17e --- /dev/null +++ b/experimental/http_get_cache/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.pbxproj b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3d07fb6 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,619 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 9FK3425VTA; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 9FK3425VTA; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 9FK3425VTA; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/experimental/http_get_cache/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/experimental/http_get_cache/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..8e3ca5d --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/experimental/http_get_cache/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/experimental/http_get_cache/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/experimental/http_get_cache/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/experimental/http_get_cache/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/experimental/http_get_cache/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/experimental/http_get_cache/example/ios/Runner/AppDelegate.swift b/experimental/http_get_cache/example/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..9074fee --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/experimental/http_get_cache/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/experimental/http_get_cache/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/ios/Runner/Base.lproj/Main.storyboard b/experimental/http_get_cache/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/ios/Runner/Info.plist b/experimental/http_get_cache/example/ios/Runner/Info.plist new file mode 100644 index 0000000..5458fc4 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/experimental/http_get_cache/example/ios/Runner/Runner-Bridging-Header.h b/experimental/http_get_cache/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/experimental/http_get_cache/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/experimental/http_get_cache/example/ios/RunnerTests/RunnerTests.swift b/experimental/http_get_cache/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/experimental/http_get_cache/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/experimental/http_get_cache/example/lib/main.dart b/experimental/http_get_cache/example/lib/main.dart new file mode 100644 index 0000000..b1338a8 --- /dev/null +++ b/experimental/http_get_cache/example/lib/main.dart @@ -0,0 +1,222 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:http_get_cache/http_get_cache.dart'; +import 'package:http_get_cache/http_get_cache_flutter.dart'; +import 'package:http_get_cache/http_image_provider.dart'; +import 'package:signals/signals_flutter.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await initFlutterHttpGetCache(); + runApp(const MainApp()); +} + +class MainApp extends StatefulWidget { + const MainApp({super.key}); + + @override + State createState() => _MainAppState(); +} + +class _MainAppState extends State { + final client = httpClient(); + + static const target = 'https://jsonplaceholder.typicode.com/photos'; + final requestCount$ = signal(0); + + // We limit to 50 items for the demo to keep it snappy and focused + late final items$ = client + .get(Uri.parse(target)) + .then((res) => res.statusCode == 200 ? jsonDecode(res.body) as List : []) + .then((items) => items.take(50).cast>().toList()) + .then( + (r) => () { + requestCount$.value++; + return r; + }(), + ) + .toFutureSignal(); + + @override + Widget build(BuildContext context) { + final state = items$.watch(context); + final count = requestCount$.watch(context); + + return MaterialApp( + debugShowCheckedModeBanner: false, + themeMode: ThemeMode.system, + theme: ThemeData( + useMaterial3: true, + colorScheme: ColorScheme.fromSeed( + seedColor: const Color(0xFF6750A4), + brightness: Brightness.light, + ), + ), + darkTheme: ThemeData( + useMaterial3: true, + colorScheme: ColorScheme.fromSeed( + seedColor: const Color(0xFFD0BCFF), + brightness: Brightness.dark, + ), + ), + home: Scaffold( + body: CustomScrollView( + slivers: [ + SliverAppBar.large( + title: const Text('Http Get Cache'), + actions: [ + Center( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Badge( + label: Text('$count'), + child: const Icon(Icons.cloud_sync_outlined), + ), + ), + ), + ], + ), + state.map( + data: (items) { + if (items.isEmpty) { + return const SliverFillRemaining( + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.inbox_outlined, + size: 64, color: Colors.grey), + SizedBox(height: 16), + Text( + 'No items found', + style: TextStyle(fontSize: 18, color: Colors.grey), + ), + ], + ), + ), + ); + } + return SliverPadding( + padding: const EdgeInsets.all(16.0), + sliver: SliverGrid( + gridDelegate: + const SliverGridDelegateWithMaxCrossAxisExtent( + maxCrossAxisExtent: 300, + mainAxisSpacing: 16, + crossAxisSpacing: 16, + childAspectRatio: 0.8, + ), + delegate: SliverChildBuilderDelegate( + (context, index) { + final item = items[index]; + final title = item['title'] as String; + final url = item['url'] as String; + // Use a deterministic random height for a staggered-like feel if we were using masonry, + // but for standard grid, we keep uniform aspect ratio. + // We'll use the ID to pick a color for the placeholder. + final id = item['id'] as int; + final color = + Colors.primaries[id % Colors.primaries.length]; + + return Card( + elevation: 2, + clipBehavior: Clip.antiAlias, + child: Stack( + fit: StackFit.expand, + children: [ + Image( + image: HttpImageProvider( + Uri.parse(url), + client: client, + ), + fit: BoxFit.cover, + loadingBuilder: + (context, child, loadingProgress) { + if (loadingProgress == null) return child; + return Container( + color: color.withValues(alpha: 0.1), + child: const Center( + child: CircularProgressIndicator(), + ), + ); + }, + errorBuilder: (context, error, stackTrace) { + return Container( + color: color.withValues(alpha: 0.2), + child: const Icon( + Icons.broken_image_outlined, + size: 48), + ); + }, + ), + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Colors.transparent, + Colors.black87, + ], + ), + ), + padding: const EdgeInsets.all(12.0), + child: Text( + title, + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + ), + ], + ), + ); + }, + childCount: items.length, + ), + ), + ); + }, + error: (error) => SliverFillRemaining( + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(Icons.error_outline, + size: 64, color: Colors.red), + const SizedBox(height: 16), + Text('Error: $error', textAlign: TextAlign.center), + const SizedBox(height: 16), + FilledButton.icon( + onPressed: () => items$.refresh(), + icon: const Icon(Icons.refresh), + label: const Text('Retry'), + ), + ], + ), + ), + ), + loading: () => const SliverFillRemaining( + child: Center(child: CircularProgressIndicator()), + ), + ), + ], + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () => items$.refresh(), + icon: const Icon(Icons.refresh), + label: const Text('Refresh Data'), + ), + ), + ); + } +} diff --git a/experimental/http_get_cache/example/linux/.gitignore b/experimental/http_get_cache/example/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/experimental/http_get_cache/example/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/experimental/http_get_cache/example/linux/CMakeLists.txt b/experimental/http_get_cache/example/linux/CMakeLists.txt new file mode 100644 index 0000000..9cb0d1d --- /dev/null +++ b/experimental/http_get_cache/example/linux/CMakeLists.txt @@ -0,0 +1,145 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "example") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/experimental/http_get_cache/example/linux/flutter/CMakeLists.txt b/experimental/http_get_cache/example/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..d5bd016 --- /dev/null +++ b/experimental/http_get_cache/example/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/experimental/http_get_cache/example/linux/flutter/generated_plugin_registrant.cc b/experimental/http_get_cache/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..2c1ec4f --- /dev/null +++ b/experimental/http_get_cache/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); + sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); +} diff --git a/experimental/http_get_cache/example/linux/flutter/generated_plugin_registrant.h b/experimental/http_get_cache/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/experimental/http_get_cache/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/experimental/http_get_cache/example/linux/flutter/generated_plugins.cmake b/experimental/http_get_cache/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..7ea2a80 --- /dev/null +++ b/experimental/http_get_cache/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + sqlite3_flutter_libs +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/experimental/http_get_cache/example/linux/main.cc b/experimental/http_get_cache/example/linux/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/experimental/http_get_cache/example/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/experimental/http_get_cache/example/linux/my_application.cc b/experimental/http_get_cache/example/linux/my_application.cc new file mode 100644 index 0000000..c0530d4 --- /dev/null +++ b/experimental/http_get_cache/example/linux/my_application.cc @@ -0,0 +1,124 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "example"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/experimental/http_get_cache/example/linux/my_application.h b/experimental/http_get_cache/example/linux/my_application.h new file mode 100644 index 0000000..72271d5 --- /dev/null +++ b/experimental/http_get_cache/example/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/experimental/http_get_cache/example/macos/.gitignore b/experimental/http_get_cache/example/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/experimental/http_get_cache/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/experimental/http_get_cache/example/macos/Flutter/Flutter-Debug.xcconfig b/experimental/http_get_cache/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/experimental/http_get_cache/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/experimental/http_get_cache/example/macos/Flutter/Flutter-Release.xcconfig b/experimental/http_get_cache/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..d495280 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/experimental/http_get_cache/example/macos/Flutter/GeneratedPluginRegistrant.swift b/experimental/http_get_cache/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..a76a051 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import sqlite3_flutter_libs + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) +} diff --git a/experimental/http_get_cache/example/macos/Podfile b/experimental/http_get_cache/example/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/experimental/http_get_cache/example/macos/Podfile.lock b/experimental/http_get_cache/example/macos/Podfile.lock new file mode 100644 index 0000000..8d44ecc --- /dev/null +++ b/experimental/http_get_cache/example/macos/Podfile.lock @@ -0,0 +1,56 @@ +PODS: + - cupertino_http (0.0.1): + - FlutterMacOS + - FlutterMacOS (1.0.0) + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - "sqlite3 (3.46.0+1)": + - "sqlite3/common (= 3.46.0+1)" + - "sqlite3/common (3.46.0+1)" + - "sqlite3/dbstatvtab (3.46.0+1)": + - sqlite3/common + - "sqlite3/fts5 (3.46.0+1)": + - sqlite3/common + - "sqlite3/perf-threadsafe (3.46.0+1)": + - sqlite3/common + - "sqlite3/rtree (3.46.0+1)": + - sqlite3/common + - sqlite3_flutter_libs (0.0.1): + - FlutterMacOS + - "sqlite3 (~> 3.46.0+1)" + - sqlite3/dbstatvtab + - sqlite3/fts5 + - sqlite3/perf-threadsafe + - sqlite3/rtree + +DEPENDENCIES: + - cupertino_http (from `Flutter/ephemeral/.symlinks/plugins/cupertino_http/macos`) + - FlutterMacOS (from `Flutter/ephemeral`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`) + +SPEC REPOS: + trunk: + - sqlite3 + +EXTERNAL SOURCES: + cupertino_http: + :path: Flutter/ephemeral/.symlinks/plugins/cupertino_http/macos + FlutterMacOS: + :path: Flutter/ephemeral + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + sqlite3_flutter_libs: + :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos + +SPEC CHECKSUMS: + cupertino_http: 1d506209e339211efa0764caa7b2de4bc55b6818 + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630 + sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b + +PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 + +COCOAPODS: 1.14.3 diff --git a/experimental/http_get_cache/example/macos/Runner.xcodeproj/project.pbxproj b/experimental/http_get_cache/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ba8fbd8 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,801 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 074CF984A91057E941EEE73C /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69FE33FADD7FC0F5D18BA539 /* Pods_RunnerTests.framework */; }; + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + FBCE14358C8D4F52CEE3840F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C79B05C2069EFDB77890EFEF /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 027D44E704C19D3FB3AB9F69 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 11470187A0A4BB27CF093CE4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 649D5F9C2EDD38C07C58A1DD /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 69FE33FADD7FC0F5D18BA539 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + ADD41B185F859BCE924EFED3 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + C79B05C2069EFDB77890EFEF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D012884557B1087627B0947B /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + E663B22DCC569136517CEE35 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 074CF984A91057E941EEE73C /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FBCE14358C8D4F52CEE3840F /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 8B4B97E465317603E70CFC94 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* example.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 8B4B97E465317603E70CFC94 /* Pods */ = { + isa = PBXGroup; + children = ( + 11470187A0A4BB27CF093CE4 /* Pods-Runner.debug.xcconfig */, + 649D5F9C2EDD38C07C58A1DD /* Pods-Runner.release.xcconfig */, + 027D44E704C19D3FB3AB9F69 /* Pods-Runner.profile.xcconfig */, + E663B22DCC569136517CEE35 /* Pods-RunnerTests.debug.xcconfig */, + D012884557B1087627B0947B /* Pods-RunnerTests.release.xcconfig */, + ADD41B185F859BCE924EFED3 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C79B05C2069EFDB77890EFEF /* Pods_Runner.framework */, + 69FE33FADD7FC0F5D18BA539 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 014BCC003C5148098362C3C5 /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + D2F43A3D0FD807C1023F7099 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 27EA7637625ECEA8711C8E13 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 014BCC003C5148098362C3C5 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 27EA7637625ECEA8711C8E13 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + D2F43A3D0FD807C1023F7099 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E663B22DCC569136517CEE35 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D012884557B1087627B0947B /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ADD41B185F859BCE924EFED3 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/experimental/http_get_cache/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/experimental/http_get_cache/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/experimental/http_get_cache/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/experimental/http_get_cache/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..15368ec --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/experimental/http_get_cache/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/experimental/http_get_cache/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/experimental/http_get_cache/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/experimental/http_get_cache/example/macos/Runner/AppDelegate.swift b/experimental/http_get_cache/example/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..d53ef64 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/experimental/http_get_cache/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/experimental/http_get_cache/example/macos/Runner/Base.lproj/MainMenu.xib b/experimental/http_get_cache/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/macos/Runner/Configs/AppInfo.xcconfig b/experimental/http_get_cache/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..92fb3cd --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.example + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. diff --git a/experimental/http_get_cache/example/macos/Runner/Configs/Debug.xcconfig b/experimental/http_get_cache/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/experimental/http_get_cache/example/macos/Runner/Configs/Release.xcconfig b/experimental/http_get_cache/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/experimental/http_get_cache/example/macos/Runner/Configs/Warnings.xcconfig b/experimental/http_get_cache/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/experimental/http_get_cache/example/macos/Runner/DebugProfile.entitlements b/experimental/http_get_cache/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..3ba6c12 --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.client + + com.apple.security.network.server + + + diff --git a/experimental/http_get_cache/example/macos/Runner/Info.plist b/experimental/http_get_cache/example/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/experimental/http_get_cache/example/macos/Runner/MainFlutterWindow.swift b/experimental/http_get_cache/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/experimental/http_get_cache/example/macos/Runner/Release.entitlements b/experimental/http_get_cache/example/macos/Runner/Release.entitlements new file mode 100644 index 0000000..7a2230d --- /dev/null +++ b/experimental/http_get_cache/example/macos/Runner/Release.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + + diff --git a/experimental/http_get_cache/example/macos/RunnerTests/RunnerTests.swift b/experimental/http_get_cache/example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/experimental/http_get_cache/example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/experimental/http_get_cache/example/pubspec.yaml b/experimental/http_get_cache/example/pubspec.yaml new file mode 100644 index 0000000..5c85693 --- /dev/null +++ b/experimental/http_get_cache/example/pubspec.yaml @@ -0,0 +1,26 @@ +name: example +description: "A new Flutter project." +publish_to: 'none' +version: 0.1.0 + +environment: + sdk: '>=3.4.3 <4.0.0' + +dependencies: + http_get_cache: + path: .. + flutter: + sdk: flutter + drift: ^2.24.2 + drift_flutter: ^0.2.8 + signals: ^5.5.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + drift_dev: ^2.24.2 + build_runner: ^2.4.11 + +flutter: + uses-material-design: true diff --git a/experimental/http_get_cache/example/web/drift_worker.js b/experimental/http_get_cache/example/web/drift_worker.js new file mode 100644 index 0000000..60cbff0 --- /dev/null +++ b/experimental/http_get_cache/example/web/drift_worker.js @@ -0,0 +1,29608 @@ +// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.4.3. +// The code supports the following hooks: +// dartPrint(message): +// if this function is defined it is called instead of the Dart [print] +// method. +// +// dartMainRunner(main, args): +// if this function is defined, the Dart [main] method will not be invoked +// directly. Instead, a closure that will invoke [main], and its arguments +// [args] is passed to [dartMainRunner]. +// +// dartDeferredLibraryLoader(uri, successCallback, errorCallback, loadId, loadPriority): +// if this function is defined, it will be called when a deferred library +// is loaded. It should load and eval the javascript of `uri`, and call +// successCallback. If it fails to do so, it should call errorCallback with +// an error. The loadId argument is the deferred import that resulted in +// this uri being loaded. The loadPriority argument is the priority the +// library should be loaded with as specified in the code via the +// load-priority annotation (0: normal, 1: high). +// dartDeferredLibraryMultiLoader(uris, successCallback, errorCallback, loadId, loadPriority): +// if this function is defined, it will be called when a deferred library +// is loaded. It should load and eval the javascript of every URI in `uris`, +// and call successCallback. If it fails to do so, it should call +// errorCallback with an error. The loadId argument is the deferred import +// that resulted in this uri being loaded. The loadPriority argument is the +// priority the library should be loaded with as specified in the code via +// the load-priority annotation (0: normal, 1: high). +// +// dartCallInstrumentation(id, qualifiedName): +// if this function is defined, it will be called at each entry of a +// method or constructor. Used only when compiling programs with +// --experiment-call-instrumentation. +(function dartProgram() { + function copyProperties(from, to) { + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + to[key] = from[key]; + } + } + function mixinPropertiesHard(from, to) { + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!to.hasOwnProperty(key)) { + to[key] = from[key]; + } + } + } + function mixinPropertiesEasy(from, to) { + Object.assign(to, from); + } + var supportsDirectProtoAccess = function() { + var cls = function() { + }; + cls.prototype = {p: {}}; + var object = new cls(); + if (!(Object.getPrototypeOf(object) && Object.getPrototypeOf(object).p === cls.prototype.p)) + return false; + try { + if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0) + return true; + if (typeof version == "function" && version.length == 0) { + var v = version(); + if (/^\d+\.\d+\.\d+\.\d+$/.test(v)) + return true; + } + } catch (_) { + } + return false; + }(); + function inherit(cls, sup) { + cls.prototype.constructor = cls; + cls.prototype["$is" + cls.name] = cls; + if (sup != null) { + if (supportsDirectProtoAccess) { + Object.setPrototypeOf(cls.prototype, sup.prototype); + return; + } + var clsPrototype = Object.create(sup.prototype); + copyProperties(cls.prototype, clsPrototype); + cls.prototype = clsPrototype; + } + } + function inheritMany(sup, classes) { + for (var i = 0; i < classes.length; i++) { + inherit(classes[i], sup); + } + } + function mixinEasy(cls, mixin) { + mixinPropertiesEasy(mixin.prototype, cls.prototype); + cls.prototype.constructor = cls; + } + function mixinHard(cls, mixin) { + mixinPropertiesHard(mixin.prototype, cls.prototype); + cls.prototype.constructor = cls; + } + function lazy(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + if (holder[name] === uninitializedSentinel) { + holder[name] = initializer(); + } + holder[getterName] = function() { + return this[name]; + }; + return holder[name]; + }; + } + function lazyFinal(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + if (holder[name] === uninitializedSentinel) { + var value = initializer(); + if (holder[name] !== uninitializedSentinel) { + A.throwLateFieldADI(name); + } + holder[name] = value; + } + var finalValue = holder[name]; + holder[getterName] = function() { + return finalValue; + }; + return finalValue; + }; + } + function makeConstList(list) { + list.immutable$list = Array; + list.fixed$length = Array; + return list; + } + function convertToFastObject(properties) { + function t() { + } + t.prototype = properties; + new t(); + return properties; + } + function convertAllToFastObject(arrayOfObjects) { + for (var i = 0; i < arrayOfObjects.length; ++i) { + convertToFastObject(arrayOfObjects[i]); + } + } + var functionCounter = 0; + function instanceTearOffGetter(isIntercepted, parameters) { + var cache = null; + return isIntercepted ? function(receiver) { + if (cache === null) + cache = A.closureFromTearOff(parameters); + return new cache(receiver, this); + } : function() { + if (cache === null) + cache = A.closureFromTearOff(parameters); + return new cache(this, null); + }; + } + function staticTearOffGetter(parameters) { + var cache = null; + return function() { + if (cache === null) + cache = A.closureFromTearOff(parameters).prototype; + return cache; + }; + } + var typesOffset = 0; + function tearOffParameters(container, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { + if (typeof funType == "number") { + funType += typesOffset; + } + return {co: container, iS: isStatic, iI: isIntercepted, rC: requiredParameterCount, dV: optionalParameterDefaultValues, cs: callNames, fs: funsOrNames, fT: funType, aI: applyIndex || 0, nDA: needsDirectAccess}; + } + function installStaticTearOff(holder, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { + var parameters = tearOffParameters(holder, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, false); + var getterFunction = staticTearOffGetter(parameters); + holder[getterName] = getterFunction; + } + function installInstanceTearOff(prototype, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { + isIntercepted = !!isIntercepted; + var parameters = tearOffParameters(prototype, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, !!needsDirectAccess); + var getterFunction = instanceTearOffGetter(isIntercepted, parameters); + prototype[getterName] = getterFunction; + } + function setOrUpdateInterceptorsByTag(newTags) { + var tags = init.interceptorsByTag; + if (!tags) { + init.interceptorsByTag = newTags; + return; + } + copyProperties(newTags, tags); + } + function setOrUpdateLeafTags(newTags) { + var tags = init.leafTags; + if (!tags) { + init.leafTags = newTags; + return; + } + copyProperties(newTags, tags); + } + function updateTypes(newTypes) { + var types = init.types; + var length = types.length; + types.push.apply(types, newTypes); + return length; + } + function updateHolder(holder, newHolder) { + copyProperties(newHolder, holder); + return holder; + } + var hunkHelpers = function() { + var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { + return function(container, getterName, name, funType) { + return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex, false); + }; + }, + mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { + return function(container, getterName, name, funType) { + return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex); + }; + }; + return {inherit: inherit, inheritMany: inheritMany, mixin: mixinEasy, mixinHard: mixinHard, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, lazyFinal: lazyFinal, updateHolder: updateHolder, convertToFastObject: convertToFastObject, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags}; + }(); + function initializeDeferredHunk(hunk) { + typesOffset = init.types.length; + hunk(hunkHelpers, init, holders, $); + } + var J = { + makeDispatchRecord(interceptor, proto, extension, indexability) { + return {i: interceptor, p: proto, e: extension, x: indexability}; + }, + getNativeInterceptor(object) { + var proto, objectProto, $constructor, interceptor, t1, + record = object[init.dispatchPropertyName]; + if (record == null) + if ($.initNativeDispatchFlag == null) { + A.initNativeDispatch(); + record = object[init.dispatchPropertyName]; + } + if (record != null) { + proto = record.p; + if (false === proto) + return record.i; + if (true === proto) + return object; + objectProto = Object.getPrototypeOf(object); + if (proto === objectProto) + return record.i; + if (record.e === objectProto) + throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record)))); + } + $constructor = object.constructor; + if ($constructor == null) + interceptor = null; + else { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + interceptor = $constructor[t1]; + } + if (interceptor != null) + return interceptor; + interceptor = A.lookupAndCacheInterceptor(object); + if (interceptor != null) + return interceptor; + if (typeof object == "function") + return B.JavaScriptFunction_methods; + proto = Object.getPrototypeOf(object); + if (proto == null) + return B.PlainJavaScriptObject_methods; + if (proto === Object.prototype) + return B.PlainJavaScriptObject_methods; + if (typeof $constructor == "function") { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true}); + return B.UnknownJavaScriptObject_methods; + } + return B.UnknownJavaScriptObject_methods; + }, + JSArray_JSArray$fixed($length, $E) { + if ($length < 0 || $length > 4294967295) + throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null)); + return J.JSArray_JSArray$markFixed(new Array($length), $E); + }, + JSArray_JSArray$growable($length, $E) { + if ($length < 0) + throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); + return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); + }, + JSArray_JSArray$allocateGrowable($length, $E) { + if ($length < 0) + throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); + return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); + }, + JSArray_JSArray$markFixed(allocation, $E) { + return J.JSArray_markFixedList(A._setArrayType(allocation, $E._eval$1("JSArray<0>")), $E); + }, + JSArray_markFixedList(list, $T) { + list.fixed$length = Array; + return list; + }, + JSArray_markUnmodifiableList(list) { + list.fixed$length = Array; + list.immutable$list = Array; + return list; + }, + JSArray__compareAny(a, b) { + var t1 = type$.Comparable_dynamic; + return J.compareTo$1$ns(t1._as(a), t1._as(b)); + }, + JSString__isWhitespace(codeUnit) { + if (codeUnit < 256) + switch (codeUnit) { + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: + case 133: + case 160: + return true; + default: + return false; + } + switch (codeUnit) { + case 5760: + case 8192: + case 8193: + case 8194: + case 8195: + case 8196: + case 8197: + case 8198: + case 8199: + case 8200: + case 8201: + case 8202: + case 8232: + case 8233: + case 8239: + case 8287: + case 12288: + case 65279: + return true; + default: + return false; + } + }, + JSString__skipLeadingWhitespace(string, index) { + var t1, codeUnit; + for (t1 = string.length; index < t1;) { + codeUnit = string.charCodeAt(index); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + ++index; + } + return index; + }, + JSString__skipTrailingWhitespace(string, index) { + var t1, index0, codeUnit; + for (t1 = string.length; index > 0; index = index0) { + index0 = index - 1; + if (!(index0 < t1)) + return A.ioore(string, index0); + codeUnit = string.charCodeAt(index0); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + } + return index; + }, + getInterceptor$(receiver) { + if (typeof receiver == "number") { + if (Math.floor(receiver) == receiver) + return J.JSInt.prototype; + return J.JSNumNotInt.prototype; + } + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return J.JSNull.prototype; + if (typeof receiver == "boolean") + return J.JSBool.prototype; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$asx(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$ax(receiver) { + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$ns(receiver) { + if (typeof receiver == "number") + return J.JSNumber.prototype; + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + getInterceptor$s(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + get$first$ax(receiver) { + return J.getInterceptor$ax(receiver).get$first(receiver); + }, + get$hashCode$(receiver) { + return J.getInterceptor$(receiver).get$hashCode(receiver); + }, + get$isEmpty$asx(receiver) { + return J.getInterceptor$asx(receiver).get$isEmpty(receiver); + }, + get$iterator$ax(receiver) { + return J.getInterceptor$ax(receiver).get$iterator(receiver); + }, + get$last$ax(receiver) { + return J.getInterceptor$ax(receiver).get$last(receiver); + }, + get$length$asx(receiver) { + return J.getInterceptor$asx(receiver).get$length(receiver); + }, + get$runtimeType$(receiver) { + return J.getInterceptor$(receiver).get$runtimeType(receiver); + }, + $eq$(receiver, a0) { + if (receiver == null) + return a0 == null; + if (typeof receiver != "object") + return a0 != null && receiver === a0; + return J.getInterceptor$(receiver).$eq(receiver, a0); + }, + $index$asx(receiver, a0) { + if (typeof a0 === "number") + if (Array.isArray(receiver) || typeof receiver == "string" || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) + if (a0 >>> 0 === a0 && a0 < receiver.length) + return receiver[a0]; + return J.getInterceptor$asx(receiver).$index(receiver, a0); + }, + $indexSet$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1); + }, + add$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).add$1(receiver, a0); + }, + allMatches$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).allMatches$1(receiver, a0); + }, + allMatches$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).allMatches$2(receiver, a0, a1); + }, + cast$1$0$ax(receiver, $T1) { + return J.getInterceptor$ax(receiver).cast$1$0(receiver, $T1); + }, + codeUnitAt$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).codeUnitAt$1(receiver, a0); + }, + compareTo$1$ns(receiver, a0) { + return J.getInterceptor$ns(receiver).compareTo$1(receiver, a0); + }, + contains$1$asx(receiver, a0) { + return J.getInterceptor$asx(receiver).contains$1(receiver, a0); + }, + elementAt$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); + }, + endsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).endsWith$1(receiver, a0); + }, + getRange$2$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).getRange$2(receiver, a0, a1); + }, + map$1$1$ax(receiver, a0, $T1) { + return J.getInterceptor$ax(receiver).map$1$1(receiver, a0, $T1); + }, + matchAsPrefix$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).matchAsPrefix$2(receiver, a0, a1); + }, + noSuchMethod$1$(receiver, a0) { + return J.getInterceptor$(receiver).noSuchMethod$1(receiver, a0); + }, + setRange$4$ax(receiver, a0, a1, a2, a3) { + return J.getInterceptor$ax(receiver).setRange$4(receiver, a0, a1, a2, a3); + }, + skip$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).skip$1(receiver, a0); + }, + startsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).startsWith$1(receiver, a0); + }, + sublist$2$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).sublist$2(receiver, a0, a1); + }, + take$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).take$1(receiver, a0); + }, + toList$0$ax(receiver) { + return J.getInterceptor$ax(receiver).toList$0(receiver); + }, + toString$0$(receiver) { + return J.getInterceptor$(receiver).toString$0(receiver); + }, + Interceptor: function Interceptor() { + }, + JSBool: function JSBool() { + }, + JSNull: function JSNull() { + }, + JavaScriptObject: function JavaScriptObject() { + }, + LegacyJavaScriptObject: function LegacyJavaScriptObject() { + }, + PlainJavaScriptObject: function PlainJavaScriptObject() { + }, + UnknownJavaScriptObject: function UnknownJavaScriptObject() { + }, + JavaScriptFunction: function JavaScriptFunction() { + }, + JavaScriptBigInt: function JavaScriptBigInt() { + }, + JavaScriptSymbol: function JavaScriptSymbol() { + }, + JSArray: function JSArray(t0) { + this.$ti = t0; + }, + JSUnmodifiableArray: function JSUnmodifiableArray(t0) { + this.$ti = t0; + }, + ArrayIterator: function ArrayIterator(t0, t1, t2) { + var _ = this; + _._iterable = t0; + _._length = t1; + _._index = 0; + _._current = null; + _.$ti = t2; + }, + JSNumber: function JSNumber() { + }, + JSInt: function JSInt() { + }, + JSNumNotInt: function JSNumNotInt() { + }, + JSString: function JSString() { + } + }, + A = {JS_CONST: function JS_CONST() { + }, + CastIterable_CastIterable(source, $S, $T) { + if ($S._eval$1("EfficientLengthIterable<0>")._is(source)) + return new A._EfficientLengthCastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("_EfficientLengthCastIterable<1,2>")); + return new A.CastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastIterable<1,2>")); + }, + LateError$fieldNI(fieldName) { + return new A.LateError("Field '" + fieldName + "' has not been initialized."); + }, + hexDigitValue(char) { + var digit, letter; + A.assertHelper(char <= 65535); + digit = char ^ 48; + if (digit <= 9) + return digit; + letter = char | 32; + if (97 <= letter && letter <= 102) + return letter - 87; + return -1; + }, + SystemHash_combine(hash, value) { + hash = hash + value & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + return hash ^ hash >>> 6; + }, + SystemHash_finish(hash) { + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >>> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + checkNotNullable(value, $name, $T) { + return value; + }, + isToStringVisiting(object) { + var t1, i; + for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i) + if (object === $.toStringVisiting[i]) + return true; + return false; + }, + SubListIterable$(_iterable, _start, _endOrLength, $E) { + A.RangeError_checkNotNegative(_start, "start"); + if (_endOrLength != null) { + A.RangeError_checkNotNegative(_endOrLength, "end"); + if (_start > _endOrLength) + A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null)); + } + return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); + }, + MappedIterable_MappedIterable(iterable, $function, $S, $T) { + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); + return new A.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + }, + TakeIterable_TakeIterable(iterable, takeCount, $E) { + var _s9_ = "takeCount"; + A.ArgumentError_checkNotNull(takeCount, _s9_, type$.int); + A.RangeError_checkNotNegative(takeCount, _s9_); + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthTakeIterable(iterable, takeCount, $E._eval$1("EfficientLengthTakeIterable<0>")); + return new A.TakeIterable(iterable, takeCount, $E._eval$1("TakeIterable<0>")); + }, + SkipIterable_SkipIterable(iterable, count, $E) { + var _s5_ = "count"; + if (type$.EfficientLengthIterable_dynamic._is(iterable)) { + A.ArgumentError_checkNotNull(count, _s5_, type$.int); + A.RangeError_checkNotNegative(count, _s5_); + return new A.EfficientLengthSkipIterable(iterable, count, $E._eval$1("EfficientLengthSkipIterable<0>")); + } + A.ArgumentError_checkNotNull(count, _s5_, type$.int); + A.RangeError_checkNotNegative(count, _s5_); + return new A.SkipIterable(iterable, count, $E._eval$1("SkipIterable<0>")); + }, + IterableElementError_noElement() { + return new A.StateError("No element"); + }, + IterableElementError_tooFew() { + return new A.StateError("Too few elements"); + }, + _CastIterableBase: function _CastIterableBase() { + }, + CastIterator: function CastIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastIterable: function CastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _EfficientLengthCastIterable: function _EfficientLengthCastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _CastListBase: function _CastListBase() { + }, + CastList: function CastList(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + LateError: function LateError(t0) { + this._message = t0; + }, + CodeUnits: function CodeUnits(t0) { + this.__internal$_string = t0; + }, + nullFuture_closure: function nullFuture_closure() { + }, + SentinelValue: function SentinelValue() { + }, + EfficientLengthIterable: function EfficientLengthIterable() { + }, + ListIterable: function ListIterable() { + }, + SubListIterable: function SubListIterable(t0, t1, t2, t3) { + var _ = this; + _.__internal$_iterable = t0; + _._start = t1; + _._endOrLength = t2; + _.$ti = t3; + }, + ListIterator: function ListIterator(t0, t1, t2) { + var _ = this; + _.__internal$_iterable = t0; + _.__internal$_length = t1; + _.__internal$_index = 0; + _.__internal$_current = null; + _.$ti = t2; + }, + MappedIterable: function MappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + MappedIterator: function MappedIterator(t0, t1, t2) { + var _ = this; + _.__internal$_current = null; + _._iterator = t0; + _._f = t1; + _.$ti = t2; + }, + MappedListIterable: function MappedListIterable(t0, t1, t2) { + this._source = t0; + this._f = t1; + this.$ti = t2; + }, + WhereIterable: function WhereIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + WhereIterator: function WhereIterator(t0, t1, t2) { + this._iterator = t0; + this._f = t1; + this.$ti = t2; + }, + ExpandIterable: function ExpandIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + ExpandIterator: function ExpandIterator(t0, t1, t2, t3) { + var _ = this; + _._iterator = t0; + _._f = t1; + _._currentExpansion = t2; + _.__internal$_current = null; + _.$ti = t3; + }, + TakeIterable: function TakeIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._takeCount = t1; + this.$ti = t2; + }, + EfficientLengthTakeIterable: function EfficientLengthTakeIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._takeCount = t1; + this.$ti = t2; + }, + TakeIterator: function TakeIterator(t0, t1, t2) { + this._iterator = t0; + this._remaining = t1; + this.$ti = t2; + }, + SkipIterable: function SkipIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._skipCount = t1; + this.$ti = t2; + }, + EfficientLengthSkipIterable: function EfficientLengthSkipIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._skipCount = t1; + this.$ti = t2; + }, + SkipIterator: function SkipIterator(t0, t1, t2) { + this._iterator = t0; + this._skipCount = t1; + this.$ti = t2; + }, + SkipWhileIterable: function SkipWhileIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + SkipWhileIterator: function SkipWhileIterator(t0, t1, t2) { + var _ = this; + _._iterator = t0; + _._f = t1; + _._hasSkipped = false; + _.$ti = t2; + }, + EmptyIterable: function EmptyIterable(t0) { + this.$ti = t0; + }, + EmptyIterator: function EmptyIterator(t0) { + this.$ti = t0; + }, + WhereTypeIterable: function WhereTypeIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + WhereTypeIterator: function WhereTypeIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + FixedLengthListMixin: function FixedLengthListMixin() { + }, + UnmodifiableListMixin: function UnmodifiableListMixin() { + }, + UnmodifiableListBase: function UnmodifiableListBase() { + }, + ReversedListIterable: function ReversedListIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + Symbol: function Symbol(t0) { + this.__internal$_name = t0; + }, + __CastListBase__CastIterableBase_ListMixin: function __CastListBase__CastIterableBase_ListMixin() { + }, + unminifyOrTag(rawClassName) { + var preserved = init.mangledGlobalNames[rawClassName]; + if (preserved != null) + return preserved; + return rawClassName; + }, + isJsIndexable(object, record) { + var result; + if (record != null) { + result = record.x; + if (result != null) + return result; + } + return type$.JavaScriptIndexingBehavior_dynamic._is(object); + }, + S(value) { + var result; + if (typeof value == "string") + return value; + if (typeof value == "number") { + if (value !== 0) + return "" + value; + } else if (true === value) + return "true"; + else if (false === value) + return "false"; + else if (value == null) + return "null"; + result = J.toString$0$(value); + return result; + }, + Primitives_objectHashCode(object) { + var hash, + property = $.Primitives__identityHashCodeProperty; + if (property == null) + property = $.Primitives__identityHashCodeProperty = Symbol("identityHashCode"); + hash = object[property]; + if (hash == null) { + hash = Math.random() * 0x3fffffff | 0; + object[property] = hash; + } + return hash; + }, + Primitives_parseInt(source, radix) { + var decimalMatch, maxCharCode, digitsPart, t1, i, _null = null, + match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source); + if (match == null) + return _null; + if (3 >= match.length) + return A.ioore(match, 3); + decimalMatch = match[3]; + if (radix == null) { + if (decimalMatch != null) + return parseInt(source, 10); + if (match[2] != null) + return parseInt(source, 16); + return _null; + } + if (radix < 2 || radix > 36) + throw A.wrapException(A.RangeError$range(radix, 2, 36, "radix", _null)); + if (radix === 10 && decimalMatch != null) + return parseInt(source, 10); + if (radix < 10 || decimalMatch == null) { + maxCharCode = radix <= 10 ? 47 + radix : 86 + radix; + A.assertHelper(typeof match[1] == "string"); + digitsPart = match[1]; + for (t1 = digitsPart.length, i = 0; i < t1; ++i) + if ((digitsPart.charCodeAt(i) | 32) > maxCharCode) + return _null; + } + return parseInt(source, radix); + }, + Primitives_objectTypeName(object) { + return A.Primitives__objectTypeNameNewRti(object); + }, + Primitives__objectTypeNameNewRti(object) { + var interceptor, dispatchName, $constructor, constructorName; + if (object instanceof A.Object) + return A._rtiToString(A.instanceType(object), null); + interceptor = J.getInterceptor$(object); + if (interceptor === B.Interceptor_methods || interceptor === B.JavaScriptObject_methods || type$.UnknownJavaScriptObject._is(object)) { + dispatchName = B.C_JS_CONST(object); + if (dispatchName !== "Object" && dispatchName !== "") + return dispatchName; + $constructor = object.constructor; + if (typeof $constructor == "function") { + constructorName = $constructor.name; + if (typeof constructorName == "string" && constructorName !== "Object" && constructorName !== "") + return constructorName; + } + } + return A._rtiToString(A.instanceType(object), null); + }, + Primitives_safeToString(object) { + if (object == null || typeof object == "number" || A._isBool(object)) + return J.toString$0$(object); + if (typeof object == "string") + return JSON.stringify(object); + if (object instanceof A.Closure) + return object.toString$0(0); + if (object instanceof A._Record) + return object._toString$1(true); + return "Instance of '" + A.Primitives_objectTypeName(object) + "'"; + }, + Primitives_currentUri() { + if (!!self.location) + return self.location.href; + return null; + }, + Primitives__fromCharCodeApply(array) { + var result, i, i0, chunkEnd, + end = array.length; + if (end <= 500) + return String.fromCharCode.apply(null, array); + for (result = "", i = 0; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); + } + return result; + }, + Primitives_stringFromCodePoints(codePoints) { + var t1, _i, i, + a = A._setArrayType([], type$.JSArray_int); + for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, A.throwConcurrentModificationError)(codePoints), ++_i) { + i = codePoints[_i]; + if (!A._isInt(i)) + throw A.wrapException(A.argumentErrorValue(i)); + if (i <= 65535) + B.JSArray_methods.add$1(a, i); + else if (i <= 1114111) { + B.JSArray_methods.add$1(a, 55296 + (B.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); + B.JSArray_methods.add$1(a, 56320 + (i & 1023)); + } else + throw A.wrapException(A.argumentErrorValue(i)); + } + return A.Primitives__fromCharCodeApply(a); + }, + Primitives_stringFromCharCodes(charCodes) { + var t1, _i, i; + for (t1 = charCodes.length, _i = 0; _i < t1; ++_i) { + i = charCodes[_i]; + if (!A._isInt(i)) + throw A.wrapException(A.argumentErrorValue(i)); + if (i < 0) + throw A.wrapException(A.argumentErrorValue(i)); + if (i > 65535) + return A.Primitives_stringFromCodePoints(charCodes); + } + return A.Primitives__fromCharCodeApply(charCodes); + }, + Primitives_stringFromNativeUint8List(charCodes, start, end) { + var i, result, i0, chunkEnd; + if (end <= 500 && start === 0 && end === charCodes.length) + return String.fromCharCode.apply(null, charCodes); + for (i = start, result = ""; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd)); + } + return result; + }, + Primitives_stringFromCharCode(charCode) { + var bits; + if (0 <= charCode) { + if (charCode <= 65535) + return String.fromCharCode(charCode); + if (charCode <= 1114111) { + bits = charCode - 65536; + return String.fromCharCode((B.JSInt_methods._shrOtherPositive$1(bits, 10) | 55296) >>> 0, bits & 1023 | 56320); + } + } + throw A.wrapException(A.RangeError$range(charCode, 0, 1114111, null, null)); + }, + Primitives_lazyAsJsDate(receiver) { + if (receiver.date === void 0) + receiver.date = new Date(receiver._core$_value); + return receiver.date; + }, + Primitives_getYear(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCFullYear() + 0 : A.Primitives_lazyAsJsDate(receiver).getFullYear() + 0; + }, + Primitives_getMonth(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCMonth() + 1 : A.Primitives_lazyAsJsDate(receiver).getMonth() + 1; + }, + Primitives_getDay(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCDate() + 0 : A.Primitives_lazyAsJsDate(receiver).getDate() + 0; + }, + Primitives_getHours(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCHours() + 0 : A.Primitives_lazyAsJsDate(receiver).getHours() + 0; + }, + Primitives_getMinutes(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCMinutes() + 0 : A.Primitives_lazyAsJsDate(receiver).getMinutes() + 0; + }, + Primitives_getSeconds(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCSeconds() + 0 : A.Primitives_lazyAsJsDate(receiver).getSeconds() + 0; + }, + Primitives_getMilliseconds(receiver) { + return receiver.isUtc ? A.Primitives_lazyAsJsDate(receiver).getUTCMilliseconds() + 0 : A.Primitives_lazyAsJsDate(receiver).getMilliseconds() + 0; + }, + Primitives_functionNoSuchMethod($function, positionalArguments, namedArguments) { + var $arguments, namedArgumentList, t1 = {}; + t1.argumentCount = 0; + $arguments = []; + namedArgumentList = []; + t1.argumentCount = positionalArguments.length; + B.JSArray_methods.addAll$1($arguments, positionalArguments); + t1.names = ""; + if (namedArguments != null && namedArguments.__js_helper$_length !== 0) + namedArguments.forEach$1(0, new A.Primitives_functionNoSuchMethod_closure(t1, namedArgumentList, $arguments)); + return J.noSuchMethod$1$($function, new A.JSInvocationMirror(B.Symbol_call, 0, $arguments, namedArgumentList, 0)); + }, + Primitives_applyFunction($function, positionalArguments, namedArguments) { + var t1, argumentCount, jsStub; + if (Array.isArray(positionalArguments)) + t1 = namedArguments == null || namedArguments.__js_helper$_length === 0; + else + t1 = false; + if (t1) { + argumentCount = positionalArguments.length; + if (argumentCount === 0) { + if (!!$function.call$0) + return $function.call$0(); + } else if (argumentCount === 1) { + if (!!$function.call$1) + return $function.call$1(positionalArguments[0]); + } else if (argumentCount === 2) { + if (!!$function.call$2) + return $function.call$2(positionalArguments[0], positionalArguments[1]); + } else if (argumentCount === 3) { + if (!!$function.call$3) + return $function.call$3(positionalArguments[0], positionalArguments[1], positionalArguments[2]); + } else if (argumentCount === 4) { + if (!!$function.call$4) + return $function.call$4(positionalArguments[0], positionalArguments[1], positionalArguments[2], positionalArguments[3]); + } else if (argumentCount === 5) + if (!!$function.call$5) + return $function.call$5(positionalArguments[0], positionalArguments[1], positionalArguments[2], positionalArguments[3], positionalArguments[4]); + jsStub = $function["call" + "$" + argumentCount]; + if (jsStub != null) + return jsStub.apply($function, positionalArguments); + } + return A.Primitives__generalApplyFunction($function, positionalArguments, namedArguments); + }, + Primitives__generalApplyFunction($function, positionalArguments, namedArguments) { + var defaultValuesClosure, t1, defaultValues, interceptor, jsFunction, maxArguments, missingDefaults, keys, _i, defaultValue, used, key, + $arguments = Array.isArray(positionalArguments) ? positionalArguments : A.List_List$of(positionalArguments, true, type$.dynamic), + argumentCount = $arguments.length, + requiredParameterCount = $function.$requiredArgCount; + if (argumentCount < requiredParameterCount) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + defaultValuesClosure = $function.$defaultValues; + t1 = defaultValuesClosure == null; + defaultValues = !t1 ? defaultValuesClosure() : null; + interceptor = J.getInterceptor$($function); + jsFunction = interceptor["call*"]; + if (typeof jsFunction == "string") + jsFunction = interceptor[jsFunction]; + if (t1) { + if (namedArguments != null && namedArguments.__js_helper$_length !== 0) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + if (argumentCount === requiredParameterCount) + return jsFunction.apply($function, $arguments); + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + } + if (Array.isArray(defaultValues)) { + if (namedArguments != null && namedArguments.__js_helper$_length !== 0) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + maxArguments = requiredParameterCount + defaultValues.length; + if (argumentCount > maxArguments) + return A.Primitives_functionNoSuchMethod($function, $arguments, null); + if (argumentCount < maxArguments) { + missingDefaults = defaultValues.slice(argumentCount - requiredParameterCount); + if ($arguments === positionalArguments) + $arguments = A.List_List$of($arguments, true, type$.dynamic); + B.JSArray_methods.addAll$1($arguments, missingDefaults); + } + return jsFunction.apply($function, $arguments); + } else { + if (argumentCount > requiredParameterCount) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + if ($arguments === positionalArguments) + $arguments = A.List_List$of($arguments, true, type$.dynamic); + keys = Object.keys(defaultValues); + if (namedArguments == null) + for (t1 = keys.length, _i = 0; _i < keys.length; keys.length === t1 || (0, A.throwConcurrentModificationError)(keys), ++_i) { + defaultValue = defaultValues[A._asString(keys[_i])]; + if (B.C__Required === defaultValue) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + B.JSArray_methods.add$1($arguments, defaultValue); + } + else { + for (t1 = keys.length, used = 0, _i = 0; _i < keys.length; keys.length === t1 || (0, A.throwConcurrentModificationError)(keys), ++_i) { + key = A._asString(keys[_i]); + if (namedArguments.containsKey$1(key)) { + ++used; + B.JSArray_methods.add$1($arguments, namedArguments.$index(0, key)); + } else { + defaultValue = defaultValues[key]; + if (B.C__Required === defaultValue) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + B.JSArray_methods.add$1($arguments, defaultValue); + } + } + if (used !== namedArguments.__js_helper$_length) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + } + return jsFunction.apply($function, $arguments); + } + }, + Primitives_extractStackTrace(error) { + var jsError = error.$thrownJsError; + if (jsError == null) + return null; + return A.getTraceFromException(jsError); + }, + iae(argument) { + throw A.wrapException(A.argumentErrorValue(argument)); + }, + ioore(receiver, index) { + if (receiver == null) + J.get$length$asx(receiver); + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + }, + diagnoseIndexError(indexable, index) { + var $length, _s5_ = "index"; + if (!A._isInt(index)) + return new A.ArgumentError(true, index, _s5_, null); + $length = A._asInt(J.get$length$asx(indexable)); + if (index < 0 || index >= $length) + return A.IndexError$withLength(index, $length, indexable, null, _s5_); + return A.RangeError$value(index, _s5_); + }, + diagnoseRangeError(start, end, $length) { + if (start > $length) + return A.RangeError$range(start, 0, $length, "start", null); + if (end != null) + if (end < start || end > $length) + return A.RangeError$range(end, start, $length, "end", null); + return new A.ArgumentError(true, end, "end", null); + }, + argumentErrorValue(object) { + return new A.ArgumentError(true, object, null, null); + }, + wrapException(ex) { + return A.initializeExceptionWrapper(new Error(), ex); + }, + initializeExceptionWrapper(wrapper, ex) { + var t1; + if (ex == null) + ex = new A.TypeError(); + wrapper.dartException = ex; + t1 = A.toStringWrapper; + if ("defineProperty" in Object) { + Object.defineProperty(wrapper, "message", {get: t1}); + wrapper.name = ""; + } else + wrapper.toString = t1; + return wrapper; + }, + toStringWrapper() { + return J.toString$0$(this.dartException); + }, + throwExpression(ex) { + throw A.wrapException(ex); + }, + throwExpressionWithWrapper(ex, wrapper) { + throw A.initializeExceptionWrapper(wrapper, ex); + }, + throwConcurrentModificationError(collection) { + throw A.wrapException(A.ConcurrentModificationError$(collection)); + }, + TypeErrorDecoder_extractPattern(message) { + var match, $arguments, argumentsExpr, expr, method, receiver; + message = A.quoteStringForRegExp(message.replace(String({}), "$receiver$")); + match = message.match(/\\\$[a-zA-Z]+\\\$/g); + if (match == null) + match = A._setArrayType([], type$.JSArray_String); + $arguments = match.indexOf("\\$arguments\\$"); + argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); + expr = match.indexOf("\\$expr\\$"); + method = match.indexOf("\\$method\\$"); + receiver = match.indexOf("\\$receiver\\$"); + return new A.TypeErrorDecoder(message.replace(new RegExp("\\\\\\$arguments\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$argumentsExpr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$expr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$method\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$receiver\\\\\\$", "g"), "((?:x|[^x])*)"), $arguments, argumentsExpr, expr, method, receiver); + }, + TypeErrorDecoder_provokeCallErrorOn(expression) { + return function($expr$) { + var $argumentsExpr$ = "$arguments$"; + try { + $expr$.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }(expression); + }, + TypeErrorDecoder_provokePropertyErrorOn(expression) { + return function($expr$) { + try { + $expr$.$method$; + } catch (e) { + return e.message; + } + }(expression); + }, + JsNoSuchMethodError$(_message, match) { + var t1 = match == null, + t2 = t1 ? null : match.method; + return new A.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); + }, + unwrapException(ex) { + var t1; + if (ex == null) + return new A.NullThrownFromJavaScriptException(ex); + if (ex instanceof A.ExceptionAndStackTrace) { + t1 = ex.dartException; + return A.saveStackTrace(ex, t1 == null ? type$.Object._as(t1) : t1); + } + if (typeof ex !== "object") + return ex; + if ("dartException" in ex) + return A.saveStackTrace(ex, ex.dartException); + return A._unwrapNonDartException(ex); + }, + saveStackTrace(ex, error) { + if (type$.Error._is(error)) + if (error.$thrownJsError == null) + error.$thrownJsError = ex; + return error; + }, + _unwrapNonDartException(ex) { + var message, number, ieErrorCode, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match; + if (!("message" in ex)) + return ex; + message = ex.message; + if ("number" in ex && typeof ex.number == "number") { + number = ex.number; + ieErrorCode = number & 65535; + if ((B.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) + switch (ieErrorCode) { + case 438: + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A.S(message) + " (Error " + ieErrorCode + ")", null)); + case 445: + case 5007: + A.S(message); + return A.saveStackTrace(ex, new A.NullError()); + } + } + if (ex instanceof TypeError) { + nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); + notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); + nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); + nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); + undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); + undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); + nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); + $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); + undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); + undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); + match = nsme.matchTypeError$1(message); + if (match != null) + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match)); + else { + match = notClosure.matchTypeError$1(message); + if (match != null) { + match.method = "call"; + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A._asString(message), match)); + } else if (nullCall.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefCall.matchTypeError$1(message) != null || undefLiteralCall.matchTypeError$1(message) != null || nullProperty.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefProperty.matchTypeError$1(message) != null || undefLiteralProperty.matchTypeError$1(message) != null) { + A._asString(message); + return A.saveStackTrace(ex, new A.NullError()); + } + } + return A.saveStackTrace(ex, new A.UnknownJsTypeError(typeof message == "string" ? message : "")); + } + if (ex instanceof RangeError) { + if (typeof message == "string" && message.indexOf("call stack") !== -1) + return new A.StackOverflowError(); + message = function(ex) { + try { + return String(ex); + } catch (e) { + } + return null; + }(ex); + return A.saveStackTrace(ex, new A.ArgumentError(false, null, null, typeof message == "string" ? message.replace(/^RangeError:\s*/, "") : message)); + } + if (typeof InternalError == "function" && ex instanceof InternalError) + if (typeof message == "string" && message === "too much recursion") + return new A.StackOverflowError(); + return ex; + }, + getTraceFromException(exception) { + var trace; + if (exception instanceof A.ExceptionAndStackTrace) + return exception.stackTrace; + if (exception == null) + return new A._StackTrace(exception); + trace = exception.$cachedTrace; + if (trace != null) + return trace; + trace = new A._StackTrace(exception); + if (typeof exception === "object") + exception.$cachedTrace = trace; + return trace; + }, + objectHashCode(object) { + if (object == null) + return J.get$hashCode$(object); + if (typeof object == "object") + return A.Primitives_objectHashCode(object); + return J.get$hashCode$(object); + }, + fillLiteralMap(keyValuePairs, result) { + var index, index0, index1, + $length = keyValuePairs.length; + for (index = 0; index < $length; index = index1) { + index0 = index + 1; + index1 = index0 + 1; + result.$indexSet(0, keyValuePairs[index], keyValuePairs[index0]); + } + return result; + }, + _invokeClosure(closure, numberOfArguments, arg1, arg2, arg3, arg4) { + type$.Function._as(closure); + switch (A._asInt(numberOfArguments)) { + case 0: + return closure.call$0(); + case 1: + return closure.call$1(arg1); + case 2: + return closure.call$2(arg1, arg2); + case 3: + return closure.call$3(arg1, arg2, arg3); + case 4: + return closure.call$4(arg1, arg2, arg3, arg4); + } + throw A.wrapException(A.Exception_Exception("Unsupported number of arguments for wrapped closure")); + }, + convertDartClosureToJS(closure, arity) { + var $function; + if (closure == null) + return null; + $function = closure.$identity; + if (!!$function) + return $function; + $function = A.convertDartClosureToJSUncached(closure, arity); + closure.$identity = $function; + return $function; + }, + convertDartClosureToJSUncached(closure, arity) { + var entry; + switch (arity) { + case 0: + entry = closure.call$0; + break; + case 1: + entry = closure.call$1; + break; + case 2: + entry = closure.call$2; + break; + case 3: + entry = closure.call$3; + break; + case 4: + entry = closure.call$4; + break; + default: + entry = null; + } + if (entry != null) + return entry.bind(closure); + return function(closure, arity, invoke) { + return function(a1, a2, a3, a4) { + return invoke(closure, arity, a1, a2, a3, a4); + }; + }(closure, arity, A._invokeClosure); + }, + Closure_fromTearOff(parameters) { + var $name, callName, $function, t1, $prototype, $constructor, t2, trampoline, applyTrampoline, i, stub, stub0, stubName, stubCallName, + container = parameters.co, + isStatic = parameters.iS, + isIntercepted = parameters.iI, + needsDirectAccess = parameters.nDA, + applyTrampolineIndex = parameters.aI, + funsOrNames = parameters.fs, + callNames = parameters.cs; + A.assertHelper(typeof funsOrNames[0] == "string"); + $name = funsOrNames[0]; + callName = callNames[0]; + $function = container[$name]; + t1 = parameters.fT; + t1.toString; + $prototype = isStatic ? Object.create(new A.StaticClosure().constructor.prototype) : Object.create(new A.BoundClosure(null, null).constructor.prototype); + $prototype.$initialize = $prototype.constructor; + $constructor = isStatic ? function static_tear_off() { + this.$initialize(); + } : function tear_off(a, b) { + this.$initialize(a, b); + }; + $prototype.constructor = $constructor; + $constructor.prototype = $prototype; + $prototype.$_name = $name; + $prototype.$_target = $function; + t2 = !isStatic; + if (t2) + trampoline = A.Closure_forwardCallTo($name, $function, isIntercepted, needsDirectAccess); + else { + $prototype.$static_name = $name; + trampoline = $function; + } + $prototype.$signature = A.Closure__computeSignatureFunctionNewRti(t1, isStatic, isIntercepted); + $prototype[callName] = trampoline; + for (applyTrampoline = trampoline, i = 1; i < funsOrNames.length; ++i) { + stub = funsOrNames[i]; + if (typeof stub == "string") { + stub0 = container[stub]; + stubName = stub; + stub = stub0; + } else + stubName = ""; + stubCallName = callNames[i]; + if (stubCallName != null) { + if (t2) + stub = A.Closure_forwardCallTo(stubName, stub, isIntercepted, needsDirectAccess); + $prototype[stubCallName] = stub; + } + if (i === applyTrampolineIndex) + applyTrampoline = stub; + } + $prototype["call*"] = applyTrampoline; + $prototype.$requiredArgCount = parameters.rC; + $prototype.$defaultValues = parameters.dV; + return $constructor; + }, + Closure__computeSignatureFunctionNewRti(functionType, isStatic, isIntercepted) { + if (typeof functionType == "number") + return functionType; + if (typeof functionType == "string") { + if (isStatic) + throw A.wrapException("Cannot compute signature for static tearoff."); + return function(recipe, evalOnReceiver) { + return function() { + return evalOnReceiver(this, recipe); + }; + }(functionType, A.BoundClosure_evalRecipe); + } + throw A.wrapException("Error in functionType of tearoff"); + }, + Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function) { + var getReceiver = A.BoundClosure_receiverOf; + switch (needsDirectAccess ? -1 : arity) { + case 0: + return function(entry, receiverOf) { + return function() { + return receiverOf(this)[entry](); + }; + }(stubName, getReceiver); + case 1: + return function(entry, receiverOf) { + return function(a) { + return receiverOf(this)[entry](a); + }; + }(stubName, getReceiver); + case 2: + return function(entry, receiverOf) { + return function(a, b) { + return receiverOf(this)[entry](a, b); + }; + }(stubName, getReceiver); + case 3: + return function(entry, receiverOf) { + return function(a, b, c) { + return receiverOf(this)[entry](a, b, c); + }; + }(stubName, getReceiver); + case 4: + return function(entry, receiverOf) { + return function(a, b, c, d) { + return receiverOf(this)[entry](a, b, c, d); + }; + }(stubName, getReceiver); + case 5: + return function(entry, receiverOf) { + return function(a, b, c, d, e) { + return receiverOf(this)[entry](a, b, c, d, e); + }; + }(stubName, getReceiver); + default: + return function(f, receiverOf) { + return function() { + return f.apply(receiverOf(this), arguments); + }; + }($function, getReceiver); + } + }, + Closure_forwardCallTo(stubName, $function, isIntercepted, needsDirectAccess) { + if (isIntercepted) + return A.Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess); + return A.Closure_cspForwardCall($function.length, needsDirectAccess, stubName, $function); + }, + Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function) { + var getReceiver = A.BoundClosure_receiverOf, + getInterceptor = A.BoundClosure_interceptorOf; + switch (needsDirectAccess ? -1 : arity) { + case 0: + throw A.wrapException(new A.RuntimeError("Intercepted function with no arguments.")); + case 1: + return function(entry, interceptorOf, receiverOf) { + return function() { + return interceptorOf(this)[entry](receiverOf(this)); + }; + }(stubName, getInterceptor, getReceiver); + case 2: + return function(entry, interceptorOf, receiverOf) { + return function(a) { + return interceptorOf(this)[entry](receiverOf(this), a); + }; + }(stubName, getInterceptor, getReceiver); + case 3: + return function(entry, interceptorOf, receiverOf) { + return function(a, b) { + return interceptorOf(this)[entry](receiverOf(this), a, b); + }; + }(stubName, getInterceptor, getReceiver); + case 4: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c); + }; + }(stubName, getInterceptor, getReceiver); + case 5: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c, d) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c, d); + }; + }(stubName, getInterceptor, getReceiver); + case 6: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c, d, e) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c, d, e); + }; + }(stubName, getInterceptor, getReceiver); + default: + return function(f, interceptorOf, receiverOf) { + return function() { + var a = [receiverOf(this)]; + Array.prototype.push.apply(a, arguments); + return f.apply(interceptorOf(this), a); + }; + }($function, getInterceptor, getReceiver); + } + }, + Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess) { + var arity, t1; + if ($.BoundClosure__interceptorFieldNameCache == null) + $.BoundClosure__interceptorFieldNameCache = A.BoundClosure__computeFieldNamed("interceptor"); + if ($.BoundClosure__receiverFieldNameCache == null) + $.BoundClosure__receiverFieldNameCache = A.BoundClosure__computeFieldNamed("receiver"); + arity = $function.length; + t1 = A.Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function); + return t1; + }, + closureFromTearOff(parameters) { + return A.Closure_fromTearOff(parameters); + }, + BoundClosure_evalRecipe(closure, recipe) { + return A._Universe_evalInEnvironment(init.typeUniverse, A.instanceType(closure._receiver), recipe); + }, + BoundClosure_receiverOf(closure) { + return closure._receiver; + }, + BoundClosure_interceptorOf(closure) { + return closure._interceptor; + }, + BoundClosure__computeFieldNamed(fieldName) { + var t1, i, $name, + template = new A.BoundClosure("receiver", "interceptor"), + names = J.JSArray_markFixedList(Object.getOwnPropertyNames(template), type$.nullable_Object); + for (t1 = names.length, i = 0; i < t1; ++i) { + $name = names[i]; + if (template[$name] === fieldName) + return $name; + } + throw A.wrapException(A.ArgumentError$("Field name " + fieldName + " not found.", null)); + }, + boolConversionCheck(value) { + if (value == null) + A.assertThrow("boolean expression must not be null"); + return value; + }, + assertTest(condition) { + if (true === condition) + return false; + if (false === condition) + return true; + A._asBool(condition); + return !condition; + }, + assertThrow(message) { + throw A.wrapException(new A._AssertionError(message)); + }, + assertHelper(condition) { + if (A.assertTest(condition)) + throw A.wrapException(A.AssertionError$(null)); + }, + throwCyclicInit(staticName) { + throw A.wrapException(new A._CyclicInitializationError(staticName)); + }, + getIsolateAffinityTag($name) { + return init.getIsolateTag($name); + }, + assertInteropArgs(args) { + if (A.assertTest(B.JSArray_methods.every$1(args, new A.assertInteropArgs_closure()))) + A.assertThrow(string$.Dart_f); + }, + wrapZoneUnaryCallback(callback, $T) { + var t1 = $.Zone__current; + if (t1 === B.C__RootZone) + return callback; + return t1.bindUnaryCallbackGuarded$1$1(callback, $T); + }, + defineProperty(obj, property, value) { + Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true}); + }, + lookupAndCacheInterceptor(obj) { + var tag, record, interceptor, interceptorClass, altTag, mark, t1; + A.assertHelper(!(obj instanceof A.Object)); + tag = A._asString($.getTagFunction.call$1(obj)); + record = $.dispatchRecordsForInstanceTags[tag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[tag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[tag]; + if (interceptorClass == null) { + altTag = A._asStringQ($.alternateTagFunction.call$2(obj, tag)); + if (altTag != null) { + record = $.dispatchRecordsForInstanceTags[altTag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[altTag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[altTag]; + tag = altTag; + } + } + if (interceptorClass == null) + return null; + interceptor = interceptorClass.prototype; + mark = tag[0]; + if (mark === "!") { + record = A.makeLeafDispatchRecord(interceptor); + $.dispatchRecordsForInstanceTags[tag] = record; + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + if (mark === "~") { + $.interceptorsForUncacheableTags[tag] = interceptor; + return interceptor; + } + if (mark === "-") { + t1 = A.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } + if (mark === "+") + return A.patchInteriorProto(obj, interceptor); + if (mark === "*") + throw A.wrapException(A.UnimplementedError$(tag)); + if (init.leafTags[tag] === true) { + t1 = A.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } else + return A.patchInteriorProto(obj, interceptor); + }, + patchInteriorProto(obj, interceptor) { + var proto = Object.getPrototypeOf(obj); + Object.defineProperty(proto, init.dispatchPropertyName, {value: J.makeDispatchRecord(interceptor, proto, null, null), enumerable: false, writable: true, configurable: true}); + return interceptor; + }, + makeLeafDispatchRecord(interceptor) { + return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + }, + makeDefaultDispatchRecord(tag, interceptorClass, proto) { + var interceptor = interceptorClass.prototype; + if (init.leafTags[tag] === true) + return A.makeLeafDispatchRecord(interceptor); + else + return J.makeDispatchRecord(interceptor, proto, null, null); + }, + initNativeDispatch() { + if (true === $.initNativeDispatchFlag) + return; + $.initNativeDispatchFlag = true; + A.initNativeDispatchContinue(); + }, + initNativeDispatchContinue() { + var map, tags, fun, i, tag, proto, record, interceptorClass; + $.dispatchRecordsForInstanceTags = Object.create(null); + $.interceptorsForUncacheableTags = Object.create(null); + A.initHooks(); + map = init.interceptorsByTag; + tags = Object.getOwnPropertyNames(map); + if (typeof window != "undefined") { + window; + fun = function() { + }; + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + proto = $.prototypeForTagFunction.call$1(tag); + if (proto != null) { + record = A.makeDefaultDispatchRecord(tag, map[tag], proto); + if (record != null) { + Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + fun.prototype = proto; + } + } + } + } + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + if (/^[A-Za-z_]/.test(tag)) { + interceptorClass = map[tag]; + map["!" + tag] = interceptorClass; + map["~" + tag] = interceptorClass; + map["-" + tag] = interceptorClass; + map["+" + tag] = interceptorClass; + map["*" + tag] = interceptorClass; + } + } + }, + initHooks() { + var transformers, i, transformer, getTag, getUnknownTag, prototypeForTag, + hooks = B.C_JS_CONST0(); + hooks = A.applyHooksTransformer(B.C_JS_CONST1, A.applyHooksTransformer(B.C_JS_CONST2, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST4, A.applyHooksTransformer(B.C_JS_CONST5, A.applyHooksTransformer(B.C_JS_CONST6(B.C_JS_CONST), hooks))))))); + if (typeof dartNativeDispatchHooksTransformer != "undefined") { + transformers = dartNativeDispatchHooksTransformer; + if (typeof transformers == "function") + transformers = [transformers]; + if (Array.isArray(transformers)) + for (i = 0; i < transformers.length; ++i) { + transformer = transformers[i]; + if (typeof transformer == "function") + hooks = transformer(hooks) || hooks; + } + } + getTag = hooks.getTag; + getUnknownTag = hooks.getUnknownTag; + prototypeForTag = hooks.prototypeForTag; + $.getTagFunction = new A.initHooks_closure(getTag); + $.alternateTagFunction = new A.initHooks_closure0(getUnknownTag); + $.prototypeForTagFunction = new A.initHooks_closure1(prototypeForTag); + }, + applyHooksTransformer(transformer, hooks) { + return transformer(hooks) || hooks; + }, + createRecordTypePredicate(shape, fieldRtis) { + var argumentCount, + $length = fieldRtis.length, + $function = init.rttc["" + $length + ";" + shape]; + if ($function == null) + return null; + if ($length === 0) + return $function; + argumentCount = $function.length; + if ($length === argumentCount) + return $function.apply(null, fieldRtis); + A.assertHelper(argumentCount === 1); + return $function(fieldRtis); + }, + JSSyntaxRegExp_makeNative(source, multiLine, caseSensitive, unicode, dotAll, global) { + var m = multiLine ? "m" : "", + i = caseSensitive ? "" : "i", + u = unicode ? "u" : "", + s = dotAll ? "s" : "", + g = global ? "g" : "", + regexp = function(source, modifiers) { + try { + return new RegExp(source, modifiers); + } catch (e) { + return e; + } + }(source, m + i + u + s + g); + if (regexp instanceof RegExp) + return regexp; + throw A.wrapException(A.FormatException$("Illegal RegExp pattern (" + String(regexp) + ")", source, null)); + }, + _MatchImplementation$(pattern, _match) { + A.assertHelper(typeof _match.input == "string"); + A.assertHelper(A._isInt(_match.index)); + return new A._MatchImplementation(_match); + }, + stringContainsUnchecked(receiver, other, startIndex) { + var t1; + if (typeof other == "string") + return receiver.indexOf(other, startIndex) >= 0; + else if (other instanceof A.JSSyntaxRegExp) { + t1 = B.JSString_methods.substring$1(receiver, startIndex); + return other._nativeRegExp.test(t1); + } else + return !J.allMatches$1$s(other, B.JSString_methods.substring$1(receiver, startIndex)).get$isEmpty(0); + }, + escapeReplacement(replacement) { + if (replacement.indexOf("$", 0) >= 0) + return replacement.replace(/\$/g, "$$$$"); + return replacement; + }, + stringReplaceFirstRE(receiver, regexp, replacement, startIndex) { + var match = regexp._execGlobal$2(receiver, startIndex); + if (match == null) + return receiver; + return A.stringReplaceRangeUnchecked(receiver, match._match.index, match.get$end(), replacement); + }, + quoteStringForRegExp(string) { + if (/[[\]{}()*+?.\\^$|]/.test(string)) + return string.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"); + return string; + }, + stringReplaceAllUnchecked(receiver, pattern, replacement) { + var nativeRegexp; + if (typeof pattern == "string") + return A.stringReplaceAllUncheckedString(receiver, pattern, replacement); + if (pattern instanceof A.JSSyntaxRegExp) { + nativeRegexp = pattern.get$_nativeGlobalVersion(); + nativeRegexp.lastIndex = 0; + return receiver.replace(nativeRegexp, A.escapeReplacement(replacement)); + } + return A.stringReplaceAllGeneral(receiver, pattern, replacement); + }, + stringReplaceAllGeneral(receiver, pattern, replacement) { + var t1, startIndex, t2, match; + for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), startIndex = 0, t2 = ""; t1.moveNext$0();) { + match = t1.get$current(); + t2 = t2 + receiver.substring(startIndex, match.get$start()) + replacement; + startIndex = match.get$end(); + } + t1 = t2 + receiver.substring(startIndex); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + stringReplaceAllUncheckedString(receiver, pattern, replacement) { + var $length, t1, i; + if (pattern === "") { + if (receiver === "") + return replacement; + $length = receiver.length; + t1 = "" + replacement; + for (i = 0; i < $length; ++i) + t1 = t1 + receiver[i] + replacement; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + if (receiver.indexOf(pattern, 0) < 0) + return receiver; + if (receiver.length < 500 || replacement.indexOf("$", 0) >= 0) + return receiver.split(pattern).join(replacement); + return receiver.replace(new RegExp(A.quoteStringForRegExp(pattern), "g"), A.escapeReplacement(replacement)); + }, + stringReplaceFirstUnchecked(receiver, pattern, replacement, startIndex) { + var index, t1, matches, match; + if (typeof pattern == "string") { + index = receiver.indexOf(pattern, startIndex); + if (index < 0) + return receiver; + return A.stringReplaceRangeUnchecked(receiver, index, index + pattern.length, replacement); + } + if (pattern instanceof A.JSSyntaxRegExp) + return startIndex === 0 ? receiver.replace(pattern._nativeRegExp, A.escapeReplacement(replacement)) : A.stringReplaceFirstRE(receiver, pattern, replacement, startIndex); + t1 = J.allMatches$2$s(pattern, receiver, startIndex); + matches = t1.get$iterator(t1); + if (!matches.moveNext$0()) + return receiver; + match = matches.get$current(); + return B.JSString_methods.replaceRange$3(receiver, match.get$start(), match.get$end(), replacement); + }, + stringReplaceRangeUnchecked(receiver, start, end, replacement) { + return receiver.substring(0, start) + replacement + receiver.substring(end); + }, + _Record_2: function _Record_2(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + _Record_2_file_outFlags: function _Record_2_file_outFlags(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + ConstantMapView: function ConstantMapView(t0, t1) { + this._collection$_map = t0; + this.$ti = t1; + }, + ConstantMap: function ConstantMap() { + }, + ConstantStringMap: function ConstantStringMap(t0, t1, t2) { + this._jsIndex = t0; + this._values = t1; + this.$ti = t2; + }, + _KeysOrValues: function _KeysOrValues(t0, t1) { + this._elements = t0; + this.$ti = t1; + }, + _KeysOrValuesOrElementsIterator: function _KeysOrValuesOrElementsIterator(t0, t1, t2) { + var _ = this; + _._elements = t0; + _.__js_helper$_length = t1; + _.__js_helper$_index = 0; + _.__js_helper$_current = null; + _.$ti = t2; + }, + Instantiation: function Instantiation() { + }, + Instantiation1: function Instantiation1(t0, t1) { + this._genericClosure = t0; + this.$ti = t1; + }, + JSInvocationMirror: function JSInvocationMirror(t0, t1, t2, t3, t4) { + var _ = this; + _._memberName = t0; + _.__js_helper$_kind = t1; + _._arguments = t2; + _._namedArgumentNames = t3; + _._typeArgumentCount = t4; + }, + Primitives_functionNoSuchMethod_closure: function Primitives_functionNoSuchMethod_closure(t0, t1, t2) { + this._box_0 = t0; + this.namedArgumentList = t1; + this.$arguments = t2; + }, + TypeErrorDecoder: function TypeErrorDecoder(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._pattern = t0; + _._arguments = t1; + _._argumentsExpr = t2; + _._expr = t3; + _._method = t4; + _._receiver = t5; + }, + NullError: function NullError() { + }, + JsNoSuchMethodError: function JsNoSuchMethodError(t0, t1, t2) { + this.__js_helper$_message = t0; + this._method = t1; + this._receiver = t2; + }, + UnknownJsTypeError: function UnknownJsTypeError(t0) { + this.__js_helper$_message = t0; + }, + NullThrownFromJavaScriptException: function NullThrownFromJavaScriptException(t0) { + this._irritant = t0; + }, + ExceptionAndStackTrace: function ExceptionAndStackTrace(t0, t1) { + this.dartException = t0; + this.stackTrace = t1; + }, + _StackTrace: function _StackTrace(t0) { + this._exception = t0; + this._trace = null; + }, + Closure: function Closure() { + }, + Closure0Args: function Closure0Args() { + }, + Closure2Args: function Closure2Args() { + }, + TearOffClosure: function TearOffClosure() { + }, + StaticClosure: function StaticClosure() { + }, + BoundClosure: function BoundClosure(t0, t1) { + this._receiver = t0; + this._interceptor = t1; + }, + _CyclicInitializationError: function _CyclicInitializationError(t0) { + this.variableName = t0; + }, + RuntimeError: function RuntimeError(t0) { + this.message = t0; + }, + _AssertionError: function _AssertionError(t0) { + this.message = t0; + }, + _Required: function _Required() { + }, + assertInteropArgs_closure: function assertInteropArgs_closure() { + }, + JsLinkedHashMap: function JsLinkedHashMap(t0) { + var _ = this; + _.__js_helper$_length = 0; + _.__js_helper$_last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; + _._modifications = 0; + _.$ti = t0; + }, + JsLinkedHashMap_values_closure: function JsLinkedHashMap_values_closure(t0) { + this.$this = t0; + }, + JsLinkedHashMap_addAll_closure: function JsLinkedHashMap_addAll_closure(t0) { + this.$this = t0; + }, + LinkedHashMapCell: function LinkedHashMapCell(t0, t1) { + var _ = this; + _.hashMapCellKey = t0; + _.hashMapCellValue = t1; + _._previous = _._next = null; + }, + LinkedHashMapKeyIterable: function LinkedHashMapKeyIterable(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + LinkedHashMapKeyIterator: function LinkedHashMapKeyIterator(t0, t1, t2) { + var _ = this; + _._map = t0; + _._modifications = t1; + _.__js_helper$_current = _._cell = null; + _.$ti = t2; + }, + initHooks_closure: function initHooks_closure(t0) { + this.getTag = t0; + }, + initHooks_closure0: function initHooks_closure0(t0) { + this.getUnknownTag = t0; + }, + initHooks_closure1: function initHooks_closure1(t0) { + this.prototypeForTag = t0; + }, + _Record: function _Record() { + }, + _Record2: function _Record2() { + }, + JSSyntaxRegExp: function JSSyntaxRegExp(t0, t1) { + var _ = this; + _.pattern = t0; + _._nativeRegExp = t1; + _._nativeAnchoredRegExp = _._nativeGlobalRegExp = null; + }, + _MatchImplementation: function _MatchImplementation(t0) { + this._match = t0; + }, + _AllMatchesIterable: function _AllMatchesIterable(t0, t1, t2) { + this._re = t0; + this._string = t1; + this.__js_helper$_start = t2; + }, + _AllMatchesIterator: function _AllMatchesIterator(t0, t1, t2) { + var _ = this; + _._regExp = t0; + _._string = t1; + _._nextIndex = t2; + _.__js_helper$_current = null; + }, + StringMatch: function StringMatch(t0, t1) { + this.start = t0; + this.pattern = t1; + }, + _StringAllMatchesIterable: function _StringAllMatchesIterable(t0, t1, t2) { + this._input = t0; + this._pattern = t1; + this.__js_helper$_index = t2; + }, + _StringAllMatchesIterator: function _StringAllMatchesIterator(t0, t1, t2) { + var _ = this; + _._input = t0; + _._pattern = t1; + _.__js_helper$_index = t2; + _.__js_helper$_current = null; + }, + throwLateFieldNI(fieldName) { + A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has not been initialized."), new Error()); + }, + throwLateFieldAI(fieldName) { + A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has already been initialized."), new Error()); + }, + throwLateFieldADI(fieldName) { + A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); + }, + _Cell$named(_name) { + var t1 = new A._Cell(_name); + return t1._value = t1; + }, + _Cell: function _Cell(t0) { + this._name = t0; + this._value = null; + }, + _checkLength($length) { + return $length; + }, + _checkViewArguments(buffer, offsetInBytes, $length) { + }, + _ensureNativeList(list) { + var t1, result, i; + if (type$.JSIndexable_dynamic._is(list)) + return list; + t1 = J.getInterceptor$asx(list); + result = A.List_List$filled(t1.get$length(list), null, false, type$.dynamic); + for (i = 0; i < t1.get$length(list); ++i) + B.JSArray_methods.$indexSet(result, i, t1.$index(list, i)); + return result; + }, + NativeByteData_NativeByteData$view(buffer, offsetInBytes, $length) { + var t1; + A._checkViewArguments(buffer, offsetInBytes, $length); + t1 = new DataView(buffer, offsetInBytes); + return t1; + }, + NativeInt32List_NativeInt32List$view(buffer, offsetInBytes, $length) { + A._checkViewArguments(buffer, offsetInBytes, $length); + $length = B.JSInt_methods._tdivFast$1(buffer.byteLength - offsetInBytes, 4); + return new Int32Array(buffer, offsetInBytes, $length); + }, + NativeInt8List__create1(arg) { + return new Int8Array(arg); + }, + NativeUint8List_NativeUint8List($length) { + return new Uint8Array($length); + }, + NativeUint8List_NativeUint8List$view(buffer, offsetInBytes, $length) { + A._checkViewArguments(buffer, offsetInBytes, $length); + return $length == null ? new Uint8Array(buffer, offsetInBytes) : new Uint8Array(buffer, offsetInBytes, $length); + }, + _checkValidIndex(index, list, $length) { + if (index >>> 0 !== index || index >= $length) + throw A.wrapException(A.diagnoseIndexError(list, index)); + }, + _checkValidRange(start, end, $length) { + var t1; + if (!(start >>> 0 !== start)) + t1 = end >>> 0 !== end || start > end || end > $length; + else + t1 = true; + if (t1) + throw A.wrapException(A.diagnoseRangeError(start, end, $length)); + return end; + }, + NativeByteBuffer: function NativeByteBuffer() { + }, + NativeTypedData: function NativeTypedData() { + }, + NativeByteData: function NativeByteData() { + }, + NativeTypedArray: function NativeTypedArray() { + }, + NativeTypedArrayOfDouble: function NativeTypedArrayOfDouble() { + }, + NativeTypedArrayOfInt: function NativeTypedArrayOfInt() { + }, + NativeFloat32List: function NativeFloat32List() { + }, + NativeFloat64List: function NativeFloat64List() { + }, + NativeInt16List: function NativeInt16List() { + }, + NativeInt32List: function NativeInt32List() { + }, + NativeInt8List: function NativeInt8List() { + }, + NativeUint16List: function NativeUint16List() { + }, + NativeUint32List: function NativeUint32List() { + }, + NativeUint8ClampedList: function NativeUint8ClampedList() { + }, + NativeUint8List: function NativeUint8List() { + }, + _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin() { + }, + _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin() { + }, + _NativeTypedArrayOfInt_NativeTypedArray_ListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin() { + }, + _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin() { + }, + Rti__getQuestionFromStar(universe, rti) { + var question; + A.assertHelper(rti._kind === 6); + question = rti._precomputed1; + if (question == null) { + A.assertHelper(rti._kind === 6); + question = rti._precomputed1 = A._Universe__lookupQuestionRti(universe, rti._primary, true); + } + return question; + }, + Rti__getFutureFromFutureOr(universe, rti) { + var future; + A.assertHelper(rti._kind === 8); + future = rti._precomputed1; + if (future == null) { + A.assertHelper(rti._kind === 8); + future = rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]); + } + return future; + }, + Rti__isUnionOfFunctionType(rti) { + var kind = rti._kind; + if (kind === 6 || kind === 7 || kind === 8) + return A.Rti__isUnionOfFunctionType(rti._primary); + return kind === 12 || kind === 13; + }, + Rti__getInterfaceTypeArguments(rti) { + A.assertHelper(rti._kind === 9); + return rti._rest; + }, + Rti__getBindingArguments(rti) { + A.assertHelper(rti._kind === 10); + return rti._rest; + }, + Rti__getRecordFields(rti) { + A.assertHelper(rti._kind === 11); + return rti._rest; + }, + Rti__getGenericFunctionBounds(rti) { + A.assertHelper(rti._kind === 13); + return rti._rest; + }, + Rti__getCanonicalRecipe(rti) { + var s = rti._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + return s; + }, + findType(recipe) { + return A._Universe_eval(init.typeUniverse, recipe, false); + }, + instantiatedGenericFunctionType(genericFunctionRti, instantiationRti) { + var bounds, typeArguments, cache, s, key, probe, rti; + if (genericFunctionRti == null) + return null; + bounds = A.Rti__getGenericFunctionBounds(genericFunctionRti); + typeArguments = A.Rti__getInterfaceTypeArguments(instantiationRti); + A.assertHelper(bounds.length === typeArguments.length); + cache = genericFunctionRti._bindCache; + if (cache == null) + cache = genericFunctionRti._bindCache = new Map(); + s = instantiationRti._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + key = s; + probe = cache.get(key); + if (probe != null) + return probe; + A.assertHelper(genericFunctionRti._kind === 13); + rti = A._substitute(init.typeUniverse, genericFunctionRti._primary, typeArguments, 0); + cache.set(key, rti); + return rti; + }, + _substitute(universe, rti, typeArguments, depth) { + var baseType, substitutedBaseType, interfaceTypeArguments, substitutedInterfaceTypeArguments, base, substitutedBase, $arguments, substitutedArguments, fields, substitutedFields, returnType, substitutedReturnType, functionParameters, substitutedFunctionParameters, bounds, substitutedBounds, index, argument, + t1 = rti._kind, + kind = t1; + switch (kind) { + case 5: + case 1: + case 2: + case 3: + case 4: + return rti; + case 6: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupStarRti(universe, substitutedBaseType, true); + case 7: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupQuestionRti(universe, substitutedBaseType, true); + case 8: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupFutureOrRti(universe, substitutedBaseType, true); + case 9: + interfaceTypeArguments = A.Rti__getInterfaceTypeArguments(rti); + substitutedInterfaceTypeArguments = A._substituteArray(universe, interfaceTypeArguments, typeArguments, depth); + if (substitutedInterfaceTypeArguments === interfaceTypeArguments) + return rti; + A.assertHelper(rti._kind === 9); + return A._Universe__lookupInterfaceRti(universe, rti._primary, substitutedInterfaceTypeArguments); + case 10: + A.assertHelper(t1 === 10); + base = rti._primary; + substitutedBase = A._substitute(universe, base, typeArguments, depth); + $arguments = A.Rti__getBindingArguments(rti); + substitutedArguments = A._substituteArray(universe, $arguments, typeArguments, depth); + if (substitutedBase === base && substitutedArguments === $arguments) + return rti; + return A._Universe__lookupBindingRti(universe, substitutedBase, substitutedArguments); + case 11: + A.assertHelper(t1 === 11); + t1 = rti._primary; + fields = A.Rti__getRecordFields(rti); + substitutedFields = A._substituteArray(universe, fields, typeArguments, depth); + if (substitutedFields === fields) + return rti; + return A._Universe__lookupRecordRti(universe, t1, substitutedFields); + case 12: + A.assertHelper(t1 === 12); + returnType = rti._primary; + substitutedReturnType = A._substitute(universe, returnType, typeArguments, depth); + A.assertHelper(rti._kind === 12); + functionParameters = rti._rest; + substitutedFunctionParameters = A._substituteFunctionParameters(universe, functionParameters, typeArguments, depth); + if (substitutedReturnType === returnType && substitutedFunctionParameters === functionParameters) + return rti; + return A._Universe__lookupFunctionRti(universe, substitutedReturnType, substitutedFunctionParameters); + case 13: + bounds = A.Rti__getGenericFunctionBounds(rti); + depth += bounds.length; + substitutedBounds = A._substituteArray(universe, bounds, typeArguments, depth); + A.assertHelper(rti._kind === 13); + base = rti._primary; + substitutedBase = A._substitute(universe, base, typeArguments, depth); + if (substitutedBounds === bounds && substitutedBase === base) + return rti; + return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, true); + case 14: + A.assertHelper(t1 === 14); + index = rti._primary; + if (index < depth) + return rti; + argument = typeArguments[index - depth]; + if (argument == null) + return rti; + return argument; + default: + throw A.wrapException(A.AssertionError$("Attempted to substitute unexpected RTI kind " + kind)); + } + }, + _substituteArray(universe, rtiArray, typeArguments, depth) { + var changed, i, rti, substitutedRti, + $length = rtiArray.length, + result = A._Utils_newArrayOrEmpty($length); + for (changed = false, i = 0; i < $length; ++i) { + rti = rtiArray[i]; + substitutedRti = A._substitute(universe, rti, typeArguments, depth); + if (substitutedRti !== rti) + changed = true; + result[i] = substitutedRti; + } + return changed ? result : rtiArray; + }, + _substituteNamed(universe, namedArray, typeArguments, depth) { + var result, changed, i, t1, t2, rti, substitutedRti, + $length = namedArray.length; + A.assertHelper($length % 3 === 0); + result = A._Utils_newArrayOrEmpty($length); + for (changed = false, i = 0; i < $length; i += 3) { + t1 = namedArray[i]; + t2 = namedArray[i + 1]; + rti = namedArray[i + 2]; + substitutedRti = A._substitute(universe, rti, typeArguments, depth); + if (substitutedRti !== rti) + changed = true; + result.splice(i, 3, t1, t2, substitutedRti); + } + return changed ? result : namedArray; + }, + _substituteFunctionParameters(universe, functionParameters, typeArguments, depth) { + var result, + requiredPositional = functionParameters._requiredPositional, + substitutedRequiredPositional = A._substituteArray(universe, requiredPositional, typeArguments, depth), + optionalPositional = functionParameters._optionalPositional, + substitutedOptionalPositional = A._substituteArray(universe, optionalPositional, typeArguments, depth), + named = functionParameters._named, + substitutedNamed = A._substituteNamed(universe, named, typeArguments, depth); + if (substitutedRequiredPositional === requiredPositional && substitutedOptionalPositional === optionalPositional && substitutedNamed === named) + return functionParameters; + result = new A._FunctionParameters(); + result._requiredPositional = substitutedRequiredPositional; + result._optionalPositional = substitutedOptionalPositional; + result._named = substitutedNamed; + return result; + }, + _setArrayType(target, rti) { + A.assertHelper(rti != null); + target[init.arrayRti] = rti; + return target; + }, + closureFunctionType(closure) { + var signature = closure.$signature; + if (signature != null) { + if (typeof signature == "number") + return A.getTypeFromTypesTable(signature); + return closure.$signature(); + } + return null; + }, + instanceOrFunctionType(object, testRti) { + var rti; + if (A.Rti__isUnionOfFunctionType(testRti)) + if (object instanceof A.Closure) { + rti = A.closureFunctionType(object); + if (rti != null) + return rti; + } + return A.instanceType(object); + }, + instanceType(object) { + if (object instanceof A.Object) + return A._instanceType(object); + if (Array.isArray(object)) + return A._arrayInstanceType(object); + return A._instanceTypeFromConstructor(J.getInterceptor$(object)); + }, + _arrayInstanceType(object) { + var rti = object[init.arrayRti], + defaultRti = type$.JSArray_dynamic; + if (rti == null) + return defaultRti; + if (rti.constructor !== defaultRti.constructor) + return defaultRti; + return rti; + }, + _instanceType(object) { + var rti = object.$ti; + return rti != null ? rti : A._instanceTypeFromConstructor(object); + }, + _instanceTypeFromConstructor(instance) { + var $constructor = instance.constructor, + probe = $constructor.$ccache; + if (probe != null) + return probe; + return A._instanceTypeFromConstructorMiss(instance, $constructor); + }, + _instanceTypeFromConstructorMiss(instance, $constructor) { + var effectiveConstructor = instance instanceof A.Closure ? Object.getPrototypeOf(Object.getPrototypeOf(instance)).constructor : $constructor, + rti = A._Universe_findErasedType(init.typeUniverse, effectiveConstructor.name); + $constructor.$ccache = rti; + return rti; + }, + getTypeFromTypesTable(index) { + var rti, + table = init.types, + type = table[index]; + if (typeof type == "string") { + rti = A._Universe_eval(init.typeUniverse, type, false); + table[index] = rti; + return rti; + } + return type; + }, + getRuntimeTypeOfDartObject(object) { + return A.createRuntimeType(A._instanceType(object)); + }, + getRuntimeTypeOfClosure(closure) { + var rti = A.closureFunctionType(closure); + return A.createRuntimeType(rti == null ? A.instanceType(closure) : rti); + }, + _structuralTypeOf(object) { + var functionRti; + if (object instanceof A._Record) + return A.evaluateRtiForRecord(object.$recipe, object._getFieldValues$0()); + functionRti = object instanceof A.Closure ? A.closureFunctionType(object) : null; + if (functionRti != null) + return functionRti; + if (type$.TrustedGetRuntimeType._is(object)) + return J.get$runtimeType$(object)._rti; + if (Array.isArray(object)) + return A._arrayInstanceType(object); + return A.instanceType(object); + }, + createRuntimeType(rti) { + var t1 = rti._cachedRuntimeType; + return t1 == null ? rti._cachedRuntimeType = A._createRuntimeType(rti) : t1; + }, + _createRuntimeType(rti) { + var s0, starErasedRecipe, starErasedRti, t1, + _s24_ = "Missing canonical recipe", + s = rti._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow(_s24_); + s0 = rti._canonicalRecipe; + if (A.assertTest(typeof s0 == "string")) + A.assertThrow(_s24_); + starErasedRecipe = s0.replace(/\*/g, ""); + if (starErasedRecipe === s) { + A.assertHelper(rti._cachedRuntimeType == null); + return rti._cachedRuntimeType = new A._Type(rti); + } + starErasedRti = A._Universe_eval(init.typeUniverse, starErasedRecipe, true); + t1 = starErasedRti._cachedRuntimeType; + return t1 == null ? starErasedRti._cachedRuntimeType = A._createRuntimeType(starErasedRti) : t1; + }, + evaluateRtiForRecord(recordRecipe, valuesList) { + var bindings, i, + values = valuesList, + $length = values.length; + if ($length === 0) + return type$.Record_0; + if (0 >= $length) + return A.ioore(values, 0); + bindings = A._Universe_evalInEnvironment(init.typeUniverse, A._structuralTypeOf(values[0]), "@<0>"); + for (i = 1; i < $length; ++i) { + if (!(i < values.length)) + return A.ioore(values, i); + bindings = A._Universe_bind(init.typeUniverse, bindings, A._structuralTypeOf(values[i])); + } + return A._Universe_evalInEnvironment(init.typeUniverse, bindings, recordRecipe); + }, + typeLiteral(recipe) { + return A.createRuntimeType(A._Universe_eval(init.typeUniverse, recipe, false)); + }, + _installSpecializedIsTest(object) { + var t1, unstarred, unstarredKind, isFn, $name, predicate, testRti = this; + if (testRti === type$.Object) + return A._finishIsFn(testRti, object, A._isObject); + if (!A.isSoundTopType(testRti)) + t1 = testRti === type$.legacy_Object; + else + t1 = true; + if (t1) + return A._finishIsFn(testRti, object, A._isTop); + t1 = testRti._kind; + if (t1 === 7) + return A._finishIsFn(testRti, object, A._generalNullableIsTestImplementation); + if (t1 === 1) + return A._finishIsFn(testRti, object, A._isNever); + if (t1 === 6) { + A.assertHelper(t1 === 6); + unstarred = testRti._primary; + } else + unstarred = testRti; + t1 = unstarred._kind; + unstarredKind = t1; + if (unstarredKind === 8) + return A._finishIsFn(testRti, object, A._isFutureOr); + if (unstarred === type$.int) + isFn = A._isInt; + else if (unstarred === type$.double || unstarred === type$.num) + isFn = A._isNum; + else if (unstarred === type$.String) + isFn = A._isString; + else + isFn = unstarred === type$.bool ? A._isBool : null; + if (isFn != null) + return A._finishIsFn(testRti, object, isFn); + if (unstarredKind === 9) { + A.assertHelper(t1 === 9); + $name = unstarred._primary; + if (A.Rti__getInterfaceTypeArguments(unstarred).every(A.isDefinitelyTopType)) { + testRti._specializedTestResource = "$is" + $name; + if ($name === "List") + return A._finishIsFn(testRti, object, A._isListTestViaProperty); + return A._finishIsFn(testRti, object, A._isTestViaProperty); + } + } else if (unstarredKind === 11) { + A.assertHelper(t1 === 11); + predicate = A.createRecordTypePredicate(unstarred._primary, A.Rti__getRecordFields(unstarred)); + return A._finishIsFn(testRti, object, predicate == null ? A._isNever : predicate); + } + return A._finishIsFn(testRti, object, A._generalIsTestImplementation); + }, + _finishIsFn(testRti, object, isFn) { + testRti._is = isFn; + return testRti._is(object); + }, + _installSpecializedAsCheck(object) { + var t1, testRti = this, + asFn = A._generalAsCheckImplementation; + if (!A.isSoundTopType(testRti)) + t1 = testRti === type$.legacy_Object; + else + t1 = true; + if (t1) + asFn = A._asTop; + else if (testRti === type$.Object) + asFn = A._asObject; + else { + t1 = A.isNullable(testRti); + if (t1) + asFn = A._generalNullableAsCheckImplementation; + } + testRti._as = asFn; + return testRti._as(object); + }, + _nullIs(testRti) { + var t1, + kind = testRti._kind; + if (!A.isSoundTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + if (!(testRti === type$.legacy_Never)) + if (kind !== 7) { + if (kind === 6) { + A.assertHelper(testRti._kind === 6); + t1 = A._nullIs(testRti._primary); + } else + t1 = false; + if (!t1) { + if (kind === 8) { + A.assertHelper(testRti._kind === 8); + t1 = A._nullIs(testRti._primary); + } else + t1 = false; + t1 = t1 || testRti === type$.Null || testRti === type$.JSNull; + } else + t1 = true; + } else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + return t1; + }, + _generalIsTestImplementation(object) { + var testRti = this; + if (object == null) + return A._nullIs(testRti); + return A.isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), testRti); + }, + _generalNullableIsTestImplementation(object) { + var testRti; + if (object == null) + return true; + testRti = this; + A.assertHelper(testRti._kind === 7); + return testRti._primary._is(object); + }, + _isTestViaProperty(object) { + var tag, testRti = this; + if (object == null) + return A._nullIs(testRti); + tag = testRti._specializedTestResource; + if (object instanceof A.Object) + return !!object[tag]; + return !!J.getInterceptor$(object)[tag]; + }, + _isListTestViaProperty(object) { + var tag, testRti = this; + if (object == null) + return A._nullIs(testRti); + if (typeof object != "object") + return false; + if (Array.isArray(object)) + return true; + tag = testRti._specializedTestResource; + if (object instanceof A.Object) + return !!object[tag]; + return !!J.getInterceptor$(object)[tag]; + }, + _generalAsCheckImplementation(object) { + var testRti = this; + if (object == null) { + if (A.isNullable(testRti)) + return object; + } else if (testRti._is(object)) + return object; + A._failedAsCheck(object, testRti); + }, + _generalNullableAsCheckImplementation(object) { + var testRti = this; + if (object == null) + return object; + else if (testRti._is(object)) + return object; + A._failedAsCheck(object, testRti); + }, + _failedAsCheck(object, testRti) { + throw A.wrapException(A._TypeError$fromMessage(A._Error_compose(object, A._rtiToString(testRti, null)))); + }, + checkTypeBound(type, bound, variable, methodName) { + if (A.isSubtype(init.typeUniverse, type, bound)) + return type; + throw A.wrapException(A._TypeError$fromMessage("The type argument '" + A._rtiToString(type, null) + "' is not a subtype of the type variable bound '" + A._rtiToString(bound, null) + "' of type variable '" + variable + "' in '" + methodName + "'.")); + }, + _Error_compose(object, checkedTypeDescription) { + return A.Error_safeToString(object) + ": type '" + A._rtiToString(A._structuralTypeOf(object), null) + "' is not a subtype of type '" + checkedTypeDescription + "'"; + }, + _TypeError$fromMessage(message) { + return new A._TypeError("TypeError: " + message); + }, + _TypeError__TypeError$forType(object, type) { + return new A._TypeError("TypeError: " + A._Error_compose(object, type)); + }, + _isFutureOr(object) { + var unstarred, testRti = this, + t1 = testRti._kind; + if (t1 === 6) { + A.assertHelper(t1 === 6); + unstarred = testRti._primary; + } else + unstarred = testRti; + A.assertHelper(unstarred._kind === 8); + return unstarred._primary._is(object) || A.Rti__getFutureFromFutureOr(init.typeUniverse, unstarred)._is(object); + }, + _isObject(object) { + return object != null; + }, + _asObject(object) { + if (object != null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "Object")); + }, + _isTop(object) { + return true; + }, + _asTop(object) { + return object; + }, + _isNever(object) { + return false; + }, + _isBool(object) { + return true === object || false === object; + }, + _asBool(object) { + if (true === object) + return true; + if (false === object) + return false; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool")); + }, + _asBoolS(object) { + if (true === object) + return true; + if (false === object) + return false; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool")); + }, + _asBoolQ(object) { + if (true === object) + return true; + if (false === object) + return false; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool?")); + }, + _asDouble(object) { + if (typeof object == "number") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double")); + }, + _asDoubleS(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double")); + }, + _asDoubleQ(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double?")); + }, + _isInt(object) { + return typeof object == "number" && Math.floor(object) === object; + }, + _asInt(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int")); + }, + _asIntS(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int")); + }, + _asIntQ(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int?")); + }, + _isNum(object) { + return typeof object == "number"; + }, + _asNum(object) { + if (typeof object == "number") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num")); + }, + _asNumS(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num")); + }, + _asNumQ(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num?")); + }, + _isString(object) { + return typeof object == "string"; + }, + _asString(object) { + if (typeof object == "string") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String")); + }, + _asStringS(object) { + if (typeof object == "string") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String")); + }, + _asStringQ(object) { + if (typeof object == "string") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String?")); + }, + _rtiArrayToString(array, genericContext) { + var s, sep, i; + for (s = "", sep = "", i = 0; i < array.length; ++i, sep = ", ") + s += sep + A._rtiToString(array[i], genericContext); + return s; + }, + _recordRtiToString(recordType, genericContext) { + var partialShape, fields, fieldCount, names, namesIndex, s, comma, i; + A.assertHelper(recordType._kind === 11); + partialShape = recordType._primary; + fields = A.Rti__getRecordFields(recordType); + if ("" === partialShape) + return "(" + A._rtiArrayToString(fields, genericContext) + ")"; + fieldCount = fields.length; + names = partialShape.split(","); + namesIndex = names.length - fieldCount; + for (s = "(", comma = "", i = 0; i < fieldCount; ++i, comma = ", ") { + s += comma; + if (namesIndex === 0) + s += "{"; + s += A._rtiToString(fields[i], genericContext); + if (namesIndex >= 0) + s += " " + names[namesIndex]; + ++namesIndex; + } + return s + "})"; + }, + _functionRtiToString(functionType, genericContext, bounds) { + var boundsLength, outerContextLength, offset, i, t1, t2, typeParametersText, typeSep, t3, t4, boundRti, kind, parameters, requiredPositional, requiredPositionalLength, optionalPositional, optionalPositionalLength, named, namedLength, returnTypeText, argumentsText, sep, _s2_ = ", "; + if (bounds != null) { + boundsLength = bounds.length; + if (genericContext == null) { + genericContext = A._setArrayType([], type$.JSArray_String); + outerContextLength = null; + } else + outerContextLength = genericContext.length; + offset = genericContext.length; + for (i = boundsLength; i > 0; --i) + B.JSArray_methods.add$1(genericContext, "T" + (offset + i)); + for (t1 = type$.nullable_Object, t2 = type$.legacy_Object, typeParametersText = "<", typeSep = "", i = 0; i < boundsLength; ++i, typeSep = _s2_) { + t3 = genericContext.length; + t4 = t3 - 1 - i; + if (!(t4 >= 0)) + return A.ioore(genericContext, t4); + typeParametersText = B.JSString_methods.$add(typeParametersText + typeSep, genericContext[t4]); + boundRti = bounds[i]; + kind = boundRti._kind; + if (!(kind === 2 || kind === 3 || kind === 4 || kind === 5 || boundRti === t1)) + t3 = boundRti === t2; + else + t3 = true; + if (!t3) + typeParametersText += " extends " + A._rtiToString(boundRti, genericContext); + } + typeParametersText += ">"; + } else { + typeParametersText = ""; + outerContextLength = null; + } + A.assertHelper(functionType._kind === 12); + t1 = functionType._primary; + A.assertHelper(functionType._kind === 12); + parameters = functionType._rest; + requiredPositional = parameters._requiredPositional; + requiredPositionalLength = requiredPositional.length; + optionalPositional = parameters._optionalPositional; + optionalPositionalLength = optionalPositional.length; + named = parameters._named; + namedLength = named.length; + A.assertHelper(optionalPositionalLength === 0 || namedLength === 0); + returnTypeText = A._rtiToString(t1, genericContext); + for (argumentsText = "", sep = "", i = 0; i < requiredPositionalLength; ++i, sep = _s2_) + argumentsText += sep + A._rtiToString(requiredPositional[i], genericContext); + if (optionalPositionalLength > 0) { + argumentsText += sep + "["; + for (sep = "", i = 0; i < optionalPositionalLength; ++i, sep = _s2_) + argumentsText += sep + A._rtiToString(optionalPositional[i], genericContext); + argumentsText += "]"; + } + if (namedLength > 0) { + argumentsText += sep + "{"; + for (sep = "", i = 0; i < namedLength; i += 3, sep = _s2_) { + argumentsText += sep; + if (named[i + 1]) + argumentsText += "required "; + argumentsText += A._rtiToString(named[i + 2], genericContext) + " " + named[i]; + } + argumentsText += "}"; + } + if (outerContextLength != null) { + genericContext.toString; + genericContext.length = outerContextLength; + } + return typeParametersText + "(" + argumentsText + ") => " + returnTypeText; + }, + _rtiToString(rti, genericContext) { + var questionArgument, s, argumentKind, $name, $arguments, t2, + t1 = rti._kind, + kind = t1; + if (kind === 5) + return "erased"; + if (kind === 2) + return "dynamic"; + if (kind === 3) + return "void"; + if (kind === 1) + return "Never"; + if (kind === 4) + return "any"; + if (kind === 6) { + A.assertHelper(t1 === 6); + return A._rtiToString(rti._primary, genericContext); + } + if (kind === 7) { + A.assertHelper(t1 === 7); + questionArgument = rti._primary; + s = A._rtiToString(questionArgument, genericContext); + argumentKind = questionArgument._kind; + return (argumentKind === 12 || argumentKind === 13 ? "(" + s + ")" : s) + "?"; + } + if (kind === 8) { + A.assertHelper(t1 === 8); + return "FutureOr<" + A._rtiToString(rti._primary, genericContext) + ">"; + } + if (kind === 9) { + A.assertHelper(t1 === 9); + $name = A._unminifyOrTag(rti._primary); + $arguments = A.Rti__getInterfaceTypeArguments(rti); + return $arguments.length > 0 ? $name + ("<" + A._rtiArrayToString($arguments, genericContext) + ">") : $name; + } + if (kind === 11) + return A._recordRtiToString(rti, genericContext); + if (kind === 12) + return A._functionRtiToString(rti, genericContext, null); + if (kind === 13) { + A.assertHelper(t1 === 13); + return A._functionRtiToString(rti._primary, genericContext, A.Rti__getGenericFunctionBounds(rti)); + } + if (kind === 14) { + genericContext.toString; + A.assertHelper(t1 === 14); + t1 = rti._primary; + t2 = genericContext.length; + t1 = t2 - 1 - t1; + if (!(t1 >= 0 && t1 < t2)) + return A.ioore(genericContext, t1); + return genericContext[t1]; + } + return "?"; + }, + _unminifyOrTag(rawClassName) { + var preserved = init.mangledGlobalNames[rawClassName]; + if (preserved != null) + return preserved; + return rawClassName; + }, + _Universe_findRule(universe, targetType) { + var rule = universe.tR[targetType]; + for (; typeof rule == "string";) + rule = universe.tR[rule]; + return rule; + }, + _Universe_findErasedType(universe, cls) { + var $length, erased, $arguments, i, $interface, + t1 = universe.eT, + probe = t1[cls]; + if (probe == null) + return A._Universe_eval(universe, cls, false); + else if (typeof probe == "number") { + $length = probe; + erased = A._Universe__lookupTerminalRti(universe, 5, "#"); + $arguments = A._Utils_newArrayOrEmpty($length); + for (i = 0; i < $length; ++i) + $arguments[i] = erased; + $interface = A._Universe__lookupInterfaceRti(universe, cls, $arguments); + t1[cls] = $interface; + return $interface; + } else + return probe; + }, + _Universe_addRules(universe, rules) { + return A._Utils_objectAssign(universe.tR, rules); + }, + _Universe_addErasedTypes(universe, types) { + return A._Utils_objectAssign(universe.eT, types); + }, + _Universe_eval(universe, recipe, normalize) { + var rti, + t1 = universe.eC, + probe = t1.get(recipe); + if (probe != null) + return probe; + rti = A._Parser_parse(A._Parser_create(universe, null, recipe, normalize)); + t1.set(recipe, rti); + return rti; + }, + _Universe_evalInEnvironment(universe, environment, recipe) { + var probe, rti, + cache = environment._evalCache; + if (cache == null) + cache = environment._evalCache = new Map(); + probe = cache.get(recipe); + if (probe != null) + return probe; + rti = A._Parser_parse(A._Parser_create(universe, environment, recipe, true)); + cache.set(recipe, rti); + return rti; + }, + _Universe_bind(universe, environment, argumentsRti) { + var s, argumentsRecipe, probe, rti, + cache = environment._bindCache; + if (cache == null) + cache = environment._bindCache = new Map(); + s = argumentsRti._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + argumentsRecipe = s; + probe = cache.get(argumentsRecipe); + if (probe != null) + return probe; + rti = A._Universe__lookupBindingRti(universe, environment, argumentsRti._kind === 10 ? A.Rti__getBindingArguments(argumentsRti) : [argumentsRti]); + cache.set(argumentsRecipe, rti); + return rti; + }, + _Universe__installTypeTests(universe, rti) { + rti._as = A._installSpecializedAsCheck; + rti._is = A._installSpecializedIsTest; + return rti; + }, + _Universe__lookupTerminalRti(universe, kind, key) { + var rti, t1, + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = kind; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupStarRti(universe, baseType, normalize) { + var key, probe, t1, + s = baseType._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + key = s + "*"; + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createStarRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createStarRti(universe, baseType, key, normalize) { + var baseKind, t1, rti; + if (normalize) { + baseKind = baseType._kind; + if (!A.isSoundTopType(baseType)) + t1 = baseType === type$.Null || baseType === type$.JSNull || baseKind === 7 || baseKind === 6; + else + t1 = true; + if (t1) + return baseType; + } + rti = new A.Rti(null, null); + rti._kind = 6; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupQuestionRti(universe, baseType, normalize) { + var key, probe, t1, + s = baseType._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + key = s + "?"; + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createQuestionRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createQuestionRti(universe, baseType, key, normalize) { + var baseKind, t1, starArgument, rti; + if (normalize) { + baseKind = baseType._kind; + if (!A.isSoundTopType(baseType)) + if (!(baseType === type$.Null || baseType === type$.JSNull)) + if (baseKind !== 7) + if (baseKind === 8) { + A.assertHelper(baseType._kind === 8); + t1 = A.isNullable(baseType._primary); + } else + t1 = false; + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) + return baseType; + else if (baseKind === 1 || baseType === type$.legacy_Never) + return type$.Null; + else if (baseKind === 6) { + A.assertHelper(baseType._kind === 6); + starArgument = baseType._primary; + t1 = starArgument._kind; + if (t1 === 8) { + A.assertHelper(t1 === 8); + t1 = A.isNullable(starArgument._primary); + } else + t1 = false; + if (t1) + return starArgument; + else + return A.Rti__getQuestionFromStar(universe, baseType); + } + } + rti = new A.Rti(null, null); + rti._kind = 7; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupFutureOrRti(universe, baseType, normalize) { + var key, probe, t1, + s = baseType._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + key = s + "/"; + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createFutureOrRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createFutureOrRti(universe, baseType, key, normalize) { + var t1, rti; + if (normalize) { + t1 = baseType._kind; + if (A.isSoundTopType(baseType) || baseType === type$.Object || baseType === type$.legacy_Object) + return baseType; + else if (t1 === 1) + return A._Universe__lookupInterfaceRti(universe, "Future", [baseType]); + else if (baseType === type$.Null || baseType === type$.JSNull) + return type$.nullable_Future_Null; + } + rti = new A.Rti(null, null); + rti._kind = 8; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupGenericFunctionParameterRti(universe, index) { + var rti, t1, + key = "" + index + "^", + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 14; + rti._primary = index; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__canonicalRecipeJoin($arguments) { + var s, sep, i, s0, + $length = $arguments.length; + for (s = "", sep = "", i = 0; i < $length; ++i, sep = ",") { + s0 = $arguments[i]._canonicalRecipe; + if (A.assertTest(typeof s0 == "string")) + A.assertThrow("Missing canonical recipe"); + s += sep + s0; + } + return s; + }, + _Universe__canonicalRecipeJoinNamed($arguments) { + var s, sep, i, t1, nameSep, s0, + $length = $arguments.length; + A.assertHelper($length % 3 === 0); + for (s = "", sep = "", i = 0; i < $length; i += 3, sep = ",") { + t1 = $arguments[i]; + nameSep = $arguments[i + 1] ? "!" : ":"; + s0 = $arguments[i + 2]._canonicalRecipe; + if (A.assertTest(typeof s0 == "string")) + A.assertThrow("Missing canonical recipe"); + s += sep + t1 + nameSep + s0; + } + return s; + }, + _Universe__lookupInterfaceRti(universe, $name, $arguments) { + var s, probe, rti, t1; + A.assertHelper(typeof $name == "string"); + s = $name; + if ($arguments.length > 0) + s += "<" + A._Universe__canonicalRecipeJoin($arguments) + ">"; + probe = universe.eC.get(s); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 9; + rti._primary = $name; + rti._rest = $arguments; + if ($arguments.length > 0) + rti._precomputed1 = $arguments[0]; + rti._canonicalRecipe = s; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(s, t1); + return t1; + }, + _Universe__lookupBindingRti(universe, base, $arguments) { + var newBase, newArguments, s, key, probe, rti, + t1 = base._kind; + if (t1 === 10) { + A.assertHelper(t1 === 10); + newBase = base._primary; + newArguments = A.Rti__getBindingArguments(base).concat($arguments); + } else { + newArguments = $arguments; + newBase = base; + } + s = newBase._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + key = s + (";<" + A._Universe__canonicalRecipeJoin(newArguments) + ">"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 10; + rti._primary = newBase; + rti._rest = newArguments; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupRecordRti(universe, partialShapeTag, fields) { + var rti, t1, + key = "+" + (partialShapeTag + "(" + A._Universe__canonicalRecipeJoin(fields) + ")"), + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 11; + rti._primary = partialShapeTag; + rti._rest = fields; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupFunctionRti(universe, returnType, parameters) { + var requiredPositional, requiredPositionalLength, optionalPositional, optionalPositionalLength, named, namedLength, recipe, sep, key, probe, rti, t1, + s = returnType._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + requiredPositional = parameters._requiredPositional; + requiredPositionalLength = requiredPositional.length; + optionalPositional = parameters._optionalPositional; + optionalPositionalLength = optionalPositional.length; + named = parameters._named; + namedLength = named.length; + A.assertHelper(optionalPositionalLength === 0 || namedLength === 0); + recipe = "(" + A._Universe__canonicalRecipeJoin(requiredPositional); + if (optionalPositionalLength > 0) { + sep = requiredPositionalLength > 0 ? "," : ""; + recipe += sep + "[" + A._Universe__canonicalRecipeJoin(optionalPositional) + "]"; + } + if (namedLength > 0) { + sep = requiredPositionalLength > 0 ? "," : ""; + recipe += sep + "{" + A._Universe__canonicalRecipeJoinNamed(named) + "}"; + } + key = s + (recipe + ")"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 12; + rti._primary = returnType; + rti._rest = parameters; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupGenericFunctionRti(universe, baseFunctionType, bounds, normalize) { + var key, probe, t1, + s = baseFunctionType._canonicalRecipe; + if (A.assertTest(typeof s == "string")) + A.assertThrow("Missing canonical recipe"); + key = s + ("<" + A._Universe__canonicalRecipeJoin(bounds) + ">"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize) { + var $length, typeArguments, count, i, bound, substitutedBase, substitutedBounds, rti; + if (normalize) { + $length = bounds.length; + typeArguments = A._Utils_newArrayOrEmpty($length); + for (count = 0, i = 0; i < $length; ++i) { + bound = bounds[i]; + if (bound._kind === 1) { + typeArguments[i] = bound; + ++count; + } + } + if (count > 0) { + substitutedBase = A._substitute(universe, baseFunctionType, typeArguments, 0); + substitutedBounds = A._substituteArray(universe, bounds, typeArguments, 0); + return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, bounds !== substitutedBounds); + } + } + rti = new A.Rti(null, null); + rti._kind = 13; + rti._primary = baseFunctionType; + rti._rest = bounds; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Parser_create(universe, environment, recipe, normalize) { + return {u: universe, e: environment, r: recipe, s: [], p: 0, n: normalize}; + }, + _Parser_parse(parser) { + var t2, i, ch, t3, t4, array, end, item, + source = parser.r, + t1 = parser.s; + for (t2 = source.length, i = 0; i < t2;) { + ch = source.charCodeAt(i); + if (ch >= 48 && ch <= 57) + i = A._Parser_handleDigit(i + 1, ch, source, t1); + else if ((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124) + i = A._Parser_handleIdentifier(parser, i, source, t1, false); + else if (ch === 46) + i = A._Parser_handleIdentifier(parser, i, source, t1, true); + else { + ++i; + switch (ch) { + case 44: + break; + case 58: + t1.push(false); + break; + case 33: + t1.push(true); + break; + case 59: + t1.push(A._Parser_toType(parser.u, parser.e, t1.pop())); + break; + case 94: + t3 = parser.u; + t4 = t1.pop(); + A.assertHelper(typeof t4 == "number"); + t1.push(A._Universe__lookupGenericFunctionParameterRti(t3, t4)); + break; + case 35: + t1.push(A._Universe__lookupTerminalRti(parser.u, 5, "#")); + break; + case 64: + t1.push(A._Universe__lookupTerminalRti(parser.u, 2, "@")); + break; + case 126: + t1.push(A._Universe__lookupTerminalRti(parser.u, 3, "~")); + break; + case 60: + t1.push(parser.p); + parser.p = t1.length; + break; + case 62: + A._Parser_handleTypeArguments(parser, t1); + break; + case 38: + A._Parser_handleExtendedOperations(parser, t1); + break; + case 42: + t3 = parser.u; + t1.push(A._Universe__lookupStarRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 63: + t3 = parser.u; + t1.push(A._Universe__lookupQuestionRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 47: + t3 = parser.u; + t1.push(A._Universe__lookupFutureOrRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 40: + t1.push(-3); + t1.push(parser.p); + parser.p = t1.length; + break; + case 41: + A._Parser_handleArguments(parser, t1); + break; + case 91: + t1.push(parser.p); + parser.p = t1.length; + break; + case 93: + array = t1.splice(parser.p); + A._Parser_toTypes(parser.u, parser.e, array); + parser.p = t1.pop(); + t1.push(array); + t1.push(-1); + break; + case 123: + t1.push(parser.p); + parser.p = t1.length; + break; + case 125: + array = t1.splice(parser.p); + A._Parser_toTypesNamed(parser.u, parser.e, array); + parser.p = t1.pop(); + t1.push(array); + t1.push(-2); + break; + case 43: + end = source.indexOf("(", i); + A.assertHelper(end >= 0); + t1.push(source.substring(i, end)); + t1.push(-4); + t1.push(parser.p); + parser.p = t1.length; + i = end + 1; + break; + default: + throw "Bad character " + ch; + } + } + } + item = t1.pop(); + return A._Parser_toType(parser.u, parser.e, item); + }, + _Parser_handleDigit(i, digit, source, stack) { + var t1, ch, + value = digit - 48; + for (t1 = source.length; i < t1; ++i) { + ch = source.charCodeAt(i); + if (!(ch >= 48 && ch <= 57)) + break; + value = value * 10 + (ch - 48); + } + stack.push(value); + return i; + }, + _Parser_handleIdentifier(parser, start, source, stack, hasPeriod) { + var t1, ch, t2, string, environment, rule, recipe, + i = start + 1; + for (t1 = source.length; i < t1; ++i) { + ch = source.charCodeAt(i); + if (ch === 46) { + if (hasPeriod) + break; + hasPeriod = true; + } else { + if (!((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124)) + t2 = ch >= 48 && ch <= 57; + else + t2 = true; + if (!t2) + break; + } + } + string = source.substring(start, i); + if (hasPeriod) { + t1 = parser.u; + environment = parser.e; + t2 = environment._kind; + if (t2 === 10) { + A.assertHelper(t2 === 10); + environment = environment._primary; + } + A.assertHelper(environment._kind === 9); + rule = A._Universe_findRule(t1, environment._primary); + A.assertHelper(rule != null); + recipe = rule[string]; + if (recipe == null) + A.throwExpression('No "' + string + '" in "' + A.Rti__getCanonicalRecipe(environment) + '"'); + stack.push(A._Universe_evalInEnvironment(t1, environment, recipe)); + } else + stack.push(string); + return i; + }, + _Parser_handleTypeArguments(parser, stack) { + var base, + t1 = parser.u, + $arguments = A._Parser_collectArray(parser, stack), + head = stack.pop(); + if (typeof head == "string") + stack.push(A._Universe__lookupInterfaceRti(t1, head, $arguments)); + else { + base = A._Parser_toType(t1, parser.e, head); + switch (base._kind) { + case 12: + stack.push(A._Universe__lookupGenericFunctionRti(t1, base, $arguments, parser.n)); + break; + default: + stack.push(A._Universe__lookupBindingRti(t1, base, $arguments)); + break; + } + } + }, + _Parser_handleArguments(parser, stack) { + var optionalPositional, named, requiredPositional, returnType, parameters, _null = null, + t1 = parser.u, + head = stack.pop(); + if (typeof head == "number") + switch (head) { + case -1: + optionalPositional = stack.pop(); + named = _null; + break; + case -2: + named = stack.pop(); + optionalPositional = _null; + break; + default: + stack.push(head); + named = _null; + optionalPositional = named; + break; + } + else { + stack.push(head); + named = _null; + optionalPositional = named; + } + requiredPositional = A._Parser_collectArray(parser, stack); + head = stack.pop(); + switch (head) { + case -3: + head = stack.pop(); + if (optionalPositional == null) + optionalPositional = t1.sEA; + if (named == null) + named = t1.sEA; + returnType = A._Parser_toType(t1, parser.e, head); + parameters = new A._FunctionParameters(); + parameters._requiredPositional = requiredPositional; + parameters._optionalPositional = optionalPositional; + parameters._named = named; + stack.push(A._Universe__lookupFunctionRti(t1, returnType, parameters)); + return; + case -4: + A.assertHelper(optionalPositional == null); + A.assertHelper(named == null); + head = stack.pop(); + A.assertHelper(typeof head == "string"); + stack.push(A._Universe__lookupRecordRti(t1, head, requiredPositional)); + return; + default: + throw A.wrapException(A.AssertionError$("Unexpected state under `()`: " + A.S(head))); + } + }, + _Parser_handleExtendedOperations(parser, stack) { + var $top = stack.pop(); + if (0 === $top) { + stack.push(A._Universe__lookupTerminalRti(parser.u, 1, "0&")); + return; + } + if (1 === $top) { + stack.push(A._Universe__lookupTerminalRti(parser.u, 4, "1&")); + return; + } + throw A.wrapException(A.AssertionError$("Unexpected extended operation " + A.S($top))); + }, + _Parser_collectArray(parser, stack) { + var array = stack.splice(parser.p); + A._Parser_toTypes(parser.u, parser.e, array); + parser.p = stack.pop(); + return array; + }, + _Parser_toType(universe, environment, item) { + if (typeof item == "string") + return A._Universe__lookupInterfaceRti(universe, item, universe.sEA); + else if (typeof item == "number") { + environment.toString; + return A._Parser_indexToType(universe, environment, item); + } else + return item; + }, + _Parser_toTypes(universe, environment, items) { + var i, + $length = items.length; + for (i = 0; i < $length; ++i) + items[i] = A._Parser_toType(universe, environment, items[i]); + }, + _Parser_toTypesNamed(universe, environment, items) { + var i, + $length = items.length; + A.assertHelper($length % 3 === 0); + for (i = 2; i < $length; i += 3) + items[i] = A._Parser_toType(universe, environment, items[i]); + }, + _Parser_indexToType(universe, environment, index) { + var typeArguments, len, + t1 = environment._kind, + kind = t1; + if (kind === 10) { + if (index === 0) { + A.assertHelper(t1 === 10); + return environment._primary; + } + typeArguments = A.Rti__getBindingArguments(environment); + len = typeArguments.length; + if (index <= len) + return typeArguments[index - 1]; + index -= len; + A.assertHelper(t1 === 10); + environment = environment._primary; + kind = environment._kind; + } else if (index === 0) + return environment; + if (kind !== 9) + throw A.wrapException(A.AssertionError$("Indexed base must be an interface type")); + typeArguments = A.Rti__getInterfaceTypeArguments(environment); + if (index <= typeArguments.length) + return typeArguments[index - 1]; + throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0))); + }, + isSubtype(universe, s, t) { + var result, + sCache = s._isSubtypeCache; + if (sCache == null) + sCache = s._isSubtypeCache = new Map(); + result = sCache.get(t); + if (result == null) { + result = A._isSubtype(universe, s, null, t, null, false) ? 1 : 0; + sCache.set(t, result); + } + if (0 === result) + return false; + if (1 === result) + return true; + return true; + }, + _isSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var t1, sKind, leftTypeVariable, tKind, t2, sBounds, tBounds, sLength, i, sBound, tBound; + if (s === t) + return true; + if (!A.isSoundTopType(t)) + t1 = t === type$.legacy_Object; + else + t1 = true; + if (t1) + return true; + sKind = s._kind; + if (sKind === 4) + return true; + if (A.isSoundTopType(s)) + return false; + t1 = s._kind; + if (t1 === 1) + return true; + leftTypeVariable = sKind === 14; + if (leftTypeVariable) { + A.assertHelper(t1 === 14); + if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv, false)) + return true; + } + t1 = t._kind; + tKind = t1; + t2 = s === type$.Null || s === type$.JSNull; + if (t2) { + if (tKind === 8) { + A.assertHelper(t1 === 8); + return A._isSubtype(universe, s, sEnv, t._primary, tEnv, false); + } + return t === type$.Null || t === type$.JSNull || tKind === 7 || tKind === 6; + } + if (t === type$.Object) { + if (sKind === 8) { + A.assertHelper(s._kind === 8); + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + } + if (sKind === 6) { + A.assertHelper(s._kind === 6); + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + } + return sKind !== 7; + } + if (sKind === 6) { + A.assertHelper(s._kind === 6); + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + } + if (tKind === 6) { + t1 = A.Rti__getQuestionFromStar(universe, t); + return A._isSubtype(universe, s, sEnv, t1, tEnv, false); + } + if (sKind === 8) { + A.assertHelper(s._kind === 8); + if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv, false)) + return false; + return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv, false); + } + if (sKind === 7) { + t1 = A._isSubtype(universe, type$.Null, sEnv, t, tEnv, false); + if (t1) { + A.assertHelper(s._kind === 7); + t1 = A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + } else + t1 = false; + return t1; + } + if (tKind === 8) { + A.assertHelper(t1 === 8); + if (A._isSubtype(universe, s, sEnv, t._primary, tEnv, false)) + return true; + return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv, false); + } + if (tKind === 7) { + t1 = A._isSubtype(universe, s, sEnv, type$.Null, tEnv, false); + if (!t1) { + A.assertHelper(t._kind === 7); + t1 = A._isSubtype(universe, s, sEnv, t._primary, tEnv, false); + } else + t1 = true; + return t1; + } + if (leftTypeVariable) + return false; + t1 = sKind !== 12; + if ((!t1 || sKind === 13) && t === type$.Function) + return true; + t2 = sKind === 11; + if (t2 && t === type$.Record) + return true; + if (tKind === 13) { + if (s === type$.JavaScriptFunction) + return true; + if (sKind !== 13) + return false; + sBounds = A.Rti__getGenericFunctionBounds(s); + tBounds = A.Rti__getGenericFunctionBounds(t); + sLength = sBounds.length; + if (sLength !== tBounds.length) + return false; + sEnv = sEnv == null ? sBounds : sBounds.concat(sEnv); + tEnv = tEnv == null ? tBounds : tBounds.concat(tEnv); + for (i = 0; i < sLength; ++i) { + sBound = sBounds[i]; + tBound = tBounds[i]; + if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv, false) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv, false)) + return false; + } + A.assertHelper(s._kind === 13); + t1 = s._primary; + A.assertHelper(t._kind === 13); + return A._isFunctionSubtype(universe, t1, sEnv, t._primary, tEnv, false); + } + if (tKind === 12) { + if (s === type$.JavaScriptFunction) + return true; + if (t1) + return false; + return A._isFunctionSubtype(universe, s, sEnv, t, tEnv, false); + } + if (sKind === 9) { + if (tKind !== 9) + return false; + return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv, false); + } + if (t2 && tKind === 11) + return A._isRecordSubtype(universe, s, sEnv, t, tEnv, false); + return false; + }, + _isFunctionSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var t1, sParameters, tParameters, sRequiredPositional, tRequiredPositional, sRequiredPositionalLength, tRequiredPositionalLength, requiredPositionalDelta, sOptionalPositional, tOptionalPositional, sOptionalPositionalLength, tOptionalPositionalLength, i, sNamed, tNamed, sNamedLength, tNamedLength, sIndex, tIndex, tName, sName, sIsRequired; + A.assertHelper(s._kind === 12); + A.assertHelper(t._kind === 12); + A.assertHelper(s._kind === 12); + t1 = s._primary; + A.assertHelper(t._kind === 12); + if (!A._isSubtype(universe, t1, sEnv, t._primary, tEnv, false)) + return false; + A.assertHelper(s._kind === 12); + sParameters = s._rest; + A.assertHelper(t._kind === 12); + tParameters = t._rest; + sRequiredPositional = sParameters._requiredPositional; + tRequiredPositional = tParameters._requiredPositional; + sRequiredPositionalLength = sRequiredPositional.length; + tRequiredPositionalLength = tRequiredPositional.length; + if (sRequiredPositionalLength > tRequiredPositionalLength) + return false; + requiredPositionalDelta = tRequiredPositionalLength - sRequiredPositionalLength; + sOptionalPositional = sParameters._optionalPositional; + tOptionalPositional = tParameters._optionalPositional; + sOptionalPositionalLength = sOptionalPositional.length; + tOptionalPositionalLength = tOptionalPositional.length; + if (sRequiredPositionalLength + sOptionalPositionalLength < tRequiredPositionalLength + tOptionalPositionalLength) + return false; + for (i = 0; i < sRequiredPositionalLength; ++i) { + t1 = sRequiredPositional[i]; + if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv, false)) + return false; + } + for (i = 0; i < requiredPositionalDelta; ++i) { + t1 = sOptionalPositional[i]; + if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv, false)) + return false; + } + for (i = 0; i < tOptionalPositionalLength; ++i) { + t1 = sOptionalPositional[requiredPositionalDelta + i]; + if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv, false)) + return false; + } + sNamed = sParameters._named; + tNamed = tParameters._named; + sNamedLength = sNamed.length; + tNamedLength = tNamed.length; + for (sIndex = 0, tIndex = 0; tIndex < tNamedLength; tIndex += 3) { + tName = tNamed[tIndex]; + for (; true;) { + if (sIndex >= sNamedLength) + return false; + sName = sNamed[sIndex]; + sIndex += 3; + if (tName < sName) + return false; + sIsRequired = sNamed[sIndex - 2]; + if (sName < tName) { + if (sIsRequired) + return false; + continue; + } + t1 = tNamed[tIndex + 1]; + if (sIsRequired && !t1) + return false; + t1 = sNamed[sIndex - 1]; + if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv, false)) + return false; + break; + } + } + for (; sIndex < sNamedLength;) { + if (sNamed[sIndex + 1]) + return false; + sIndex += 3; + } + return true; + }, + _isInterfaceSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var sName, tName, t1, rule, recipes, $length, supertypeArgs, i; + A.assertHelper(s._kind === 9); + sName = s._primary; + A.assertHelper(t._kind === 9); + tName = t._primary; + for (; t1 = sName === tName, !t1;) { + rule = universe.tR[sName]; + if (rule == null) + return false; + if (typeof rule == "string") { + sName = rule; + continue; + } + recipes = rule[tName]; + if (recipes == null) + return false; + $length = recipes.length; + supertypeArgs = $length > 0 ? new Array($length) : init.typeUniverse.sEA; + for (i = 0; i < $length; ++i) + supertypeArgs[i] = A._Universe_evalInEnvironment(universe, s, recipes[i]); + A.assertHelper(t._kind === 9); + return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv, false); + } + A.assertHelper(t1); + return A._areArgumentsSubtypes(universe, A.Rti__getInterfaceTypeArguments(s), null, sEnv, A.Rti__getInterfaceTypeArguments(t), tEnv, false); + }, + _areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv, isLegacy) { + var i, + $length = sArgs.length; + A.assertHelper($length === tArgs.length); + for (i = 0; i < $length; ++i) + if (!A._isSubtype(universe, sArgs[i], sEnv, tArgs[i], tEnv, false)) + return false; + return true; + }, + _isRecordSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var t1, i, + sFields = A.Rti__getRecordFields(s), + tFields = A.Rti__getRecordFields(t), + sCount = sFields.length; + if (sCount !== tFields.length) + return false; + A.assertHelper(s._kind === 11); + t1 = s._primary; + A.assertHelper(t._kind === 11); + if (t1 !== t._primary) + return false; + for (i = 0; i < sCount; ++i) + if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv, false)) + return false; + return true; + }, + isNullable(t) { + var t1, + kind = t._kind; + if (!(t === type$.Null || t === type$.JSNull)) + if (!A.isSoundTopType(t)) + if (kind !== 7) { + if (kind === 6) { + A.assertHelper(t._kind === 6); + t1 = A.isNullable(t._primary); + } else + t1 = false; + if (!t1) + if (kind === 8) { + A.assertHelper(t._kind === 8); + t1 = A.isNullable(t._primary); + } else + t1 = false; + else + t1 = true; + } else + t1 = true; + else + t1 = true; + else + t1 = true; + return t1; + }, + isDefinitelyTopType(t) { + var t1; + if (!A.isSoundTopType(t)) + t1 = t === type$.legacy_Object; + else + t1 = true; + return t1; + }, + isSoundTopType(t) { + var kind = t._kind; + return kind === 2 || kind === 3 || kind === 4 || kind === 5 || t === type$.nullable_Object; + }, + _Utils_objectAssign(o, other) { + var i, key, + keys = Object.keys(other), + $length = keys.length; + for (i = 0; i < $length; ++i) { + key = keys[i]; + o[key] = other[key]; + } + }, + _Utils_newArrayOrEmpty($length) { + return $length > 0 ? new Array($length) : init.typeUniverse.sEA; + }, + Rti: function Rti(t0, t1) { + var _ = this; + _._as = t0; + _._is = t1; + _._cachedRuntimeType = _._specializedTestResource = _._isSubtypeCache = _._precomputed1 = null; + _._kind = 0; + _._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null; + }, + _FunctionParameters: function _FunctionParameters() { + this._named = this._optionalPositional = this._requiredPositional = null; + }, + _Type: function _Type(t0) { + this._rti = t0; + }, + _Error: function _Error() { + }, + _TypeError: function _TypeError(t0) { + this.__rti$_message = t0; + }, + _AsyncRun__initializeScheduleImmediate() { + var div, span, t1 = {}; + if (self.scheduleImmediate != null) + return A.async__AsyncRun__scheduleImmediateJsOverride$closure(); + if (self.MutationObserver != null && self.document != null) { + div = self.document.createElement("div"); + span = self.document.createElement("span"); + t1.storedCallback = null; + new self.MutationObserver(A.convertDartClosureToJS(new A._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true}); + return new A._AsyncRun__initializeScheduleImmediate_closure(t1, div, span); + } else if (self.setImmediate != null) + return A.async__AsyncRun__scheduleImmediateWithSetImmediate$closure(); + return A.async__AsyncRun__scheduleImmediateWithTimer$closure(); + }, + _AsyncRun__scheduleImmediateJsOverride(callback) { + self.scheduleImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateJsOverride_internalCallback(type$.void_Function._as(callback)), 0)); + }, + _AsyncRun__scheduleImmediateWithSetImmediate(callback) { + self.setImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(type$.void_Function._as(callback)), 0)); + }, + _AsyncRun__scheduleImmediateWithTimer(callback) { + A.Timer__createTimer(B.Duration_0, type$.void_Function._as(callback)); + }, + Timer__createTimer(duration, callback) { + var milliseconds = B.JSInt_methods._tdivFast$1(duration._duration, 1000); + return A._TimerImpl$(milliseconds < 0 ? 0 : milliseconds, callback); + }, + _TimerImpl$(milliseconds, callback) { + var t1 = new A._TimerImpl(); + t1._TimerImpl$2(milliseconds, callback); + return t1; + }, + _TimerImpl$periodic(milliseconds, callback) { + var t1 = new A._TimerImpl(); + t1._TimerImpl$periodic$2(milliseconds, callback); + return t1; + }, + _makeAsyncAwaitCompleter($T) { + return new A._AsyncAwaitCompleter(new A._Future($.Zone__current, $T._eval$1("_Future<0>")), $T._eval$1("_AsyncAwaitCompleter<0>")); + }, + _asyncStartSync(bodyFunction, completer) { + bodyFunction.call$2(0, null); + completer.isSync = true; + return completer._future; + }, + _asyncAwait(object, bodyFunction) { + A._awaitOnObject(object, bodyFunction); + }, + _asyncReturn(object, completer) { + completer.complete$1(object); + }, + _asyncRethrow(object, completer) { + completer.completeError$2(A.unwrapException(object), A.getTraceFromException(object)); + }, + _awaitOnObject(object, bodyFunction) { + var t1, future, + thenCallback = new A._awaitOnObject_closure(bodyFunction), + errorCallback = new A._awaitOnObject_closure0(bodyFunction); + if (object instanceof A._Future) + object._thenAwait$1$2(thenCallback, errorCallback, type$.dynamic); + else { + t1 = type$.dynamic; + if (object instanceof A._Future) + object.then$1$2$onError(thenCallback, errorCallback, t1); + else { + future = new A._Future($.Zone__current, type$._Future_dynamic); + future._async$_state = 8; + future._resultOrListeners = object; + future._thenAwait$1$2(thenCallback, errorCallback, t1); + } + } + }, + _wrapJsFunctionForAsync($function) { + var $protected = function(fn, ERROR) { + return function(errorCode, result) { + while (true) { + try { + fn(errorCode, result); + break; + } catch (error) { + result = error; + errorCode = ERROR; + } + } + }; + }($function, 1); + return $.Zone__current.registerBinaryCallback$3$1(new A._wrapJsFunctionForAsync_closure($protected), type$.void, type$.int, type$.dynamic); + }, + _SyncStarIterator__terminatedBody(_1, _2, _3) { + return 0; + }, + AsyncError$(error, stackTrace) { + var t1 = A.checkNotNullable(error, "error", type$.Object); + return new A.AsyncError(t1, stackTrace == null ? A.AsyncError_defaultStackTrace(error) : stackTrace); + }, + AsyncError_defaultStackTrace(error) { + var stackTrace; + if (type$.Error._is(error)) { + stackTrace = error.get$stackTrace(); + if (stackTrace != null) + return stackTrace; + } + return B._StringStackTrace_uwd; + }, + Future_Future(computation, $T) { + var result = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + A.Timer_Timer(B.Duration_0, new A.Future_Future_closure(result, computation)); + return result; + }, + Future_Future$sync(computation, $T) { + var result, error, stackTrace, future, replacement, t1, exception; + try { + result = computation.call$0(); + t1 = $T._eval$1("Future<0>")._is(result) ? result : A._Future$value(result, $T); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + stackTrace = A.getTraceFromException(exception); + t1 = $.Zone__current; + future = new A._Future(t1, $T._eval$1("_Future<0>")); + replacement = t1.errorCallback$2(error, stackTrace); + if (replacement != null) + future._asyncCompleteError$2(replacement.error, replacement.stackTrace); + else + future._asyncCompleteError$2(error, stackTrace); + return future; + } + }, + Future_Future$value(value, $T) { + var t1 = value == null ? $T._as(value) : value, + t2 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + t2._asyncComplete$1(t1); + return t2; + }, + Future_Future$error(error, stackTrace, $T) { + var t1, replacement; + A.checkNotNullable(error, "error", type$.Object); + t1 = $.Zone__current; + if (t1 !== B.C__RootZone) { + replacement = t1.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } + } + if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + t1._asyncCompleteError$2(error, stackTrace); + return t1; + }, + Future_Future$delayed(duration, $T) { + var result, + t1 = !$T._is(null); + if (t1) + throw A.wrapException(A.ArgumentError$value(null, "computation", "The type parameter is not nullable")); + result = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + A.Timer_Timer(duration, new A.Future_Future$delayed_closure(null, result, $T)); + return result; + }, + Future_wait(futures, $T) { + var handleError, future, pos, e, st, t1, t2, exception, _box_0 = {}, cleanUp = null, + eagerError = false, + _future = new A._Future($.Zone__current, $T._eval$1("_Future>")); + _box_0.values = null; + _box_0.remaining = 0; + _box_0.stackTrace = _box_0.error = null; + handleError = new A.Future_wait_handleError(_box_0, cleanUp, eagerError, _future); + try { + for (t1 = J.get$iterator$ax(futures), t2 = type$.Null; t1.moveNext$0();) { + future = t1.get$current(); + pos = _box_0.remaining; + future.then$1$2$onError(new A.Future_wait_closure(_box_0, pos, _future, $T, cleanUp, eagerError), handleError, t2); + ++_box_0.remaining; + } + t1 = _box_0.remaining; + if (t1 === 0) { + t1 = _future; + t1._completeWithValue$1(A._setArrayType([], $T._eval$1("JSArray<0>"))); + return t1; + } + _box_0.values = A.List_List$filled(t1, null, false, $T._eval$1("0?")); + } catch (exception) { + e = A.unwrapException(exception); + st = A.getTraceFromException(exception); + if (_box_0.remaining === 0 || A.boolConversionCheck(eagerError)) + return A.Future_Future$error(e, st, $T._eval$1("List<0>")); + else { + _box_0.error = e; + _box_0.stackTrace = st; + } + } + return _future; + }, + _completeWithErrorCallback(result, error, stackTrace) { + var replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } else if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + result._completeError$2(error, stackTrace); + }, + _Future$zoneValue(value, _zone, $T) { + var t1 = new A._Future(_zone, $T._eval$1("_Future<0>")); + $T._as(value); + t1._async$_state = 8; + t1._resultOrListeners = value; + return t1; + }, + _Future$value(value, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + $T._as(value); + t1._async$_state = 8; + t1._resultOrListeners = value; + return t1; + }, + _Future__chainCoreFutureSync(source, target) { + var t1, t2, t3, listeners; + A.assertHelper(target._async$_state <= 3); + for (t1 = type$._Future_dynamic; t2 = source._async$_state, t3 = (t2 & 4) !== 0, t3;) { + A.assertHelper(t3); + source = t1._as(source._resultOrListeners); + } + t1 = t2 | target._async$_state & 1; + source._async$_state = t1; + if ((t1 & 24) !== 0) { + listeners = target._removeListeners$0(); + target._cloneResult$1(source); + A._Future__propagateToListeners(target, listeners); + } else { + listeners = type$.nullable__FutureListener_dynamic_dynamic._as(target._resultOrListeners); + target._setChained$1(source); + source._prependListeners$1(listeners); + } + }, + _Future__chainCoreFutureAsync(source, target) { + var t2, t3, t4, listeners, _box_0 = {}, + t1 = _box_0.source = source; + A.assertHelper(target._async$_state <= 3); + for (t2 = type$._Future_dynamic; t3 = t1._async$_state, t4 = (t3 & 4) !== 0, t4; t1 = source) { + A.assertHelper(t4); + source = t2._as(t1._resultOrListeners); + _box_0.source = source; + } + if ((t3 & 24) === 0) { + listeners = type$.nullable__FutureListener_dynamic_dynamic._as(target._resultOrListeners); + target._setChained$1(t1); + _box_0.source._prependListeners$1(listeners); + return; + } + if ((t3 & 16) === 0 && target._resultOrListeners == null) { + target._cloneResult$1(t1); + return; + } + target._setPendingComplete$0(); + target._zone.scheduleMicrotask$1(new A._Future__chainCoreFutureAsync_closure(_box_0, target)); + }, + _Future__propagateToListeners(source, listeners) { + var t2, t3, t4, _box_0, t5, t6, hasError, asyncError, nextListener, nextListener0, sourceResult, t7, zone, previous, oldZone, result, current, _box_1 = {}, + t1 = _box_1.source = source; + for (t2 = type$.AsyncError, t3 = type$.nullable__FutureListener_dynamic_dynamic, t4 = type$.Future_dynamic; true;) { + _box_0 = {}; + A.assertHelper((t1._async$_state & 24) !== 0); + t1 = _box_1.source; + t5 = t1._async$_state; + t6 = (t5 & 16) === 0; + hasError = !t6; + if (listeners == null) { + if (hasError && (t5 & 1) === 0) { + A.assertHelper(hasError); + asyncError = t2._as(t1._resultOrListeners); + _box_1.source._zone.handleUncaughtError$2(asyncError.error, asyncError.stackTrace); + } + return; + } + _box_0.listener = listeners; + nextListener = listeners._nextListener; + for (t1 = listeners; nextListener != null; t1 = nextListener, nextListener = nextListener0) { + t1._nextListener = null; + A._Future__propagateToListeners(_box_1.source, t1); + _box_0.listener = nextListener; + nextListener0 = nextListener._nextListener; + } + t5 = _box_1.source; + sourceResult = t5._resultOrListeners; + _box_0.listenerHasError = hasError; + _box_0.listenerValueOrError = sourceResult; + if (t6) { + t7 = t1.state; + t7 = (t7 & 1) !== 0 || (t7 & 15) === 8; + } else + t7 = true; + if (t7) { + zone = t1.result._zone; + if (hasError) { + t1 = t5._zone; + t1 = !(t1 === zone || t1.get$errorZone() === zone.get$errorZone()); + } else + t1 = false; + if (t1) { + t1 = _box_1.source; + A.assertHelper((t1._async$_state & 16) !== 0); + asyncError = t2._as(t1._resultOrListeners); + _box_1.source._zone.handleUncaughtError$2(asyncError.error, asyncError.stackTrace); + return; + } + t1 = $.Zone__current; + if (t1 !== zone) { + A.assertHelper(zone !== t1); + previous = $.Zone__current; + $.Zone__current = zone; + oldZone = previous; + } else + oldZone = null; + t1 = _box_0.listener.state; + if ((t1 & 15) === 8) + new A._Future__propagateToListeners_handleWhenCompleteCallback(_box_0, _box_1, hasError).call$0(); + else if (t6) { + if ((t1 & 1) !== 0) + new A._Future__propagateToListeners_handleValueCallback(_box_0, sourceResult).call$0(); + } else if ((t1 & 2) !== 0) + new A._Future__propagateToListeners_handleError(_box_1, _box_0).call$0(); + if (oldZone != null) + $.Zone__current = oldZone; + t1 = _box_0.listenerValueOrError; + if (t1 instanceof A._Future) { + t5 = _box_0.listener.$ti; + t5 = t5._eval$1("Future<2>")._is(t1) || !t5._rest[1]._is(t1); + } else + t5 = false; + if (t5) { + t4._as(t1); + result = _box_0.listener.result; + if ((t1._async$_state & 24) !== 0) { + A.assertHelper((result._async$_state & 24) === 0); + current = t3._as(result._resultOrListeners); + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + result._cloneResult$1(t1); + _box_1.source = t1; + continue; + } else + A._Future__chainCoreFutureSync(t1, result); + return; + } + } + result = _box_0.listener.result; + A.assertHelper((result._async$_state & 24) === 0); + current = t3._as(result._resultOrListeners); + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + t1 = _box_0.listenerHasError; + t5 = _box_0.listenerValueOrError; + t6 = result._async$_state & 24; + if (!t1) { + result.$ti._precomputed1._as(t5); + A.assertHelper(t6 === 0); + result._async$_state = 8; + result._resultOrListeners = t5; + } else { + t2._as(t5); + A.assertHelper(t6 === 0); + result._async$_state = result._async$_state & 1 | 16; + result._resultOrListeners = t5; + } + _box_1.source = result; + t1 = result; + } + }, + _registerErrorHandler(errorHandler, zone) { + if (type$.dynamic_Function_Object_StackTrace._is(errorHandler)) + return zone.registerBinaryCallback$3$1(errorHandler, type$.dynamic, type$.Object, type$.StackTrace); + if (type$.dynamic_Function_Object._is(errorHandler)) + return zone.registerUnaryCallback$2$1(errorHandler, type$.dynamic, type$.Object); + throw A.wrapException(A.ArgumentError$value(errorHandler, "onError", string$.Error_)); + }, + _microtaskLoop() { + var entry, next; + for (entry = $._nextCallback; entry != null; entry = $._nextCallback) { + $._lastPriorityCallback = null; + next = entry.next; + $._nextCallback = next; + if (next == null) + $._lastCallback = null; + entry.callback.call$0(); + } + }, + _startMicrotaskLoop() { + $._isInCallbackLoop = true; + try { + A._microtaskLoop(); + } finally { + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + if ($._nextCallback != null) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); + } + }, + _scheduleAsyncCallback(callback) { + var newEntry = new A._AsyncCallbackEntry(callback), + lastCallback = $._lastCallback; + if (lastCallback == null) { + $._nextCallback = $._lastCallback = newEntry; + if (!$._isInCallbackLoop) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); + } else + $._lastCallback = lastCallback.next = newEntry; + }, + _schedulePriorityAsyncCallback(callback) { + var entry, lastPriorityCallback, next, + t1 = $._nextCallback; + if (t1 == null) { + A._scheduleAsyncCallback(callback); + $._lastPriorityCallback = $._lastCallback; + return; + } + entry = new A._AsyncCallbackEntry(callback); + lastPriorityCallback = $._lastPriorityCallback; + if (lastPriorityCallback == null) { + entry.next = t1; + $._nextCallback = $._lastPriorityCallback = entry; + } else { + next = lastPriorityCallback.next; + entry.next = next; + $._lastPriorityCallback = lastPriorityCallback.next = entry; + if (next == null) + $._lastCallback = entry; + } + }, + scheduleMicrotask(callback) { + var t1, _null = null, + currentZone = $.Zone__current; + if (B.C__RootZone === currentZone) { + A._rootScheduleMicrotask(_null, _null, B.C__RootZone, callback); + return; + } + if (B.C__RootZone === currentZone.get$_scheduleMicrotask().zone) + t1 = B.C__RootZone.get$errorZone() === currentZone.get$errorZone(); + else + t1 = false; + if (t1) { + A._rootScheduleMicrotask(_null, _null, currentZone, currentZone.registerCallback$1$1(callback, type$.void)); + return; + } + t1 = $.Zone__current; + t1.scheduleMicrotask$1(t1.bindCallbackGuarded$1(callback)); + }, + StreamIterator_StreamIterator(stream, $T) { + return new A._StreamIterator(A.checkNotNullable(stream, "stream", type$.Object), $T._eval$1("_StreamIterator<0>")); + }, + StreamController_StreamController(onCancel, onListen, sync, $T) { + var _null = null; + return sync ? new A._SyncStreamController(onListen, _null, _null, onCancel, $T._eval$1("_SyncStreamController<0>")) : new A._AsyncStreamController(onListen, _null, _null, onCancel, $T._eval$1("_AsyncStreamController<0>")); + }, + _runGuarded(notificationHandler) { + var e, s, exception; + if (notificationHandler == null) + return; + try { + notificationHandler.call$0(); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + $.Zone__current.handleUncaughtError$2(e, s); + } + }, + _ControllerSubscription$(_controller, onData, onError, onDone, cancelOnError, $T) { + var t1 = $.Zone__current, + t2 = cancelOnError ? 1 : 0, + t3 = onError != null ? 32 : 0, + t4 = A._BufferingStreamSubscription__registerDataHandler(t1, onData, $T), + t5 = A._BufferingStreamSubscription__registerErrorHandler(t1, onError), + t6 = onDone == null ? A.async___nullDoneHandler$closure() : onDone; + return new A._ControllerSubscription(_controller, t4, t5, t1.registerCallback$1$1(t6, type$.void), t1, t2 | t3, $T._eval$1("_ControllerSubscription<0>")); + }, + _BufferingStreamSubscription__registerDataHandler(zone, handleData, $T) { + var t1 = handleData == null ? A.async___nullDataHandler$closure() : handleData; + return zone.registerUnaryCallback$2$1(t1, type$.void, $T); + }, + _BufferingStreamSubscription__registerErrorHandler(zone, handleError) { + if (handleError == null) + handleError = A.async___nullErrorHandler$closure(); + if (type$.void_Function_Object_StackTrace._is(handleError)) + return zone.registerBinaryCallback$3$1(handleError, type$.dynamic, type$.Object, type$.StackTrace); + if (type$.void_Function_Object._is(handleError)) + return zone.registerUnaryCallback$2$1(handleError, type$.dynamic, type$.Object); + throw A.wrapException(A.ArgumentError$("handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.", null)); + }, + _nullDataHandler(value) { + }, + _nullErrorHandler(error, stackTrace) { + type$.Object._as(error); + type$.StackTrace._as(stackTrace); + $.Zone__current.handleUncaughtError$2(error, stackTrace); + }, + _nullDoneHandler() { + }, + _runUserCode(userCode, onSuccess, onError, $T) { + var e, s, replacement, error, stackTrace, exception; + try { + onSuccess.call$1(userCode.call$0()); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + replacement = $.Zone__current.errorCallback$2(e, s); + if (replacement == null) + onError.call$2(e, s); + else { + error = replacement.error; + stackTrace = replacement.stackTrace; + onError.call$2(error, stackTrace); + } + } + }, + _cancelAndError(subscription, future, error, stackTrace) { + var cancelFuture = subscription.cancel$0(), + t1 = $.$get$Future__nullFuture(); + if (cancelFuture !== t1) + cancelFuture.whenComplete$1(new A._cancelAndError_closure(future, error, stackTrace)); + else + future._completeError$2(error, stackTrace); + }, + _cancelAndErrorClosure(subscription, future) { + return new A._cancelAndErrorClosure_closure(subscription, future); + }, + _cancelAndValue(subscription, future, value) { + var cancelFuture = subscription.cancel$0(), + t1 = $.$get$Future__nullFuture(); + if (cancelFuture !== t1) + cancelFuture.whenComplete$1(new A._cancelAndValue_closure(future, value)); + else + future._complete$1(value); + }, + _StreamHandlerTransformer$(handleDone, $S, $T) { + return new A._StreamHandlerTransformer(new A._StreamHandlerTransformer_closure(null, null, handleDone, $T, $S), $S._eval$1("@<0>")._bind$1($T)._eval$1("_StreamHandlerTransformer<1,2>")); + }, + Timer_Timer(duration, callback) { + var t1 = $.Zone__current; + if (t1 === B.C__RootZone) + return t1.createTimer$2(duration, callback); + return t1.createTimer$2(duration, t1.bindCallbackGuarded$1(callback)); + }, + _rootHandleUncaughtError($self, $parent, zone, error, stackTrace) { + A._rootHandleError(type$.Object._as(error), type$.StackTrace._as(stackTrace)); + }, + _rootHandleError(error, stackTrace) { + A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace)); + }, + _rootRun($self, $parent, zone, f, $R) { + var old, t1, previous; + type$.nullable_Zone._as($self); + type$.nullable_ZoneDelegate._as($parent); + type$.Zone._as(zone); + $R._eval$1("0()")._as(f); + t1 = $.Zone__current; + if (t1 === zone) + return f.call$0(); + A.assertHelper(zone !== t1); + previous = $.Zone__current; + $.Zone__current = zone; + old = previous; + try { + t1 = f.call$0(); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRunUnary($self, $parent, zone, f, arg, $R, $T) { + var old, t1, previous; + type$.nullable_Zone._as($self); + type$.nullable_ZoneDelegate._as($parent); + type$.Zone._as(zone); + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + $T._as(arg); + t1 = $.Zone__current; + if (t1 === zone) + return f.call$1(arg); + A.assertHelper(zone !== t1); + previous = $.Zone__current; + $.Zone__current = zone; + old = previous; + try { + t1 = f.call$1(arg); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRunBinary($self, $parent, zone, f, arg1, arg2, $R, T1, T2) { + var old, t1, previous; + type$.nullable_Zone._as($self); + type$.nullable_ZoneDelegate._as($parent); + type$.Zone._as(zone); + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + T1._as(arg1); + T2._as(arg2); + t1 = $.Zone__current; + if (t1 === zone) + return f.call$2(arg1, arg2); + A.assertHelper(zone !== t1); + previous = $.Zone__current; + $.Zone__current = zone; + old = previous; + try { + t1 = f.call$2(arg1, arg2); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRegisterCallback($self, $parent, zone, f, $R) { + return $R._eval$1("0()")._as(f); + }, + _rootRegisterUnaryCallback($self, $parent, zone, f, $R, $T) { + return $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + }, + _rootRegisterBinaryCallback($self, $parent, zone, f, $R, T1, T2) { + return $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + }, + _rootErrorCallback($self, $parent, zone, error, stackTrace) { + type$.Object._as(error); + type$.nullable_StackTrace._as(stackTrace); + return null; + }, + _rootScheduleMicrotask($self, $parent, zone, f) { + var t1, t2; + type$.void_Function._as(f); + if (B.C__RootZone !== zone) { + t1 = B.C__RootZone.get$errorZone(); + t2 = zone.get$errorZone(); + f = t1 !== t2 ? zone.bindCallbackGuarded$1(f) : zone.bindCallback$1$1(f, type$.void); + } + A._scheduleAsyncCallback(f); + }, + _rootCreateTimer($self, $parent, zone, duration, callback) { + type$.Duration._as(duration); + type$.void_Function._as(callback); + return A.Timer__createTimer(duration, B.C__RootZone !== zone ? zone.bindCallback$1$1(callback, type$.void) : callback); + }, + _rootCreatePeriodicTimer($self, $parent, zone, duration, callback) { + var milliseconds; + type$.Duration._as(duration); + type$.void_Function_Timer._as(callback); + if (B.C__RootZone !== zone) + callback = zone.bindUnaryCallback$2$1(callback, type$.void, type$.Timer); + milliseconds = B.JSInt_methods._tdivFast$1(duration._duration, 1000); + return A._TimerImpl$periodic(milliseconds < 0 ? 0 : milliseconds, callback); + }, + _rootPrint($self, $parent, zone, line) { + A.printString(A._asString(line)); + }, + _printToZone(line) { + $.Zone__current.print$1(line); + }, + _rootFork($self, $parent, zone, specification, zoneValues) { + var valueMap, t1, handleUncaughtError; + type$.nullable_ZoneSpecification._as(specification); + type$.nullable_Map_of_nullable_Object_and_nullable_Object._as(zoneValues); + $.printToZone = A.async___printToZone$closure(); + if (specification == null) + specification = B._ZoneSpecification_48t; + if (zoneValues == null) + valueMap = zone.get$_async$_map(); + else { + t1 = type$.nullable_Object; + valueMap = A.HashMap_HashMap$from(zoneValues, t1, t1); + } + t1 = new A._CustomZone(zone.get$_run(), zone.get$_runUnary(), zone.get$_runBinary(), zone.get$_registerCallback(), zone.get$_registerUnaryCallback(), zone.get$_registerBinaryCallback(), zone.get$_errorCallback(), zone.get$_scheduleMicrotask(), zone.get$_createTimer(), zone.get$_createPeriodicTimer(), zone.get$_print(), zone.get$_fork(), zone.get$_handleUncaughtError(), zone, valueMap); + handleUncaughtError = specification.handleUncaughtError; + if (handleUncaughtError != null) + t1.set$_handleUncaughtError(new A._ZoneFunction(t1, handleUncaughtError, type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace)); + return t1; + }, + runZoned(body, zoneValues, $R) { + A.checkNotNullable(body, "body", $R._eval$1("0()")); + return A._runZoned(body, zoneValues, null, $R); + }, + _runZoned(body, zoneValues, specification, $R) { + return $.Zone__current.fork$2$specification$zoneValues(specification, zoneValues).run$1$1(body, $R); + }, + _AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) { + this._box_0 = t0; + }, + _AsyncRun__initializeScheduleImmediate_closure: function _AsyncRun__initializeScheduleImmediate_closure(t0, t1, t2) { + this._box_0 = t0; + this.div = t1; + this.span = t2; + }, + _AsyncRun__scheduleImmediateJsOverride_internalCallback: function _AsyncRun__scheduleImmediateJsOverride_internalCallback(t0) { + this.callback = t0; + }, + _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: function _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(t0) { + this.callback = t0; + }, + _TimerImpl: function _TimerImpl() { + this._tick = 0; + }, + _TimerImpl_internalCallback: function _TimerImpl_internalCallback(t0, t1) { + this.$this = t0; + this.callback = t1; + }, + _TimerImpl$periodic_closure: function _TimerImpl$periodic_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.milliseconds = t1; + _.start = t2; + _.callback = t3; + }, + _AsyncAwaitCompleter: function _AsyncAwaitCompleter(t0, t1) { + this._future = t0; + this.isSync = false; + this.$ti = t1; + }, + _awaitOnObject_closure: function _awaitOnObject_closure(t0) { + this.bodyFunction = t0; + }, + _awaitOnObject_closure0: function _awaitOnObject_closure0(t0) { + this.bodyFunction = t0; + }, + _wrapJsFunctionForAsync_closure: function _wrapJsFunctionForAsync_closure(t0) { + this.$protected = t0; + }, + _SyncStarIterator: function _SyncStarIterator(t0, t1) { + var _ = this; + _._body = t0; + _._suspendedBodies = _._nestedIterator = _._datum = _._async$_current = null; + _.$ti = t1; + }, + _SyncStarIterable: function _SyncStarIterable(t0, t1) { + this._outerHelper = t0; + this.$ti = t1; + }, + AsyncError: function AsyncError(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + _BroadcastStream: function _BroadcastStream(t0, t1) { + this._controller = t0; + this.$ti = t1; + }, + _BroadcastSubscription: function _BroadcastSubscription(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._eventState = 0; + _._async$_previous = _._async$_next = null; + _._controller = t0; + _._async$_onData = t1; + _._onError = t2; + _._onDone = t3; + _._zone = t4; + _._async$_state = t5; + _._pending = _._cancelFuture = null; + _.$ti = t6; + }, + _BroadcastStreamController: function _BroadcastStreamController() { + }, + _SyncBroadcastStreamController: function _SyncBroadcastStreamController(t0, t1, t2) { + var _ = this; + _.onListen = t0; + _.onCancel = t1; + _._async$_state = 0; + _._doneFuture = _._addStreamState = _._lastSubscription = _._firstSubscription = null; + _.$ti = t2; + }, + _SyncBroadcastStreamController__sendData_closure: function _SyncBroadcastStreamController__sendData_closure(t0, t1) { + this.$this = t0; + this.data = t1; + }, + _SyncBroadcastStreamController__sendError_closure: function _SyncBroadcastStreamController__sendError_closure(t0, t1, t2) { + this.$this = t0; + this.error = t1; + this.stackTrace = t2; + }, + _SyncBroadcastStreamController__sendDone_closure: function _SyncBroadcastStreamController__sendDone_closure(t0) { + this.$this = t0; + }, + Future_Future_closure: function Future_Future_closure(t0, t1) { + this.result = t0; + this.computation = t1; + }, + Future_Future$delayed_closure: function Future_Future$delayed_closure(t0, t1, t2) { + this.computation = t0; + this.result = t1; + this.T = t2; + }, + Future_wait_handleError: function Future_wait_handleError(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.cleanUp = t1; + _.eagerError = t2; + _._future = t3; + }, + Future_wait_closure: function Future_wait_closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.pos = t1; + _._future = t2; + _.T = t3; + _.cleanUp = t4; + _.eagerError = t5; + }, + _Completer: function _Completer() { + }, + _AsyncCompleter: function _AsyncCompleter(t0, t1) { + this.future = t0; + this.$ti = t1; + }, + _SyncCompleter: function _SyncCompleter(t0, t1) { + this.future = t0; + this.$ti = t1; + }, + _FutureListener: function _FutureListener(t0, t1, t2, t3, t4) { + var _ = this; + _._nextListener = null; + _.result = t0; + _.state = t1; + _.callback = t2; + _.errorCallback = t3; + _.$ti = t4; + }, + _Future: function _Future(t0, t1) { + var _ = this; + _._async$_state = 0; + _._zone = t0; + _._resultOrListeners = null; + _.$ti = t1; + }, + _Future__addListener_closure: function _Future__addListener_closure(t0, t1) { + this.$this = t0; + this.listener = t1; + }, + _Future__prependListeners_closure: function _Future__prependListeners_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _Future__chainForeignFuture_closure: function _Future__chainForeignFuture_closure(t0) { + this.$this = t0; + }, + _Future__chainForeignFuture_closure0: function _Future__chainForeignFuture_closure0(t0) { + this.$this = t0; + }, + _Future__chainForeignFuture_closure1: function _Future__chainForeignFuture_closure1(t0, t1, t2) { + this.$this = t0; + this.e = t1; + this.s = t2; + }, + _Future__chainCoreFutureAsync_closure: function _Future__chainCoreFutureAsync_closure(t0, t1) { + this._box_0 = t0; + this.target = t1; + }, + _Future__asyncCompleteWithValue_closure: function _Future__asyncCompleteWithValue_closure(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _Future__asyncCompleteError_closure: function _Future__asyncCompleteError_closure(t0, t1, t2) { + this.$this = t0; + this.error = t1; + this.stackTrace = t2; + }, + _Future__propagateToListeners_handleWhenCompleteCallback: function _Future__propagateToListeners_handleWhenCompleteCallback(t0, t1, t2) { + this._box_0 = t0; + this._box_1 = t1; + this.hasError = t2; + }, + _Future__propagateToListeners_handleWhenCompleteCallback_closure: function _Future__propagateToListeners_handleWhenCompleteCallback_closure(t0) { + this.originalSource = t0; + }, + _Future__propagateToListeners_handleValueCallback: function _Future__propagateToListeners_handleValueCallback(t0, t1) { + this._box_0 = t0; + this.sourceResult = t1; + }, + _Future__propagateToListeners_handleError: function _Future__propagateToListeners_handleError(t0, t1) { + this._box_1 = t0; + this._box_0 = t1; + }, + _AsyncCallbackEntry: function _AsyncCallbackEntry(t0) { + this.callback = t0; + this.next = null; + }, + Stream: function Stream() { + }, + Stream_length_closure: function Stream_length_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + Stream_length_closure0: function Stream_length_closure0(t0, t1) { + this._box_0 = t0; + this.future = t1; + }, + Stream_first_closure: function Stream_first_closure(t0) { + this.future = t0; + }, + Stream_first_closure0: function Stream_first_closure0(t0, t1, t2) { + this.$this = t0; + this.subscription = t1; + this.future = t2; + }, + Stream_firstWhere_closure: function Stream_firstWhere_closure(t0, t1, t2) { + this.$this = t0; + this.orElse = t1; + this.future = t2; + }, + Stream_firstWhere_closure0: function Stream_firstWhere_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.test = t1; + _.subscription = t2; + _.future = t3; + }, + Stream_firstWhere__closure: function Stream_firstWhere__closure(t0, t1) { + this.test = t0; + this.value = t1; + }, + Stream_firstWhere__closure0: function Stream_firstWhere__closure0(t0, t1, t2) { + this.subscription = t0; + this.future = t1; + this.value = t2; + }, + StreamTransformerBase: function StreamTransformerBase() { + }, + _StreamController: function _StreamController() { + }, + _StreamController__subscribe_closure: function _StreamController__subscribe_closure(t0) { + this.$this = t0; + }, + _StreamController__recordCancel_complete: function _StreamController__recordCancel_complete(t0) { + this.$this = t0; + }, + _SyncStreamControllerDispatch: function _SyncStreamControllerDispatch() { + }, + _AsyncStreamControllerDispatch: function _AsyncStreamControllerDispatch() { + }, + _AsyncStreamController: function _AsyncStreamController(t0, t1, t2, t3, t4) { + var _ = this; + _._varData = null; + _._async$_state = 0; + _._doneFuture = null; + _.onListen = t0; + _.onPause = t1; + _.onResume = t2; + _.onCancel = t3; + _.$ti = t4; + }, + _SyncStreamController: function _SyncStreamController(t0, t1, t2, t3, t4) { + var _ = this; + _._varData = null; + _._async$_state = 0; + _._doneFuture = null; + _.onListen = t0; + _.onPause = t1; + _.onResume = t2; + _.onCancel = t3; + _.$ti = t4; + }, + _ControllerStream: function _ControllerStream(t0, t1) { + this._controller = t0; + this.$ti = t1; + }, + _ControllerSubscription: function _ControllerSubscription(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._controller = t0; + _._async$_onData = t1; + _._onError = t2; + _._onDone = t3; + _._zone = t4; + _._async$_state = t5; + _._pending = _._cancelFuture = null; + _.$ti = t6; + }, + _StreamSinkWrapper: function _StreamSinkWrapper(t0, t1) { + this._async$_target = t0; + this.$ti = t1; + }, + _BufferingStreamSubscription: function _BufferingStreamSubscription() { + }, + _BufferingStreamSubscription__sendError_sendError: function _BufferingStreamSubscription__sendError_sendError(t0, t1, t2) { + this.$this = t0; + this.error = t1; + this.stackTrace = t2; + }, + _BufferingStreamSubscription__sendDone_sendDone: function _BufferingStreamSubscription__sendDone_sendDone(t0) { + this.$this = t0; + }, + _StreamImpl: function _StreamImpl() { + }, + _DelayedEvent: function _DelayedEvent() { + }, + _DelayedData: function _DelayedData(t0, t1) { + this.value = t0; + this.next = null; + this.$ti = t1; + }, + _DelayedError: function _DelayedError(t0, t1) { + this.error = t0; + this.stackTrace = t1; + this.next = null; + }, + _DelayedDone: function _DelayedDone() { + }, + _PendingEvents: function _PendingEvents(t0) { + var _ = this; + _._async$_state = 0; + _.lastPendingEvent = _.firstPendingEvent = null; + _.$ti = t0; + }, + _PendingEvents_schedule_closure: function _PendingEvents_schedule_closure(t0, t1) { + this.$this = t0; + this.dispatch = t1; + }, + _DoneStreamSubscription: function _DoneStreamSubscription(t0, t1) { + var _ = this; + _._async$_state = 1; + _._zone = t0; + _._onDone = null; + _.$ti = t1; + }, + _StreamIterator: function _StreamIterator(t0, t1) { + var _ = this; + _._subscription = null; + _._stateData = t0; + _._async$_hasValue = false; + _.$ti = t1; + }, + _cancelAndError_closure: function _cancelAndError_closure(t0, t1, t2) { + this.future = t0; + this.error = t1; + this.stackTrace = t2; + }, + _cancelAndErrorClosure_closure: function _cancelAndErrorClosure_closure(t0, t1) { + this.subscription = t0; + this.future = t1; + }, + _cancelAndValue_closure: function _cancelAndValue_closure(t0, t1) { + this.future = t0; + this.value = t1; + }, + _ForwardingStream: function _ForwardingStream() { + }, + _ForwardingStreamSubscription: function _ForwardingStreamSubscription(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._stream = t0; + _._subscription = null; + _._async$_onData = t1; + _._onError = t2; + _._onDone = t3; + _._zone = t4; + _._async$_state = t5; + _._pending = _._cancelFuture = null; + _.$ti = t6; + }, + _MapStream: function _MapStream(t0, t1, t2) { + this._transform = t0; + this._async$_source = t1; + this.$ti = t2; + }, + _EventSinkWrapper: function _EventSinkWrapper(t0, t1) { + this._async$_sink = t0; + this.$ti = t1; + }, + _SinkTransformerStreamSubscription: function _SinkTransformerStreamSubscription(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.___SinkTransformerStreamSubscription__transformerSink_A = $; + _._subscription = null; + _._async$_onData = t0; + _._onError = t1; + _._onDone = t2; + _._zone = t3; + _._async$_state = t4; + _._pending = _._cancelFuture = null; + _.$ti = t5; + }, + _StreamSinkTransformer: function _StreamSinkTransformer() { + }, + _BoundSinkStream: function _BoundSinkStream(t0, t1, t2) { + this._sinkMapper = t0; + this._stream = t1; + this.$ti = t2; + }, + _HandlerEventSink: function _HandlerEventSink(t0, t1, t2, t3, t4) { + var _ = this; + _._handleData = t0; + _._handleError = t1; + _._handleDone = t2; + _._async$_sink = t3; + _.$ti = t4; + }, + _StreamHandlerTransformer: function _StreamHandlerTransformer(t0, t1) { + this._sinkMapper = t0; + this.$ti = t1; + }, + _StreamHandlerTransformer_closure: function _StreamHandlerTransformer_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.handleData = t0; + _.handleError = t1; + _.handleDone = t2; + _.T = t3; + _.S = t4; + }, + _ZoneFunction: function _ZoneFunction(t0, t1, t2) { + this.zone = t0; + this.$function = t1; + this.$ti = t2; + }, + _ZoneSpecification: function _ZoneSpecification(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { + var _ = this; + _.handleUncaughtError = t0; + _.run = t1; + _.runUnary = t2; + _.runBinary = t3; + _.registerCallback = t4; + _.registerUnaryCallback = t5; + _.registerBinaryCallback = t6; + _.errorCallback = t7; + _.scheduleMicrotask = t8; + _.createTimer = t9; + _.createPeriodicTimer = t10; + _.print = t11; + _.fork = t12; + }, + _ZoneDelegate: function _ZoneDelegate(t0) { + this._delegationTarget = t0; + }, + _Zone: function _Zone() { + }, + _CustomZone: function _CustomZone(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._run = t0; + _._runUnary = t1; + _._runBinary = t2; + _._registerCallback = t3; + _._registerUnaryCallback = t4; + _._registerBinaryCallback = t5; + _._errorCallback = t6; + _._scheduleMicrotask = t7; + _._createTimer = t8; + _._createPeriodicTimer = t9; + _._print = t10; + _._fork = t11; + _._handleUncaughtError = t12; + _._delegateCache = null; + _.parent = t13; + _._async$_map = t14; + }, + _CustomZone_bindCallback_closure: function _CustomZone_bindCallback_closure(t0, t1, t2) { + this.$this = t0; + this.registered = t1; + this.R = t2; + }, + _CustomZone_bindUnaryCallback_closure: function _CustomZone_bindUnaryCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.registered = t1; + _.T = t2; + _.R = t3; + }, + _CustomZone_bindCallbackGuarded_closure: function _CustomZone_bindCallbackGuarded_closure(t0, t1) { + this.$this = t0; + this.registered = t1; + }, + _CustomZone_bindUnaryCallbackGuarded_closure: function _CustomZone_bindUnaryCallbackGuarded_closure(t0, t1, t2) { + this.$this = t0; + this.registered = t1; + this.T = t2; + }, + _rootHandleError_closure: function _rootHandleError_closure(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + _RootZone: function _RootZone() { + }, + _RootZone_bindCallback_closure: function _RootZone_bindCallback_closure(t0, t1, t2) { + this.$this = t0; + this.f = t1; + this.R = t2; + }, + _RootZone_bindUnaryCallback_closure: function _RootZone_bindUnaryCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.f = t1; + _.T = t2; + _.R = t3; + }, + _RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) { + this.$this = t0; + this.f = t1; + }, + _RootZone_bindUnaryCallbackGuarded_closure: function _RootZone_bindUnaryCallbackGuarded_closure(t0, t1, t2) { + this.$this = t0; + this.f = t1; + this.T = t2; + }, + HashMap_HashMap($K, $V) { + return new A._HashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("_HashMap<1,2>")); + }, + _HashMap__getTableEntry(table, key) { + var entry = table[key]; + return entry === table ? null : entry; + }, + _HashMap__setTableEntry(table, key, value) { + if (value == null) + table[key] = table; + else + table[key] = value; + }, + _HashMap__newHashTable() { + var table = Object.create(null); + A._HashMap__setTableEntry(table, "", table); + delete table[""]; + return table; + }, + LinkedHashMap_LinkedHashMap($K, $V) { + return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); + }, + LinkedHashMap_LinkedHashMap$_literal(keyValuePairs, $K, $V) { + return $K._eval$1("@<0>")._bind$1($V)._eval$1("LinkedHashMap<1,2>")._as(A.fillLiteralMap(keyValuePairs, new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")))); + }, + LinkedHashMap_LinkedHashMap$_empty($K, $V) { + return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); + }, + LinkedHashSet_LinkedHashSet$_empty($E) { + return new A._LinkedHashSet($E._eval$1("_LinkedHashSet<0>")); + }, + _LinkedHashSet__newHashTable() { + var table = Object.create(null); + A.assertHelper(table != null); + table[""] = table; + delete table[""]; + return table; + }, + _LinkedHashSetIterator$(_set, _modifications, $E) { + var t1 = new A._LinkedHashSetIterator(_set, _modifications, $E._eval$1("_LinkedHashSetIterator<0>")); + t1._collection$_cell = _set._collection$_first; + return t1; + }, + HashMap_HashMap$from(other, $K, $V) { + var result = A.HashMap_HashMap($K, $V); + other.forEach$1(0, new A.HashMap_HashMap$from_closure(result, $K, $V)); + return result; + }, + MapBase_mapToString(m) { + var result, t1 = {}; + if (A.isToStringVisiting(m)) + return "{...}"; + result = new A.StringBuffer(""); + try { + B.JSArray_methods.add$1($.toStringVisiting, m); + result._contents += "{"; + t1.first = true; + m.forEach$1(0, new A.MapBase_mapToString_closure(t1, result)); + result._contents += "}"; + } finally { + A.assertHelper(B.JSArray_methods.get$last($.toStringVisiting) === m); + if (0 >= $.toStringVisiting.length) + return A.ioore($.toStringVisiting, -1); + $.toStringVisiting.pop(); + } + t1 = result._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _HashMap: function _HashMap(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_keys = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _.$ti = t0; + }, + _HashMap_values_closure: function _HashMap_values_closure(t0) { + this.$this = t0; + }, + _IdentityHashMap: function _IdentityHashMap(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_keys = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _.$ti = t0; + }, + _HashMapKeyIterable: function _HashMapKeyIterable(t0, t1) { + this._collection$_map = t0; + this.$ti = t1; + }, + _HashMapKeyIterator: function _HashMapKeyIterator(t0, t1, t2) { + var _ = this; + _._collection$_map = t0; + _._collection$_keys = t1; + _._offset = 0; + _._collection$_current = null; + _.$ti = t2; + }, + _LinkedHashSet: function _LinkedHashSet(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_last = _._collection$_first = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _._collection$_modifications = 0; + _.$ti = t0; + }, + _LinkedHashSetCell: function _LinkedHashSetCell(t0) { + this._element = t0; + this._collection$_previous = this._collection$_next = null; + }, + _LinkedHashSetIterator: function _LinkedHashSetIterator(t0, t1, t2) { + var _ = this; + _._set = t0; + _._collection$_modifications = t1; + _._collection$_current = _._collection$_cell = null; + _.$ti = t2; + }, + HashMap_HashMap$from_closure: function HashMap_HashMap$from_closure(t0, t1, t2) { + this.result = t0; + this.K = t1; + this.V = t2; + }, + LinkedList: function LinkedList(t0) { + var _ = this; + _._collection$_length = _._modificationCount = 0; + _._collection$_first = null; + _.$ti = t0; + }, + _LinkedListIterator: function _LinkedListIterator(t0, t1, t2, t3) { + var _ = this; + _._list = t0; + _._modificationCount = t1; + _._collection$_current = null; + _._collection$_next = t2; + _._visitedFirst = false; + _.$ti = t3; + }, + LinkedListEntry: function LinkedListEntry() { + }, + ListBase: function ListBase() { + }, + MapBase: function MapBase() { + }, + MapBase_entries_closure: function MapBase_entries_closure(t0) { + this.$this = t0; + }, + MapBase_mapToString_closure: function MapBase_mapToString_closure(t0, t1) { + this._box_0 = t0; + this.result = t1; + }, + _MapBaseValueIterable: function _MapBaseValueIterable(t0, t1) { + this._collection$_map = t0; + this.$ti = t1; + }, + _MapBaseValueIterator: function _MapBaseValueIterator(t0, t1, t2) { + var _ = this; + _._collection$_keys = t0; + _._collection$_map = t1; + _._collection$_current = null; + _.$ti = t2; + }, + _UnmodifiableMapMixin: function _UnmodifiableMapMixin() { + }, + MapView: function MapView() { + }, + UnmodifiableMapView: function UnmodifiableMapView() { + }, + SetBase: function SetBase() { + }, + _SetBase: function _SetBase() { + }, + _UnmodifiableMapView_MapView__UnmodifiableMapMixin: function _UnmodifiableMapView_MapView__UnmodifiableMapMixin() { + }, + _Utf8Decoder__makeNativeUint8List(codeUnits, start, end) { + var bytes, t1, i, b, + $length = end - start; + if ($length <= 4096) + bytes = $.$get$_Utf8Decoder__reusableBuffer(); + else + bytes = new Uint8Array($length); + for (t1 = J.getInterceptor$asx(codeUnits), i = 0; i < $length; ++i) { + b = t1.$index(codeUnits, start + i); + if ((b & 255) !== b) + b = 255; + bytes[i] = b; + } + return bytes; + }, + _Utf8Decoder__convertInterceptedUint8List(allowMalformed, codeUnits, start, end) { + var decoder = allowMalformed ? $.$get$_Utf8Decoder__decoderNonfatal() : $.$get$_Utf8Decoder__decoder(); + if (decoder == null) + return null; + if (0 === start && end === codeUnits.length) + return A._Utf8Decoder__useTextDecoder(decoder, codeUnits); + return A._Utf8Decoder__useTextDecoder(decoder, codeUnits.subarray(start, end)); + }, + _Utf8Decoder__useTextDecoder(decoder, codeUnits) { + var t1, exception; + try { + t1 = decoder.decode(codeUnits); + return t1; + } catch (exception) { + } + return null; + }, + Base64Codec__checkPadding(source, sourceIndex, sourceEnd, firstPadding, paddingCount, $length) { + if (B.JSInt_methods.$mod($length, 4) !== 0) + throw A.wrapException(A.FormatException$("Invalid base64 padding, padded length must be multiple of four, is " + $length, source, sourceEnd)); + if (firstPadding + paddingCount !== $length) + throw A.wrapException(A.FormatException$("Invalid base64 padding, '=' not at the end", source, sourceIndex)); + if (paddingCount > 2) + throw A.wrapException(A.FormatException$("Invalid base64 padding, more than two '=' characters", source, sourceIndex)); + }, + _Utf8Decoder_errorDescription(state) { + switch (state) { + case 65: + return "Missing extension byte"; + case 67: + return "Unexpected extension byte"; + case 69: + return "Invalid UTF-8 byte"; + case 71: + return "Overlong encoding"; + case 73: + return "Out of unicode range"; + case 75: + return "Encoded surrogate"; + case 77: + return "Unfinished UTF-8 octet sequence"; + default: + return ""; + } + }, + _Utf8Decoder__decoder_closure: function _Utf8Decoder__decoder_closure() { + }, + _Utf8Decoder__decoderNonfatal_closure: function _Utf8Decoder__decoderNonfatal_closure() { + }, + AsciiCodec: function AsciiCodec() { + }, + _UnicodeSubsetEncoder: function _UnicodeSubsetEncoder() { + }, + AsciiEncoder: function AsciiEncoder(t0) { + this._subsetMask = t0; + }, + Base64Codec: function Base64Codec() { + }, + Base64Encoder: function Base64Encoder() { + }, + Codec: function Codec() { + }, + _FusedCodec: function _FusedCodec(t0, t1, t2) { + this._convert$_first = t0; + this._second = t1; + this.$ti = t2; + }, + Converter: function Converter() { + }, + Encoding: function Encoding() { + }, + Utf8Codec: function Utf8Codec() { + }, + Utf8Encoder: function Utf8Encoder() { + }, + _Utf8Encoder: function _Utf8Encoder(t0) { + this._bufferIndex = this._carry = 0; + this._buffer = t0; + }, + _Utf8Decoder: function _Utf8Decoder(t0) { + this.allowMalformed = t0; + this._state = 16; + this._charOrIndex = 0; + }, + BigInt_parse(source) { + var result = A._BigIntImpl__tryParse(source, null); + if (result == null) + A.throwExpression(A.FormatException$("Could not parse BigInt", source, null)); + return result; + }, + _BigIntImpl_parse(source, radix) { + var result = A._BigIntImpl__tryParse(source, radix); + if (result == null) + throw A.wrapException(A.FormatException$("Could not parse BigInt", source, null)); + return result; + }, + _BigIntImpl__parseDecimal(source, isNegative) { + var part, i, + result = $.$get$_BigIntImpl_zero(), + t1 = source.length, + digitInPartCount = 4 - t1 % 4; + if (digitInPartCount === 4) + digitInPartCount = 0; + for (part = 0, i = 0; i < t1; ++i) { + part = part * 10 + source.charCodeAt(i) - 48; + ++digitInPartCount; + if (digitInPartCount === 4) { + result = result.$mul(0, $.$get$_BigIntImpl__bigInt10000()).$add(0, A._BigIntImpl__BigIntImpl$_fromInt(part)); + part = 0; + digitInPartCount = 0; + } + } + if (isNegative) + return result.$negate(0); + return result; + }, + _BigIntImpl__codeUnitToRadixValue(codeUnit) { + if (48 <= codeUnit && codeUnit <= 57) + return codeUnit - 48; + return (codeUnit | 32) - 97 + 10; + }, + _BigIntImpl__parseHex(source, startPos, isNegative) { + var i, chunk, j, i0, digitValue, digitIndex, digitIndex0, + t1 = source.length, + sourceLength = t1 - startPos, + chunkCount = B.JSNumber_methods.ceil$0(sourceLength / 4), + digits = new Uint16Array(chunkCount), + t2 = chunkCount - 1, + lastDigitLength = sourceLength - t2 * 4; + for (i = startPos, chunk = 0, j = 0; j < lastDigitLength; ++j, i = i0) { + i0 = i + 1; + if (!(i < t1)) + return A.ioore(source, i); + digitValue = A._BigIntImpl__codeUnitToRadixValue(source.charCodeAt(i)); + if (digitValue >= 16) + return null; + chunk = chunk * 16 + digitValue; + } + digitIndex = t2 - 1; + if (!(t2 >= 0 && t2 < chunkCount)) + return A.ioore(digits, t2); + digits[t2] = chunk; + for (; i < t1; digitIndex = digitIndex0) { + for (chunk = 0, j = 0; j < 4; ++j, i = i0) { + i0 = i + 1; + if (!(i >= 0 && i < t1)) + return A.ioore(source, i); + digitValue = A._BigIntImpl__codeUnitToRadixValue(source.charCodeAt(i)); + if (digitValue >= 16) + return null; + chunk = chunk * 16 + digitValue; + } + digitIndex0 = digitIndex - 1; + if (!(digitIndex >= 0 && digitIndex < chunkCount)) + return A.ioore(digits, digitIndex); + digits[digitIndex] = chunk; + } + if (chunkCount === 1) { + if (0 >= chunkCount) + return A.ioore(digits, 0); + t1 = digits[0] === 0; + } else + t1 = false; + if (t1) + return $.$get$_BigIntImpl_zero(); + t1 = A._BigIntImpl__normalize(chunkCount, digits); + return new A._BigIntImpl(t1 === 0 ? false : isNegative, digits, t1); + }, + _BigIntImpl__tryParse(source, radix) { + var match, t1, t2, isNegative, decimalMatch, hexMatch; + if (source === "") + return null; + match = $.$get$_BigIntImpl__parseRE().firstMatch$1(source); + if (match == null) + return null; + t1 = match._match; + t2 = t1.length; + if (1 >= t2) + return A.ioore(t1, 1); + isNegative = t1[1] === "-"; + if (4 >= t2) + return A.ioore(t1, 4); + decimalMatch = t1[4]; + hexMatch = t1[3]; + if (5 >= t2) + return A.ioore(t1, 5); + if (decimalMatch != null) + return A._BigIntImpl__parseDecimal(decimalMatch, isNegative); + if (hexMatch != null) + return A._BigIntImpl__parseHex(hexMatch, 2, isNegative); + return null; + }, + _BigIntImpl__normalize(used, digits) { + var t2, + t1 = digits.length; + while (true) { + if (used > 0) { + t2 = used - 1; + if (!(t2 < t1)) + return A.ioore(digits, t2); + t2 = digits[t2] === 0; + } else + t2 = false; + if (!t2) + break; + --used; + } + return used; + }, + _BigIntImpl__cloneDigits(digits, from, to, $length) { + var t1, i, t2, + resultDigits = new Uint16Array($length), + n = to - from; + for (t1 = digits.length, i = 0; i < n; ++i) { + t2 = from + i; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(digits, t2); + t2 = digits[t2]; + if (!(i < $length)) + return A.ioore(resultDigits, i); + resultDigits[i] = t2; + } + return resultDigits; + }, + _BigIntImpl__BigIntImpl$from(value) { + var t1; + if (value === 0) + return $.$get$_BigIntImpl_zero(); + if (value === 1) + return $.$get$_BigIntImpl_one(); + if (value === 2) + return $.$get$_BigIntImpl_two(); + if (Math.abs(value) < 4294967296) + return A._BigIntImpl__BigIntImpl$_fromInt(B.JSInt_methods.toInt$0(value)); + t1 = A._BigIntImpl__BigIntImpl$_fromDouble(value); + return t1; + }, + _BigIntImpl__BigIntImpl$_fromInt(value) { + var digits, t1, i, i0, + isNegative = value < 0; + if (isNegative) { + if (value === -9223372036854776e3) { + digits = new Uint16Array(4); + digits[3] = 32768; + t1 = A._BigIntImpl__normalize(4, digits); + return new A._BigIntImpl(t1 !== 0, digits, t1); + } + value = -value; + } + if (value < 65536) { + digits = new Uint16Array(1); + digits[0] = value; + t1 = A._BigIntImpl__normalize(1, digits); + return new A._BigIntImpl(t1 === 0 ? false : isNegative, digits, t1); + } + if (value <= 4294967295) { + digits = new Uint16Array(2); + digits[0] = value & 65535; + digits[1] = B.JSInt_methods._shrOtherPositive$1(value, 16); + t1 = A._BigIntImpl__normalize(2, digits); + return new A._BigIntImpl(t1 === 0 ? false : isNegative, digits, t1); + } + t1 = B.JSInt_methods._tdivFast$1(B.JSInt_methods.get$bitLength(value) - 1, 16) + 1; + digits = new Uint16Array(t1); + for (i = 0; value !== 0; i = i0) { + i0 = i + 1; + if (!(i < t1)) + return A.ioore(digits, i); + digits[i] = value & 65535; + value = B.JSInt_methods._tdivFast$1(value, 65536); + } + t1 = A._BigIntImpl__normalize(t1, digits); + return new A._BigIntImpl(t1 === 0 ? false : isNegative, digits, t1); + }, + _BigIntImpl__BigIntImpl$_fromDouble(value) { + var isNegative, bits, i, t1, t2, exponent, unshiftedDigits, unshiftedBig, absResult; + if (isNaN(value) || value == 1 / 0 || value == -1 / 0) + throw A.wrapException(A.ArgumentError$("Value must be finite: " + value, null)); + isNegative = value < 0; + if (isNegative) + value = -value; + value = Math.floor(value); + if (value === 0) + return $.$get$_BigIntImpl_zero(); + bits = $.$get$_BigIntImpl__bitsForFromDouble(); + for (i = 0; i < 8; ++i) + bits[i] = 0; + B.NativeByteData_methods._setFloat64$3(A.NativeByteData_NativeByteData$view(bits.buffer, 0, null), 0, value, true); + t1 = bits[7]; + t2 = bits[6]; + exponent = (t1 << 4 >>> 0) + (t2 >>> 4) - 1075; + unshiftedDigits = new Uint16Array(4); + unshiftedDigits[0] = (bits[1] << 8 >>> 0) + bits[0]; + unshiftedDigits[1] = (bits[3] << 8 >>> 0) + bits[2]; + unshiftedDigits[2] = (bits[5] << 8 >>> 0) + bits[4]; + unshiftedDigits[3] = t2 & 15 | 16; + unshiftedBig = new A._BigIntImpl(false, unshiftedDigits, 4); + if (exponent < 0) + absResult = unshiftedBig.$shr(0, -exponent); + else + absResult = exponent > 0 ? unshiftedBig.$shl(0, exponent) : unshiftedBig; + if (isNegative) + return absResult.$negate(0); + return absResult; + }, + _BigIntImpl__dlShiftDigits(xDigits, xUsed, n, resultDigits) { + var i, t1, t2, t3, t4; + if (xUsed === 0) + return 0; + if (n === 0 && resultDigits === xDigits) + return xUsed; + for (i = xUsed - 1, t1 = xDigits.length, t2 = resultDigits.length; i >= 0; --i) { + t3 = i + n; + if (!(i < t1)) + return A.ioore(xDigits, i); + t4 = xDigits[i]; + if (!(t3 >= 0 && t3 < t2)) + return A.ioore(resultDigits, t3); + resultDigits[t3] = t4; + } + for (i = n - 1; i >= 0; --i) { + if (!(i < t2)) + return A.ioore(resultDigits, i); + resultDigits[i] = 0; + } + return xUsed + n; + }, + _BigIntImpl__lsh(xDigits, xUsed, n, resultDigits) { + var digitShift, bitShift, carryBitShift, bitMask, i, t1, t2, carry, digit, t3, t4; + A.assertHelper(xUsed > 0); + digitShift = B.JSInt_methods._tdivFast$1(n, 16); + bitShift = B.JSInt_methods.$mod(n, 16); + carryBitShift = 16 - bitShift; + bitMask = B.JSInt_methods.$shl(1, carryBitShift) - 1; + for (i = xUsed - 1, t1 = xDigits.length, t2 = resultDigits.length, carry = 0; i >= 0; --i) { + if (!(i < t1)) + return A.ioore(xDigits, i); + digit = xDigits[i]; + t3 = i + digitShift + 1; + t4 = B.JSInt_methods.$shr(digit, carryBitShift); + if (!(t3 >= 0 && t3 < t2)) + return A.ioore(resultDigits, t3); + resultDigits[t3] = (t4 | carry) >>> 0; + carry = B.JSInt_methods.$shl((digit & bitMask) >>> 0, bitShift); + } + if (!(digitShift >= 0 && digitShift < t2)) + return A.ioore(resultDigits, digitShift); + resultDigits[digitShift] = carry; + }, + _BigIntImpl__lShiftDigits(xDigits, xUsed, n, resultDigits) { + var resultUsed, t1, i, t2, + digitsShift = B.JSInt_methods._tdivFast$1(n, 16); + if (B.JSInt_methods.$mod(n, 16) === 0) + return A._BigIntImpl__dlShiftDigits(xDigits, xUsed, digitsShift, resultDigits); + resultUsed = xUsed + digitsShift + 1; + A._BigIntImpl__lsh(xDigits, xUsed, n, resultDigits); + for (t1 = resultDigits.length, i = digitsShift; --i, i >= 0;) { + if (!(i < t1)) + return A.ioore(resultDigits, i); + resultDigits[i] = 0; + } + t2 = resultUsed - 1; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(resultDigits, t2); + if (resultDigits[t2] === 0) + resultUsed = t2; + return resultUsed; + }, + _BigIntImpl__rsh(xDigits, xUsed, n, resultDigits) { + var digitsShift, bitShift, carryBitShift, bitMask, t1, carry, last, t2, i, t3, digit; + A.assertHelper(xUsed > 0); + digitsShift = B.JSInt_methods._tdivFast$1(n, 16); + bitShift = B.JSInt_methods.$mod(n, 16); + carryBitShift = 16 - bitShift; + bitMask = B.JSInt_methods.$shl(1, bitShift) - 1; + t1 = xDigits.length; + if (!(digitsShift >= 0 && digitsShift < t1)) + return A.ioore(xDigits, digitsShift); + carry = B.JSInt_methods.$shr(xDigits[digitsShift], bitShift); + last = xUsed - digitsShift - 1; + for (t2 = resultDigits.length, i = 0; i < last; ++i) { + t3 = i + digitsShift + 1; + if (!(t3 < t1)) + return A.ioore(xDigits, t3); + digit = xDigits[t3]; + t3 = B.JSInt_methods.$shl((digit & bitMask) >>> 0, carryBitShift); + if (!(i < t2)) + return A.ioore(resultDigits, i); + resultDigits[i] = (t3 | carry) >>> 0; + carry = B.JSInt_methods.$shr(digit, bitShift); + } + if (!(last >= 0 && last < t2)) + return A.ioore(resultDigits, last); + resultDigits[last] = carry; + }, + _BigIntImpl__compareDigits(digits, used, otherDigits, otherUsed) { + var i, t1, t2, t3, + result = used - otherUsed; + if (result === 0) + for (i = used - 1, t1 = digits.length, t2 = otherDigits.length; i >= 0; --i) { + if (!(i < t1)) + return A.ioore(digits, i); + t3 = digits[i]; + if (!(i < t2)) + return A.ioore(otherDigits, i); + result = t3 - otherDigits[i]; + if (result !== 0) + return result; + } + return result; + }, + _BigIntImpl__absAdd(digits, used, otherDigits, otherUsed, resultDigits) { + var t1, t2, t3, carry, i, t4; + A.assertHelper(used >= otherUsed && otherUsed > 0); + for (t1 = digits.length, t2 = otherDigits.length, t3 = resultDigits.length, carry = 0, i = 0; i < otherUsed; ++i) { + if (!(i < t1)) + return A.ioore(digits, i); + t4 = digits[i]; + if (!(i < t2)) + return A.ioore(otherDigits, i); + carry += t4 + otherDigits[i]; + if (!(i < t3)) + return A.ioore(resultDigits, i); + resultDigits[i] = carry & 65535; + carry = B.JSInt_methods._shrOtherPositive$1(carry, 16); + } + for (i = otherUsed; i < used; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(digits, i); + carry += digits[i]; + if (!(i < t3)) + return A.ioore(resultDigits, i); + resultDigits[i] = carry & 65535; + carry = B.JSInt_methods._shrOtherPositive$1(carry, 16); + } + if (!(used >= 0 && used < t3)) + return A.ioore(resultDigits, used); + resultDigits[used] = carry; + }, + _BigIntImpl__absSub(digits, used, otherDigits, otherUsed, resultDigits) { + var t1, t2, t3, carry, i, t4; + A.assertHelper(used >= otherUsed && otherUsed > 0); + for (t1 = digits.length, t2 = otherDigits.length, t3 = resultDigits.length, carry = 0, i = 0; i < otherUsed; ++i) { + if (!(i < t1)) + return A.ioore(digits, i); + t4 = digits[i]; + if (!(i < t2)) + return A.ioore(otherDigits, i); + carry += t4 - otherDigits[i]; + if (!(i < t3)) + return A.ioore(resultDigits, i); + resultDigits[i] = carry & 65535; + carry = 0 - (B.JSInt_methods._shrOtherPositive$1(carry, 16) & 1); + } + for (i = otherUsed; i < used; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(digits, i); + carry += digits[i]; + if (!(i < t3)) + return A.ioore(resultDigits, i); + resultDigits[i] = carry & 65535; + carry = 0 - (B.JSInt_methods._shrOtherPositive$1(carry, 16) & 1); + } + }, + _BigIntImpl__mulAdd(x, multiplicandDigits, i, accumulatorDigits, j, n) { + var t1, t2, c, i0, t3, combined, j0, l; + if (x === 0) + return; + for (t1 = multiplicandDigits.length, t2 = accumulatorDigits.length, c = 0; --n, n >= 0; j = j0, i = i0) { + i0 = i + 1; + if (!(i < t1)) + return A.ioore(multiplicandDigits, i); + t3 = multiplicandDigits[i]; + if (!(j >= 0 && j < t2)) + return A.ioore(accumulatorDigits, j); + combined = x * t3 + accumulatorDigits[j] + c; + j0 = j + 1; + accumulatorDigits[j] = combined & 65535; + c = B.JSInt_methods._tdivFast$1(combined, 65536); + } + for (; c !== 0; j = j0) { + if (!(j >= 0 && j < t2)) + return A.ioore(accumulatorDigits, j); + l = accumulatorDigits[j] + c; + j0 = j + 1; + accumulatorDigits[j] = l & 65535; + c = B.JSInt_methods._tdivFast$1(l, 65536); + } + }, + _BigIntImpl__estimateQuotientDigit(topDigitDivisor, digits, i) { + var t2, t3, quotientDigit, + t1 = digits.length; + if (!(i >= 0 && i < t1)) + return A.ioore(digits, i); + t2 = digits[i]; + if (t2 === topDigitDivisor) + return 65535; + t3 = i - 1; + if (!(t3 >= 0 && t3 < t1)) + return A.ioore(digits, t3); + quotientDigit = B.JSInt_methods.$tdiv((t2 << 16 | digits[t3]) >>> 0, topDigitDivisor); + if (quotientDigit > 65535) + return 65535; + return quotientDigit; + }, + Expando__badExpandoKey(object) { + throw A.wrapException(A.ArgumentError$value(object, "object", "Expandos are not allowed on strings, numbers, bools, records or null")); + }, + int_parse(source, radix) { + var value = A.Primitives_parseInt(source, radix); + if (value != null) + return value; + throw A.wrapException(A.FormatException$(source, null, null)); + }, + Error__throw(error, stackTrace) { + error = A.wrapException(error); + if (error == null) + error = type$.Object._as(error); + error.stack = stackTrace.toString$0(0); + throw error; + throw A.wrapException("unreachable"); + }, + List_List$filled($length, fill, growable, $E) { + var i, + result = growable ? J.JSArray_JSArray$growable($length, $E) : J.JSArray_JSArray$fixed($length, $E); + if ($length !== 0 && fill != null) + for (i = 0; i < result.length; ++i) + result[i] = fill; + return result; + }, + List_List$from(elements, growable, $E) { + var t1, + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + B.JSArray_methods.add$1(list, $E._as(t1.get$current())); + if (growable) + return list; + return J.JSArray_markFixedList(list, $E); + }, + List_List$of(elements, growable, $E) { + var t1; + if (growable) + return A.List_List$_of(elements, $E); + t1 = J.JSArray_markFixedList(A.List_List$_of(elements, $E), $E); + return t1; + }, + List_List$_of(elements, $E) { + var list, t1; + if (Array.isArray(elements)) + return A._setArrayType(elements.slice(0), $E._eval$1("JSArray<0>")); + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + B.JSArray_methods.add$1(list, t1.get$current()); + return list; + }, + List_List$unmodifiable(elements, $E) { + return J.JSArray_markUnmodifiableList(A.List_List$from(elements, false, $E)); + }, + String_String$fromCharCodes(charCodes, start, end) { + var t1, t2, maxLength, array, len; + A.RangeError_checkNotNegative(start, "start"); + t1 = end == null; + t2 = !t1; + if (t2) { + maxLength = end - start; + if (maxLength < 0) + throw A.wrapException(A.RangeError$range(end, start, null, "end", null)); + if (maxLength === 0) + return ""; + } + if (Array.isArray(charCodes)) { + array = charCodes; + len = array.length; + if (t1) + end = len; + return A.Primitives_stringFromCharCodes(start > 0 || end < len ? array.slice(start, end) : array); + } + if (type$.NativeUint8List._is(charCodes)) + return A.String__stringFromUint8List(charCodes, start, end); + if (t2) + charCodes = J.take$1$ax(charCodes, end); + if (start > 0) + charCodes = J.skip$1$ax(charCodes, start); + return A.Primitives_stringFromCharCodes(A.List_List$of(charCodes, true, type$.int)); + }, + String_String$fromCharCode(charCode) { + return A.Primitives_stringFromCharCode(charCode); + }, + String__stringFromUint8List(charCodes, start, endOrNull) { + var len = charCodes.length; + if (start >= len) + return ""; + return A.Primitives_stringFromNativeUint8List(charCodes, start, endOrNull == null || endOrNull > len ? len : endOrNull); + }, + RegExp_RegExp(source, caseSensitive, dotAll, multiLine, unicode) { + return new A.JSSyntaxRegExp(source, A.JSSyntaxRegExp_makeNative(source, multiLine, caseSensitive, unicode, dotAll, false)); + }, + StringBuffer__writeAll(string, objects, separator) { + var iterator = J.get$iterator$ax(objects); + if (!iterator.moveNext$0()) + return string; + if (separator.length === 0) { + do + string += A.S(iterator.get$current()); + while (iterator.moveNext$0()); + } else { + string += A.S(iterator.get$current()); + for (; iterator.moveNext$0();) + string = string + separator + A.S(iterator.get$current()); + } + return string; + }, + NoSuchMethodError_NoSuchMethodError$withInvocation(receiver, invocation) { + return new A.NoSuchMethodError(receiver, invocation.get$memberName(), invocation.get$positionalArguments(), invocation.get$namedArguments()); + }, + Uri_base() { + var cachedUri, uri, + current = A.Primitives_currentUri(); + if (current == null) + throw A.wrapException(A.UnsupportedError$("'Uri.base' is not supported")); + cachedUri = $.Uri__cachedBaseUri; + if (cachedUri != null && current === $.Uri__cachedBaseString) + return cachedUri; + uri = A.Uri_parse(current); + $.Uri__cachedBaseUri = uri; + $.Uri__cachedBaseString = current; + return uri; + }, + _Uri__uriEncode(canonicalTable, text, encoding, spaceToPlus) { + var t1, bytes, i, t2, byte, t3, + _s16_ = "0123456789ABCDEF"; + if (encoding === B.C_Utf8Codec) { + t1 = $.$get$_Uri__needsNoEncoding(); + t1 = t1._nativeRegExp.test(text); + } else + t1 = false; + if (t1) + return text; + bytes = B.C_Utf8Encoder.convert$1(text); + for (t1 = bytes.length, i = 0, t2 = ""; i < t1; ++i) { + byte = bytes[i]; + if (byte < 128) { + t3 = byte >>> 4; + if (!(t3 < 8)) + return A.ioore(canonicalTable, t3); + t3 = (canonicalTable[t3] & 1 << (byte & 15)) !== 0; + } else + t3 = false; + if (t3) + t2 += A.Primitives_stringFromCharCode(byte); + else + t2 = spaceToPlus && byte === 32 ? t2 + "+" : t2 + "%" + _s16_[byte >>> 4 & 15] + _s16_[byte & 15]; + } + return t2.charCodeAt(0) == 0 ? t2 : t2; + }, + StackTrace_current() { + return A.getTraceFromException(new Error()); + }, + DateTime$_withValue(_value, isUtc) { + if (Math.abs(_value) > 864e13) + A.throwExpression(A.ArgumentError$("DateTime is outside valid range: " + _value, null)); + A.checkNotNullable(true, "isUtc", type$.bool); + return new A.DateTime(_value, true); + }, + DateTime__fourDigits(n) { + var absN = Math.abs(n), + sign = n < 0 ? "-" : ""; + if (absN >= 1000) + return "" + n; + if (absN >= 100) + return sign + "0" + absN; + if (absN >= 10) + return sign + "00" + absN; + return sign + "000" + absN; + }, + DateTime__threeDigits(n) { + if (n >= 100) + return "" + n; + if (n >= 10) + return "0" + n; + return "00" + n; + }, + DateTime__twoDigits(n) { + if (n >= 10) + return "" + n; + return "0" + n; + }, + Duration$(microseconds, milliseconds) { + return new A.Duration(microseconds + 1000 * milliseconds); + }, + EnumByName_byName(_this, $name, $T) { + var t1, _i, value; + for (t1 = _this.length, _i = 0; _i < t1; ++_i) { + value = _this[_i]; + if (value._core$_name === $name) + return value; + } + throw A.wrapException(A.ArgumentError$value($name, "name", "No enum value with that name")); + }, + EnumByName_asNameMap(_this, $T) { + var _i, value, + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, $T); + for (_i = 0; _i < 2; ++_i) { + value = _this[_i]; + t1.$indexSet(0, value._core$_name, value); + } + return t1; + }, + Error_safeToString(object) { + if (typeof object == "number" || A._isBool(object) || object == null) + return J.toString$0$(object); + if (typeof object == "string") + return JSON.stringify(object); + return A.Primitives_safeToString(object); + }, + Error_throwWithStackTrace(error, stackTrace) { + A.checkNotNullable(error, "error", type$.Object); + A.checkNotNullable(stackTrace, "stackTrace", type$.StackTrace); + A.Error__throw(error, stackTrace); + }, + AssertionError$(message) { + return new A.AssertionError(message); + }, + ArgumentError$(message, $name) { + return new A.ArgumentError(false, null, $name, message); + }, + ArgumentError$value(value, $name, message) { + return new A.ArgumentError(true, value, $name, message); + }, + ArgumentError_checkNotNull(argument, $name, $T) { + return argument; + }, + RangeError$(message) { + var _null = null; + return new A.RangeError(_null, _null, false, _null, _null, message); + }, + RangeError$value(value, $name) { + return new A.RangeError(null, null, true, value, $name, "Value not in range"); + }, + RangeError$range(invalidValue, minValue, maxValue, $name, message) { + return new A.RangeError(minValue, maxValue, true, invalidValue, $name, "Invalid value"); + }, + RangeError_checkValueInInterval(value, minValue, maxValue, $name) { + if (value < minValue || value > maxValue) + throw A.wrapException(A.RangeError$range(value, minValue, maxValue, $name, null)); + return value; + }, + RangeError_checkValidRange(start, end, $length) { + if (0 > start || start > $length) + throw A.wrapException(A.RangeError$range(start, 0, $length, "start", null)); + if (end != null) { + if (start > end || end > $length) + throw A.wrapException(A.RangeError$range(end, start, $length, "end", null)); + return end; + } + return $length; + }, + RangeError_checkNotNegative(value, $name) { + if (value < 0) + throw A.wrapException(A.RangeError$range(value, 0, null, $name, null)); + return value; + }, + IndexError$withLength(invalidValue, $length, indexable, message, $name) { + return new A.IndexError($length, true, invalidValue, $name, "Index out of range"); + }, + UnsupportedError$(message) { + return new A.UnsupportedError(message); + }, + UnimplementedError$(message) { + return new A.UnimplementedError(message); + }, + StateError$(message) { + return new A.StateError(message); + }, + ConcurrentModificationError$(modifiedObject) { + return new A.ConcurrentModificationError(modifiedObject); + }, + Exception_Exception(message) { + return new A._Exception(message); + }, + FormatException$(message, source, offset) { + return new A.FormatException(message, source, offset); + }, + Iterable_iterableToShortString(iterable, leftDelimiter, rightDelimiter) { + var parts, t1; + if (A.isToStringVisiting(iterable)) { + if (leftDelimiter === "(" && rightDelimiter === ")") + return "(...)"; + return leftDelimiter + "..." + rightDelimiter; + } + parts = A._setArrayType([], type$.JSArray_String); + B.JSArray_methods.add$1($.toStringVisiting, iterable); + try { + A._iterablePartsToStrings(iterable, parts); + } finally { + A.assertHelper(B.JSArray_methods.get$last($.toStringVisiting) === iterable); + if (0 >= $.toStringVisiting.length) + return A.ioore($.toStringVisiting, -1); + $.toStringVisiting.pop(); + } + t1 = A.StringBuffer__writeAll(leftDelimiter, type$.Iterable_dynamic._as(parts), ", ") + rightDelimiter; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + Iterable_iterableToFullString(iterable, leftDelimiter, rightDelimiter) { + var buffer, t1; + if (A.isToStringVisiting(iterable)) + return leftDelimiter + "..." + rightDelimiter; + buffer = new A.StringBuffer(leftDelimiter); + B.JSArray_methods.add$1($.toStringVisiting, iterable); + try { + t1 = buffer; + t1._contents = A.StringBuffer__writeAll(t1._contents, iterable, ", "); + } finally { + A.assertHelper(B.JSArray_methods.get$last($.toStringVisiting) === iterable); + if (0 >= $.toStringVisiting.length) + return A.ioore($.toStringVisiting, -1); + $.toStringVisiting.pop(); + } + buffer._contents += rightDelimiter; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _iterablePartsToStrings(iterable, parts) { + var next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision, + it = iterable.get$iterator(iterable), + $length = 0, count = 0; + while (true) { + if (!($length < 80 || count < 3)) + break; + if (!it.moveNext$0()) + return; + next = A.S(it.get$current()); + B.JSArray_methods.add$1(parts, next); + $length += next.length + 2; + ++count; + } + if (!it.moveNext$0()) { + if (count <= 5) + return; + if (0 >= parts.length) + return A.ioore(parts, -1); + ultimateString = parts.pop(); + if (0 >= parts.length) + return A.ioore(parts, -1); + penultimateString = parts.pop(); + } else { + penultimate = it.get$current(); + ++count; + if (!it.moveNext$0()) { + if (count <= 4) { + B.JSArray_methods.add$1(parts, A.S(penultimate)); + return; + } + ultimateString = A.S(penultimate); + if (0 >= parts.length) + return A.ioore(parts, -1); + penultimateString = parts.pop(); + $length += ultimateString.length + 2; + } else { + ultimate = it.get$current(); + ++count; + A.assertHelper(count < 100); + for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) { + ultimate0 = it.get$current(); + ++count; + if (count > 100) { + while (true) { + if (!($length > 75 && count > 3)) + break; + if (0 >= parts.length) + return A.ioore(parts, -1); + $length -= parts.pop().length + 2; + --count; + } + B.JSArray_methods.add$1(parts, "..."); + return; + } + } + penultimateString = A.S(penultimate); + ultimateString = A.S(ultimate); + $length += ultimateString.length + penultimateString.length + 4; + } + } + if (count > parts.length + 2) { + $length += 5; + elision = "..."; + } else + elision = null; + while (true) { + if (!($length > 80 && parts.length > 3)) + break; + if (0 >= parts.length) + return A.ioore(parts, -1); + $length -= parts.pop().length + 2; + if (elision == null) { + $length += 5; + elision = "..."; + } + } + if (elision != null) + B.JSArray_methods.add$1(parts, elision); + B.JSArray_methods.add$1(parts, penultimateString); + B.JSArray_methods.add$1(parts, ultimateString); + }, + Object_hash(object1, object2, object3, object4) { + var t1; + if (B.C_SentinelValue === object3) { + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2)); + } + if (B.C_SentinelValue === object4) { + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + object3 = J.get$hashCode$(object3); + return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3)); + } + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + object3 = J.get$hashCode$(object3); + object4 = J.get$hashCode$(object4); + object4 = A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3), object4)); + return object4; + }, + print(object) { + var line = A.S(object), + toZone = $.printToZone; + if (toZone == null) + A.printString(line); + else + toZone.call$1(line); + }, + Uri_Uri$dataFromString($content) { + var t1, _null = null, + buffer = new A.StringBuffer(""), + indices = A._setArrayType([-1], type$.JSArray_int); + A.UriData__writeUri(_null, _null, _null, buffer, indices); + B.JSArray_methods.add$1(indices, buffer._contents.length); + buffer._contents += ","; + A.UriData__uriEncodeBytes(B.List_42A, B.C_AsciiCodec.encode$1($content), buffer); + t1 = buffer._contents; + return new A.UriData(t1.charCodeAt(0) == 0 ? t1 : t1, indices, _null).get$uri(); + }, + Uri_parse(uri) { + var delta, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, isSimple, scheme, t1, t2, schemeAuth, queryStart0, pathStart0, userInfoStart, userInfo, host, portNumber, port, path, query, _null = null, + end = uri.length; + if (end >= 5) { + if (4 >= end) + return A.ioore(uri, 4); + delta = ((uri.charCodeAt(4) ^ 58) * 3 | uri.charCodeAt(0) ^ 100 | uri.charCodeAt(1) ^ 97 | uri.charCodeAt(2) ^ 116 | uri.charCodeAt(3) ^ 97) >>> 0; + if (delta === 0) + return A.UriData__parse(end < end ? B.JSString_methods.substring$2(uri, 0, end) : uri, 5, _null).get$uri(); + else if (delta === 32) + return A.UriData__parse(B.JSString_methods.substring$2(uri, 5, end), 0, _null).get$uri(); + } + indices = A.List_List$filled(8, 0, false, type$.int); + B.JSArray_methods.$indexSet(indices, 0, 0); + B.JSArray_methods.$indexSet(indices, 1, -1); + B.JSArray_methods.$indexSet(indices, 2, -1); + B.JSArray_methods.$indexSet(indices, 7, -1); + B.JSArray_methods.$indexSet(indices, 3, 0); + B.JSArray_methods.$indexSet(indices, 4, 0); + B.JSArray_methods.$indexSet(indices, 5, end); + B.JSArray_methods.$indexSet(indices, 6, end); + if (A._scan(uri, 0, end, 0, indices) >= 14) + B.JSArray_methods.$indexSet(indices, 7, end); + schemeEnd = indices[1]; + if (schemeEnd >= 0) + if (A._scan(uri, 0, schemeEnd, 20, indices) === 20) + indices[7] = schemeEnd; + hostStart = indices[2] + 1; + portStart = indices[3]; + pathStart = indices[4]; + queryStart = indices[5]; + fragmentStart = indices[6]; + if (fragmentStart < queryStart) + queryStart = fragmentStart; + if (pathStart < hostStart) + pathStart = queryStart; + else if (pathStart <= schemeEnd) + pathStart = schemeEnd + 1; + if (portStart < hostStart) + portStart = pathStart; + A.assertHelper(hostStart === 0 || schemeEnd <= hostStart); + A.assertHelper(hostStart <= portStart); + A.assertHelper(schemeEnd <= pathStart); + A.assertHelper(portStart <= pathStart); + A.assertHelper(pathStart <= queryStart); + A.assertHelper(queryStart <= fragmentStart); + isSimple = indices[7] < 0; + if (isSimple) + if (hostStart > schemeEnd + 3) { + scheme = _null; + isSimple = false; + } else { + t1 = portStart > 0; + if (t1 && portStart + 1 === pathStart) { + scheme = _null; + isSimple = false; + } else { + if (!B.JSString_methods.startsWith$2(uri, "\\", pathStart)) + if (hostStart > 0) + t2 = B.JSString_methods.startsWith$2(uri, "\\", hostStart - 1) || B.JSString_methods.startsWith$2(uri, "\\", hostStart - 2); + else + t2 = false; + else + t2 = true; + if (t2) { + scheme = _null; + isSimple = false; + } else { + if (!(queryStart < end && queryStart === pathStart + 2 && B.JSString_methods.startsWith$2(uri, "..", pathStart))) + t2 = queryStart > pathStart + 2 && B.JSString_methods.startsWith$2(uri, "/..", queryStart - 3); + else + t2 = true; + if (t2) + scheme = _null; + else if (schemeEnd === 4) + if (B.JSString_methods.startsWith$2(uri, "file", 0)) { + if (hostStart <= 0) { + if (!B.JSString_methods.startsWith$2(uri, "/", pathStart)) { + schemeAuth = "file:///"; + delta = 3; + } else { + schemeAuth = "file://"; + delta = 2; + } + uri = schemeAuth + B.JSString_methods.substring$2(uri, pathStart, end); + schemeEnd -= 0; + t1 = delta - 0; + queryStart += t1; + fragmentStart += t1; + end = uri.length; + hostStart = 7; + portStart = 7; + pathStart = 7; + } else if (pathStart === queryStart) { + ++fragmentStart; + queryStart0 = queryStart + 1; + uri = B.JSString_methods.replaceRange$3(uri, pathStart, queryStart, "/"); + ++end; + queryStart = queryStart0; + } + scheme = "file"; + } else if (B.JSString_methods.startsWith$2(uri, "http", 0)) { + if (t1 && portStart + 3 === pathStart && B.JSString_methods.startsWith$2(uri, "80", portStart + 1)) { + fragmentStart -= 3; + pathStart0 = pathStart - 3; + queryStart -= 3; + uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + end -= 3; + pathStart = pathStart0; + } + scheme = "http"; + } else + scheme = _null; + else if (schemeEnd === 5 && B.JSString_methods.startsWith$2(uri, "https", 0)) { + if (t1 && portStart + 4 === pathStart && B.JSString_methods.startsWith$2(uri, "443", portStart + 1)) { + fragmentStart -= 4; + pathStart0 = pathStart - 4; + queryStart -= 4; + uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + end -= 3; + pathStart = pathStart0; + } + scheme = "https"; + } else + scheme = _null; + isSimple = !t2; + } + } + } + else + scheme = _null; + if (isSimple) { + if (end < uri.length) { + uri = B.JSString_methods.substring$2(uri, 0, end); + schemeEnd -= 0; + hostStart -= 0; + portStart -= 0; + pathStart -= 0; + queryStart -= 0; + fragmentStart -= 0; + } + return new A._SimpleUri(uri, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme); + } + if (scheme == null) + if (schemeEnd > 0) + scheme = A._Uri__makeScheme(uri, 0, schemeEnd); + else { + if (schemeEnd === 0) + A._Uri__fail(uri, 0, "Invalid empty scheme"); + scheme = ""; + } + if (hostStart > 0) { + userInfoStart = schemeEnd + 3; + userInfo = userInfoStart < hostStart ? A._Uri__makeUserInfo(uri, userInfoStart, hostStart - 1) : ""; + host = A._Uri__makeHost(uri, hostStart, portStart, false); + t1 = portStart + 1; + if (t1 < pathStart) { + portNumber = A.Primitives_parseInt(B.JSString_methods.substring$2(uri, t1, pathStart), _null); + port = A._Uri__makePort(portNumber == null ? A.throwExpression(A.FormatException$("Invalid port", uri, t1)) : portNumber, scheme); + } else + port = _null; + } else { + port = _null; + host = port; + userInfo = ""; + } + path = A._Uri__makePath(uri, pathStart, queryStart, _null, scheme, host != null); + query = queryStart < fragmentStart ? A._Uri__makeQuery(uri, queryStart + 1, fragmentStart, _null) : _null; + return A._Uri$_internal(scheme, userInfo, host, port, path, query, fragmentStart < end ? A._Uri__makeFragment(uri, fragmentStart + 1, end) : _null); + }, + Uri_decodeComponent(encodedComponent) { + A._asString(encodedComponent); + return A._Uri__uriDecode(encodedComponent, 0, encodedComponent.length, B.C_Utf8Codec, false); + }, + Uri__parseIPv4Address(host, start, end) { + var t1, i, partStart, partIndex, char, part, partIndex0, + _s43_ = "IPv4 address should contain exactly 4 parts", + _s37_ = "each part must be in the range 0..255", + error = new A.Uri__parseIPv4Address_error(host), + result = new Uint8Array(4); + for (t1 = host.length, i = start, partStart = i, partIndex = 0; i < end; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(host, i); + char = host.charCodeAt(i); + if (char !== 46) { + if ((char ^ 48) > 9) + error.call$2("invalid character", i); + } else { + if (partIndex === 3) + error.call$2(_s43_, i); + part = A.int_parse(B.JSString_methods.substring$2(host, partStart, i), null); + if (part > 255) + error.call$2(_s37_, partStart); + partIndex0 = partIndex + 1; + if (!(partIndex < 4)) + return A.ioore(result, partIndex); + result[partIndex] = part; + partStart = i + 1; + partIndex = partIndex0; + } + } + if (partIndex !== 3) + error.call$2(_s43_, end); + part = A.int_parse(B.JSString_methods.substring$2(host, partStart, end), null); + if (part > 255) + error.call$2(_s37_, partStart); + if (!(partIndex < 4)) + return A.ioore(result, partIndex); + result[partIndex] = part; + return result; + }, + Uri_parseIPv6Address(host, start, end) { + var parts, i, partStart, wildcardSeen, seenDot, char, atEnd, last, bytes, wildCardLength, index, value, j, t2, _null = null, + error = new A.Uri_parseIPv6Address_error(host), + parseHex = new A.Uri_parseIPv6Address_parseHex(error, host), + t1 = host.length; + if (t1 < 2) + error.call$2("address is too short", _null); + parts = A._setArrayType([], type$.JSArray_int); + for (i = start, partStart = i, wildcardSeen = false, seenDot = false; i < end; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(host, i); + char = host.charCodeAt(i); + if (char === 58) { + if (i === start) { + ++i; + if (!(i < t1)) + return A.ioore(host, i); + if (host.charCodeAt(i) !== 58) + error.call$2("invalid start colon.", i); + partStart = i; + } + if (i === partStart) { + if (wildcardSeen) + error.call$2("only one wildcard `::` is allowed", i); + B.JSArray_methods.add$1(parts, -1); + wildcardSeen = true; + } else + B.JSArray_methods.add$1(parts, parseHex.call$2(partStart, i)); + partStart = i + 1; + } else if (char === 46) + seenDot = true; + } + if (parts.length === 0) + error.call$2("too few parts", _null); + atEnd = partStart === end; + t1 = B.JSArray_methods.get$last(parts); + if (atEnd && t1 !== -1) + error.call$2("expected a part after last `:`", end); + if (!atEnd) + if (!seenDot) + B.JSArray_methods.add$1(parts, parseHex.call$2(partStart, end)); + else { + last = A.Uri__parseIPv4Address(host, partStart, end); + B.JSArray_methods.add$1(parts, (last[0] << 8 | last[1]) >>> 0); + B.JSArray_methods.add$1(parts, (last[2] << 8 | last[3]) >>> 0); + } + if (wildcardSeen) { + if (parts.length > 7) + error.call$2("an address with a wildcard must have less than 7 parts", _null); + } else if (parts.length !== 8) + error.call$2("an address without a wildcard must contain exactly 8 parts", _null); + bytes = new Uint8Array(16); + for (t1 = parts.length, wildCardLength = 9 - t1, i = 0, index = 0; i < t1; ++i) { + value = parts[i]; + if (value === -1) + for (j = 0; j < wildCardLength; ++j) { + if (!(index >= 0 && index < 16)) + return A.ioore(bytes, index); + bytes[index] = 0; + t2 = index + 1; + if (!(t2 < 16)) + return A.ioore(bytes, t2); + bytes[t2] = 0; + index += 2; + } + else { + t2 = B.JSInt_methods._shrOtherPositive$1(value, 8); + if (!(index >= 0 && index < 16)) + return A.ioore(bytes, index); + bytes[index] = t2; + t2 = index + 1; + if (!(t2 < 16)) + return A.ioore(bytes, t2); + bytes[t2] = value & 255; + index += 2; + } + } + return bytes; + }, + _Uri$_internal(scheme, _userInfo, _host, _port, path, _query, _fragment) { + return new A._Uri(scheme, _userInfo, _host, _port, path, _query, _fragment); + }, + _Uri__Uri(host, path, pathSegments, scheme) { + var userInfo, query, fragment, port, isFile, t1, hasAuthority, t2, _null = null; + scheme = scheme == null ? "" : A._Uri__makeScheme(scheme, 0, scheme.length); + userInfo = A._Uri__makeUserInfo(_null, 0, 0); + host = A._Uri__makeHost(host, 0, host == null ? 0 : host.length, false); + query = A._Uri__makeQuery(_null, 0, 0, _null); + fragment = A._Uri__makeFragment(_null, 0, 0); + port = A._Uri__makePort(_null, scheme); + isFile = scheme === "file"; + if (host == null) + t1 = userInfo.length !== 0 || port != null || isFile; + else + t1 = false; + if (t1) + host = ""; + t1 = host == null; + hasAuthority = !t1; + path = A._Uri__makePath(path, 0, path == null ? 0 : path.length, pathSegments, scheme, hasAuthority); + t2 = scheme.length === 0; + if (t2 && t1 && !B.JSString_methods.startsWith$1(path, "/")) + path = A._Uri__normalizeRelativePath(path, !t2 || hasAuthority); + else + path = A._Uri__removeDotSegments(path); + return A._Uri$_internal(scheme, userInfo, t1 && B.JSString_methods.startsWith$1(path, "//") ? "" : host, port, path, query, fragment); + }, + _Uri__defaultPort(scheme) { + if (scheme === "http") + return 80; + if (scheme === "https") + return 443; + return 0; + }, + _Uri__fail(uri, index, message) { + throw A.wrapException(A.FormatException$(message, uri, index)); + }, + _Uri__Uri$file(path, windows) { + return windows ? A._Uri__makeWindowsFileUrl(path, false) : A._Uri__makeFileUri(path, false); + }, + _Uri__checkNonWindowsPathReservedCharacters(segments, argumentError) { + var t1, _i, segment; + for (t1 = segments.length, _i = 0; _i < t1; ++_i) { + segment = segments[_i]; + if (J.contains$1$asx(segment, "/")) { + t1 = A.UnsupportedError$("Illegal path character " + A.S(segment)); + throw A.wrapException(t1); + } + } + }, + _Uri__checkWindowsPathReservedCharacters(segments, argumentError, firstSegment) { + var t1, t2, t3; + for (t1 = A.SubListIterable$(segments, firstSegment, null, A._arrayInstanceType(segments)._precomputed1), t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListIterable.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + if (B.JSString_methods.contains$1(t3, A.RegExp_RegExp('["*/:<>?\\\\|]', true, false, false, false))) + if (argumentError) + throw A.wrapException(A.ArgumentError$("Illegal character in path", null)); + else + throw A.wrapException(A.UnsupportedError$("Illegal character in path: " + t3)); + } + }, + _Uri__checkWindowsDriveLetter(charCode, argumentError) { + var t1, + _s21_ = "Illegal drive letter "; + if (!(65 <= charCode && charCode <= 90)) + t1 = 97 <= charCode && charCode <= 122; + else + t1 = true; + if (t1) + return; + if (argumentError) + throw A.wrapException(A.ArgumentError$(_s21_ + A.String_String$fromCharCode(charCode), null)); + else + throw A.wrapException(A.UnsupportedError$(_s21_ + A.String_String$fromCharCode(charCode))); + }, + _Uri__makeFileUri(path, slashTerminated) { + var _null = null, + segments = A._setArrayType(path.split("/"), type$.JSArray_String); + if (B.JSString_methods.startsWith$1(path, "/")) + return A._Uri__Uri(_null, _null, segments, "file"); + else + return A._Uri__Uri(_null, _null, segments, _null); + }, + _Uri__makeWindowsFileUrl(path, slashTerminated) { + var t1, pathSegments, pathStart, hostPart, _s1_ = "\\", _null = null, _s4_ = "file"; + if (B.JSString_methods.startsWith$1(path, "\\\\?\\")) + if (B.JSString_methods.startsWith$2(path, "UNC\\", 4)) + path = B.JSString_methods.replaceRange$3(path, 0, 7, _s1_); + else { + path = B.JSString_methods.substring$1(path, 4); + t1 = path.length; + if (t1 >= 3) { + if (1 >= t1) + return A.ioore(path, 1); + if (path.charCodeAt(1) === 58) { + if (2 >= t1) + return A.ioore(path, 2); + t1 = path.charCodeAt(2) !== 92; + } else + t1 = true; + } else + t1 = true; + if (t1) + throw A.wrapException(A.ArgumentError$value(path, "path", "Windows paths with \\\\?\\ prefix must be absolute")); + } + else + path = A.stringReplaceAllUnchecked(path, "/", _s1_); + t1 = path.length; + if (t1 > 1 && path.charCodeAt(1) === 58) { + if (0 >= t1) + return A.ioore(path, 0); + A._Uri__checkWindowsDriveLetter(path.charCodeAt(0), true); + if (t1 !== 2) { + if (2 >= t1) + return A.ioore(path, 2); + t1 = path.charCodeAt(2) !== 92; + } else + t1 = true; + if (t1) + throw A.wrapException(A.ArgumentError$value(path, "path", "Windows paths with drive letter must be absolute")); + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 1); + return A._Uri__Uri(_null, _null, pathSegments, _s4_); + } + if (B.JSString_methods.startsWith$1(path, _s1_)) + if (B.JSString_methods.startsWith$2(path, _s1_, 1)) { + pathStart = B.JSString_methods.indexOf$2(path, _s1_, 2); + t1 = pathStart < 0; + hostPart = t1 ? B.JSString_methods.substring$1(path, 2) : B.JSString_methods.substring$2(path, 2, pathStart); + pathSegments = A._setArrayType((t1 ? "" : B.JSString_methods.substring$1(path, pathStart + 1)).split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(hostPart, _null, pathSegments, _s4_); + } else { + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(_null, _null, pathSegments, _s4_); + } + else { + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(_null, _null, pathSegments, _null); + } + }, + _Uri__makePort(port, scheme) { + if (port != null && port === A._Uri__defaultPort(scheme)) + return null; + return port; + }, + _Uri__makeHost(host, start, end, strictIPv6) { + var t1, t2, index, zoneIDstart, zoneID, i; + if (host == null) + return null; + if (start === end) + return ""; + t1 = host.length; + if (!(start >= 0 && start < t1)) + return A.ioore(host, start); + if (host.charCodeAt(start) === 91) { + t2 = end - 1; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(host, t2); + if (host.charCodeAt(t2) !== 93) + A._Uri__fail(host, start, "Missing end `]` to match `[` in host"); + t1 = start + 1; + index = A._Uri__checkZoneID(host, t1, t2); + if (index < t2) { + zoneIDstart = index + 1; + zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, t2, "%25"); + } else + zoneID = ""; + A.Uri_parseIPv6Address(host, t1, index); + return B.JSString_methods.substring$2(host, start, index).toLowerCase() + zoneID + "]"; + } + for (i = start; i < end; ++i) { + if (!(i < t1)) + return A.ioore(host, i); + if (host.charCodeAt(i) === 58) { + index = B.JSString_methods.indexOf$2(host, "%", start); + index = index >= start && index < end ? index : end; + if (index < end) { + zoneIDstart = index + 1; + zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, end, "%25"); + } else + zoneID = ""; + A.Uri_parseIPv6Address(host, start, index); + return "[" + B.JSString_methods.substring$2(host, start, index) + zoneID + "]"; + } + } + return A._Uri__normalizeRegName(host, start, end); + }, + _Uri__checkZoneID(host, start, end) { + var index = B.JSString_methods.indexOf$2(host, "%", start); + return index >= start && index < end ? index : end; + }, + _Uri__normalizeZoneID(host, start, end, prefix) { + var t1, index, sectionStart, isNormalized, char, replacement, t2, t3, tail, sourceLength, slice, + buffer = prefix !== "" ? new A.StringBuffer(prefix) : null; + for (t1 = host.length, index = start, sectionStart = index, isNormalized = true; index < end;) { + if (!(index >= 0 && index < t1)) + return A.ioore(host, index); + char = host.charCodeAt(index); + if (char === 37) { + replacement = A._Uri__normalizeEscape(host, index, true); + t2 = replacement == null; + if (t2 && isNormalized) { + index += 3; + continue; + } + if (buffer == null) + buffer = new A.StringBuffer(""); + t3 = buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + if (t2) + replacement = B.JSString_methods.substring$2(host, index, index + 3); + else if (replacement === "%") + A._Uri__fail(host, index, "ZoneID should not contain % anymore"); + buffer._contents = t3 + replacement; + index += 3; + sectionStart = index; + isNormalized = true; + } else { + if (char < 127) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_piR, t2); + t2 = (B.List_piR[t2] & 1 << (char & 15)) !== 0; + } else + t2 = false; + if (t2) { + if (isNormalized && 65 <= char && 90 >= char) { + if (buffer == null) + buffer = new A.StringBuffer(""); + if (sectionStart < index) { + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + sectionStart = index; + } + isNormalized = false; + } + ++index; + } else { + if ((char & 64512) === 55296 && index + 1 < end) { + t2 = index + 1; + if (!(t2 < t1)) + return A.ioore(host, t2); + tail = host.charCodeAt(t2); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (buffer == null) { + buffer = new A.StringBuffer(""); + t2 = buffer; + } else + t2 = buffer; + t2._contents += slice; + t3 = A._Uri__escapeChar(char); + t2._contents += t3; + index += sourceLength; + sectionStart = index; + } + } + } + if (buffer == null) + return B.JSString_methods.substring$2(host, start, end); + if (sectionStart < end) { + slice = B.JSString_methods.substring$2(host, sectionStart, end); + buffer._contents += slice; + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__normalizeRegName(host, start, end) { + var t1, index, sectionStart, buffer, isNormalized, char, replacement, t2, slice, t3, sourceLength, tail; + for (t1 = host.length, index = start, sectionStart = index, buffer = null, isNormalized = true; index < end;) { + if (!(index >= 0 && index < t1)) + return A.ioore(host, index); + char = host.charCodeAt(index); + if (char === 37) { + replacement = A._Uri__normalizeEscape(host, index, true); + t2 = replacement == null; + if (t2 && isNormalized) { + index += 3; + continue; + } + if (buffer == null) + buffer = new A.StringBuffer(""); + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (!isNormalized) + slice = slice.toLowerCase(); + t3 = buffer._contents += slice; + if (t2) { + replacement = B.JSString_methods.substring$2(host, index, index + 3); + sourceLength = 3; + } else if (replacement === "%") { + replacement = "%25"; + sourceLength = 1; + } else + sourceLength = 3; + buffer._contents = t3 + replacement; + index += sourceLength; + sectionStart = index; + isNormalized = true; + } else { + if (char < 127) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_4AN, t2); + t2 = (B.List_4AN[t2] & 1 << (char & 15)) !== 0; + } else + t2 = false; + if (t2) { + if (isNormalized && 65 <= char && 90 >= char) { + if (buffer == null) + buffer = new A.StringBuffer(""); + if (sectionStart < index) { + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + sectionStart = index; + } + isNormalized = false; + } + ++index; + } else { + if (char <= 93) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_VOY, t2); + t2 = (B.List_VOY[t2] & 1 << (char & 15)) !== 0; + } else + t2 = false; + if (t2) + A._Uri__fail(host, index, "Invalid character"); + else { + if ((char & 64512) === 55296 && index + 1 < end) { + t2 = index + 1; + if (!(t2 < t1)) + return A.ioore(host, t2); + tail = host.charCodeAt(t2); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (!isNormalized) + slice = slice.toLowerCase(); + if (buffer == null) { + buffer = new A.StringBuffer(""); + t2 = buffer; + } else + t2 = buffer; + t2._contents += slice; + t3 = A._Uri__escapeChar(char); + t2._contents += t3; + index += sourceLength; + sectionStart = index; + } + } + } + } + if (buffer == null) + return B.JSString_methods.substring$2(host, start, end); + if (sectionStart < end) { + slice = B.JSString_methods.substring$2(host, sectionStart, end); + if (!isNormalized) + slice = slice.toLowerCase(); + buffer._contents += slice; + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__makeScheme(scheme, start, end) { + var t1, i, containsUpperCase, codeUnit, t2; + if (start === end) + return ""; + t1 = scheme.length; + if (!(start < t1)) + return A.ioore(scheme, start); + if (!A._Uri__isAlphabeticCharacter(scheme.charCodeAt(start))) + A._Uri__fail(scheme, start, "Scheme not starting with alphabetic character"); + for (i = start, containsUpperCase = false; i < end; ++i) { + if (!(i < t1)) + return A.ioore(scheme, i); + codeUnit = scheme.charCodeAt(i); + if (codeUnit < 128) { + t2 = codeUnit >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_GVy, t2); + t2 = (B.List_GVy[t2] & 1 << (codeUnit & 15)) !== 0; + } else + t2 = false; + if (!t2) + A._Uri__fail(scheme, i, "Illegal scheme character"); + if (65 <= codeUnit && codeUnit <= 90) + containsUpperCase = true; + } + scheme = B.JSString_methods.substring$2(scheme, start, end); + return A._Uri__canonicalizeScheme(containsUpperCase ? scheme.toLowerCase() : scheme); + }, + _Uri__canonicalizeScheme(scheme) { + if (scheme === "http") + return "http"; + if (scheme === "file") + return "file"; + if (scheme === "https") + return "https"; + if (scheme === "package") + return "package"; + return scheme; + }, + _Uri__makeUserInfo(userInfo, start, end) { + if (userInfo == null) + return ""; + return A._Uri__normalizeOrSubstring(userInfo, start, end, B.List_2jN, false, false); + }, + _Uri__makePath(path, start, end, pathSegments, scheme, hasAuthority) { + var t1, result, + isFile = scheme === "file", + ensureLeadingSlash = isFile || hasAuthority; + if (path == null) { + if (pathSegments == null) + return isFile ? "/" : ""; + t1 = A._arrayInstanceType(pathSegments); + result = new A.MappedListIterable(pathSegments, t1._eval$1("String(1)")._as(new A._Uri__makePath_closure()), t1._eval$1("MappedListIterable<1,String>")).join$1(0, "/"); + } else if (pathSegments != null) + throw A.wrapException(A.ArgumentError$("Both path and pathSegments specified", null)); + else + result = A._Uri__normalizeOrSubstring(path, start, end, B.List_M2I, true, true); + if (result.length === 0) { + if (isFile) + return "/"; + } else if (ensureLeadingSlash && !B.JSString_methods.startsWith$1(result, "/")) + result = "/" + result; + return A._Uri__normalizePath(result, scheme, hasAuthority); + }, + _Uri__normalizePath(path, scheme, hasAuthority) { + var t1 = scheme.length === 0; + if (t1 && !hasAuthority && !B.JSString_methods.startsWith$1(path, "/") && !B.JSString_methods.startsWith$1(path, "\\")) + return A._Uri__normalizeRelativePath(path, !t1 || hasAuthority); + return A._Uri__removeDotSegments(path); + }, + _Uri__makeQuery(query, start, end, queryParameters) { + if (query != null) + return A._Uri__normalizeOrSubstring(query, start, end, B.List_42A, true, false); + return null; + }, + _Uri__makeFragment(fragment, start, end) { + if (fragment == null) + return null; + return A._Uri__normalizeOrSubstring(fragment, start, end, B.List_42A, true, false); + }, + _Uri__normalizeEscape(source, index, lowerCase) { + var t2, t3, firstDigit, secondDigit, firstDigitValue, secondDigitValue, value, + t1 = source.length; + if (!(index >= 0 && index < t1)) + return A.ioore(source, index); + A.assertHelper(source.charCodeAt(index) === 37); + t2 = index + 2; + if (t2 >= t1) + return "%"; + t3 = index + 1; + if (!(t3 < t1)) + return A.ioore(source, t3); + firstDigit = source.charCodeAt(t3); + secondDigit = source.charCodeAt(t2); + firstDigitValue = A.hexDigitValue(firstDigit); + secondDigitValue = A.hexDigitValue(secondDigit); + if (firstDigitValue < 0 || secondDigitValue < 0) + return "%"; + value = firstDigitValue * 16 + secondDigitValue; + if (value < 127) { + t1 = B.JSInt_methods._shrOtherPositive$1(value, 4); + if (!(t1 < 8)) + return A.ioore(B.List_piR, t1); + t1 = (B.List_piR[t1] & 1 << (value & 15)) !== 0; + } else + t1 = false; + if (t1) + return A.Primitives_stringFromCharCode(lowerCase && 65 <= value && 90 >= value ? (value | 32) >>> 0 : value); + if (firstDigit >= 97 || secondDigit >= 97) + return B.JSString_methods.substring$2(source, index, index + 3).toUpperCase(); + return null; + }, + _Uri__escapeChar(char) { + var codeUnits, t1, flag, encodedBytes, index, byte, t2, t3, + _s16_ = "0123456789ABCDEF"; + A.assertHelper(char <= 1114111); + if (char < 128) { + codeUnits = new Uint8Array(3); + codeUnits[0] = 37; + t1 = char >>> 4; + if (!(t1 < 16)) + return A.ioore(_s16_, t1); + codeUnits[1] = _s16_.charCodeAt(t1); + codeUnits[2] = _s16_.charCodeAt(char & 15); + } else { + if (char > 2047) + if (char > 65535) { + flag = 240; + encodedBytes = 4; + } else { + flag = 224; + encodedBytes = 3; + } + else { + flag = 192; + encodedBytes = 2; + } + t1 = 3 * encodedBytes; + codeUnits = new Uint8Array(t1); + for (index = 0; --encodedBytes, encodedBytes >= 0; flag = 128) { + byte = B.JSInt_methods._shrReceiverPositive$1(char, 6 * encodedBytes) & 63 | flag; + if (!(index < t1)) + return A.ioore(codeUnits, index); + codeUnits[index] = 37; + t2 = index + 1; + t3 = byte >>> 4; + if (!(t3 < 16)) + return A.ioore(_s16_, t3); + if (!(t2 < t1)) + return A.ioore(codeUnits, t2); + codeUnits[t2] = _s16_.charCodeAt(t3); + t3 = index + 2; + if (!(t3 < t1)) + return A.ioore(codeUnits, t3); + codeUnits[t3] = _s16_.charCodeAt(byte & 15); + index += 3; + } + } + return A.String_String$fromCharCodes(codeUnits, 0, null); + }, + _Uri__normalizeOrSubstring(component, start, end, charTable, escapeDelimiters, replaceBackslash) { + var t1 = A._Uri__normalize(component, start, end, charTable, escapeDelimiters, replaceBackslash); + return t1 == null ? B.JSString_methods.substring$2(component, start, end) : t1; + }, + _Uri__normalize(component, start, end, charTable, escapeDelimiters, replaceBackslash) { + var t1, t2, index, sectionStart, buffer, char, t3, replacement, sourceLength, tail, t4, _null = null; + for (t1 = !escapeDelimiters, t2 = component.length, index = start, sectionStart = index, buffer = _null; index < end;) { + if (!(index >= 0 && index < t2)) + return A.ioore(component, index); + char = component.charCodeAt(index); + if (char < 127) { + t3 = char >>> 4; + if (!(t3 < 8)) + return A.ioore(charTable, t3); + t3 = (charTable[t3] & 1 << (char & 15)) !== 0; + } else + t3 = false; + if (t3) + ++index; + else { + if (char === 37) { + replacement = A._Uri__normalizeEscape(component, index, false); + if (replacement == null) { + index += 3; + continue; + } + if ("%" === replacement) { + replacement = "%25"; + sourceLength = 1; + } else + sourceLength = 3; + } else if (char === 92 && replaceBackslash) { + replacement = "/"; + sourceLength = 1; + } else { + if (t1) + if (char <= 93) { + t3 = char >>> 4; + if (!(t3 < 8)) + return A.ioore(B.List_VOY, t3); + t3 = (B.List_VOY[t3] & 1 << (char & 15)) !== 0; + } else + t3 = false; + else + t3 = false; + if (t3) { + A._Uri__fail(component, index, "Invalid character"); + sourceLength = _null; + replacement = sourceLength; + } else { + if ((char & 64512) === 55296) { + t3 = index + 1; + if (t3 < end) { + if (!(t3 < t2)) + return A.ioore(component, t3); + tail = component.charCodeAt(t3); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + } else + sourceLength = 1; + replacement = A._Uri__escapeChar(char); + } + } + if (buffer == null) { + buffer = new A.StringBuffer(""); + t3 = buffer; + } else + t3 = buffer; + t4 = t3._contents += B.JSString_methods.substring$2(component, sectionStart, index); + t3._contents = t4 + A.S(replacement); + if (typeof sourceLength !== "number") + return A.iae(sourceLength); + index += sourceLength; + sectionStart = index; + } + } + if (buffer == null) + return _null; + if (sectionStart < end) { + t1 = B.JSString_methods.substring$2(component, sectionStart, end); + buffer._contents += t1; + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__mayContainDotSegments(path) { + if (B.JSString_methods.startsWith$1(path, ".")) + return true; + return B.JSString_methods.indexOf$1(path, "/.") !== -1; + }, + _Uri__removeDotSegments(path) { + var output, t1, t2, appendSlash, _i, segment, t3; + if (!A._Uri__mayContainDotSegments(path)) + return path; + A.assertHelper(path.length !== 0); + output = A._setArrayType([], type$.JSArray_String); + for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) { + segment = t1[_i]; + if (J.$eq$(segment, "..")) { + t3 = output.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(output, -1); + output.pop(); + if (output.length === 0) + B.JSArray_methods.add$1(output, ""); + } + appendSlash = true; + } else { + appendSlash = "." === segment; + if (!appendSlash) + B.JSArray_methods.add$1(output, segment); + } + } + if (appendSlash) + B.JSArray_methods.add$1(output, ""); + return B.JSArray_methods.join$1(output, "/"); + }, + _Uri__normalizeRelativePath(path, allowScheme) { + var output, t1, t2, appendSlash, _i, segment; + A.assertHelper(!B.JSString_methods.startsWith$1(path, "/")); + if (!A._Uri__mayContainDotSegments(path)) + return !allowScheme ? A._Uri__escapeScheme(path) : path; + A.assertHelper(path.length !== 0); + output = A._setArrayType([], type$.JSArray_String); + for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) { + segment = t1[_i]; + if (".." === segment) { + appendSlash = output.length !== 0 && B.JSArray_methods.get$last(output) !== ".."; + if (appendSlash) { + if (0 >= output.length) + return A.ioore(output, -1); + output.pop(); + } else + B.JSArray_methods.add$1(output, ".."); + } else { + appendSlash = "." === segment; + if (!appendSlash) + B.JSArray_methods.add$1(output, segment); + } + } + t1 = output.length; + if (t1 !== 0) + if (t1 === 1) { + if (0 >= t1) + return A.ioore(output, 0); + t1 = output[0].length === 0; + } else + t1 = false; + else + t1 = true; + if (t1) + return "./"; + if (appendSlash || B.JSArray_methods.get$last(output) === "..") + B.JSArray_methods.add$1(output, ""); + if (!allowScheme) { + if (0 >= output.length) + return A.ioore(output, 0); + B.JSArray_methods.$indexSet(output, 0, A._Uri__escapeScheme(output[0])); + } + return B.JSArray_methods.join$1(output, "/"); + }, + _Uri__escapeScheme(path) { + var i, char, t2, + t1 = path.length; + if (t1 >= 2 && A._Uri__isAlphabeticCharacter(path.charCodeAt(0))) + for (i = 1; i < t1; ++i) { + char = path.charCodeAt(i); + if (char === 58) + return B.JSString_methods.substring$2(path, 0, i) + "%3A" + B.JSString_methods.substring$1(path, i + 1); + if (char <= 127) { + t2 = char >>> 4; + if (!(t2 < 8)) + return A.ioore(B.List_GVy, t2); + t2 = (B.List_GVy[t2] & 1 << (char & 15)) === 0; + } else + t2 = true; + if (t2) + break; + } + return path; + }, + _Uri__packageNameEnd(uri, path) { + if (uri.isScheme$1("package") && uri._host == null) + return A._skipPackageNameChars(path, 0, path.length); + return -1; + }, + _Uri__hexCharPairToByte(s, pos) { + var t1, byte, i, t2, charCode; + for (t1 = s.length, byte = 0, i = 0; i < 2; ++i) { + t2 = pos + i; + if (!(t2 < t1)) + return A.ioore(s, t2); + charCode = s.charCodeAt(t2); + if (48 <= charCode && charCode <= 57) + byte = byte * 16 + charCode - 48; + else { + charCode |= 32; + if (97 <= charCode && charCode <= 102) + byte = byte * 16 + charCode - 87; + else + throw A.wrapException(A.ArgumentError$("Invalid URL encoding", null)); + } + } + return byte; + }, + _Uri__uriDecode(text, start, end, encoding, plusToSpace) { + var t1, simple, i, codeUnit, t2, bytes; + A.assertHelper(start <= end); + t1 = text.length; + A.assertHelper(end <= t1); + i = start; + while (true) { + if (!(i < end)) { + simple = true; + break; + } + if (!(i < t1)) + return A.ioore(text, i); + codeUnit = text.charCodeAt(i); + if (codeUnit <= 127) + t2 = codeUnit === 37; + else + t2 = true; + if (t2) { + simple = false; + break; + } + ++i; + } + if (simple) + if (B.C_Utf8Codec === encoding) + return B.JSString_methods.substring$2(text, start, end); + else + bytes = new A.CodeUnits(B.JSString_methods.substring$2(text, start, end)); + else { + bytes = A._setArrayType([], type$.JSArray_int); + for (i = start; i < end; ++i) { + if (!(i < t1)) + return A.ioore(text, i); + codeUnit = text.charCodeAt(i); + if (codeUnit > 127) + throw A.wrapException(A.ArgumentError$("Illegal percent encoding in URI", null)); + if (codeUnit === 37) { + if (i + 3 > t1) + throw A.wrapException(A.ArgumentError$("Truncated URI", null)); + B.JSArray_methods.add$1(bytes, A._Uri__hexCharPairToByte(text, i + 1)); + i += 2; + } else + B.JSArray_methods.add$1(bytes, codeUnit); + } + } + return encoding.decode$1(bytes); + }, + _Uri__isAlphabeticCharacter(codeUnit) { + var lowerCase = codeUnit | 32; + return 97 <= lowerCase && lowerCase <= 122; + }, + UriData__writeUri(mimeType, charsetName, parameters, buffer, indices) { + buffer._contents = buffer._contents; + }, + UriData__parse(text, start, sourceUri) { + var indices, t1, i, slashIndex, char, equalsIndex, lastSeparator, t2, data, + _s17_ = "Invalid MIME type"; + A.assertHelper(start === 0 || start === 5); + A.assertHelper(start === 5 === B.JSString_methods.startsWith$1(text, "data:")); + indices = A._setArrayType([start - 1], type$.JSArray_int); + for (t1 = text.length, i = start, slashIndex = -1, char = null; i < t1; ++i) { + char = text.charCodeAt(i); + if (char === 44 || char === 59) + break; + if (char === 47) { + if (slashIndex < 0) { + slashIndex = i; + continue; + } + throw A.wrapException(A.FormatException$(_s17_, text, i)); + } + } + if (slashIndex < 0 && i > start) + throw A.wrapException(A.FormatException$(_s17_, text, i)); + for (; char !== 44;) { + B.JSArray_methods.add$1(indices, i); + ++i; + for (equalsIndex = -1; i < t1; ++i) { + if (!(i >= 0)) + return A.ioore(text, i); + char = text.charCodeAt(i); + if (char === 61) { + if (equalsIndex < 0) + equalsIndex = i; + } else if (char === 59 || char === 44) + break; + } + if (equalsIndex >= 0) + B.JSArray_methods.add$1(indices, equalsIndex); + else { + lastSeparator = B.JSArray_methods.get$last(indices); + if (char !== 44 || i !== lastSeparator + 7 || !B.JSString_methods.startsWith$2(text, "base64", lastSeparator + 1)) + throw A.wrapException(A.FormatException$("Expecting '='", text, i)); + break; + } + } + B.JSArray_methods.add$1(indices, i); + t2 = i + 1; + if ((indices.length & 1) === 1) + text = B.C_Base64Codec.normalize$3(text, t2, t1); + else { + data = A._Uri__normalize(text, t2, t1, B.List_42A, true, false); + if (data != null) + text = B.JSString_methods.replaceRange$3(text, t2, t1, data); + } + return new A.UriData(text, indices, sourceUri); + }, + UriData__uriEncodeBytes(canonicalTable, bytes, buffer) { + var t1, byteOr, i, byte, t2, + _s16_ = "0123456789ABCDEF"; + for (t1 = bytes.length, byteOr = 0, i = 0; i < t1; ++i) { + byte = bytes[i]; + byteOr |= byte; + if (byte < 128) { + t2 = byte >>> 4; + if (!(t2 < 8)) + return A.ioore(canonicalTable, t2); + t2 = (canonicalTable[t2] & 1 << (byte & 15)) !== 0; + } else + t2 = false; + if (t2) { + t2 = A.Primitives_stringFromCharCode(byte); + buffer._contents += t2; + } else { + t2 = A.Primitives_stringFromCharCode(37); + buffer._contents += t2; + t2 = byte >>> 4; + if (!(t2 < 16)) + return A.ioore(_s16_, t2); + t2 = A.Primitives_stringFromCharCode(_s16_.charCodeAt(t2)); + buffer._contents += t2; + t2 = A.Primitives_stringFromCharCode(_s16_.charCodeAt(byte & 15)); + buffer._contents += t2; + } + } + if ((byteOr & 4294967040) !== 0) + for (i = 0; i < t1; ++i) { + byte = bytes[i]; + if (byte > 255) + throw A.wrapException(A.ArgumentError$value(byte, "non-byte value", null)); + } + }, + _createTables() { + var _i, t1, t2, t3, b, + _s77_ = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", + _s1_ = ".", _s1_0 = ":", _s1_1 = "/", _s1_2 = "\\", _s1_3 = "?", _s1_4 = "#", _s2_ = "/\\", + tables = J.JSArray_JSArray$allocateGrowable(22, type$.Uint8List); + for (_i = 0; _i < 22; ++_i) + tables[_i] = new Uint8Array(96); + t1 = new A._createTables_build(tables); + t2 = new A._createTables_setChars(); + t3 = new A._createTables_setRange(); + b = t1.call$2(0, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, _s1_, 14); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s1_1, 3); + t2.call$3(b, _s1_2, 227); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(14, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, _s1_, 15); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(15, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, "%", 225); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s1_1, 9); + t2.call$3(b, _s1_2, 233); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(1, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s1_1, 10); + t2.call$3(b, _s1_2, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(2, 235); + t2.call$3(b, _s77_, 139); + t2.call$3(b, _s1_1, 131); + t2.call$3(b, _s1_2, 131); + t2.call$3(b, _s1_, 146); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(3, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_1, 68); + t2.call$3(b, _s1_2, 68); + t2.call$3(b, _s1_, 18); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(4, 229); + t2.call$3(b, _s77_, 5); + t3.call$3(b, "AZ", 229); + t2.call$3(b, _s1_0, 102); + t2.call$3(b, "@", 68); + t2.call$3(b, "[", 232); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(5, 229); + t2.call$3(b, _s77_, 5); + t3.call$3(b, "AZ", 229); + t2.call$3(b, _s1_0, 102); + t2.call$3(b, "@", 68); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(6, 231); + t3.call$3(b, "19", 7); + t2.call$3(b, "@", 68); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(7, 231); + t3.call$3(b, "09", 7); + t2.call$3(b, "@", 68); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + t2.call$3(t1.call$2(8, 8), "]", 5); + b = t1.call$2(9, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 16); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(16, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 17); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(17, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_1, 9); + t2.call$3(b, _s1_2, 233); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(10, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 18); + t2.call$3(b, _s1_1, 10); + t2.call$3(b, _s1_2, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(18, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 19); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(19, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(11, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_1, 10); + t2.call$3(b, _s1_2, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(12, 236); + t2.call$3(b, _s77_, 12); + t2.call$3(b, _s1_3, 12); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(13, 237); + t2.call$3(b, _s77_, 13); + t2.call$3(b, _s1_3, 13); + t3.call$3(t1.call$2(20, 245), "az", 21); + b = t1.call$2(21, 245); + t3.call$3(b, "az", 21); + t3.call$3(b, "09", 21); + t2.call$3(b, "+-.", 21); + return tables; + }, + _scan(uri, start, end, state, indices) { + var i, table, char, transition, + tables = $.$get$_scannerTables(), + t1 = uri.length; + A.assertHelper(end <= t1); + for (i = start; i < end; ++i) { + if (!(state >= 0 && state < tables.length)) + return A.ioore(tables, state); + table = tables[state]; + if (!(i < t1)) + return A.ioore(uri, i); + char = uri.charCodeAt(i) ^ 96; + transition = table[char > 95 ? 31 : char]; + state = transition & 31; + B.JSArray_methods.$indexSet(indices, transition >>> 5, i); + } + return state; + }, + _SimpleUri__packageNameEnd(uri) { + if (uri._schemeEnd === 7 && B.JSString_methods.startsWith$1(uri._uri, "package") && uri._hostStart <= 0) + return A._skipPackageNameChars(uri._uri, uri._pathStart, uri._queryStart); + return -1; + }, + _skipPackageNameChars(source, start, end) { + var t1, i, dots, char; + for (t1 = source.length, i = start, dots = 0; i < end; ++i) { + if (!(i >= 0 && i < t1)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 47) + return dots !== 0 ? i : -1; + if (char === 37 || char === 58) + return -1; + dots |= char ^ 46; + } + return -1; + }, + _caseInsensitiveCompareStart(prefix, string, start) { + var t1, t2, result, i, t3, stringChar, delta, lowerChar; + for (t1 = prefix.length, t2 = string.length, result = 0, i = 0; i < t1; ++i) { + t3 = start + i; + if (!(t3 < t2)) + return A.ioore(string, t3); + stringChar = string.charCodeAt(t3); + delta = prefix.charCodeAt(i) ^ stringChar; + if (delta !== 0) { + if (delta === 32) { + lowerChar = stringChar | delta; + if (97 <= lowerChar && lowerChar <= 122) { + result = 32; + continue; + } + } + return -1; + } + } + return result; + }, + _BigIntImpl: function _BigIntImpl(t0, t1, t2) { + this._isNegative = t0; + this._digits = t1; + this._used = t2; + }, + _BigIntImpl_hashCode_combine: function _BigIntImpl_hashCode_combine() { + }, + _BigIntImpl_hashCode_finish: function _BigIntImpl_hashCode_finish() { + }, + _FinalizationRegistryWrapper: function _FinalizationRegistryWrapper(t0, t1) { + this._registry = t0; + this.$ti = t1; + }, + NoSuchMethodError_toString_closure: function NoSuchMethodError_toString_closure(t0, t1) { + this._box_0 = t0; + this.sb = t1; + }, + DateTime: function DateTime(t0, t1) { + this._core$_value = t0; + this.isUtc = t1; + }, + Duration: function Duration(t0) { + this._duration = t0; + }, + _Enum: function _Enum() { + }, + Error: function Error() { + }, + AssertionError: function AssertionError(t0) { + this.message = t0; + }, + TypeError: function TypeError() { + }, + ArgumentError: function ArgumentError(t0, t1, t2, t3) { + var _ = this; + _._hasValue = t0; + _.invalidValue = t1; + _.name = t2; + _.message = t3; + }, + RangeError: function RangeError(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.start = t0; + _.end = t1; + _._hasValue = t2; + _.invalidValue = t3; + _.name = t4; + _.message = t5; + }, + IndexError: function IndexError(t0, t1, t2, t3, t4) { + var _ = this; + _.length = t0; + _._hasValue = t1; + _.invalidValue = t2; + _.name = t3; + _.message = t4; + }, + NoSuchMethodError: function NoSuchMethodError(t0, t1, t2, t3) { + var _ = this; + _._core$_receiver = t0; + _._core$_memberName = t1; + _._core$_arguments = t2; + _._namedArguments = t3; + }, + UnsupportedError: function UnsupportedError(t0) { + this.message = t0; + }, + UnimplementedError: function UnimplementedError(t0) { + this.message = t0; + }, + StateError: function StateError(t0) { + this.message = t0; + }, + ConcurrentModificationError: function ConcurrentModificationError(t0) { + this.modifiedObject = t0; + }, + OutOfMemoryError: function OutOfMemoryError() { + }, + StackOverflowError: function StackOverflowError() { + }, + _Exception: function _Exception(t0) { + this.message = t0; + }, + FormatException: function FormatException(t0, t1, t2) { + this.message = t0; + this.source = t1; + this.offset = t2; + }, + IntegerDivisionByZeroException: function IntegerDivisionByZeroException() { + }, + Iterable: function Iterable() { + }, + MapEntry: function MapEntry(t0, t1, t2) { + this.key = t0; + this.value = t1; + this.$ti = t2; + }, + Null: function Null() { + }, + Object: function Object() { + }, + _StringStackTrace: function _StringStackTrace(t0) { + this._stackTrace = t0; + }, + StringBuffer: function StringBuffer(t0) { + this._contents = t0; + }, + Uri__parseIPv4Address_error: function Uri__parseIPv4Address_error(t0) { + this.host = t0; + }, + Uri_parseIPv6Address_error: function Uri_parseIPv6Address_error(t0) { + this.host = t0; + }, + Uri_parseIPv6Address_parseHex: function Uri_parseIPv6Address_parseHex(t0, t1) { + this.error = t0; + this.host = t1; + }, + _Uri: function _Uri(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.scheme = t0; + _._userInfo = t1; + _._host = t2; + _._port = t3; + _.path = t4; + _._query = t5; + _._fragment = t6; + _.___Uri_hashCode_FI = _.___Uri_pathSegments_FI = _.___Uri__text_FI = $; + }, + _Uri__makePath_closure: function _Uri__makePath_closure() { + }, + UriData: function UriData(t0, t1, t2) { + this._text = t0; + this._separatorIndices = t1; + this._uriCache = t2; + }, + _createTables_build: function _createTables_build(t0) { + this.tables = t0; + }, + _createTables_setChars: function _createTables_setChars() { + }, + _createTables_setRange: function _createTables_setRange() { + }, + _SimpleUri: function _SimpleUri(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._uri = t0; + _._schemeEnd = t1; + _._hostStart = t2; + _._portStart = t3; + _._pathStart = t4; + _._queryStart = t5; + _._fragmentStart = t6; + _._schemeCache = t7; + _._hashCodeCache = null; + }, + _DataUri: function _DataUri(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.scheme = t0; + _._userInfo = t1; + _._host = t2; + _._port = t3; + _.path = t4; + _._query = t5; + _._fragment = t6; + _.___Uri_hashCode_FI = _.___Uri_pathSegments_FI = _.___Uri__text_FI = $; + }, + Expando: function Expando(t0, t1) { + this._jsWeakMap = t0; + this.$ti = t1; + }, + _convertDartFunctionFast(f) { + var ret, + existing = f.$dart_jsFunction; + if (existing != null) + return existing; + ret = function(_call, f) { + return function() { + return _call(f, Array.prototype.slice.apply(arguments)); + }; + }(A._callDartFunctionFast, f); + ret[$.$get$DART_CLOSURE_PROPERTY_NAME()] = f; + f.$dart_jsFunction = ret; + return ret; + }, + _callDartFunctionFast(callback, $arguments) { + type$.List_dynamic._as($arguments); + type$.Function._as(callback); + return A.Primitives_applyFunction(callback, $arguments, null); + }, + allowInterop(f, $F) { + if (typeof f == "function") + return f; + else + return $F._as(A._convertDartFunctionFast(f)); + }, + _noJsifyRequired(o) { + return o == null || A._isBool(o) || typeof o == "number" || typeof o == "string" || type$.Int8List._is(o) || type$.Uint8List._is(o) || type$.Uint8ClampedList._is(o) || type$.Int16List._is(o) || type$.Uint16List._is(o) || type$.Int32List._is(o) || type$.Uint32List._is(o) || type$.Float32List._is(o) || type$.Float64List._is(o) || type$.ByteBuffer._is(o) || type$.ByteData._is(o); + }, + jsify(object) { + if (A._noJsifyRequired(object)) + return object; + return new A.jsify__convert(new A._IdentityHashMap(type$._IdentityHashMap_of_nullable_Object_and_nullable_Object)).call$1(object); + }, + callMethod(o, method, args, $T) { + A.assertInteropArgs(args); + return $T._as(o[method].apply(o, args)); + }, + callConstructor(constr, $arguments, $T) { + var args, factoryFunction; + if ($arguments == null) + return $T._as(new constr()); + else + A.assertInteropArgs($arguments); + if ($arguments instanceof Array) + switch ($arguments.length) { + case 0: + return $T._as(new constr()); + case 1: + return $T._as(new constr($arguments[0])); + case 2: + return $T._as(new constr($arguments[0], $arguments[1])); + case 3: + return $T._as(new constr($arguments[0], $arguments[1], $arguments[2])); + case 4: + return $T._as(new constr($arguments[0], $arguments[1], $arguments[2], $arguments[3])); + } + args = [null]; + B.JSArray_methods.addAll$1(args, $arguments); + factoryFunction = constr.bind.apply(constr, args); + String(factoryFunction); + return $T._as(new factoryFunction()); + }, + promiseToFuture(jsPromise, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")), + completer = new A._AsyncCompleter(t1, $T._eval$1("_AsyncCompleter<0>")); + jsPromise.then(A.convertDartClosureToJS(new A.promiseToFuture_closure(completer, $T), 1), A.convertDartClosureToJS(new A.promiseToFuture_closure0(completer), 1)); + return t1; + }, + _noDartifyRequired(o) { + return o == null || typeof o === "boolean" || typeof o === "number" || typeof o === "string" || o instanceof Int8Array || o instanceof Uint8Array || o instanceof Uint8ClampedArray || o instanceof Int16Array || o instanceof Uint16Array || o instanceof Int32Array || o instanceof Uint32Array || o instanceof Float32Array || o instanceof Float64Array || o instanceof ArrayBuffer || o instanceof DataView; + }, + dartify(o) { + if (A._noDartifyRequired(o)) + return o; + return new A.dartify_convert(new A._IdentityHashMap(type$._IdentityHashMap_of_nullable_Object_and_nullable_Object)).call$1(o); + }, + jsify__convert: function jsify__convert(t0) { + this._convertedObjects = t0; + }, + promiseToFuture_closure: function promiseToFuture_closure(t0, t1) { + this.completer = t0; + this.T = t1; + }, + promiseToFuture_closure0: function promiseToFuture_closure0(t0) { + this.completer = t0; + }, + dartify_convert: function dartify_convert(t0) { + this._convertedObjects = t0; + }, + NullRejectionException: function NullRejectionException(t0) { + this.isUndefined = t0; + }, + max(a, b, $T) { + A.checkTypeBound($T, type$.num, "T", "max"); + return Math.max($T._as(a), $T._as(b)); + }, + sqrt(x) { + return Math.sqrt(x); + }, + sin(radians) { + return Math.sin(radians); + }, + cos(radians) { + return Math.cos(radians); + }, + tan(radians) { + return Math.tan(radians); + }, + acos(x) { + return Math.acos(x); + }, + asin(x) { + return Math.asin(x); + }, + atan(x) { + return Math.atan(x); + }, + _JSRandom: function _JSRandom() { + }, + _JSSecureRandom: function _JSSecureRandom(t0) { + this._math$_buffer = t0; + }, + applyDbFunctions(db) { + db.createFunction$3$directOnly$function$functionName(false, new A.applyDbFunctions_closure(), "newId"); + db.createFunction$3$directOnly$function$functionName(false, new A.applyDbFunctions_closure0(), "now"); + db.execute$1("PRAGMA journal_mode=WAL"); + db.execute$1("PRAGMA busy_timeout=100"); + }, + applyDbFunctions_closure: function applyDbFunctions_closure() { + }, + applyDbFunctions_closure0: function applyDbFunctions_closure0() { + }, + DelegatingStreamSink: function DelegatingStreamSink() { + }, + DefaultEquality: function DefaultEquality(t0) { + this.$ti = t0; + }, + ListEquality: function ListEquality(t0) { + this.$ti = t0; + }, + NonGrowableListMixin: function NonGrowableListMixin() { + }, + UnmodifiableMapMixin: function UnmodifiableMapMixin() { + }, + DriftCommunication$(_channel, serialize) { + var t1 = new A.DriftCommunication(_channel, true, A.LinkedHashMap_LinkedHashMap$_empty(type$.int, type$._PendingRequest), A.StreamController_StreamController(null, null, true, type$.Request), new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void)); + t1.DriftCommunication$3$debugLog$serialize(_channel, false, true); + return t1; + }, + DriftCommunication: function DriftCommunication(t0, t1, t2, t3, t4) { + var _ = this; + _._communication$_channel = t0; + _._serialize = t1; + _._currentRequestId = 0; + _._pendingRequests = t2; + _._incomingRequests = t3; + _._startedClosingLocally = false; + _._closeCompleter = t4; + }, + DriftCommunication_closure: function DriftCommunication_closure(t0) { + this.$this = t0; + }, + DriftCommunication_setRequestHandler_closure: function DriftCommunication_setRequestHandler_closure(t0, t1) { + this.$this = t0; + this.handler = t1; + }, + _PendingRequest: function _PendingRequest(t0, t1) { + this.completer = t0; + this.requestTrace = t1; + }, + ConnectionClosedException: function ConnectionClosedException() { + }, + DriftRemoteException: function DriftRemoteException(t0) { + this.remoteCause = t0; + }, + DriftProtocol: function DriftProtocol() { + }, + DriftProtocol_decodePayload_readInt: function DriftProtocol_decodePayload_readInt(t0) { + this._box_0 = t0; + }, + DriftProtocol_decodePayload_readNullableInt: function DriftProtocol_decodePayload_readNullableInt(t0) { + this._box_0 = t0; + }, + Message: function Message() { + }, + Request: function Request(t0, t1) { + this.id = t0; + this.payload = t1; + }, + SuccessResponse: function SuccessResponse(t0, t1) { + this.requestId = t0; + this.response = t1; + }, + ErrorResponse: function ErrorResponse(t0, t1, t2) { + this.requestId = t0; + this.error = t1; + this.stackTrace = t2; + }, + CancelledResponse: function CancelledResponse(t0) { + this.requestId = t0; + }, + NoArgsRequest: function NoArgsRequest(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + StatementMethod: function StatementMethod(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + ExecuteQuery: function ExecuteQuery(t0, t1, t2, t3) { + var _ = this; + _.method = t0; + _.sql = t1; + _.args = t2; + _.executorId = t3; + }, + RequestCancellation: function RequestCancellation(t0) { + this.originalRequestId = t0; + }, + ExecuteBatchedStatement: function ExecuteBatchedStatement(t0, t1) { + this.stmts = t0; + this.executorId = t1; + }, + NestedExecutorControl: function NestedExecutorControl(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + RunNestedExecutorControl: function RunNestedExecutorControl(t0, t1) { + this.control = t0; + this.executorId = t1; + }, + EnsureOpen: function EnsureOpen(t0, t1) { + this.schemaVersion = t0; + this.executorId = t1; + }, + ServerInfo: function ServerInfo(t0) { + this.dialect = t0; + }, + RunBeforeOpen: function RunBeforeOpen(t0, t1) { + this.details = t0; + this.createdExecutor = t1; + }, + NotifyTablesUpdated: function NotifyTablesUpdated(t0) { + this.updates = t0; + }, + SelectResult: function SelectResult(t0) { + this.rows = t0; + }, + ServerImplementation$(connection, allowRemoteShutdown, closeExecutorWhenShutdown) { + var _null = null, + t1 = type$.int, + t2 = A._setArrayType([], type$.JSArray_int); + t1 = new A.ServerImplementation(connection, false, true, A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.QueryExecutor), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.CancellationToken_dynamic), t2, new A._SyncBroadcastStreamController(_null, _null, type$._SyncBroadcastStreamController_void), A.LinkedHashSet_LinkedHashSet$_empty(type$.DriftCommunication), new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void), A.StreamController_StreamController(_null, _null, false, type$.NotifyTablesUpdated)); + t1.ServerImplementation$3(connection, false, true); + return t1; + }, + ServerImplementation: function ServerImplementation(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) { + var _ = this; + _.connection = t0; + _.allowRemoteShutdown = t1; + _.closeExecutorWhenShutdown = t2; + _._managedExecutors = t3; + _._knownSchemaVersion = _._currentExecutorId = 0; + _._cancellableOperations = t4; + _._executorBacklog = t5; + _._backlogUpdated = t6; + _._isShuttingDown = false; + _._activeChannels = t7; + _._done = t8; + _._tableUpdateNotifications = t9; + }, + ServerImplementation_closure: function ServerImplementation_closure(t0) { + this.$this = t0; + }, + ServerImplementation_serve_closure: function ServerImplementation_serve_closure(t0, t1) { + this.$this = t0; + this.comm = t1; + }, + ServerImplementation_serve_closure0: function ServerImplementation_serve_closure0(t0, t1) { + this.$this = t0; + this.comm = t1; + }, + ServerImplementation__handleRequest_closure: function ServerImplementation__handleRequest_closure(t0, t1) { + this.$this = t0; + this.payload = t1; + }, + ServerImplementation__handleRequest_closure0: function ServerImplementation__handleRequest_closure0(t0, t1) { + this.$this = t0; + this.request = t1; + }, + ServerImplementation__waitForTurn_idIsActive: function ServerImplementation__waitForTurn_idIsActive(t0, t1) { + this.$this = t0; + this.transactionId = t1; + }, + ServerImplementation__waitForTurn_closure: function ServerImplementation__waitForTurn_closure(t0) { + this.idIsActive = t0; + }, + _ServerDbUser: function _ServerDbUser(t0, t1, t2) { + this._server = t0; + this.connection = t1; + this.schemaVersion = t2; + }, + UpdateKind: function UpdateKind(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + TableUpdate: function TableUpdate(t0, t1) { + this.kind = t0; + this.table = t1; + }, + runCancellable(operation, $T) { + var token, t2, t1 = {}; + t1.token = token; + t1.token = null; + token = new A.CancellationToken(new A._SyncCompleter(new A._Future($.Zone__current, $T._eval$1("_Future<0>")), $T._eval$1("_SyncCompleter<0>")), A._setArrayType([], type$.JSArray_of_void_Function), $T._eval$1("CancellationToken<0>")); + t1.token = token; + t2 = type$.nullable_Object; + A.runZoned(new A.runCancellable_closure(t1, operation, $T), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol_uzx, token], t2, t2), type$.void); + return t1.token; + }, + checkIfCancelled() { + var token = $.Zone__current.$index(0, B.Symbol_uzx); + if (token instanceof A.CancellationToken && token._cancellationRequested) + throw A.wrapException(B.C_CancellationException); + }, + runCancellable_closure: function runCancellable_closure(t0, t1, t2) { + this._box_0 = t0; + this.operation = t1; + this.T = t2; + }, + CancellationToken: function CancellationToken(t0, t1, t2) { + var _ = this; + _._resultCompleter = t0; + _._cancellationCallbacks = t1; + _._cancellationRequested = false; + _.$ti = t2; + }, + CancellationException: function CancellationException() { + }, + QueryExecutor: function QueryExecutor() { + }, + BatchedStatements: function BatchedStatements(t0, t1) { + this.statements = t0; + this.$arguments = t1; + }, + ArgumentsForBatchedStatement: function ArgumentsForBatchedStatement(t0, t1) { + this.statementIndex = t0; + this.$arguments = t1; + }, + _defaultSavepoint(depth) { + return "SAVEPOINT s" + A._asInt(depth); + }, + _defaultRelease(depth) { + return "RELEASE s" + A._asInt(depth); + }, + _defaultRollbackToSavepoint(depth) { + return "ROLLBACK TO s" + A._asInt(depth); + }, + DatabaseDelegate: function DatabaseDelegate() { + }, + QueryDelegate: function QueryDelegate() { + }, + TransactionDelegate: function TransactionDelegate() { + }, + NoTransactionDelegate: function NoTransactionDelegate() { + }, + DbVersionDelegate: function DbVersionDelegate() { + }, + NoVersionDelegate: function NoVersionDelegate() { + }, + DynamicVersionDelegate: function DynamicVersionDelegate() { + }, + _BaseExecutor: function _BaseExecutor() { + }, + _BaseExecutor__synchronized_closure: function _BaseExecutor__synchronized_closure(t0, t1) { + this.action = t0; + this.T = t1; + }, + _BaseExecutor_runSelect_closure: function _BaseExecutor_runSelect_closure(t0, t1, t2) { + this.$this = t0; + this.statement = t1; + this.args = t2; + }, + _BaseExecutor_runDelete_closure: function _BaseExecutor_runDelete_closure(t0, t1, t2) { + this.$this = t0; + this.statement = t1; + this.args = t2; + }, + _BaseExecutor_runInsert_closure: function _BaseExecutor_runInsert_closure(t0, t1, t2) { + this.$this = t0; + this.statement = t1; + this.args = t2; + }, + _BaseExecutor_runCustom_closure: function _BaseExecutor_runCustom_closure(t0, t1, t2) { + this.$this = t0; + this.args = t1; + this.statement = t2; + }, + _BaseExecutor_runBatched_closure: function _BaseExecutor_runBatched_closure(t0, t1) { + this.$this = t0; + this.statements = t1; + }, + _TransactionExecutor: function _TransactionExecutor() { + }, + _StatementBasedTransactionExecutor: function _StatementBasedTransactionExecutor(t0, t1, t2, t3, t4, t5, t6, t7, t8) { + var _ = this; + _._engines$_delegate = t0; + _._opened = null; + _._engines$_done = t1; + _._parent = t2; + _.depth = t3; + _._startCommand = t4; + _._commitCommand = t5; + _._rollbackCommand = t6; + _._db = t7; + _._lock = t8; + _._waitingChildExecutors = 0; + _._engines$_closed = _._ensureOpenCalled = false; + }, + _StatementBasedTransactionExecutor_ensureOpen_closure: function _StatementBasedTransactionExecutor_ensureOpen_closure(t0) { + this.$this = t0; + }, + _StatementBasedTransactionExecutor_ensureOpen_closure0: function _StatementBasedTransactionExecutor_ensureOpen_closure0(t0) { + this.parent = t0; + }, + DelegatedDatabase: function DelegatedDatabase() { + }, + DelegatedDatabase_ensureOpen_closure: function DelegatedDatabase_ensureOpen_closure(t0, t1) { + this.$this = t0; + this.user = t1; + }, + DelegatedDatabase_close_closure: function DelegatedDatabase_close_closure(t0) { + this.$this = t0; + }, + _BeforeOpeningExecutor: function _BeforeOpeningExecutor(t0, t1) { + var _ = this; + _._base = t0; + _._lock = t1; + _._waitingChildExecutors = 0; + _._engines$_closed = _._ensureOpenCalled = false; + }, + _ExclusiveExecutor: function _ExclusiveExecutor(t0, t1, t2) { + var _ = this; + _._outer = t0; + _._opened = null; + _._completer = t1; + _._lock = t2; + _._waitingChildExecutors = 0; + _._engines$_closed = _._ensureOpenCalled = false; + }, + _ExclusiveExecutor_ensureOpen_closure: function _ExclusiveExecutor_ensureOpen_closure(t0, t1) { + this.$this = t0; + this.opened = t1; + }, + QueryResult$(columnNames, rows) { + var t2, _i, column, + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.int); + for (t2 = columnNames.length, _i = 0; _i < columnNames.length; columnNames.length === t2 || (0, A.throwConcurrentModificationError)(columnNames), ++_i) { + column = columnNames[_i]; + t1.$indexSet(0, column, B.JSArray_methods.lastIndexOf$1(columnNames, column)); + } + return new A.QueryResult(columnNames, rows, t1); + }, + QueryResult_QueryResult$fromRows(rows) { + var keys, t1, t2, _i, row, t3, t4, t5, _i0; + if (rows.length === 0) + return A.QueryResult$(B.List_empty2, B.List_empty3); + keys = J.toList$0$ax(B.JSArray_methods.get$first(rows).get$keys()); + t1 = A._setArrayType([], type$.JSArray_List_dynamic); + for (t2 = rows.length, _i = 0; _i < rows.length; rows.length === t2 || (0, A.throwConcurrentModificationError)(rows), ++_i) { + row = rows[_i]; + t3 = []; + for (t4 = keys.length, t5 = J.getInterceptor$asx(row), _i0 = 0; _i0 < keys.length; keys.length === t4 || (0, A.throwConcurrentModificationError)(keys), ++_i0) + t3.push(t5.$index(row, keys[_i0])); + t1.push(t3); + } + return A.QueryResult$(keys, t1); + }, + QueryResult: function QueryResult(t0, t1, t2) { + this.columnNames = t0; + this.rows = t1; + this._columnIndexes = t2; + }, + QueryResult_asMap_closure: function QueryResult_asMap_closure(t0) { + this.$this = t0; + }, + ApplyInterceptor_interceptWith(_this, interceptor) { + return new A._InterceptedExecutor(_this, interceptor); + }, + QueryInterceptor: function QueryInterceptor() { + }, + _InterceptedExecutor: function _InterceptedExecutor(t0, t1) { + this._interceptor$_inner = t0; + this._interceptor$_interceptor = t1; + }, + _InterceptedTransactionExecutor: function _InterceptedTransactionExecutor(t0, t1) { + this._interceptor$_inner = t0; + this._interceptor$_interceptor = t1; + }, + OpeningDetails: function OpeningDetails(t0, t1) { + this.versionBefore = t0; + this.versionNow = t1; + }, + SqlDialect: function SqlDialect(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + Sqlite3Delegate: function Sqlite3Delegate() { + }, + _SqliteVersionDelegate: function _SqliteVersionDelegate(t0) { + this.database = t0; + }, + PreparedStatementsCache: function PreparedStatementsCache(t0) { + this._cachedStatements = t0; + }, + EnableNativeFunctions_useNativeFunctions(_this) { + var _s13_ = "moor_contains"; + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_2, true, A.native_functions___pow$closure(), "power"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_2, true, A.native_functions___pow$closure(), "pow"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__sqrt$closure()), "sqrt"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__sin$closure()), "sin"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__cos$closure()), "cos"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__tan$closure()), "tan"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__asin$closure()), "asin"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__acos$closure()), "acos"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_1, true, A._unaryNumFunction(A.math__atan$closure()), "atan"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_2, true, A.native_functions___regexpImpl$closure(), "regexp"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_3, true, A.native_functions___regexpImpl$closure(), "regexp_moor_ffi"); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_2, true, A.native_functions___containsImpl$closure(), _s13_); + _this.createFunction$4$argumentCount$deterministic$function$functionName(B.AllowedArgumentCount_3, true, A.native_functions___containsImpl$closure(), _s13_); + _this.createFunction$5$argumentCount$deterministic$directOnly$function$functionName(B.AllowedArgumentCount_0, true, false, new A.EnableNativeFunctions_useNativeFunctions_closure(), "current_time_millis"); + }, + _pow(args) { + var first = args.$index(0, 0), + second = args.$index(0, 1); + if (first == null || second == null || typeof first != "number" || typeof second != "number") + return null; + return Math.pow(first, second); + }, + _unaryNumFunction(calculation) { + return new A._unaryNumFunction_closure(calculation); + }, + _regexpImpl(args) { + var firstParam, regex, secondParam, value, t1, t2, t3, exception, + multiLine = false, + caseSensitive = true, + unicode = false, + dotAll = false, + argCount = args.rawValues.length; + if (argCount < 2 || argCount > 3) + throw A.wrapException("Expected two or three arguments to regexp"); + firstParam = args.$index(0, 0); + secondParam = args.$index(0, 1); + if (firstParam == null || secondParam == null) + return null; + if (typeof firstParam != "string" || typeof secondParam != "string") + throw A.wrapException("Expected two strings as parameters to regexp"); + if (argCount === 3) { + value = args.$index(0, 2); + if (A._isInt(value)) { + multiLine = (value & 1) === 1; + caseSensitive = (value & 2) !== 2; + unicode = (value & 4) === 4; + dotAll = (value & 8) === 8; + } + } + regex = null; + try { + t1 = multiLine; + t2 = caseSensitive; + t3 = unicode; + regex = A.RegExp_RegExp(firstParam, t2, dotAll, t1, t3); + } catch (exception) { + if (A.unwrapException(exception) instanceof A.FormatException) + throw A.wrapException("Invalid regex"); + else + throw exception; + } + t1 = regex._nativeRegExp; + return t1.test(secondParam); + }, + _containsImpl(args) { + var first, second, + argCount = args.rawValues.length; + if (argCount < 2 || argCount > 3) + throw A.wrapException("Expected 2 or 3 arguments to moor_contains"); + first = args.$index(0, 0); + second = args.$index(0, 1); + if (typeof first != "string" || typeof second != "string") + throw A.wrapException("First two args to contains must be strings"); + return argCount === 3 && args.$index(0, 2) === 1 ? J.contains$1$asx(first, second) : B.JSString_methods.contains$1(first.toLowerCase(), second.toLowerCase()); + }, + EnableNativeFunctions_useNativeFunctions_closure: function EnableNativeFunctions_useNativeFunctions_closure() { + }, + _unaryNumFunction_closure: function _unaryNumFunction_closure(t0) { + this.calculation = t0; + }, + LazyDatabase: function LazyDatabase(t0) { + var _ = this; + _.__LazyDatabase__delegate_F = $; + _._delegateAvailable = false; + _._openDelegate = null; + _.opener = t0; + }, + LazyDatabase__awaitOpened_closure: function LazyDatabase__awaitOpened_closure(t0, t1) { + this.$this = t0; + this.delegate = t1; + }, + LazyDatabase_ensureOpen_closure: function LazyDatabase_ensureOpen_closure(t0, t1) { + this.$this = t0; + this.user = t1; + }, + Lock: function Lock() { + this._last = null; + }, + Lock_synchronized_callBlockAndComplete: function Lock_synchronized_callBlockAndComplete(t0, t1, t2) { + this.block = t0; + this.blockCompleted = t1; + this.T = t2; + }, + Lock_synchronized_closure: function Lock_synchronized_closure(t0, t1) { + this.callBlockAndComplete = t0; + this.T = t1; + }, + WebPortToChannel_channel(_this, explicitClose) { + var _null = null, + _s8_ = "_foreign", + controller = new A.StreamChannelController(type$.StreamChannelController_nullable_Object), + t1 = type$.nullable_Object, + localToForeignController = A.StreamController_StreamController(_null, _null, false, t1), + foreignToLocalController = A.StreamController_StreamController(_null, _null, false, t1), + t2 = A._instanceType(foreignToLocalController), + t3 = A._instanceType(localToForeignController); + controller.set$__StreamChannelController__local_F(A.GuaranteeChannel$(new A._ControllerStream(foreignToLocalController, t2._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(localToForeignController, t3._eval$1("_StreamSinkWrapper<1>")), true, t1)); + t1 = A.GuaranteeChannel$(new A._ControllerStream(localToForeignController, t3._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(foreignToLocalController, t2._eval$1("_StreamSinkWrapper<1>")), true, t1); + controller.__StreamChannelController__foreign_F !== $ && A.throwLateFieldAI(_s8_); + controller.set$__StreamChannelController__foreign_F(t1); + t1 = type$.JavaScriptFunction._as(A.allowInterop(new A.WebPortToChannel_channel_closure(explicitClose, controller), type$.Function)); + if (A.assertTest(typeof t1 == "function")) + A.assertThrow(string$.Dart_f); + _this.onmessage = t1; + t1 = controller.__StreamChannelController__local_F; + t1 === $ && A.throwLateFieldNI("_local"); + t1 = t1.__GuaranteeChannel__streamController_F; + t1 === $ && A.throwLateFieldNI("_streamController"); + new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$2$onDone(new A.WebPortToChannel_channel_closure0(_this), new A.WebPortToChannel_channel_closure1(explicitClose, _this)); + t1 = controller.__StreamChannelController__foreign_F; + t1 === $ && A.throwLateFieldNI(_s8_); + return t1; + }, + WebPortToChannel_channel_closure: function WebPortToChannel_channel_closure(t0, t1) { + this.explicitClose = t0; + this.controller = t1; + }, + WebPortToChannel_channel_closure0: function WebPortToChannel_channel_closure0(t0) { + this._this = t0; + }, + WebPortToChannel_channel_closure1: function WebPortToChannel_channel_closure1(t0, t1) { + this.explicitClose = t0; + this._this = t1; + }, + DedicatedDriftWorker: function DedicatedDriftWorker(t0, t1, t2) { + var _ = this; + _.self = t0; + _._checkCompatibility = t1; + _._dedicated_worker$_servers = t2; + _._compatibility = null; + }, + DedicatedDriftWorker_start_closure: function DedicatedDriftWorker_start_closure(t0) { + this.$this = t0; + }, + DedicatedDriftWorker__handleMessage_closure: function DedicatedDriftWorker__handleMessage_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + ProtocolVersion_negotiate(versionCode) { + var t1; + $label0$0: { + if (versionCode <= 0) { + t1 = B.ProtocolVersion_0_0_legacy; + break $label0$0; + } + if (1 === versionCode) { + t1 = B.ProtocolVersion_1_1_v1; + break $label0$0; + } + if (2 === versionCode) { + t1 = B.ProtocolVersion_2_2_v2; + break $label0$0; + } + if (versionCode > 2) { + t1 = B.ProtocolVersion_2_2_v2; + break $label0$0; + } + t1 = A.throwExpression(A.AssertionError$(null)); + } + return t1; + }, + ProtocolVersion_fromJsObject(object) { + if ("v" in object) + return A.ProtocolVersion_negotiate(A._asInt(A._asDouble(object.v))); + else + return B.ProtocolVersion_0_0_legacy; + }, + WasmInitializationMessage_WasmInitializationMessage$fromJs(jsObject) { + var t1, version, t2, t3, t4, t5, existingDatabases, t6, asBooleans, + type = A._asString(jsObject.type), + payload = jsObject.payload; + $label0$0: { + if ("Error" === type) { + t1 = new A.WorkerError(A._asString(type$.JSObject._as(payload))); + break $label0$0; + } + if ("ServeDriftDatabase" === type) { + t1 = type$.JSObject; + t1._as(payload); + version = A.ProtocolVersion_fromJsObject(payload); + t2 = A.Uri_parse(A._asString(payload.sqlite)); + t1 = t1._as(payload.port); + t3 = A.EnumByName_byName(B.List_gqi, A._asString(payload.storage), type$.WasmStorageImplementation); + t4 = A._asString(payload.database); + t5 = type$.nullable_JSObject._as(payload.initPort); + t1 = new A.ServeDriftDatabase(t2, t1, t3, t4, t5, version, version.versionCode < 2 || A._asBool(payload.migrations)); + break $label0$0; + } + if ("StartFileSystemServer" === type) { + t1 = new A.StartFileSystemServer(type$.JSObject._as(payload)); + break $label0$0; + } + if ("RequestCompatibilityCheck" === type) { + t1 = new A.RequestCompatibilityCheck(A._asString(payload)); + break $label0$0; + } + if ("DedicatedWorkerCompatibilityResult" === type) { + type$.JSObject._as(payload); + existingDatabases = A._setArrayType([], type$.JSArray_Record_2_WebStorageApi_and_String); + if ("existing" in payload) + B.JSArray_methods.addAll$1(existingDatabases, A.EncodeLocations_readFromJs(type$.JSArray_nullable_Object._as(payload.existing))); + t1 = A._asBool(payload.supportsNestedWorkers); + t2 = A._asBool(payload.canAccessOpfs); + t3 = A._asBool(payload.supportsSharedArrayBuffers); + t4 = A._asBool(payload.supportsIndexedDb); + t5 = A._asBool(payload.indexedDbExists); + t6 = A._asBool(payload.opfsExists); + t6 = new A.DedicatedWorkerCompatibilityResult(t1, t2, t3, t4, existingDatabases, A.ProtocolVersion_fromJsObject(payload), t5, t6); + t1 = t6; + break $label0$0; + } + if ("SharedWorkerCompatibilityResult" === type) { + t1 = type$.JSArray_nullable_Object; + t1._as(payload); + asBooleans = B.JSArray_methods.cast$1$0(payload, type$.bool); + if (payload.length > 5) { + if (5 < 0 || 5 >= payload.length) + return A.ioore(payload, 5); + existingDatabases = A.EncodeLocations_readFromJs(t1._as(payload[5])); + if (payload.length > 6) { + if (6 < 0 || 6 >= payload.length) + return A.ioore(payload, 6); + version = A.ProtocolVersion_negotiate(A._asInt(payload[6])); + } else + version = B.ProtocolVersion_0_0_legacy; + } else { + existingDatabases = B.List_empty5; + version = B.ProtocolVersion_0_0_legacy; + } + t1 = asBooleans._source; + t2 = J.getInterceptor$asx(t1); + t3 = asBooleans.$ti._rest[1]; + t1 = new A.SharedWorkerCompatibilityResult(t3._as(t2.$index(t1, 0)), t3._as(t2.$index(t1, 1)), t3._as(t2.$index(t1, 2)), existingDatabases, version, t3._as(t2.$index(t1, 3)), t3._as(t2.$index(t1, 4))); + break $label0$0; + } + if ("DeleteDatabase" === type) { + t1 = payload == null ? type$.Object._as(payload) : payload; + type$.JSArray_nullable_Object._as(t1); + t2 = $.$get$WebStorageApi_byName(); + if (0 < 0 || 0 >= t1.length) + return A.ioore(t1, 0); + t2 = t2.$index(0, A._asString(t1[0])); + t2.toString; + if (1 < 0 || 1 >= t1.length) + return A.ioore(t1, 1); + t1 = new A.DeleteDatabase(new A._Record_2(t2, A._asString(t1[1]))); + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$("Unknown type " + type, null)); + } + return t1; + }, + EncodeLocations_readFromJs(object) { + var t3, t4, + existing = A._setArrayType([], type$.JSArray_Record_2_WebStorageApi_and_String), + t1 = B.JSArray_methods.cast$1$0(object, type$.JSObject), + t2 = t1.$ti; + t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")); + t2 = t2._eval$1("ListBase.E"); + for (; t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + t4 = $.$get$WebStorageApi_byName().$index(0, A._asString(t3.l)); + t4.toString; + B.JSArray_methods.add$1(existing, new A._Record_2(t4, A._asString(t3.n))); + } + return existing; + }, + EncodeLocations_encodeToJs(_this) { + var t1, _i, entry, _this0, + existing = A._setArrayType([], type$.JSArray_JSObject); + for (t1 = _this.length, _i = 0; _i < _this.length; _this.length === t1 || (0, A.throwConcurrentModificationError)(_this), ++_i) { + entry = _this[_i]; + _this0 = {}; + _this0.l = entry._0._core$_name; + _this0.n = entry._1; + B.JSArray_methods.add$1(existing, _this0); + } + return existing; + }, + _extension_1_sendTyped(_this, type, payload, transfer) { + var _this0 = {}; + _this0.type = type; + _this0.payload = payload; + _this.call$2(_this0, transfer); + }, + ProtocolVersion: function ProtocolVersion(t0, t1, t2) { + this.versionCode = t0; + this.index = t1; + this._core$_name = t2; + }, + WasmInitializationMessage: function WasmInitializationMessage() { + }, + WasmInitializationMessage_sendToWorker_closure: function WasmInitializationMessage_sendToWorker_closure(t0) { + this.worker = t0; + }, + WasmInitializationMessage_sendToPort_closure: function WasmInitializationMessage_sendToPort_closure(t0) { + this.port = t0; + }, + WasmInitializationMessage_sendToClient_closure: function WasmInitializationMessage_sendToClient_closure(t0) { + this.worker = t0; + }, + CompatibilityResult: function CompatibilityResult() { + }, + SharedWorkerCompatibilityResult: function SharedWorkerCompatibilityResult(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.canSpawnDedicatedWorkers = t0; + _.dedicatedWorkersCanUseOpfs = t1; + _.canUseIndexedDb = t2; + _.existingDatabases = t3; + _.version = t4; + _.indexedDbExists = t5; + _.opfsExists = t6; + }, + WorkerError: function WorkerError(t0) { + this.error = t0; + }, + ServeDriftDatabase: function ServeDriftDatabase(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.sqlite3WasmUri = t0; + _.port = t1; + _.storage = t2; + _.databaseName = t3; + _.initializationPort = t4; + _.protocolVersion = t5; + _.enableMigrations = t6; + }, + RequestCompatibilityCheck: function RequestCompatibilityCheck(t0) { + this.databaseName = t0; + }, + DedicatedWorkerCompatibilityResult: function DedicatedWorkerCompatibilityResult(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _.supportsNestedWorkers = t0; + _.canAccessOpfs = t1; + _.supportsSharedArrayBuffers = t2; + _.supportsIndexedDb = t3; + _.existingDatabases = t4; + _.version = t5; + _.indexedDbExists = t6; + _.opfsExists = t7; + }, + StartFileSystemServer: function StartFileSystemServer(t0) { + this.sqlite3Options = t0; + }, + DeleteDatabase: function DeleteDatabase(t0) { + this.database = t0; + }, + _storageManager() { + var t1 = type$.JSObject, + $navigator = t1._as(self.navigator); + if ("storage" in $navigator) + return t1._as($navigator.storage); + return null; + }, + checkOpfsSupport() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], opfsRoot, fileHandle, openedFile, getSizeResult, t1, exception, storage, $async$exception; + var $async$checkOpfsSupport = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + storage = A._storageManager(); + if (storage == null) { + $async$returnValue = false; + // goto return + $async$goto = 1; + break; + } + opfsRoot = null; + fileHandle = null; + openedFile = null; + $async$handler = 4; + t1 = type$.JSObject; + $async$goto = 7; + return A._asyncAwait(A.promiseToFuture(t1._as(storage.getDirectory()), t1), $async$checkOpfsSupport); + case 7: + // returning from await. + opfsRoot = $async$result; + $async$goto = 8; + return A._asyncAwait(A.promiseToFuture(t1._as(opfsRoot.getFileHandle("_drift_feature_detection", {create: true})), t1), $async$checkOpfsSupport); + case 8: + // returning from await. + fileHandle = $async$result; + $async$goto = 9; + return A._asyncAwait(A.promiseToFuture(t1._as(fileHandle.createSyncAccessHandle()), t1), $async$checkOpfsSupport); + case 9: + // returning from await. + openedFile = $async$result; + getSizeResult = A.JSObjectUnsafeUtilExtension__callMethod(openedFile, "getSize", null, null, null, null); + $async$goto = typeof getSizeResult === "object" ? 10 : 11; + break; + case 10: + // then + $async$goto = 12; + return A._asyncAwait(A.promiseToFuture(t1._as(getSizeResult), type$.nullable_Object), $async$checkOpfsSupport); + case 12: + // returning from await. + $async$returnValue = false; + $async$next = [1]; + // goto finally + $async$goto = 5; + break; + case 11: + // join + $async$returnValue = true; + $async$next = [1]; + // goto finally + $async$goto = 5; + break; + $async$next.push(6); + // goto finally + $async$goto = 5; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + $async$returnValue = false; + $async$next = [1]; + // goto finally + $async$goto = 5; + break; + $async$next.push(6); + // goto finally + $async$goto = 5; + break; + case 3: + // uncaught + $async$next = [2]; + case 5: + // finally + $async$handler = 2; + if (openedFile != null) + openedFile.close(); + $async$goto = opfsRoot != null && fileHandle != null ? 13 : 14; + break; + case 13: + // then + $async$goto = 15; + return A._asyncAwait(A.promiseToFuture(type$.JSObject._as(opfsRoot.removeEntry("_drift_feature_detection")), type$.nullable_Object), $async$checkOpfsSupport); + case 15: + // returning from await. + case 14: + // join + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$checkOpfsSupport, $async$completer); + }, + checkIndexedDbSupport() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$handler = 2, $async$currentError, idb, mockDb, exception, t1, t2, $async$exception; + var $async$checkIndexedDbSupport = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + t2 = t1._as(self); + if (!("indexedDB" in t2) || !("FileReader" in t2)) { + $async$returnValue = false; + // goto return + $async$goto = 1; + break; + } + idb = t1._as(t2.indexedDB); + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait(A.CompleteIdbRequest_complete0(t1._as(idb.open("drift_mock_db")), t1), $async$checkIndexedDbSupport); + case 7: + // returning from await. + mockDb = $async$result; + mockDb.close(); + t1._as(idb.deleteDatabase("drift_mock_db")); + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + $async$returnValue = false; + // goto return + $async$goto = 1; + break; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + $async$returnValue = true; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$checkIndexedDbSupport, $async$completer); + }, + checkIndexedDbExists(databaseName) { + return A.checkIndexedDbExists$body(databaseName); + }, + checkIndexedDbExists$body(databaseName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$handler = 2, $async$currentError, idb, databases, entry, openRequest, database, t1, t2, exception, _box_0, $async$exception; + var $async$checkIndexedDbExists = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + $async$outer: + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + _box_0.indexedDbExists = null; + $async$handler = 4; + t1 = type$.JSObject; + idb = t1._as(t1._as(self).indexedDB); + $async$goto = "databases" in idb ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait(A.promiseToFuture(t1._as(idb.databases()), type$.JSArray_nullable_Object), $async$checkIndexedDbExists); + case 9: + // returning from await. + databases = $async$result; + t1 = databases; + t1 = J.get$iterator$ax(type$.List_JSObject._is(t1) ? t1 : new A.CastList(t1, A._arrayInstanceType(t1)._eval$1("CastList<1,JSObject>"))); + for (; t1.moveNext$0();) { + entry = t1.get$current(); + if (A._asString(entry.name) === databaseName) { + $async$returnValue = true; + // goto return + $async$goto = 1; + break $async$outer; + } + } + $async$returnValue = false; + // goto return + $async$goto = 1; + break; + case 8: + // join + openRequest = t1._as(idb.open(databaseName, 1)); + t2 = type$.JavaScriptFunction._as(A.allowInterop(new A.checkIndexedDbExists_closure(_box_0, openRequest), type$.Function)); + if (A.assertTest(typeof t2 == "function")) + A.assertThrow(string$.Dart_f); + openRequest.onupgradeneeded = t2; + $async$goto = 10; + return A._asyncAwait(A.CompleteIdbRequest_complete0(openRequest, t1), $async$checkIndexedDbExists); + case 10: + // returning from await. + database = $async$result; + if (_box_0.indexedDbExists == null) + _box_0.indexedDbExists = true; + database.close(); + $async$goto = _box_0.indexedDbExists === false ? 11 : 12; + break; + case 11: + // then + $async$goto = 13; + return A._asyncAwait(A.CompleteIdbRequest_complete0(t1._as(idb.deleteDatabase(databaseName)), type$.nullable_Object), $async$checkIndexedDbExists); + case 13: + // returning from await. + case 12: + // join + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + t1 = _box_0.indexedDbExists; + $async$returnValue = t1 === true; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$checkIndexedDbExists, $async$completer); + }, + deleteDatabaseInIndexedDb(databaseName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + t1, t2; + var $async$deleteDatabaseInIndexedDb = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + t2 = t1._as(self); + $async$goto = "indexedDB" in t2 ? 2 : 3; + break; + case 2: + // then + $async$goto = 4; + return A._asyncAwait(A.CompleteIdbRequest_complete0(t1._as(t1._as(t2.indexedDB).deleteDatabase(databaseName)), type$.nullable_Object), $async$deleteDatabaseInIndexedDb); + case 4: + // returning from await. + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$deleteDatabaseInIndexedDb, $async$completer); + }, + opfsDatabases() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.List_String), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], directory, entries, t1, entry, t2, exception, t3, storage, $async$exception, $async$temp1; + var $async$opfsDatabases = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + storage = A._storageManager(); + if (storage == null) { + $async$returnValue = B.List_empty2; + // goto return + $async$goto = 1; + break; + } + t2 = type$.JSObject; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t2._as(storage.getDirectory()), t2), $async$opfsDatabases); + case 3: + // returning from await. + directory = $async$result; + $async$handler = 5; + $async$goto = 8; + return A._asyncAwait(A.promiseToFuture(t2._as(directory.getDirectoryHandle("drift_db")), t2), $async$opfsDatabases); + case 8: + // returning from await. + directory = $async$result; + $async$handler = 2; + // goto after finally + $async$goto = 7; + break; + case 5: + // catch + $async$handler = 4; + $async$exception = $async$currentError; + $async$returnValue = B.List_empty2; + // goto return + $async$goto = 1; + break; + // goto after finally + $async$goto = 7; + break; + case 4: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 7: + // after finally + t2 = directory; + t3 = type$.AsyncJavaScriptIteratable_JSArray_nullable_Object; + if (!(type$.JavaScriptSymbol._as(self.Symbol.asyncIterator) in t2)) + A.throwExpression(A.ArgumentError$("Target object does not implement the async iterable interface", null)); + entries = new A._MapStream(t3._eval$1("JSObject(Stream.T)")._as(new A.opfsDatabases_closure()), new A.AsyncJavaScriptIteratable(t2, t3), t3._eval$1("_MapStream")); + t1 = A._setArrayType([], type$.JSArray_String); + t2 = new A._StreamIterator(A.checkNotNullable(entries, "stream", type$.Object), type$._StreamIterator_JSObject); + $async$handler = 9; + case 12: + // for condition + $async$temp1 = A; + $async$goto = 14; + return A._asyncAwait(t2.moveNext$0(), $async$opfsDatabases); + case 14: + // returning from await. + if (!$async$temp1.boolConversionCheck($async$result)) { + // goto after for + $async$goto = 13; + break; + } + entry = t2.get$current(); + if (A._asString(entry.kind) === "directory") + J.add$1$ax(t1, A._asString(entry.name)); + // goto for condition + $async$goto = 12; + break; + case 13: + // after for + $async$next.push(11); + // goto finally + $async$goto = 10; + break; + case 9: + // uncaught + $async$next = [2]; + case 10: + // finally + $async$handler = 2; + $async$goto = 15; + return A._asyncAwait(t2.cancel$0(), $async$opfsDatabases); + case 15: + // returning from await. + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 11: + // after finally + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$opfsDatabases, $async$completer); + }, + deleteDatabaseInOpfs(databaseName) { + return A.deleteDatabaseInOpfs$body(databaseName); + }, + deleteDatabaseInOpfs$body(databaseName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, directory, t1, exception, storage, $async$exception; + var $async$deleteDatabaseInOpfs = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + storage = A._storageManager(); + if (storage == null) { + // goto return + $async$goto = 1; + break; + } + t1 = type$.JSObject; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t1._as(storage.getDirectory()), t1), $async$deleteDatabaseInOpfs); + case 3: + // returning from await. + directory = $async$result; + $async$handler = 5; + $async$goto = 8; + return A._asyncAwait(A.promiseToFuture(t1._as(directory.getDirectoryHandle("drift_db")), t1), $async$deleteDatabaseInOpfs); + case 8: + // returning from await. + directory = $async$result; + $async$goto = 9; + return A._asyncAwait(A.promiseToFuture(t1._as(directory.removeEntry(databaseName, {recursive: true})), type$.nullable_Object), $async$deleteDatabaseInOpfs); + case 9: + // returning from await. + $async$handler = 2; + // goto after finally + $async$goto = 7; + break; + case 5: + // catch + $async$handler = 4; + $async$exception = $async$currentError; + // goto after finally + $async$goto = 7; + break; + case 4: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 7: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$deleteDatabaseInOpfs, $async$completer); + }, + CompleteIdbRequest_complete0(_this, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")), + completer = new A._SyncCompleter(t1, $T._eval$1("_SyncCompleter<0>")), + t2 = type$.nullable_void_Function_JSObject, + t3 = type$.JSObject; + A._EventStreamSubscription$(_this, "success", t2._as(new A.CompleteIdbRequest_complete_closure1(completer, _this, $T)), false, t3); + A._EventStreamSubscription$(_this, "error", t2._as(new A.CompleteIdbRequest_complete_closure2(completer, _this)), false, t3); + return t1; + }, + checkIndexedDbExists_closure: function checkIndexedDbExists_closure(t0, t1) { + this._box_0 = t0; + this.openRequest = t1; + }, + opfsDatabases_closure: function opfsDatabases_closure() { + }, + DriftServerController: function DriftServerController(t0, t1) { + this.servers = t0; + this._setup = t1; + }, + DriftServerController_serve_closure: function DriftServerController_serve_closure(t0, t1) { + this.$this = t0; + this.message = t1; + }, + DriftServerController_serve__closure: function DriftServerController_serve__closure(t0) { + this.initPort = t0; + }, + DriftServerController_serve___closure: function DriftServerController_serve___closure(t0) { + this.completer = t0; + }, + DriftServerController_serve__closure0: function DriftServerController_serve__closure0(t0, t1, t2) { + this.$this = t0; + this.message = t1; + this.initializer = t2; + }, + DriftServerController_serve__closure1: function DriftServerController_serve__closure1(t0, t1, t2) { + this.$this = t0; + this.message = t1; + this.wasmServer = t2; + }, + _CloseVfsOnClose: function _CloseVfsOnClose(t0, t1) { + this._shared$_close = t0; + this._root = t1; + }, + RunningWasmServer: function RunningWasmServer(t0, t1, t2) { + var _ = this; + _.storage = t0; + _.server = t1; + _._connectedClients = 0; + _._lastClientDisconnected = t2; + }, + RunningWasmServer_serve_closure: function RunningWasmServer_serve_closure(t0) { + this.$this = t0; + }, + WasmCompatibility: function WasmCompatibility(t0, t1) { + this.supportsIndexedDb = t0; + this.supportsOpfs = t1; + }, + CompleteIdbRequest_complete_closure1: function CompleteIdbRequest_complete_closure1(t0, t1, t2) { + this.completer = t0; + this._this = t1; + this.T = t2; + }, + CompleteIdbRequest_complete_closure2: function CompleteIdbRequest_complete_closure2(t0, t1) { + this.completer = t0; + this._this = t1; + }, + SharedDriftWorker: function SharedDriftWorker(t0, t1) { + this.self = t0; + this._dedicatedWorker = null; + this._servers = t1; + }, + SharedDriftWorker_start_closure: function SharedDriftWorker_start_closure(t0) { + this.$this = t0; + }, + SharedDriftWorker__newConnection_closure: function SharedDriftWorker__newConnection_closure(t0, t1) { + this.$this = t0; + this.clientPort = t1; + }, + SharedDriftWorker__startFeatureDetection_result: function SharedDriftWorker__startFeatureDetection_result(t0, t1, t2) { + this._box_0 = t0; + this.completer = t1; + this.canUseIndexedDb = t2; + }, + SharedDriftWorker__startFeatureDetection_closure: function SharedDriftWorker__startFeatureDetection_closure(t0) { + this.result = t0; + }, + SharedDriftWorker__startFeatureDetection_closure0: function SharedDriftWorker__startFeatureDetection_closure0(t0, t1, t2) { + this.$this = t0; + this.result = t1; + this.worker = t2; + }, + WasmStorageImplementation: function WasmStorageImplementation(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + WebStorageApi: function WebStorageApi(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + WasmDatabase: function WasmDatabase(t0, t1, t2, t3, t4) { + var _ = this; + _.delegate = t0; + _._migrationError = null; + _.logStatements = t1; + _.isSequential = t2; + _._openingLock = t3; + _._lock = t4; + _._waitingChildExecutors = 0; + _._engines$_closed = _._ensureOpenCalled = false; + }, + _WasmDelegate: function _WasmDelegate(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._sqlite3 = t0; + _._path = t1; + _._fileSystem = t2; + _._database = null; + _._isOpen = _._hasInitializedDatabase = false; + _._database$_setup = t3; + _.cachePreparedStatements = t4; + _.enableMigrations = t5; + _._preparedStmtsCache = t6; + _.__Sqlite3Delegate_versionDelegate_A = $; + _.isInTransaction = false; + }, + Context_Context(current, style) { + if (current == null) + current = "."; + return new A.Context(style, current); + }, + _parseUri(uri) { + return uri; + }, + _validateArgList(method, args) { + var numArgs, i, numArgs0, message, t1, t2, t3, t4; + for (numArgs = args.length, i = 1; i < numArgs; ++i) { + if (args[i] == null || args[i - 1] != null) + continue; + for (; numArgs >= 1; numArgs = numArgs0) { + numArgs0 = numArgs - 1; + if (args[numArgs0] != null) + break; + } + message = new A.StringBuffer(""); + t1 = "" + (method + "("); + message._contents = t1; + t2 = A._arrayInstanceType(args); + t3 = t2._eval$1("SubListIterable<1>"); + t4 = new A.SubListIterable(args, 0, numArgs, t3); + t4.SubListIterable$3(args, 0, numArgs, t2._precomputed1); + t3 = t1 + new A.MappedListIterable(t4, t3._eval$1("String(ListIterable.E)")._as(new A._validateArgList_closure()), t3._eval$1("MappedListIterable")).join$1(0, ", "); + message._contents = t3; + message._contents = t3 + ("): part " + (i - 1) + " was null, but part " + i + " was not."); + throw A.wrapException(A.ArgumentError$(message.toString$0(0), null)); + } + }, + Context: function Context(t0, t1) { + this.style = t0; + this._context$_current = t1; + }, + Context_joinAll_closure: function Context_joinAll_closure() { + }, + Context_split_closure: function Context_split_closure() { + }, + _validateArgList_closure: function _validateArgList_closure() { + }, + _PathDirection: function _PathDirection(t0) { + this.name = t0; + }, + _PathRelation: function _PathRelation(t0) { + this.name = t0; + }, + InternalStyle: function InternalStyle() { + }, + ParsedPath_ParsedPath$parse(path, style) { + var t1, parts, separators, t2, start, i, + root = style.getRoot$1(path); + style.isRootRelative$1(path); + if (root != null) + path = B.JSString_methods.substring$1(path, root.length); + t1 = type$.JSArray_String; + parts = A._setArrayType([], t1); + separators = A._setArrayType([], t1); + t1 = path.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(path, 0); + t2 = style.isSeparator$1(path.charCodeAt(0)); + } else + t2 = false; + if (t2) { + if (0 >= t1) + return A.ioore(path, 0); + B.JSArray_methods.add$1(separators, path[0]); + start = 1; + } else { + B.JSArray_methods.add$1(separators, ""); + start = 0; + } + for (i = start; i < t1; ++i) + if (style.isSeparator$1(path.charCodeAt(i))) { + B.JSArray_methods.add$1(parts, B.JSString_methods.substring$2(path, start, i)); + B.JSArray_methods.add$1(separators, path[i]); + start = i + 1; + } + if (start < t1) { + B.JSArray_methods.add$1(parts, B.JSString_methods.substring$1(path, start)); + B.JSArray_methods.add$1(separators, ""); + } + return new A.ParsedPath(style, root, parts, separators); + }, + ParsedPath: function ParsedPath(t0, t1, t2, t3) { + var _ = this; + _.style = t0; + _.root = t1; + _.parts = t2; + _.separators = t3; + }, + PathException$(message) { + return new A.PathException(message); + }, + PathException: function PathException(t0) { + this.message = t0; + }, + Style__getPlatformStyle() { + if (A.Uri_base().get$scheme() !== "file") + return $.$get$Style_url(); + if (!B.JSString_methods.endsWith$1(A.Uri_base().get$path(), "/")) + return $.$get$Style_url(); + if (A._Uri__Uri(null, "a/b", null, null).toFilePath$0() === "a\\b") + return $.$get$Style_windows(); + return $.$get$Style_posix(); + }, + Style: function Style() { + }, + PosixStyle: function PosixStyle(t0, t1, t2) { + this.separatorPattern = t0; + this.needsSeparatorPattern = t1; + this.rootPattern = t2; + }, + UrlStyle: function UrlStyle(t0, t1, t2, t3) { + var _ = this; + _.separatorPattern = t0; + _.needsSeparatorPattern = t1; + _.rootPattern = t2; + _.relativeRootPattern = t3; + }, + WindowsStyle: function WindowsStyle(t0, t1, t2, t3) { + var _ = this; + _.separatorPattern = t0; + _.needsSeparatorPattern = t1; + _.rootPattern = t2; + _.relativeRootPattern = t3; + }, + WindowsStyle_absolutePathToUri_closure: function WindowsStyle_absolutePathToUri_closure() { + }, + SqliteException: function SqliteException(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.message = t0; + _.explanation = t1; + _.extendedResultCode = t2; + _.operation = t3; + _.causingStatement = t4; + _.parametersToStatement = t5; + }, + SqliteException_toString_closure: function SqliteException_toString_closure() { + }, + AllowedArgumentCount: function AllowedArgumentCount(t0) { + this.allowedArgs = t0; + }, + RawSqliteBindings: function RawSqliteBindings() { + }, + SqliteResult: function SqliteResult(t0, t1, t2) { + this.resultCode = t0; + this.result = t1; + this.$ti = t2; + }, + RawSqliteDatabase: function RawSqliteDatabase() { + }, + RawStatementCompiler: function RawStatementCompiler() { + }, + RawSqliteStatement: function RawSqliteStatement() { + }, + RawSqliteContext: function RawSqliteContext() { + }, + RawSqliteValue: function RawSqliteValue() { + }, + _extension_0_runWithArgsAndSetResult(_this, $function, args) { + var e, exception, encoded, t2, ptr, + t1 = type$.nullable_Object, + dartArgs = new A.ValueList(args, A.List_List$filled(args.length, null, false, t1)); + try { + A._extension_0_setResult(_this, $function.call$1(dartArgs)); + } catch (exception) { + e = A.unwrapException(exception); + encoded = B.C_Utf8Encoder.convert$1(A.Error_safeToString(e)); + t2 = _this.bindings; + ptr = t2.allocateBytes$1(encoded); + A.callMethod(t2._sqlite3_result_error, "call", [null, _this.context, ptr, encoded.length], t1); + A.callMethod(t2._free, "call", [null, ptr], t1); + } finally { + dartArgs.isValid = false; + } + }, + _extension_0_setResult(_this, result) { + var t1, encoded, ptr, t2, t3, _null = null, _s4_ = "call"; + $label0$0: { + if (result == null) { + A.callMethod(_this.bindings._sqlite3_result_null, _s4_, [null, _this.context], type$.nullable_Object); + t1 = _null; + break $label0$0; + } + if (A._isInt(result)) { + t1 = A._BigIntImpl__BigIntImpl$from(result).toString$0(0); + A.callMethod(_this.bindings._sqlite3_result_int64, _s4_, [null, _this.context, type$.JavaScriptBigInt._as(self.BigInt(t1))], type$.nullable_Object); + t1 = _null; + break $label0$0; + } + if (result instanceof A._BigIntImpl) { + t1 = A.BigIntRangeCheck_get_checkRange(result).toString$0(0); + A.callMethod(_this.bindings._sqlite3_result_int64, _s4_, [null, _this.context, type$.JavaScriptBigInt._as(self.BigInt(t1))], type$.nullable_Object); + t1 = _null; + break $label0$0; + } + if (typeof result == "number") { + A.callMethod(_this.bindings._sqlite3_result_double, _s4_, [null, _this.context, result], type$.nullable_Object); + t1 = _null; + break $label0$0; + } + if (A._isBool(result)) { + t1 = A._BigIntImpl__BigIntImpl$from(result ? 1 : 0).toString$0(0); + A.callMethod(_this.bindings._sqlite3_result_int64, _s4_, [null, _this.context, type$.JavaScriptBigInt._as(self.BigInt(t1))], type$.nullable_Object); + t1 = _null; + break $label0$0; + } + if (typeof result == "string") { + encoded = B.C_Utf8Encoder.convert$1(result); + t1 = _this.bindings; + ptr = t1.allocateBytes$1(encoded); + t2 = type$.nullable_Object; + A.callMethod(t1._sqlite3_result_text, _s4_, [null, _this.context, ptr, encoded.length, -1], t2); + A.callMethod(t1._free, _s4_, [null, ptr], t2); + t1 = _null; + break $label0$0; + } + t1 = type$.List_int; + if (t1._is(result)) { + t1._as(result); + t1 = _this.bindings; + ptr = t1.allocateBytes$1(result); + t2 = J.get$length$asx(result); + t3 = type$.nullable_Object; + A.callMethod(t1._sqlite3_result_blob64, _s4_, [null, _this.context, ptr, type$.JavaScriptBigInt._as(self.BigInt(t2)), -1], t3); + A.callMethod(t1._free, _s4_, [null, ptr], t3); + t1 = _null; + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$value(result, "result", "Unsupported type")); + } + return t1; + }, + FinalizableDatabase: function FinalizableDatabase(t0, t1, t2) { + this.bindings = t0; + this.database = t1; + this._statements = t2; + }, + DatabaseImplementation: function DatabaseImplementation(t0, t1, t2, t3) { + var _ = this; + _.bindings = t0; + _.database = t1; + _.finalizable = t2; + _._updateListeners = t3; + _._isClosed = false; + }, + DatabaseImplementation_createFunction_closure: function DatabaseImplementation_createFunction_closure(t0) { + this.$function = t0; + }, + DatabaseImplementation__prepareInternal_freeIntermediateResults: function DatabaseImplementation__prepareInternal_freeIntermediateResults(t0, t1) { + this.compiler = t0; + this.createdStatements = t1; + }, + ValueList: function ValueList(t0, t1) { + this.rawValues = t0; + this._cachedCopies = t1; + this.isValid = true; + }, + FinalizablePart: function FinalizablePart() { + }, + disposeFinalizer_closure: function disposeFinalizer_closure() { + }, + Sqlite3Implementation: function Sqlite3Implementation() { + }, + FinalizableStatement: function FinalizableStatement(t0) { + this.statement = t0; + this._inResetState = true; + this._closed = false; + }, + StatementImplementation: function StatementImplementation(t0, t1, t2, t3) { + var _ = this; + _.statement = t0; + _.database = t1; + _.finalizable = t2; + _.sql = t3; + _._latestArguments = null; + }, + Cursor: function Cursor() { + }, + ResultSet: function ResultSet(t0, t1, t2) { + this.rows = t0; + this._result_set$_columnNames = t1; + this._calculatedIndexes = t2; + }, + Row: function Row(t0, t1) { + this._result = t0; + this._data = t1; + }, + _ResultIterator: function _ResultIterator(t0) { + this.result = t0; + this.index = -1; + }, + _ResultSet_Cursor_ListMixin: function _ResultSet_Cursor_ListMixin() { + }, + _ResultSet_Cursor_ListMixin_NonGrowableListMixin: function _ResultSet_Cursor_ListMixin_NonGrowableListMixin() { + }, + _Row_Object_UnmodifiableMapMixin: function _Row_Object_UnmodifiableMapMixin() { + }, + _Row_Object_UnmodifiableMapMixin_MapMixin: function _Row_Object_UnmodifiableMapMixin_MapMixin() { + }, + OpenMode: function OpenMode(t0, t1) { + this.index = t0; + this._core$_name = t1; + }, + CommonPreparedStatement: function CommonPreparedStatement() { + }, + IndexedParameters: function IndexedParameters(t0) { + this.parameters = t0; + }, + VfsException$(returnCode) { + A.assertHelper(returnCode !== 0); + return new A.VfsException(returnCode); + }, + VfsException: function VfsException(t0) { + this.returnCode = t0; + }, + Sqlite3Filename: function Sqlite3Filename(t0) { + this.path = t0; + }, + VirtualFileSystem: function VirtualFileSystem() { + }, + BaseVirtualFileSystem: function BaseVirtualFileSystem() { + }, + BaseVfsFile: function BaseVfsFile() { + }, + WasmSqliteBindings: function WasmSqliteBindings(t0) { + this.bindings = t0; + }, + WasmDatabase0: function WasmDatabase0(t0, t1) { + this.bindings = t0; + this.db = t1; + }, + WasmStatementCompiler: function WasmStatementCompiler(t0, t1, t2, t3) { + var _ = this; + _.database = t0; + _.sql = t1; + _.stmtOut = t2; + _.pzTail = t3; + }, + WasmStatement: function WasmStatement(t0, t1, t2) { + this.stmt = t0; + this.bindings = t1; + this._allocatedArguments = t2; + }, + WasmContext: function WasmContext(t0, t1) { + this.bindings = t0; + this.context = t1; + }, + WasmValue: function WasmValue(t0, t1) { + this.bindings = t0; + this.value = t1; + }, + WasmValueList: function WasmValueList(t0, t1, t2) { + this.bindings = t0; + this.length = t1; + this.value = t2; + }, + AsyncJavaScriptIteratable: function AsyncJavaScriptIteratable(t0, t1) { + this._jsObject = t0; + this.$ti = t1; + }, + AsyncJavaScriptIteratable_listen_fetchNext: function AsyncJavaScriptIteratable_listen_fetchNext(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.iterator = t2; + _.controller = t3; + }, + AsyncJavaScriptIteratable_listen_fetchNext_closure: function AsyncJavaScriptIteratable_listen_fetchNext_closure(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.controller = t2; + _.fetchNext = t3; + }, + AsyncJavaScriptIteratable_listen_fetchNextIfNecessary: function AsyncJavaScriptIteratable_listen_fetchNextIfNecessary(t0, t1, t2) { + this._box_0 = t0; + this.controller = t1; + this.fetchNext = t2; + }, + CompleteIdbRequest_complete(_this, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")), + completer = new A._SyncCompleter(t1, $T._eval$1("_SyncCompleter<0>")), + t2 = type$.nullable_void_Function_JSObject, + t3 = type$.JSObject; + A._EventStreamSubscription$(_this, "success", t2._as(new A.CompleteIdbRequest_complete_closure(completer, _this, $T)), false, t3); + A._EventStreamSubscription$(_this, "error", t2._as(new A.CompleteIdbRequest_complete_closure0(completer, _this)), false, t3); + return t1; + }, + CompleteOpenIdbRequest_completeOrBlocked(_this, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")), + completer = new A._SyncCompleter(t1, $T._eval$1("_SyncCompleter<0>")), + t2 = type$.nullable_void_Function_JSObject, + t3 = type$.JSObject; + A._EventStreamSubscription$(_this, "success", t2._as(new A.CompleteOpenIdbRequest_completeOrBlocked_closure(completer, _this, $T)), false, t3); + A._EventStreamSubscription$(_this, "error", t2._as(new A.CompleteOpenIdbRequest_completeOrBlocked_closure0(completer, _this)), false, t3); + A._EventStreamSubscription$(_this, "blocked", t2._as(new A.CompleteOpenIdbRequest_completeOrBlocked_closure1(completer, _this)), false, t3); + return t1; + }, + _CursorReader: function _CursorReader(t0, t1) { + var _ = this; + _._indexed_db0$_onError = _._onSuccess = _._cursor = null; + _._cursorRequest = t0; + _.$ti = t1; + }, + _CursorReader_moveNext_closure: function _CursorReader_moveNext_closure(t0, t1) { + this.$this = t0; + this.completer = t1; + }, + _CursorReader_moveNext_closure0: function _CursorReader_moveNext_closure0(t0, t1) { + this.$this = t0; + this.completer = t1; + }, + CompleteIdbRequest_complete_closure: function CompleteIdbRequest_complete_closure(t0, t1, t2) { + this.completer = t0; + this._this = t1; + this.T = t2; + }, + CompleteIdbRequest_complete_closure0: function CompleteIdbRequest_complete_closure0(t0, t1) { + this.completer = t0; + this._this = t1; + }, + CompleteOpenIdbRequest_completeOrBlocked_closure: function CompleteOpenIdbRequest_completeOrBlocked_closure(t0, t1, t2) { + this.completer = t0; + this._this = t1; + this.T = t2; + }, + CompleteOpenIdbRequest_completeOrBlocked_closure0: function CompleteOpenIdbRequest_completeOrBlocked_closure0(t0, t1) { + this.completer = t0; + this._this = t1; + }, + CompleteOpenIdbRequest_completeOrBlocked_closure1: function CompleteOpenIdbRequest_completeOrBlocked_closure1(t0, t1) { + this.completer = t0; + this._this = t1; + }, + WasmInstance_load(response, imports) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.WasmInstance), + $async$returnValue, t1, t2, _this, $async$temp1, $async$temp2; + var $async$WasmInstance_load = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _this = {}; + imports.forEach$1(0, new A.WasmInstance_load_closure(_this)); + t1 = type$.JSObject; + t2 = type$.String; + t2 = new A.WasmInstance(A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.JavaScriptFunction), A.LinkedHashMap_LinkedHashMap$_empty(t2, t1)); + $async$temp1 = t2; + $async$temp2 = t1; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t1._as(self.WebAssembly.instantiateStreaming(response, _this)), t1), $async$WasmInstance_load); + case 3: + // returning from await. + $async$temp1.WasmInstance$_$1($async$temp2._as($async$result.instance)); + $async$returnValue = t2; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$WasmInstance_load, $async$completer); + }, + WasmInstance: function WasmInstance(t0, t1) { + this.functions = t0; + this.globals = t1; + }, + WasmInstance_load_closure: function WasmInstance_load_closure(t0) { + this.importsJs = t0; + }, + WasmInstance_load__closure: function WasmInstance_load__closure(t0) { + this.moduleJs = t0; + }, + WasmSqlite3_loadFromUrl(uri) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.WasmSqlite3), + $async$returnValue, t1, jsUri, $async$temp1; + var $async$WasmSqlite3_loadFromUrl = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + jsUri = uri.get$isAbsolute() ? t1._as(new self.URL(uri.toString$0(0))) : t1._as(new self.URL(uri.toString$0(0), A.Uri_base().toString$0(0))); + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t1._as(self.fetch(jsUri, null)), t1), $async$WasmSqlite3_loadFromUrl); + case 3: + // returning from await. + $async$returnValue = $async$temp1.WasmSqlite3__load($async$result); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$WasmSqlite3_loadFromUrl, $async$completer); + }, + WasmSqlite3__load(fetchResponse) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.WasmSqlite3), + $async$returnValue, $async$temp1, $async$temp2; + var $async$WasmSqlite3__load = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$temp2 = A; + $async$goto = 3; + return A._asyncAwait(A.WasmBindings_instantiateAsync(fetchResponse), $async$WasmSqlite3__load); + case 3: + // returning from await. + $async$returnValue = new $async$temp1.WasmSqlite3(new $async$temp2.WasmSqliteBindings($async$result)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$WasmSqlite3__load, $async$completer); + }, + WasmSqlite3: function WasmSqlite3(t0) { + this.bindings = t0; + }, + WasmVfs: function WasmVfs(t0, t1, t2, t3, t4) { + var _ = this; + _.synchronizer = t0; + _.serializer = t1; + _.pathContext = t2; + _.random = t3; + _.name = t4; + }, + WasmFile: function WasmFile(t0, t1) { + this.vfs = t0; + this.fd = t1; + this.lockStatus = 0; + }, + RequestResponseSynchronizer_RequestResponseSynchronizer(buffer) { + var t1; + if (A._asInt(buffer.byteLength) !== 8) + throw A.wrapException(A.ArgumentError$("Must be 8 in length", null)); + t1 = type$.JavaScriptFunction._as(self.Int32Array); + return new A.RequestResponseSynchronizer(type$.NativeInt32List._as(A.callConstructor(t1, [buffer], type$.JSObject))); + }, + MessageSerializer_readEmpty(unused) { + return B.C_EmptyMessage; + }, + MessageSerializer_readFlags(msg) { + var t1 = msg.dataView; + return new A.Flags(B.NativeByteData_methods._getInt32$2(t1, 0, false), B.NativeByteData_methods._getInt32$2(t1, 4, false), B.NativeByteData_methods._getInt32$2(t1, 8, false)); + }, + MessageSerializer_readNameAndFlags(msg) { + var t1 = msg.dataView; + return new A.NameAndInt32Flags(B.C_Utf8Codec.decode$1(A.SharedArrayBuffer_asUint8ListSlice(msg.buffer, 16, B.NativeByteData_methods._getInt32$2(t1, 12, false))), B.NativeByteData_methods._getInt32$2(t1, 0, false), B.NativeByteData_methods._getInt32$2(t1, 4, false), B.NativeByteData_methods._getInt32$2(t1, 8, false)); + }, + RequestResponseSynchronizer: function RequestResponseSynchronizer(t0) { + this.int32View = t0; + }, + MessageSerializer: function MessageSerializer(t0, t1, t2) { + this.buffer = t0; + this.dataView = t1; + this.byteView = t2; + }, + WorkerOperation: function WorkerOperation(t0, t1, t2, t3, t4) { + var _ = this; + _.readRequest = t0; + _.readResponse = t1; + _.index = t2; + _._core$_name = t3; + _.$ti = t4; + }, + Message0: function Message0() { + }, + EmptyMessage: function EmptyMessage() { + }, + Flags: function Flags(t0, t1, t2) { + this.flag0 = t0; + this.flag1 = t1; + this.flag2 = t2; + }, + NameAndInt32Flags: function NameAndInt32Flags(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _.flag0 = t1; + _.flag1 = t2; + _.flag2 = t3; + }, + VfsWorker_create(options) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.VfsWorker), + $async$returnValue, t2, _i, t3, t4, t5, t6, t1, root, split; + var $async$VfsWorker_create = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t1._as(A.storageManager().getDirectory()), t1), $async$VfsWorker_create); + case 3: + // returning from await. + root = $async$result; + split = $.$get$url().split$1(0, A._asString(options.root)); + t2 = split.length, _i = 0; + case 4: + // for condition + if (!(_i < split.length)) { + // goto after for + $async$goto = 6; + break; + } + $async$goto = 7; + return A._asyncAwait(A.promiseToFuture(t1._as(root.getDirectoryHandle(split[_i], {create: true})), t1), $async$VfsWorker_create); + case 7: + // returning from await. + root = $async$result; + case 5: + // for update + split.length === t2 || (0, A.throwConcurrentModificationError)(split), ++_i; + // goto for condition + $async$goto = 4; + break; + case 6: + // after for + t2 = type$._OpenedFileHandle; + t3 = A.RequestResponseSynchronizer_RequestResponseSynchronizer(t1._as(options.synchronizationBuffer)); + t4 = t1._as(options.communicationBuffer); + t5 = A.SharedArrayBuffer_asByteData(t4, 65536, 2048); + t6 = type$.JavaScriptFunction._as(self.Uint8Array); + $async$returnValue = new A.VfsWorker(t3, new A.MessageSerializer(t4, t5, type$.NativeUint8List._as(A.callConstructor(t6, [t4], t1))), root, A.LinkedHashMap_LinkedHashMap$_empty(type$.int, t2), A.LinkedHashSet_LinkedHashSet$_empty(t2)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$VfsWorker_create, $async$completer); + }, + _ResolvedPath: function _ResolvedPath(t0, t1, t2) { + this.fullPath = t0; + this.directory = t1; + this.filename = t2; + }, + VfsWorker: function VfsWorker(t0, t1, t2, t3, t4) { + var _ = this; + _.synchronizer = t0; + _.messages = t1; + _.root = t2; + _._fdCounter = 0; + _._stopped = false; + _._openFiles = t3; + _._implicitlyHeldLocks = t4; + }, + _OpenedFileHandle: function _OpenedFileHandle(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.fd = t0; + _.readonly = t1; + _.deleteOnClose = t2; + _.fullPath = t3; + _.directory = t4; + _.filename = t5; + _.file = t6; + _.explicitlyLocked = false; + _.syncHandle = null; + }, + IndexedDbFileSystem_open(dbName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.IndexedDbFileSystem), + $async$returnValue, t1, t2, t3, t4, fs; + var $async$IndexedDbFileSystem_open = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.String; + t2 = new A.AsynchronousIndexedDbFileSystem(dbName); + t3 = A.InMemoryFileSystem$(null); + t4 = $.$get$Random__secureRandom(); + fs = new A.IndexedDbFileSystem(t2, t3, new A.LinkedList(type$.LinkedList__IndexedDbWorkItem), A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), t4, "indexeddb"); + $async$goto = 3; + return A._asyncAwait(t2.open$0(), $async$IndexedDbFileSystem_open); + case 3: + // returning from await. + $async$goto = 4; + return A._asyncAwait(fs._readFiles$0(), $async$IndexedDbFileSystem_open); + case 4: + // returning from await. + $async$returnValue = fs; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$IndexedDbFileSystem_open, $async$completer); + }, + AsynchronousIndexedDbFileSystem: function AsynchronousIndexedDbFileSystem(t0) { + this._indexed_db$_database = null; + this._dbName = t0; + }, + AsynchronousIndexedDbFileSystem_open_closure: function AsynchronousIndexedDbFileSystem_open_closure(t0) { + this.openRequest = t0; + }, + AsynchronousIndexedDbFileSystem__readFile_closure: function AsynchronousIndexedDbFileSystem__readFile_closure(t0) { + this.fileId = t0; + }, + AsynchronousIndexedDbFileSystem_readFully_closure: function AsynchronousIndexedDbFileSystem_readFully_closure(t0, t1, t2, t3) { + var _ = this; + _.row = t0; + _.result = t1; + _.rowOffset = t2; + _.length = t3; + }, + AsynchronousIndexedDbFileSystem__write_writeBlock: function AsynchronousIndexedDbFileSystem__write_writeBlock(t0, t1) { + this.blocks = t0; + this.fileId = t1; + }, + AsynchronousIndexedDbFileSystem__write_closure: function AsynchronousIndexedDbFileSystem__write_closure(t0, t1) { + this.writeBlock = t0; + this.writes = t1; + }, + _FileWriteRequest: function _FileWriteRequest(t0, t1, t2) { + this.originalContent = t0; + this.replacedBlocks = t1; + this.newFileLength = t2; + }, + _FileWriteRequest__updateBlock_closure: function _FileWriteRequest__updateBlock_closure(t0, t1) { + this.$this = t0; + this.blockOffset = t1; + }, + _OffsetAndBuffer: function _OffsetAndBuffer(t0, t1) { + this.offset = t0; + this.buffer = t1; + }, + IndexedDbFileSystem: function IndexedDbFileSystem(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._asynchronous = t0; + _._isClosing = false; + _._currentWorkItem = null; + _._memory = t1; + _._pendingWork = t2; + _._inMemoryOnlyFiles = t3; + _._knownFileIds = t4; + _.random = t5; + _.name = t6; + }, + IndexedDbFileSystem__startWorkingIfNeeded_closure: function IndexedDbFileSystem__startWorkingIfNeeded_closure(t0) { + this.$this = t0; + }, + _IndexedDbFile: function _IndexedDbFile(t0, t1, t2) { + this.vfs = t0; + this.memoryFile = t1; + this.path = t2; + }, + _IndexedDbFile_xTruncate_closure: function _IndexedDbFile_xTruncate_closure(t0, t1) { + this.$this = t0; + this.size = t1; + }, + _IndexedDbWorkItem: function _IndexedDbWorkItem() { + }, + _FunctionWorkItem: function _FunctionWorkItem(t0, t1) { + var _ = this; + _.work = t0; + _.completer = t1; + _._collection$_previous = _._collection$_next = _._list = null; + }, + _DeleteFileWorkItem: function _DeleteFileWorkItem(t0, t1, t2) { + var _ = this; + _.fileSystem = t0; + _.path = t1; + _.completer = t2; + _._collection$_previous = _._collection$_next = _._list = null; + }, + _CreateFileWorkItem: function _CreateFileWorkItem(t0, t1, t2) { + var _ = this; + _.fileSystem = t0; + _.path = t1; + _.completer = t2; + _._collection$_previous = _._collection$_next = _._list = null; + }, + _WriteFileWorkItem: function _WriteFileWorkItem(t0, t1, t2, t3, t4) { + var _ = this; + _.fileSystem = t0; + _.path = t1; + _.originalContent = t2; + _.writes = t3; + _.completer = t4; + _._collection$_previous = _._collection$_next = _._list = null; + }, + InMemoryFileSystem$(random) { + var t1 = $.$get$Random__secureRandom(); + return new A.InMemoryFileSystem(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.nullable_Uint8List), t1, "dart-memory"); + }, + InMemoryFileSystem: function InMemoryFileSystem(t0, t1, t2) { + this.fileData = t0; + this.random = t1; + this.name = t2; + }, + _InMemoryFile: function _InMemoryFile(t0, t1, t2) { + var _ = this; + _.vfs = t0; + _.path = t1; + _.deleteOnClose = t2; + _._lockMode = 0; + }, + SimpleOpfsFileSystem_loadFromStorage(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SimpleOpfsFileSystem), + $async$returnValue, t1, opfsDirectory, t2, t3, _i, storage; + var $async$SimpleOpfsFileSystem_loadFromStorage = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + storage = A.storageManager(); + if (storage == null) + throw A.wrapException(A.VfsException$(1)); + t1 = type$.JSObject; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t1._as(storage.getDirectory()), t1), $async$SimpleOpfsFileSystem_loadFromStorage); + case 3: + // returning from await. + opfsDirectory = $async$result; + t2 = $.$get$context().split$1(0, path), t3 = t2.length, _i = 0; + case 4: + // for condition + if (!(_i < t2.length)) { + // goto after for + $async$goto = 6; + break; + } + $async$goto = 7; + return A._asyncAwait(A.promiseToFuture(t1._as(opfsDirectory.getDirectoryHandle(t2[_i], {create: true})), t1), $async$SimpleOpfsFileSystem_loadFromStorage); + case 7: + // returning from await. + opfsDirectory = $async$result; + case 5: + // for update + t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i; + // goto for condition + $async$goto = 4; + break; + case 6: + // after for + $async$returnValue = A.SimpleOpfsFileSystem_inDirectory(opfsDirectory, "simple-opfs"); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$SimpleOpfsFileSystem_loadFromStorage, $async$completer); + }, + SimpleOpfsFileSystem_inDirectory(root, vfsName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SimpleOpfsFileSystem), + $async$returnValue, t1, _i, type, t2, t3, t4, $open, meta, $async$temp1, $async$temp2; + var $async$SimpleOpfsFileSystem_inDirectory = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $open = new A.SimpleOpfsFileSystem_inDirectory_open(root); + $async$goto = 3; + return A._asyncAwait($open.call$1("meta"), $async$SimpleOpfsFileSystem_inDirectory); + case 3: + // returning from await. + meta = $async$result; + meta.truncate(2); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileType, type$.JSObject); + _i = 0; + case 4: + // for condition + if (!(_i < 2)) { + // goto after for + $async$goto = 6; + break; + } + type = B.List_oyU[_i]; + $async$temp1 = t1; + $async$temp2 = type; + $async$goto = 7; + return A._asyncAwait($open.call$1(type._core$_name), $async$SimpleOpfsFileSystem_inDirectory); + case 7: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, $async$result); + case 5: + // for update + ++_i; + // goto for condition + $async$goto = 4; + break; + case 6: + // after for + t2 = new Uint8Array(2); + t3 = A.InMemoryFileSystem$(null); + t4 = $.$get$Random__secureRandom(); + $async$returnValue = new A.SimpleOpfsFileSystem(meta, t2, t1, t3, t4, vfsName); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$SimpleOpfsFileSystem_inDirectory, $async$completer); + }, + FileType: function FileType(t0, t1, t2) { + this.filePath = t0; + this.index = t1; + this._core$_name = t2; + }, + SimpleOpfsFileSystem: function SimpleOpfsFileSystem(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._metaHandle = t0; + _._existsList = t1; + _._files = t2; + _._simple_opfs$_memory = t3; + _.random = t4; + _.name = t5; + }, + SimpleOpfsFileSystem_inDirectory_open: function SimpleOpfsFileSystem_inDirectory_open(t0) { + this.root = t0; + }, + _SimpleOpfsFile: function _SimpleOpfsFile(t0, t1, t2, t3) { + var _ = this; + _.vfs = t0; + _.type = t1; + _.syncHandle = t2; + _.deleteOnClose = t3; + _._simple_opfs$_lockMode = 0; + }, + WasmBindings_instantiateAsync(response) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.WasmBindings), + $async$returnValue, instance, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, t36, t37, t38, t39, t40, t41, t42, t43, t44, t45, t46, t47, t48, t49, t50, injected, t1; + var $async$WasmBindings_instantiateAsync = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + injected = A._InjectedValues$(); + t1 = injected.___InjectedValues_injectedValues_A; + t1 === $ && A.throwLateFieldNI("injectedValues"); + $async$goto = 3; + return A._asyncAwait(A.WasmInstance_load(response, t1), $async$WasmBindings_instantiateAsync); + case 3: + // returning from await. + instance = $async$result; + t1 = injected.___InjectedValues_memory_A; + t1 === $ && A.throwLateFieldNI("memory"); + t2 = instance.functions; + t3 = t2.$index(0, "dart_sqlite3_malloc"); + t3.toString; + t4 = t2.$index(0, "dart_sqlite3_free"); + t4.toString; + t5 = t2.$index(0, "dart_sqlite3_create_scalar_function"); + t5.toString; + t6 = t2.$index(0, "dart_sqlite3_create_aggregate_function"); + t6.toString; + t2.$index(0, "dart_sqlite3_create_window_function").toString; + t2.$index(0, "dart_sqlite3_create_collation").toString; + t7 = t2.$index(0, "dart_sqlite3_register_vfs"); + t7.toString; + t2.$index(0, "sqlite3_vfs_unregister").toString; + t8 = t2.$index(0, "dart_sqlite3_updates"); + t8.toString; + t2.$index(0, "sqlite3_libversion").toString; + t2.$index(0, "sqlite3_sourceid").toString; + t2.$index(0, "sqlite3_libversion_number").toString; + t9 = t2.$index(0, "sqlite3_open_v2"); + t9.toString; + t10 = t2.$index(0, "sqlite3_close_v2"); + t10.toString; + t11 = t2.$index(0, "sqlite3_extended_errcode"); + t11.toString; + t12 = t2.$index(0, "sqlite3_errmsg"); + t12.toString; + t13 = t2.$index(0, "sqlite3_errstr"); + t13.toString; + t14 = t2.$index(0, "sqlite3_extended_result_codes"); + t14.toString; + t15 = t2.$index(0, "sqlite3_exec"); + t15.toString; + t2.$index(0, "sqlite3_free").toString; + t16 = t2.$index(0, "sqlite3_prepare_v3"); + t16.toString; + t17 = t2.$index(0, "sqlite3_bind_parameter_count"); + t17.toString; + t18 = t2.$index(0, "sqlite3_column_count"); + t18.toString; + t19 = t2.$index(0, "sqlite3_column_name"); + t19.toString; + t20 = t2.$index(0, "sqlite3_reset"); + t20.toString; + t21 = t2.$index(0, "sqlite3_step"); + t21.toString; + t22 = t2.$index(0, "sqlite3_finalize"); + t22.toString; + t23 = t2.$index(0, "sqlite3_column_type"); + t23.toString; + t24 = t2.$index(0, "sqlite3_column_int64"); + t24.toString; + t25 = t2.$index(0, "sqlite3_column_double"); + t25.toString; + t26 = t2.$index(0, "sqlite3_column_bytes"); + t26.toString; + t27 = t2.$index(0, "sqlite3_column_blob"); + t27.toString; + t28 = t2.$index(0, "sqlite3_column_text"); + t28.toString; + t29 = t2.$index(0, "sqlite3_bind_null"); + t29.toString; + t30 = t2.$index(0, "sqlite3_bind_int64"); + t30.toString; + t31 = t2.$index(0, "sqlite3_bind_double"); + t31.toString; + t32 = t2.$index(0, "sqlite3_bind_text"); + t32.toString; + t33 = t2.$index(0, "sqlite3_bind_blob64"); + t33.toString; + t34 = t2.$index(0, "sqlite3_bind_parameter_index"); + t34.toString; + t35 = t2.$index(0, "sqlite3_changes"); + t35.toString; + t36 = t2.$index(0, "sqlite3_last_insert_rowid"); + t36.toString; + t37 = t2.$index(0, "sqlite3_user_data"); + t37.toString; + t38 = t2.$index(0, "sqlite3_result_null"); + t38.toString; + t39 = t2.$index(0, "sqlite3_result_int64"); + t39.toString; + t40 = t2.$index(0, "sqlite3_result_double"); + t40.toString; + t41 = t2.$index(0, "sqlite3_result_text"); + t41.toString; + t42 = t2.$index(0, "sqlite3_result_blob64"); + t42.toString; + t43 = t2.$index(0, "sqlite3_result_error"); + t43.toString; + t44 = t2.$index(0, "sqlite3_value_type"); + t44.toString; + t45 = t2.$index(0, "sqlite3_value_int64"); + t45.toString; + t46 = t2.$index(0, "sqlite3_value_double"); + t46.toString; + t47 = t2.$index(0, "sqlite3_value_bytes"); + t47.toString; + t48 = t2.$index(0, "sqlite3_value_text"); + t48.toString; + t49 = t2.$index(0, "sqlite3_value_blob"); + t49.toString; + t2.$index(0, "sqlite3_aggregate_context").toString; + t2.$index(0, "sqlite3_get_autocommit").toString; + t50 = t2.$index(0, "sqlite3_stmt_isexplain"); + t50.toString; + t2.$index(0, "sqlite3_stmt_readonly").toString; + t2.$index(0, "dart_sqlite3_db_config_int"); + instance.globals.$index(0, "sqlite3_temp_directory").toString; + $async$returnValue = injected.___InjectedValues_bindings_A = new A.WasmBindings(t1, injected.callbacks, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t23, t24, t25, t26, t28, t27, t29, t30, t31, t32, t33, t34, t22, t35, t36, t37, t38, t39, t40, t41, t42, t43, t44, t45, t46, t47, t48, t49, t50); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$WasmBindings_instantiateAsync, $async$completer); + }, + _runVfs(body) { + var e, exception, t1; + try { + body.call$0(); + return 0; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.VfsException) { + e = t1; + return e.returnCode; + } else + return 1; + } + }, + WrappedMemory_strlen(_this, address) { + var bytes, t1, $length; + if (A.assertTest(address !== 0)) + A.assertThrow("Null pointer dereference"); + bytes = A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(_this.buffer), address, null); + t1 = bytes.length; + $length = 0; + while (true) { + if (!($length < t1)) + return A.ioore(bytes, $length); + if (!(bytes[$length] !== 0)) + break; + ++$length; + } + return $length; + }, + WrappedMemory_int32ValueOfPointer(_this, pointer) { + var t1, t2; + if (A.assertTest(pointer !== 0)) + A.assertThrow("Null pointer dereference"); + t1 = A.NativeInt32List_NativeInt32List$view(type$.NativeByteBuffer._as(_this.buffer), 0, null); + t2 = B.JSInt_methods._shrOtherPositive$1(pointer, 2); + if (!(t2 < t1.length)) + return A.ioore(t1, t2); + return t1[t2]; + }, + WrappedMemory_setInt32Value(_this, pointer, value) { + var t1, t2; + if (A.assertTest(pointer !== 0)) + A.assertThrow("Null pointer dereference"); + t1 = A.NativeInt32List_NativeInt32List$view(type$.NativeByteBuffer._as(_this.buffer), 0, null); + t2 = B.JSInt_methods._shrOtherPositive$1(pointer, 2); + if (!(t2 < t1.length)) + return A.ioore(t1, t2); + t1[t2] = value; + }, + WrappedMemory_readString(_this, address, $length) { + var t1; + if (A.assertTest(address !== 0)) + A.assertThrow("Null pointer dereference"); + t1 = type$.NativeByteBuffer._as(_this.buffer); + return B.C_Utf8Codec.decode$1(A.NativeUint8List_NativeUint8List$view(t1, address, $length == null ? A.WrappedMemory_strlen(_this, address) : $length)); + }, + WrappedMemory_readNullableString(_this, address, $length) { + var t1; + if (address === 0) + return null; + t1 = type$.NativeByteBuffer._as(_this.buffer); + return B.C_Utf8Codec.decode$1(A.NativeUint8List_NativeUint8List$view(t1, address, $length == null ? A.WrappedMemory_strlen(_this, address) : $length)); + }, + WrappedMemory_copyRange(_this, pointer, $length) { + var list = new Uint8Array($length); + B.NativeUint8List_methods.setAll$2(list, 0, A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(_this.buffer), pointer, $length)); + return list; + }, + _InjectedValues$() { + var t1 = type$.int; + t1 = new A._InjectedValues(new A.DartCallbacks(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.RegisteredFunctionSet), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AggregateContext_nullable_Object), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.VirtualFileSystem), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.VirtualFileSystemFile))); + t1._InjectedValues$0(); + return t1; + }, + WasmBindings: function WasmBindings(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, t36, t37, t38, t39, t40, t41, t42, t43, t44, t45, t46, t47, t48, t49) { + var _ = this; + _.memory = t0; + _.callbacks = t1; + _._malloc = t2; + _._free = t3; + _._create_scalar = t4; + _._create_aggregate = t5; + _._register_vfs = t6; + _._update_hooks = t7; + _._sqlite3_open_v2 = t8; + _._sqlite3_close_v2 = t9; + _._sqlite3_extended_errcode = t10; + _._sqlite3_errmsg = t11; + _._sqlite3_errstr = t12; + _._sqlite3_extended_result_codes = t13; + _._sqlite3_exec = t14; + _._sqlite3_prepare_v3 = t15; + _._sqlite3_bind_parameter_count = t16; + _._sqlite3_column_count = t17; + _._sqlite3_column_name = t18; + _._sqlite3_reset = t19; + _._sqlite3_step = t20; + _._sqlite3_column_type = t21; + _._sqlite3_column_int64 = t22; + _._sqlite3_column_double = t23; + _._sqlite3_column_bytes = t24; + _._sqlite3_column_text = t25; + _._sqlite3_column_blob = t26; + _._sqlite3_bind_null = t27; + _._sqlite3_bind_int64 = t28; + _._sqlite3_bind_double = t29; + _._sqlite3_bind_text = t30; + _._sqlite3_bind_blob64 = t31; + _._sqlite3_bind_parameter_index = t32; + _._sqlite3_finalize = t33; + _._sqlite3_changes = t34; + _._sqlite3_last_insert_rowid = t35; + _._sqlite3_user_data = t36; + _._sqlite3_result_null = t37; + _._sqlite3_result_int64 = t38; + _._sqlite3_result_double = t39; + _._sqlite3_result_text = t40; + _._sqlite3_result_blob64 = t41; + _._sqlite3_result_error = t42; + _._sqlite3_value_type = t43; + _._sqlite3_value_int64 = t44; + _._sqlite3_value_double = t45; + _._sqlite3_value_bytes = t46; + _._sqlite3_value_text = t47; + _._sqlite3_value_blob = t48; + _._sqlite3_stmt_isexplain = t49; + }, + _InjectedValues: function _InjectedValues(t0) { + var _ = this; + _.___InjectedValues_memory_A = _.___InjectedValues_injectedValues_A = _.___InjectedValues_bindings_A = $; + _.callbacks = t0; + }, + _InjectedValues_closure: function _InjectedValues_closure(t0) { + this.memory = t0; + }, + _InjectedValues_closure0: function _InjectedValues_closure0(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure13: function _InjectedValues__closure13(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.vfs = t1; + _.path = t2; + _.flags = t3; + _.memory = t4; + _.dartFdPtr = t5; + _.pOutFlags = t6; + }, + _InjectedValues_closure1: function _InjectedValues_closure1(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure12: function _InjectedValues__closure12(t0, t1, t2) { + this.vfs = t0; + this.path = t1; + this.syncDir = t2; + }, + _InjectedValues_closure2: function _InjectedValues_closure2(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure11: function _InjectedValues__closure11(t0, t1, t2, t3, t4) { + var _ = this; + _.vfs = t0; + _.path = t1; + _.flags = t2; + _.memory = t3; + _.pResOut = t4; + }, + _InjectedValues_closure3: function _InjectedValues_closure3(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure10: function _InjectedValues__closure10(t0, t1, t2, t3, t4) { + var _ = this; + _.vfs = t0; + _.path = t1; + _.nOut = t2; + _.memory = t3; + _.zOut = t4; + }, + _InjectedValues_closure4: function _InjectedValues_closure4(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure9: function _InjectedValues__closure9(t0, t1, t2, t3) { + var _ = this; + _.vfs = t0; + _.memory = t1; + _.zOut = t2; + _.nByte = t3; + }, + _InjectedValues_closure5: function _InjectedValues_closure5(t0) { + this.$this = t0; + }, + _InjectedValues__closure8: function _InjectedValues__closure8(t0, t1) { + this.vfs = t0; + this.micros = t1; + }, + _InjectedValues_closure6: function _InjectedValues_closure6(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues_closure7: function _InjectedValues_closure7(t0) { + this.$this = t0; + }, + _InjectedValues_closure8: function _InjectedValues_closure8(t0) { + this.$this = t0; + }, + _InjectedValues__closure7: function _InjectedValues__closure7(t0, t1, t2) { + this.$this = t0; + this.file = t1; + this.fd = t2; + }, + _InjectedValues_closure9: function _InjectedValues_closure9(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure6: function _InjectedValues__closure6(t0, t1, t2, t3, t4) { + var _ = this; + _.file = t0; + _.memory = t1; + _.target = t2; + _.amount = t3; + _.offset = t4; + }, + _InjectedValues_closure10: function _InjectedValues_closure10(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure5: function _InjectedValues__closure5(t0, t1, t2, t3, t4) { + var _ = this; + _.file = t0; + _.memory = t1; + _.source = t2; + _.amount = t3; + _.offset = t4; + }, + _InjectedValues_closure11: function _InjectedValues_closure11(t0) { + this.$this = t0; + }, + _InjectedValues__closure4: function _InjectedValues__closure4(t0, t1) { + this.file = t0; + this.size = t1; + }, + _InjectedValues_closure12: function _InjectedValues_closure12(t0) { + this.$this = t0; + }, + _InjectedValues__closure3: function _InjectedValues__closure3(t0, t1) { + this.file = t0; + this.flags = t1; + }, + _InjectedValues_closure13: function _InjectedValues_closure13(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure2: function _InjectedValues__closure2(t0, t1, t2) { + this.file = t0; + this.memory = t1; + this.sizePtr = t2; + }, + _InjectedValues_closure14: function _InjectedValues_closure14(t0) { + this.$this = t0; + }, + _InjectedValues__closure1: function _InjectedValues__closure1(t0, t1) { + this.file = t0; + this.flags = t1; + }, + _InjectedValues_closure15: function _InjectedValues_closure15(t0) { + this.$this = t0; + }, + _InjectedValues__closure0: function _InjectedValues__closure0(t0, t1) { + this.file = t0; + this.flags = t1; + }, + _InjectedValues_closure16: function _InjectedValues_closure16(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues__closure: function _InjectedValues__closure(t0, t1, t2) { + this.file = t0; + this.memory = t1; + this.pResOut = t2; + }, + _InjectedValues_closure17: function _InjectedValues_closure17(t0) { + this.$this = t0; + }, + _InjectedValues_closure18: function _InjectedValues_closure18(t0) { + this.$this = t0; + }, + _InjectedValues_closure19: function _InjectedValues_closure19(t0) { + this.$this = t0; + }, + _InjectedValues_closure20: function _InjectedValues_closure20(t0) { + this.$this = t0; + }, + _InjectedValues_closure21: function _InjectedValues_closure21(t0) { + this.$this = t0; + }, + _InjectedValues_closure22: function _InjectedValues_closure22(t0) { + this.$this = t0; + }, + _InjectedValues_closure23: function _InjectedValues_closure23(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + _InjectedValues_closure24: function _InjectedValues_closure24(t0, t1) { + this.$this = t0; + this.memory = t1; + }, + DartCallbacks: function DartCallbacks(t0, t1, t2, t3) { + var _ = this; + _._id = 0; + _.functions = t0; + _.aggregateContexts = t1; + _.registeredVfs = t2; + _.openedFiles = t3; + _.installedUpdateHook = null; + }, + RegisteredFunctionSet: function RegisteredFunctionSet(t0, t1, t2) { + this.xFunc = t0; + this.xStep = t1; + this.xFinal = t2; + }, + Chain_Chain$parse(chain) { + var t1, t2, + _s51_ = string$.______; + if (chain.length === 0) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([], type$.JSArray_Trace), type$.Trace)); + t1 = $.$get$vmChainGap(); + if (B.JSString_methods.contains$1(chain, t1)) { + t1 = B.JSString_methods.split$1(chain, t1); + t2 = A._arrayInstanceType(t1); + return new A.Chain(A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(t1, t2._eval$1("bool(1)")._as(new A.Chain_Chain$parse_closure()), t2._eval$1("WhereIterable<1>")), t2._eval$1("Trace(1)")._as(A.trace_Trace___parseVM_tearOff$closure()), t2._eval$1("MappedIterable<1,Trace>")), type$.Trace)); + } + if (!B.JSString_methods.contains$1(chain, _s51_)) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([A.Trace_Trace$parse(chain)], type$.JSArray_Trace), type$.Trace)); + return new A.Chain(A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(chain.split(_s51_), type$.JSArray_String), type$.Trace_Function_String._as(A.trace_Trace___parseFriendly_tearOff$closure()), type$.MappedListIterable_String_Trace), type$.Trace)); + }, + Chain: function Chain(t0) { + this.traces = t0; + }, + Chain_Chain$parse_closure: function Chain_Chain$parse_closure() { + }, + Chain_toTrace_closure: function Chain_toTrace_closure() { + }, + Chain_toString_closure0: function Chain_toString_closure0() { + }, + Chain_toString__closure0: function Chain_toString__closure0() { + }, + Chain_toString_closure: function Chain_toString_closure(t0) { + this.longest = t0; + }, + Chain_toString__closure: function Chain_toString__closure(t0) { + this.longest = t0; + }, + Frame___parseVM_tearOff(frame) { + return A.Frame_Frame$parseVM(A._asString(frame)); + }, + Frame_Frame$parseVM(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseVM_closure(frame)); + }, + Frame___parseV8_tearOff(frame) { + return A.Frame_Frame$parseV8(A._asString(frame)); + }, + Frame_Frame$parseV8(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseV8_closure(frame)); + }, + Frame_Frame$_parseFirefoxEval(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$_parseFirefoxEval_closure(frame)); + }, + Frame___parseFirefox_tearOff(frame) { + return A.Frame_Frame$parseFirefox(A._asString(frame)); + }, + Frame_Frame$parseFirefox(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseFirefox_closure(frame)); + }, + Frame___parseFriendly_tearOff(frame) { + return A.Frame_Frame$parseFriendly(A._asString(frame)); + }, + Frame_Frame$parseFriendly(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseFriendly_closure(frame)); + }, + Frame__uriOrPathToUri(uriOrPath) { + if (B.JSString_methods.contains$1(uriOrPath, $.$get$Frame__uriRegExp())) + return A.Uri_parse(uriOrPath); + else if (B.JSString_methods.contains$1(uriOrPath, $.$get$Frame__windowsRegExp())) + return A._Uri__Uri$file(uriOrPath, true); + else if (B.JSString_methods.startsWith$1(uriOrPath, "/")) + return A._Uri__Uri$file(uriOrPath, false); + if (B.JSString_methods.contains$1(uriOrPath, "\\")) + return $.$get$windows().toUri$1(uriOrPath); + return A.Uri_parse(uriOrPath); + }, + Frame__catchFormatException(text, body) { + var t1, exception; + try { + t1 = body.call$0(); + return t1; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.FormatException) + return new A.UnparsedFrame(A._Uri__Uri(null, "unparsed", null, null), text); + else + throw exception; + } + }, + Frame: function Frame(t0, t1, t2, t3) { + var _ = this; + _.uri = t0; + _.line = t1; + _.column = t2; + _.member = t3; + }, + Frame_Frame$parseVM_closure: function Frame_Frame$parseVM_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseV8_closure: function Frame_Frame$parseV8_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseV8_closure_parseLocation: function Frame_Frame$parseV8_closure_parseLocation(t0) { + this.frame = t0; + }, + Frame_Frame$_parseFirefoxEval_closure: function Frame_Frame$_parseFirefoxEval_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseFirefox_closure: function Frame_Frame$parseFirefox_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseFriendly_closure: function Frame_Frame$parseFriendly_closure(t0) { + this.frame = t0; + }, + LazyTrace: function LazyTrace(t0) { + this._thunk = t0; + this.__LazyTrace__trace_FI = $; + }, + Trace_Trace$from(trace) { + if (type$.Trace._is(trace)) + return trace; + if (trace instanceof A.Chain) + return trace.toTrace$0(); + return new A.LazyTrace(new A.Trace_Trace$from_closure(trace)); + }, + Trace_Trace$parse(trace) { + var error, t1, exception; + try { + if (trace.length === 0) { + t1 = A.Trace$(A._setArrayType([], type$.JSArray_Frame), null); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_v8Trace())) { + t1 = A.Trace$parseV8(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, "\tat ")) { + t1 = A.Trace$parseJSCore(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_firefoxSafariTrace()) || B.JSString_methods.contains$1(trace, $.$get$_firefoxEvalTrace())) { + t1 = A.Trace$parseFirefox(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, string$.______)) { + t1 = A.Chain_Chain$parse(trace).toTrace$0(); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_friendlyTrace())) { + t1 = A.Trace$parseFriendly(trace); + return t1; + } + t1 = A.Trace$parseVM(trace); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.FormatException) { + error = t1; + throw A.wrapException(A.FormatException$(error.message + "\nStack trace:\n" + trace, null, null)); + } else + throw exception; + } + }, + Trace___parseVM_tearOff(trace) { + return A.Trace$parseVM(A._asString(trace)); + }, + Trace$parseVM(trace) { + var t1 = A.List_List$unmodifiable(A.Trace__parseVM(trace), type$.Frame); + return new A.Trace(t1); + }, + Trace__parseVM(trace) { + var $frames, + t1 = B.JSString_methods.trim$0(trace), + t2 = $.$get$vmChainGap(), + t3 = type$.WhereIterable_String, + lines = new A.WhereIterable(A._setArrayType(A.stringReplaceAllUnchecked(t1, t2, "").split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace__parseVM_closure()), t3); + if (!lines.get$iterator(0).moveNext$0()) + return A._setArrayType([], type$.JSArray_Frame); + t1 = A.TakeIterable_TakeIterable(lines, lines.get$length(0) - 1, t3._eval$1("Iterable.E")); + t2 = A._instanceType(t1); + t2 = A.MappedIterable_MappedIterable(t1, t2._eval$1("Frame(Iterable.E)")._as(A.frame_Frame___parseVM_tearOff$closure()), t2._eval$1("Iterable.E"), type$.Frame); + $frames = A.List_List$of(t2, true, A._instanceType(t2)._eval$1("Iterable.E")); + if (!J.endsWith$1$s(lines.get$last(0), ".da")) + B.JSArray_methods.add$1($frames, A.Frame_Frame$parseVM(lines.get$last(0))); + return $frames; + }, + Trace$parseV8(trace) { + var t2, t3, + t1 = A.SubListIterable$(A._setArrayType(trace.split("\n"), type$.JSArray_String), 1, null, type$.String); + t1 = t1.super$Iterable$skipWhile(0, t1.$ti._eval$1("bool(ListIterable.E)")._as(new A.Trace$parseV8_closure())); + t2 = type$.Frame; + t3 = t1.$ti; + t2 = A.List_List$unmodifiable(A.MappedIterable_MappedIterable(t1, t3._eval$1("Frame(Iterable.E)")._as(A.frame_Frame___parseV8_tearOff$closure()), t3._eval$1("Iterable.E"), t2), t2); + return new A.Trace(t2); + }, + Trace$parseJSCore(trace) { + var t1 = A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(A._setArrayType(trace.split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace$parseJSCore_closure()), type$.WhereIterable_String), type$.Frame_Function_String._as(A.frame_Frame___parseV8_tearOff$closure()), type$.MappedIterable_String_Frame), type$.Frame); + return new A.Trace(t1); + }, + Trace$parseFirefox(trace) { + var t1 = A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(A._setArrayType(B.JSString_methods.trim$0(trace).split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace$parseFirefox_closure()), type$.WhereIterable_String), type$.Frame_Function_String._as(A.frame_Frame___parseFirefox_tearOff$closure()), type$.MappedIterable_String_Frame), type$.Frame); + return new A.Trace(t1); + }, + Trace___parseFriendly_tearOff(trace) { + return A.Trace$parseFriendly(A._asString(trace)); + }, + Trace$parseFriendly(trace) { + var t1 = trace.length === 0 ? A._setArrayType([], type$.JSArray_Frame) : new A.MappedIterable(new A.WhereIterable(A._setArrayType(B.JSString_methods.trim$0(trace).split("\n"), type$.JSArray_String), type$.bool_Function_String._as(new A.Trace$parseFriendly_closure()), type$.WhereIterable_String), type$.Frame_Function_String._as(A.frame_Frame___parseFriendly_tearOff$closure()), type$.MappedIterable_String_Frame); + t1 = A.List_List$unmodifiable(t1, type$.Frame); + return new A.Trace(t1); + }, + Trace$($frames, original) { + var t1 = A.List_List$unmodifiable($frames, type$.Frame); + return new A.Trace(t1); + }, + Trace: function Trace(t0) { + this.frames = t0; + }, + Trace_Trace$from_closure: function Trace_Trace$from_closure(t0) { + this.trace = t0; + }, + Trace__parseVM_closure: function Trace__parseVM_closure() { + }, + Trace$parseV8_closure: function Trace$parseV8_closure() { + }, + Trace$parseJSCore_closure: function Trace$parseJSCore_closure() { + }, + Trace$parseFirefox_closure: function Trace$parseFirefox_closure() { + }, + Trace$parseFriendly_closure: function Trace$parseFriendly_closure() { + }, + Trace_toString_closure0: function Trace_toString_closure0() { + }, + Trace_toString_closure: function Trace_toString_closure(t0) { + this.longest = t0; + }, + UnparsedFrame: function UnparsedFrame(t0, t1) { + this.uri = t0; + this.member = t1; + }, + CloseGuaranteeChannel: function CloseGuaranteeChannel(t0) { + var _ = this; + _.__CloseGuaranteeChannel__sink_F = _.__CloseGuaranteeChannel__stream_F = $; + _._close_guarantee_channel$_subscription = null; + _._disconnected = false; + _.$ti = t0; + }, + _CloseGuaranteeStream: function _CloseGuaranteeStream(t0, t1, t2) { + this._inner = t0; + this._channel = t1; + this.$ti = t2; + }, + _CloseGuaranteeSink: function _CloseGuaranteeSink(t0, t1, t2) { + this._channel = t0; + this._sink = t1; + this.$ti = t2; + }, + GuaranteeChannel$(innerStream, innerSink, allowSinkErrors, $T) { + var t2, t1 = {}; + t1.innerStream = innerStream; + t2 = new A.GuaranteeChannel($T._eval$1("GuaranteeChannel<0>")); + t2.GuaranteeChannel$3$allowSinkErrors(innerSink, true, t1, $T); + return t2; + }, + GuaranteeChannel: function GuaranteeChannel(t0) { + var _ = this; + _.__GuaranteeChannel__streamController_F = _.__GuaranteeChannel__sink_F = $; + _._guarantee_channel$_subscription = null; + _._guarantee_channel$_disconnected = false; + _.$ti = t0; + }, + GuaranteeChannel_closure: function GuaranteeChannel_closure(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.T = t2; + }, + GuaranteeChannel__closure: function GuaranteeChannel__closure(t0) { + this.$this = t0; + }, + _GuaranteeSink: function _GuaranteeSink(t0, t1, t2, t3, t4) { + var _ = this; + _._guarantee_channel$_inner = t0; + _._guarantee_channel$_channel = t1; + _._doneCompleter = t2; + _._guarantee_channel$_closed = _._guarantee_channel$_disconnected = false; + _._addStreamCompleter = _._addStreamSubscription = null; + _._allowErrors = t3; + _.$ti = t4; + }, + StreamChannelController: function StreamChannelController(t0) { + this.__StreamChannelController__foreign_F = this.__StreamChannelController__local_F = $; + this.$ti = t0; + }, + StreamChannelMixin: function StreamChannelMixin() { + }, + _EventStreamSubscription$(_target, _eventType, onData, _useCapture, $T) { + var t1; + if (onData == null) + t1 = null; + else { + t1 = A._wrapZone(new A._EventStreamSubscription_closure(onData), type$.JSObject); + t1 = t1 == null ? null : type$.JavaScriptFunction._as(A.allowInterop(t1, type$.Function)); + } + t1 = new A._EventStreamSubscription(_target, _eventType, t1, false, $T._eval$1("_EventStreamSubscription<0>")); + t1._tryResume$0(); + return t1; + }, + _wrapZone(callback, $T) { + var t1 = $.Zone__current; + if (t1 === B.C__RootZone) + return callback; + return t1.bindUnaryCallbackGuarded$1$1(callback, $T); + }, + EventStreamProvider: function EventStreamProvider(t0, t1) { + this._eventType = t0; + this.$ti = t1; + }, + _EventStream: function _EventStream(t0, t1, t2, t3) { + var _ = this; + _._target = t0; + _._eventType = t1; + _._useCapture = t2; + _.$ti = t3; + }, + _EventStreamSubscription: function _EventStreamSubscription(t0, t1, t2, t3, t4) { + var _ = this; + _._pauseCount = 0; + _._target = t0; + _._eventType = t1; + _._onData = t2; + _._useCapture = t3; + _.$ti = t4; + }, + _EventStreamSubscription_closure: function _EventStreamSubscription_closure(t0) { + this.onData = t0; + }, + _EventStreamSubscription_onData_closure: function _EventStreamSubscription_onData_closure(t0) { + this.handleData = t0; + }, + printString(string) { + if (typeof dartPrint == "function") { + dartPrint(string); + return; + } + if (typeof console == "object" && typeof console.log != "undefined") { + console.log(string); + return; + } + if (typeof print == "function") { + print(string); + return; + } + throw "Unable to print message: " + String(string); + }, + ListToJSArray_get_toJS(_this, $T) { + return _this; + }, + StringToJSString_get_toJS(_this) { + return _this; + }, + JSAnyUtilityExtension_instanceOfString(_this, constructorName) { + var parts, $constructor, t1, t2, _i, part; + if (constructorName.length === 0) + return false; + parts = constructorName.split("."); + $constructor = type$.JSObject._as(self); + for (t1 = parts.length, t2 = type$.nullable_JSObject, _i = 0; _i < t1; ++_i) { + part = parts[_i]; + $constructor = t2._as($constructor[part]); + if ($constructor == null) + return false; + } + return _this instanceof type$.JavaScriptFunction._as($constructor); + }, + JSObjectUnsafeUtilExtension__callMethod(_this, method, arg1, arg2, arg3, arg4) { + var t1; + if (arg1 == null) + return _this[method](); + else if (arg2 == null) + return _this[method](arg1); + else if (arg3 == null) + return _this[method](arg1, arg2); + else { + t1 = _this[method](arg1, arg2, arg3); + return t1; + } + }, + _pseudorandomStringWithAlphabet($length, alphabet) { + var i, t1, + b = A.List_List$filled($length, 0, false, type$.int), + max = alphabet.length; + for (i = 0; i < $length; ++i) { + t1 = B.C__JSRandom.nextInt$1(max); + if (!(t1 >= 0 && t1 < max)) + return A.ioore(alphabet, t1); + B.JSArray_methods.$indexSet(b, i, alphabet.charCodeAt(t1)); + } + return A.String_String$fromCharCodes(b, 0, null); + }, + current() { + var exception, t1, path, lastIndex, uri = null; + try { + uri = A.Uri_base(); + } catch (exception) { + if (type$.Exception._is(A.unwrapException(exception))) { + t1 = $._current; + if (t1 != null) + return t1; + throw exception; + } else + throw exception; + } + if (J.$eq$(uri, $._currentUriBase)) { + t1 = $._current; + t1.toString; + return t1; + } + $._currentUriBase = uri; + if ($.$get$Style_platform() === $.$get$Style_url()) + t1 = $._current = uri.resolve$1(".").toString$0(0); + else { + path = uri.toFilePath$0(); + t1 = path.length; + lastIndex = t1 - 1; + if (!(lastIndex >= 0)) + return A.ioore(path, lastIndex); + t1 = path[lastIndex]; + A.assertHelper(t1 === "/" || t1 === "\\"); + t1 = $._current = lastIndex === 0 ? path : B.JSString_methods.substring$2(path, 0, lastIndex); + } + return t1; + }, + isAlphabetic(char) { + var t1; + if (!(char >= 65 && char <= 90)) + t1 = char >= 97 && char <= 122; + else + t1 = true; + return t1; + }, + driveLetterEnd(path, index) { + var t2, t3, _null = null, + t1 = path.length, + index0 = index + 2; + if (t1 < index0) + return _null; + if (!(index >= 0 && index < t1)) + return A.ioore(path, index); + if (!A.isAlphabetic(path.charCodeAt(index))) + return _null; + t2 = index + 1; + if (!(t2 < t1)) + return A.ioore(path, t2); + if (path.charCodeAt(t2) !== 58) { + t3 = index + 4; + if (t1 < t3) + return _null; + if (B.JSString_methods.substring$2(path, t2, t3).toLowerCase() !== "%3a") + return _null; + index = index0; + } + t2 = index + 2; + if (t1 === t2) + return t2; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(path, t2); + if (path.charCodeAt(t2) !== 47) + return _null; + return index + 3; + }, + createExceptionRaw(bindings, db, returnCode, operation, previousStatement, statementArgs) { + var _s4_ = "call", + t1 = db.bindings, + t2 = db.db, + t3 = type$.nullable_Object, + extendedCode = A._asInt(A._asDouble(A.callMethod(t1._sqlite3_extended_errcode, _s4_, [null, t2], t3))), + t4 = bindings.bindings; + return new A.SqliteException(A.WrappedMemory_readString(t1.memory, A._asInt(A._asDouble(A.callMethod(t1._sqlite3_errmsg, _s4_, [null, t2], t3))), null), A.WrappedMemory_readString(t4.memory, A._asInt(A._asDouble(A.callMethod(t4._sqlite3_errstr, _s4_, [null, extendedCode], t3))), null) + " (code " + extendedCode + ")", returnCode, operation, previousStatement, statementArgs); + }, + throwException(db, returnCode, operation, previousStatement, statementArgs) { + throw A.wrapException(A.createExceptionRaw(db.bindings, db.database, returnCode, operation, previousStatement, statementArgs)); + }, + BigIntRangeCheck_get_checkRange(_this) { + if (_this.compareTo$1(0, $.$get$bigIntMinValue64()) < 0 || _this.compareTo$1(0, $.$get$bigIntMaxValue64()) > 0) + throw A.wrapException(A.Exception_Exception("BigInt value exceeds the range of 64 bits")); + return _this; + }, + ReadBlob_byteBuffer(_this) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.ByteBuffer), + $async$returnValue; + var $async$ReadBlob_byteBuffer = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(type$.JSObject._as(_this.arrayBuffer()), type$.NativeByteBuffer), $async$ReadBlob_byteBuffer); + case 3: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$ReadBlob_byteBuffer, $async$completer); + }, + SharedArrayBuffer_asByteData(_this, offset, $length) { + var t1 = type$.JavaScriptFunction._as(self.DataView), + t2 = [_this]; + t2.push(offset); + t2.push($length); + return type$.NativeByteData._as(A.callConstructor(t1, t2, type$.JSObject)); + }, + SharedArrayBuffer_asUint8ListSlice(_this, offset, $length) { + var t1 = type$.JavaScriptFunction._as(self.Uint8Array), + t2 = [_this]; + t2.push(offset); + t2.push($length); + return type$.NativeUint8List._as(A.callConstructor(t1, t2, type$.JSObject)); + }, + Atomics_notify(typedArray, index) { + self.Atomics.notify(typedArray, index, 1 / 0); + }, + storageManager() { + var t1 = type$.JSObject, + $navigator = t1._as(self.navigator); + if ("storage" in $navigator) + return t1._as($navigator.storage); + return null; + }, + FileSystemSyncAccessHandleApi_readDart(_this, buffer, options) { + return A._asInt(_this.read(buffer, options)); + }, + FileSystemSyncAccessHandleApi_writeDart(_this, buffer, options) { + return A._asInt(_this.write(buffer, options)); + }, + FileSystemDirectoryHandleApi_remove(_this, $name) { + return A.promiseToFuture(type$.JSObject._as(_this.removeEntry($name, {recursive: false})), type$.nullable_Object); + }, + GenerateFilename_randomFileName(_this, prefix) { + var t1, i, t2, + _s61_ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789"; + for (t1 = prefix, i = 0; i < 16; ++i, t1 = t2) { + t2 = _this.nextInt$1(61); + if (!(t2 < 61)) + return A.ioore(_s61_, t2); + t2 = t1 + A.Primitives_stringFromCharCode(_s61_.charCodeAt(t2)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + main() { + var $self = type$.JSObject._as(self); + if (A.JSAnyUtilityExtension_instanceOfString($self, "DedicatedWorkerGlobalScope")) + new A.DedicatedDriftWorker($self, new A.Lock(), new A.DriftServerController(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.RunningWasmServer), A.functions__applyDbFunctions$closure())).start$0(); + else if (A.JSAnyUtilityExtension_instanceOfString($self, "SharedWorkerGlobalScope")) + new A.SharedDriftWorker($self, new A.DriftServerController(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.RunningWasmServer), A.functions__applyDbFunctions$closure())).start$0(); + return null; + } + }, + B = {}; + var holders = [A, J, B]; + var $ = {}; + A.JS_CONST.prototype = {}; + J.Interceptor.prototype = { + $eq(receiver, other) { + return receiver === other; + }, + get$hashCode(receiver) { + return A.Primitives_objectHashCode(receiver); + }, + toString$0(receiver) { + return "Instance of '" + A.Primitives_objectTypeName(receiver) + "'"; + }, + noSuchMethod$1(receiver, invocation) { + throw A.wrapException(A.NoSuchMethodError_NoSuchMethodError$withInvocation(receiver, type$.Invocation._as(invocation))); + }, + get$runtimeType(receiver) { + return A.createRuntimeType(A._instanceTypeFromConstructor(this)); + } + }; + J.JSBool.prototype = { + toString$0(receiver) { + return String(receiver); + }, + get$hashCode(receiver) { + return receiver ? 519018 : 218159; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.bool); + }, + $isTrustedGetRuntimeType: 1, + $isbool: 1 + }; + J.JSNull.prototype = { + $eq(receiver, other) { + return null == other; + }, + toString$0(receiver) { + return "null"; + }, + get$hashCode(receiver) { + return 0; + }, + $isTrustedGetRuntimeType: 1, + $isNull: 1 + }; + J.JavaScriptObject.prototype = {$isJSObject: 1}; + J.LegacyJavaScriptObject.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.PlainJavaScriptObject.prototype = {}; + J.UnknownJavaScriptObject.prototype = {}; + J.JavaScriptFunction.prototype = { + toString$0(receiver) { + var dartClosure = receiver[$.$get$DART_CLOSURE_PROPERTY_NAME()]; + if (dartClosure == null) + return this.super$LegacyJavaScriptObject$toString(receiver); + return "JavaScript function for " + J.toString$0$(dartClosure); + }, + $isFunction: 1 + }; + J.JavaScriptBigInt.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JavaScriptSymbol.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JSArray.prototype = { + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A._arrayInstanceType(receiver)._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + add$1(receiver, value) { + A._arrayInstanceType(receiver)._precomputed1._as(value); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("add")); + receiver.push(value); + }, + removeAt$1(receiver, index) { + var t1; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeAt")); + t1 = receiver.length; + if (index >= t1) + throw A.wrapException(A.RangeError$value(index, null)); + return receiver.splice(index, 1)[0]; + }, + insert$2(receiver, index, value) { + var t1; + A._arrayInstanceType(receiver)._precomputed1._as(value); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("insert")); + t1 = receiver.length; + if (index > t1) + throw A.wrapException(A.RangeError$value(index, null)); + receiver.splice(index, 0, value); + }, + insertAll$2(receiver, index, iterable) { + var insertionLength, end; + A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(iterable); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("insertAll")); + A.RangeError_checkValueInInterval(index, 0, receiver.length, "index"); + if (!type$.EfficientLengthIterable_dynamic._is(iterable)) + iterable = J.toList$0$ax(iterable); + insertionLength = J.get$length$asx(iterable); + this._setLengthUnsafe$1(receiver, receiver.length + insertionLength); + end = index + insertionLength; + this.setRange$4(receiver, end, receiver.length, receiver, index); + this.setRange$3(receiver, index, end, iterable); + }, + removeLast$0(receiver) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeLast")); + if (receiver.length === 0) + throw A.wrapException(A.diagnoseIndexError(receiver, -1)); + return receiver.pop(); + }, + remove$1(receiver, element) { + var i; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("remove")); + for (i = 0; i < receiver.length; ++i) + if (J.$eq$(receiver[i], element)) { + receiver.splice(i, 1); + return true; + } + return false; + }, + addAll$1(receiver, collection) { + var i, t1, e, i0; + A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(collection); + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("addAll")); + if (Array.isArray(collection)) { + this._addAllFromArray$1(receiver, collection); + return; + } + i = receiver.length; + for (t1 = J.get$iterator$ax(collection); t1.moveNext$0(); i = i0) { + e = t1.get$current(); + i0 = i + 1; + A.assertHelper(i === receiver.length || A.throwExpression(A.ConcurrentModificationError$(receiver))); + receiver.push(e); + } + }, + _addAllFromArray$1(receiver, array) { + var len, i; + type$.JSArray_dynamic._as(array); + len = array.length; + if (len === 0) + return; + if (receiver === array) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + for (i = 0; i < len; ++i) + receiver.push(array[i]); + }, + clear$0(receiver) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("clear")); + this._setLengthUnsafe$1(receiver, 0); + }, + forEach$1(receiver, f) { + var end, i; + A._arrayInstanceType(receiver)._eval$1("~(1)")._as(f); + end = receiver.length; + for (i = 0; i < end; ++i) { + f.call$1(receiver[i]); + if (receiver.length !== end) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + }, + map$1$1(receiver, f, $T) { + var t1 = A._arrayInstanceType(receiver); + return new A.MappedListIterable(receiver, t1._bind$1($T)._eval$1("1(2)")._as(f), t1._eval$1("@<1>")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + join$1(receiver, separator) { + var i, + list = A.List_List$filled(receiver.length, "", false, type$.String); + for (i = 0; i < receiver.length; ++i) + this.$indexSet(list, i, A.S(receiver[i])); + return list.join(separator); + }, + join$0(receiver) { + return this.join$1(receiver, ""); + }, + take$1(receiver, n) { + return A.SubListIterable$(receiver, 0, A.checkNotNullable(n, "count", type$.int), A._arrayInstanceType(receiver)._precomputed1); + }, + skip$1(receiver, n) { + return A.SubListIterable$(receiver, n, null, A._arrayInstanceType(receiver)._precomputed1); + }, + elementAt$1(receiver, index) { + if (!(index >= 0 && index < receiver.length)) + return A.ioore(receiver, index); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + var t1 = receiver.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, "start", null)); + if (end < start || end > t1) + throw A.wrapException(A.RangeError$range(end, start, t1, "end", null)); + if (start === end) + return A._setArrayType([], A._arrayInstanceType(receiver)); + return A._setArrayType(receiver.slice(start, end), A._arrayInstanceType(receiver)); + }, + getRange$2(receiver, start, end) { + A.RangeError_checkValidRange(start, end, receiver.length); + return A.SubListIterable$(receiver, start, end, A._arrayInstanceType(receiver)._precomputed1); + }, + get$first(receiver) { + if (receiver.length > 0) + return receiver[0]; + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$last(receiver) { + var t1 = receiver.length; + if (t1 > 0) + return receiver[t1 - 1]; + throw A.wrapException(A.IterableElementError_noElement()); + }, + setRange$4(receiver, start, end, iterable, skipCount) { + var $length, otherList, otherStart, t1, i; + A._arrayInstanceType(receiver)._eval$1("Iterable<1>")._as(iterable); + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("setRange")); + A.RangeError_checkValidRange(start, end, receiver.length); + $length = end - start; + if ($length === 0) + return; + A.RangeError_checkNotNegative(skipCount, "skipCount"); + if (type$.List_dynamic._is(iterable)) { + otherList = iterable; + otherStart = skipCount; + } else { + otherList = J.skip$1$ax(iterable, skipCount).toList$1$growable(0, false); + otherStart = 0; + } + t1 = J.getInterceptor$asx(otherList); + if (otherStart + $length > t1.get$length(otherList)) + throw A.wrapException(A.IterableElementError_tooFew()); + if (otherStart < start) + for (i = $length - 1; i >= 0; --i) + receiver[start + i] = t1.$index(otherList, otherStart + i); + else + for (i = 0; i < $length; ++i) + receiver[start + i] = t1.$index(otherList, otherStart + i); + }, + setRange$3(receiver, start, end, iterable) { + return this.setRange$4(receiver, start, end, iterable, 0); + }, + every$1(receiver, test) { + var end, i; + A._arrayInstanceType(receiver)._eval$1("bool(1)")._as(test); + end = receiver.length; + for (i = 0; i < end; ++i) { + if (!A.boolConversionCheck(test.call$1(receiver[i]))) + return false; + if (receiver.length !== end) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return true; + }, + sort$1(receiver, compare) { + var len, a, b, undefineds, i, + t1 = A._arrayInstanceType(receiver); + t1._eval$1("int(1,1)?")._as(compare); + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("sort")); + len = receiver.length; + if (len < 2) + return; + if (compare == null) + compare = J._interceptors_JSArray__compareAny$closure(); + if (len === 2) { + a = receiver[0]; + b = receiver[1]; + t1 = compare.call$2(a, b); + if (typeof t1 !== "number") + return t1.$gt(); + if (t1 > 0) { + receiver[0] = b; + receiver[1] = a; + } + return; + } + if (t1._precomputed1._is(null)) { + for (undefineds = 0, i = 0; i < receiver.length; ++i) + if (receiver[i] === void 0) { + receiver[i] = null; + ++undefineds; + } + } else + undefineds = 0; + receiver.sort(A.convertDartClosureToJS(compare, 2)); + if (undefineds > 0) + this._replaceSomeNullsWithUndefined$1(receiver, undefineds); + }, + sort$0(receiver) { + return this.sort$1(receiver, null); + }, + _replaceSomeNullsWithUndefined$1(receiver, count) { + var i, i0; + A.assertHelper(count > 0); + i = receiver.length; + for (; i0 = i - 1, i > 0; i = i0) + if (receiver[i0] === null) { + receiver[i0] = void 0; + --count; + if (count === 0) + break; + } + }, + lastIndexOf$1(receiver, element) { + var i, + t1 = receiver.length, + start = t1 - 1; + if (start < 0) + return -1; + start >= t1; + for (i = start; i >= 0; --i) { + if (!(i < receiver.length)) + return A.ioore(receiver, i); + if (J.$eq$(receiver[i], element)) + return i; + } + return -1; + }, + get$isEmpty(receiver) { + return receiver.length === 0; + }, + toString$0(receiver) { + return A.Iterable_iterableToFullString(receiver, "[", "]"); + }, + toList$1$growable(receiver, growable) { + var t1 = A._setArrayType(receiver.slice(0), A._arrayInstanceType(receiver)); + return t1; + }, + toList$0(receiver) { + return this.toList$1$growable(receiver, true); + }, + get$iterator(receiver) { + return new J.ArrayIterator(receiver, receiver.length, A._arrayInstanceType(receiver)._eval$1("ArrayIterator<1>")); + }, + get$hashCode(receiver) { + return A.Primitives_objectHashCode(receiver); + }, + get$length(receiver) { + return receiver.length; + }, + _setLengthUnsafe$1(receiver, newLength) { + if (A.assertTest(newLength >= 0)) + A.assertThrow(A.throwExpression(A.RangeError$range(newLength, 0, null, "newLength", null))); + receiver.length = newLength; + }, + $index(receiver, index) { + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $indexSet(receiver, index, value) { + A._arrayInstanceType(receiver)._precomputed1._as(value); + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("indexed set")); + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + receiver[index] = value; + }, + $isJSIndexable: 1, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + J.JSUnmodifiableArray.prototype = {}; + J.ArrayIterator.prototype = { + get$current() { + var t1 = this._current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t2, _this = this, + t1 = _this._iterable, + $length = t1.length; + if (_this._length !== $length) { + t1 = A.throwConcurrentModificationError(t1); + throw A.wrapException(t1); + } + t2 = _this._index; + if (t2 >= $length) { + _this.set$_current(null); + return false; + } + _this.set$_current(t1[t2]); + ++_this._index; + return true; + }, + set$_current(_current) { + this._current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + J.JSNumber.prototype = { + compareTo$1(receiver, b) { + var bIsNegative; + A._asNum(b); + if (receiver < b) + return -1; + else if (receiver > b) + return 1; + else if (receiver === b) { + if (receiver === 0) { + bIsNegative = this.get$isNegative(b); + if (this.get$isNegative(receiver) === bIsNegative) + return 0; + if (this.get$isNegative(receiver)) + return -1; + return 1; + } + return 0; + } else if (isNaN(receiver)) { + if (isNaN(b)) + return 0; + return 1; + } else + return -1; + }, + get$isNegative(receiver) { + return receiver === 0 ? 1 / receiver < 0 : receiver < 0; + }, + toInt$0(receiver) { + var t1; + if (receiver >= -2147483648 && receiver <= 2147483647) + return receiver | 0; + if (isFinite(receiver)) { + t1 = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver); + return t1 + 0; + } + throw A.wrapException(A.UnsupportedError$("" + receiver + ".toInt()")); + }, + ceil$0(receiver) { + var truncated, d; + if (receiver >= 0) { + if (receiver <= 2147483647) { + truncated = receiver | 0; + return receiver === truncated ? truncated : truncated + 1; + } + } else if (receiver >= -2147483648) + return receiver | 0; + d = Math.ceil(receiver); + if (isFinite(d)) + return d; + throw A.wrapException(A.UnsupportedError$("" + receiver + ".ceil()")); + }, + toString$0(receiver) { + if (receiver === 0 && 1 / receiver < 0) + return "-0.0"; + else + return "" + receiver; + }, + get$hashCode(receiver) { + var absolute, floorLog2, factor, scaled, + intValue = receiver | 0; + if (receiver === intValue) + return intValue & 536870911; + absolute = Math.abs(receiver); + floorLog2 = Math.log(absolute) / 0.6931471805599453 | 0; + factor = Math.pow(2, floorLog2); + scaled = absolute < 1 ? absolute / factor : factor / absolute; + return ((scaled * 9007199254740992 | 0) + (scaled * 3542243181176521 | 0)) * 599197 + floorLog2 * 1259 & 536870911; + }, + $add(receiver, other) { + return receiver + other; + }, + $mod(receiver, other) { + var result = receiver % other; + if (result === 0) + return 0; + if (result > 0) + return result; + return result + other; + }, + $tdiv(receiver, other) { + if ((receiver | 0) === receiver) + if (other >= 1 || other < -1) + return receiver / other | 0; + return this._tdivSlow$1(receiver, other); + }, + _tdivFast$1(receiver, other) { + return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow$1(receiver, other); + }, + _tdivSlow$1(receiver, other) { + var quotient = receiver / other; + if (quotient >= -2147483648 && quotient <= 2147483647) + return quotient | 0; + if (quotient > 0) { + if (quotient !== 1 / 0) + return Math.floor(quotient); + } else if (quotient > -1 / 0) + return Math.ceil(quotient); + throw A.wrapException(A.UnsupportedError$("Result of truncating division is " + A.S(quotient) + ": " + A.S(receiver) + " ~/ " + other)); + }, + $shl(receiver, other) { + if (other < 0) + throw A.wrapException(A.argumentErrorValue(other)); + return other > 31 ? 0 : receiver << other >>> 0; + }, + $shr(receiver, other) { + var t1; + if (other < 0) + throw A.wrapException(A.argumentErrorValue(other)); + if (receiver > 0) + t1 = this._shrBothPositive$1(receiver, other); + else { + t1 = other > 31 ? 31 : other; + t1 = receiver >> t1 >>> 0; + } + return t1; + }, + _shrOtherPositive$1(receiver, other) { + var t1; + if (receiver > 0) + t1 = this._shrBothPositive$1(receiver, other); + else { + t1 = other > 31 ? 31 : other; + t1 = receiver >> t1 >>> 0; + } + return t1; + }, + _shrReceiverPositive$1(receiver, other) { + if (0 > other) + throw A.wrapException(A.argumentErrorValue(other)); + return this._shrBothPositive$1(receiver, other); + }, + _shrBothPositive$1(receiver, other) { + return other > 31 ? 0 : receiver >>> other; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.num); + }, + $isComparable: 1, + $isdouble: 1, + $isnum: 1 + }; + J.JSInt.prototype = { + get$bitLength(receiver) { + var wordBits, + t1 = receiver < 0 ? -receiver - 1 : receiver, + nonneg = t1; + for (wordBits = 32; nonneg >= 4294967296;) { + nonneg = this._tdivFast$1(nonneg, 4294967296); + wordBits += 32; + } + return wordBits - Math.clz32(nonneg); + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.int); + }, + $isTrustedGetRuntimeType: 1, + $isint: 1 + }; + J.JSNumNotInt.prototype = { + get$runtimeType(receiver) { + return A.createRuntimeType(type$.double); + }, + $isTrustedGetRuntimeType: 1 + }; + J.JSString.prototype = { + codeUnitAt$1(receiver, index) { + if (index < 0) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + if (index >= receiver.length) + A.throwExpression(A.diagnoseIndexError(receiver, index)); + return receiver.charCodeAt(index); + }, + allMatches$2(receiver, string, start) { + var t1 = string.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, null, null)); + return new A._StringAllMatchesIterable(string, receiver, start); + }, + allMatches$1(receiver, string) { + return this.allMatches$2(receiver, string, 0); + }, + matchAsPrefix$2(receiver, string, start) { + var t1, t2, i, t3, _null = null; + if (start < 0 || start > string.length) + throw A.wrapException(A.RangeError$range(start, 0, string.length, _null, _null)); + t1 = receiver.length; + t2 = string.length; + if (start + t1 > t2) + return _null; + for (i = 0; i < t1; ++i) { + t3 = start + i; + if (!(t3 >= 0 && t3 < t2)) + return A.ioore(string, t3); + if (string.charCodeAt(t3) !== receiver.charCodeAt(i)) + return _null; + } + return new A.StringMatch(start, receiver); + }, + $add(receiver, other) { + return receiver + other; + }, + endsWith$1(receiver, other) { + var otherLength = other.length, + t1 = receiver.length; + if (otherLength > t1) + return false; + return other === this.substring$1(receiver, t1 - otherLength); + }, + replaceFirst$2(receiver, from, to) { + A.RangeError_checkValueInInterval(0, 0, receiver.length, "startIndex"); + return A.stringReplaceFirstUnchecked(receiver, from, to, 0); + }, + split$1(receiver, pattern) { + if (typeof pattern == "string") + return A._setArrayType(receiver.split(pattern), type$.JSArray_String); + else if (pattern instanceof A.JSSyntaxRegExp && pattern.get$_nativeAnchoredVersion().exec("").length - 2 === 0) + return A._setArrayType(receiver.split(pattern._nativeRegExp), type$.JSArray_String); + else + return this._defaultSplit$1(receiver, pattern); + }, + replaceRange$3(receiver, start, end, replacement) { + var e = A.RangeError_checkValidRange(start, end, receiver.length); + return A.stringReplaceRangeUnchecked(receiver, start, e, replacement); + }, + _defaultSplit$1(receiver, pattern) { + var t1, start, $length, match, matchStart, matchEnd, + result = A._setArrayType([], type$.JSArray_String); + for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), start = 0, $length = 1; t1.moveNext$0();) { + match = t1.get$current(); + matchStart = match.get$start(); + matchEnd = match.get$end(); + $length = matchEnd - matchStart; + if ($length === 0 && start === matchStart) + continue; + B.JSArray_methods.add$1(result, this.substring$2(receiver, start, matchStart)); + start = matchEnd; + } + if (start < receiver.length || $length > 0) + B.JSArray_methods.add$1(result, this.substring$1(receiver, start)); + return result; + }, + startsWith$2(receiver, pattern, index) { + var endIndex; + if (index < 0 || index > receiver.length) + throw A.wrapException(A.RangeError$range(index, 0, receiver.length, null, null)); + if (typeof pattern == "string") { + endIndex = index + pattern.length; + if (endIndex > receiver.length) + return false; + return pattern === receiver.substring(index, endIndex); + } + return J.matchAsPrefix$2$s(pattern, receiver, index) != null; + }, + startsWith$1(receiver, pattern) { + return this.startsWith$2(receiver, pattern, 0); + }, + substring$2(receiver, start, end) { + return receiver.substring(start, A.RangeError_checkValidRange(start, end, receiver.length)); + }, + substring$1(receiver, start) { + return this.substring$2(receiver, start, null); + }, + trim$0(receiver) { + var startIndex, t1, endIndex0, + result = receiver.trim(), + endIndex = result.length; + if (endIndex === 0) + return result; + if (0 >= endIndex) + return A.ioore(result, 0); + if (result.charCodeAt(0) === 133) { + startIndex = J.JSString__skipLeadingWhitespace(result, 1); + if (startIndex === endIndex) + return ""; + } else + startIndex = 0; + t1 = endIndex - 1; + if (!(t1 >= 0)) + return A.ioore(result, t1); + endIndex0 = result.charCodeAt(t1) === 133 ? J.JSString__skipTrailingWhitespace(result, t1) : endIndex; + if (startIndex === 0 && endIndex0 === endIndex) + return result; + return result.substring(startIndex, endIndex0); + }, + $mul(receiver, times) { + var s, result; + if (0 >= times) + return ""; + if (times === 1 || receiver.length === 0) + return receiver; + if (times !== times >>> 0) + throw A.wrapException(B.C_OutOfMemoryError); + for (s = receiver, result = ""; true;) { + if ((times & 1) === 1) + result = s + result; + times = times >>> 1; + if (times === 0) + break; + s += s; + } + return result; + }, + padLeft$2(receiver, width, padding) { + var delta = width - receiver.length; + if (delta <= 0) + return receiver; + return this.$mul(padding, delta) + receiver; + }, + padRight$1(receiver, width) { + var delta = width - receiver.length; + if (delta <= 0) + return receiver; + return receiver + this.$mul(" ", delta); + }, + indexOf$2(receiver, pattern, start) { + var t1; + if (start < 0 || start > receiver.length) + throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null)); + t1 = receiver.indexOf(pattern, start); + return t1; + }, + indexOf$1(receiver, pattern) { + return this.indexOf$2(receiver, pattern, 0); + }, + lastIndexOf$2(receiver, pattern, start) { + var t1, t2; + if (start == null) + start = receiver.length; + else if (start < 0 || start > receiver.length) + throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null)); + t1 = pattern.length; + t2 = receiver.length; + if (start + t1 > t2) + start = t2 - t1; + return receiver.lastIndexOf(pattern, start); + }, + lastIndexOf$1(receiver, pattern) { + return this.lastIndexOf$2(receiver, pattern, null); + }, + contains$1(receiver, other) { + return A.stringContainsUnchecked(receiver, other, 0); + }, + compareTo$1(receiver, other) { + var t1; + A._asString(other); + if (receiver === other) + t1 = 0; + else + t1 = receiver < other ? -1 : 1; + return t1; + }, + toString$0(receiver) { + return receiver; + }, + get$hashCode(receiver) { + var t1, hash, i; + for (t1 = receiver.length, hash = 0, i = 0; i < t1; ++i) { + hash = hash + receiver.charCodeAt(i) & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + hash ^= hash >> 6; + } + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.String); + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $isJSIndexable: 1, + $isTrustedGetRuntimeType: 1, + $isComparable: 1, + $isPattern: 1, + $isString: 1 + }; + A._CastIterableBase.prototype = { + get$iterator(_) { + var t1 = A._instanceType(this); + return new A.CastIterator(J.get$iterator$ax(this.get$_source()), t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("CastIterator<1,2>")); + }, + get$length(_) { + return J.get$length$asx(this.get$_source()); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.get$_source()); + }, + skip$1(_, count) { + var t1 = A._instanceType(this); + return A.CastIterable_CastIterable(J.skip$1$ax(this.get$_source(), count), t1._precomputed1, t1._rest[1]); + }, + take$1(_, count) { + var t1 = A._instanceType(this); + return A.CastIterable_CastIterable(J.take$1$ax(this.get$_source(), count), t1._precomputed1, t1._rest[1]); + }, + elementAt$1(_, index) { + return A._instanceType(this)._rest[1]._as(J.elementAt$1$ax(this.get$_source(), index)); + }, + get$first(_) { + return A._instanceType(this)._rest[1]._as(J.get$first$ax(this.get$_source())); + }, + get$last(_) { + return A._instanceType(this)._rest[1]._as(J.get$last$ax(this.get$_source())); + }, + toString$0(_) { + return J.toString$0$(this.get$_source()); + } + }; + A.CastIterator.prototype = { + moveNext$0() { + return this._source.moveNext$0(); + }, + get$current() { + return this.$ti._rest[1]._as(this._source.get$current()); + }, + $isIterator: 1 + }; + A.CastIterable.prototype = { + get$_source() { + return this._source; + } + }; + A._EfficientLengthCastIterable.prototype = {$isEfficientLengthIterable: 1}; + A._CastListBase.prototype = { + $index(_, index) { + return this.$ti._rest[1]._as(J.$index$asx(this._source, index)); + }, + $indexSet(_, index, value) { + var t1 = this.$ti; + J.$indexSet$ax(this._source, index, t1._precomputed1._as(t1._rest[1]._as(value))); + }, + getRange$2(_, start, end) { + var t1 = this.$ti; + return A.CastIterable_CastIterable(J.getRange$2$ax(this._source, start, end), t1._precomputed1, t1._rest[1]); + }, + setRange$4(_, start, end, iterable, skipCount) { + var t1 = this.$ti; + J.setRange$4$ax(this._source, start, end, A.CastIterable_CastIterable(t1._eval$1("Iterable<2>")._as(iterable), t1._rest[1], t1._precomputed1), skipCount); + }, + setRange$3(_, start, end, iterable) { + return this.setRange$4(0, start, end, iterable, 0); + }, + $isEfficientLengthIterable: 1, + $isList: 1 + }; + A.CastList.prototype = { + cast$1$0(_, $R) { + return new A.CastList(this._source, this.$ti._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + get$_source() { + return this._source; + } + }; + A.LateError.prototype = { + toString$0(_) { + return "LateInitializationError: " + this._message; + } + }; + A.CodeUnits.prototype = { + get$length(_) { + return this.__internal$_string.length; + }, + $index(_, i) { + var t1 = this.__internal$_string; + if (!(i >= 0 && i < t1.length)) + return A.ioore(t1, i); + return t1.charCodeAt(i); + } + }; + A.nullFuture_closure.prototype = { + call$0() { + return A.Future_Future$value(null, type$.Null); + }, + $signature: 14 + }; + A.SentinelValue.prototype = {}; + A.EfficientLengthIterable.prototype = {}; + A.ListIterable.prototype = { + get$iterator(_) { + var _this = this; + return new A.ListIterator(_this, _this.get$length(_this), A._instanceType(_this)._eval$1("ListIterator")); + }, + get$isEmpty(_) { + return this.get$length(this) === 0; + }, + get$first(_) { + if (this.get$length(this) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return this.elementAt$1(0, 0); + }, + get$last(_) { + var _this = this; + if (_this.get$length(_this) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return _this.elementAt$1(0, _this.get$length(_this) - 1); + }, + join$1(_, separator) { + var first, t1, i, _this = this, + $length = _this.get$length(_this); + if (separator.length !== 0) { + if ($length === 0) + return ""; + first = A.S(_this.elementAt$1(0, 0)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + for (t1 = first, i = 1; i < $length; ++i) { + t1 = t1 + separator + A.S(_this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else { + for (i = 0, t1 = ""; i < $length; ++i) { + t1 += A.S(_this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }, + join$0(_) { + return this.join$1(0, ""); + }, + map$1$1(_, toElement, $T) { + var t1 = A._instanceType(this); + return new A.MappedListIterable(this, t1._bind$1($T)._eval$1("1(ListIterable.E)")._as(toElement), t1._eval$1("@")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + fold$1$2(_, initialValue, combine, $T) { + var $length, value, i, _this = this; + $T._as(initialValue); + A._instanceType(_this)._bind$1($T)._eval$1("1(1,ListIterable.E)")._as(combine); + $length = _this.get$length(_this); + for (value = initialValue, i = 0; i < $length; ++i) { + value = combine.call$2(value, _this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return value; + }, + skip$1(_, count) { + return A.SubListIterable$(this, count, null, A._instanceType(this)._eval$1("ListIterable.E")); + }, + take$1(_, count) { + return A.SubListIterable$(this, 0, A.checkNotNullable(count, "count", type$.int), A._instanceType(this)._eval$1("ListIterable.E")); + } + }; + A.SubListIterable.prototype = { + SubListIterable$3(_iterable, _start, _endOrLength, $E) { + var endOrLength, + t1 = this._start; + A.RangeError_checkNotNegative(t1, "start"); + endOrLength = this._endOrLength; + if (endOrLength != null) { + A.RangeError_checkNotNegative(endOrLength, "end"); + if (t1 > endOrLength) + throw A.wrapException(A.RangeError$range(t1, 0, endOrLength, "start", null)); + } + }, + get$_endIndex() { + var $length = J.get$length$asx(this.__internal$_iterable), + endOrLength = this._endOrLength; + if (endOrLength == null || endOrLength > $length) + return $length; + return endOrLength; + }, + get$_startIndex() { + var $length = J.get$length$asx(this.__internal$_iterable), + t1 = this._start; + if (t1 > $length) + return $length; + return t1; + }, + get$length(_) { + var endOrLength, + $length = J.get$length$asx(this.__internal$_iterable), + t1 = this._start; + if (t1 >= $length) + return 0; + endOrLength = this._endOrLength; + if (endOrLength == null || endOrLength >= $length) + return $length - t1; + if (typeof endOrLength !== "number") + return endOrLength.$sub(); + return endOrLength - t1; + }, + elementAt$1(_, index) { + var _this = this, + realIndex = _this.get$_startIndex() + index; + if (index < 0 || realIndex >= _this.get$_endIndex()) + throw A.wrapException(A.IndexError$withLength(index, _this.get$length(0), _this, null, "index")); + return J.elementAt$1$ax(_this.__internal$_iterable, realIndex); + }, + skip$1(_, count) { + var newStart, endOrLength, _this = this; + A.RangeError_checkNotNegative(count, "count"); + newStart = _this._start + count; + endOrLength = _this._endOrLength; + if (endOrLength != null && newStart >= endOrLength) + return new A.EmptyIterable(_this.$ti._eval$1("EmptyIterable<1>")); + return A.SubListIterable$(_this.__internal$_iterable, newStart, endOrLength, _this.$ti._precomputed1); + }, + take$1(_, count) { + var endOrLength, t1, newEnd, _this = this; + A.RangeError_checkNotNegative(count, "count"); + endOrLength = _this._endOrLength; + t1 = _this._start; + if (endOrLength == null) + return A.SubListIterable$(_this.__internal$_iterable, t1, B.JSInt_methods.$add(t1, count), _this.$ti._precomputed1); + else { + newEnd = B.JSInt_methods.$add(t1, count); + if (endOrLength < newEnd) + return _this; + return A.SubListIterable$(_this.__internal$_iterable, t1, newEnd, _this.$ti._precomputed1); + } + }, + toList$1$growable(_, growable) { + var $length, result, i, _this = this, + start = _this._start, + t1 = _this.__internal$_iterable, + t2 = J.getInterceptor$asx(t1), + end = t2.get$length(t1), + endOrLength = _this._endOrLength; + if (endOrLength != null && endOrLength < end) + end = endOrLength; + $length = end - start; + if ($length <= 0) { + t1 = J.JSArray_JSArray$fixed(0, _this.$ti._precomputed1); + return t1; + } + result = A.List_List$filled($length, t2.elementAt$1(t1, start), false, _this.$ti._precomputed1); + for (i = 1; i < $length; ++i) { + B.JSArray_methods.$indexSet(result, i, t2.elementAt$1(t1, start + i)); + if (t2.get$length(t1) < end) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return result; + } + }; + A.ListIterator.prototype = { + get$current() { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t3, _this = this, + t1 = _this.__internal$_iterable, + t2 = J.getInterceptor$asx(t1), + $length = t2.get$length(t1); + if (_this.__internal$_length !== $length) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + t3 = _this.__internal$_index; + if (t3 >= $length) { + _this.set$__internal$_current(null); + return false; + } + _this.set$__internal$_current(t2.elementAt$1(t1, t3)); + ++_this.__internal$_index; + return true; + }, + set$__internal$_current(_current) { + this.__internal$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.MappedIterable.prototype = { + get$iterator(_) { + var t1 = A._instanceType(this); + return new A.MappedIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("MappedIterator<1,2>")); + }, + get$length(_) { + return J.get$length$asx(this.__internal$_iterable); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.__internal$_iterable); + }, + get$first(_) { + return this._f.call$1(J.get$first$ax(this.__internal$_iterable)); + }, + get$last(_) { + return this._f.call$1(J.get$last$ax(this.__internal$_iterable)); + }, + elementAt$1(_, index) { + return this._f.call$1(J.elementAt$1$ax(this.__internal$_iterable, index)); + } + }; + A.EfficientLengthMappedIterable.prototype = {$isEfficientLengthIterable: 1}; + A.MappedIterator.prototype = { + moveNext$0() { + var _this = this, + t1 = _this._iterator; + if (t1.moveNext$0()) { + _this.set$__internal$_current(_this._f.call$1(t1.get$current())); + return true; + } + _this.set$__internal$_current(null); + return false; + }, + get$current() { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + set$__internal$_current(_current) { + this.__internal$_current = this.$ti._eval$1("2?")._as(_current); + }, + $isIterator: 1 + }; + A.MappedListIterable.prototype = { + get$length(_) { + return J.get$length$asx(this._source); + }, + elementAt$1(_, index) { + return this._f.call$1(J.elementAt$1$ax(this._source, index)); + } + }; + A.WhereIterable.prototype = { + get$iterator(_) { + return new A.WhereIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, this.$ti._eval$1("WhereIterator<1>")); + }, + map$1$1(_, toElement, $T) { + var t1 = this.$ti; + return new A.MappedIterable(this, t1._bind$1($T)._eval$1("1(2)")._as(toElement), t1._eval$1("@<1>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + } + }; + A.WhereIterator.prototype = { + moveNext$0() { + var t1, t2; + for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();) + if (A.boolConversionCheck(t2.call$1(t1.get$current()))) + return true; + return false; + }, + get$current() { + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.ExpandIterable.prototype = { + get$iterator(_) { + var t1 = this.$ti; + return new A.ExpandIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, B.C_EmptyIterator, t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("ExpandIterator<1,2>")); + } + }; + A.ExpandIterator.prototype = { + get$current() { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + moveNext$0() { + var t1, t2, _this = this; + if (_this._currentExpansion == null) + return false; + for (t1 = _this._iterator, t2 = _this._f; !_this._currentExpansion.moveNext$0();) { + _this.set$__internal$_current(null); + if (t1.moveNext$0()) { + _this.set$_currentExpansion(null); + _this.set$_currentExpansion(J.get$iterator$ax(t2.call$1(t1.get$current()))); + } else + return false; + } + _this.set$__internal$_current(_this._currentExpansion.get$current()); + return true; + }, + set$_currentExpansion(_currentExpansion) { + this._currentExpansion = this.$ti._eval$1("Iterator<2>?")._as(_currentExpansion); + }, + set$__internal$_current(_current) { + this.__internal$_current = this.$ti._eval$1("2?")._as(_current); + }, + $isIterator: 1 + }; + A.TakeIterable.prototype = { + get$iterator(_) { + var t1 = J.get$iterator$ax(this.__internal$_iterable), + t2 = this._takeCount; + A.assertHelper(t2 >= 0); + return new A.TakeIterator(t1, t2, A._instanceType(this)._eval$1("TakeIterator<1>")); + } + }; + A.EfficientLengthTakeIterable.prototype = { + get$length(_) { + var iterableLength = J.get$length$asx(this.__internal$_iterable), + t1 = this._takeCount; + if (iterableLength > t1) + return t1; + return iterableLength; + }, + $isEfficientLengthIterable: 1 + }; + A.TakeIterator.prototype = { + moveNext$0() { + if (--this._remaining >= 0) + return this._iterator.moveNext$0(); + this._remaining = -1; + return false; + }, + get$current() { + if (this._remaining < 0) { + this.$ti._precomputed1._as(null); + return null; + } + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.SkipIterable.prototype = { + skip$1(_, count) { + A.ArgumentError_checkNotNull(count, "count", type$.int); + A.RangeError_checkNotNegative(count, "count"); + return new A.SkipIterable(this.__internal$_iterable, this._skipCount + count, A._instanceType(this)._eval$1("SkipIterable<1>")); + }, + get$iterator(_) { + var t1 = J.get$iterator$ax(this.__internal$_iterable), + t2 = this._skipCount; + A.assertHelper(t2 >= 0); + return new A.SkipIterator(t1, t2, A._instanceType(this)._eval$1("SkipIterator<1>")); + } + }; + A.EfficientLengthSkipIterable.prototype = { + get$length(_) { + var $length = J.get$length$asx(this.__internal$_iterable) - this._skipCount; + if ($length >= 0) + return $length; + return 0; + }, + skip$1(_, count) { + A.ArgumentError_checkNotNull(count, "count", type$.int); + A.RangeError_checkNotNegative(count, "count"); + return new A.EfficientLengthSkipIterable(this.__internal$_iterable, this._skipCount + count, this.$ti); + }, + $isEfficientLengthIterable: 1 + }; + A.SkipIterator.prototype = { + moveNext$0() { + var t1, i; + for (t1 = this._iterator, i = 0; i < this._skipCount; ++i) + t1.moveNext$0(); + this._skipCount = 0; + return t1.moveNext$0(); + }, + get$current() { + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.SkipWhileIterable.prototype = { + get$iterator(_) { + return new A.SkipWhileIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, this.$ti._eval$1("SkipWhileIterator<1>")); + } + }; + A.SkipWhileIterator.prototype = { + moveNext$0() { + var t1, t2, _this = this; + if (!_this._hasSkipped) { + _this._hasSkipped = true; + for (t1 = _this._iterator, t2 = _this._f; t1.moveNext$0();) + if (!A.boolConversionCheck(t2.call$1(t1.get$current()))) + return true; + } + return _this._iterator.moveNext$0(); + }, + get$current() { + return this._iterator.get$current(); + }, + $isIterator: 1 + }; + A.EmptyIterable.prototype = { + get$iterator(_) { + return B.C_EmptyIterator; + }, + get$isEmpty(_) { + return true; + }, + get$length(_) { + return 0; + }, + get$first(_) { + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$last(_) { + throw A.wrapException(A.IterableElementError_noElement()); + }, + elementAt$1(_, index) { + throw A.wrapException(A.RangeError$range(index, 0, 0, "index", null)); + }, + map$1$1(_, toElement, $T) { + this.$ti._bind$1($T)._eval$1("1(2)")._as(toElement); + return new A.EmptyIterable($T._eval$1("EmptyIterable<0>")); + }, + skip$1(_, count) { + A.RangeError_checkNotNegative(count, "count"); + return this; + }, + take$1(_, count) { + A.RangeError_checkNotNegative(count, "count"); + return this; + } + }; + A.EmptyIterator.prototype = { + moveNext$0() { + return false; + }, + get$current() { + throw A.wrapException(A.IterableElementError_noElement()); + }, + $isIterator: 1 + }; + A.WhereTypeIterable.prototype = { + get$iterator(_) { + return new A.WhereTypeIterator(J.get$iterator$ax(this._source), this.$ti._eval$1("WhereTypeIterator<1>")); + } + }; + A.WhereTypeIterator.prototype = { + moveNext$0() { + var t1, t2; + for (t1 = this._source, t2 = this.$ti._precomputed1; t1.moveNext$0();) + if (t2._is(t1.get$current())) + return true; + return false; + }, + get$current() { + return this.$ti._precomputed1._as(this._source.get$current()); + }, + $isIterator: 1 + }; + A.FixedLengthListMixin.prototype = {}; + A.UnmodifiableListMixin.prototype = { + $indexSet(_, index, value) { + A._instanceType(this)._eval$1("UnmodifiableListMixin.E")._as(value); + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + }, + setRange$4(_, start, end, iterable, skipCount) { + A._instanceType(this)._eval$1("Iterable")._as(iterable); + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + }, + setRange$3(_, start, end, iterable) { + return this.setRange$4(0, start, end, iterable, 0); + } + }; + A.UnmodifiableListBase.prototype = {}; + A.ReversedListIterable.prototype = { + get$length(_) { + return J.get$length$asx(this._source); + }, + elementAt$1(_, index) { + var t1 = this._source, + t2 = J.getInterceptor$asx(t1); + return t2.elementAt$1(t1, t2.get$length(t1) - 1 - index); + } + }; + A.Symbol.prototype = { + get$hashCode(_) { + var hash = this._hashCode; + if (hash != null) + return hash; + hash = 664597 * B.JSString_methods.get$hashCode(this.__internal$_name) & 536870911; + this._hashCode = hash; + return hash; + }, + toString$0(_) { + return 'Symbol("' + this.__internal$_name + '")'; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Symbol && this.__internal$_name === other.__internal$_name; + }, + $isSymbol0: 1 + }; + A.__CastListBase__CastIterableBase_ListMixin.prototype = {}; + A._Record_2.prototype = {$recipe: "+(1,2)", $shape: 1}; + A._Record_2_file_outFlags.prototype = {$recipe: "+file,outFlags(1,2)", $shape: 2}; + A.ConstantMapView.prototype = {}; + A.ConstantMap.prototype = { + toString$0(_) { + return A.MapBase_mapToString(this); + }, + get$entries() { + return new A._SyncStarIterable(this.entries$body$ConstantMap(), A._instanceType(this)._eval$1("_SyncStarIterable>")); + }, + entries$body$ConstantMap() { + var $async$self = this; + return function() { + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, t2, t3, key, t4; + return function $async$get$entries($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.get$keys(), t1 = t1.get$iterator(t1), t2 = A._instanceType($async$self), t3 = t2._rest[1], t2 = t2._eval$1("@<1>")._bind$1(t3)._eval$1("MapEntry<1,2>"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + key = t1.get$current(); + t4 = $async$self.$index(0, key); + $async$goto = 4; + return $async$iterator._async$_current = new A.MapEntry(key, t4 == null ? t3._as(t4) : t4, t2), 1; + case 4: + // after yield + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + $isMap: 1 + }; + A.ConstantStringMap.prototype = { + get$length(_) { + return this._values.length; + }, + get$_keys() { + var keys = this.$keys; + if (keys == null) { + keys = Object.keys(this._jsIndex); + this.$keys = keys; + } + return keys; + }, + containsKey$1(key) { + if (typeof key != "string") + return false; + if ("__proto__" === key) + return false; + return this._jsIndex.hasOwnProperty(key); + }, + $index(_, key) { + if (!this.containsKey$1(key)) + return null; + return this._values[this._jsIndex[key]]; + }, + forEach$1(_, f) { + var keys, values, t1, i; + this.$ti._eval$1("~(1,2)")._as(f); + keys = this.get$_keys(); + values = this._values; + for (t1 = keys.length, i = 0; i < t1; ++i) + f.call$2(keys[i], values[i]); + }, + get$keys() { + return new A._KeysOrValues(this.get$_keys(), this.$ti._eval$1("_KeysOrValues<1>")); + }, + get$values() { + return new A._KeysOrValues(this._values, this.$ti._eval$1("_KeysOrValues<2>")); + } + }; + A._KeysOrValues.prototype = { + get$length(_) { + return this._elements.length; + }, + get$isEmpty(_) { + return 0 === this._elements.length; + }, + get$iterator(_) { + var t1 = this._elements; + return new A._KeysOrValuesOrElementsIterator(t1, t1.length, this.$ti._eval$1("_KeysOrValuesOrElementsIterator<1>")); + } + }; + A._KeysOrValuesOrElementsIterator.prototype = { + get$current() { + var t1 = this.__js_helper$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + t1 = _this.__js_helper$_index; + if (t1 >= _this.__js_helper$_length) { + _this.set$__js_helper$_current(null); + return false; + } + _this.set$__js_helper$_current(_this._elements[t1]); + ++_this.__js_helper$_index; + return true; + }, + set$__js_helper$_current(_current) { + this.__js_helper$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.Instantiation.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Instantiation1 && this._genericClosure.$eq(0, other._genericClosure) && A.getRuntimeTypeOfClosure(this) === A.getRuntimeTypeOfClosure(other); + }, + get$hashCode(_) { + return A.Object_hash(this._genericClosure, A.getRuntimeTypeOfClosure(this), B.C_SentinelValue, B.C_SentinelValue); + }, + toString$0(_) { + var t1 = B.JSArray_methods.join$1([A.createRuntimeType(this.$ti._precomputed1)], ", "); + return this._genericClosure.toString$0(0) + " with " + ("<" + t1 + ">"); + } + }; + A.Instantiation1.prototype = { + call$2(a0, a1) { + return this._genericClosure.call$1$2(a0, a1, this.$ti._rest[0]); + }, + call$4(a0, a1, a2, a3) { + return this._genericClosure.call$1$4(a0, a1, a2, a3, this.$ti._rest[0]); + }, + $signature() { + return A.instantiatedGenericFunctionType(A.closureFunctionType(this._genericClosure), this.$ti); + } + }; + A.JSInvocationMirror.prototype = { + get$memberName() { + var t1 = this._memberName; + if (t1 instanceof A.Symbol) + return t1; + return this._memberName = new A.Symbol(A._asString(t1)); + }, + get$positionalArguments() { + var t1, t2, argumentCount, list, index, _this = this; + if (_this.__js_helper$_kind === 1) + return B.List_empty0; + t1 = _this._arguments; + t2 = J.getInterceptor$asx(t1); + argumentCount = t2.get$length(t1) - J.get$length$asx(_this._namedArgumentNames) - _this._typeArgumentCount; + if (argumentCount === 0) + return B.List_empty0; + list = []; + for (index = 0; index < argumentCount; ++index) + list.push(t2.$index(t1, index)); + return J.JSArray_markUnmodifiableList(list); + }, + get$namedArguments() { + var t1, t2, namedArgumentCount, t3, t4, namedArgumentsStartIndex, map, i, _this = this; + if (_this.__js_helper$_kind !== 0) + return B.Map_empty; + t1 = _this._namedArgumentNames; + t2 = J.getInterceptor$asx(t1); + namedArgumentCount = t2.get$length(t1); + t3 = _this._arguments; + t4 = J.getInterceptor$asx(t3); + namedArgumentsStartIndex = t4.get$length(t3) - namedArgumentCount - _this._typeArgumentCount; + if (namedArgumentCount === 0) + return B.Map_empty; + map = new A.JsLinkedHashMap(type$.JsLinkedHashMap_Symbol_dynamic); + for (i = 0; i < namedArgumentCount; ++i) + map.$indexSet(0, new A.Symbol(A._asString(t2.$index(t1, i))), t4.$index(t3, namedArgumentsStartIndex + i)); + return new A.ConstantMapView(map, type$.ConstantMapView_Symbol_dynamic); + }, + $isInvocation: 1 + }; + A.Primitives_functionNoSuchMethod_closure.prototype = { + call$2($name, argument) { + var t1; + A._asString($name); + t1 = this._box_0; + t1.names = t1.names + "$" + $name; + B.JSArray_methods.add$1(this.namedArgumentList, $name); + B.JSArray_methods.add$1(this.$arguments, argument); + ++t1.argumentCount; + }, + $signature: 77 + }; + A.TypeErrorDecoder.prototype = { + matchTypeError$1(message) { + var result, t1, _this = this, + match = new RegExp(_this._pattern).exec(message); + if (match == null) + return null; + result = Object.create(null); + t1 = _this._arguments; + if (t1 !== -1) + result.arguments = match[t1 + 1]; + t1 = _this._argumentsExpr; + if (t1 !== -1) + result.argumentsExpr = match[t1 + 1]; + t1 = _this._expr; + if (t1 !== -1) + result.expr = match[t1 + 1]; + t1 = _this._method; + if (t1 !== -1) + result.method = match[t1 + 1]; + t1 = _this._receiver; + if (t1 !== -1) + result.receiver = match[t1 + 1]; + return result; + } + }; + A.NullError.prototype = { + toString$0(_) { + return "Null check operator used on a null value"; + } + }; + A.JsNoSuchMethodError.prototype = { + toString$0(_) { + var t2, _this = this, + _s38_ = "NoSuchMethodError: method not found: '", + t1 = _this._method; + if (t1 == null) + return "NoSuchMethodError: " + _this.__js_helper$_message; + t2 = _this._receiver; + if (t2 == null) + return _s38_ + t1 + "' (" + _this.__js_helper$_message + ")"; + return _s38_ + t1 + "' on '" + t2 + "' (" + _this.__js_helper$_message + ")"; + } + }; + A.UnknownJsTypeError.prototype = { + toString$0(_) { + var t1 = this.__js_helper$_message; + return t1.length === 0 ? "Error" : "Error: " + t1; + } + }; + A.NullThrownFromJavaScriptException.prototype = { + toString$0(_) { + return "Throw of null ('" + (this._irritant === null ? "null" : "undefined") + "' from JavaScript)"; + }, + $isException: 1 + }; + A.ExceptionAndStackTrace.prototype = {}; + A._StackTrace.prototype = { + toString$0(_) { + var trace, + t1 = this._trace; + if (t1 != null) + return t1; + t1 = this._exception; + trace = t1 !== null && typeof t1 === "object" ? t1.stack : null; + return this._trace = trace == null ? "" : trace; + }, + $isStackTrace: 1 + }; + A.Closure.prototype = { + toString$0(_) { + var $constructor = this.constructor, + $name = $constructor == null ? null : $constructor.name; + return "Closure '" + A.unminifyOrTag($name == null ? "unknown" : $name) + "'"; + }, + $isFunction: 1, + get$$call() { + return this; + }, + "call*": "call$1", + $requiredArgCount: 1, + $defaultValues: null + }; + A.Closure0Args.prototype = {"call*": "call$0", $requiredArgCount: 0}; + A.Closure2Args.prototype = {"call*": "call$2", $requiredArgCount: 2}; + A.TearOffClosure.prototype = {}; + A.StaticClosure.prototype = { + toString$0(_) { + var $name = this.$static_name; + if ($name == null) + return "Closure of unknown static method"; + return "Closure '" + A.unminifyOrTag($name) + "'"; + } + }; + A.BoundClosure.prototype = { + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + if (!(other instanceof A.BoundClosure)) + return false; + return this.$_target === other.$_target && this._receiver === other._receiver; + }, + get$hashCode(_) { + return (A.objectHashCode(this._receiver) ^ A.Primitives_objectHashCode(this.$_target)) >>> 0; + }, + toString$0(_) { + return "Closure '" + this.$_name + "' of " + ("Instance of '" + A.Primitives_objectTypeName(this._receiver) + "'"); + } + }; + A._CyclicInitializationError.prototype = { + toString$0(_) { + return "Reading static variable '" + this.variableName + "' during its initialization"; + } + }; + A.RuntimeError.prototype = { + toString$0(_) { + return "RuntimeError: " + this.message; + } + }; + A._AssertionError.prototype = { + toString$0(_) { + return "Assertion failed: " + A.Error_safeToString(this.message); + } + }; + A._Required.prototype = {}; + A.assertInteropArgs_closure.prototype = { + call$1(arg) { + return !type$.Function._is(arg) || typeof arg == "function"; + }, + $signature: 39 + }; + A.JsLinkedHashMap.prototype = { + get$length(_) { + return this.__js_helper$_length; + }, + get$isEmpty(_) { + return this.__js_helper$_length === 0; + }, + get$keys() { + return new A.LinkedHashMapKeyIterable(this, A._instanceType(this)._eval$1("LinkedHashMapKeyIterable<1>")); + }, + get$values() { + var t1 = A._instanceType(this); + return A.MappedIterable_MappedIterable(new A.LinkedHashMapKeyIterable(this, t1._eval$1("LinkedHashMapKeyIterable<1>")), new A.JsLinkedHashMap_values_closure(this), t1._precomputed1, t1._rest[1]); + }, + containsKey$1(key) { + var strings, nums; + if (typeof key == "string") { + strings = this._strings; + if (strings == null) + return false; + return strings[key] != null; + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = this._nums; + if (nums == null) + return false; + return nums[key] != null; + } else + return this.internalContainsKey$1(key); + }, + internalContainsKey$1(key) { + var rest = this.__js_helper$_rest; + if (rest == null) + return false; + return this.internalFindBucketIndex$2(rest[this.internalComputeHashCode$1(key)], key) >= 0; + }, + addAll$1(_, other) { + A._instanceType(this)._eval$1("Map<1,2>")._as(other).forEach$1(0, new A.JsLinkedHashMap_addAll_closure(this)); + }, + $index(_, key) { + var strings, cell, t1, nums, _null = null; + if (typeof key == "string") { + strings = this._strings; + if (strings == null) + return _null; + cell = strings[key]; + t1 = cell == null ? _null : cell.hashMapCellValue; + return t1; + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = this._nums; + if (nums == null) + return _null; + cell = nums[key]; + t1 = cell == null ? _null : cell.hashMapCellValue; + return t1; + } else + return this.internalGet$1(key); + }, + internalGet$1(key) { + var bucket, index, + rest = this.__js_helper$_rest; + if (rest == null) + return null; + bucket = rest[this.internalComputeHashCode$1(key)]; + index = this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return null; + return bucket[index].hashMapCellValue; + }, + $indexSet(_, key, value) { + var strings, nums, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + if (typeof key == "string") { + strings = _this._strings; + _this._addHashTableEntry$3(strings == null ? _this._strings = _this._newHashTable$0() : strings, key, value); + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = _this._nums; + _this._addHashTableEntry$3(nums == null ? _this._nums = _this._newHashTable$0() : nums, key, value); + } else + _this.internalSet$2(key, value); + }, + internalSet$2(key, value) { + var rest, hash, bucket, index, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + rest = _this.__js_helper$_rest; + if (rest == null) + rest = _this.__js_helper$_rest = _this._newHashTable$0(); + hash = _this.internalComputeHashCode$1(key); + bucket = rest[hash]; + if (bucket == null) { + t1 = [_this._newLinkedCell$2(key, value)]; + A.assertHelper(t1 != null); + rest[hash] = t1; + } else { + index = _this.internalFindBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index].hashMapCellValue = value; + else + bucket.push(_this._newLinkedCell$2(key, value)); + } + }, + putIfAbsent$2(key, ifAbsent) { + var t2, value, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._eval$1("2()")._as(ifAbsent); + if (_this.containsKey$1(key)) { + t2 = _this.$index(0, key); + return t2 == null ? t1._rest[1]._as(t2) : t2; + } + value = ifAbsent.call$0(); + _this.$indexSet(0, key, value); + return value; + }, + remove$1(_, key) { + var _this = this; + if (typeof key == "string") + return _this.__js_helper$_removeHashTableEntry$2(_this._strings, key); + else if (typeof key == "number" && (key & 0x3fffffff) === key) + return _this.__js_helper$_removeHashTableEntry$2(_this._nums, key); + else + return _this.internalRemove$1(key); + }, + internalRemove$1(key) { + var hash, bucket, index, cell, _this = this, + rest = _this.__js_helper$_rest; + if (rest == null) + return null; + hash = _this.internalComputeHashCode$1(key); + bucket = rest[hash]; + index = _this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return null; + cell = bucket.splice(index, 1)[0]; + _this.__js_helper$_unlinkCell$1(cell); + if (bucket.length === 0) + delete rest[hash]; + return cell.hashMapCellValue; + }, + clear$0(_) { + var _this = this; + if (_this.__js_helper$_length > 0) { + _this._strings = _this._nums = _this.__js_helper$_rest = _this._first = _this.__js_helper$_last = null; + _this.__js_helper$_length = 0; + _this._modified$0(); + } + }, + forEach$1(_, action) { + var cell, modifications, _this = this; + A._instanceType(_this)._eval$1("~(1,2)")._as(action); + cell = _this._first; + modifications = _this._modifications; + for (; cell != null;) { + action.call$2(cell.hashMapCellKey, cell.hashMapCellValue); + if (modifications !== _this._modifications) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + cell = cell._next; + } + }, + _addHashTableEntry$3(table, key, value) { + var cell, + t1 = A._instanceType(this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + cell = table[key]; + if (cell == null) + table[key] = this._newLinkedCell$2(key, value); + else + cell.hashMapCellValue = value; + }, + __js_helper$_removeHashTableEntry$2(table, key) { + var cell; + if (table == null) + return null; + cell = table[key]; + if (cell == null) + return null; + this.__js_helper$_unlinkCell$1(cell); + delete table[key]; + return cell.hashMapCellValue; + }, + _modified$0() { + this._modifications = this._modifications + 1 & 1073741823; + }, + _newLinkedCell$2(key, value) { + var _this = this, + t1 = A._instanceType(_this), + cell = new A.LinkedHashMapCell(t1._precomputed1._as(key), t1._rest[1]._as(value)); + if (_this._first == null) + _this._first = _this.__js_helper$_last = cell; + else { + t1 = _this.__js_helper$_last; + t1.toString; + cell._previous = t1; + _this.__js_helper$_last = t1._next = cell; + } + ++_this.__js_helper$_length; + _this._modified$0(); + return cell; + }, + __js_helper$_unlinkCell$1(cell) { + var _this = this, + previous = cell._previous, + next = cell._next; + if (previous == null) { + A.assertHelper(cell === _this._first); + _this._first = next; + } else + previous._next = next; + if (next == null) { + A.assertHelper(cell === _this.__js_helper$_last); + _this.__js_helper$_last = previous; + } else + next._previous = previous; + --_this.__js_helper$_length; + _this._modified$0(); + }, + internalComputeHashCode$1(key) { + return J.get$hashCode$(key) & 1073741823; + }, + internalFindBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i].hashMapCellKey, key)) + return i; + return -1; + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + _newHashTable$0() { + var table = Object.create(null); + A.assertHelper(table != null); + table[""] = table; + delete table[""]; + return table; + }, + $isLinkedHashMap: 1 + }; + A.JsLinkedHashMap_values_closure.prototype = { + call$1(each) { + var t1 = this.$this, + t2 = A._instanceType(t1); + t1 = t1.$index(0, t2._precomputed1._as(each)); + return t1 == null ? t2._rest[1]._as(t1) : t1; + }, + $signature() { + return A._instanceType(this.$this)._eval$1("2(1)"); + } + }; + A.JsLinkedHashMap_addAll_closure.prototype = { + call$2(key, value) { + var t1 = this.$this, + t2 = A._instanceType(t1); + t1.$indexSet(0, t2._precomputed1._as(key), t2._rest[1]._as(value)); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(1,2)"); + } + }; + A.LinkedHashMapCell.prototype = {}; + A.LinkedHashMapKeyIterable.prototype = { + get$length(_) { + return this._map.__js_helper$_length; + }, + get$isEmpty(_) { + return this._map.__js_helper$_length === 0; + }, + get$iterator(_) { + var t1 = this._map, + t2 = new A.LinkedHashMapKeyIterator(t1, t1._modifications, this.$ti._eval$1("LinkedHashMapKeyIterator<1>")); + t2._cell = t1._first; + return t2; + } + }; + A.LinkedHashMapKeyIterator.prototype = { + get$current() { + return this.__js_helper$_current; + }, + moveNext$0() { + var cell, _this = this, + t1 = _this._map; + if (_this._modifications !== t1._modifications) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + cell = _this._cell; + if (cell == null) { + _this.set$__js_helper$_current(null); + return false; + } else { + _this.set$__js_helper$_current(cell.hashMapCellKey); + _this._cell = cell._next; + return true; + } + }, + set$__js_helper$_current(_current) { + this.__js_helper$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.initHooks_closure.prototype = { + call$1(o) { + return this.getTag(o); + }, + $signature: 44 + }; + A.initHooks_closure0.prototype = { + call$2(o, tag) { + return this.getUnknownTag(o, tag); + }, + $signature: 38 + }; + A.initHooks_closure1.prototype = { + call$1(tag) { + return this.prototypeForTag(A._asString(tag)); + }, + $signature: 110 + }; + A._Record.prototype = { + toString$0(_) { + return this._toString$1(false); + }, + _toString$1(safe) { + var t2, separator, i, key, value, + keys = this._fieldKeys$0(), + values = this._getFieldValues$0(), + t1 = keys.length; + A.assertHelper(t1 === values.length); + t2 = (safe ? "" + "Record " : "") + "("; + for (separator = "", i = 0; i < t1; ++i, separator = ", ") { + t2 += separator; + key = keys[i]; + if (typeof key == "string") + t2 = t2 + key + ": "; + if (!(i < values.length)) + return A.ioore(values, i); + value = values[i]; + t2 = safe ? t2 + A.Primitives_safeToString(value) : t2 + A.S(value); + } + t1 = t2 + ")"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _fieldKeys$0() { + var t1, + shapeTag = this.$shape; + for (; $._Record__computedFieldKeys.length <= shapeTag;) + B.JSArray_methods.add$1($._Record__computedFieldKeys, null); + t1 = $._Record__computedFieldKeys[shapeTag]; + if (t1 == null) { + t1 = this._computeFieldKeys$0(); + B.JSArray_methods.$indexSet($._Record__computedFieldKeys, shapeTag, t1); + } + return t1; + }, + _computeFieldKeys$0() { + var i, names, last, + recipe = this.$recipe, + position = recipe.indexOf("("), + joinedNames = recipe.substring(1, position), + fields = recipe.substring(position), + arity = fields === "()" ? 0 : fields.replace(/[^,]/g, "").length + 1, + t1 = type$.Object, + result = J.JSArray_JSArray$allocateGrowable(arity, t1); + for (i = 0; i < arity; ++i) + result[i] = i; + if (joinedNames !== "") { + names = joinedNames.split(","); + i = names.length; + for (last = arity; i > 0;) { + --last; + --i; + B.JSArray_methods.$indexSet(result, last, names[i]); + } + } + return A.List_List$unmodifiable(result, t1); + } + }; + A._Record2.prototype = { + _getFieldValues$0() { + return [this._0, this._1]; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A._Record2 && this.$shape === other.$shape && J.$eq$(this._0, other._0) && J.$eq$(this._1, other._1); + }, + get$hashCode(_) { + return A.Object_hash(this.$shape, this._0, this._1, B.C_SentinelValue); + } + }; + A.JSSyntaxRegExp.prototype = { + toString$0(_) { + return "RegExp/" + this.pattern + "/" + this._nativeRegExp.flags; + }, + get$_nativeGlobalVersion() { + var _this = this, + t1 = _this._nativeGlobalRegExp; + if (t1 != null) + return t1; + t1 = _this._nativeRegExp; + return _this._nativeGlobalRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern, t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); + }, + get$_nativeAnchoredVersion() { + var _this = this, + t1 = _this._nativeAnchoredRegExp; + if (t1 != null) + return t1; + t1 = _this._nativeRegExp; + return _this._nativeAnchoredRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern + "|()", t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); + }, + firstMatch$1(string) { + var m = this._nativeRegExp.exec(string); + if (m == null) + return null; + return A._MatchImplementation$(this, m); + }, + allMatches$2(_, string, start) { + var t1 = string.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, null, null)); + return new A._AllMatchesIterable(this, string, start); + }, + allMatches$1(_, string) { + return this.allMatches$2(0, string, 0); + }, + _execGlobal$2(string, start) { + var match, + regexp = this.get$_nativeGlobalVersion(); + if (regexp == null) + regexp = type$.Object._as(regexp); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return null; + return A._MatchImplementation$(this, match); + }, + _execAnchored$2(string, start) { + var match, + regexp = this.get$_nativeAnchoredVersion(); + if (regexp == null) + regexp = type$.Object._as(regexp); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return null; + if (0 >= match.length) + return A.ioore(match, -1); + if (match.pop() != null) + return null; + return A._MatchImplementation$(this, match); + }, + matchAsPrefix$2(_, string, start) { + if (start < 0 || start > string.length) + throw A.wrapException(A.RangeError$range(start, 0, string.length, null, null)); + return this._execAnchored$2(string, start); + }, + $isPattern: 1, + $isRegExp: 1 + }; + A._MatchImplementation.prototype = { + get$start() { + return this._match.index; + }, + get$end() { + var t1 = this._match; + return t1.index + t1[0].length; + }, + $index(_, index) { + var t1 = this._match; + if (!(index < t1.length)) + return A.ioore(t1, index); + return t1[index]; + }, + $isMatch: 1, + $isRegExpMatch: 1 + }; + A._AllMatchesIterable.prototype = { + get$iterator(_) { + return new A._AllMatchesIterator(this._re, this._string, this.__js_helper$_start); + } + }; + A._AllMatchesIterator.prototype = { + get$current() { + var t1 = this.__js_helper$_current; + return t1 == null ? type$.RegExpMatch._as(t1) : t1; + }, + moveNext$0() { + var t1, t2, t3, match, nextIndex, _this = this, + string = _this._string; + if (string == null) + return false; + t1 = _this._nextIndex; + t2 = string.length; + if (t1 <= t2) { + t3 = _this._regExp; + match = t3._execGlobal$2(string, t1); + if (match != null) { + _this.__js_helper$_current = match; + nextIndex = match.get$end(); + if (match._match.index === nextIndex) { + if (t3._nativeRegExp.unicode) { + t1 = _this._nextIndex; + t3 = t1 + 1; + if (t3 < t2) { + if (!(t1 >= 0 && t1 < t2)) + return A.ioore(string, t1); + t1 = string.charCodeAt(t1); + if (t1 >= 55296 && t1 <= 56319) { + if (!(t3 >= 0)) + return A.ioore(string, t3); + t1 = string.charCodeAt(t3); + t1 = t1 >= 56320 && t1 <= 57343; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + nextIndex = (t1 ? nextIndex + 1 : nextIndex) + 1; + } + _this._nextIndex = nextIndex; + return true; + } + } + _this._string = _this.__js_helper$_current = null; + return false; + }, + $isIterator: 1 + }; + A.StringMatch.prototype = { + get$end() { + return this.start + this.pattern.length; + }, + $index(_, g) { + if (g !== 0) + A.throwExpression(A.RangeError$value(g, null)); + return this.pattern; + }, + $isMatch: 1, + get$start() { + return this.start; + } + }; + A._StringAllMatchesIterable.prototype = { + get$iterator(_) { + return new A._StringAllMatchesIterator(this._input, this._pattern, this.__js_helper$_index); + }, + get$first(_) { + var t1 = this._pattern, + index = this._input.indexOf(t1, this.__js_helper$_index); + if (index >= 0) + return new A.StringMatch(index, t1); + throw A.wrapException(A.IterableElementError_noElement()); + } + }; + A._StringAllMatchesIterator.prototype = { + moveNext$0() { + var index, end, _this = this, + t1 = _this.__js_helper$_index, + t2 = _this._pattern, + t3 = t2.length, + t4 = _this._input, + t5 = t4.length; + if (t1 + t3 > t5) { + _this.__js_helper$_current = null; + return false; + } + index = t4.indexOf(t2, t1); + if (index < 0) { + _this.__js_helper$_index = t5 + 1; + _this.__js_helper$_current = null; + return false; + } + end = index + t3; + _this.__js_helper$_current = new A.StringMatch(index, t2); + _this.__js_helper$_index = end === _this.__js_helper$_index ? end + 1 : end; + return true; + }, + get$current() { + var t1 = this.__js_helper$_current; + t1.toString; + return t1; + }, + $isIterator: 1 + }; + A._Cell.prototype = { + _readField$0() { + var t1 = this._value; + if (t1 === this) + throw A.wrapException(A.LateError$fieldNI(this._name)); + return t1; + } + }; + A.NativeByteBuffer.prototype = { + get$runtimeType(receiver) { + return B.Type_ByteBuffer_EOZ; + }, + $isTrustedGetRuntimeType: 1, + $isNativeByteBuffer: 1, + $isByteBuffer: 1 + }; + A.NativeTypedData.prototype = { + _invalidPosition$3(receiver, position, $length, $name) { + var t1 = A.RangeError$range(position, 0, $length, $name, null); + throw A.wrapException(t1); + }, + _checkPosition$3(receiver, position, $length, $name) { + if (position >>> 0 !== position || position > $length) + this._invalidPosition$3(receiver, position, $length, $name); + } + }; + A.NativeByteData.prototype = { + get$runtimeType(receiver) { + return B.Type_ByteData_mF8; + }, + _getInt32$2(receiver, byteOffset, littleEndian) { + return receiver.getInt32(byteOffset, littleEndian); + }, + _getUint32$2(receiver, byteOffset, littleEndian) { + return receiver.getUint32(byteOffset, littleEndian); + }, + _setFloat64$3(receiver, byteOffset, value, littleEndian) { + return receiver.setFloat64(byteOffset, value, littleEndian); + }, + _setInt32$3(receiver, byteOffset, value, littleEndian) { + return receiver.setInt32(byteOffset, value, littleEndian); + }, + _setUint32$3(receiver, byteOffset, value, littleEndian) { + return receiver.setUint32(byteOffset, value, littleEndian); + }, + $isTrustedGetRuntimeType: 1, + $isNativeByteData: 1, + $isByteData: 1 + }; + A.NativeTypedArray.prototype = { + get$length(receiver) { + return receiver.length; + }, + _setRangeFast$4(receiver, start, end, source, skipCount) { + var count, sourceLength, + targetLength = receiver.length; + this._checkPosition$3(receiver, start, targetLength, "start"); + this._checkPosition$3(receiver, end, targetLength, "end"); + if (start > end) + throw A.wrapException(A.RangeError$range(start, 0, end, null, null)); + count = end - start; + if (skipCount < 0) + throw A.wrapException(A.ArgumentError$(skipCount, null)); + sourceLength = source.length; + if (sourceLength - skipCount < count) + throw A.wrapException(A.StateError$("Not enough elements")); + if (skipCount !== 0 || sourceLength !== count) + source = source.subarray(skipCount, skipCount + count); + receiver.set(source, start); + }, + $isJSIndexable: 1, + $isJavaScriptIndexingBehavior: 1 + }; + A.NativeTypedArrayOfDouble.prototype = { + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $indexSet(receiver, index, value) { + A._asDouble(value); + A._checkValidIndex(index, receiver, receiver.length); + receiver[index] = value; + }, + setRange$4(receiver, start, end, iterable, skipCount) { + type$.Iterable_double._as(iterable); + if (type$.NativeTypedArrayOfDouble._is(iterable)) { + this._setRangeFast$4(receiver, start, end, iterable, skipCount); + return; + } + this.super$ListBase$setRange(receiver, start, end, iterable, skipCount); + }, + setRange$3(receiver, start, end, iterable) { + return this.setRange$4(receiver, start, end, iterable, 0); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.NativeTypedArrayOfInt.prototype = { + $indexSet(receiver, index, value) { + A._asInt(value); + A._checkValidIndex(index, receiver, receiver.length); + receiver[index] = value; + }, + setRange$4(receiver, start, end, iterable, skipCount) { + type$.Iterable_int._as(iterable); + if (type$.NativeTypedArrayOfInt._is(iterable)) { + this._setRangeFast$4(receiver, start, end, iterable, skipCount); + return; + } + this.super$ListBase$setRange(receiver, start, end, iterable, skipCount); + }, + setRange$3(receiver, start, end, iterable) { + return this.setRange$4(receiver, start, end, iterable, 0); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.NativeFloat32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Float32List_Ymk; + }, + sublist$2(receiver, start, end) { + return new Float32Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isFloat32List: 1 + }; + A.NativeFloat64List.prototype = { + get$runtimeType(receiver) { + return B.Type_Float64List_Ymk; + }, + sublist$2(receiver, start, end) { + return new Float64Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isFloat64List: 1 + }; + A.NativeInt16List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int16List_cot; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Int16Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isInt16List: 1 + }; + A.NativeInt32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int32List_m1p; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Int32Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isNativeInt32List: 1, + $isInt32List: 1 + }; + A.NativeInt8List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int8List_woc; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Int8Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isInt8List: 1 + }; + A.NativeUint16List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint16List_2mh; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint16Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isUint16List: 1 + }; + A.NativeUint32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint32List_2mh; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint32Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isUint32List: 1 + }; + A.NativeUint8ClampedList.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint8ClampedList_9Bb; + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint8ClampedArray(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isUint8ClampedList: 1 + }; + A.NativeUint8List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint8List_CSc; + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint8Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + $isTrustedGetRuntimeType: 1, + $isNativeUint8List: 1, + $isUint8List: 1 + }; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.prototype = {}; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.prototype = {}; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; + A.Rti.prototype = { + _eval$1(recipe) { + return A._Universe_evalInEnvironment(init.typeUniverse, this, recipe); + }, + _bind$1(typeOrTuple) { + return A._Universe_bind(init.typeUniverse, this, typeOrTuple); + } + }; + A._FunctionParameters.prototype = {}; + A._Type.prototype = { + toString$0(_) { + return A._rtiToString(this._rti, null); + } + }; + A._Error.prototype = { + toString$0(_) { + return this.__rti$_message; + } + }; + A._TypeError.prototype = {$isTypeError: 1}; + A._AsyncRun__initializeScheduleImmediate_internalCallback.prototype = { + call$1(_) { + var t1 = this._box_0, + f = t1.storedCallback; + t1.storedCallback = null; + f.call$0(); + }, + $signature: 24 + }; + A._AsyncRun__initializeScheduleImmediate_closure.prototype = { + call$1(callback) { + var t1, t2; + type$.void_Function._as(callback); + t1 = this._box_0; + A.assertHelper(t1.storedCallback == null); + t1.storedCallback = callback; + t1 = this.div; + t2 = this.span; + t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2); + }, + $signature: 76 + }; + A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = { + call$0() { + this.callback.call$0(); + }, + $signature: 8 + }; + A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback.prototype = { + call$0() { + this.callback.call$0(); + }, + $signature: 8 + }; + A._TimerImpl.prototype = { + _TimerImpl$2(milliseconds, callback) { + if (self.setTimeout != null) + self.setTimeout(A.convertDartClosureToJS(new A._TimerImpl_internalCallback(this, callback), 0), milliseconds); + else + throw A.wrapException(A.UnsupportedError$("`setTimeout()` not found.")); + }, + _TimerImpl$periodic$2(milliseconds, callback) { + if (self.setTimeout != null) + self.setInterval(A.convertDartClosureToJS(new A._TimerImpl$periodic_closure(this, milliseconds, Date.now(), callback), 0), milliseconds); + else + throw A.wrapException(A.UnsupportedError$("Periodic timer.")); + }, + $isTimer: 1 + }; + A._TimerImpl_internalCallback.prototype = { + call$0() { + this.$this._tick = 1; + this.callback.call$0(); + }, + $signature: 0 + }; + A._TimerImpl$periodic_closure.prototype = { + call$0() { + var duration, _this = this, + t1 = _this.$this, + tick = t1._tick + 1, + t2 = _this.milliseconds; + if (t2 > 0) { + duration = Date.now() - _this.start; + if (duration > (tick + 1) * t2) + tick = B.JSInt_methods.$tdiv(duration, t2); + } + t1._tick = tick; + _this.callback.call$1(t1); + }, + $signature: 8 + }; + A._AsyncAwaitCompleter.prototype = { + complete$1(value) { + var t2, _this = this, + t1 = _this.$ti; + t1._eval$1("1/?")._as(value); + if (value == null) + value = t1._precomputed1._as(value); + if (!_this.isSync) + _this._future._asyncComplete$1(value); + else { + t2 = _this._future; + if (t1._eval$1("Future<1>")._is(value)) { + A.assertHelper((t2._async$_state & 24) === 0); + t2._chainFuture$1(value); + } else + t2._completeWithValue$1(value); + } + }, + completeError$2(e, st) { + var t1 = this._future; + if (this.isSync) + t1._completeError$2(e, st); + else + t1._asyncCompleteError$2(e, st); + }, + $isCompleter: 1 + }; + A._awaitOnObject_closure.prototype = { + call$1(result) { + return this.bodyFunction.call$2(0, result); + }, + $signature: 12 + }; + A._awaitOnObject_closure0.prototype = { + call$2(error, stackTrace) { + this.bodyFunction.call$2(1, new A.ExceptionAndStackTrace(error, type$.StackTrace._as(stackTrace))); + }, + $signature: 52 + }; + A._wrapJsFunctionForAsync_closure.prototype = { + call$2(errorCode, result) { + this.$protected(A._asInt(errorCode), result); + }, + $signature: 53 + }; + A._SyncStarIterator.prototype = { + get$current() { + var t1 = this._async$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + _resumeBody$2(errorCode, errorValue) { + var body, t1, exception; + errorCode = A._asInt(errorCode); + errorValue = errorValue; + body = this._body; + for (; true;) + try { + t1 = body(this, errorCode, errorValue); + return t1; + } catch (exception) { + errorValue = exception; + errorCode = 1; + } + }, + moveNext$0() { + var nestedIterator, exception, value, suspendedBodies, _this = this, _null = null, errorValue = null, errorCode = 0; + for (; true;) { + nestedIterator = _this._nestedIterator; + if (nestedIterator != null) + try { + if (nestedIterator.moveNext$0()) { + _this.set$_async$_current(nestedIterator.get$current()); + return true; + } else + _this.set$_nestedIterator(_null); + } catch (exception) { + errorValue = exception; + errorCode = 1; + _this.set$_nestedIterator(_null); + } + value = _this._resumeBody$2(errorCode, errorValue); + if (1 === value) + return true; + if (0 === value) { + _this.set$_async$_current(_null); + suspendedBodies = _this._suspendedBodies; + if (suspendedBodies == null || suspendedBodies.length === 0) { + _this._body = A._SyncStarIterator__terminatedBody; + return false; + } + if (0 >= suspendedBodies.length) + return A.ioore(suspendedBodies, -1); + _this._body = suspendedBodies.pop(); + errorCode = 0; + errorValue = null; + continue; + } + if (2 === value) { + errorCode = 0; + errorValue = null; + continue; + } + if (3 === value) { + errorValue = _this._datum; + _this._datum = null; + suspendedBodies = _this._suspendedBodies; + if (suspendedBodies == null || suspendedBodies.length === 0) { + _this.set$_async$_current(_null); + _this._body = A._SyncStarIterator__terminatedBody; + throw errorValue; + return false; + } + if (0 >= suspendedBodies.length) + return A.ioore(suspendedBodies, -1); + _this._body = suspendedBodies.pop(); + errorCode = 1; + continue; + } + throw A.wrapException(A.StateError$("sync*")); + } + return false; + }, + _yieldStar$1(iterable) { + var t1, t2, _this = this; + if (iterable instanceof A._SyncStarIterable) { + t1 = iterable._outerHelper(); + t2 = _this._suspendedBodies; + if (t2 == null) + t2 = _this._suspendedBodies = []; + B.JSArray_methods.add$1(t2, _this._body); + _this._body = t1; + return 2; + } else { + _this.set$_nestedIterator(J.get$iterator$ax(iterable)); + return 2; + } + }, + set$_async$_current(_current) { + this._async$_current = this.$ti._eval$1("1?")._as(_current); + }, + set$_nestedIterator(_nestedIterator) { + this._nestedIterator = this.$ti._eval$1("Iterator<1>?")._as(_nestedIterator); + }, + $isIterator: 1 + }; + A._SyncStarIterable.prototype = { + get$iterator(_) { + return new A._SyncStarIterator(this._outerHelper(), this.$ti._eval$1("_SyncStarIterator<1>")); + } + }; + A.AsyncError.prototype = { + toString$0(_) { + return A.S(this.error); + }, + $isError: 1, + get$stackTrace() { + return this.stackTrace; + } + }; + A._BroadcastStream.prototype = {}; + A._BroadcastSubscription.prototype = { + _onPause$0() { + }, + _onResume$0() { + }, + set$_async$_next(_next) { + this._async$_next = this.$ti._eval$1("_BroadcastSubscription<1>?")._as(_next); + }, + set$_async$_previous(_previous) { + this._async$_previous = this.$ti._eval$1("_BroadcastSubscription<1>?")._as(_previous); + } + }; + A._BroadcastStreamController.prototype = { + get$_mayAddEvent() { + return this._async$_state < 4; + }, + _removeListener$1(subscription) { + var previous, next, _this = this; + A._instanceType(_this)._eval$1("_BroadcastSubscription<1>")._as(subscription); + A.assertHelper(subscription._controller === _this); + A.assertHelper(subscription._async$_next !== subscription); + previous = subscription._async$_previous; + next = subscription._async$_next; + if (previous == null) + _this.set$_firstSubscription(next); + else + previous.set$_async$_next(next); + if (next == null) + _this.set$_lastSubscription(previous); + else + next.set$_async$_previous(previous); + subscription.set$_async$_previous(subscription); + subscription.set$_async$_next(subscription); + }, + _subscribe$4(onData, onError, onDone, cancelOnError) { + var t2, t3, t4, t5, t6, t7, subscription, oldLast, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("~(1)?")._as(onData); + type$.nullable_void_Function._as(onDone); + if ((_this._async$_state & 4) !== 0) { + t2 = $.Zone__current; + t1 = new A._DoneStreamSubscription(t2, t1._eval$1("_DoneStreamSubscription<1>")); + A.scheduleMicrotask(t1.get$_onMicrotask()); + if (onDone != null) + t1.set$_onDone(t2.registerCallback$1$1(onDone, type$.void)); + return t1; + } + t2 = $.Zone__current; + t3 = cancelOnError ? 1 : 0; + t4 = onError != null ? 32 : 0; + t5 = A._BufferingStreamSubscription__registerDataHandler(t2, onData, t1._precomputed1); + t6 = A._BufferingStreamSubscription__registerErrorHandler(t2, onError); + t7 = onDone == null ? A.async___nullDoneHandler$closure() : onDone; + t1 = t1._eval$1("_BroadcastSubscription<1>"); + subscription = new A._BroadcastSubscription(_this, t5, t6, t2.registerCallback$1$1(t7, type$.void), t2, t3 | t4, t1); + subscription.set$_async$_previous(subscription); + subscription.set$_async$_next(subscription); + t1._as(subscription); + A.assertHelper(subscription._async$_next === subscription); + subscription._eventState = _this._async$_state & 1; + oldLast = _this._lastSubscription; + _this.set$_lastSubscription(subscription); + subscription.set$_async$_next(null); + subscription.set$_async$_previous(oldLast); + if (oldLast == null) + _this.set$_firstSubscription(subscription); + else + oldLast.set$_async$_next(subscription); + if (_this._firstSubscription == _this._lastSubscription) + A._runGuarded(_this.onListen); + return subscription; + }, + _recordCancel$1(sub) { + var _this = this, + t1 = A._instanceType(_this); + sub = t1._eval$1("_BroadcastSubscription<1>")._as(t1._eval$1("StreamSubscription<1>")._as(sub)); + if (sub._async$_next === sub) + return null; + if ((sub._eventState & 2) !== 0) + sub._eventState |= 4; + else { + _this._removeListener$1(sub); + if ((_this._async$_state & 2) === 0 && _this._firstSubscription == null) + _this._callOnCancel$0(); + } + return null; + }, + _recordPause$1(subscription) { + A._instanceType(this)._eval$1("StreamSubscription<1>")._as(subscription); + }, + _recordResume$1(subscription) { + A._instanceType(this)._eval$1("StreamSubscription<1>")._as(subscription); + }, + _addEventError$0() { + var t1 = this._async$_state; + if ((t1 & 4) !== 0) + return new A.StateError("Cannot add new events after calling close"); + A.assertHelper((t1 & 8) !== 0); + return new A.StateError("Cannot add new events while doing an addStream"); + }, + add$1(_, data) { + var _this = this; + A._instanceType(_this)._precomputed1._as(data); + if (!_this.get$_mayAddEvent()) + throw A.wrapException(_this._addEventError$0()); + _this._sendData$1(data); + }, + addError$2(error, stackTrace) { + var replacement; + A.checkNotNullable(error, "error", type$.Object); + if (!this.get$_mayAddEvent()) + throw A.wrapException(this._addEventError$0()); + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } + this._sendError$2(error, stackTrace); + }, + close$0() { + var t1, doneFuture, _this = this; + if ((_this._async$_state & 4) !== 0) { + A.assertHelper(_this._doneFuture != null); + t1 = _this._doneFuture; + t1.toString; + return t1; + } + if (!_this.get$_mayAddEvent()) + throw A.wrapException(_this._addEventError$0()); + _this._async$_state |= 4; + doneFuture = _this._doneFuture; + if (doneFuture == null) + doneFuture = _this._doneFuture = new A._Future($.Zone__current, type$._Future_void); + _this._sendDone$0(); + return doneFuture; + }, + _forEachListener$1(action) { + var t1, subscription, id, next, _this = this; + A._instanceType(_this)._eval$1("~(_BufferingStreamSubscription<1>)")._as(action); + t1 = _this._async$_state; + if ((t1 & 2) !== 0) + throw A.wrapException(A.StateError$(string$.Cannotf)); + subscription = _this._firstSubscription; + if (subscription == null) + return; + id = t1 & 1; + _this._async$_state = t1 ^ 3; + for (; subscription != null;) { + t1 = subscription._eventState; + if ((t1 & 1) === id) { + subscription._eventState = t1 | 2; + action.call$1(subscription); + t1 = subscription._eventState ^= 1; + next = subscription._async$_next; + if ((t1 & 4) !== 0) + _this._removeListener$1(subscription); + subscription._eventState &= 4294967293; + subscription = next; + } else + subscription = subscription._async$_next; + } + _this._async$_state &= 4294967293; + if (_this._firstSubscription == null) + _this._callOnCancel$0(); + }, + _callOnCancel$0() { + var doneFuture, _this = this; + A.assertHelper(_this._firstSubscription == null); + if ((_this._async$_state & 4) !== 0) { + doneFuture = _this._doneFuture; + if ((doneFuture._async$_state & 30) === 0) + doneFuture._asyncComplete$1(null); + } + A._runGuarded(_this.onCancel); + }, + set$_firstSubscription(_firstSubscription) { + this._firstSubscription = A._instanceType(this)._eval$1("_BroadcastSubscription<1>?")._as(_firstSubscription); + }, + set$_lastSubscription(_lastSubscription) { + this._lastSubscription = A._instanceType(this)._eval$1("_BroadcastSubscription<1>?")._as(_lastSubscription); + }, + $isEventSink: 1, + $isStreamSink: 1, + $isStreamController: 1, + $is_StreamControllerLifecycle: 1, + $is_EventSink: 1, + $is_EventDispatch: 1 + }; + A._SyncBroadcastStreamController.prototype = { + get$_mayAddEvent() { + return A._BroadcastStreamController.prototype.get$_mayAddEvent.call(this) && (this._async$_state & 2) === 0; + }, + _addEventError$0() { + if ((this._async$_state & 2) !== 0) + return new A.StateError(string$.Cannotf); + return this.super$_BroadcastStreamController$_addEventError(); + }, + _sendData$1(data) { + var firstSubscription, _this = this; + _this.$ti._precomputed1._as(data); + firstSubscription = _this._firstSubscription; + if (firstSubscription == null) + return; + if (firstSubscription == _this._lastSubscription) { + _this._async$_state |= 2; + firstSubscription._async$_add$1(data); + _this._async$_state &= 4294967293; + if (_this._firstSubscription == null) + _this._callOnCancel$0(); + return; + } + _this._forEachListener$1(new A._SyncBroadcastStreamController__sendData_closure(_this, data)); + }, + _sendError$2(error, stackTrace) { + if (this._firstSubscription == null) + return; + this._forEachListener$1(new A._SyncBroadcastStreamController__sendError_closure(this, error, stackTrace)); + }, + _sendDone$0() { + var t1, _this = this; + if (_this._firstSubscription != null) + _this._forEachListener$1(new A._SyncBroadcastStreamController__sendDone_closure(_this)); + else { + t1 = _this._doneFuture; + A.assertHelper(t1 != null && (t1._async$_state & 30) === 0); + _this._doneFuture._asyncComplete$1(null); + } + } + }; + A._SyncBroadcastStreamController__sendData_closure.prototype = { + call$1(subscription) { + this.$this.$ti._eval$1("_BufferingStreamSubscription<1>")._as(subscription)._async$_add$1(this.data); + }, + $signature() { + return this.$this.$ti._eval$1("~(_BufferingStreamSubscription<1>)"); + } + }; + A._SyncBroadcastStreamController__sendError_closure.prototype = { + call$1(subscription) { + this.$this.$ti._eval$1("_BufferingStreamSubscription<1>")._as(subscription)._addError$2(this.error, this.stackTrace); + }, + $signature() { + return this.$this.$ti._eval$1("~(_BufferingStreamSubscription<1>)"); + } + }; + A._SyncBroadcastStreamController__sendDone_closure.prototype = { + call$1(subscription) { + this.$this.$ti._eval$1("_BufferingStreamSubscription<1>")._as(subscription)._close$0(); + }, + $signature() { + return this.$this.$ti._eval$1("~(_BufferingStreamSubscription<1>)"); + } + }; + A.Future_Future_closure.prototype = { + call$0() { + var e, s, exception; + try { + this.result._complete$1(this.computation.call$0()); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._completeWithErrorCallback(this.result, e, s); + } + }, + $signature: 0 + }; + A.Future_Future$delayed_closure.prototype = { + call$0() { + this.T._as(null); + this.result._complete$1(null); + }, + $signature: 0 + }; + A.Future_wait_handleError.prototype = { + call$2(theError, theStackTrace) { + var t1, t2, _this = this; + type$.Object._as(theError); + type$.StackTrace._as(theStackTrace); + t1 = _this._box_0; + t2 = --t1.remaining; + if (t1.values != null) { + t1.values = null; + t1.error = theError; + t1.stackTrace = theStackTrace; + if (t2 === 0 || _this.eagerError) + _this._future._completeError$2(theError, theStackTrace); + } else if (t2 === 0 && !_this.eagerError) { + t2 = t1.error; + t2.toString; + t1 = t1.stackTrace; + t1.toString; + _this._future._completeError$2(t2, t1); + } + }, + $signature: 6 + }; + A.Future_wait_closure.prototype = { + call$1(value) { + var remainingResults, valueList, t1, value0, t3, t4, _i, t5, _this = this, + t2 = _this.T; + t2._as(value); + t3 = _this._box_0; + remainingResults = --t3.remaining; + valueList = t3.values; + if (valueList != null) { + t3 = _this.pos; + A.assertHelper(J.$index$asx(valueList, t3) == null); + J.$indexSet$ax(valueList, t3, value); + if (J.$eq$(remainingResults, 0)) { + t1 = A._setArrayType([], t2._eval$1("JSArray<0>")); + for (t3 = valueList, t4 = t3.length, _i = 0; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) { + value0 = t3[_i]; + t5 = value0; + if (t5 == null) + t5 = t2._as(t5); + J.add$1$ax(t1, t5); + } + _this._future._completeWithValue$1(t1); + } + } else if (J.$eq$(remainingResults, 0) && !_this.eagerError) { + t1 = t3.error; + t1.toString; + t3 = t3.stackTrace; + t3.toString; + _this._future._completeError$2(t1, t3); + } + }, + $signature() { + return this.T._eval$1("Null(0)"); + } + }; + A._Completer.prototype = { + completeError$2(error, stackTrace) { + var replacement, + t1 = type$.Object; + t1._as(error); + type$.nullable_StackTrace._as(stackTrace); + A.checkNotNullable(error, "error", t1); + if ((this.future._async$_state & 30) !== 0) + throw A.wrapException(A.StateError$("Future already completed")); + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } else if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + this._completeError$2(error, stackTrace); + }, + completeError$1(error) { + return this.completeError$2(error, null); + }, + $isCompleter: 1 + }; + A._AsyncCompleter.prototype = { + complete$1(value) { + var t2, + t1 = this.$ti; + t1._eval$1("1/?")._as(value); + t2 = this.future; + if ((t2._async$_state & 30) !== 0) + throw A.wrapException(A.StateError$("Future already completed")); + t2._asyncComplete$1(t1._eval$1("1/")._as(value)); + }, + complete$0() { + return this.complete$1(null); + }, + _completeError$2(error, stackTrace) { + this.future._asyncCompleteError$2(error, stackTrace); + } + }; + A._SyncCompleter.prototype = { + complete$1(value) { + var t2, + t1 = this.$ti; + t1._eval$1("1/?")._as(value); + t2 = this.future; + if ((t2._async$_state & 30) !== 0) + throw A.wrapException(A.StateError$("Future already completed")); + t2._complete$1(t1._eval$1("1/")._as(value)); + }, + complete$0() { + return this.complete$1(null); + }, + _completeError$2(error, stackTrace) { + this.future._completeError$2(error, stackTrace); + } + }; + A._FutureListener.prototype = { + matchesErrorTest$1(asyncError) { + if ((this.state & 15) !== 6) + return true; + return this.result._zone.runUnary$2$2(type$.bool_Function_Object._as(this.callback), asyncError.error, type$.bool, type$.Object); + }, + handleError$1(asyncError) { + var result, errorCallback, t2, t3, t4, t5, exception, _this = this, + t1 = _this.state; + A.assertHelper((t1 & 2) !== 0 && _this.errorCallback != null); + errorCallback = _this.errorCallback; + result = null; + t2 = type$.dynamic; + t3 = type$.Object; + t4 = asyncError.error; + t5 = _this.result._zone; + if (type$.dynamic_Function_Object_StackTrace._is(errorCallback)) + result = t5.runBinary$3$3(errorCallback, t4, asyncError.stackTrace, t2, t3, type$.StackTrace); + else + result = t5.runUnary$2$2(type$.dynamic_Function_Object._as(errorCallback), t4, t2, t3); + try { + t2 = _this.$ti._eval$1("2/")._as(result); + return t2; + } catch (exception) { + if (type$.TypeError._is(A.unwrapException(exception))) { + if ((t1 & 1) !== 0) + throw A.wrapException(A.ArgumentError$("The error handler of Future.then must return a value of the returned future's type", "onError")); + throw A.wrapException(A.ArgumentError$("The error handler of Future.catchError must return a value of the future's type", "onError")); + } else + throw exception; + } + } + }; + A._Future.prototype = { + _setChained$1(source) { + var _this = this; + A.assertHelper(_this._async$_state <= 3); + _this._async$_state = _this._async$_state & 1 | 4; + _this._resultOrListeners = source; + }, + then$1$2$onError(f, onError, $R) { + var currentZone, result, t2, + t1 = this.$ti; + t1._bind$1($R)._eval$1("1/(2)")._as(f); + currentZone = $.Zone__current; + if (currentZone === B.C__RootZone) { + if (onError != null && !type$.dynamic_Function_Object_StackTrace._is(onError) && !type$.dynamic_Function_Object._is(onError)) + throw A.wrapException(A.ArgumentError$value(onError, "onError", string$.Error_)); + } else { + f = currentZone.registerUnaryCallback$2$1(f, $R._eval$1("0/"), t1._precomputed1); + if (onError != null) + onError = A._registerErrorHandler(onError, currentZone); + } + result = new A._Future($.Zone__current, $R._eval$1("_Future<0>")); + t2 = onError == null ? 1 : 3; + this._addListener$1(new A._FutureListener(result, t2, f, onError, t1._eval$1("@<1>")._bind$1($R)._eval$1("_FutureListener<1,2>"))); + return result; + }, + then$1$1(f, $R) { + return this.then$1$2$onError(f, null, $R); + }, + _thenAwait$1$2(f, onError, $E) { + var result, + t1 = this.$ti; + t1._bind$1($E)._eval$1("1/(2)")._as(f); + result = new A._Future($.Zone__current, $E._eval$1("_Future<0>")); + this._addListener$1(new A._FutureListener(result, 19, f, onError, t1._eval$1("@<1>")._bind$1($E)._eval$1("_FutureListener<1,2>"))); + return result; + }, + whenComplete$1(action) { + var t1, t2, result; + type$.dynamic_Function._as(action); + t1 = this.$ti; + t2 = $.Zone__current; + result = new A._Future(t2, t1); + if (t2 !== B.C__RootZone) + action = t2.registerCallback$1$1(action, type$.dynamic); + this._addListener$1(new A._FutureListener(result, 8, action, null, t1._eval$1("@<1>")._bind$1(t1._precomputed1)._eval$1("_FutureListener<1,2>"))); + return result; + }, + _setPendingComplete$0() { + A.assertHelper((this._async$_state & 30) === 0); + this._async$_state ^= 2; + }, + _setErrorObject$1(error) { + var _this = this; + A.assertHelper((_this._async$_state & 24) === 0); + _this._async$_state = _this._async$_state & 1 | 16; + _this._resultOrListeners = error; + }, + _cloneResult$1(source) { + var _this = this; + A.assertHelper((_this._async$_state & 24) === 0); + A.assertHelper((source._async$_state & 24) !== 0); + _this._async$_state = source._async$_state & 30 | _this._async$_state & 1; + _this._resultOrListeners = source._resultOrListeners; + }, + _addListener$1(listener) { + var t1, source, _this = this; + A.assertHelper(listener._nextListener == null); + t1 = _this._async$_state; + if (t1 <= 3) { + listener._nextListener = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); + _this._resultOrListeners = listener; + } else { + if ((t1 & 4) !== 0) { + source = type$._Future_dynamic._as(_this._resultOrListeners); + if ((source._async$_state & 24) === 0) { + source._addListener$1(listener); + return; + } + _this._cloneResult$1(source); + } + A.assertHelper((_this._async$_state & 24) !== 0); + _this._zone.scheduleMicrotask$1(new A._Future__addListener_closure(_this, listener)); + } + }, + _prependListeners$1(listeners) { + var t1, existingListeners, next, cursor, next0, source, _this = this, _box_0 = {}; + _box_0.listeners = listeners; + if (listeners == null) + return; + t1 = _this._async$_state; + if (t1 <= 3) { + existingListeners = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); + _this._resultOrListeners = listeners; + if (existingListeners != null) { + next = listeners._nextListener; + for (cursor = listeners; next != null; cursor = next, next = next0) + next0 = next._nextListener; + cursor._nextListener = existingListeners; + } + } else { + if ((t1 & 4) !== 0) { + source = type$._Future_dynamic._as(_this._resultOrListeners); + if ((source._async$_state & 24) === 0) { + source._prependListeners$1(listeners); + return; + } + _this._cloneResult$1(source); + } + A.assertHelper((_this._async$_state & 24) !== 0); + _box_0.listeners = _this._reverseListeners$1(listeners); + _this._zone.scheduleMicrotask$1(new A._Future__prependListeners_closure(_box_0, _this)); + } + }, + _removeListeners$0() { + var current, _this = this; + A.assertHelper((_this._async$_state & 24) === 0); + current = type$.nullable__FutureListener_dynamic_dynamic._as(_this._resultOrListeners); + _this._resultOrListeners = null; + return _this._reverseListeners$1(current); + }, + _reverseListeners$1(listeners) { + var current, prev, next; + for (current = listeners, prev = null; current != null; prev = current, current = next) { + next = current._nextListener; + current._nextListener = prev; + } + return prev; + }, + _chainForeignFuture$1(source) { + var e, s, exception, _this = this; + A.assertHelper((_this._async$_state & 24) === 0); + A.assertHelper(false); + _this._setPendingComplete$0(); + try { + source.then$1$2$onError(new A._Future__chainForeignFuture_closure(_this), new A._Future__chainForeignFuture_closure0(_this), type$.Null); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A.scheduleMicrotask(new A._Future__chainForeignFuture_closure1(_this, e, s)); + } + }, + _complete$1(value) { + var listeners, _this = this, + t1 = _this.$ti; + t1._eval$1("1/")._as(value); + A.assertHelper((_this._async$_state & 24) === 0); + if (t1._eval$1("Future<1>")._is(value)) + if (t1._is(value)) + A._Future__chainCoreFutureSync(value, _this); + else + _this._chainForeignFuture$1(value); + else { + listeners = _this._removeListeners$0(); + t1._precomputed1._as(value); + A.assertHelper((_this._async$_state & 24) === 0); + _this._async$_state = 8; + _this._resultOrListeners = value; + A._Future__propagateToListeners(_this, listeners); + } + }, + _completeWithValue$1(value) { + var listeners, _this = this; + _this.$ti._precomputed1._as(value); + A.assertHelper((_this._async$_state & 24) === 0); + listeners = _this._removeListeners$0(); + A.assertHelper((_this._async$_state & 24) === 0); + _this._async$_state = 8; + _this._resultOrListeners = value; + A._Future__propagateToListeners(_this, listeners); + }, + _completeError$2(error, stackTrace) { + var listeners, _this = this; + type$.Object._as(error); + type$.StackTrace._as(stackTrace); + A.assertHelper((_this._async$_state & 24) === 0); + listeners = _this._removeListeners$0(); + _this._setErrorObject$1(A.AsyncError$(error, stackTrace)); + A._Future__propagateToListeners(_this, listeners); + }, + _asyncComplete$1(value) { + var _this = this, + t1 = _this.$ti; + t1._eval$1("1/")._as(value); + A.assertHelper((_this._async$_state & 24) === 0); + if (t1._eval$1("Future<1>")._is(value)) { + _this._chainFuture$1(value); + return; + } + _this._asyncCompleteWithValue$1(value); + }, + _asyncCompleteWithValue$1(value) { + var _this = this; + _this.$ti._precomputed1._as(value); + _this._setPendingComplete$0(); + _this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteWithValue_closure(_this, value)); + }, + _chainFuture$1(value) { + var _this = this, + t1 = _this.$ti; + t1._eval$1("Future<1>")._as(value); + A.assertHelper((_this._async$_state & 30) === 0); + if (t1._is(value)) { + A._Future__chainCoreFutureAsync(value, _this); + return; + } + _this._chainForeignFuture$1(value); + }, + _asyncCompleteError$2(error, stackTrace) { + var _this = this; + type$.StackTrace._as(stackTrace); + A.assertHelper((_this._async$_state & 24) === 0); + _this._setPendingComplete$0(); + _this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteError_closure(_this, error, stackTrace)); + }, + $isFuture: 1 + }; + A._Future__addListener_closure.prototype = { + call$0() { + A._Future__propagateToListeners(this.$this, this.listener); + }, + $signature: 0 + }; + A._Future__prependListeners_closure.prototype = { + call$0() { + A._Future__propagateToListeners(this.$this, this._box_0.listeners); + }, + $signature: 0 + }; + A._Future__chainForeignFuture_closure.prototype = { + call$1(value) { + var error, stackTrace, exception, + t1 = this.$this; + A.assertHelper((t1._async$_state & 2) !== 0); + A.assertHelper((t1._async$_state & 2) !== 0); + t1._async$_state ^= 2; + try { + t1._completeWithValue$1(t1.$ti._precomputed1._as(value)); + } catch (exception) { + error = A.unwrapException(exception); + stackTrace = A.getTraceFromException(exception); + t1._completeError$2(error, stackTrace); + } + }, + $signature: 24 + }; + A._Future__chainForeignFuture_closure0.prototype = { + call$2(error, stackTrace) { + var t1; + type$.Object._as(error); + type$.StackTrace._as(stackTrace); + t1 = this.$this; + A.assertHelper((t1._async$_state & 2) !== 0); + t1._completeError$2(error, stackTrace); + }, + $signature: 81 + }; + A._Future__chainForeignFuture_closure1.prototype = { + call$0() { + this.$this._completeError$2(this.e, this.s); + }, + $signature: 0 + }; + A._Future__chainCoreFutureAsync_closure.prototype = { + call$0() { + A._Future__chainCoreFutureSync(this._box_0.source, this.target); + }, + $signature: 0 + }; + A._Future__asyncCompleteWithValue_closure.prototype = { + call$0() { + this.$this._completeWithValue$1(this.value); + }, + $signature: 0 + }; + A._Future__asyncCompleteError_closure.prototype = { + call$0() { + this.$this._completeError$2(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleWhenCompleteCallback.prototype = { + call$0() { + var completeResult, e, s, t2, t3, exception, originalSource, _this = this, + t1 = _this._box_0; + A.assertHelper((t1.listener.state & 1) === 0); + A.assertHelper((t1.listener.state & 2) === 0); + completeResult = null; + try { + t2 = t1.listener; + t3 = t2.state; + A.assertHelper((t3 & 2) === 0); + A.assertHelper((t3 & 15) === 8); + completeResult = t2.result._zone.run$1$1(type$.dynamic_Function._as(t2.callback), type$.dynamic); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + if (_this.hasError) { + t2 = _this._box_1.source; + A.assertHelper((t2._async$_state & 16) !== 0); + t2 = type$.AsyncError._as(t2._resultOrListeners).error === e; + } else + t2 = false; + if (t2) { + t2 = _this._box_1.source; + A.assertHelper((t2._async$_state & 16) !== 0); + t1.listenerValueOrError = type$.AsyncError._as(t2._resultOrListeners); + } else + t1.listenerValueOrError = A.AsyncError$(e, s); + t1.listenerHasError = true; + return; + } + if (completeResult instanceof A._Future && (completeResult._async$_state & 24) !== 0) { + if ((completeResult._async$_state & 16) !== 0) { + t2 = completeResult; + A.assertHelper((t2._async$_state & 16) !== 0); + t1.listenerValueOrError = type$.AsyncError._as(t2._resultOrListeners); + t1.listenerHasError = true; + } + return; + } + if (completeResult instanceof A._Future) { + originalSource = _this._box_1.source; + t1.listenerValueOrError = completeResult.then$1$1(new A._Future__propagateToListeners_handleWhenCompleteCallback_closure(originalSource), type$.dynamic); + t1.listenerHasError = false; + } + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleWhenCompleteCallback_closure.prototype = { + call$1(_) { + return this.originalSource; + }, + $signature: 88 + }; + A._Future__propagateToListeners_handleValueCallback.prototype = { + call$0() { + var e, s, t1, t2, t3, t4, t5, exception; + try { + t1 = this._box_0; + t2 = t1.listener; + t3 = t2.$ti; + t4 = t3._precomputed1; + t5 = t4._as(this.sourceResult); + A.assertHelper((t2.state & 1) !== 0); + t1.listenerValueOrError = t2.result._zone.runUnary$2$2(t3._eval$1("2/(1)")._as(t2.callback), t5, t3._eval$1("2/"), t4); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = this._box_0; + t1.listenerValueOrError = A.AsyncError$(e, s); + t1.listenerHasError = true; + } + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleError.prototype = { + call$0() { + var asyncError, e, s, t1, t2, exception, t3, t4, _this = this; + try { + t1 = _this._box_1.source; + A.assertHelper((t1._async$_state & 16) !== 0); + asyncError = type$.AsyncError._as(t1._resultOrListeners); + t1 = _this._box_0; + if (t1.listener.matchesErrorTest$1(asyncError)) { + t2 = t1.listener; + A.assertHelper((t2.state & 2) !== 0); + t2 = t2.errorCallback != null; + } else + t2 = false; + if (t2) { + t1.listenerValueOrError = t1.listener.handleError$1(asyncError); + t1.listenerHasError = false; + } + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = _this._box_1; + t2 = t1.source; + A.assertHelper((t2._async$_state & 16) !== 0); + t3 = type$.AsyncError; + t4 = _this._box_0; + if (t3._as(t2._resultOrListeners).error === e) { + t1 = t1.source; + A.assertHelper((t1._async$_state & 16) !== 0); + t4.listenerValueOrError = t3._as(t1._resultOrListeners); + } else + t4.listenerValueOrError = A.AsyncError$(e, s); + t4.listenerHasError = true; + } + }, + $signature: 0 + }; + A._AsyncCallbackEntry.prototype = {}; + A.Stream.prototype = { + get$length(_) { + var t1 = {}, + future = new A._Future($.Zone__current, type$._Future_int); + t1.count = 0; + this.listen$4$cancelOnError$onDone$onError(new A.Stream_length_closure(t1, this), true, new A.Stream_length_closure0(t1, future), future.get$_completeError()); + return future; + }, + get$first(_) { + var future = new A._Future($.Zone__current, A._instanceType(this)._eval$1("_Future")), + subscription = this.listen$4$cancelOnError$onDone$onError(null, true, new A.Stream_first_closure(future), future.get$_completeError()); + subscription.onData$1(new A.Stream_first_closure0(this, subscription, future)); + return future; + }, + firstWhere$1(_, test) { + var future, subscription, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("bool(Stream.T)")._as(test); + future = new A._Future($.Zone__current, t1._eval$1("_Future")); + subscription = _this.listen$4$cancelOnError$onDone$onError(null, true, new A.Stream_firstWhere_closure(_this, null, future), future.get$_completeError()); + subscription.onData$1(new A.Stream_firstWhere_closure0(_this, test, subscription, future)); + return future; + } + }; + A.Stream_length_closure.prototype = { + call$1(_) { + A._instanceType(this.$this)._eval$1("Stream.T")._as(_); + ++this._box_0.count; + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(Stream.T)"); + } + }; + A.Stream_length_closure0.prototype = { + call$0() { + this.future._complete$1(this._box_0.count); + }, + $signature: 0 + }; + A.Stream_first_closure.prototype = { + call$0() { + var e, s, t1, exception; + try { + t1 = A.IterableElementError_noElement(); + throw A.wrapException(t1); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._completeWithErrorCallback(this.future, e, s); + } + }, + $signature: 0 + }; + A.Stream_first_closure0.prototype = { + call$1(value) { + A._cancelAndValue(this.subscription, this.future, A._instanceType(this.$this)._eval$1("Stream.T")._as(value)); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(Stream.T)"); + } + }; + A.Stream_firstWhere_closure.prototype = { + call$0() { + var e, s, t1, exception; + try { + t1 = A.IterableElementError_noElement(); + throw A.wrapException(t1); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._completeWithErrorCallback(this.future, e, s); + } + }, + $signature: 0 + }; + A.Stream_firstWhere_closure0.prototype = { + call$1(value) { + var t1, t2, _this = this; + A._instanceType(_this.$this)._eval$1("Stream.T")._as(value); + t1 = _this.subscription; + t2 = _this.future; + A._runUserCode(new A.Stream_firstWhere__closure(_this.test, value), new A.Stream_firstWhere__closure0(t1, t2, value), A._cancelAndErrorClosure(t1, t2), type$.bool); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(Stream.T)"); + } + }; + A.Stream_firstWhere__closure.prototype = { + call$0() { + return this.test.call$1(this.value); + }, + $signature: 37 + }; + A.Stream_firstWhere__closure0.prototype = { + call$1(isMatch) { + if (A._asBool(isMatch)) + A._cancelAndValue(this.subscription, this.future, this.value); + }, + $signature: 58 + }; + A.StreamTransformerBase.prototype = {$isStreamTransformer: 1}; + A._StreamController.prototype = { + get$_pendingEvents() { + var t1, _this = this; + A.assertHelper((_this._async$_state & 3) === 0); + if ((_this._async$_state & 8) === 0) + return A._instanceType(_this)._eval$1("_PendingEvents<1>?")._as(_this._varData); + t1 = A._instanceType(_this); + return t1._eval$1("_PendingEvents<1>?")._as(t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).get$_varData()); + }, + _ensurePendingEvents$0() { + var events, t1, _this = this; + A.assertHelper((_this._async$_state & 3) === 0); + if ((_this._async$_state & 8) === 0) { + events = _this._varData; + if (events == null) + events = _this._varData = new A._PendingEvents(A._instanceType(_this)._eval$1("_PendingEvents<1>")); + return A._instanceType(_this)._eval$1("_PendingEvents<1>")._as(events); + } + t1 = A._instanceType(_this); + events = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).get$_varData(); + return t1._eval$1("_PendingEvents<1>")._as(events); + }, + get$_subscription() { + var varData, _this = this; + A.assertHelper((_this._async$_state & 1) !== 0); + varData = _this._varData; + if ((_this._async$_state & 8) !== 0) + varData = type$._StreamControllerAddStreamState_nullable_Object._as(varData).get$_varData(); + return A._instanceType(_this)._eval$1("_ControllerSubscription<1>")._as(varData); + }, + _badEventState$0() { + var t1 = this._async$_state; + if ((t1 & 4) !== 0) + return new A.StateError("Cannot add event after closing"); + A.assertHelper((t1 & 8) !== 0); + return new A.StateError("Cannot add event while adding a stream"); + }, + _ensureDoneFuture$0() { + var t1 = this._doneFuture; + if (t1 == null) + t1 = this._doneFuture = (this._async$_state & 2) !== 0 ? $.$get$Future__nullFuture() : new A._Future($.Zone__current, type$._Future_void); + return t1; + }, + add$1(_, value) { + var t2, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(value); + t2 = _this._async$_state; + if (t2 >= 4) + throw A.wrapException(_this._badEventState$0()); + if ((t2 & 1) !== 0) + _this._sendData$1(value); + else if ((t2 & 3) === 0) + _this._ensurePendingEvents$0().add$1(0, new A._DelayedData(value, t1._eval$1("_DelayedData<1>"))); + }, + addError$2(error, stackTrace) { + var replacement, _this = this, + t1 = type$.Object; + t1._as(error); + type$.nullable_StackTrace._as(stackTrace); + A.checkNotNullable(error, "error", t1); + if (_this._async$_state >= 4) + throw A.wrapException(_this._badEventState$0()); + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } else if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + t1 = _this._async$_state; + if ((t1 & 1) !== 0) + _this._sendError$2(error, stackTrace); + else if ((t1 & 3) === 0) + _this._ensurePendingEvents$0().add$1(0, new A._DelayedError(error, stackTrace)); + }, + addError$1(error) { + return this.addError$2(error, null); + }, + close$0() { + var _this = this, + t1 = _this._async$_state; + if ((t1 & 4) !== 0) + return _this._ensureDoneFuture$0(); + if (t1 >= 4) + throw A.wrapException(_this._badEventState$0()); + t1 = _this._async$_state = t1 | 4; + if ((t1 & 1) !== 0) + _this._sendDone$0(); + else if ((t1 & 3) === 0) + _this._ensurePendingEvents$0().add$1(0, B.C__DelayedDone); + return _this._ensureDoneFuture$0(); + }, + _subscribe$4(onData, onError, onDone, cancelOnError) { + var subscription, pendingEvents, t2, addState, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("~(1)?")._as(onData); + type$.nullable_void_Function._as(onDone); + if ((_this._async$_state & 3) !== 0) + throw A.wrapException(A.StateError$("Stream has already been listened to.")); + subscription = A._ControllerSubscription$(_this, onData, onError, onDone, cancelOnError, t1._precomputed1); + pendingEvents = _this.get$_pendingEvents(); + t2 = _this._async$_state |= 1; + if ((t2 & 8) !== 0) { + addState = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData); + addState.set$_varData(subscription); + addState.resume$0(); + } else + _this._varData = subscription; + subscription._setPendingEvents$1(pendingEvents); + subscription._guardCallback$1(new A._StreamController__subscribe_closure(_this)); + return subscription; + }, + _recordCancel$1(subscription) { + var result, onCancel, cancelResult, e, s, exception, result0, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("StreamSubscription<1>")._as(subscription); + result = null; + if ((_this._async$_state & 8) !== 0) + result = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).cancel$0(); + _this._varData = null; + _this._async$_state = _this._async$_state & 4294967286 | 2; + onCancel = _this.onCancel; + if (onCancel != null) + if (result == null) + try { + cancelResult = onCancel.call$0(); + if (cancelResult instanceof A._Future) + result = cancelResult; + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + result0 = new A._Future($.Zone__current, type$._Future_void); + result0._asyncCompleteError$2(e, s); + result = result0; + } + else + result = result.whenComplete$1(onCancel); + t1 = new A._StreamController__recordCancel_complete(_this); + if (result != null) + result = result.whenComplete$1(t1); + else + t1.call$0(); + return result; + }, + _recordPause$1(subscription) { + var _this = this, + t1 = A._instanceType(_this); + t1._eval$1("StreamSubscription<1>")._as(subscription); + if ((_this._async$_state & 8) !== 0) + t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).pause$0(); + A._runGuarded(_this.onPause); + }, + _recordResume$1(subscription) { + var _this = this, + t1 = A._instanceType(_this); + t1._eval$1("StreamSubscription<1>")._as(subscription); + if ((_this._async$_state & 8) !== 0) + t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).resume$0(); + A._runGuarded(_this.onResume); + }, + set$onListen(onListen) { + this.onListen = type$.nullable_void_Function._as(onListen); + }, + set$onResume(onResume) { + this.onResume = type$.nullable_void_Function._as(onResume); + }, + $isEventSink: 1, + $isStreamSink: 1, + $isStreamController: 1, + $is_StreamControllerLifecycle: 1, + $is_EventSink: 1, + $is_EventDispatch: 1 + }; + A._StreamController__subscribe_closure.prototype = { + call$0() { + A._runGuarded(this.$this.onListen); + }, + $signature: 0 + }; + A._StreamController__recordCancel_complete.prototype = { + call$0() { + var doneFuture = this.$this._doneFuture; + if (doneFuture != null && (doneFuture._async$_state & 30) === 0) + doneFuture._asyncComplete$1(null); + }, + $signature: 0 + }; + A._SyncStreamControllerDispatch.prototype = { + _sendData$1(data) { + this.$ti._precomputed1._as(data); + this.get$_subscription()._async$_add$1(data); + }, + _sendError$2(error, stackTrace) { + this.get$_subscription()._addError$2(error, stackTrace); + }, + _sendDone$0() { + this.get$_subscription()._close$0(); + } + }; + A._AsyncStreamControllerDispatch.prototype = { + _sendData$1(data) { + var t1 = this.$ti; + t1._precomputed1._as(data); + this.get$_subscription()._addPending$1(new A._DelayedData(data, t1._eval$1("_DelayedData<1>"))); + }, + _sendError$2(error, stackTrace) { + this.get$_subscription()._addPending$1(new A._DelayedError(error, stackTrace)); + }, + _sendDone$0() { + this.get$_subscription()._addPending$1(B.C__DelayedDone); + } + }; + A._AsyncStreamController.prototype = {}; + A._SyncStreamController.prototype = {}; + A._ControllerStream.prototype = { + get$hashCode(_) { + return (A.Primitives_objectHashCode(this._controller) ^ 892482866) >>> 0; + }, + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + return other instanceof A._ControllerStream && other._controller === this._controller; + } + }; + A._ControllerSubscription.prototype = { + _onCancel$0() { + return this._controller._recordCancel$1(this); + }, + _onPause$0() { + this._controller._recordPause$1(this); + }, + _onResume$0() { + this._controller._recordResume$1(this); + } + }; + A._StreamSinkWrapper.prototype = { + add$1(_, data) { + this._async$_target.add$1(0, this.$ti._precomputed1._as(data)); + }, + addError$2(error, stackTrace) { + this._async$_target.addError$2(error, stackTrace); + }, + close$0() { + return this._async$_target.close$0(); + }, + $isEventSink: 1, + $isStreamSink: 1 + }; + A._BufferingStreamSubscription.prototype = { + _setPendingEvents$1(pendingEvents) { + var _this = this; + A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>?")._as(pendingEvents); + A.assertHelper(_this._pending == null); + if (pendingEvents == null) + return; + _this.set$_pending(pendingEvents); + if (pendingEvents.lastPendingEvent != null) { + _this._async$_state = (_this._async$_state | 128) >>> 0; + pendingEvents.schedule$1(_this); + } + }, + onData$1(handleData) { + var t1 = A._instanceType(this); + this.set$_async$_onData(A._BufferingStreamSubscription__registerDataHandler(this._zone, t1._eval$1("~(_BufferingStreamSubscription.T)?")._as(handleData), t1._eval$1("_BufferingStreamSubscription.T"))); + }, + onError$1(handleError) { + var _this = this; + _this._async$_state = (_this._async$_state & 4294967263) >>> 0; + _this._onError = A._BufferingStreamSubscription__registerErrorHandler(_this._zone, handleError); + }, + pause$0() { + var t2, t3, _this = this, + t1 = _this._async$_state; + if ((t1 & 8) !== 0) + return; + t2 = (t1 + 256 | 4) >>> 0; + _this._async$_state = t2; + if (t1 < 256) { + t3 = _this._pending; + if (t3 != null) + if (t3._async$_state === 1) + t3._async$_state = 3; + } + if ((t1 & 4) === 0 && (t2 & 64) === 0) + _this._guardCallback$1(_this.get$_onPause()); + }, + resume$0() { + var _this = this, + t1 = _this._async$_state; + if ((t1 & 8) !== 0) + return; + if (t1 >= 256) { + t1 = _this._async$_state -= 256; + if (t1 < 256) + if ((t1 & 128) !== 0 && _this._pending.lastPendingEvent != null) + _this._pending.schedule$1(_this); + else { + A.assertHelper(_this.get$_mayResumeInput()); + t1 = (_this._async$_state & 4294967291) >>> 0; + _this._async$_state = t1; + if ((t1 & 64) === 0) + _this._guardCallback$1(_this.get$_onResume()); + } + } + }, + cancel$0() { + var _this = this, + t1 = (_this._async$_state & 4294967279) >>> 0; + _this._async$_state = t1; + if ((t1 & 8) === 0) + _this._cancel$0(); + t1 = _this._cancelFuture; + return t1 == null ? $.$get$Future__nullFuture() : t1; + }, + get$_mayResumeInput() { + if (this._async$_state < 256) { + var t1 = this._pending; + t1 = t1 == null ? null : t1.lastPendingEvent == null; + t1 = t1 !== false; + } else + t1 = false; + return t1; + }, + _cancel$0() { + var t2, _this = this, + t1 = _this._async$_state = (_this._async$_state | 8) >>> 0; + if ((t1 & 128) !== 0) { + t2 = _this._pending; + if (t2._async$_state === 1) + t2._async$_state = 3; + } + if ((t1 & 64) === 0) + _this.set$_pending(null); + _this._cancelFuture = _this._onCancel$0(); + }, + _async$_add$1(data) { + var t2, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("_BufferingStreamSubscription.T")._as(data); + A.assertHelper((_this._async$_state & 2) === 0); + t2 = _this._async$_state; + if ((t2 & 8) !== 0) + return; + if (t2 < 64) + _this._sendData$1(data); + else + _this._addPending$1(new A._DelayedData(data, t1._eval$1("_DelayedData<_BufferingStreamSubscription.T>"))); + }, + _addError$2(error, stackTrace) { + var t1 = this._async$_state; + if ((t1 & 8) !== 0) + return; + if (t1 < 64) + this._sendError$2(error, stackTrace); + else + this._addPending$1(new A._DelayedError(error, stackTrace)); + }, + _close$0() { + var t1, _this = this; + A.assertHelper((_this._async$_state & 2) === 0); + t1 = _this._async$_state; + if ((t1 & 8) !== 0) + return; + t1 = (t1 | 2) >>> 0; + _this._async$_state = t1; + if (t1 < 64) + _this._sendDone$0(); + else + _this._addPending$1(B.C__DelayedDone); + }, + _onPause$0() { + A.assertHelper((this._async$_state & 4) !== 0); + }, + _onResume$0() { + A.assertHelper((this._async$_state & 4) === 0); + }, + _onCancel$0() { + A.assertHelper((this._async$_state & 8) !== 0); + return null; + }, + _addPending$1($event) { + var t1, _this = this, + pending = _this._pending; + if (pending == null) { + pending = new A._PendingEvents(A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>")); + _this.set$_pending(pending); + } + pending.add$1(0, $event); + t1 = _this._async$_state; + if ((t1 & 128) === 0) { + t1 = (t1 | 128) >>> 0; + _this._async$_state = t1; + if (t1 < 256) + pending.schedule$1(_this); + } + }, + _sendData$1(data) { + var t2, _this = this, + t1 = A._instanceType(_this)._eval$1("_BufferingStreamSubscription.T"); + t1._as(data); + A.assertHelper((_this._async$_state & 8) === 0); + A.assertHelper(_this._async$_state < 256); + A.assertHelper((_this._async$_state & 64) === 0); + t2 = _this._async$_state; + _this._async$_state = (t2 | 64) >>> 0; + _this._zone.runUnaryGuarded$1$2(_this._async$_onData, data, t1); + _this._async$_state = (_this._async$_state & 4294967231) >>> 0; + _this._checkState$1((t2 & 4) !== 0); + }, + _sendError$2(error, stackTrace) { + var t1, t2, cancelFuture, _this = this; + A.assertHelper((_this._async$_state & 8) === 0); + A.assertHelper(_this._async$_state < 256); + A.assertHelper((_this._async$_state & 64) === 0); + t1 = _this._async$_state; + t2 = new A._BufferingStreamSubscription__sendError_sendError(_this, error, stackTrace); + if ((t1 & 1) !== 0) { + _this._async$_state = (t1 | 16) >>> 0; + _this._cancel$0(); + cancelFuture = _this._cancelFuture; + if (cancelFuture != null && cancelFuture !== $.$get$Future__nullFuture()) + cancelFuture.whenComplete$1(t2); + else + t2.call$0(); + } else { + t2.call$0(); + _this._checkState$1((t1 & 4) !== 0); + } + }, + _sendDone$0() { + var t1, cancelFuture, _this = this; + A.assertHelper((_this._async$_state & 8) === 0); + A.assertHelper(_this._async$_state < 256); + A.assertHelper((_this._async$_state & 64) === 0); + t1 = new A._BufferingStreamSubscription__sendDone_sendDone(_this); + _this._cancel$0(); + _this._async$_state = (_this._async$_state | 16) >>> 0; + cancelFuture = _this._cancelFuture; + if (cancelFuture != null && cancelFuture !== $.$get$Future__nullFuture()) + cancelFuture.whenComplete$1(t1); + else + t1.call$0(); + }, + _guardCallback$1(callback) { + var t1, _this = this; + type$.void_Function._as(callback); + A.assertHelper((_this._async$_state & 64) === 0); + t1 = _this._async$_state; + _this._async$_state = (t1 | 64) >>> 0; + callback.call$0(); + _this._async$_state = (_this._async$_state & 4294967231) >>> 0; + _this._checkState$1((t1 & 4) !== 0); + }, + _checkState$1(wasInputPaused) { + var t1, isInputPaused, _this = this; + A.assertHelper((_this._async$_state & 64) === 0); + t1 = _this._async$_state; + if ((t1 & 128) !== 0 && _this._pending.lastPendingEvent == null) { + t1 = (t1 & 4294967167) >>> 0; + _this._async$_state = t1; + if ((t1 & 4) !== 0 && _this.get$_mayResumeInput()) + _this._async$_state = (_this._async$_state & 4294967291) >>> 0; + } + for (; true; wasInputPaused = isInputPaused) { + t1 = _this._async$_state; + if ((t1 & 8) !== 0) { + _this.set$_pending(null); + return; + } + isInputPaused = (t1 & 4) !== 0; + if (wasInputPaused === isInputPaused) + break; + _this._async$_state = (t1 ^ 64) >>> 0; + if (isInputPaused) + _this._onPause$0(); + else + _this._onResume$0(); + _this._async$_state = (_this._async$_state & 4294967231) >>> 0; + } + t1 = _this._async$_state; + if ((t1 & 128) !== 0 && t1 < 256) + _this._pending.schedule$1(_this); + }, + set$_async$_onData(_onData) { + this._async$_onData = A._instanceType(this)._eval$1("~(_BufferingStreamSubscription.T)")._as(_onData); + }, + set$_pending(_pending) { + this._pending = A._instanceType(this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>?")._as(_pending); + }, + $isStreamSubscription: 1, + $is_EventSink: 1, + $is_EventDispatch: 1 + }; + A._BufferingStreamSubscription__sendError_sendError.prototype = { + call$0() { + var onError, t3, t4, + t1 = this.$this, + t2 = t1._async$_state; + if ((t2 & 8) !== 0 && (t2 & 16) === 0) + return; + t1._async$_state = (t2 | 64) >>> 0; + onError = t1._onError; + t2 = this.error; + t3 = type$.Object; + t4 = t1._zone; + if (type$.void_Function_Object_StackTrace._is(onError)) + t4.runBinaryGuarded$2$3(onError, t2, this.stackTrace, t3, type$.StackTrace); + else + t4.runUnaryGuarded$1$2(type$.void_Function_Object._as(onError), t2, t3); + t1._async$_state = (t1._async$_state & 4294967231) >>> 0; + }, + $signature: 0 + }; + A._BufferingStreamSubscription__sendDone_sendDone.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._async$_state; + if ((t2 & 16) === 0) + return; + t1._async$_state = (t2 | 74) >>> 0; + t1._zone.runGuarded$1(t1._onDone); + t1._async$_state = (t1._async$_state & 4294967231) >>> 0; + }, + $signature: 0 + }; + A._StreamImpl.prototype = { + listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) { + var t1 = A._instanceType(this); + t1._eval$1("~(1)?")._as(onData); + type$.nullable_void_Function._as(onDone); + return this._controller._subscribe$4(t1._eval$1("~(1)?")._as(onData), onError, onDone, cancelOnError === true); + }, + listen$3$onDone$onError(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + }, + listen$1(onData) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, null, null); + }, + listen$2$onDone(onData, onDone) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, null); + } + }; + A._DelayedEvent.prototype = { + set$next(next) { + this.next = type$.nullable__DelayedEvent_dynamic._as(next); + }, + get$next() { + return this.next; + } + }; + A._DelayedData.prototype = { + perform$1(dispatch) { + this.$ti._eval$1("_EventDispatch<1>")._as(dispatch)._sendData$1(this.value); + } + }; + A._DelayedError.prototype = { + perform$1(dispatch) { + dispatch._sendError$2(this.error, this.stackTrace); + } + }; + A._DelayedDone.prototype = { + perform$1(dispatch) { + dispatch._sendDone$0(); + }, + get$next() { + return null; + }, + set$next(_) { + throw A.wrapException(A.StateError$("No events after a done.")); + }, + $is_DelayedEvent: 1 + }; + A._PendingEvents.prototype = { + schedule$1(dispatch) { + var t1, _this = this; + _this.$ti._eval$1("_EventDispatch<1>")._as(dispatch); + if (_this._async$_state === 1) + return; + A.assertHelper(_this.lastPendingEvent != null); + t1 = _this._async$_state; + if (t1 >= 1) { + A.assertHelper(t1 === 3); + _this._async$_state = 1; + return; + } + A.scheduleMicrotask(new A._PendingEvents_schedule_closure(_this, dispatch)); + _this._async$_state = 1; + }, + add$1(_, $event) { + var _this = this, + lastEvent = _this.lastPendingEvent; + if (lastEvent == null) + _this.firstPendingEvent = _this.lastPendingEvent = $event; + else { + lastEvent.set$next($event); + _this.lastPendingEvent = $event; + } + } + }; + A._PendingEvents_schedule_closure.prototype = { + call$0() { + var t2, $event, nextEvent, + t1 = this.$this, + oldState = t1._async$_state; + t1._async$_state = 0; + if (oldState === 3) + return; + t2 = t1.$ti._eval$1("_EventDispatch<1>")._as(this.dispatch); + A.assertHelper(t1.lastPendingEvent != null); + $event = t1.firstPendingEvent; + nextEvent = $event.get$next(); + t1.firstPendingEvent = nextEvent; + if (nextEvent == null) + t1.lastPendingEvent = null; + $event.perform$1(t2); + }, + $signature: 0 + }; + A._DoneStreamSubscription.prototype = { + onData$1(handleData) { + this.$ti._eval$1("~(1)?")._as(handleData); + }, + onError$1(handleError) { + }, + pause$0() { + var t1 = this._async$_state; + if (t1 >= 0) + this._async$_state = t1 + 2; + }, + resume$0() { + var _this = this, + resumeState = _this._async$_state - 2; + if (resumeState < 0) + return; + if (resumeState === 0) { + _this._async$_state = 1; + A.scheduleMicrotask(_this.get$_onMicrotask()); + } else + _this._async$_state = resumeState; + }, + cancel$0() { + this._async$_state = -1; + this.set$_onDone(null); + return $.$get$Future__nullFuture(); + }, + _onMicrotask$0() { + var _0_0, _this = this, + unscheduledState = _this._async$_state - 1; + if (unscheduledState === 0) { + _this._async$_state = -1; + _0_0 = _this._onDone; + if (_0_0 != null) { + _this.set$_onDone(null); + _this._zone.runGuarded$1(_0_0); + } + } else + _this._async$_state = unscheduledState; + }, + set$_onDone(_onDone) { + this._onDone = type$.nullable_void_Function._as(_onDone); + }, + $isStreamSubscription: 1 + }; + A._StreamIterator.prototype = { + get$current() { + var _this = this; + if (_this._async$_hasValue) + return _this.$ti._precomputed1._as(_this._stateData); + return _this.$ti._precomputed1._as(null); + }, + moveNext$0() { + var future, _this = this, + subscription = _this._subscription; + if (subscription != null) { + if (_this._async$_hasValue) { + future = new A._Future($.Zone__current, type$._Future_bool); + _this._stateData = future; + _this._async$_hasValue = false; + subscription.resume$0(); + return future; + } + throw A.wrapException(A.StateError$("Already waiting for next.")); + } + return _this._initializeOrDone$0(); + }, + _initializeOrDone$0() { + var stateData, future, subscription, _this = this; + A.assertHelper(_this._subscription == null); + stateData = _this._stateData; + if (stateData != null) { + _this.$ti._eval$1("Stream<1>")._as(stateData); + future = new A._Future($.Zone__current, type$._Future_bool); + _this._stateData = future; + subscription = stateData.listen$4$cancelOnError$onDone$onError(_this.get$_async$_onData(), true, _this.get$_onDone(), _this.get$_onError()); + if (_this._stateData != null) + _this.set$_subscription(subscription); + return future; + } + return $.$get$Future__falseFuture(); + }, + cancel$0() { + var _this = this, + subscription = _this._subscription, + stateData = _this._stateData; + _this._stateData = null; + if (subscription != null) { + _this.set$_subscription(null); + if (!_this._async$_hasValue) + type$._Future_bool._as(stateData)._asyncComplete$1(false); + else + _this._async$_hasValue = false; + return subscription.cancel$0(); + } + return $.$get$Future__nullFuture(); + }, + _async$_onData$1(data) { + var moveNextFuture, t1, _this = this; + _this.$ti._precomputed1._as(data); + if (_this._subscription == null) + return; + moveNextFuture = type$._Future_bool._as(_this._stateData); + _this._stateData = data; + _this._async$_hasValue = true; + moveNextFuture._complete$1(true); + if (_this._async$_hasValue) { + t1 = _this._subscription; + if (t1 != null) + t1.pause$0(); + } + }, + _onError$2(error, stackTrace) { + var subscription, moveNextFuture, _this = this; + type$.Object._as(error); + type$.StackTrace._as(stackTrace); + subscription = _this._subscription; + moveNextFuture = type$._Future_bool._as(_this._stateData); + _this.set$_subscription(null); + _this._stateData = null; + if (subscription != null) + moveNextFuture._completeError$2(error, stackTrace); + else + moveNextFuture._asyncCompleteError$2(error, stackTrace); + }, + _onDone$0() { + var _this = this, + subscription = _this._subscription, + moveNextFuture = type$._Future_bool._as(_this._stateData); + _this.set$_subscription(null); + _this._stateData = null; + if (subscription != null) + moveNextFuture._completeWithValue$1(false); + else + moveNextFuture._asyncCompleteWithValue$1(false); + }, + set$_subscription(_subscription) { + this._subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription); + } + }; + A._cancelAndError_closure.prototype = { + call$0() { + return this.future._completeError$2(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._cancelAndErrorClosure_closure.prototype = { + call$2(error, stackTrace) { + A._cancelAndError(this.subscription, this.future, error, type$.StackTrace._as(stackTrace)); + }, + $signature: 6 + }; + A._cancelAndValue_closure.prototype = { + call$0() { + return this.future._complete$1(this.value); + }, + $signature: 0 + }; + A._ForwardingStream.prototype = { + listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) { + var t2, t3, t4, t5, t6, t7, + t1 = this.$ti; + t1._eval$1("~(2)?")._as(onData); + type$.nullable_void_Function._as(onDone); + t2 = t1._rest[1]; + t3 = $.Zone__current; + t4 = cancelOnError === true ? 1 : 0; + t5 = onError != null ? 32 : 0; + t6 = A._BufferingStreamSubscription__registerDataHandler(t3, onData, t2); + t7 = A._BufferingStreamSubscription__registerErrorHandler(t3, onError); + t1 = new A._ForwardingStreamSubscription(this, t6, t7, t3.registerCallback$1$1(onDone, type$.void), t3, t4 | t5, t1._eval$1("@<1>")._bind$1(t2)._eval$1("_ForwardingStreamSubscription<1,2>")); + t1.set$_subscription(this._async$_source.listen$3$onDone$onError(t1.get$_handleData(), t1.get$_handleDone(), t1.get$_handleError())); + return t1; + }, + listen$3$onDone$onError(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + } + }; + A._ForwardingStreamSubscription.prototype = { + _async$_add$1(data) { + this.$ti._rest[1]._as(data); + if ((this._async$_state & 2) !== 0) + return; + this.super$_BufferingStreamSubscription$_add(data); + }, + _addError$2(error, stackTrace) { + if ((this._async$_state & 2) !== 0) + return; + this.super$_BufferingStreamSubscription$_addError(error, stackTrace); + }, + _onPause$0() { + var t1 = this._subscription; + if (t1 != null) + t1.pause$0(); + }, + _onResume$0() { + var t1 = this._subscription; + if (t1 != null) + t1.resume$0(); + }, + _onCancel$0() { + var subscription = this._subscription; + if (subscription != null) { + this.set$_subscription(null); + return subscription.cancel$0(); + } + return null; + }, + _handleData$1(data) { + this._stream._handleData$2(this.$ti._precomputed1._as(data), this); + }, + _handleError$2(error, stackTrace) { + var t1; + type$.StackTrace._as(stackTrace); + t1 = error == null ? type$.Object._as(error) : error; + this._stream.$ti._eval$1("_EventSink<2>")._as(this)._addError$2(t1, stackTrace); + }, + _handleDone$0() { + this._stream.$ti._eval$1("_EventSink<2>")._as(this)._close$0(); + }, + set$_subscription(_subscription) { + this._subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription); + } + }; + A._MapStream.prototype = { + _handleData$2(inputEvent, sink) { + var outputEvent, e, s, exception, error, stackTrace, replacement, + t1 = this.$ti; + t1._precomputed1._as(inputEvent); + t1._eval$1("_EventSink<2>")._as(sink); + outputEvent = null; + try { + outputEvent = this._transform.call$1(inputEvent); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + error = e; + stackTrace = s; + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } + sink._addError$2(error, stackTrace); + return; + } + sink._async$_add$1(outputEvent); + } + }; + A._EventSinkWrapper.prototype = { + add$1(_, data) { + var t1 = this._async$_sink; + data = t1.$ti._rest[1]._as(this.$ti._precomputed1._as(data)); + if ((t1._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + t1.super$_BufferingStreamSubscription$_add(data); + }, + addError$2(error, stackTrace) { + var t1 = this._async$_sink; + if ((t1._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + t1.super$_BufferingStreamSubscription$_addError(error, stackTrace); + }, + close$0() { + var t1 = this._async$_sink; + if ((t1._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + t1.super$_BufferingStreamSubscription$_close(); + }, + $isEventSink: 1 + }; + A._SinkTransformerStreamSubscription.prototype = { + _onPause$0() { + var t1 = this._subscription; + if (t1 != null) + t1.pause$0(); + }, + _onResume$0() { + var t1 = this._subscription; + if (t1 != null) + t1.resume$0(); + }, + _onCancel$0() { + var subscription = this._subscription; + if (subscription != null) { + this.set$_subscription(null); + return subscription.cancel$0(); + } + return null; + }, + _handleData$1(data) { + var e, s, t1, exception, t2, _this = this; + _this.$ti._precomputed1._as(data); + try { + t1 = _this.___SinkTransformerStreamSubscription__transformerSink_A; + t1 === $ && A.throwLateFieldNI("_transformerSink"); + t1.add$1(0, data); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = type$.Object._as(e); + t2 = type$.StackTrace._as(s); + if ((_this._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + _this.super$_BufferingStreamSubscription$_addError(t1, t2); + } + }, + _handleError$2(error, stackTrace) { + var e, s, t2, t3, exception, _this = this, + _s24_ = "Stream is already closed", + t1 = type$.Object; + t1._as(error); + t2 = type$.StackTrace; + t2._as(stackTrace); + try { + t3 = _this.___SinkTransformerStreamSubscription__transformerSink_A; + t3 === $ && A.throwLateFieldNI("_transformerSink"); + t3.addError$2(error, stackTrace); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + if (e === error) { + if ((_this._async$_state & 2) !== 0) + A.throwExpression(A.StateError$(_s24_)); + _this.super$_BufferingStreamSubscription$_addError(error, stackTrace); + } else { + t1 = t1._as(e); + t2 = t2._as(s); + if ((_this._async$_state & 2) !== 0) + A.throwExpression(A.StateError$(_s24_)); + _this.super$_BufferingStreamSubscription$_addError(t1, t2); + } + } + }, + _handleDone$0() { + var e, s, t1, exception, t2, _this = this; + try { + _this.set$_subscription(null); + t1 = _this.___SinkTransformerStreamSubscription__transformerSink_A; + t1 === $ && A.throwLateFieldNI("_transformerSink"); + t1.close$0(); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = type$.Object._as(e); + t2 = type$.StackTrace._as(s); + if ((_this._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + _this.super$_BufferingStreamSubscription$_addError(t1, t2); + } + }, + set$___SinkTransformerStreamSubscription__transformerSink_A(___SinkTransformerStreamSubscription__transformerSink_A) { + this.___SinkTransformerStreamSubscription__transformerSink_A = this.$ti._eval$1("EventSink<1>")._as(___SinkTransformerStreamSubscription__transformerSink_A); + }, + set$_subscription(_subscription) { + this._subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription); + } + }; + A._StreamSinkTransformer.prototype = { + bind$1(stream) { + var t1 = this.$ti; + return new A._BoundSinkStream(this._sinkMapper, t1._eval$1("Stream<1>")._as(stream), t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("_BoundSinkStream<1,2>")); + } + }; + A._BoundSinkStream.prototype = { + listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) { + var t2, t3, t4, t5, t6, t7, subscription, + t1 = this.$ti; + t1._eval$1("~(2)?")._as(onData); + type$.nullable_void_Function._as(onDone); + t2 = t1._rest[1]; + t3 = $.Zone__current; + t4 = cancelOnError === true ? 1 : 0; + t5 = onError != null ? 32 : 0; + t6 = A._BufferingStreamSubscription__registerDataHandler(t3, onData, t2); + t7 = A._BufferingStreamSubscription__registerErrorHandler(t3, onError); + t2 = t1._eval$1("@<1>")._bind$1(t2); + subscription = new A._SinkTransformerStreamSubscription(t6, t7, t3.registerCallback$1$1(onDone, type$.void), t3, t4 | t5, t2._eval$1("_SinkTransformerStreamSubscription<1,2>")); + subscription.set$___SinkTransformerStreamSubscription__transformerSink_A(t2._eval$1("EventSink<1>")._as(this._sinkMapper.call$1(new A._EventSinkWrapper(subscription, t1._eval$1("_EventSinkWrapper<2>"))))); + subscription.set$_subscription(this._stream.listen$3$onDone$onError(subscription.get$_handleData(), subscription.get$_handleDone(), subscription.get$_handleError())); + return subscription; + }, + listen$3$onDone$onError(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + } + }; + A._HandlerEventSink.prototype = { + add$1(_, data) { + var sink, + t1 = this.$ti; + t1._precomputed1._as(data); + sink = this._async$_sink; + if (sink == null) + throw A.wrapException(A.StateError$("Sink is closed")); + data = sink.$ti._precomputed1._as(t1._rest[1]._as(data)); + t1 = sink._async$_sink; + t1.$ti._rest[1]._as(data); + if ((t1._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + t1.super$_BufferingStreamSubscription$_add(data); + }, + addError$2(error, stackTrace) { + var sink; + A.checkNotNullable(error, "error", type$.Object); + sink = this._async$_sink; + if (sink == null) + throw A.wrapException(A.StateError$("Sink is closed")); + sink.addError$2(error, stackTrace); + }, + close$0() { + var sink = this._async$_sink; + if (sink == null) + return; + this.set$_async$_sink(null); + this._handleDone.call$1(sink); + }, + set$_async$_sink(_sink) { + this._async$_sink = this.$ti._eval$1("EventSink<2>?")._as(_sink); + }, + $isEventSink: 1 + }; + A._StreamHandlerTransformer.prototype = { + bind$1(stream) { + return this.super$_StreamSinkTransformer$bind(this.$ti._eval$1("Stream<1>")._as(stream)); + } + }; + A._StreamHandlerTransformer_closure.prototype = { + call$1(outputSink) { + var _this = this, + t1 = _this.T; + return new A._HandlerEventSink(_this.handleData, _this.handleError, _this.handleDone, t1._eval$1("EventSink<0>")._as(outputSink), _this.S._eval$1("@<0>")._bind$1(t1)._eval$1("_HandlerEventSink<1,2>")); + }, + $signature() { + return this.S._eval$1("@<0>")._bind$1(this.T)._eval$1("_HandlerEventSink<1,2>(EventSink<2>)"); + } + }; + A._ZoneFunction.prototype = {}; + A._ZoneSpecification.prototype = {$isZoneSpecification: 1}; + A._ZoneDelegate.prototype = {$isZoneDelegate: 1}; + A._Zone.prototype = { + _processUncaughtError$3(zone, error, stackTrace) { + var implZone, handler, parentDelegate, parentZone, currentZone, e, s, implementation, t1, exception; + type$.StackTrace._as(stackTrace); + implementation = this.get$_handleUncaughtError(); + implZone = implementation.zone; + if (implZone === B.C__RootZone) { + A._rootHandleError(error, stackTrace); + return; + } + handler = implementation.$function; + parentDelegate = implZone.get$_parentDelegate(); + t1 = implZone.get$parent(); + t1.toString; + parentZone = t1; + currentZone = $.Zone__current; + try { + $.Zone__current = parentZone; + handler.call$5(implZone, parentDelegate, zone, error, stackTrace); + $.Zone__current = currentZone; + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + $.Zone__current = currentZone; + t1 = error === e ? stackTrace : s; + parentZone._processUncaughtError$3(implZone, e, t1); + } + }, + $isZone: 1 + }; + A._CustomZone.prototype = { + get$_async$_delegate() { + var t1 = this._delegateCache; + return t1 == null ? this._delegateCache = new A._ZoneDelegate(this) : t1; + }, + get$_parentDelegate() { + return this.parent.get$_async$_delegate(); + }, + get$errorZone() { + return this._handleUncaughtError.zone; + }, + runGuarded$1(f) { + var e, s, exception; + type$.void_Function._as(f); + try { + this.run$1$1(f, type$.void); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + runUnaryGuarded$1$2(f, arg, $T) { + var e, s, exception; + $T._eval$1("~(0)")._as(f); + $T._as(arg); + try { + this.runUnary$2$2(f, arg, type$.void, $T); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + runBinaryGuarded$2$3(f, arg1, arg2, T1, T2) { + var e, s, exception; + T1._eval$1("@<0>")._bind$1(T2)._eval$1("~(1,2)")._as(f); + T1._as(arg1); + T2._as(arg2); + try { + this.runBinary$3$3(f, arg1, arg2, type$.void, T1, T2); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + bindCallback$1$1(f, $R) { + return new A._CustomZone_bindCallback_closure(this, this.registerCallback$1$1($R._eval$1("0()")._as(f), $R), $R); + }, + bindUnaryCallback$2$1(f, $R, $T) { + return new A._CustomZone_bindUnaryCallback_closure(this, this.registerUnaryCallback$2$1($R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f), $R, $T), $T, $R); + }, + bindCallbackGuarded$1(f) { + return new A._CustomZone_bindCallbackGuarded_closure(this, this.registerCallback$1$1(type$.void_Function._as(f), type$.void)); + }, + bindUnaryCallbackGuarded$1$1(f, $T) { + return new A._CustomZone_bindUnaryCallbackGuarded_closure(this, this.registerUnaryCallback$2$1($T._eval$1("~(0)")._as(f), type$.void, $T), $T); + }, + $index(_, key) { + var value, + t1 = this._async$_map, + result = t1.$index(0, key); + if (result != null || t1.containsKey$1(key)) + return result; + value = this.parent.$index(0, key); + if (value != null) + t1.$indexSet(0, key, value); + return value; + }, + handleUncaughtError$2(error, stackTrace) { + this._processUncaughtError$3(this, error, type$.StackTrace._as(stackTrace)); + }, + fork$2$specification$zoneValues(specification, zoneValues) { + var implementation = this._fork, + t1 = implementation.zone; + return implementation.$function.call$5(t1, t1.get$_parentDelegate(), this, specification, zoneValues); + }, + run$1$1(f, $R) { + var implementation, t1; + $R._eval$1("0()")._as(f); + implementation = this._run; + t1 = implementation.zone; + return implementation.$function.call$1$4(t1, t1.get$_parentDelegate(), this, f, $R); + }, + runUnary$2$2(f, arg, $R, $T) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + $T._as(arg); + implementation = this._runUnary; + t1 = implementation.zone; + return implementation.$function.call$2$5(t1, t1.get$_parentDelegate(), this, f, arg, $R, $T); + }, + runBinary$3$3(f, arg1, arg2, $R, T1, T2) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + T1._as(arg1); + T2._as(arg2); + implementation = this._runBinary; + t1 = implementation.zone; + return implementation.$function.call$3$6(t1, t1.get$_parentDelegate(), this, f, arg1, arg2, $R, T1, T2); + }, + registerCallback$1$1(callback, $R) { + var implementation, t1; + $R._eval$1("0()")._as(callback); + implementation = this._registerCallback; + t1 = implementation.zone; + return implementation.$function.call$1$4(t1, t1.get$_parentDelegate(), this, callback, $R); + }, + registerUnaryCallback$2$1(callback, $R, $T) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(callback); + implementation = this._registerUnaryCallback; + t1 = implementation.zone; + return implementation.$function.call$2$4(t1, t1.get$_parentDelegate(), this, callback, $R, $T); + }, + registerBinaryCallback$3$1(callback, $R, T1, T2) { + var implementation, t1; + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(callback); + implementation = this._registerBinaryCallback; + t1 = implementation.zone; + return implementation.$function.call$3$4(t1, t1.get$_parentDelegate(), this, callback, $R, T1, T2); + }, + errorCallback$2(error, stackTrace) { + var implementation, implementationZone; + type$.nullable_StackTrace._as(stackTrace); + A.checkNotNullable(error, "error", type$.Object); + implementation = this._errorCallback; + implementationZone = implementation.zone; + if (implementationZone === B.C__RootZone) + return null; + return implementation.$function.call$5(implementationZone, implementationZone.get$_parentDelegate(), this, error, stackTrace); + }, + scheduleMicrotask$1(f) { + var implementation, t1; + type$.void_Function._as(f); + implementation = this._scheduleMicrotask; + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, f); + }, + createTimer$2(duration, f) { + var implementation, t1; + type$.void_Function._as(f); + implementation = this._createTimer; + t1 = implementation.zone; + return implementation.$function.call$5(t1, t1.get$_parentDelegate(), this, duration, f); + }, + print$1(line) { + var implementation = this._print, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, line); + }, + set$_handleUncaughtError(_handleUncaughtError) { + this._handleUncaughtError = type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace._as(_handleUncaughtError); + }, + get$_run() { + return this._run; + }, + get$_runUnary() { + return this._runUnary; + }, + get$_runBinary() { + return this._runBinary; + }, + get$_registerCallback() { + return this._registerCallback; + }, + get$_registerUnaryCallback() { + return this._registerUnaryCallback; + }, + get$_registerBinaryCallback() { + return this._registerBinaryCallback; + }, + get$_errorCallback() { + return this._errorCallback; + }, + get$_scheduleMicrotask() { + return this._scheduleMicrotask; + }, + get$_createTimer() { + return this._createTimer; + }, + get$_createPeriodicTimer() { + return this._createPeriodicTimer; + }, + get$_print() { + return this._print; + }, + get$_fork() { + return this._fork; + }, + get$_handleUncaughtError() { + return this._handleUncaughtError; + }, + get$parent() { + return this.parent; + }, + get$_async$_map() { + return this._async$_map; + } + }; + A._CustomZone_bindCallback_closure.prototype = { + call$0() { + return this.$this.run$1$1(this.registered, this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A._CustomZone_bindUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this, + t1 = _this.T; + return _this.$this.runUnary$2$2(_this.registered, t1._as(arg), _this.R, t1); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A._CustomZone_bindCallbackGuarded_closure.prototype = { + call$0() { + return this.$this.runGuarded$1(this.registered); + }, + $signature: 0 + }; + A._CustomZone_bindUnaryCallbackGuarded_closure.prototype = { + call$1(arg) { + var t1 = this.T; + return this.$this.runUnaryGuarded$1$2(this.registered, t1._as(arg), t1); + }, + $signature() { + return this.T._eval$1("~(0)"); + } + }; + A._rootHandleError_closure.prototype = { + call$0() { + A.Error_throwWithStackTrace(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._RootZone.prototype = { + get$_run() { + return B._ZoneFunction__RootZone__rootRun; + }, + get$_runUnary() { + return B._ZoneFunction__RootZone__rootRunUnary; + }, + get$_runBinary() { + return B._ZoneFunction__RootZone__rootRunBinary; + }, + get$_registerCallback() { + return B._ZoneFunction__RootZone__rootRegisterCallback; + }, + get$_registerUnaryCallback() { + return B._ZoneFunction_QOa; + }, + get$_registerBinaryCallback() { + return B._ZoneFunction_qxw; + }, + get$_errorCallback() { + return B._ZoneFunction__RootZone__rootErrorCallback; + }, + get$_scheduleMicrotask() { + return B._ZoneFunction__RootZone__rootScheduleMicrotask; + }, + get$_createTimer() { + return B._ZoneFunction__RootZone__rootCreateTimer; + }, + get$_createPeriodicTimer() { + return B._ZoneFunction_kWM; + }, + get$_print() { + return B._ZoneFunction__RootZone__rootPrint; + }, + get$_fork() { + return B._ZoneFunction__RootZone__rootFork; + }, + get$_handleUncaughtError() { + return B._ZoneFunction_NIe; + }, + get$parent() { + return null; + }, + get$_async$_map() { + return $.$get$_RootZone__rootMap(); + }, + get$_async$_delegate() { + var t1 = $._RootZone__rootDelegate; + return t1 == null ? $._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1; + }, + get$_parentDelegate() { + var t1 = $._RootZone__rootDelegate; + return t1 == null ? $._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1; + }, + get$errorZone() { + return this; + }, + runGuarded$1(f) { + var e, s, exception; + type$.void_Function._as(f); + try { + if (B.C__RootZone === $.Zone__current) { + f.call$0(); + return; + } + A._rootRun(null, null, this, f, type$.void); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + runUnaryGuarded$1$2(f, arg, $T) { + var e, s, exception; + $T._eval$1("~(0)")._as(f); + $T._as(arg); + try { + if (B.C__RootZone === $.Zone__current) { + f.call$1(arg); + return; + } + A._rootRunUnary(null, null, this, f, arg, type$.void, $T); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + runBinaryGuarded$2$3(f, arg1, arg2, T1, T2) { + var e, s, exception; + T1._eval$1("@<0>")._bind$1(T2)._eval$1("~(1,2)")._as(f); + T1._as(arg1); + T2._as(arg2); + try { + if (B.C__RootZone === $.Zone__current) { + f.call$2(arg1, arg2); + return; + } + A._rootRunBinary(null, null, this, f, arg1, arg2, type$.void, T1, T2); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(type$.Object._as(e), type$.StackTrace._as(s)); + } + }, + bindCallback$1$1(f, $R) { + return new A._RootZone_bindCallback_closure(this, $R._eval$1("0()")._as(f), $R); + }, + bindUnaryCallback$2$1(f, $R, $T) { + return new A._RootZone_bindUnaryCallback_closure(this, $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f), $T, $R); + }, + bindCallbackGuarded$1(f) { + return new A._RootZone_bindCallbackGuarded_closure(this, type$.void_Function._as(f)); + }, + bindUnaryCallbackGuarded$1$1(f, $T) { + return new A._RootZone_bindUnaryCallbackGuarded_closure(this, $T._eval$1("~(0)")._as(f), $T); + }, + $index(_, key) { + return null; + }, + handleUncaughtError$2(error, stackTrace) { + A._rootHandleError(error, type$.StackTrace._as(stackTrace)); + }, + fork$2$specification$zoneValues(specification, zoneValues) { + return A._rootFork(null, null, this, specification, zoneValues); + }, + run$1$1(f, $R) { + $R._eval$1("0()")._as(f); + if ($.Zone__current === B.C__RootZone) + return f.call$0(); + return A._rootRun(null, null, this, f, $R); + }, + runUnary$2$2(f, arg, $R, $T) { + $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + $T._as(arg); + if ($.Zone__current === B.C__RootZone) + return f.call$1(arg); + return A._rootRunUnary(null, null, this, f, arg, $R, $T); + }, + runBinary$3$3(f, arg1, arg2, $R, T1, T2) { + $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + T1._as(arg1); + T2._as(arg2); + if ($.Zone__current === B.C__RootZone) + return f.call$2(arg1, arg2); + return A._rootRunBinary(null, null, this, f, arg1, arg2, $R, T1, T2); + }, + registerCallback$1$1(f, $R) { + return $R._eval$1("0()")._as(f); + }, + registerUnaryCallback$2$1(f, $R, $T) { + return $R._eval$1("@<0>")._bind$1($T)._eval$1("1(2)")._as(f); + }, + registerBinaryCallback$3$1(f, $R, T1, T2) { + return $R._eval$1("@<0>")._bind$1(T1)._bind$1(T2)._eval$1("1(2,3)")._as(f); + }, + errorCallback$2(error, stackTrace) { + type$.nullable_StackTrace._as(stackTrace); + return null; + }, + scheduleMicrotask$1(f) { + A._rootScheduleMicrotask(null, null, this, type$.void_Function._as(f)); + }, + createTimer$2(duration, f) { + return A.Timer__createTimer(duration, type$.void_Function._as(f)); + }, + print$1(line) { + A.printString(line); + } + }; + A._RootZone_bindCallback_closure.prototype = { + call$0() { + return this.$this.run$1$1(this.f, this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A._RootZone_bindUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this, + t1 = _this.T; + return _this.$this.runUnary$2$2(_this.f, t1._as(arg), _this.R, t1); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A._RootZone_bindCallbackGuarded_closure.prototype = { + call$0() { + return this.$this.runGuarded$1(this.f); + }, + $signature: 0 + }; + A._RootZone_bindUnaryCallbackGuarded_closure.prototype = { + call$1(arg) { + var t1 = this.T; + return this.$this.runUnaryGuarded$1$2(this.f, t1._as(arg), t1); + }, + $signature() { + return this.T._eval$1("~(0)"); + } + }; + A._HashMap.prototype = { + get$length(_) { + return this._collection$_length; + }, + get$isEmpty(_) { + return this._collection$_length === 0; + }, + get$keys() { + return new A._HashMapKeyIterable(this, A._instanceType(this)._eval$1("_HashMapKeyIterable<1>")); + }, + get$values() { + var t1 = A._instanceType(this); + return A.MappedIterable_MappedIterable(new A._HashMapKeyIterable(this, t1._eval$1("_HashMapKeyIterable<1>")), new A._HashMap_values_closure(this), t1._precomputed1, t1._rest[1]); + }, + containsKey$1(key) { + var strings, nums; + if (typeof key == "string" && key !== "__proto__") { + strings = this._collection$_strings; + return strings == null ? false : strings[key] != null; + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = this._collection$_nums; + return nums == null ? false : nums[key] != null; + } else + return this._containsKey$1(key); + }, + _containsKey$1(key) { + var rest = this._collection$_rest; + if (rest == null) + return false; + return this._findBucketIndex$2(this._getBucket$2(rest, key), key) >= 0; + }, + $index(_, key) { + var strings, t1, nums; + if (typeof key == "string" && key !== "__proto__") { + strings = this._collection$_strings; + t1 = strings == null ? null : A._HashMap__getTableEntry(strings, key); + return t1; + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = this._collection$_nums; + t1 = nums == null ? null : A._HashMap__getTableEntry(nums, key); + return t1; + } else + return this._get$1(key); + }, + _get$1(key) { + var bucket, index, + rest = this._collection$_rest; + if (rest == null) + return null; + bucket = this._getBucket$2(rest, key); + index = this._findBucketIndex$2(bucket, key); + return index < 0 ? null : bucket[index + 1]; + }, + $indexSet(_, key, value) { + var strings, nums, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + if (typeof key == "string" && key !== "__proto__") { + strings = _this._collection$_strings; + _this._collection$_addHashTableEntry$3(strings == null ? _this._collection$_strings = A._HashMap__newHashTable() : strings, key, value); + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = _this._collection$_nums; + _this._collection$_addHashTableEntry$3(nums == null ? _this._collection$_nums = A._HashMap__newHashTable() : nums, key, value); + } else + _this._set$2(key, value); + }, + _set$2(key, value) { + var rest, hash, bucket, index, _this = this, + t1 = A._instanceType(_this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + rest = _this._collection$_rest; + if (rest == null) + rest = _this._collection$_rest = A._HashMap__newHashTable(); + hash = _this._computeHashCode$1(key); + bucket = rest[hash]; + if (bucket == null) { + A._HashMap__setTableEntry(rest, hash, [key, value]); + ++_this._collection$_length; + _this._collection$_keys = null; + } else { + index = _this._findBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index + 1] = value; + else { + bucket.push(key, value); + ++_this._collection$_length; + _this._collection$_keys = null; + } + } + }, + forEach$1(_, action) { + var keys, $length, t2, i, key, t3, _this = this, + t1 = A._instanceType(_this); + t1._eval$1("~(1,2)")._as(action); + keys = _this._computeKeys$0(); + for ($length = keys.length, t2 = t1._precomputed1, t1 = t1._rest[1], i = 0; i < $length; ++i) { + key = keys[i]; + t2._as(key); + t3 = _this.$index(0, key); + action.call$2(key, t3 == null ? t1._as(t3) : t3); + if (keys !== _this._collection$_keys) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + }, + _computeKeys$0() { + var strings, names, entries, index, i, nums, rest, bucket, $length, i0, _this = this, + result = _this._collection$_keys; + if (result != null) + return result; + result = A.List_List$filled(_this._collection$_length, null, false, type$.dynamic); + strings = _this._collection$_strings; + if (strings != null) { + names = Object.getOwnPropertyNames(strings); + entries = names.length; + for (index = 0, i = 0; i < entries; ++i) { + result[index] = names[i]; + ++index; + } + } else + index = 0; + nums = _this._collection$_nums; + if (nums != null) { + names = Object.getOwnPropertyNames(nums); + entries = names.length; + for (i = 0; i < entries; ++i) { + result[index] = +names[i]; + ++index; + } + } + rest = _this._collection$_rest; + if (rest != null) { + names = Object.getOwnPropertyNames(rest); + entries = names.length; + for (i = 0; i < entries; ++i) { + bucket = rest[names[i]]; + $length = bucket.length; + for (i0 = 0; i0 < $length; i0 += 2) { + result[index] = bucket[i0]; + ++index; + } + } + } + A.assertHelper(index === _this._collection$_length); + return _this._collection$_keys = result; + }, + _collection$_addHashTableEntry$3(table, key, value) { + var t1 = A._instanceType(this); + t1._precomputed1._as(key); + t1._rest[1]._as(value); + if (table[key] == null) { + ++this._collection$_length; + this._collection$_keys = null; + } + A._HashMap__setTableEntry(table, key, value); + }, + _computeHashCode$1(key) { + return J.get$hashCode$(key) & 1073741823; + }, + _getBucket$2(table, key) { + return table[this._computeHashCode$1(key)]; + }, + _findBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; i += 2) + if (J.$eq$(bucket[i], key)) + return i; + return -1; + } + }; + A._HashMap_values_closure.prototype = { + call$1(each) { + var t1 = this.$this, + t2 = A._instanceType(t1); + t1 = t1.$index(0, t2._precomputed1._as(each)); + return t1 == null ? t2._rest[1]._as(t1) : t1; + }, + $signature() { + return A._instanceType(this.$this)._eval$1("2(1)"); + } + }; + A._IdentityHashMap.prototype = { + _computeHashCode$1(key) { + return A.objectHashCode(key) & 1073741823; + }, + _findBucketIndex$2(bucket, key) { + var $length, i, t1; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; i += 2) { + t1 = bucket[i]; + if (t1 == null ? key == null : t1 === key) + return i; + } + return -1; + } + }; + A._HashMapKeyIterable.prototype = { + get$length(_) { + return this._collection$_map._collection$_length; + }, + get$isEmpty(_) { + return this._collection$_map._collection$_length === 0; + }, + get$iterator(_) { + var t1 = this._collection$_map; + return new A._HashMapKeyIterator(t1, t1._computeKeys$0(), this.$ti._eval$1("_HashMapKeyIterator<1>")); + } + }; + A._HashMapKeyIterator.prototype = { + get$current() { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + keys = _this._collection$_keys, + offset = _this._offset, + t1 = _this._collection$_map; + if (keys !== t1._collection$_keys) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + else if (offset >= keys.length) { + _this.set$_collection$_current(null); + return false; + } else { + _this.set$_collection$_current(keys[offset]); + _this._offset = offset + 1; + return true; + } + }, + set$_collection$_current(_current) { + this._collection$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A._LinkedHashSet.prototype = { + get$iterator(_) { + var _this = this, + t1 = new A._LinkedHashSetIterator(_this, _this._collection$_modifications, _this.$ti._eval$1("_LinkedHashSetIterator<1>")); + t1._collection$_cell = _this._collection$_first; + return t1; + }, + get$length(_) { + return this._collection$_length; + }, + get$isEmpty(_) { + return this._collection$_length === 0; + }, + contains$1(_, object) { + var strings, t1; + if (object !== "__proto__") { + strings = this._collection$_strings; + if (strings == null) + return false; + return type$.nullable__LinkedHashSetCell._as(strings[object]) != null; + } else { + t1 = this._contains$1(object); + return t1; + } + }, + _contains$1(object) { + var rest = this._collection$_rest; + if (rest == null) + return false; + return this._findBucketIndex$2(rest[B.JSString_methods.get$hashCode(object) & 1073741823], object) >= 0; + }, + get$first(_) { + var first = this._collection$_first; + if (first == null) + throw A.wrapException(A.StateError$("No elements")); + return this.$ti._precomputed1._as(first._element); + }, + get$last(_) { + var last = this._collection$_last; + if (last == null) + throw A.wrapException(A.StateError$("No elements")); + return this.$ti._precomputed1._as(last._element); + }, + add$1(_, element) { + var strings, nums, _this = this; + _this.$ti._precomputed1._as(element); + if (typeof element == "string" && element !== "__proto__") { + strings = _this._collection$_strings; + return _this._collection$_addHashTableEntry$2(strings == null ? _this._collection$_strings = A._LinkedHashSet__newHashTable() : strings, element); + } else if (typeof element == "number" && (element & 1073741823) === element) { + nums = _this._collection$_nums; + return _this._collection$_addHashTableEntry$2(nums == null ? _this._collection$_nums = A._LinkedHashSet__newHashTable() : nums, element); + } else + return _this._add$1(element); + }, + _add$1(element) { + var rest, hash, bucket, t1, _this = this; + _this.$ti._precomputed1._as(element); + rest = _this._collection$_rest; + if (rest == null) + rest = _this._collection$_rest = A._LinkedHashSet__newHashTable(); + hash = J.get$hashCode$(element) & 1073741823; + bucket = rest[hash]; + if (bucket == null) { + t1 = [_this._collection$_newLinkedCell$1(element)]; + A.assertHelper(t1 != null); + rest[hash] = t1; + } else { + if (_this._findBucketIndex$2(bucket, element) >= 0) + return false; + bucket.push(_this._collection$_newLinkedCell$1(element)); + } + return true; + }, + remove$1(_, object) { + var t1; + if (typeof object == "string" && object !== "__proto__") + return this._removeHashTableEntry$2(this._collection$_strings, object); + else { + t1 = this._remove$1(object); + return t1; + } + }, + _remove$1(object) { + var hash, bucket, index, cell, + rest = this._collection$_rest; + if (rest == null) + return false; + hash = J.get$hashCode$(object) & 1073741823; + bucket = rest[hash]; + index = this._findBucketIndex$2(bucket, object); + if (index < 0) + return false; + cell = bucket.splice(index, 1)[0]; + if (0 === bucket.length) + delete rest[hash]; + this._unlinkCell$1(cell); + return true; + }, + _collection$_addHashTableEntry$2(table, element) { + this.$ti._precomputed1._as(element); + if (type$.nullable__LinkedHashSetCell._as(table[element]) != null) + return false; + table[element] = this._collection$_newLinkedCell$1(element); + return true; + }, + _removeHashTableEntry$2(table, element) { + var cell; + if (table == null) + return false; + cell = type$.nullable__LinkedHashSetCell._as(table[element]); + if (cell == null) + return false; + this._unlinkCell$1(cell); + delete table[element]; + return true; + }, + _collection$_modified$0() { + this._collection$_modifications = this._collection$_modifications + 1 & 1073741823; + }, + _collection$_newLinkedCell$1(element) { + var t1, _this = this, + cell = new A._LinkedHashSetCell(_this.$ti._precomputed1._as(element)); + if (_this._collection$_first == null) + _this._collection$_first = _this._collection$_last = cell; + else { + t1 = _this._collection$_last; + t1.toString; + cell._collection$_previous = t1; + _this._collection$_last = t1._collection$_next = cell; + } + ++_this._collection$_length; + _this._collection$_modified$0(); + return cell; + }, + _unlinkCell$1(cell) { + var _this = this, + previous = cell._collection$_previous, + next = cell._collection$_next; + if (previous == null) { + A.assertHelper(cell === _this._collection$_first); + _this._collection$_first = next; + } else + previous._collection$_next = next; + if (next == null) { + A.assertHelper(cell === _this._collection$_last); + _this._collection$_last = previous; + } else + next._collection$_previous = previous; + --_this._collection$_length; + _this._collection$_modified$0(); + }, + _findBucketIndex$2(bucket, element) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i]._element, element)) + return i; + return -1; + } + }; + A._LinkedHashSetCell.prototype = {}; + A._LinkedHashSetIterator.prototype = { + get$current() { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + cell = _this._collection$_cell, + t1 = _this._set; + if (_this._collection$_modifications !== t1._collection$_modifications) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + else if (cell == null) { + _this.set$_collection$_current(null); + return false; + } else { + _this.set$_collection$_current(_this.$ti._eval$1("1?")._as(cell._element)); + _this._collection$_cell = cell._collection$_next; + return true; + } + }, + set$_collection$_current(_current) { + this._collection$_current = this.$ti._eval$1("1?")._as(_current); + }, + $isIterator: 1 + }; + A.HashMap_HashMap$from_closure.prototype = { + call$2(k, v) { + this.result.$indexSet(0, this.K._as(k), this.V._as(v)); + }, + $signature: 54 + }; + A.LinkedList.prototype = { + remove$1(_, entry) { + this.$ti._precomputed1._as(entry); + if (entry._list !== this) + return false; + this._unlink$1(entry); + return true; + }, + get$iterator(_) { + var _this = this; + return new A._LinkedListIterator(_this, _this._modificationCount, _this._collection$_first, _this.$ti._eval$1("_LinkedListIterator<1>")); + }, + get$length(_) { + return this._collection$_length; + }, + get$first(_) { + var t1; + if (this._collection$_length === 0) + throw A.wrapException(A.StateError$("No such element")); + t1 = this._collection$_first; + t1.toString; + return t1; + }, + get$last(_) { + var t1; + if (this._collection$_length === 0) + throw A.wrapException(A.StateError$("No such element")); + t1 = this._collection$_first._collection$_previous; + t1.toString; + return t1; + }, + get$isEmpty(_) { + return this._collection$_length === 0; + }, + _insertBefore$3$updateFirst(entry, newEntry, updateFirst) { + var _this = this, + t1 = _this.$ti; + t1._eval$1("1?")._as(entry); + t1._precomputed1._as(newEntry); + if (newEntry._list != null) + throw A.wrapException(A.StateError$("LinkedListEntry is already in a LinkedList")); + ++_this._modificationCount; + newEntry.set$_list(_this); + if (_this._collection$_length === 0) { + A.assertHelper(entry == null); + newEntry.set$_collection$_next(newEntry); + newEntry.set$_collection$_previous(newEntry); + _this.set$_collection$_first(newEntry); + ++_this._collection$_length; + return; + } + t1 = entry._collection$_previous; + t1.toString; + newEntry.set$_collection$_previous(t1); + newEntry.set$_collection$_next(entry); + t1.set$_collection$_next(newEntry); + entry.set$_collection$_previous(newEntry); + ++_this._collection$_length; + }, + _unlink$1(entry) { + var t1, next, _this = this, _null = null; + _this.$ti._precomputed1._as(entry); + ++_this._modificationCount; + entry._collection$_next.set$_collection$_previous(entry._collection$_previous); + t1 = entry._collection$_previous; + next = entry._collection$_next; + t1.set$_collection$_next(next); + --_this._collection$_length; + entry.set$_collection$_previous(_null); + entry.set$_collection$_next(_null); + entry.set$_list(_null); + if (_this._collection$_length === 0) + _this.set$_collection$_first(_null); + else if (entry === _this._collection$_first) + _this.set$_collection$_first(next); + }, + set$_collection$_first(_first) { + this._collection$_first = this.$ti._eval$1("1?")._as(_first); + } + }; + A._LinkedListIterator.prototype = { + get$current() { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + t1 = _this._list; + if (_this._modificationCount !== t1._modificationCount) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + if (t1._collection$_length !== 0) + t1 = _this._visitedFirst && _this._collection$_next === t1.get$first(0); + else + t1 = true; + if (t1) { + _this.set$_collection$_current(null); + return false; + } + _this._visitedFirst = true; + _this.set$_collection$_current(_this._collection$_next); + _this.set$_collection$_next(_this._collection$_next._collection$_next); + return true; + }, + set$_collection$_current(_current) { + this._collection$_current = this.$ti._eval$1("1?")._as(_current); + }, + set$_collection$_next(_next) { + this._collection$_next = this.$ti._eval$1("1?")._as(_next); + }, + $isIterator: 1 + }; + A.LinkedListEntry.prototype = { + get$previous() { + var t1 = this._list; + if (t1 == null || this === t1.get$first(0)) + return null; + return this._collection$_previous; + }, + set$_list(_list) { + this._list = A._instanceType(this)._eval$1("LinkedList?")._as(_list); + }, + set$_collection$_next(_next) { + this._collection$_next = A._instanceType(this)._eval$1("LinkedListEntry.E?")._as(_next); + }, + set$_collection$_previous(_previous) { + this._collection$_previous = A._instanceType(this)._eval$1("LinkedListEntry.E?")._as(_previous); + } + }; + A.ListBase.prototype = { + get$iterator(receiver) { + return new A.ListIterator(receiver, this.get$length(receiver), A.instanceType(receiver)._eval$1("ListIterator")); + }, + elementAt$1(receiver, index) { + return this.$index(receiver, index); + }, + get$isEmpty(receiver) { + return this.get$length(receiver) === 0; + }, + get$first(receiver) { + if (this.get$length(receiver) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return this.$index(receiver, 0); + }, + get$last(receiver) { + if (this.get$length(receiver) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return this.$index(receiver, this.get$length(receiver) - 1); + }, + map$1$1(receiver, f, $T) { + var t1 = A.instanceType(receiver); + return new A.MappedListIterable(receiver, t1._bind$1($T)._eval$1("1(ListBase.E)")._as(f), t1._eval$1("@")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + skip$1(receiver, count) { + return A.SubListIterable$(receiver, count, null, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + take$1(receiver, count) { + return A.SubListIterable$(receiver, 0, A.checkNotNullable(count, "count", type$.int), A.instanceType(receiver)._eval$1("ListBase.E")); + }, + toList$1$growable(receiver, growable) { + var t1, first, result, i, _this = this; + if (_this.get$isEmpty(receiver)) { + t1 = J.JSArray_JSArray$growable(0, A.instanceType(receiver)._eval$1("ListBase.E")); + return t1; + } + first = _this.$index(receiver, 0); + result = A.List_List$filled(_this.get$length(receiver), first, true, A.instanceType(receiver)._eval$1("ListBase.E")); + for (i = 1; i < _this.get$length(receiver); ++i) + B.JSArray_methods.$indexSet(result, i, _this.$index(receiver, i)); + return result; + }, + toList$0(receiver) { + return this.toList$1$growable(receiver, true); + }, + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A.instanceType(receiver)._eval$1("@")._bind$1($R)._eval$1("CastList<1,2>")); + }, + sublist$2(receiver, start, end) { + var listLength = this.get$length(receiver); + A.RangeError_checkValidRange(start, end, listLength); + return A.List_List$from(this.getRange$2(receiver, start, end), true, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + getRange$2(receiver, start, end) { + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + return A.SubListIterable$(receiver, start, end, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + fillRange$3(receiver, start, end, fill) { + var i; + A.instanceType(receiver)._eval$1("ListBase.E?")._as(fill); + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + for (i = start; i < end; ++i) + this.$indexSet(receiver, i, fill); + }, + setRange$4(receiver, start, end, iterable, skipCount) { + var $length, otherStart, otherList, i, + t1 = A.instanceType(receiver); + t1._eval$1("Iterable")._as(iterable); + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + $length = end - start; + if ($length === 0) + return; + A.RangeError_checkNotNegative(skipCount, "skipCount"); + if (t1._eval$1("List")._is(iterable)) { + otherStart = skipCount; + otherList = iterable; + } else { + otherList = J.skip$1$ax(iterable, skipCount).toList$1$growable(0, false); + otherStart = 0; + } + t1 = J.getInterceptor$asx(otherList); + if (otherStart + $length > t1.get$length(otherList)) + throw A.wrapException(A.IterableElementError_tooFew()); + if (otherStart < start) + for (i = $length - 1; i >= 0; --i) + this.$indexSet(receiver, start + i, t1.$index(otherList, otherStart + i)); + else + for (i = 0; i < $length; ++i) + this.$indexSet(receiver, start + i, t1.$index(otherList, otherStart + i)); + }, + setRange$3(receiver, start, end, iterable) { + return this.setRange$4(receiver, start, end, iterable, 0); + }, + setAll$2(receiver, index, iterable) { + var t1, index0; + A.instanceType(receiver)._eval$1("Iterable")._as(iterable); + if (type$.List_dynamic._is(iterable)) + this.setRange$3(receiver, index, index + iterable.length, iterable); + else + for (t1 = J.get$iterator$ax(iterable); t1.moveNext$0(); index = index0) { + index0 = index + 1; + this.$indexSet(receiver, index, t1.get$current()); + } + }, + toString$0(receiver) { + return A.Iterable_iterableToFullString(receiver, "[", "]"); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.MapBase.prototype = { + forEach$1(_, action) { + var t2, key, t3, + t1 = A._instanceType(this); + t1._eval$1("~(MapBase.K,MapBase.V)")._as(action); + for (t2 = J.get$iterator$ax(this.get$keys()), t1 = t1._eval$1("MapBase.V"); t2.moveNext$0();) { + key = t2.get$current(); + t3 = this.$index(0, key); + action.call$2(key, t3 == null ? t1._as(t3) : t3); + } + }, + get$entries() { + return J.map$1$1$ax(this.get$keys(), new A.MapBase_entries_closure(this), A._instanceType(this)._eval$1("MapEntry")); + }, + get$length(_) { + return J.get$length$asx(this.get$keys()); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.get$keys()); + }, + get$values() { + var t1 = A._instanceType(this); + return new A._MapBaseValueIterable(this, t1._eval$1("@")._bind$1(t1._eval$1("MapBase.V"))._eval$1("_MapBaseValueIterable<1,2>")); + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + $isMap: 1 + }; + A.MapBase_entries_closure.prototype = { + call$1(key) { + var t1 = this.$this, + t2 = A._instanceType(t1); + t2._eval$1("MapBase.K")._as(key); + t1 = t1.$index(0, key); + if (t1 == null) + t1 = t2._eval$1("MapBase.V")._as(t1); + return new A.MapEntry(key, t1, t2._eval$1("@")._bind$1(t2._eval$1("MapBase.V"))._eval$1("MapEntry<1,2>")); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("MapEntry(MapBase.K)"); + } + }; + A.MapBase_mapToString_closure.prototype = { + call$2(k, v) { + var t2, + t1 = this._box_0; + if (!t1.first) + this.result._contents += ", "; + t1.first = false; + t1 = this.result; + t2 = A.S(k); + t2 = t1._contents += t2; + t1._contents = t2 + ": "; + t2 = A.S(v); + t1._contents += t2; + }, + $signature: 61 + }; + A._MapBaseValueIterable.prototype = { + get$length(_) { + var t1 = this._collection$_map; + return t1.get$length(t1); + }, + get$isEmpty(_) { + var t1 = this._collection$_map; + return t1.get$isEmpty(t1); + }, + get$first(_) { + var t1 = this._collection$_map; + t1 = t1.$index(0, J.get$first$ax(t1.get$keys())); + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + get$last(_) { + var t1 = this._collection$_map; + t1 = t1.$index(0, J.get$last$ax(t1.get$keys())); + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + get$iterator(_) { + var t1 = this._collection$_map, + t2 = this.$ti; + return new A._MapBaseValueIterator(J.get$iterator$ax(t1.get$keys()), t1, t2._eval$1("@<1>")._bind$1(t2._rest[1])._eval$1("_MapBaseValueIterator<1,2>")); + } + }; + A._MapBaseValueIterator.prototype = { + moveNext$0() { + var _this = this, + t1 = _this._collection$_keys; + if (t1.moveNext$0()) { + _this.set$_collection$_current(_this._collection$_map.$index(0, t1.get$current())); + return true; + } + _this.set$_collection$_current(null); + return false; + }, + get$current() { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + set$_collection$_current(_current) { + this._collection$_current = this.$ti._eval$1("2?")._as(_current); + }, + $isIterator: 1 + }; + A._UnmodifiableMapMixin.prototype = {}; + A.MapView.prototype = { + $index(_, key) { + return this._collection$_map.$index(0, key); + }, + forEach$1(_, action) { + this._collection$_map.forEach$1(0, this.$ti._eval$1("~(1,2)")._as(action)); + }, + get$length(_) { + return this._collection$_map.__js_helper$_length; + }, + get$keys() { + var t1 = this._collection$_map; + return new A.LinkedHashMapKeyIterable(t1, t1.$ti._eval$1("LinkedHashMapKeyIterable<1>")); + }, + toString$0(_) { + return A.MapBase_mapToString(this._collection$_map); + }, + get$values() { + return this._collection$_map.get$values(); + }, + get$entries() { + return this._collection$_map.get$entries(); + }, + $isMap: 1 + }; + A.UnmodifiableMapView.prototype = {}; + A.SetBase.prototype = { + get$isEmpty(_) { + return this._collection$_length === 0; + }, + map$1$1(_, f, $T) { + var t1 = this.$ti; + return new A.EfficientLengthMappedIterable(this, t1._bind$1($T)._eval$1("1(2)")._as(f), t1._eval$1("@<1>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); + }, + toString$0(_) { + return A.Iterable_iterableToFullString(this, "{", "}"); + }, + take$1(_, n) { + return A.TakeIterable_TakeIterable(this, n, this.$ti._precomputed1); + }, + skip$1(_, n) { + return A.SkipIterable_SkipIterable(this, n, this.$ti._precomputed1); + }, + get$first(_) { + var t1, + it = A._LinkedHashSetIterator$(this, this._collection$_modifications, this.$ti._precomputed1); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + t1 = it._collection$_current; + return t1 == null ? it.$ti._precomputed1._as(t1) : t1; + }, + get$last(_) { + var t1, result, + it = A._LinkedHashSetIterator$(this, this._collection$_modifications, this.$ti._precomputed1); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + t1 = it.$ti._precomputed1; + do { + result = it._collection$_current; + if (result == null) + result = t1._as(result); + } while (it.moveNext$0()); + return result; + }, + elementAt$1(_, index) { + var iterator, skipCount, t1, _this = this; + A.RangeError_checkNotNegative(index, "index"); + iterator = A._LinkedHashSetIterator$(_this, _this._collection$_modifications, _this.$ti._precomputed1); + for (skipCount = index; iterator.moveNext$0();) { + if (skipCount === 0) { + t1 = iterator._collection$_current; + return t1 == null ? iterator.$ti._precomputed1._as(t1) : t1; + } + --skipCount; + } + throw A.wrapException(A.IndexError$withLength(index, index - skipCount, _this, null, "index")); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isSet: 1 + }; + A._SetBase.prototype = {}; + A._UnmodifiableMapView_MapView__UnmodifiableMapMixin.prototype = {}; + A._Utf8Decoder__decoder_closure.prototype = { + call$0() { + var t1, exception; + try { + t1 = new TextDecoder("utf-8", {fatal: true}); + return t1; + } catch (exception) { + } + return null; + }, + $signature: 23 + }; + A._Utf8Decoder__decoderNonfatal_closure.prototype = { + call$0() { + var t1, exception; + try { + t1 = new TextDecoder("utf-8", {fatal: false}); + return t1; + } catch (exception) { + } + return null; + }, + $signature: 23 + }; + A.AsciiCodec.prototype = { + encode$1(source) { + return B.AsciiEncoder_127.convert$1(source); + } + }; + A._UnicodeSubsetEncoder.prototype = { + convert$1(string) { + var stringLength, $length, result, t1, i, codeUnit; + A._asString(string); + stringLength = string.length; + $length = A.RangeError_checkValidRange(0, null, stringLength) - 0; + result = new Uint8Array($length); + for (t1 = ~this._subsetMask, i = 0; i < $length; ++i) { + if (!(i < stringLength)) + return A.ioore(string, i); + codeUnit = string.charCodeAt(i); + if ((codeUnit & t1) !== 0) + throw A.wrapException(A.ArgumentError$value(string, "string", "Contains invalid characters.")); + if (!(i < $length)) + return A.ioore(result, i); + result[i] = codeUnit; + } + return result; + } + }; + A.AsciiEncoder.prototype = {}; + A.Base64Codec.prototype = { + normalize$3(source, start, end) { + var inverseAlphabet, t2, i, sliceStart, buffer, firstPadding, firstPaddingSourceIndex, paddingCount, i0, char, i1, digit1, t3, digit2, char0, value, t4, endLength, $length, + _s64_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", + _s31_ = "Invalid base64 encoding length ", + t1 = source.length; + end = A.RangeError_checkValidRange(start, end, t1); + inverseAlphabet = $.$get$_Base64Decoder__inverseAlphabet(); + for (t2 = inverseAlphabet.length, i = start, sliceStart = i, buffer = null, firstPadding = -1, firstPaddingSourceIndex = -1, paddingCount = 0; i < end; i = i0) { + i0 = i + 1; + if (!(i < t1)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 37) { + i1 = i0 + 2; + if (i1 <= end) { + A.assertHelper(i1 <= t1); + if (!(i0 < t1)) + return A.ioore(source, i0); + digit1 = A.hexDigitValue(source.charCodeAt(i0)); + t3 = i0 + 1; + if (!(t3 < t1)) + return A.ioore(source, t3); + digit2 = A.hexDigitValue(source.charCodeAt(t3)); + char0 = digit1 * 16 + digit2 - (digit2 & 256); + if (char0 === 37) + char0 = -1; + i0 = i1; + } else + char0 = -1; + } else + char0 = char; + if (0 <= char0 && char0 <= 127) { + if (!(char0 >= 0 && char0 < t2)) + return A.ioore(inverseAlphabet, char0); + value = inverseAlphabet[char0]; + if (value >= 0) { + if (!(value < 64)) + return A.ioore(_s64_, value); + char0 = _s64_.charCodeAt(value); + if (char0 === char) + continue; + char = char0; + } else { + if (value === -1) { + if (firstPadding < 0) { + t3 = buffer == null ? null : buffer._contents.length; + if (t3 == null) + t3 = 0; + firstPadding = t3 + (i - sliceStart); + firstPaddingSourceIndex = i; + } + ++paddingCount; + if (char === 61) + continue; + } + char = char0; + } + if (value !== -2) { + if (buffer == null) { + buffer = new A.StringBuffer(""); + t3 = buffer; + } else + t3 = buffer; + t3._contents += B.JSString_methods.substring$2(source, sliceStart, i); + t4 = A.Primitives_stringFromCharCode(char); + t3._contents += t4; + sliceStart = i0; + continue; + } + } + throw A.wrapException(A.FormatException$("Invalid base64 data", source, i)); + } + if (buffer != null) { + t1 = B.JSString_methods.substring$2(source, sliceStart, end); + t1 = buffer._contents += t1; + t2 = t1.length; + if (firstPadding >= 0) + A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, t2); + else { + endLength = B.JSInt_methods.$mod(t2 - 1, 4) + 1; + if (endLength === 1) + throw A.wrapException(A.FormatException$(_s31_, source, end)); + for (; endLength < 4;) { + t1 += "="; + buffer._contents = t1; + ++endLength; + } + } + t1 = buffer._contents; + return B.JSString_methods.replaceRange$3(source, start, end, t1.charCodeAt(0) == 0 ? t1 : t1); + } + $length = end - start; + if (firstPadding >= 0) + A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, $length); + else { + endLength = B.JSInt_methods.$mod($length, 4); + if (endLength === 1) + throw A.wrapException(A.FormatException$(_s31_, source, end)); + if (endLength > 1) + source = B.JSString_methods.replaceRange$3(source, end, end, endLength === 2 ? "==" : "="); + } + return source; + } + }; + A.Base64Encoder.prototype = {}; + A.Codec.prototype = {}; + A._FusedCodec.prototype = {}; + A.Converter.prototype = {$isStreamTransformer: 1}; + A.Encoding.prototype = {}; + A.Utf8Codec.prototype = { + decode$1(codeUnits) { + type$.List_int._as(codeUnits); + return new A._Utf8Decoder(false)._convertGeneral$4(codeUnits, 0, null, true); + } + }; + A.Utf8Encoder.prototype = { + convert$1(string) { + var stringLength, end, $length, t1, encoder, endPosition, t2; + A._asString(string); + stringLength = string.length; + end = A.RangeError_checkValidRange(0, null, stringLength); + $length = end - 0; + if ($length === 0) + return new Uint8Array(0); + t1 = new Uint8Array($length * 3); + encoder = new A._Utf8Encoder(t1); + endPosition = encoder._fillBuffer$3(string, 0, end); + t2 = end - 1; + A.assertHelper(endPosition >= t2); + if (endPosition !== end) { + if (!(t2 >= 0 && t2 < stringLength)) + return A.ioore(string, t2); + A.assertHelper((string.charCodeAt(t2) & 64512) === 55296); + encoder._writeReplacementCharacter$0(); + } + return B.NativeUint8List_methods.sublist$2(t1, 0, encoder._bufferIndex); + } + }; + A._Utf8Encoder.prototype = { + _writeReplacementCharacter$0() { + var _this = this, + t1 = _this._buffer, + t2 = _this._bufferIndex, + t3 = _this._bufferIndex = t2 + 1, + t4 = t1.length; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = 239; + t2 = _this._bufferIndex = t3 + 1; + if (!(t3 < t4)) + return A.ioore(t1, t3); + t1[t3] = 191; + _this._bufferIndex = t2 + 1; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = 189; + }, + _writeSurrogate$2(leadingSurrogate, nextCodeUnit) { + var rune, t1, t2, t3, t4, _this = this; + if ((nextCodeUnit & 64512) === 56320) { + rune = 65536 + ((leadingSurrogate & 1023) << 10) | nextCodeUnit & 1023; + A.assertHelper(rune > 65535); + A.assertHelper(rune <= 1114111); + t1 = _this._buffer; + t2 = _this._bufferIndex; + t3 = _this._bufferIndex = t2 + 1; + t4 = t1.length; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = rune >>> 18 | 240; + t2 = _this._bufferIndex = t3 + 1; + if (!(t3 < t4)) + return A.ioore(t1, t3); + t1[t3] = rune >>> 12 & 63 | 128; + t3 = _this._bufferIndex = t2 + 1; + if (!(t2 < t4)) + return A.ioore(t1, t2); + t1[t2] = rune >>> 6 & 63 | 128; + _this._bufferIndex = t3 + 1; + if (!(t3 < t4)) + return A.ioore(t1, t3); + t1[t3] = rune & 63 | 128; + return true; + } else { + _this._writeReplacementCharacter$0(); + return false; + } + }, + _fillBuffer$3(str, start, end) { + var t1, t2, t3, stringIndex, codeUnit, t4, t5, _this = this; + if (start !== end) { + t1 = end - 1; + if (!(t1 >= 0 && t1 < str.length)) + return A.ioore(str, t1); + t1 = (str.charCodeAt(t1) & 64512) === 55296; + } else + t1 = false; + if (t1) + --end; + for (t1 = _this._buffer, t2 = t1.length, t3 = str.length, stringIndex = start; stringIndex < end; ++stringIndex) { + if (!(stringIndex < t3)) + return A.ioore(str, stringIndex); + codeUnit = str.charCodeAt(stringIndex); + if (codeUnit <= 127) { + t4 = _this._bufferIndex; + if (t4 >= t2) + break; + _this._bufferIndex = t4 + 1; + t1[t4] = codeUnit; + } else { + t4 = codeUnit & 64512; + if (t4 === 55296) { + if (_this._bufferIndex + 4 > t2) + break; + t4 = stringIndex + 1; + if (!(t4 < t3)) + return A.ioore(str, t4); + if (_this._writeSurrogate$2(codeUnit, str.charCodeAt(t4))) + stringIndex = t4; + } else if (t4 === 56320) { + if (_this._bufferIndex + 3 > t2) + break; + _this._writeReplacementCharacter$0(); + } else if (codeUnit <= 2047) { + t4 = _this._bufferIndex; + t5 = t4 + 1; + if (t5 >= t2) + break; + _this._bufferIndex = t5; + if (!(t4 < t2)) + return A.ioore(t1, t4); + t1[t4] = codeUnit >>> 6 | 192; + _this._bufferIndex = t5 + 1; + t1[t5] = codeUnit & 63 | 128; + } else { + A.assertHelper(codeUnit <= 65535); + t4 = _this._bufferIndex; + if (t4 + 2 >= t2) + break; + t5 = _this._bufferIndex = t4 + 1; + if (!(t4 < t2)) + return A.ioore(t1, t4); + t1[t4] = codeUnit >>> 12 | 224; + t4 = _this._bufferIndex = t5 + 1; + if (!(t5 < t2)) + return A.ioore(t1, t5); + t1[t5] = codeUnit >>> 6 & 63 | 128; + _this._bufferIndex = t4 + 1; + if (!(t4 < t2)) + return A.ioore(t1, t4); + t1[t4] = codeUnit & 63 | 128; + } + } + } + return stringIndex; + } + }; + A._Utf8Decoder.prototype = { + _convertGeneral$4(codeUnits, start, maybeEnd, single) { + var end, casted, bytes, errorOffset, t1, result, message, _this = this; + type$.List_int._as(codeUnits); + end = A.RangeError_checkValidRange(start, maybeEnd, J.get$length$asx(codeUnits)); + if (start === end) + return ""; + if (codeUnits instanceof Uint8Array) { + casted = codeUnits; + bytes = casted; + errorOffset = 0; + } else { + bytes = A._Utf8Decoder__makeNativeUint8List(codeUnits, start, end); + end -= start; + errorOffset = start; + start = 0; + } + if (single && end - start >= 15) { + t1 = _this.allowMalformed; + result = A._Utf8Decoder__convertInterceptedUint8List(t1, bytes, start, end); + if (result != null) { + if (!t1) + return result; + if (result.indexOf("\ufffd") < 0) + return result; + } + } + result = _this._decodeRecursive$4(bytes, start, end, single); + t1 = _this._state; + if ((t1 & 1) !== 0) { + message = A._Utf8Decoder_errorDescription(t1); + _this._state = 0; + throw A.wrapException(A.FormatException$(message, codeUnits, errorOffset + _this._charOrIndex)); + } + return result; + }, + _decodeRecursive$4(bytes, start, end, single) { + var mid, s1, _this = this; + if (end - start > 1000) { + mid = B.JSInt_methods._tdivFast$1(start + end, 2); + s1 = _this._decodeRecursive$4(bytes, start, mid, false); + if ((_this._state & 1) !== 0) + return s1; + return s1 + _this._decodeRecursive$4(bytes, mid, end, single); + } + return _this.decodeGeneral$4(bytes, start, end, single); + }, + decodeGeneral$4(bytes, start, end, single) { + var byte, t2, type, t3, i0, markEnd, i1, m, _this = this, + _s256_ = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE", + _s144_ = " \x000:XECCCCCN:lDb \x000:XECCCCCNvlDb \x000:XECCCCCN:lDb AAAAA\x00\x00\x00\x00\x00AAAAA00000AAAAA:::::AAAAAGG000AAAAA00KKKAAAAAG::::AAAAA:IIIIAAAAA000\x800AAAAA\x00\x00\x00\x00 AAAAA", + _65533 = 65533, + state = _this._state, + char = _this._charOrIndex, + buffer = new A.StringBuffer(""), + i = start + 1, + t1 = bytes.length; + if (!(start >= 0 && start < t1)) + return A.ioore(bytes, start); + byte = bytes[start]; + $label0$0: + for (t2 = _this.allowMalformed; true;) { + for (; true; i = i0) { + if (!(byte >= 0 && byte < 256)) + return A.ioore(_s256_, byte); + type = _s256_.charCodeAt(byte) & 31; + char = state <= 32 ? byte & 61694 >>> type : (byte & 63 | char << 6) >>> 0; + t3 = state + type; + if (!(t3 >= 0 && t3 < 144)) + return A.ioore(_s144_, t3); + state = _s144_.charCodeAt(t3); + if (state === 0) { + t3 = A.Primitives_stringFromCharCode(char); + buffer._contents += t3; + if (i === end) + break $label0$0; + break; + } else if ((state & 1) !== 0) { + if (t2) + switch (state) { + case 69: + case 67: + t3 = A.Primitives_stringFromCharCode(_65533); + buffer._contents += t3; + break; + case 65: + t3 = A.Primitives_stringFromCharCode(_65533); + buffer._contents += t3; + --i; + break; + default: + t3 = A.Primitives_stringFromCharCode(_65533); + t3 = buffer._contents += t3; + buffer._contents = t3 + A.Primitives_stringFromCharCode(_65533); + break; + } + else { + _this._state = state; + _this._charOrIndex = i - 1; + return ""; + } + state = 0; + } + if (i === end) + break $label0$0; + i0 = i + 1; + if (!(i >= 0 && i < t1)) + return A.ioore(bytes, i); + byte = bytes[i]; + } + i0 = i + 1; + if (!(i >= 0 && i < t1)) + return A.ioore(bytes, i); + byte = bytes[i]; + if (byte < 128) { + while (true) { + if (!(i0 < end)) { + markEnd = end; + break; + } + i1 = i0 + 1; + if (!(i0 >= 0 && i0 < t1)) + return A.ioore(bytes, i0); + byte = bytes[i0]; + if (byte >= 128) { + markEnd = i1 - 1; + i0 = i1; + break; + } + i0 = i1; + } + A.assertHelper(i < markEnd); + if (markEnd - i < 20) + for (m = i; m < markEnd; ++m) { + if (!(m < t1)) + return A.ioore(bytes, m); + t3 = A.Primitives_stringFromCharCode(bytes[m]); + buffer._contents += t3; + } + else { + t3 = A.String_String$fromCharCodes(bytes, i, markEnd); + buffer._contents += t3; + } + if (markEnd === end) + break $label0$0; + i = i0; + } else + i = i0; + } + if (single && state > 32) + if (t2) { + t1 = A.Primitives_stringFromCharCode(_65533); + buffer._contents += t1; + } else { + _this._state = 77; + _this._charOrIndex = end; + return ""; + } + _this._state = state; + _this._charOrIndex = char; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A._BigIntImpl.prototype = { + $negate(_) { + var t2, t3, _this = this, + t1 = _this._used; + if (t1 === 0) + return _this; + t2 = !_this._isNegative; + t3 = _this._digits; + t1 = A._BigIntImpl__normalize(t1, t3); + return new A._BigIntImpl(t1 === 0 ? false : t2, t3, t1); + }, + _dlShift$1(n) { + var resultUsed, digits, resultDigits, i, t1, t2, t3, + used = this._used; + if (used === 0) + return $.$get$_BigIntImpl_zero(); + resultUsed = used + n; + digits = this._digits; + resultDigits = new Uint16Array(resultUsed); + for (i = used - 1, t1 = digits.length; i >= 0; --i) { + t2 = i + n; + if (!(i < t1)) + return A.ioore(digits, i); + t3 = digits[i]; + if (!(t2 >= 0 && t2 < resultUsed)) + return A.ioore(resultDigits, t2); + resultDigits[t2] = t3; + } + t1 = this._isNegative; + t2 = A._BigIntImpl__normalize(resultUsed, resultDigits); + return new A._BigIntImpl(t2 === 0 ? false : t1, resultDigits, t2); + }, + _drShift$1(n) { + var resultUsed, digits, resultDigits, t1, i, t2, t3, result, _this = this, + used = _this._used; + if (used === 0) + return $.$get$_BigIntImpl_zero(); + resultUsed = used - n; + if (resultUsed <= 0) + return _this._isNegative ? $.$get$_BigIntImpl__minusOne() : $.$get$_BigIntImpl_zero(); + digits = _this._digits; + resultDigits = new Uint16Array(resultUsed); + for (t1 = digits.length, i = n; i < used; ++i) { + t2 = i - n; + if (!(i >= 0 && i < t1)) + return A.ioore(digits, i); + t3 = digits[i]; + if (!(t2 < resultUsed)) + return A.ioore(resultDigits, t2); + resultDigits[t2] = t3; + } + t2 = _this._isNegative; + t3 = A._BigIntImpl__normalize(resultUsed, resultDigits); + result = new A._BigIntImpl(t3 === 0 ? false : t2, resultDigits, t3); + if (t2) + for (i = 0; i < n; ++i) { + if (!(i < t1)) + return A.ioore(digits, i); + if (digits[i] !== 0) + return result.$sub(0, $.$get$_BigIntImpl_one()); + } + return result; + }, + $shl(_, shiftAmount) { + var t1, digitShift, resultUsed, resultDigits, t2, _this = this; + if (shiftAmount < 0) + throw A.wrapException(A.ArgumentError$("shift-amount must be posititve " + shiftAmount, null)); + t1 = _this._used; + if (t1 === 0) + return _this; + digitShift = B.JSInt_methods._tdivFast$1(shiftAmount, 16); + if (B.JSInt_methods.$mod(shiftAmount, 16) === 0) + return _this._dlShift$1(digitShift); + resultUsed = t1 + digitShift + 1; + resultDigits = new Uint16Array(resultUsed); + A._BigIntImpl__lsh(_this._digits, t1, shiftAmount, resultDigits); + t1 = _this._isNegative; + t2 = A._BigIntImpl__normalize(resultUsed, resultDigits); + return new A._BigIntImpl(t2 === 0 ? false : t1, resultDigits, t2); + }, + $shr(_, shiftAmount) { + var t1, digitShift, bitShift, resultUsed, digits, resultDigits, t2, result, i, _this = this; + if (shiftAmount < 0) + throw A.wrapException(A.ArgumentError$("shift-amount must be posititve " + shiftAmount, null)); + t1 = _this._used; + if (t1 === 0) + return _this; + digitShift = B.JSInt_methods._tdivFast$1(shiftAmount, 16); + bitShift = B.JSInt_methods.$mod(shiftAmount, 16); + if (bitShift === 0) + return _this._drShift$1(digitShift); + resultUsed = t1 - digitShift; + if (resultUsed <= 0) + return _this._isNegative ? $.$get$_BigIntImpl__minusOne() : $.$get$_BigIntImpl_zero(); + digits = _this._digits; + resultDigits = new Uint16Array(resultUsed); + A._BigIntImpl__rsh(digits, t1, shiftAmount, resultDigits); + t1 = _this._isNegative; + t2 = A._BigIntImpl__normalize(resultUsed, resultDigits); + result = new A._BigIntImpl(t2 === 0 ? false : t1, resultDigits, t2); + if (t1) { + t1 = digits.length; + if (!(digitShift >= 0 && digitShift < t1)) + return A.ioore(digits, digitShift); + if ((digits[digitShift] & B.JSInt_methods.$shl(1, bitShift) - 1) >>> 0 !== 0) + return result.$sub(0, $.$get$_BigIntImpl_one()); + for (i = 0; i < digitShift; ++i) { + if (!(i < t1)) + return A.ioore(digits, i); + if (digits[i] !== 0) + return result.$sub(0, $.$get$_BigIntImpl_one()); + } + } + return result; + }, + compareTo$1(_, other) { + var t1, result; + type$._BigIntImpl._as(other); + t1 = this._isNegative; + if (t1 === other._isNegative) { + result = A._BigIntImpl__compareDigits(this._digits, this._used, other._digits, other._used); + return t1 ? 0 - result : result; + } + return t1 ? -1 : 1; + }, + _absAddSetSign$2(other, isNegative) { + var resultUsed, resultDigits, t1, _this = this, + used = _this._used, + otherUsed = other._used; + if (used < otherUsed) + return other._absAddSetSign$2(_this, isNegative); + if (used === 0) { + A.assertHelper(!isNegative); + return $.$get$_BigIntImpl_zero(); + } + if (otherUsed === 0) + return _this._isNegative === isNegative ? _this : _this.$negate(0); + resultUsed = used + 1; + resultDigits = new Uint16Array(resultUsed); + A._BigIntImpl__absAdd(_this._digits, used, other._digits, otherUsed, resultDigits); + t1 = A._BigIntImpl__normalize(resultUsed, resultDigits); + return new A._BigIntImpl(t1 === 0 ? false : isNegative, resultDigits, t1); + }, + _absSubSetSign$2(other, isNegative) { + var resultDigits, _this = this, + t1 = _this._digits, + t2 = _this._used, + t3 = other._digits, + t4 = other._used; + A.assertHelper(A._BigIntImpl__compareDigits(t1, t2, t3, t4) >= 0); + if (t2 === 0) { + A.assertHelper(!isNegative); + return $.$get$_BigIntImpl_zero(); + } + if (t4 === 0) + return _this._isNegative === isNegative ? _this : _this.$negate(0); + resultDigits = new Uint16Array(t2); + A._BigIntImpl__absSub(t1, t2, t3, t4, resultDigits); + t1 = A._BigIntImpl__normalize(t2, resultDigits); + return new A._BigIntImpl(t1 === 0 ? false : isNegative, resultDigits, t1); + }, + $add(_, other) { + var t2, isNegative, _this = this, + t1 = _this._used; + if (t1 === 0) + return other; + t2 = other._used; + if (t2 === 0) + return _this; + isNegative = _this._isNegative; + if (isNegative === other._isNegative) + return _this._absAddSetSign$2(other, isNegative); + if (A._BigIntImpl__compareDigits(_this._digits, t1, other._digits, t2) >= 0) + return _this._absSubSetSign$2(other, isNegative); + return other._absSubSetSign$2(_this, !isNegative); + }, + $sub(_, other) { + var t2, isNegative, _this = this, + t1 = _this._used; + if (t1 === 0) + return other.$negate(0); + t2 = other._used; + if (t2 === 0) + return _this; + isNegative = _this._isNegative; + if (isNegative !== other._isNegative) + return _this._absAddSetSign$2(other, isNegative); + if (A._BigIntImpl__compareDigits(_this._digits, t1, other._digits, t2) >= 0) + return _this._absSubSetSign$2(other, isNegative); + return other._absSubSetSign$2(_this, !isNegative); + }, + $mul(_, other) { + var resultUsed, digits, otherDigits, resultDigits, t1, i, t2, + used = this._used, + otherUsed = other._used; + if (used === 0 || otherUsed === 0) + return $.$get$_BigIntImpl_zero(); + resultUsed = used + otherUsed; + digits = this._digits; + otherDigits = other._digits; + resultDigits = new Uint16Array(resultUsed); + for (t1 = otherDigits.length, i = 0; i < otherUsed;) { + if (!(i < t1)) + return A.ioore(otherDigits, i); + A._BigIntImpl__mulAdd(otherDigits[i], digits, 0, resultDigits, i, used); + ++i; + } + t1 = this._isNegative !== other._isNegative; + t2 = A._BigIntImpl__normalize(resultUsed, resultDigits); + return new A._BigIntImpl(t2 === 0 ? false : t1, resultDigits, t2); + }, + _div$1(other) { + var lastQuo_used, quo_digits, quo, + t1 = other._used; + A.assertHelper(t1 > 0); + if (this._used < t1) + return $.$get$_BigIntImpl_zero(); + this._divRem$1(other); + lastQuo_used = $._BigIntImpl____lastQuoRemUsed._readField$0() - $._BigIntImpl____lastRemUsed._readField$0(); + quo_digits = A._BigIntImpl__cloneDigits($._BigIntImpl____lastQuoRemDigits._readField$0(), $._BigIntImpl____lastRemUsed._readField$0(), $._BigIntImpl____lastQuoRemUsed._readField$0(), lastQuo_used); + t1 = A._BigIntImpl__normalize(lastQuo_used, quo_digits); + quo = new A._BigIntImpl(false, quo_digits, t1); + return this._isNegative !== other._isNegative && t1 > 0 ? quo.$negate(0) : quo; + }, + _rem$1(other) { + var remDigits, rem, _this = this, + t1 = other._used; + A.assertHelper(t1 > 0); + if (_this._used < t1) + return _this; + _this._divRem$1(other); + remDigits = A._BigIntImpl__cloneDigits($._BigIntImpl____lastQuoRemDigits._readField$0(), 0, $._BigIntImpl____lastRemUsed._readField$0(), $._BigIntImpl____lastRemUsed._readField$0()); + t1 = A._BigIntImpl__normalize($._BigIntImpl____lastRemUsed._readField$0(), remDigits); + rem = new A._BigIntImpl(false, remDigits, t1); + if ($._BigIntImpl____lastRem_nsh._readField$0() > 0) + rem = rem.$shr(0, $._BigIntImpl____lastRem_nsh._readField$0()); + return _this._isNegative && rem._used > 0 ? rem.$negate(0) : rem; + }, + _divRem$1(other) { + var yUsed, yDigits, t1, nsh, yDigits0, yUsed0, resultDigits, resultUsed0, topDigitDivisor, j, tmpDigits, tmpUsed, resultUsed1, t2, nyDigits, i, estimatedQuotientDigit, _this = this, + resultUsed = _this._used; + if (resultUsed === $._BigIntImpl__lastDividendUsed && other._used === $._BigIntImpl__lastDivisorUsed && _this._digits === $._BigIntImpl__lastDividendDigits && other._digits === $._BigIntImpl__lastDivisorDigits) + return; + yUsed = other._used; + A.assertHelper(resultUsed >= yUsed); + yDigits = other._digits; + t1 = yUsed - 1; + if (!(t1 >= 0 && t1 < yDigits.length)) + return A.ioore(yDigits, t1); + nsh = 16 - B.JSInt_methods.get$bitLength(yDigits[t1]); + if (nsh > 0) { + yDigits0 = new Uint16Array(yUsed + 5); + yUsed0 = A._BigIntImpl__lShiftDigits(yDigits, yUsed, nsh, yDigits0); + resultDigits = new Uint16Array(resultUsed + 5); + resultUsed0 = A._BigIntImpl__lShiftDigits(_this._digits, resultUsed, nsh, resultDigits); + } else { + resultDigits = A._BigIntImpl__cloneDigits(_this._digits, 0, resultUsed, resultUsed + 2); + yUsed0 = yUsed; + yDigits0 = yDigits; + resultUsed0 = resultUsed; + } + t1 = yUsed0 - 1; + if (!(t1 >= 0 && t1 < yDigits0.length)) + return A.ioore(yDigits0, t1); + topDigitDivisor = yDigits0[t1]; + j = resultUsed0 - yUsed0; + tmpDigits = new Uint16Array(resultUsed0); + tmpUsed = A._BigIntImpl__dlShiftDigits(yDigits0, yUsed0, j, tmpDigits); + resultUsed1 = resultUsed0 + 1; + t1 = resultDigits.length; + if (A._BigIntImpl__compareDigits(resultDigits, resultUsed0, tmpDigits, tmpUsed) >= 0) { + if (!(resultUsed0 >= 0 && resultUsed0 < t1)) + return A.ioore(resultDigits, resultUsed0); + resultDigits[resultUsed0] = 1; + A._BigIntImpl__absSub(resultDigits, resultUsed1, tmpDigits, tmpUsed, resultDigits); + } else { + if (!(resultUsed0 >= 0 && resultUsed0 < t1)) + return A.ioore(resultDigits, resultUsed0); + resultDigits[resultUsed0] = 0; + } + t2 = yUsed0 + 2; + nyDigits = new Uint16Array(t2); + if (!(yUsed0 >= 0 && yUsed0 < t2)) + return A.ioore(nyDigits, yUsed0); + nyDigits[yUsed0] = 1; + A._BigIntImpl__absSub(nyDigits, yUsed0 + 1, yDigits0, yUsed0, nyDigits); + i = resultUsed0 - 1; + for (; j > 0;) { + estimatedQuotientDigit = A._BigIntImpl__estimateQuotientDigit(topDigitDivisor, resultDigits, i); + --j; + A._BigIntImpl__mulAdd(estimatedQuotientDigit, nyDigits, 0, resultDigits, j, yUsed0); + if (!(i >= 0 && i < t1)) + return A.ioore(resultDigits, i); + if (resultDigits[i] < estimatedQuotientDigit) { + tmpUsed = A._BigIntImpl__dlShiftDigits(nyDigits, yUsed0, j, tmpDigits); + A._BigIntImpl__absSub(resultDigits, resultUsed1, tmpDigits, tmpUsed, resultDigits); + for (; --estimatedQuotientDigit, resultDigits[i] < estimatedQuotientDigit;) + A._BigIntImpl__absSub(resultDigits, resultUsed1, tmpDigits, tmpUsed, resultDigits); + } + --i; + } + $._BigIntImpl__lastDividendDigits = _this._digits; + $._BigIntImpl__lastDividendUsed = resultUsed; + $._BigIntImpl__lastDivisorDigits = yDigits; + $._BigIntImpl__lastDivisorUsed = yUsed; + $._BigIntImpl____lastQuoRemDigits._value = resultDigits; + $._BigIntImpl____lastQuoRemUsed._value = resultUsed1; + $._BigIntImpl____lastRemUsed._value = yUsed0; + $._BigIntImpl____lastRem_nsh._value = nsh; + }, + get$hashCode(_) { + var hash, t2, t3, i, + combine = new A._BigIntImpl_hashCode_combine(), + t1 = this._used; + if (t1 === 0) + return 6707; + hash = this._isNegative ? 83585 : 429689; + for (t2 = this._digits, t3 = t2.length, i = 0; i < t1; ++i) { + if (!(i < t3)) + return A.ioore(t2, i); + hash = combine.call$2(hash, t2[i]); + } + return new A._BigIntImpl_hashCode_finish().call$1(hash); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A._BigIntImpl && this.compareTo$1(0, other) === 0; + }, + toString$0(_) { + var decimalDigitChunks, rest, t2, digits4, t3, _this = this, + t1 = _this._used; + if (t1 === 0) + return "0"; + if (t1 === 1) { + if (_this._isNegative) { + t1 = _this._digits; + if (0 >= t1.length) + return A.ioore(t1, 0); + return B.JSInt_methods.toString$0(-t1[0]); + } + t1 = _this._digits; + if (0 >= t1.length) + return A.ioore(t1, 0); + return B.JSInt_methods.toString$0(t1[0]); + } + decimalDigitChunks = A._setArrayType([], type$.JSArray_String); + t1 = _this._isNegative; + rest = t1 ? _this.$negate(0) : _this; + for (; rest._used > 1;) { + t2 = $.$get$_BigIntImpl__bigInt10000(); + if (t2._used === 0) + A.throwExpression(B.C_IntegerDivisionByZeroException); + digits4 = rest._rem$1(t2).toString$0(0); + B.JSArray_methods.add$1(decimalDigitChunks, digits4); + t3 = digits4.length; + if (t3 === 1) + B.JSArray_methods.add$1(decimalDigitChunks, "000"); + if (t3 === 2) + B.JSArray_methods.add$1(decimalDigitChunks, "00"); + if (t3 === 3) + B.JSArray_methods.add$1(decimalDigitChunks, "0"); + rest = rest._div$1(t2); + } + t2 = rest._digits; + if (0 >= t2.length) + return A.ioore(t2, 0); + B.JSArray_methods.add$1(decimalDigitChunks, B.JSInt_methods.toString$0(t2[0])); + if (t1) + B.JSArray_methods.add$1(decimalDigitChunks, "-"); + return new A.ReversedListIterable(decimalDigitChunks, type$.ReversedListIterable_String).join$0(0); + }, + $isBigInt: 1, + $isComparable: 1 + }; + A._BigIntImpl_hashCode_combine.prototype = { + call$2(hash, value) { + hash = hash + value & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + return hash ^ hash >>> 6; + }, + $signature: 4 + }; + A._BigIntImpl_hashCode_finish.prototype = { + call$1(hash) { + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >>> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + $signature: 13 + }; + A._FinalizationRegistryWrapper.prototype = { + detach$1(detachToken) { + var t1 = this._registry; + if (t1 != null) + t1.unregister(detachToken); + } + }; + A.NoSuchMethodError_toString_closure.prototype = { + call$2(key, value) { + var t1, t2, t3; + type$.Symbol._as(key); + t1 = this.sb; + t2 = this._box_0; + t3 = t1._contents += t2.comma; + t3 += key.__internal$_name; + t1._contents = t3; + t1._contents = t3 + ": "; + t3 = A.Error_safeToString(value); + t1._contents += t3; + t2.comma = ", "; + }, + $signature: 79 + }; + A.DateTime.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.DateTime && this._core$_value === other._core$_value && this.isUtc === other.isUtc; + }, + compareTo$1(_, other) { + return B.JSInt_methods.compareTo$1(this._core$_value, type$.DateTime._as(other)._core$_value); + }, + get$hashCode(_) { + var t1 = this._core$_value; + return (t1 ^ B.JSInt_methods._shrOtherPositive$1(t1, 30)) & 1073741823; + }, + toUtc$0() { + if (this.isUtc) + return this; + return A.DateTime$_withValue(this._core$_value, true); + }, + toString$0(_) { + var _this = this, + y = A.DateTime__fourDigits(A.Primitives_getYear(_this)), + m = A.DateTime__twoDigits(A.Primitives_getMonth(_this)), + d = A.DateTime__twoDigits(A.Primitives_getDay(_this)), + h = A.DateTime__twoDigits(A.Primitives_getHours(_this)), + min = A.DateTime__twoDigits(A.Primitives_getMinutes(_this)), + sec = A.DateTime__twoDigits(A.Primitives_getSeconds(_this)), + ms = A.DateTime__threeDigits(A.Primitives_getMilliseconds(_this)), + t1 = y + "-" + m; + if (_this.isUtc) + return t1 + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + "Z"; + else + return t1 + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms; + }, + $isComparable: 1 + }; + A.Duration.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Duration && this._duration === other._duration; + }, + get$hashCode(_) { + return B.JSInt_methods.get$hashCode(this._duration); + }, + compareTo$1(_, other) { + return B.JSInt_methods.compareTo$1(this._duration, type$.Duration._as(other)._duration); + }, + toString$0(_) { + var sign, minutes, minutesPadding, seconds, secondsPadding, + microseconds = this._duration, + hours = B.JSInt_methods._tdivFast$1(microseconds, 3600000000), + microseconds0 = microseconds % 3600000000; + if (microseconds < 0) { + hours = 0 - hours; + microseconds = 0 - microseconds0; + sign = "-"; + } else { + microseconds = microseconds0; + sign = ""; + } + minutes = B.JSInt_methods._tdivFast$1(microseconds, 60000000); + microseconds %= 60000000; + minutesPadding = minutes < 10 ? "0" : ""; + seconds = B.JSInt_methods._tdivFast$1(microseconds, 1000000); + secondsPadding = seconds < 10 ? "0" : ""; + return sign + hours + ":" + minutesPadding + minutes + ":" + secondsPadding + seconds + "." + B.JSString_methods.padLeft$2(B.JSInt_methods.toString$0(microseconds % 1000000), 6, "0"); + }, + $isComparable: 1 + }; + A._Enum.prototype = { + toString$0(_) { + return this._enumToString$0(); + }, + $isEnum: 1 + }; + A.Error.prototype = { + get$stackTrace() { + return A.Primitives_extractStackTrace(this); + } + }; + A.AssertionError.prototype = { + toString$0(_) { + var t1 = this.message; + if (t1 != null) + return "Assertion failed: " + A.Error_safeToString(t1); + return "Assertion failed"; + } + }; + A.TypeError.prototype = {}; + A.ArgumentError.prototype = { + get$_errorName() { + return "Invalid argument" + (!this._hasValue ? "(s)" : ""); + }, + get$_errorExplanation() { + return ""; + }, + toString$0(_) { + var _this = this, + $name = _this.name, + nameString = $name == null ? "" : " (" + $name + ")", + message = _this.message, + messageString = message == null ? "" : ": " + A.S(message), + prefix = _this.get$_errorName() + nameString + messageString; + if (!_this._hasValue) + return prefix; + return prefix + _this.get$_errorExplanation() + ": " + A.Error_safeToString(_this.get$invalidValue()); + }, + get$invalidValue() { + return this.invalidValue; + } + }; + A.RangeError.prototype = { + get$invalidValue() { + return A._asNumQ(this.invalidValue); + }, + get$_errorName() { + return "RangeError"; + }, + get$_errorExplanation() { + var start, end, explanation; + A.assertHelper(this._hasValue); + start = this.start; + end = this.end; + if (start == null) + explanation = end != null ? ": Not less than or equal to " + A.S(end) : ""; + else if (end == null) + explanation = ": Not greater than or equal to " + A.S(start); + else if (end > start) + explanation = ": Not in inclusive range " + A.S(start) + ".." + A.S(end); + else + explanation = end < start ? ": Valid value range is empty" : ": Only valid value is " + A.S(start); + return explanation; + } + }; + A.IndexError.prototype = { + get$invalidValue() { + return A._asInt(this.invalidValue); + }, + get$_errorName() { + return "RangeError"; + }, + get$_errorExplanation() { + A.assertHelper(this._hasValue); + if (A._asInt(this.invalidValue) < 0) + return ": index must not be negative"; + var t1 = this.length; + if (t1 === 0) + return ": no indices are valid"; + return ": index should be less than " + t1; + }, + get$length(receiver) { + return this.length; + } + }; + A.NoSuchMethodError.prototype = { + toString$0(_) { + var $arguments, t1, _i, t2, t3, argument, receiverText, actualParameters, _this = this, _box_0 = {}, + sb = new A.StringBuffer(""); + _box_0.comma = ""; + $arguments = _this._core$_arguments; + for (t1 = $arguments.length, _i = 0, t2 = "", t3 = ""; _i < t1; ++_i, t3 = ", ") { + argument = $arguments[_i]; + sb._contents = t2 + t3; + t2 = A.Error_safeToString(argument); + t2 = sb._contents += t2; + _box_0.comma = ", "; + } + _this._namedArguments.forEach$1(0, new A.NoSuchMethodError_toString_closure(_box_0, sb)); + receiverText = A.Error_safeToString(_this._core$_receiver); + actualParameters = sb.toString$0(0); + return "NoSuchMethodError: method not found: '" + _this._core$_memberName.__internal$_name + "'\nReceiver: " + receiverText + "\nArguments: [" + actualParameters + "]"; + } + }; + A.UnsupportedError.prototype = { + toString$0(_) { + return "Unsupported operation: " + this.message; + } + }; + A.UnimplementedError.prototype = { + toString$0(_) { + return "UnimplementedError: " + this.message; + } + }; + A.StateError.prototype = { + toString$0(_) { + return "Bad state: " + this.message; + } + }; + A.ConcurrentModificationError.prototype = { + toString$0(_) { + var t1 = this.modifiedObject; + if (t1 == null) + return "Concurrent modification during iteration."; + return "Concurrent modification during iteration: " + A.Error_safeToString(t1) + "."; + } + }; + A.OutOfMemoryError.prototype = { + toString$0(_) { + return "Out of Memory"; + }, + get$stackTrace() { + return null; + }, + $isError: 1 + }; + A.StackOverflowError.prototype = { + toString$0(_) { + return "Stack Overflow"; + }, + get$stackTrace() { + return null; + }, + $isError: 1 + }; + A._Exception.prototype = { + toString$0(_) { + return "Exception: " + this.message; + }, + $isException: 1 + }; + A.FormatException.prototype = { + toString$0(_) { + var t1, lineEnd, lineNum, lineStart, previousCharWasCR, i, char, end, start, prefix, postfix, + message = this.message, + report = "" !== message ? "FormatException: " + message : "FormatException", + offset = this.offset, + source = this.source; + if (typeof source == "string") { + if (offset != null) + t1 = offset < 0 || offset > source.length; + else + t1 = false; + if (t1) + offset = null; + if (offset == null) { + if (source.length > 78) + source = B.JSString_methods.substring$2(source, 0, 75) + "..."; + return report + "\n" + source; + } + for (lineEnd = source.length, lineNum = 1, lineStart = 0, previousCharWasCR = false, i = 0; i < offset; ++i) { + if (!(i < lineEnd)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 10) { + if (lineStart !== i || !previousCharWasCR) + ++lineNum; + lineStart = i + 1; + previousCharWasCR = false; + } else if (char === 13) { + ++lineNum; + lineStart = i + 1; + previousCharWasCR = true; + } + } + report = lineNum > 1 ? report + (" (at line " + lineNum + ", character " + (offset - lineStart + 1) + ")\n") : report + (" (at character " + (offset + 1) + ")\n"); + for (i = offset; i < lineEnd; ++i) { + if (!(i >= 0)) + return A.ioore(source, i); + char = source.charCodeAt(i); + if (char === 10 || char === 13) { + lineEnd = i; + break; + } + } + if (lineEnd - lineStart > 78) + if (offset - lineStart < 75) { + end = lineStart + 75; + start = lineStart; + prefix = ""; + postfix = "..."; + } else { + if (lineEnd - offset < 75) { + start = lineEnd - 75; + end = lineEnd; + postfix = ""; + } else { + start = offset - 36; + end = offset + 36; + postfix = "..."; + } + prefix = "..."; + } + else { + end = lineEnd; + start = lineStart; + prefix = ""; + postfix = ""; + } + return report + prefix + B.JSString_methods.substring$2(source, start, end) + postfix + "\n" + B.JSString_methods.$mul(" ", offset - start + prefix.length) + "^\n"; + } else + return offset != null ? report + (" (at offset " + A.S(offset) + ")") : report; + }, + $isException: 1 + }; + A.IntegerDivisionByZeroException.prototype = { + get$stackTrace() { + return null; + }, + toString$0(_) { + return "IntegerDivisionByZeroException"; + }, + $isError: 1, + $isException: 1 + }; + A.Iterable.prototype = { + cast$1$0(_, $R) { + return A.CastIterable_CastIterable(this, A._instanceType(this)._eval$1("Iterable.E"), $R); + }, + map$1$1(_, toElement, $T) { + var t1 = A._instanceType(this); + return A.MappedIterable_MappedIterable(this, t1._bind$1($T)._eval$1("1(Iterable.E)")._as(toElement), t1._eval$1("Iterable.E"), $T); + }, + toList$1$growable(_, growable) { + return A.List_List$of(this, growable, A._instanceType(this)._eval$1("Iterable.E")); + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + get$length(_) { + var it, count; + A.assertHelper(!type$.EfficientLengthIterable_dynamic._is(this)); + it = this.get$iterator(this); + for (count = 0; it.moveNext$0();) + ++count; + return count; + }, + get$isEmpty(_) { + return !this.get$iterator(this).moveNext$0(); + }, + take$1(_, count) { + return A.TakeIterable_TakeIterable(this, count, A._instanceType(this)._eval$1("Iterable.E")); + }, + skip$1(_, count) { + return A.SkipIterable_SkipIterable(this, count, A._instanceType(this)._eval$1("Iterable.E")); + }, + skipWhile$1(_, test) { + var t1 = A._instanceType(this); + return new A.SkipWhileIterable(this, t1._eval$1("bool(Iterable.E)")._as(test), t1._eval$1("SkipWhileIterable")); + }, + get$first(_) { + var it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + return it.get$current(); + }, + get$last(_) { + var result, + it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + do + result = it.get$current(); + while (it.moveNext$0()); + return result; + }, + elementAt$1(_, index) { + var iterator, skipCount; + A.RangeError_checkNotNegative(index, "index"); + iterator = this.get$iterator(this); + for (skipCount = index; iterator.moveNext$0();) { + if (skipCount === 0) + return iterator.get$current(); + --skipCount; + } + throw A.wrapException(A.IndexError$withLength(index, index - skipCount, this, null, "index")); + }, + toString$0(_) { + return A.Iterable_iterableToShortString(this, "(", ")"); + } + }; + A.MapEntry.prototype = { + toString$0(_) { + return "MapEntry(" + A.S(this.key) + ": " + A.S(this.value) + ")"; + } + }; + A.Null.prototype = { + get$hashCode(_) { + return A.Object.prototype.get$hashCode.call(this, 0); + }, + toString$0(_) { + return "null"; + } + }; + A.Object.prototype = {$isObject: 1, + $eq(_, other) { + return this === other; + }, + get$hashCode(_) { + return A.Primitives_objectHashCode(this); + }, + toString$0(_) { + return "Instance of '" + A.Primitives_objectTypeName(this) + "'"; + }, + noSuchMethod$1(_, invocation) { + throw A.wrapException(A.NoSuchMethodError_NoSuchMethodError$withInvocation(this, type$.Invocation._as(invocation))); + }, + get$runtimeType(_) { + return A.getRuntimeTypeOfDartObject(this); + }, + toString() { + return this.toString$0(this); + } + }; + A._StringStackTrace.prototype = { + toString$0(_) { + return this._stackTrace; + }, + $isStackTrace: 1 + }; + A.StringBuffer.prototype = { + get$length(_) { + return this._contents.length; + }, + toString$0(_) { + var t1 = this._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isStringSink: 1 + }; + A.Uri__parseIPv4Address_error.prototype = { + call$2(msg, position) { + throw A.wrapException(A.FormatException$("Illegal IPv4 address, " + msg, this.host, position)); + }, + $signature: 43 + }; + A.Uri_parseIPv6Address_error.prototype = { + call$2(msg, position) { + throw A.wrapException(A.FormatException$("Illegal IPv6 address, " + msg, this.host, position)); + }, + $signature: 49 + }; + A.Uri_parseIPv6Address_parseHex.prototype = { + call$2(start, end) { + var value; + if (end - start > 4) + this.error.call$2("an IPv6 part can only contain a maximum of 4 hex digits", start); + value = A.int_parse(B.JSString_methods.substring$2(this.host, start, end), 16); + if (value < 0 || value > 65535) + this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start); + return value; + }, + $signature: 4 + }; + A._Uri.prototype = { + get$_text() { + var t1, t2, t3, t4, _this = this, + value = _this.___Uri__text_FI; + if (value === $) { + t1 = _this.scheme; + t2 = t1.length !== 0 ? "" + t1 + ":" : ""; + t3 = _this._host; + t4 = t3 == null; + if (!t4 || t1 === "file") { + t1 = t2 + "//"; + t2 = _this._userInfo; + if (t2.length !== 0) + t1 = t1 + t2 + "@"; + if (!t4) + t1 += t3; + t2 = _this._port; + if (t2 != null) + t1 = t1 + ":" + A.S(t2); + } else + t1 = t2; + t1 += _this.path; + t2 = _this._query; + if (t2 != null) + t1 = t1 + "?" + t2; + t2 = _this._fragment; + if (t2 != null) + t1 = t1 + "#" + t2; + value !== $ && A.throwLateFieldADI("_text"); + value = _this.___Uri__text_FI = t1.charCodeAt(0) == 0 ? t1 : t1; + } + return value; + }, + get$pathSegments() { + var pathToSplit, t1, result, _this = this, + value = _this.___Uri_pathSegments_FI; + if (value === $) { + pathToSplit = _this.path; + t1 = pathToSplit.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(pathToSplit, 0); + t1 = pathToSplit.charCodeAt(0) === 47; + } else + t1 = false; + if (t1) + pathToSplit = B.JSString_methods.substring$1(pathToSplit, 1); + result = pathToSplit.length === 0 ? B.List_empty2 : A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(pathToSplit.split("/"), type$.JSArray_String), type$.dynamic_Function_String._as(A.core_Uri_decodeComponent$closure()), type$.MappedListIterable_String_dynamic), type$.String); + _this.___Uri_pathSegments_FI !== $ && A.throwLateFieldADI("pathSegments"); + _this.set$___Uri_pathSegments_FI(result); + value = result; + } + return value; + }, + get$hashCode(_) { + var result, _this = this, + value = _this.___Uri_hashCode_FI; + if (value === $) { + result = B.JSString_methods.get$hashCode(_this.get$_text()); + _this.___Uri_hashCode_FI !== $ && A.throwLateFieldADI("hashCode"); + _this.___Uri_hashCode_FI = result; + value = result; + } + return value; + }, + get$userInfo() { + return this._userInfo; + }, + get$host() { + var host = this._host; + if (host == null) + return ""; + if (B.JSString_methods.startsWith$1(host, "[")) + return B.JSString_methods.substring$2(host, 1, host.length - 1); + return host; + }, + get$port() { + var t1 = this._port; + return t1 == null ? A._Uri__defaultPort(this.scheme) : t1; + }, + get$query() { + var t1 = this._query; + return t1 == null ? "" : t1; + }, + get$fragment() { + var t1 = this._fragment; + return t1 == null ? "" : t1; + }, + isScheme$1(scheme) { + var thisScheme = this.scheme; + if (scheme.length !== thisScheme.length) + return false; + return A._caseInsensitiveCompareStart(scheme, thisScheme, 0) >= 0; + }, + replace$1$scheme(scheme) { + var isFile, userInfo, port, host, currentPath, t1, path, _this = this; + scheme = A._Uri__makeScheme(scheme, 0, scheme.length); + isFile = scheme === "file"; + userInfo = _this._userInfo; + port = _this._port; + if (scheme !== _this.scheme) + port = A._Uri__makePort(port, scheme); + host = _this._host; + if (!(host != null)) + host = userInfo.length !== 0 || port != null || isFile ? "" : null; + currentPath = _this.path; + if (!isFile) + t1 = host != null && currentPath.length !== 0; + else + t1 = true; + if (t1 && !B.JSString_methods.startsWith$1(currentPath, "/")) + currentPath = "/" + currentPath; + path = currentPath; + return A._Uri$_internal(scheme, userInfo, host, port, path, _this._query, _this._fragment); + }, + get$isAbsolute() { + if (this.scheme !== "") { + var t1 = this._fragment; + t1 = (t1 == null ? "" : t1) === ""; + } else + t1 = false; + return t1; + }, + _mergePaths$2(base, reference) { + var backCount, refStart, baseEnd, t1, newEnd, delta, t2, t3; + for (backCount = 0, refStart = 0; B.JSString_methods.startsWith$2(reference, "../", refStart);) { + refStart += 3; + ++backCount; + } + baseEnd = B.JSString_methods.lastIndexOf$1(base, "/"); + t1 = base.length; + while (true) { + if (!(baseEnd > 0 && backCount > 0)) + break; + newEnd = B.JSString_methods.lastIndexOf$2(base, "/", baseEnd - 1); + if (newEnd < 0) + break; + delta = baseEnd - newEnd; + t2 = delta !== 2; + if (!t2 || delta === 3) { + t3 = newEnd + 1; + if (!(t3 < t1)) + return A.ioore(base, t3); + if (base.charCodeAt(t3) === 46) + if (t2) { + t2 = newEnd + 2; + if (!(t2 < t1)) + return A.ioore(base, t2); + t2 = base.charCodeAt(t2) === 46; + } else + t2 = true; + else + t2 = false; + } else + t2 = false; + if (t2) + break; + --backCount; + baseEnd = newEnd; + } + return B.JSString_methods.replaceRange$3(base, baseEnd + 1, null, B.JSString_methods.substring$1(reference, refStart - 3 * backCount)); + }, + resolve$1(reference) { + return this.resolveUri$1(A.Uri_parse(reference)); + }, + resolveUri$1(reference) { + var targetScheme, t1, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, packageNameEnd, packageName, mergedPath, fragment, _this = this; + if (reference.get$scheme().length !== 0) + return reference; + else { + targetScheme = _this.scheme; + if (reference.get$hasAuthority()) { + t1 = reference.replace$1$scheme(targetScheme); + return t1; + } else { + targetUserInfo = _this._userInfo; + targetHost = _this._host; + targetPort = _this._port; + targetPath = _this.path; + if (reference.get$hasEmptyPath()) + targetQuery = reference.get$hasQuery() ? reference.get$query() : _this._query; + else { + packageNameEnd = A._Uri__packageNameEnd(_this, targetPath); + if (packageNameEnd > 0) { + A.assertHelper(targetScheme === "package"); + A.assertHelper(targetHost == null); + A.assertHelper(targetPath.length !== 0); + packageName = B.JSString_methods.substring$2(targetPath, 0, packageNameEnd); + targetPath = reference.get$hasAbsolutePath() ? packageName + A._Uri__removeDotSegments(reference.get$path()) : packageName + A._Uri__removeDotSegments(_this._mergePaths$2(B.JSString_methods.substring$1(targetPath, packageName.length), reference.get$path())); + } else if (reference.get$hasAbsolutePath()) + targetPath = A._Uri__removeDotSegments(reference.get$path()); + else if (targetPath.length === 0) + if (targetHost == null) + targetPath = targetScheme.length === 0 ? reference.get$path() : A._Uri__removeDotSegments(reference.get$path()); + else + targetPath = A._Uri__removeDotSegments("/" + reference.get$path()); + else { + mergedPath = _this._mergePaths$2(targetPath, reference.get$path()); + t1 = targetScheme.length === 0; + if (!t1 || targetHost != null || B.JSString_methods.startsWith$1(targetPath, "/")) + targetPath = A._Uri__removeDotSegments(mergedPath); + else + targetPath = A._Uri__normalizeRelativePath(mergedPath, !t1 || targetHost != null); + } + targetQuery = reference.get$hasQuery() ? reference.get$query() : null; + } + } + } + fragment = reference.get$hasFragment() ? reference.get$fragment() : null; + return A._Uri$_internal(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, fragment); + }, + get$hasAuthority() { + return this._host != null; + }, + get$hasQuery() { + return this._query != null; + }, + get$hasFragment() { + return this._fragment != null; + }, + get$hasEmptyPath() { + return this.path.length === 0; + }, + get$hasAbsolutePath() { + return B.JSString_methods.startsWith$1(this.path, "/"); + }, + toFilePath$0() { + var pathSegments, _this = this, + t1 = _this.scheme; + if (t1 !== "" && t1 !== "file") + throw A.wrapException(A.UnsupportedError$("Cannot extract a file path from a " + t1 + " URI")); + t1 = _this._query; + if ((t1 == null ? "" : t1) !== "") + throw A.wrapException(A.UnsupportedError$(string$.Cannotefq)); + t1 = _this._fragment; + if ((t1 == null ? "" : t1) !== "") + throw A.wrapException(A.UnsupportedError$(string$.Cannoteff)); + if (_this._host != null && _this.get$host() !== "") + A.throwExpression(A.UnsupportedError$(string$.Cannoten)); + pathSegments = _this.get$pathSegments(); + A._Uri__checkNonWindowsPathReservedCharacters(pathSegments, false); + t1 = A.StringBuffer__writeAll(B.JSString_methods.startsWith$1(_this.path, "/") ? "" + "/" : "", pathSegments, "/"); + t1 = t1.charCodeAt(0) == 0 ? t1 : t1; + return t1; + }, + toString$0(_) { + return this.get$_text(); + }, + $eq(_, other) { + var t1, t2, _this = this; + if (other == null) + return false; + if (_this === other) + return true; + if (type$.Uri._is(other)) + if (_this.scheme === other.get$scheme()) + if (_this._host != null === other.get$hasAuthority()) + if (_this._userInfo === other.get$userInfo()) + if (_this.get$host() === other.get$host()) + if (_this.get$port() === other.get$port()) + if (_this.path === other.get$path()) { + t1 = _this._query; + t2 = t1 == null; + if (!t2 === other.get$hasQuery()) { + if (t2) + t1 = ""; + if (t1 === other.get$query()) { + t1 = _this._fragment; + t2 = t1 == null; + if (!t2 === other.get$hasFragment()) { + if (t2) + t1 = ""; + t1 = t1 === other.get$fragment(); + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + return t1; + }, + set$___Uri_pathSegments_FI(___Uri_pathSegments_FI) { + this.___Uri_pathSegments_FI = type$.List_String._as(___Uri_pathSegments_FI); + }, + $isUri: 1, + get$scheme() { + return this.scheme; + }, + get$path() { + return this.path; + } + }; + A._Uri__makePath_closure.prototype = { + call$1(s) { + return A._Uri__uriEncode(B.List_M2I0, A._asString(s), B.C_Utf8Codec, false); + }, + $signature: 25 + }; + A.UriData.prototype = { + get$uri() { + var t2, queryIndex, end, query, _this = this, _null = null, + t1 = _this._uriCache; + if (t1 == null) { + t1 = _this._separatorIndices; + if (0 >= t1.length) + return A.ioore(t1, 0); + t2 = _this._text; + t1 = t1[0] + 1; + queryIndex = B.JSString_methods.indexOf$2(t2, "?", t1); + end = t2.length; + if (queryIndex >= 0) { + query = A._Uri__normalizeOrSubstring(t2, queryIndex + 1, end, B.List_42A, false, false); + end = queryIndex; + } else + query = _null; + t1 = _this._uriCache = new A._DataUri("data", "", _null, _null, A._Uri__normalizeOrSubstring(t2, t1, end, B.List_M2I, false, false), query, _null); + } + return t1; + }, + toString$0(_) { + var t2, + t1 = this._separatorIndices; + if (0 >= t1.length) + return A.ioore(t1, 0); + t2 = this._text; + return t1[0] === -1 ? "data:" + t2 : t2; + } + }; + A._createTables_build.prototype = { + call$2(state, defaultTransition) { + var t1 = this.tables; + if (!(state < t1.length)) + return A.ioore(t1, state); + t1 = t1[state]; + B.NativeUint8List_methods.fillRange$3(t1, 0, 96, defaultTransition); + return t1; + }, + $signature: 75 + }; + A._createTables_setChars.prototype = { + call$3(target, chars, transition) { + var t1, i, t2; + for (t1 = chars.length, i = 0; i < t1; ++i) { + t2 = chars.charCodeAt(i) ^ 96; + if (!(t2 < 96)) + return A.ioore(target, t2); + target[t2] = transition; + } + }, + $signature: 26 + }; + A._createTables_setRange.prototype = { + call$3(target, range, transition) { + var i, n, + t1 = range.length; + if (0 >= t1) + return A.ioore(range, 0); + i = range.charCodeAt(0); + if (1 >= t1) + return A.ioore(range, 1); + n = range.charCodeAt(1); + for (; i <= n; ++i) { + t1 = (i ^ 96) >>> 0; + if (!(t1 < 96)) + return A.ioore(target, t1); + target[t1] = transition; + } + }, + $signature: 26 + }; + A._SimpleUri.prototype = { + get$hasAuthority() { + return this._hostStart > 0; + }, + get$hasPort() { + return this._hostStart > 0 && this._portStart + 1 < this._pathStart; + }, + get$hasQuery() { + return this._queryStart < this._fragmentStart; + }, + get$hasFragment() { + return this._fragmentStart < this._uri.length; + }, + get$hasAbsolutePath() { + return B.JSString_methods.startsWith$2(this._uri, "/", this._pathStart); + }, + get$hasEmptyPath() { + return this._pathStart === this._queryStart; + }, + get$isAbsolute() { + return this._schemeEnd > 0 && this._fragmentStart >= this._uri.length; + }, + get$scheme() { + var t1 = this._schemeCache; + return t1 == null ? this._schemeCache = this._computeScheme$0() : t1; + }, + _computeScheme$0() { + var t2, _this = this, + t1 = _this._schemeEnd; + if (t1 <= 0) + return ""; + t2 = t1 === 4; + if (t2 && B.JSString_methods.startsWith$1(_this._uri, "http")) + return "http"; + if (t1 === 5 && B.JSString_methods.startsWith$1(_this._uri, "https")) + return "https"; + if (t2 && B.JSString_methods.startsWith$1(_this._uri, "file")) + return "file"; + if (t1 === 7 && B.JSString_methods.startsWith$1(_this._uri, "package")) + return "package"; + return B.JSString_methods.substring$2(_this._uri, 0, t1); + }, + get$userInfo() { + var t1 = this._hostStart, + t2 = this._schemeEnd + 3; + return t1 > t2 ? B.JSString_methods.substring$2(this._uri, t2, t1 - 1) : ""; + }, + get$host() { + var t1 = this._hostStart; + return t1 > 0 ? B.JSString_methods.substring$2(this._uri, t1, this._portStart) : ""; + }, + get$port() { + var t1, _this = this; + if (_this.get$hasPort()) + return A.int_parse(B.JSString_methods.substring$2(_this._uri, _this._portStart + 1, _this._pathStart), null); + t1 = _this._schemeEnd; + if (t1 === 4 && B.JSString_methods.startsWith$1(_this._uri, "http")) + return 80; + if (t1 === 5 && B.JSString_methods.startsWith$1(_this._uri, "https")) + return 443; + return 0; + }, + get$path() { + return B.JSString_methods.substring$2(this._uri, this._pathStart, this._queryStart); + }, + get$query() { + var t1 = this._queryStart, + t2 = this._fragmentStart; + return t1 < t2 ? B.JSString_methods.substring$2(this._uri, t1 + 1, t2) : ""; + }, + get$fragment() { + var t1 = this._fragmentStart, + t2 = this._uri; + return t1 < t2.length ? B.JSString_methods.substring$1(t2, t1 + 1) : ""; + }, + _isPort$1(port) { + var portDigitStart = this._portStart + 1; + return portDigitStart + port.length === this._pathStart && B.JSString_methods.startsWith$2(this._uri, port, portDigitStart); + }, + removeFragment$0() { + var _this = this, + t1 = _this._fragmentStart, + t2 = _this._uri; + if (t1 >= t2.length) + return _this; + return new A._SimpleUri(B.JSString_methods.substring$2(t2, 0, t1), _this._schemeEnd, _this._hostStart, _this._portStart, _this._pathStart, _this._queryStart, t1, _this._schemeCache); + }, + replace$1$scheme(scheme) { + var schemeChanged, isFile, t1, userInfo, port, host, t2, path, t3, query, fragment, _this = this, _null = null; + scheme = A._Uri__makeScheme(scheme, 0, scheme.length); + schemeChanged = !(_this._schemeEnd === scheme.length && B.JSString_methods.startsWith$1(_this._uri, scheme)); + isFile = scheme === "file"; + t1 = _this._hostStart; + userInfo = t1 > 0 ? B.JSString_methods.substring$2(_this._uri, _this._schemeEnd + 3, t1) : ""; + port = _this.get$hasPort() ? _this.get$port() : _null; + if (schemeChanged) + port = A._Uri__makePort(port, scheme); + t1 = _this._hostStart; + if (t1 > 0) + host = B.JSString_methods.substring$2(_this._uri, t1, _this._portStart); + else + host = userInfo.length !== 0 || port != null || isFile ? "" : _null; + t1 = _this._uri; + t2 = _this._queryStart; + path = B.JSString_methods.substring$2(t1, _this._pathStart, t2); + if (!isFile) + t3 = host != null && path.length !== 0; + else + t3 = true; + if (t3 && !B.JSString_methods.startsWith$1(path, "/")) + path = "/" + path; + t3 = _this._fragmentStart; + query = t2 < t3 ? B.JSString_methods.substring$2(t1, t2 + 1, t3) : _null; + t2 = _this._fragmentStart; + fragment = t2 < t1.length ? B.JSString_methods.substring$1(t1, t2 + 1) : _null; + return A._Uri$_internal(scheme, userInfo, host, port, path, query, fragment); + }, + resolve$1(reference) { + return this.resolveUri$1(A.Uri_parse(reference)); + }, + resolveUri$1(reference) { + if (reference instanceof A._SimpleUri) + return this._simpleMerge$2(this, reference); + return this._toNonSimple$0().resolveUri$1(reference); + }, + _simpleMerge$2(base, ref) { + var t2, t3, t4, isSimple, delta, refStart, basePathStart, packageNameEnd, basePathStart0, baseStart, baseEnd, baseUri, baseStart0, backCount, refStart0, insert, + t1 = ref._schemeEnd; + if (t1 > 0) + return ref; + t2 = ref._hostStart; + if (t2 > 0) { + t3 = base._schemeEnd; + if (t3 <= 0) + return ref; + t4 = t3 === 4; + if (t4 && B.JSString_methods.startsWith$1(base._uri, "file")) + isSimple = ref._pathStart !== ref._queryStart; + else if (t4 && B.JSString_methods.startsWith$1(base._uri, "http")) + isSimple = !ref._isPort$1("80"); + else + isSimple = !(t3 === 5 && B.JSString_methods.startsWith$1(base._uri, "https")) || !ref._isPort$1("443"); + if (isSimple) { + delta = t3 + 1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, delta) + B.JSString_methods.substring$1(ref._uri, t1 + 1), t3, t2 + delta, ref._portStart + delta, ref._pathStart + delta, ref._queryStart + delta, ref._fragmentStart + delta, base._schemeCache); + } else + return this._toNonSimple$0().resolveUri$1(ref); + } + refStart = ref._pathStart; + t1 = ref._queryStart; + if (refStart === t1) { + t2 = ref._fragmentStart; + if (t1 < t2) { + t3 = base._queryStart; + delta = t3 - t1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, t3) + B.JSString_methods.substring$1(ref._uri, t1), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, t1 + delta, t2 + delta, base._schemeCache); + } + t1 = ref._uri; + if (t2 < t1.length) { + t3 = base._fragmentStart; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, t3) + B.JSString_methods.substring$1(t1, t2), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, base._queryStart, t2 + (t3 - t2), base._schemeCache); + } + return base.removeFragment$0(); + } + t2 = ref._uri; + if (B.JSString_methods.startsWith$2(t2, "/", refStart)) { + basePathStart = base._pathStart; + packageNameEnd = A._SimpleUri__packageNameEnd(this); + basePathStart0 = packageNameEnd > 0 ? packageNameEnd : basePathStart; + delta = basePathStart0 - refStart; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, basePathStart0) + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, basePathStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + } + baseStart = base._pathStart; + baseEnd = base._queryStart; + if (baseStart === baseEnd && base._hostStart > 0) { + for (; B.JSString_methods.startsWith$2(t2, "../", refStart);) + refStart += 3; + delta = baseStart - refStart + 1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, baseStart) + "/" + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + } + baseUri = base._uri; + packageNameEnd = A._SimpleUri__packageNameEnd(this); + if (packageNameEnd >= 0) + baseStart0 = packageNameEnd; + else + for (baseStart0 = baseStart; B.JSString_methods.startsWith$2(baseUri, "../", baseStart0);) + baseStart0 += 3; + backCount = 0; + while (true) { + refStart0 = refStart + 3; + if (!(refStart0 <= t1 && B.JSString_methods.startsWith$2(t2, "../", refStart))) + break; + ++backCount; + refStart = refStart0; + } + for (t3 = baseUri.length, insert = ""; baseEnd > baseStart0;) { + --baseEnd; + if (!(baseEnd >= 0 && baseEnd < t3)) + return A.ioore(baseUri, baseEnd); + if (baseUri.charCodeAt(baseEnd) === 47) { + if (backCount === 0) { + insert = "/"; + break; + } + --backCount; + insert = "/"; + } + } + if (baseEnd === baseStart0 && base._schemeEnd <= 0 && !B.JSString_methods.startsWith$2(baseUri, "/", baseStart)) { + refStart -= backCount * 3; + insert = ""; + } + delta = baseEnd - refStart + insert.length; + return new A._SimpleUri(B.JSString_methods.substring$2(baseUri, 0, baseEnd) + insert + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + }, + toFilePath$0() { + var t2, _this = this, + t1 = _this._schemeEnd; + if (t1 >= 0) { + t2 = !(t1 === 4 && B.JSString_methods.startsWith$1(_this._uri, "file")); + t1 = t2; + } else + t1 = false; + if (t1) + throw A.wrapException(A.UnsupportedError$("Cannot extract a file path from a " + _this.get$scheme() + " URI")); + t1 = _this._queryStart; + t2 = _this._uri; + if (t1 < t2.length) { + if (t1 < _this._fragmentStart) + throw A.wrapException(A.UnsupportedError$(string$.Cannotefq)); + throw A.wrapException(A.UnsupportedError$(string$.Cannoteff)); + } + if (_this._hostStart < _this._portStart) + A.throwExpression(A.UnsupportedError$(string$.Cannoten)); + t1 = B.JSString_methods.substring$2(t2, _this._pathStart, t1); + return t1; + }, + get$hashCode(_) { + var t1 = this._hashCodeCache; + return t1 == null ? this._hashCodeCache = B.JSString_methods.get$hashCode(this._uri) : t1; + }, + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + return type$.Uri._is(other) && this._uri === other.toString$0(0); + }, + _toNonSimple$0() { + var _this = this, _null = null, + t1 = _this.get$scheme(), + t2 = _this.get$userInfo(), + t3 = _this._hostStart > 0 ? _this.get$host() : _null, + t4 = _this.get$hasPort() ? _this.get$port() : _null, + t5 = _this._uri, + t6 = _this._queryStart, + t7 = B.JSString_methods.substring$2(t5, _this._pathStart, t6), + t8 = _this._fragmentStart; + t6 = t6 < t8 ? _this.get$query() : _null; + return A._Uri$_internal(t1, t2, t3, t4, t7, t6, t8 < t5.length ? _this.get$fragment() : _null); + }, + toString$0(_) { + return this._uri; + }, + $isUri: 1 + }; + A._DataUri.prototype = {}; + A.Expando.prototype = { + $index(_, object) { + A.Expando__badExpandoKey(object); + return this._jsWeakMap.get(object); + }, + toString$0(_) { + return "Expando:null"; + } + }; + A.jsify__convert.prototype = { + call$1(o) { + var t1, convertedMap, key, convertedList; + if (A._noJsifyRequired(o)) + return o; + t1 = this._convertedObjects; + if (t1.containsKey$1(o)) + return t1.$index(0, o); + if (type$.Map_of_nullable_Object_and_nullable_Object._is(o)) { + convertedMap = {}; + t1.$indexSet(0, o, convertedMap); + for (t1 = J.get$iterator$ax(o.get$keys()); t1.moveNext$0();) { + key = t1.get$current(); + convertedMap[key] = this.call$1(o.$index(0, key)); + } + return convertedMap; + } else if (type$.Iterable_nullable_Object._is(o)) { + convertedList = []; + t1.$indexSet(0, o, convertedList); + B.JSArray_methods.addAll$1(convertedList, J.map$1$1$ax(o, this, type$.dynamic)); + return convertedList; + } else + return o; + }, + $signature: 16 + }; + A.promiseToFuture_closure.prototype = { + call$1(r) { + return this.completer.complete$1(this.T._eval$1("0/?")._as(r)); + }, + $signature: 12 + }; + A.promiseToFuture_closure0.prototype = { + call$1(e) { + if (e == null) + return this.completer.completeError$1(new A.NullRejectionException(e === undefined)); + return this.completer.completeError$1(e); + }, + $signature: 12 + }; + A.dartify_convert.prototype = { + call$1(o) { + var t1, millisSinceEpoch, proto, t2, dartObject, originalKeys, dartKeys, i, jsKey, dartKey, l, $length; + if (A._noDartifyRequired(o)) + return o; + t1 = this._convertedObjects; + o.toString; + if (t1.containsKey$1(o)) + return t1.$index(0, o); + if (o instanceof Date) { + millisSinceEpoch = o.getTime(); + if (Math.abs(millisSinceEpoch) > 864e13) + A.throwExpression(A.ArgumentError$("DateTime is outside valid range: " + millisSinceEpoch, null)); + A.checkNotNullable(true, "isUtc", type$.bool); + return new A.DateTime(millisSinceEpoch, true); + } + if (o instanceof RegExp) + throw A.wrapException(A.ArgumentError$("structured clone of RegExp", null)); + if (typeof Promise != "undefined" && o instanceof Promise) + return A.promiseToFuture(o, type$.nullable_Object); + proto = Object.getPrototypeOf(o); + if (proto === Object.prototype || proto === null) { + t2 = type$.nullable_Object; + dartObject = A.LinkedHashMap_LinkedHashMap$_empty(t2, t2); + t1.$indexSet(0, o, dartObject); + originalKeys = Object.keys(o); + dartKeys = []; + for (t1 = J.getInterceptor$ax(originalKeys), t2 = t1.get$iterator(originalKeys); t2.moveNext$0();) + dartKeys.push(A.dartify(t2.get$current())); + for (i = 0; i < t1.get$length(originalKeys); ++i) { + jsKey = t1.$index(originalKeys, i); + if (!(i < dartKeys.length)) + return A.ioore(dartKeys, i); + dartKey = dartKeys[i]; + if (jsKey != null) + dartObject.$indexSet(0, dartKey, this.call$1(o[jsKey])); + } + return dartObject; + } + if (o instanceof Array) { + l = o; + dartObject = []; + t1.$indexSet(0, o, dartObject); + $length = A._asInt(o.length); + for (t1 = J.getInterceptor$asx(l), i = 0; i < $length; ++i) + dartObject.push(this.call$1(t1.$index(l, i))); + return dartObject; + } + return o; + }, + $signature: 16 + }; + A.NullRejectionException.prototype = { + toString$0(_) { + return "Promise was rejected with a value of `" + (this.isUndefined ? "undefined" : "null") + "`."; + }, + $isException: 1 + }; + A._JSRandom.prototype = { + nextInt$1(max) { + if (max <= 0 || max > 4294967296) + throw A.wrapException(A.RangeError$(string$.max_mu + max)); + return Math.random() * max >>> 0; + }, + $isRandom: 1 + }; + A._JSSecureRandom.prototype = { + _JSSecureRandom$0() { + var $crypto = self.crypto; + if ($crypto != null) + if ($crypto.getRandomValues != null) + return; + throw A.wrapException(A.UnsupportedError$("No source of cryptographically secure random numbers available.")); + }, + nextInt$1(max) { + var byteCount, t1, start, randomLimit, t2, t3, t4, random, result; + if (max <= 0 || max > 4294967296) + throw A.wrapException(A.RangeError$(string$.max_mu + max)); + if (max > 255) + if (max > 65535) + byteCount = max > 16777215 ? 4 : 3; + else + byteCount = 2; + else + byteCount = 1; + t1 = this._math$_buffer; + B.NativeByteData_methods._setUint32$3(t1, 0, 0, false); + start = 4 - byteCount; + randomLimit = A._asInt(Math.pow(256, byteCount)); + for (t2 = max - 1, t3 = (max & t2) === 0; true;) { + t4 = t1.buffer; + t4 = new Uint8Array(t4, start, byteCount); + crypto.getRandomValues(t4); + random = B.NativeByteData_methods._getUint32$2(t1, 0, false); + if (t3) + return (random & t2) >>> 0; + result = random % max; + if (random - result + max < randomLimit) + return result; + } + }, + $isRandom: 1 + }; + A.applyDbFunctions_closure.prototype = { + call$1(_) { + return A._pseudorandomStringWithAlphabet(15, "abcdefghijklmnopqrstuvwxyz0123456789"); + }, + $signature: 27 + }; + A.applyDbFunctions_closure0.prototype = { + call$1(_) { + return B.JSString_methods.replaceFirst$2(new A.DateTime(Date.now(), false).toUtc$0().toString$0(0), "T", " "); + }, + $signature: 27 + }; + A.DelegatingStreamSink.prototype = { + add$1(_, data) { + this._sink.add$1(0, this.$ti._precomputed1._as(data)); + }, + addError$2(error, stackTrace) { + this._sink.addError$2(error, stackTrace); + }, + close$0() { + return this._sink.close$0(); + }, + $isEventSink: 1, + $isStreamSink: 1 + }; + A.DefaultEquality.prototype = {}; + A.ListEquality.prototype = { + equals$2(list1, list2) { + var $length, t2, i, + t1 = this.$ti._eval$1("List<1>?"); + t1._as(list1); + t1._as(list2); + if (list1 === list2) + return true; + t1 = J.getInterceptor$asx(list1); + $length = t1.get$length(list1); + t2 = J.getInterceptor$asx(list2); + if ($length !== t2.get$length(list2)) + return false; + for (i = 0; i < $length; ++i) + if (!J.$eq$(t1.$index(list1, i), t2.$index(list2, i))) + return false; + return true; + }, + hash$1(list) { + var t1, hash, i; + this.$ti._eval$1("List<1>?")._as(list); + for (t1 = J.getInterceptor$asx(list), hash = 0, i = 0; i < t1.get$length(list); ++i) { + hash = hash + J.get$hashCode$(t1.$index(list, i)) & 2147483647; + hash = hash + (hash << 10 >>> 0) & 2147483647; + hash ^= hash >>> 6; + } + hash = hash + (hash << 3 >>> 0) & 2147483647; + hash ^= hash >>> 11; + return hash + (hash << 15 >>> 0) & 2147483647; + } + }; + A.NonGrowableListMixin.prototype = {}; + A.UnmodifiableMapMixin.prototype = {}; + A.DriftCommunication.prototype = { + DriftCommunication$3$debugLog$serialize(_channel, debugLog, serialize) { + var t1 = this._communication$_channel.__CloseGuaranteeChannel__stream_F; + t1 === $ && A.throwLateFieldNI("_stream"); + t1.listen$2$onDone(this.get$_handleMessage(), new A.DriftCommunication_closure(this)); + }, + newRequestId$0() { + return this._currentRequestId++; + }, + close$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, t1; + var $async$close$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._startedClosingLocally || ($async$self._closeCompleter.future._async$_state & 30) !== 0) { + // goto return + $async$goto = 1; + break; + } + $async$self._startedClosingLocally = true; + t1 = $async$self._communication$_channel.__CloseGuaranteeChannel__sink_F; + t1 === $ && A.throwLateFieldNI("_sink"); + t1.close$0(); + $async$goto = 3; + return A._asyncAwait($async$self._closeCompleter.future, $async$close$0); + case 3: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$close$0, $async$completer); + }, + _handleMessage$1(msg) { + var request, _this = this; + msg.toString; + msg = B.C_DriftProtocol.deserialize$1(msg); + if (msg instanceof A.SuccessResponse) { + request = _this._pendingRequests.remove$1(0, msg.requestId); + if (request != null) + request.completer.complete$1(msg.response); + } else if (msg instanceof A.ErrorResponse) { + request = _this._pendingRequests.remove$1(0, msg.requestId); + if (request != null) + request.completeWithError$2(new A.DriftRemoteException(msg.error), msg.stackTrace); + } else if (msg instanceof A.Request) + _this._incomingRequests.add$1(0, msg); + else if (msg instanceof A.CancelledResponse) { + request = _this._pendingRequests.remove$1(0, msg.requestId); + if (request != null) + request.completeWithError$1(B.C_CancellationException); + } + }, + _send$1(msg) { + var t1, t2; + if (this._startedClosingLocally || (this._closeCompleter.future._async$_state & 30) !== 0) + throw A.wrapException(A.StateError$("Tried to send " + msg.toString$0(0) + " over isolate channel, but the connection was closed!")); + t1 = this._communication$_channel.__CloseGuaranteeChannel__sink_F; + t1 === $ && A.throwLateFieldNI("_sink"); + t2 = B.C_DriftProtocol.serialize$1(msg); + t1._sink.add$1(0, t1.$ti._precomputed1._as(t2)); + }, + respondError$3(request, error, trace) { + var t1, _this = this; + type$.nullable_StackTrace._as(trace); + if (_this._startedClosingLocally || (_this._closeCompleter.future._async$_state & 30) !== 0) + return; + t1 = request.id; + if (error instanceof A.CancellationException) + _this._send$1(new A.CancelledResponse(t1)); + else + _this._send$1(new A.ErrorResponse(t1, error, trace)); + }, + setRequestHandler$1(handler) { + var t1 = this._incomingRequests; + new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$1(new A.DriftCommunication_setRequestHandler_closure(this, type$.dynamic_Function_Request._as(handler))); + } + }; + A.DriftCommunication_closure.prototype = { + call$0() { + var t1, t2, t3, t4, t5; + for (t1 = this.$this, t2 = t1._pendingRequests, t3 = t2.get$values(), t4 = A._instanceType(t3), t4 = t4._eval$1("@<1>")._bind$1(t4._rest[1]), t3 = new A.MappedIterator(J.get$iterator$ax(t3.__internal$_iterable), t3._f, t4._eval$1("MappedIterator<1,2>")), t4 = t4._rest[1]; t3.moveNext$0();) { + t5 = t3.__internal$_current; + (t5 == null ? t4._as(t5) : t5).completeWithError$1(B.C_ConnectionClosedException); + } + t2.clear$0(0); + t1._closeCompleter.complete$0(); + }, + $signature: 0 + }; + A.DriftCommunication_setRequestHandler_closure.prototype = { + call$1(request) { + return this.$call$body$DriftCommunication_setRequestHandler_closure(type$.Request._as(request)); + }, + $call$body$DriftCommunication_setRequestHandler_closure(request) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, e, s, t1, exception, t2, response, $async$exception; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + response = null; + $async$handler = 4; + t1 = $async$self.handler.call$1(request); + $async$goto = 7; + return A._asyncAwait(t1 instanceof A._Future ? t1 : A._Future$value(t1, type$.dynamic), $async$call$1); + case 7: + // returning from await. + response = $async$result; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + e = A.unwrapException($async$exception); + s = A.getTraceFromException($async$exception); + t1 = $async$self.$this.respondError$3(request, e, s); + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + t1 = $async$self.$this; + if (!(t1._startedClosingLocally || (t1._closeCompleter.future._async$_state & 30) !== 0)) { + t2 = response; + t1._send$1(new A.SuccessResponse(request.id, t2)); + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 85 + }; + A._PendingRequest.prototype = { + completeWithError$2(error, trace) { + var t1; + if (trace == null) + t1 = this.requestTrace; + else { + t1 = A._setArrayType([], type$.JSArray_Trace); + if (trace instanceof A.Chain) + B.JSArray_methods.addAll$1(t1, trace.traces); + else + t1.push(A.Trace_Trace$from(trace)); + t1.push(A.Trace_Trace$from(this.requestTrace)); + t1 = new A.Chain(A.List_List$unmodifiable(t1, type$.Trace)); + } + this.completer.completeError$2(error, t1); + }, + completeWithError$1(error) { + return this.completeWithError$2(error, null); + } + }; + A.ConnectionClosedException.prototype = { + toString$0(_) { + return "Channel was closed before receiving a response"; + }, + $isException: 1 + }; + A.DriftRemoteException.prototype = { + toString$0(_) { + return J.toString$0$(this.remoteCause); + }, + $isException: 1 + }; + A.DriftProtocol.prototype = { + serialize$1(message) { + var t1, t2; + if (message instanceof A.Request) + return [0, message.id, this.encodePayload$1(message.payload)]; + else if (message instanceof A.ErrorResponse) { + t1 = J.toString$0$(message.error); + t2 = message.stackTrace; + t2 = t2 == null ? null : t2.toString$0(0); + return [2, message.requestId, t1, t2]; + } else if (message instanceof A.SuccessResponse) + return [1, message.requestId, this.encodePayload$1(message.response)]; + else if (message instanceof A.CancelledResponse) + return A._setArrayType([3, message.requestId], type$.JSArray_int); + else + return null; + }, + deserialize$1(message) { + var t1, tag, id, stringTrace; + if (!type$.List_dynamic._is(message)) + throw A.wrapException(B.FormatException_ZGD); + t1 = J.getInterceptor$asx(message); + tag = t1.$index(message, 0); + id = A._asInt(t1.$index(message, 1)); + switch (tag) { + case 0: + return new A.Request(id, this.decodePayload$1(t1.$index(message, 2))); + case 2: + stringTrace = A._asStringQ(t1.$index(message, 3)); + t1 = t1.$index(message, 2); + if (t1 == null) + t1 = type$.Object._as(t1); + return new A.ErrorResponse(id, t1, stringTrace != null ? new A._StringStackTrace(stringTrace) : null); + case 1: + return new A.SuccessResponse(id, this.decodePayload$1(t1.$index(message, 2))); + case 3: + return new A.CancelledResponse(id); + } + throw A.wrapException(B.FormatException_urD); + }, + encodePayload$1(payload) { + var t1, t2, t3, t4, t5, _i, arg, t6, _i0, update, rows, result, columns; + if (payload == null || A._isBool(payload)) + return payload; + if (payload instanceof A.NoArgsRequest) + return payload.index; + else if (payload instanceof A.ExecuteQuery) { + t1 = payload.method; + t2 = payload.sql; + t3 = []; + for (t4 = payload.args, t5 = t4.length, _i = 0; _i < t4.length; t4.length === t5 || (0, A.throwConcurrentModificationError)(t4), ++_i) + t3.push(this._encodeDbValue$1(t4[_i])); + return [3, t1.index, t2, t3, payload.executorId]; + } else if (payload instanceof A.ExecuteBatchedStatement) { + t1 = payload.stmts; + t2 = [4, t1.statements]; + for (t1 = t1.$arguments, t3 = t1.length, _i = 0; _i < t1.length; t1.length === t3 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + arg = t1[_i]; + t4 = [arg.statementIndex]; + for (t5 = arg.$arguments, t6 = t5.length, _i0 = 0; _i0 < t5.length; t5.length === t6 || (0, A.throwConcurrentModificationError)(t5), ++_i0) + t4.push(this._encodeDbValue$1(t5[_i0])); + t2.push(t4); + } + t2.push(payload.executorId); + return t2; + } else if (payload instanceof A.RunNestedExecutorControl) + return A._setArrayType([5, payload.control.index, payload.executorId], type$.JSArray_nullable_int); + else if (payload instanceof A.EnsureOpen) + return A._setArrayType([6, payload.schemaVersion, payload.executorId], type$.JSArray_nullable_int); + else if (payload instanceof A.ServerInfo) + return A._setArrayType([13, payload.dialect._core$_name], type$.JSArray_Object); + else if (payload instanceof A.RunBeforeOpen) { + t1 = payload.details; + return A._setArrayType([7, t1.versionBefore, t1.versionNow, payload.createdExecutor], type$.JSArray_nullable_int); + } else if (payload instanceof A.NotifyTablesUpdated) { + t1 = A._setArrayType([8], type$.JSArray_Object); + for (t2 = payload.updates, t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + update = t2[_i]; + t4 = update.kind; + t4 = t4 == null ? null : t4.index; + t1.push([update.table, t4]); + } + return t1; + } else if (payload instanceof A.SelectResult) { + rows = payload.rows; + t1 = J.getInterceptor$asx(rows); + if (t1.get$isEmpty(rows)) + return B.List_11; + else { + result = [11]; + columns = J.toList$0$ax(t1.get$first(rows).get$keys()); + result.push(columns.length); + B.JSArray_methods.addAll$1(result, columns); + result.push(t1.get$length(rows)); + for (t1 = t1.get$iterator(rows); t1.moveNext$0();) + for (t2 = J.get$iterator$ax(t1.get$current().get$values()); t2.moveNext$0();) + result.push(this._encodeDbValue$1(t2.get$current())); + return result; + } + } else if (payload instanceof A.RequestCancellation) + return A._setArrayType([12, payload.originalRequestId], type$.JSArray_int); + else + return [10, payload]; + }, + decodePayload$1(encoded) { + var tag, t1, readInt, readNullableInt, method, sql, t2, args, i, list, t3, t4, t5, updates, encodedUpdate, kindIndex, columnCount, columns, rows, result, t6, rowOffset, t7, c, _box_0 = {}; + if (encoded == null || A._isBool(encoded)) + return encoded; + _box_0.fullMessage = null; + if (A._isInt(encoded)) { + tag = encoded; + t1 = null; + } else { + type$.List_dynamic._as(encoded); + _box_0.fullMessage = encoded; + tag = A._asInt(J.$index$asx(encoded, 0)); + t1 = encoded; + } + readInt = new A.DriftProtocol_decodePayload_readInt(_box_0); + readNullableInt = new A.DriftProtocol_decodePayload_readNullableInt(_box_0); + switch (tag) { + case 0: + return B.NoArgsRequest_0; + case 3: + method = B.JSArray_methods.$index(B.List_kYu, readInt.call$1(1)); + t1 = _box_0.fullMessage; + t1.toString; + sql = A._asString(J.$index$asx(t1, 2)); + t1 = J.map$1$1$ax(type$.List_dynamic._as(J.$index$asx(_box_0.fullMessage, 3)), this.get$_decodeDbValue(), type$.nullable_Object); + return new A.ExecuteQuery(method, sql, A.List_List$of(t1, true, t1.$ti._eval$1("ListIterable.E")), readNullableInt.call$1(4)); + case 4: + t1.toString; + t2 = type$.List_dynamic; + sql = J.cast$1$0$ax(t2._as(J.$index$asx(t1, 1)), type$.String); + args = A._setArrayType([], type$.JSArray_ArgumentsForBatchedStatement); + for (i = 2; i < J.get$length$asx(_box_0.fullMessage) - 1; ++i) { + list = t2._as(J.$index$asx(_box_0.fullMessage, i)); + t1 = J.getInterceptor$asx(list); + t3 = A._asInt(t1.$index(list, 0)); + t4 = []; + for (t1 = t1.skip$1(list, 1), t5 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t5._eval$1("ListIterator")), t5 = t5._eval$1("ListIterable.E"); t1.moveNext$0();) { + encoded = t1.__internal$_current; + t4.push(this._decodeDbValue$1(encoded == null ? t5._as(encoded) : encoded)); + } + B.JSArray_methods.add$1(args, new A.ArgumentsForBatchedStatement(t3, t4)); + } + return new A.ExecuteBatchedStatement(new A.BatchedStatements(sql, args), A._asIntQ(J.get$last$ax(_box_0.fullMessage))); + case 5: + return new A.RunNestedExecutorControl(B.JSArray_methods.$index(B.List_p2F, readInt.call$1(1)), readNullableInt.call$1(2)); + case 6: + return new A.EnsureOpen(readInt.call$1(1), readNullableInt.call$1(2)); + case 13: + t1.toString; + return new A.ServerInfo(A.EnumByName_byName(B.List_yTp, A._asString(J.$index$asx(t1, 1)), type$.SqlDialect)); + case 7: + t1 = readNullableInt.call$1(1); + t2 = readInt.call$1(2); + A.assertHelper(t1 !== 0); + return new A.RunBeforeOpen(new A.OpeningDetails(t1, t2), readInt.call$1(3)); + case 8: + updates = A._setArrayType([], type$.JSArray_TableUpdate); + t1 = type$.List_dynamic; + i = 1; + while (true) { + t2 = _box_0.fullMessage; + t2.toString; + if (!(i < J.get$length$asx(t2))) + break; + encodedUpdate = t1._as(J.$index$asx(_box_0.fullMessage, i)); + t2 = J.getInterceptor$asx(encodedUpdate); + kindIndex = A._asIntQ(t2.$index(encodedUpdate, 1)); + t2 = A._asString(t2.$index(encodedUpdate, 0)); + if (kindIndex == null) + t3 = null; + else { + if (kindIndex >>> 0 !== kindIndex || kindIndex >= 3) + return A.ioore(B.List_c4R, kindIndex); + t3 = B.List_c4R[kindIndex]; + } + B.JSArray_methods.add$1(updates, new A.TableUpdate(t3, t2)); + ++i; + } + return new A.NotifyTablesUpdated(updates); + case 11: + t1.toString; + if (J.get$length$asx(t1) === 1) + return B.SelectResult_List_empty; + columnCount = readInt.call$1(1); + t1 = 2 + columnCount; + t2 = type$.String; + columns = J.cast$1$0$ax(J.sublist$2$ax(_box_0.fullMessage, 2, t1), t2); + rows = readInt.call$1(t1); + result = A._setArrayType([], type$.JSArray_Map_of_String_and_nullable_Object); + for (t1 = columns._source, t3 = J.getInterceptor$asx(t1), t4 = columns.$ti._rest[1], t5 = 3 + columnCount, t6 = type$.nullable_Object, i = 0; i < rows; ++i) { + rowOffset = t5 + i * columnCount; + t7 = A.LinkedHashMap_LinkedHashMap$_empty(t2, t6); + for (c = 0; c < columnCount; ++c) + t7.$indexSet(0, t4._as(t3.$index(t1, c)), this._decodeDbValue$1(J.$index$asx(_box_0.fullMessage, rowOffset + c))); + B.JSArray_methods.add$1(result, t7); + } + return new A.SelectResult(result); + case 12: + return new A.RequestCancellation(readInt.call$1(1)); + case 10: + return J.$index$asx(encoded, 1); + } + throw A.wrapException(A.ArgumentError$value(tag, "tag", "Tag was unknown")); + }, + _encodeDbValue$1(variable) { + if (type$.List_int._is(variable) && !type$.Uint8List._is(variable)) + return new Uint8Array(A._ensureNativeList(variable)); + else if (variable instanceof A._BigIntImpl) + return A._setArrayType(["bigint", variable.toString$0(0)], type$.JSArray_String); + else + return variable; + }, + _decodeDbValue$1(wire) { + var t1; + if (type$.List_dynamic._is(wire)) { + t1 = J.getInterceptor$asx(wire); + if (t1.get$length(wire) === 2 && J.$eq$(t1.$index(wire, 0), "bigint")) + return A._BigIntImpl_parse(J.toString$0$(t1.$index(wire, 1)), null); + return new Uint8Array(A._ensureNativeList(t1.cast$1$0(wire, type$.int))); + } + return wire; + } + }; + A.DriftProtocol_decodePayload_readInt.prototype = { + call$1(index) { + var t1 = this._box_0.fullMessage; + t1.toString; + return A._asInt(J.$index$asx(t1, index)); + }, + $signature: 13 + }; + A.DriftProtocol_decodePayload_readNullableInt.prototype = { + call$1(index) { + var t1 = this._box_0.fullMessage; + t1.toString; + return A._asIntQ(J.$index$asx(t1, index)); + }, + $signature: 87 + }; + A.Message.prototype = {}; + A.Request.prototype = { + toString$0(_) { + return "Request (id = " + this.id + "): " + A.S(this.payload); + } + }; + A.SuccessResponse.prototype = { + toString$0(_) { + return "SuccessResponse (id = " + this.requestId + "): " + A.S(this.response); + } + }; + A.ErrorResponse.prototype = { + toString$0(_) { + return "ErrorResponse (id = " + this.requestId + "): " + A.S(this.error) + " at " + A.S(this.stackTrace); + } + }; + A.CancelledResponse.prototype = { + toString$0(_) { + return "Previous request " + this.requestId + " was cancelled"; + } + }; + A.NoArgsRequest.prototype = { + _enumToString$0() { + return "NoArgsRequest." + this._core$_name; + } + }; + A.StatementMethod.prototype = { + _enumToString$0() { + return "StatementMethod." + this._core$_name; + } + }; + A.ExecuteQuery.prototype = { + toString$0(_) { + var _this = this, + t1 = _this.executorId; + if (t1 != null) + return _this.method.toString$0(0) + ": " + _this.sql + " with " + A.S(_this.args) + " (@" + A.S(t1) + ")"; + return _this.method.toString$0(0) + ": " + _this.sql + " with " + A.S(_this.args); + } + }; + A.RequestCancellation.prototype = { + toString$0(_) { + return "Cancel previous request " + this.originalRequestId; + } + }; + A.ExecuteBatchedStatement.prototype = {}; + A.NestedExecutorControl.prototype = { + _enumToString$0() { + return "NestedExecutorControl." + this._core$_name; + } + }; + A.RunNestedExecutorControl.prototype = { + toString$0(_) { + return "RunTransactionAction(" + this.control.toString$0(0) + ", " + A.S(this.executorId) + ")"; + } + }; + A.EnsureOpen.prototype = { + toString$0(_) { + return "EnsureOpen(" + this.schemaVersion + ", " + A.S(this.executorId) + ")"; + } + }; + A.ServerInfo.prototype = { + toString$0(_) { + return "ServerInfo(" + this.dialect.toString$0(0) + ")"; + } + }; + A.RunBeforeOpen.prototype = { + toString$0(_) { + return "RunBeforeOpen(" + this.details.toString$0(0) + ", " + this.createdExecutor + ")"; + } + }; + A.NotifyTablesUpdated.prototype = { + toString$0(_) { + return "NotifyTablesUpdated(" + A.S(this.updates) + ")"; + } + }; + A.SelectResult.prototype = {}; + A.ServerImplementation.prototype = { + ServerImplementation$3(connection, allowRemoteShutdown, closeExecutorWhenShutdown) { + this._done.future.then$1$1(new A.ServerImplementation_closure(this), type$.Null); + }, + serve$1(channel) { + var comm, t1, _this = this; + if (_this._isShuttingDown) + throw A.wrapException(A.StateError$("Cannot add new channels after shutdown() was called")); + comm = A.DriftCommunication$(channel, true); + comm.setRequestHandler$1(new A.ServerImplementation_serve_closure(_this, comm)); + t1 = _this.connection.get$dialect(); + comm._send$1(new A.Request(comm.newRequestId$0(), new A.ServerInfo(t1))); + _this._activeChannels.add$1(0, comm); + comm._closeCompleter.future.then$1$1(new A.ServerImplementation_serve_closure0(_this, comm), type$.bool); + }, + shutdown$0() { + var t1, _this = this; + if (!_this._isShuttingDown) { + _this._isShuttingDown = true; + t1 = _this.connection.close$0(); + _this._done.complete$1(t1); + } + return _this._done.future; + }, + _closeRemainingConnections$0() { + var t1, t2, t3; + for (t1 = this._activeChannels, t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, t1.$ti._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + (t3 == null ? t2._as(t3) : t3).close$0(); + } + }, + _handleRequest$2(comms, request) { + var t1, token, _this = this, + payload = request.payload; + if (payload instanceof A.NoArgsRequest) + switch (payload.index) { + case 0: + t1 = A.StateError$("Remote shutdowns not allowed"); + throw A.wrapException(t1); + } + else if (payload instanceof A.EnsureOpen) + return _this._handleEnsureOpen$2(comms, payload); + else if (payload instanceof A.ExecuteQuery) { + token = A.runCancellable(new A.ServerImplementation__handleRequest_closure(_this, payload), type$.dynamic); + _this._cancellableOperations.$indexSet(0, request.id, token); + return token._resultCompleter.future.whenComplete$1(new A.ServerImplementation__handleRequest_closure0(_this, request)); + } else if (payload instanceof A.ExecuteBatchedStatement) + return _this._runBatched$2(payload.stmts, payload.executorId); + else if (payload instanceof A.NotifyTablesUpdated) { + _this._tableUpdateNotifications.add$1(0, payload); + _this.dispatchTableUpdateNotification$2(payload, comms); + } else if (payload instanceof A.RunNestedExecutorControl) + return _this._transactionControl$3(comms, payload.control, payload.executorId); + else if (payload instanceof A.RequestCancellation) { + t1 = _this._cancellableOperations.$index(0, payload.originalRequestId); + if (t1 != null) + t1.cancel$0(); + return null; + } + }, + _handleEnsureOpen$2(comms, $open) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$self = this, executor, t1; + var $async$_handleEnsureOpen$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._loadExecutor$1($open.executorId), $async$_handleEnsureOpen$2); + case 3: + // returning from await. + executor = $async$result; + t1 = $open.schemaVersion; + $async$self._knownSchemaVersion = t1; + $async$goto = 4; + return A._asyncAwait(executor.ensureOpen$1(new A._ServerDbUser($async$self, comms, t1)), $async$_handleEnsureOpen$2); + case 4: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_handleEnsureOpen$2, $async$completer); + }, + _runQuery$4(method, sql, args, transactionId) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), + $async$returnValue, $async$self = this, executor, $async$temp1; + var $async$_runQuery$4 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._loadExecutor$1(transactionId), $async$_runQuery$4); + case 3: + // returning from await. + executor = $async$result; + $async$goto = 4; + return A._asyncAwait(A.Future_Future$delayed(B.Duration_0, type$.void), $async$_runQuery$4); + case 4: + // returning from await. + A.checkIfCancelled(); + case 5: + // switch + switch (method.index) { + case 0: + // goto case + $async$goto = 7; + break; + case 1: + // goto case + $async$goto = 8; + break; + case 2: + // goto case + $async$goto = 9; + break; + case 3: + // goto case + $async$goto = 10; + break; + default: + // goto after switch + $async$goto = 6; + break; + } + break; + case 7: + // case + $async$returnValue = executor.runCustom$2(sql, args); + // goto return + $async$goto = 1; + break; + case 8: + // case + $async$returnValue = executor.runDelete$2(sql, args); + // goto return + $async$goto = 1; + break; + case 9: + // case + $async$returnValue = executor.runInsert$2(sql, args); + // goto return + $async$goto = 1; + break; + case 10: + // case + $async$temp1 = A; + $async$goto = 11; + return A._asyncAwait(executor.runSelect$2(sql, args), $async$_runQuery$4); + case 11: + // returning from await. + $async$returnValue = new $async$temp1.SelectResult($async$result); + // goto return + $async$goto = 1; + break; + case 6: + // after switch + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_runQuery$4, $async$completer); + }, + _runBatched$2(stmts, transactionId) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$_runBatched$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._loadExecutor$1(transactionId), $async$_runBatched$2); + case 3: + // returning from await. + $async$goto = 2; + return A._asyncAwait($async$result.runBatched$1(stmts), $async$_runBatched$2); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_runBatched$2, $async$completer); + }, + _loadExecutor$1(transactionId) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.QueryExecutor), + $async$returnValue, $async$self = this, t1; + var $async$_loadExecutor$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._waitForTurn$1(transactionId), $async$_loadExecutor$1); + case 3: + // returning from await. + if (transactionId != null) { + t1 = $async$self._managedExecutors.$index(0, transactionId); + t1.toString; + } else + t1 = $async$self.connection; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_loadExecutor$1, $async$completer); + }, + _spawnTransaction$2(comm, executor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.int), + $async$returnValue, $async$self = this, transaction, id; + var $async$_spawnTransaction$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._loadExecutor$1(executor), $async$_spawnTransaction$2); + case 3: + // returning from await. + transaction = $async$result.beginTransaction$0(); + id = $async$self._putExecutor$2$beforeCurrent(transaction, true); + $async$goto = 4; + return A._asyncAwait(transaction.ensureOpen$1(new A._ServerDbUser($async$self, comm, $async$self._knownSchemaVersion)), $async$_spawnTransaction$2); + case 4: + // returning from await. + $async$returnValue = id; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_spawnTransaction$2, $async$completer); + }, + _spawnExclusive$2(comm, executor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.int), + $async$returnValue, $async$self = this, exclusive, id; + var $async$_spawnExclusive$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._loadExecutor$1(executor), $async$_spawnExclusive$2); + case 3: + // returning from await. + exclusive = $async$result.beginExclusive$0(); + id = $async$self._putExecutor$2$beforeCurrent(exclusive, true); + $async$goto = 4; + return A._asyncAwait(exclusive.ensureOpen$1(new A._ServerDbUser($async$self, comm, $async$self._knownSchemaVersion)), $async$_spawnExclusive$2); + case 4: + // returning from await. + $async$returnValue = id; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_spawnExclusive$2, $async$completer); + }, + _putExecutor$2$beforeCurrent(executor, beforeCurrent) { + var t2, t3, + t1 = this._currentExecutorId++; + this._managedExecutors.$indexSet(0, t1, executor); + t2 = this._executorBacklog; + t3 = t2.length; + if (t3 !== 0) + B.JSArray_methods.insert$2(t2, 0, t1); + else + B.JSArray_methods.add$1(t2, t1); + return t1; + }, + _transactionControl$3(comm, action, executorId) { + return this._transactionControl$body$ServerImplementation(comm, action, executorId); + }, + _transactionControl$body$ServerImplementation(comm, action, executorId) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, executor; + var $async$_transactionControl$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = action === B.NestedExecutorControl_0 ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._spawnTransaction$2(comm, executorId), $async$_transactionControl$3); + case 6: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = action === B.NestedExecutorControl_3 ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait($async$self._spawnExclusive$2(comm, executorId), $async$_transactionControl$3); + case 9: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 8: + // join + case 4: + // join + $async$goto = 10; + return A._asyncAwait($async$self._loadExecutor$1(executorId), $async$_transactionControl$3); + case 10: + // returning from await. + executor = $async$result; + $async$goto = action === B.NestedExecutorControl_4 ? 11 : 12; + break; + case 11: + // then + $async$goto = 13; + return A._asyncAwait(executor.close$0(), $async$_transactionControl$3); + case 13: + // returning from await. + executorId.toString; + $async$self._releaseExecutor$1(executorId); + // goto return + $async$goto = 1; + break; + case 12: + // join + if (!type$.TransactionExecutor._is(executor)) + throw A.wrapException(A.ArgumentError$value(executorId, "transactionId", "Does not reference a transaction. This might happen if you don't await all operations made inside a transaction, in which case the transaction might complete with pending operations.")); + case 14: + // switch + switch (action.index) { + case 1: + // goto case + $async$goto = 16; + break; + case 2: + // goto case + $async$goto = 17; + break; + default: + // goto default + $async$goto = 18; + break; + } + break; + case 16: + // case + $async$goto = 19; + return A._asyncAwait(executor.send$0(), $async$_transactionControl$3); + case 19: + // returning from await. + executorId.toString; + $async$self._releaseExecutor$1(executorId); + // goto after switch + $async$goto = 15; + break; + case 17: + // case + $async$handler = 20; + $async$goto = 23; + return A._asyncAwait(executor.rollback$0(), $async$_transactionControl$3); + case 23: + // returning from await. + $async$next.push(22); + // goto finally + $async$goto = 21; + break; + case 20: + // uncaught + $async$next = [2]; + case 21: + // finally + $async$handler = 2; + executorId.toString; + $async$self._releaseExecutor$1(executorId); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 22: + // after finally + // goto after switch + $async$goto = 15; + break; + case 18: + // default + A.assertThrow("Unknown TransactionControl"); + case 15: + // after switch + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_transactionControl$3, $async$completer); + }, + _releaseExecutor$1(id) { + var t1; + this._managedExecutors.remove$1(0, id); + B.JSArray_methods.remove$1(this._executorBacklog, id); + t1 = this._backlogUpdated; + if ((t1._async$_state & 4) === 0) + t1.add$1(0, null); + }, + _waitForTurn$1(transactionId) { + var t2, + t1 = new A.ServerImplementation__waitForTurn_idIsActive(this, transactionId); + if (A.boolConversionCheck(t1.call$0())) + return A.Future_Future$value(null, type$.void); + t2 = this._backlogUpdated; + return new A._BroadcastStream(t2, A._instanceType(t2)._eval$1("_BroadcastStream<1>")).firstWhere$1(0, new A.ServerImplementation__waitForTurn_closure(t1)); + }, + dispatchTableUpdateNotification$2(notification, source) { + var t1, t2, t3; + for (t1 = this._activeChannels, t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, t1.$ti._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + if (t3 == null) + t3 = t2._as(t3); + if (t3 !== source) + t3._send$1(new A.Request(t3._currentRequestId++, notification)); + } + }, + $isDriftServer: 1 + }; + A.ServerImplementation_closure.prototype = { + call$1(_) { + var t1 = this.$this; + t1._closeRemainingConnections$0(); + t1._tableUpdateNotifications.close$0(); + }, + $signature: 92 + }; + A.ServerImplementation_serve_closure.prototype = { + call$1(request) { + return this.$this._handleRequest$2(this.comm, request); + }, + $signature: 108 + }; + A.ServerImplementation_serve_closure0.prototype = { + call$1(_) { + return this.$this._activeChannels.remove$1(0, this.comm); + }, + $signature: 22 + }; + A.ServerImplementation__handleRequest_closure.prototype = { + call$0() { + var t1 = this.payload; + return this.$this._runQuery$4(t1.method, t1.sql, t1.args, t1.executorId); + }, + $signature: 40 + }; + A.ServerImplementation__handleRequest_closure0.prototype = { + call$0() { + return this.$this._cancellableOperations.remove$1(0, this.request.id); + }, + $signature: 41 + }; + A.ServerImplementation__waitForTurn_idIsActive.prototype = { + call$0() { + var t2, + t1 = this.transactionId; + if (t1 == null) + return this.$this._executorBacklog.length === 0; + else { + t2 = this.$this._executorBacklog; + return t2.length !== 0 && B.JSArray_methods.get$first(t2) === t1; + } + }, + $signature: 37 + }; + A.ServerImplementation__waitForTurn_closure.prototype = { + call$1(_) { + return this.idIsActive.call$0(); + }, + $signature: 22 + }; + A._ServerDbUser.prototype = { + beforeOpen$2(executor, details) { + return this.beforeOpen$body$_ServerDbUser(executor, details); + }, + beforeOpen$body$_ServerDbUser(executor, details) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$handler = 1, $async$currentError, $async$next = [], $async$self = this, t2, id0, t3, t1, id; + var $async$beforeOpen$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._server; + id = t1._putExecutor$2$beforeCurrent(executor, true); + $async$handler = 2; + t2 = $async$self.connection; + id0 = t2.newRequestId$0(); + t3 = new A._Future($.Zone__current, type$._Future_void); + t2._pendingRequests.$indexSet(0, id0, new A._PendingRequest(new A._AsyncCompleter(t3, type$._AsyncCompleter_void), A.StackTrace_current())); + t2._send$1(new A.Request(id0, new A.RunBeforeOpen(details, id))); + $async$goto = 5; + return A._asyncAwait(t3, $async$beforeOpen$2); + case 5: + // returning from await. + $async$next.push(4); + // goto finally + $async$goto = 3; + break; + case 2: + // uncaught + $async$next = [1]; + case 3: + // finally + $async$handler = 1; + t1._releaseExecutor$1(id); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 4: + // after finally + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$beforeOpen$2, $async$completer); + }, + $isQueryExecutorUser: 1 + }; + A.UpdateKind.prototype = { + _enumToString$0() { + return "UpdateKind." + this._core$_name; + } + }; + A.TableUpdate.prototype = { + get$hashCode(_) { + return A.Object_hash(this.kind, this.table, B.C_SentinelValue, B.C_SentinelValue); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.TableUpdate && other.kind == this.kind && other.table === this.table; + }, + toString$0(_) { + return "TableUpdate(" + this.table + ", kind: " + A.S(this.kind) + ")"; + } + }; + A.runCancellable_closure.prototype = { + call$0() { + return this._box_0.token._resultCompleter.complete$1(A.Future_Future$sync(this.operation, this.T)); + }, + $signature: 0 + }; + A.CancellationToken.prototype = { + cancel$0() { + var t1, _i; + if (this._cancellationRequested) + return; + for (t1 = this._cancellationCallbacks, _i = 0; false; ++_i) + t1[_i].call$0(); + this._cancellationRequested = true; + } + }; + A.CancellationException.prototype = { + toString$0(_) { + return "Operation was cancelled"; + }, + $isException: 1 + }; + A.QueryExecutor.prototype = { + close$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void); + var $async$close$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$close$0, $async$completer); + } + }; + A.BatchedStatements.prototype = { + get$hashCode(_) { + return A.Object_hash(B.C_ListEquality.hash$1(this.statements), B.C_ListEquality.hash$1(this.$arguments), B.C_SentinelValue, B.C_SentinelValue); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.BatchedStatements && B.C_ListEquality.equals$2(other.statements, this.statements) && B.C_ListEquality.equals$2(other.$arguments, this.$arguments); + }, + toString$0(_) { + var t1 = this.statements; + return "BatchedStatements(" + t1.toString$0(t1) + ", " + A.S(this.$arguments) + ")"; + } + }; + A.ArgumentsForBatchedStatement.prototype = { + get$hashCode(_) { + return A.Object_hash(this.statementIndex, B.C_ListEquality, B.C_SentinelValue, B.C_SentinelValue); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ArgumentsForBatchedStatement && other.statementIndex === this.statementIndex && B.C_ListEquality.equals$2(other.$arguments, this.$arguments); + }, + toString$0(_) { + return "ArgumentsForBatchedStatement(" + this.statementIndex + ", " + A.S(this.$arguments) + ")"; + } + }; + A.DatabaseDelegate.prototype = {}; + A.QueryDelegate.prototype = {}; + A.TransactionDelegate.prototype = {}; + A.NoTransactionDelegate.prototype = {}; + A.DbVersionDelegate.prototype = {}; + A.NoVersionDelegate.prototype = {}; + A.DynamicVersionDelegate.prototype = {}; + A._BaseExecutor.prototype = { + get$isSequential() { + return false; + }, + get$logStatements() { + return false; + }, + _debugCheckIsOpen$0() { + if (!this._ensureOpenCalled) + throw A.wrapException(A.StateError$("Tried to run an operation without first calling QueryExecutor.ensureOpen()!\n\nIf you're seeing this exception from a drift database, it may indicate a bug in\ndrift itself. Please consider opening an issue with the stack trace and details\non how to reproduce this.")); + if (this._engines$_closed) + throw A.wrapException(A.StateError$("This database or transaction runner has already been closed and may not be used\nanymore.\n\nIf this is happening in a transaction, you might be using the transaction\nwithout awaiting every statement in it.")); + return true; + }, + _synchronized$1$1(action, $T) { + $T._eval$1("Future<0>()")._as(action); + if (this.get$isSequential() || this._waitingChildExecutors > 0) + return this._lock.synchronized$1$1(new A._BaseExecutor__synchronized_closure(action, $T), $T); + else + return action.call$0(); + }, + _log$2(sql, args) { + this.get$logStatements(); + }, + runSelect$2(statement, args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.List_Map_of_String_and_nullable_Object), + $async$returnValue, $async$self = this, t1; + var $async$runSelect$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._synchronized$1$1(new A._BaseExecutor_runSelect_closure($async$self, statement, args), type$.QueryResult), $async$runSelect$2); + case 3: + // returning from await. + t1 = $async$result.get$asMap(0); + $async$returnValue = A.List_List$of(t1, true, t1.$ti._eval$1("ListIterable.E")); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$runSelect$2, $async$completer); + }, + runDelete$2(statement, args) { + return this._synchronized$1$1(new A._BaseExecutor_runDelete_closure(this, statement, args), type$.int); + }, + runInsert$2(statement, args) { + return this._synchronized$1$1(new A._BaseExecutor_runInsert_closure(this, statement, args), type$.int); + }, + runCustom$2(statement, args) { + return this._synchronized$1$1(new A._BaseExecutor_runCustom_closure(this, args, statement), type$.void); + }, + runCustom$1(statement) { + return this.runCustom$2(statement, null); + }, + runBatched$1(statements) { + return this._synchronized$1$1(new A._BaseExecutor_runBatched_closure(this, statements), type$.void); + }, + beginExclusive$0() { + return new A._ExclusiveExecutor(this, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void), new A.Lock()); + }, + beginTransaction$0() { + return this.beginTransactionInContext$1(this); + } + }; + A._BaseExecutor__synchronized_closure.prototype = { + call$0() { + A.checkIfCancelled(); + return this.action.call$0(); + }, + $signature() { + return this.T._eval$1("Future<0>()"); + } + }; + A._BaseExecutor_runSelect_closure.prototype = { + call$0() { + var t2, t3, + t1 = this.$this; + t1._debugCheckIsOpen$0(); + t2 = this.statement; + t3 = this.args; + t1._log$2(t2, t3); + return t1.get$impl().runSelect$2(t2, t3); + }, + $signature: 42 + }; + A._BaseExecutor_runDelete_closure.prototype = { + call$0() { + var t2, t3, + t1 = this.$this; + t1._debugCheckIsOpen$0(); + t2 = this.statement; + t3 = this.args; + t1._log$2(t2, t3); + return t1.get$impl().runUpdate$2(t2, t3); + }, + $signature: 28 + }; + A._BaseExecutor_runInsert_closure.prototype = { + call$0() { + var t2, t3, + t1 = this.$this; + t1._debugCheckIsOpen$0(); + t2 = this.statement; + t3 = this.args; + t1._log$2(t2, t3); + return t1.get$impl().runInsert$2(t2, t3); + }, + $signature: 28 + }; + A._BaseExecutor_runCustom_closure.prototype = { + call$0() { + var resolvedArgs, t2, + t1 = this.$this; + t1._debugCheckIsOpen$0(); + resolvedArgs = this.args; + if (resolvedArgs == null) + resolvedArgs = B.List_empty; + t2 = this.statement; + t1._log$2(t2, resolvedArgs); + return t1.get$impl().runCustom$2(t2, resolvedArgs); + }, + $signature: 2 + }; + A._BaseExecutor_runBatched_closure.prototype = { + call$0() { + var t1 = this.$this; + t1._debugCheckIsOpen$0(); + t1.get$logStatements(); + return t1.get$impl().runBatched$1(this.statements); + }, + $signature: 2 + }; + A._TransactionExecutor.prototype = { + _checkCanOpen$0() { + this._ensureOpenCalled = true; + if (this._engines$_closed) + throw A.wrapException(A.StateError$("A transaction was used after being closed. Please check that you're awaiting all database operations inside a `transaction` block.")); + }, + beginTransactionInContext$1(context) { + throw A.wrapException(A.UnsupportedError$("Nested transactions aren't supported.")); + }, + get$dialect() { + return B.SqlDialect_0_sqlite; + }, + get$logStatements() { + return false; + }, + get$isSequential() { + return true; + }, + $isTransactionExecutor: 1 + }; + A._StatementBasedTransactionExecutor.prototype = { + ensureOpen$1(user) { + var opened, $parent, _this = this; + _this._checkCanOpen$0(); + opened = _this._opened; + if (opened == null) { + opened = new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_bool), type$._AsyncCompleter_bool); + _this.set$_opened(opened); + $parent = _this._parent; + ++$parent._waitingChildExecutors; + $parent._synchronized$1$1(new A._StatementBasedTransactionExecutor_ensureOpen_closure(_this), type$.Null).whenComplete$1(new A._StatementBasedTransactionExecutor_ensureOpen_closure0($parent)); + } + return opened.future; + }, + get$impl() { + return this._db.delegate; + }, + beginTransactionInContext$1(context) { + var t1 = this.depth + 1; + return new A._StatementBasedTransactionExecutor(this._engines$_delegate, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void), context, t1, A._defaultSavepoint(t1), A._defaultRelease(t1), A._defaultRollbackToSavepoint(t1), this._db, new A.Lock()); + }, + send$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this; + var $async$send$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (!$async$self._ensureOpenCalled) { + // goto return + $async$goto = 1; + break; + } + $async$goto = 3; + return A._asyncAwait($async$self.runCustom$2($async$self._commitCommand, B.List_empty), $async$send$0); + case 3: + // returning from await. + $async$self._afterCommitOrRollback$0(); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$send$0, $async$completer); + }, + rollback$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this; + var $async$rollback$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + if (!$async$self._ensureOpenCalled) { + // goto return + $async$goto = 1; + break; + } + $async$handler = 3; + $async$goto = 6; + return A._asyncAwait($async$self.runCustom$2($async$self._rollbackCommand, B.List_empty), $async$rollback$0); + case 6: + // returning from await. + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + $async$self._afterCommitOrRollback$0(); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$rollback$0, $async$completer); + }, + _afterCommitOrRollback$0() { + var _this = this; + if (_this.depth === 0) + _this._db.delegate.isInTransaction = false; + _this._engines$_done.complete$0(); + _this._engines$_closed = true; + }, + set$_opened(_opened) { + this._opened = type$.nullable_Completer_bool._as(_opened); + } + }; + A._StatementBasedTransactionExecutor_ensureOpen_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$handler = 1, $async$currentError, $async$self = this, e, s, t1, exception, $async$exception; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 3; + t1 = $async$self.$this; + $async$goto = 6; + return A._asyncAwait(t1.runCustom$1(t1._startCommand), $async$call$0); + case 6: + // returning from await. + t1._db.delegate.isInTransaction = true; + t1._opened.complete$1(true); + $async$handler = 1; + // goto after finally + $async$goto = 5; + break; + case 3: + // catch + $async$handler = 2; + $async$exception = $async$currentError; + e = A.unwrapException($async$exception); + s = A.getTraceFromException($async$exception); + $async$self.$this._opened.completeError$2(e, s); + // goto after finally + $async$goto = 5; + break; + case 2: + // uncaught + // goto rethrow + $async$goto = 1; + break; + case 5: + // after finally + $async$goto = 7; + return A._asyncAwait($async$self.$this._engines$_done.future, $async$call$0); + case 7: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 14 + }; + A._StatementBasedTransactionExecutor_ensureOpen_closure0.prototype = { + call$0() { + return this.parent._waitingChildExecutors--; + }, + $signature: 45 + }; + A.DelegatedDatabase.prototype = { + get$impl() { + return this.delegate; + }, + get$dialect() { + return B.SqlDialect_0_sqlite; + }, + ensureOpen$1(user) { + return this._openingLock.synchronized$1$1(new A.DelegatedDatabase_ensureOpen_closure(this, user), type$.bool); + }, + _runMigrations$1(user) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, currentVersion, oldVersion, t1, t2; + var $async$_runMigrations$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.delegate; + t2 = t1.__Sqlite3Delegate_versionDelegate_A; + t2 === $ && A.throwLateFieldNI("versionDelegate"); + currentVersion = user.schemaVersion; + $async$goto = t2 instanceof A.NoVersionDelegate ? 2 : 4; + break; + case 2: + // then + oldVersion = currentVersion; + // goto join + $async$goto = 3; + break; + case 4: + // else + $async$goto = t2 instanceof A._SqliteVersionDelegate ? 5 : 7; + break; + case 5: + // then + $async$goto = 8; + return A._asyncAwait(A.Future_Future$value(t2.database.get$userVersion(), type$.int), $async$_runMigrations$1); + case 8: + // returning from await. + oldVersion = $async$result; + // goto join + $async$goto = 6; + break; + case 7: + // else + throw A.wrapException(A.Exception_Exception("Invalid delegate: " + t1.toString$0(0) + ". The versionDelegate getter must not subclass DBVersionDelegate directly")); + case 6: + // join + case 3: + // join + if (oldVersion === 0) + oldVersion = null; + A.assertHelper(oldVersion !== 0); + $async$goto = 9; + return A._asyncAwait(user.beforeOpen$2(new A._BeforeOpeningExecutor($async$self, new A.Lock()), new A.OpeningDetails(oldVersion, currentVersion)), $async$_runMigrations$1); + case 9: + // returning from await. + $async$goto = t2 instanceof A._SqliteVersionDelegate && oldVersion !== currentVersion ? 10 : 11; + break; + case 10: + // then + t2.database.execute$1("PRAGMA user_version = " + currentVersion + ";"); + $async$goto = 12; + return A._asyncAwait(A.Future_Future$value(null, type$.void), $async$_runMigrations$1); + case 12: + // returning from await. + case 11: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_runMigrations$1, $async$completer); + }, + beginTransactionInContext$1(context) { + var t1 = $.Zone__current; + return new A._StatementBasedTransactionExecutor(B.C_NoTransactionDelegate, new A._AsyncCompleter(new A._Future(t1, type$._Future_void), type$._AsyncCompleter_void), context, 0, "BEGIN TRANSACTION", "COMMIT TRANSACTION", "ROLLBACK TRANSACTION", this, new A.Lock()); + }, + close$0() { + return this._openingLock.synchronized$1$1(new A.DelegatedDatabase_close_closure(this), type$.void); + }, + set$_migrationError(_migrationError) { + this._migrationError = type$.nullable_Record_2_Object_and_StackTrace._as(_migrationError); + }, + get$logStatements() { + return this.logStatements; + }, + get$isSequential() { + return this.isSequential; + } + }; + A.DelegatedDatabase_ensureOpen_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, e, s, _0_0, t2, t3, t4, exception, t1, $async$exception; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + if (t1._engines$_closed) { + $async$returnValue = A.Future_Future$error(new A.StateError("Can't re-open a database after closing it. Please create a new database connection and open that instead."), null, type$.bool); + // goto return + $async$goto = 1; + break; + } + _0_0 = t1._migrationError; + if (_0_0 != null) + A.Error_throwWithStackTrace(_0_0._0, _0_0._1); + t2 = t1.delegate; + t3 = type$.bool; + t4 = A.Future_Future$value(t2._isOpen, t3); + $async$goto = 3; + return A._asyncAwait(type$.Future_bool._is(t4) ? t4 : A._Future$value(A._asBool(t4), t3), $async$call$0); + case 3: + // returning from await. + if ($async$result) { + $async$returnValue = t1._ensureOpenCalled = true; + // goto return + $async$goto = 1; + break; + } + t3 = $async$self.user; + $async$goto = 4; + return A._asyncAwait(t2.open$1(t3), $async$call$0); + case 4: + // returning from await. + t1._ensureOpenCalled = true; + $async$handler = 6; + $async$goto = 9; + return A._asyncAwait(t1._runMigrations$1(t3), $async$call$0); + case 9: + // returning from await. + $async$returnValue = true; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 8; + break; + case 6: + // catch + $async$handler = 5; + $async$exception = $async$currentError; + e = A.unwrapException($async$exception); + s = A.getTraceFromException($async$exception); + t1.set$_migrationError(new A._Record_2(e, s)); + throw $async$exception; + // goto after finally + $async$goto = 8; + break; + case 5: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 8: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 46 + }; + A.DelegatedDatabase_close_closure.prototype = { + call$0() { + var t1 = this.$this; + if (t1._ensureOpenCalled && !t1._engines$_closed) { + t1._engines$_closed = true; + t1._ensureOpenCalled = false; + return t1.delegate.close$0(); + } else + return A.Future_Future$value(null, type$.void); + }, + $signature: 2 + }; + A._BeforeOpeningExecutor.prototype = { + beginTransactionInContext$1(context) { + return this._base.beginTransactionInContext$1(context); + }, + ensureOpen$1(_) { + this._ensureOpenCalled = true; + return A.Future_Future$value(true, type$.bool); + }, + get$impl() { + return this._base.delegate; + }, + get$logStatements() { + return false; + }, + get$dialect() { + return B.SqlDialect_0_sqlite; + } + }; + A._ExclusiveExecutor.prototype = { + get$dialect() { + return this._outer.get$dialect(); + }, + ensureOpen$1(user) { + var t1, opened, t2, _this = this, + _0_0 = _this._opened; + if (_0_0 != null) + return _0_0.future; + else { + _this._ensureOpenCalled = true; + t1 = new A._Future($.Zone__current, type$._Future_bool); + opened = new A._AsyncCompleter(t1, type$._AsyncCompleter_bool); + _this.set$_opened(opened); + t2 = _this._outer; + ++t2._waitingChildExecutors; + t2._synchronized$1$1(new A._ExclusiveExecutor_ensureOpen_closure(_this, opened), type$.Null); + return t1; + } + }, + get$impl() { + return this._outer.get$impl(); + }, + beginTransactionInContext$1(context) { + return this._outer.beginTransactionInContext$1(context); + }, + close$0() { + this._completer.complete$0(); + return A.Future_Future$value(null, type$.void); + }, + set$_opened(_opened) { + this._opened = type$.nullable_Completer_bool._as(_opened); + } + }; + A._ExclusiveExecutor_ensureOpen_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self.opened.complete$1(true); + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._completer.future, $async$call$0); + case 2: + // returning from await. + --t1._outer._waitingChildExecutors; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 14 + }; + A.QueryResult.prototype = { + get$asMap(_) { + var t1 = this.rows, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("Map(1)")._as(new A.QueryResult_asMap_closure(this)), t2._eval$1("MappedListIterable<1,Map>")); + } + }; + A.QueryResult_asMap_closure.prototype = { + call$1(row) { + var t1, t2, t3, t4, t5, _i, column, t6; + type$.List_nullable_Object._as(row); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.dynamic); + for (t2 = this.$this, t3 = t2.columnNames, t4 = t3.length, t2 = t2._columnIndexes, t5 = J.getInterceptor$asx(row), _i = 0; _i < t3.length; t3.length === t4 || (0, A.throwConcurrentModificationError)(t3), ++_i) { + column = t3[_i]; + t6 = t2.$index(0, column); + t6.toString; + t1.$indexSet(0, column, t5.$index(row, t6)); + } + return t1; + }, + $signature: 47 + }; + A.QueryInterceptor.prototype = {}; + A._InterceptedExecutor.prototype = { + beginTransaction$0() { + var t1 = this._interceptor$_inner; + return new A._InterceptedTransactionExecutor(t1.beginTransactionInContext$1(t1), this._interceptor$_interceptor); + }, + beginExclusive$0() { + return new A._InterceptedExecutor(new A._ExclusiveExecutor(this._interceptor$_inner, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void), new A.Lock()), this._interceptor$_interceptor); + }, + get$dialect() { + return this._interceptor$_inner.get$dialect(); + }, + ensureOpen$1(user) { + return this._interceptor$_inner.ensureOpen$1(user); + }, + runBatched$1(statements) { + return this._interceptor$_inner.runBatched$1(statements); + }, + runCustom$2(statement, args) { + return this._interceptor$_inner.runCustom$2(statement, args); + }, + runDelete$2(statement, args) { + return this._interceptor$_inner.runDelete$2(statement, args); + }, + runInsert$2(statement, args) { + return this._interceptor$_inner.runInsert$2(statement, args); + }, + runSelect$2(statement, args) { + return this._interceptor$_inner.runSelect$2(statement, args); + }, + close$0() { + return this._interceptor$_interceptor.close$1(this._interceptor$_inner); + } + }; + A._InterceptedTransactionExecutor.prototype = { + rollback$0() { + return type$.TransactionExecutor._as(this._interceptor$_inner).rollback$0(); + }, + send$0() { + return type$.TransactionExecutor._as(this._interceptor$_inner).send$0(); + }, + $isTransactionExecutor: 1 + }; + A.OpeningDetails.prototype = {}; + A.SqlDialect.prototype = { + _enumToString$0() { + return "SqlDialect." + this._core$_name; + } + }; + A.Sqlite3Delegate.prototype = { + open$1(db) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, t1, exception; + var $async$open$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (!$async$self._hasInitializedDatabase) { + A.assertHelper($async$self._database == null); + $async$self.set$_database($async$self.openDatabase$0()); + try { + A.assertHelper(!$async$self._hasInitializedDatabase); + t1 = $async$self._database; + t1.toString; + A.EnableNativeFunctions_useNativeFunctions(t1); + t1 = $async$self._database; + t1.toString; + $async$self._database$_setup.call$1(t1); + if ($async$self.enableMigrations) { + t1 = $async$self._database; + t1.toString; + t1 = new A._SqliteVersionDelegate(t1); + } else + t1 = B.C_NoVersionDelegate; + $async$self.__Sqlite3Delegate_versionDelegate_A = t1; + $async$self._hasInitializedDatabase = true; + } catch (exception) { + t1 = $async$self._database; + if (t1 != null) + t1.dispose$0(); + $async$self.set$_database(null); + $async$self._preparedStmtsCache._cachedStatements.clear$0(0); + throw exception; + } + } + $async$self._isOpen = true; + $async$returnValue = A.Future_Future$value(null, type$.void); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$open$1, $async$completer); + }, + close$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$close$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self._preparedStmtsCache.disposeAll$0(); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$close$0, $async$completer); + }, + runBatchSync$1(statements) { + var stmt, application, stmt0, stmt1, t1, t2, t3, _i, t4, t5, t6, t7, + prepared = A._setArrayType([], type$.JSArray_CommonPreparedStatement); + try { + for (t1 = statements.statements, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + stmt = t3 == null ? t2._as(t3) : t3; + J.add$1$ax(prepared, this._database.prepare$2$checkNoTail(stmt, true)); + } + for (t1 = statements.$arguments, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + application = t1[_i]; + stmt0 = J.$index$asx(prepared, application.statementIndex); + t3 = stmt0; + t4 = application.$arguments; + t5 = t3.finalizable; + if (t5._closed) + A.throwExpression(A.StateError$(string$.Tried_)); + if (!t5._inResetState) { + t6 = t5.statement; + t7 = t6.bindings._sqlite3_reset; + t6 = [null, t6.stmt]; + A.assertInteropArgs(t6); + A._asInt(A._asDouble(t7.call.apply(t7, t6))); + t5._inResetState = true; + } + t5.statement.deallocateArguments$0(); + t3._bindParams$1(new A.IndexedParameters(t4)); + t3._execute$0(); + } + } finally { + for (t1 = prepared, t2 = t1.length, t3 = type$.StatementImplementation, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + stmt1 = t1[_i]; + t4 = stmt1; + t5 = t4.finalizable; + if (!t5._closed) { + t6 = $.$get$disposeFinalizer()._registry; + if (t6 != null) + t6.unregister(t4); + if (!t5._closed) { + t5._closed = true; + if (!t5._inResetState) { + t6 = t5.statement; + t7 = t6.bindings._sqlite3_reset; + t6 = [null, t6.stmt]; + A.assertInteropArgs(t6); + A._asInt(A._asDouble(t7.call.apply(t7, t6))); + t5._inResetState = true; + } + t6 = t5.statement; + t6.deallocateArguments$0(); + t7 = t6.bindings._sqlite3_finalize; + t6 = [null, t6.stmt]; + A.assertInteropArgs(t6); + A._asInt(A._asDouble(t7.call.apply(t7, t6))); + } + t6 = t4.database; + t3._as(t4); + if (!t6._isClosed) + B.JSArray_methods.remove$1(t6.finalizable._statements, t5); + } + } + } + }, + runWithArgsSync$2(statement, args) { + var stmt, cached, _0_0, t1, t2; + if (args.length === 0) + this._database.execute$1(statement); + else { + stmt = null; + cached = null; + _0_0 = this._getPreparedStatement$1(statement); + stmt = _0_0._0; + cached = _0_0._1; + try { + stmt.executeWith$1(new A.IndexedParameters(args)); + } finally { + t1 = stmt; + t2 = cached; + type$.CommonPreparedStatement._as(t1); + if (!A._asBool(t2)) + t1.dispose$0(); + } + } + }, + runSelect$2(statement, args) { + return this.runSelect$body$Sqlite3Delegate(statement, args); + }, + runSelect$body$Sqlite3Delegate(statement, args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.QueryResult), + $async$returnValue, $async$next = [], $async$self = this, result, t1, t2, stmt, cached, _0_0; + var $async$runSelect$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + stmt = null; + cached = null; + _0_0 = $async$self._getPreparedStatement$1(statement); + stmt = _0_0._0; + cached = _0_0._1; + try { + result = stmt.selectWith$1(new A.IndexedParameters(args)); + t1 = A.QueryResult_QueryResult$fromRows(J.toList$0$ax(result)); + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + } finally { + t1 = stmt; + t2 = cached; + type$.CommonPreparedStatement._as(t1); + if (!A._asBool(t2)) + t1.dispose$0(); + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$runSelect$2, $async$completer); + }, + _getPreparedStatement$1(sql) { + var stmt, t3, t4, t5, + t1 = this._preparedStmtsCache._cachedStatements, + foundStatement = t1.remove$1(0, sql), + t2 = foundStatement != null; + if (t2) + t1.$indexSet(0, sql, foundStatement); + if (t2) + return new A._Record_2(foundStatement, true); + stmt = this._database.prepare$2$checkNoTail(sql, true); + t2 = stmt.statement; + t3 = t2.stmt; + t2 = t2.bindings._sqlite3_stmt_isexplain; + t4 = type$.nullable_Object; + if (A._asInt(A._asDouble(A.callMethod(t2, "call", [null, t3], t4))) === 0) { + A.assertHelper(!t1.containsKey$1(sql)); + if (t1.__js_helper$_length === 64) { + t5 = t1.remove$1(0, new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")).get$first(0)); + t5.toString; + t5.dispose$0(); + } + t1.$indexSet(0, sql, stmt); + } + return new A._Record_2(stmt, A._asInt(A._asDouble(A.callMethod(t2, "call", [null, t3], t4))) === 0); + }, + set$_database(_database) { + this._database = A._instanceType(this)._eval$1("Sqlite3Delegate.0?")._as(_database); + } + }; + A._SqliteVersionDelegate.prototype = {}; + A.PreparedStatementsCache.prototype = { + disposeAll$0() { + var t1, t2, t3, t4, t5, t6, t7; + for (t1 = this._cachedStatements, t2 = t1.get$values(), t3 = A._instanceType(t2), t3 = t3._eval$1("@<1>")._bind$1(t3._rest[1]), t2 = new A.MappedIterator(J.get$iterator$ax(t2.__internal$_iterable), t2._f, t3._eval$1("MappedIterator<1,2>")), t3 = t3._rest[1]; t2.moveNext$0();) { + t4 = t2.__internal$_current; + if (t4 == null) + t4 = t3._as(t4); + t5 = t4.finalizable; + if (!t5._closed) { + t6 = $.$get$disposeFinalizer()._registry; + if (t6 != null) + t6.unregister(t4); + if (!t5._closed) { + t5._closed = true; + if (!t5._inResetState) { + t6 = t5.statement; + t7 = t6.bindings._sqlite3_reset; + t6 = [null, t6.stmt]; + A.assertInteropArgs(t6); + A._asInt(A._asDouble(t7.call.apply(t7, t6))); + t5._inResetState = true; + } + t6 = t5.statement; + t6.deallocateArguments$0(); + t7 = t6.bindings._sqlite3_finalize; + t6 = [null, t6.stmt]; + A.assertInteropArgs(t6); + A._asInt(A._asDouble(t7.call.apply(t7, t6))); + } + t4 = t4.database; + if (!t4._isClosed) + B.JSArray_methods.remove$1(t4.finalizable._statements, t5); + } + } + t1.clear$0(0); + } + }; + A.EnableNativeFunctions_useNativeFunctions_closure.prototype = { + call$1(args) { + return Date.now(); + }, + $signature: 48 + }; + A._unaryNumFunction_closure.prototype = { + call$1(args) { + var value = args.$index(0, 0); + if (typeof value == "number") + return this.calculation.call$1(value); + else + return null; + }, + $signature: 29 + }; + A.LazyDatabase.prototype = { + get$_delegate() { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1; + }, + get$dialect() { + if (this._delegateAvailable) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + t1 = B.SqlDialect_0_sqlite !== t1.get$dialect(); + } else + t1 = false; + if (t1) + throw A.wrapException(A.Exception_Exception("LazyDatabase created with " + B.SqlDialect_0_sqlite.toString$0(0) + ", but underlying database is " + this.get$_delegate().get$dialect().toString$0(0) + ".")); + return B.SqlDialect_0_sqlite; + }, + _awaitOpened$0() { + var t1, delegate, _this = this; + if (_this._delegateAvailable) + return A.Future_Future$value(null, type$.void); + else { + t1 = _this._openDelegate; + if (t1 != null) + return t1.future; + else { + t1 = new A._Future($.Zone__current, type$._Future_void); + delegate = _this._openDelegate = new A._AsyncCompleter(t1, type$._AsyncCompleter_void); + A.Future_Future$sync(_this.opener, type$.QueryExecutor).then$1$2$onError(new A.LazyDatabase__awaitOpened_closure(_this, delegate), delegate.get$completeError(), type$.Null); + return t1; + } + } + }, + beginExclusive$0() { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.beginExclusive$0(); + }, + beginTransaction$0() { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.beginTransaction$0(); + }, + ensureOpen$1(user) { + return this._awaitOpened$0().then$1$1(new A.LazyDatabase_ensureOpen_closure(this, user), type$.bool); + }, + runBatched$1(statements) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.runBatched$1(statements); + }, + runCustom$2(statement, args) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.runCustom$2(statement, args); + }, + runDelete$2(statement, args) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.runDelete$2(statement, args); + }, + runInsert$2(statement, args) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.runInsert$2(statement, args); + }, + runSelect$2(statement, args) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.runSelect$2(statement, args); + }, + close$0() { + if (this._delegateAvailable) { + var t1 = this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.close$0(); + } else + return A.Future_Future$value(null, type$.void); + } + }; + A.LazyDatabase__awaitOpened_closure.prototype = { + call$1(database) { + var t1; + type$.QueryExecutor._as(database); + t1 = this.$this; + t1.__LazyDatabase__delegate_F !== $ && A.throwLateFieldAI("_delegate"); + t1.__LazyDatabase__delegate_F = database; + t1._delegateAvailable = true; + this.delegate.complete$0(); + }, + $signature: 50 + }; + A.LazyDatabase_ensureOpen_closure.prototype = { + call$1(_) { + var t1 = this.$this.__LazyDatabase__delegate_F; + t1 === $ && A.throwLateFieldNI("_delegate"); + return t1.ensureOpen$1(this.user); + }, + $signature: 51 + }; + A.Lock.prototype = { + synchronized$1$1(block, $T) { + var previous, t1; + $T._eval$1("0/()")._as(block); + previous = this._last; + t1 = new A._Future($.Zone__current, type$._Future_void); + this._last = t1; + t1 = new A.Lock_synchronized_callBlockAndComplete(block, new A._AsyncCompleter(t1, type$._AsyncCompleter_void), $T); + if (previous != null) + return previous.then$1$1(new A.Lock_synchronized_closure(t1, $T), $T); + else + return t1.call$0(); + } + }; + A.Lock_synchronized_callBlockAndComplete.prototype = { + call$0() { + return A.Future_Future$sync(this.block, this.T).whenComplete$1(type$.void_Function_$opt_void._as(this.blockCompleted.get$complete())); + }, + $signature() { + return this.T._eval$1("Future<0>()"); + } + }; + A.Lock_synchronized_closure.prototype = { + call$1(_) { + return this.callBlockAndComplete.call$0(); + }, + $signature() { + return this.T._eval$1("Future<0>(~)"); + } + }; + A.WebPortToChannel_channel_closure.prototype = { + call$1($event) { + var message = type$.JSObject._as($event).data, + t1 = this.explicitClose && J.$eq$(message, "_disconnect"), + t2 = this.controller.__StreamChannelController__local_F; + if (t1) { + t2 === $ && A.throwLateFieldNI("_local"); + t1 = t2.__GuaranteeChannel__sink_F; + t1 === $ && A.throwLateFieldNI("_sink"); + t1.close$0(); + } else { + t2 === $ && A.throwLateFieldNI("_local"); + t1 = t2.__GuaranteeChannel__sink_F; + t1 === $ && A.throwLateFieldNI("_sink"); + t1.add$1(0, A.dartify(message)); + } + }, + $signature: 9 + }; + A.WebPortToChannel_channel_closure0.prototype = { + call$1(e) { + return A.callMethod(this._this, "postMessage", [A.jsify(e)], type$.void); + }, + $signature: 7 + }; + A.WebPortToChannel_channel_closure1.prototype = { + call$0() { + if (this.explicitClose) + this._this.postMessage("_disconnect"); + this._this.close(); + }, + $signature: 0 + }; + A.DedicatedDriftWorker.prototype = { + start$0() { + A._EventStreamSubscription$(this.self, "message", type$.nullable_void_Function_JSObject._as(new A.DedicatedDriftWorker_start_closure(this)), false, type$.JSObject); + }, + _dedicated_worker$_handleMessage$1(message) { + return this._handleMessage$body$DedicatedDriftWorker(message); + }, + _handleMessage$body$DedicatedDriftWorker(message) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$handler = 1, $async$currentError, $async$self = this, storage, $name, e, t1, dbName, existingServer, existingDatabases, opfsExists, t2, indexedDbExists, t3, t4, options, worker, _0_7_isSet, _0_7, exception, _box_0, $async$exception, $async$temp1; + var $async$_dedicated_worker$_handleMessage$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + t1 = message instanceof A.RequestCompatibilityCheck; + dbName = t1 ? message.databaseName : null; + $async$goto = t1 ? 3 : 4; + break; + case 3: + // then + _box_0.supportsIndexedDb = _box_0.supportsOpfs = false; + $async$goto = 5; + return A._asyncAwait($async$self._checkCompatibility.synchronized$1$1(new A.DedicatedDriftWorker__handleMessage_closure(_box_0, $async$self), type$.Null), $async$_dedicated_worker$_handleMessage$1); + case 5: + // returning from await. + existingServer = $async$self._dedicated_worker$_servers.servers.$index(0, dbName); + existingDatabases = A._setArrayType([], type$.JSArray_Record_2_WebStorageApi_and_String); + $async$goto = _box_0.supportsOpfs ? 6 : 8; + break; + case 6: + // then + $async$temp1 = J; + $async$goto = 9; + return A._asyncAwait(A.opfsDatabases(), $async$_dedicated_worker$_handleMessage$1); + case 9: + // returning from await. + t1 = $async$temp1.get$iterator$ax($async$result), opfsExists = false; + case 10: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 11; + break; + } + t2 = t1.get$current(); + B.JSArray_methods.add$1(existingDatabases, new A._Record_2(B.WebStorageApi_0, t2)); + if (t2 === dbName) + opfsExists = true; + // goto for condition + $async$goto = 10; + break; + case 11: + // after for + // goto join + $async$goto = 7; + break; + case 8: + // else + opfsExists = false; + case 7: + // join + $async$goto = existingServer != null ? 12 : 14; + break; + case 12: + // then + t1 = existingServer.storage; + indexedDbExists = t1 === B.WasmStorageImplementation_2 || t1 === B.WasmStorageImplementation_3; + opfsExists = t1 === B.WasmStorageImplementation_0 || t1 === B.WasmStorageImplementation_1; + // goto join + $async$goto = 13; + break; + case 14: + // else + $async$temp1 = _box_0.supportsIndexedDb; + if ($async$temp1) { + // goto then + $async$goto = 15; + break; + } else + $async$result = $async$temp1; + // goto join + $async$goto = 16; + break; + case 15: + // then + $async$goto = 17; + return A._asyncAwait(A.checkIndexedDbExists(dbName), $async$_dedicated_worker$_handleMessage$1); + case 17: + // returning from await. + case 16: + // join + indexedDbExists = $async$result; + case 13: + // join + t1 = type$.JSObject._as(self); + t2 = "Worker" in t1; + t3 = _box_0.supportsOpfs; + t4 = _box_0.supportsIndexedDb; + new A.DedicatedWorkerCompatibilityResult(t2, t3, "SharedArrayBuffer" in t1, t4, existingDatabases, B.ProtocolVersion_2_2_v2, indexedDbExists, opfsExists).sendToClient$1($async$self.self); + // goto break $label0$0 + $async$goto = 2; + break; + case 4: + // join + if (message instanceof A.ServeDriftDatabase) { + $async$self._dedicated_worker$_servers.serve$1(message); + // goto break $label0$0 + $async$goto = 2; + break; + } + t1 = message instanceof A.StartFileSystemServer; + options = t1 ? message.sqlite3Options : null; + $async$goto = t1 ? 18 : 19; + break; + case 18: + // then + $async$goto = 20; + return A._asyncAwait(A.VfsWorker_create(options), $async$_dedicated_worker$_handleMessage$1); + case 20: + // returning from await. + worker = $async$result; + $async$self.self.postMessage(true); + $async$goto = 21; + return A._asyncAwait(worker.start$0(), $async$_dedicated_worker$_handleMessage$1); + case 21: + // returning from await. + // goto break $label0$0 + $async$goto = 2; + break; + case 19: + // join + storage = null; + $name = null; + _0_7_isSet = message instanceof A.DeleteDatabase; + if (_0_7_isSet) { + _0_7 = message.database; + storage = _0_7._0; + $name = _0_7._1; + } + $async$goto = _0_7_isSet ? 22 : 23; + break; + case 22: + // then + $async$handler = 25; + case 28: + // switch + switch (storage) { + case B.WebStorageApi_1: + // goto case + $async$goto = 30; + break; + case B.WebStorageApi_0: + // goto case + $async$goto = 31; + break; + default: + // goto after switch + $async$goto = 29; + break; + } + break; + case 30: + // case + $async$goto = 32; + return A._asyncAwait(A.deleteDatabaseInIndexedDb($name), $async$_dedicated_worker$_handleMessage$1); + case 32: + // returning from await. + // goto after switch + $async$goto = 29; + break; + case 31: + // case + $async$goto = 33; + return A._asyncAwait(A.deleteDatabaseInOpfs($name), $async$_dedicated_worker$_handleMessage$1); + case 33: + // returning from await. + // goto after switch + $async$goto = 29; + break; + case 29: + // after switch + message.sendToClient$1($async$self.self); + $async$handler = 1; + // goto after finally + $async$goto = 27; + break; + case 25: + // catch + $async$handler = 24; + $async$exception = $async$currentError; + e = A.unwrapException($async$exception); + new A.WorkerError(J.toString$0$(e)).sendToClient$1($async$self.self); + // goto after finally + $async$goto = 27; + break; + case 24: + // uncaught + // goto rethrow + $async$goto = 1; + break; + case 27: + // after finally + // goto break $label0$0 + $async$goto = 2; + break; + case 23: + // join + // goto break $label0$0 + $async$goto = 2; + break; + case 2: + // break $label0$0 + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_dedicated_worker$_handleMessage$1, $async$completer); + } + }; + A.DedicatedDriftWorker_start_closure.prototype = { + call$1($event) { + this.$this._dedicated_worker$_handleMessage$1(A.WasmInitializationMessage_WasmInitializationMessage$fromJs(type$.JSObject._as($event.data))); + }, + $signature: 1 + }; + A.DedicatedDriftWorker__handleMessage_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, supportsIndexedDb, t1, knownResults, t2, $async$temp1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + knownResults = t1._compatibility; + t2 = $async$self._box_0; + $async$goto = knownResults != null ? 2 : 4; + break; + case 2: + // then + t2.supportsOpfs = knownResults.supportsOpfs; + t2.supportsIndexedDb = knownResults.supportsIndexedDb; + // goto join + $async$goto = 3; + break; + case 4: + // else + $async$temp1 = t2; + $async$goto = 5; + return A._asyncAwait(A.checkOpfsSupport(), $async$call$0); + case 5: + // returning from await. + $async$temp1.supportsOpfs = $async$result; + $async$goto = 6; + return A._asyncAwait(A.checkIndexedDbSupport(), $async$call$0); + case 6: + // returning from await. + supportsIndexedDb = $async$result; + t2.supportsIndexedDb = supportsIndexedDb; + t1._compatibility = new A.WasmCompatibility(supportsIndexedDb, t2.supportsOpfs); + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 14 + }; + A.ProtocolVersion.prototype = { + _enumToString$0() { + return "ProtocolVersion." + this._core$_name; + } + }; + A.WasmInitializationMessage.prototype = { + sendToWorker$1(worker) { + this.sendTo$1(new A.WasmInitializationMessage_sendToWorker_closure(worker)); + }, + sendToPort$1(port) { + this.sendTo$1(new A.WasmInitializationMessage_sendToPort_closure(port)); + }, + sendToClient$1(worker) { + this.sendTo$1(new A.WasmInitializationMessage_sendToClient_closure(worker)); + } + }; + A.WasmInitializationMessage_sendToWorker_closure.prototype = { + call$2(msg, transfer) { + var t1; + type$.nullable_List_JSObject._as(transfer); + t1 = transfer == null ? B.List_empty1 : transfer; + this.worker.postMessage(msg, t1); + }, + $signature: 17 + }; + A.WasmInitializationMessage_sendToPort_closure.prototype = { + call$2(msg, transfer) { + var t1; + type$.nullable_List_JSObject._as(transfer); + t1 = transfer == null ? B.List_empty1 : transfer; + this.port.postMessage(msg, t1); + }, + $signature: 17 + }; + A.WasmInitializationMessage_sendToClient_closure.prototype = { + call$2(msg, transfer) { + var t1; + type$.nullable_List_JSObject._as(transfer); + t1 = transfer == null ? B.List_empty1 : transfer; + this.worker.postMessage(msg, t1); + }, + $signature: 17 + }; + A.CompatibilityResult.prototype = {}; + A.SharedWorkerCompatibilityResult.prototype = { + sendTo$1(sender) { + var _this = this; + A._extension_1_sendTyped(type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender), "SharedWorkerCompatibilityResult", A._setArrayType([_this.canSpawnDedicatedWorkers, _this.dedicatedWorkersCanUseOpfs, _this.canUseIndexedDb, _this.indexedDbExists, _this.opfsExists, A.EncodeLocations_encodeToJs(_this.existingDatabases), _this.version.versionCode], type$.JSArray_Object), null); + } + }; + A.WorkerError.prototype = { + sendTo$1(sender) { + A._extension_1_sendTyped(type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender), "Error", this.error, null); + }, + toString$0(_) { + return "Error in worker: " + this.error; + }, + $isException: 1 + }; + A.ServeDriftDatabase.prototype = { + sendTo$1(sender) { + var _this0, t1, t2, _this = this; + type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender); + _this0 = {}; + _this0.sqlite = _this.sqlite3WasmUri.toString$0(0); + t1 = _this.port; + _this0.port = t1; + _this0.storage = _this.storage._core$_name; + _this0.database = _this.databaseName; + t2 = _this.initializationPort; + _this0.initPort = t2; + _this0.migrations = _this.enableMigrations; + _this0.v = _this.protocolVersion.versionCode; + t1 = A._setArrayType([t1], type$.JSArray_JSObject); + if (t2 != null) + t1.push(t2); + A._extension_1_sendTyped(sender, "ServeDriftDatabase", _this0, t1); + } + }; + A.RequestCompatibilityCheck.prototype = { + sendTo$1(sender) { + A._extension_1_sendTyped(type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender), "RequestCompatibilityCheck", this.databaseName, null); + } + }; + A.DedicatedWorkerCompatibilityResult.prototype = { + sendTo$1(sender) { + var _this0, _this = this; + type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender); + _this0 = {}; + _this0.supportsNestedWorkers = _this.supportsNestedWorkers; + _this0.canAccessOpfs = _this.canAccessOpfs; + _this0.supportsIndexedDb = _this.supportsIndexedDb; + _this0.supportsSharedArrayBuffers = _this.supportsSharedArrayBuffers; + _this0.indexedDbExists = _this.indexedDbExists; + _this0.opfsExists = _this.opfsExists; + _this0.existing = A.EncodeLocations_encodeToJs(_this.existingDatabases); + _this0.v = _this.version.versionCode; + A._extension_1_sendTyped(sender, "DedicatedWorkerCompatibilityResult", _this0, null); + } + }; + A.StartFileSystemServer.prototype = { + sendTo$1(sender) { + A._extension_1_sendTyped(type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender), "StartFileSystemServer", this.sqlite3Options, null); + } + }; + A.DeleteDatabase.prototype = { + sendTo$1(sender) { + var t1 = this.database; + A._extension_1_sendTyped(type$.void_Function_2_nullable_JSObject_and_nullable_List_JSObject._as(sender), "DeleteDatabase", A._setArrayType([t1._0._core$_name, t1._1], type$.JSArray_String), null); + } + }; + A.checkIndexedDbExists_closure.prototype = { + call$1($event) { + type$.JSObject._as($event); + type$.nullable_JSObject._as(this.openRequest.transaction).abort(); + this._box_0.indexedDbExists = false; + }, + $signature: 9 + }; + A.opfsDatabases_closure.prototype = { + call$1(data) { + type$.JSArray_nullable_Object._as(data); + if (1 < 0 || 1 >= data.length) + return A.ioore(data, 1); + return type$.JSObject._as(data[1]); + }, + $signature: 55 + }; + A.DriftServerController.prototype = { + serve$1(message) { + type$.ServeDriftDatabase._as(message); + this.servers.putIfAbsent$2(message.databaseName, new A.DriftServerController_serve_closure(this, message)).serve$1(A.WebPortToChannel_channel(message.port, message.protocolVersion.versionCode >= 1)); + }, + openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage(databaseName, enableMigrations, initializer, sqlite3WasmUri, storage) { + return this.openConnection$body$DriftServerController(databaseName, enableMigrations, type$.nullable_FutureOr_nullable_Uint8List_Function._as(initializer), sqlite3WasmUri, storage); + }, + openConnection$body$DriftServerController(databaseName, enableMigrations, initializer, sqlite3WasmUri, storage) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.QueryExecutor), + $async$returnValue, $async$self = this, vfs, $close, t1, t2, response, file, $name, id, ptr, db, sqlite3; + var $async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(A.WasmSqlite3_loadFromUrl(sqlite3WasmUri), $async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage); + case 3: + // returning from await. + sqlite3 = $async$result; + case 4: + // switch + switch (storage.index) { + case 0: + // goto case + $async$goto = 6; + break; + case 1: + // goto case + $async$goto = 7; + break; + case 3: + // goto case + $async$goto = 8; + break; + case 2: + // goto case + $async$goto = 9; + break; + case 4: + // goto case + $async$goto = 10; + break; + default: + // goto default + $async$goto = 11; + break; + } + break; + case 6: + // case + $async$goto = 12; + return A._asyncAwait(A.SimpleOpfsFileSystem_loadFromStorage("drift_db/" + databaseName), $async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage); + case 12: + // returning from await. + vfs = $async$result; + $close = vfs.get$close(); + // goto after switch + $async$goto = 5; + break; + case 7: + // case + $async$goto = 13; + return A._asyncAwait($async$self._loadLockedWasmVfs$1(databaseName), $async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage); + case 13: + // returning from await. + vfs = $async$result; + $close = vfs.get$close(); + // goto after switch + $async$goto = 5; + break; + case 8: + // case + case 9: + // case + $async$goto = 14; + return A._asyncAwait(A.IndexedDbFileSystem_open(databaseName), $async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage); + case 14: + // returning from await. + vfs = $async$result; + $close = vfs.get$close(); + // goto after switch + $async$goto = 5; + break; + case 10: + // case + vfs = A.InMemoryFileSystem$(null); + $close = null; + // goto after switch + $async$goto = 5; + break; + case 11: + // default + vfs = null; + $close = null; + case 5: + // after switch + $async$goto = initializer != null && vfs.xAccess$2("/database", 0) === 0 ? 15 : 16; + break; + case 15: + // then + t1 = initializer.call$0(); + t2 = type$.nullable_Uint8List; + $async$goto = 17; + return A._asyncAwait(type$.Future_nullable_Uint8List._is(t1) ? t1 : A._Future$value(t2._as(t1), t2), $async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage); + case 17: + // returning from await. + response = $async$result; + if (response != null) { + file = vfs.xOpen$2(new A.Sqlite3Filename("/database"), 4)._0; + file.xWrite$2(response, 0); + file.xClose$0(); + } + case 16: + // join + type$.VirtualFileSystem._as(vfs); + t1 = sqlite3.bindings; + t1 = t1.bindings; + $name = t1.allocateBytes$2$additionalLength(B.C_Utf8Encoder.convert$1(vfs.name), 1); + t2 = t1.callbacks.registeredVfs; + id = t2.__js_helper$_length; + t2.$indexSet(0, id, vfs); + ptr = A._asInt(A._asDouble(A.callMethod(t1._register_vfs, "call", [null, $name, id, 1], type$.nullable_Object))); + t1 = $.$get$DartCallbacks_sqliteVfsPointer(); + t1.$ti._eval$1("1?")._as(ptr); + t1._jsWeakMap.set(vfs, ptr); + t1 = A.LinkedHashMap_LinkedHashMap(type$.String, type$.CommonPreparedStatement); + db = new A.WasmDatabase(new A._WasmDelegate(sqlite3, "/database", null, $async$self._setup, true, enableMigrations, new A.PreparedStatementsCache(t1)), false, true, new A.Lock(), new A.Lock()); + if ($close != null) { + $async$returnValue = A.ApplyInterceptor_interceptWith(db, new A._CloseVfsOnClose($close, db)); + // goto return + $async$goto = 1; + break; + } else { + $async$returnValue = db; + // goto return + $async$goto = 1; + break; + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage, $async$completer); + }, + _loadLockedWasmVfs$1(databaseName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.WasmVfs), + $async$returnValue, t4, t5, t6, t1, t2, t3, worker; + var $async$_loadLockedWasmVfs$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = self; + t2 = type$.JSObject; + t3 = {clientVersion: 1, root: "drift_db/" + databaseName, synchronizationBuffer: t2._as(new t1.SharedArrayBuffer(8)), communicationBuffer: t2._as(new t1.SharedArrayBuffer(67584))}; + worker = t2._as(new t1.Worker(A.Uri_base().toString$0(0))); + new A.StartFileSystemServer(t3).sendToWorker$1(worker); + $async$goto = 3; + return A._asyncAwait(new A._EventStream(worker, "message", false, type$._EventStream_JSObject).get$first(0), $async$_loadLockedWasmVfs$1); + case 3: + // returning from await. + t4 = A.RequestResponseSynchronizer_RequestResponseSynchronizer(t2._as(t3.synchronizationBuffer)); + t3 = t2._as(t3.communicationBuffer); + t5 = A.SharedArrayBuffer_asByteData(t3, 65536, 2048); + t1 = type$.JavaScriptFunction._as(t1.Uint8Array); + t1 = type$.NativeUint8List._as(A.callConstructor(t1, [t3], t2)); + t2 = A.Context_Context("/", $.$get$Style_url()); + t6 = $.$get$Random__secureRandom(); + $async$returnValue = new A.WasmVfs(t4, new A.MessageSerializer(t3, t5, t1), t2, t6, "dart-sqlite3-vfs"); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_loadLockedWasmVfs$1, $async$completer); + } + }; + A.DriftServerController_serve_closure.prototype = { + call$0() { + var t1 = this.message, + initPort = t1.initializationPort, + initializer = initPort != null ? new A.DriftServerController_serve__closure(initPort) : null, + t2 = this.$this, + server = A.ServerImplementation$(new A.LazyDatabase(new A.DriftServerController_serve__closure0(t2, t1, initializer)), false, true), + t3 = new A._Future($.Zone__current, type$._Future_void), + wasmServer = new A.RunningWasmServer(t1.storage, server, new A._SyncCompleter(t3, type$._SyncCompleter_void)); + t3.whenComplete$1(new A.DriftServerController_serve__closure1(t2, t1, wasmServer)); + return wasmServer; + }, + $signature: 56 + }; + A.DriftServerController_serve__closure.prototype = { + call$0() { + var t3, + t1 = new A._Future($.Zone__current, type$._Future_nullable_Uint8List), + t2 = this.initPort; + t2.postMessage(true); + t3 = type$.JavaScriptFunction._as(A.allowInterop(new A.DriftServerController_serve___closure(new A._AsyncCompleter(t1, type$._AsyncCompleter_nullable_Uint8List)), type$.Function)); + if (A.assertTest(typeof t3 == "function")) + A.assertThrow(string$.Dart_f); + t2.onmessage = t3; + return t1; + }, + $signature: 57 + }; + A.DriftServerController_serve___closure.prototype = { + call$1(e) { + var data = type$.nullable_NativeUint8List._as(type$.JSObject._as(e).data), + t1 = data == null ? null : data; + this.completer.complete$1(t1); + }, + $signature: 9 + }; + A.DriftServerController_serve__closure0.prototype = { + call$0() { + var t1 = this.message; + return this.$this.openConnection$5$databaseName$enableMigrations$initializer$sqlite3WasmUri$storage(t1.databaseName, t1.enableMigrations, this.initializer, t1.sqlite3WasmUri, t1.storage); + }, + $signature: 117 + }; + A.DriftServerController_serve__closure1.prototype = { + call$0() { + this.$this.servers.remove$1(0, this.message.databaseName); + this.wasmServer.server.shutdown$0(); + }, + $signature: 8 + }; + A._CloseVfsOnClose.prototype = { + close$1(inner) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$close$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait(inner.close$0(), $async$close$1); + case 2: + // returning from await. + $async$goto = $async$self._root === inner ? 3 : 4; + break; + case 3: + // then + t1 = $async$self._shared$_close.call$0(); + $async$goto = 5; + return A._asyncAwait(t1 instanceof A._Future ? t1 : A._Future$value(t1, type$.void), $async$close$1); + case 5: + // returning from await. + case 4: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$close$1, $async$completer); + } + }; + A.RunningWasmServer.prototype = { + serve$1(channel) { + var t1, t2, t3, t4; + ++this._connectedClients; + t1 = type$.nullable_Object; + t2 = channel.$ti; + t1 = t2._eval$1("Stream<1>(Stream<1>)")._as(t2._eval$1("StreamTransformer<1,1>")._as(A._StreamHandlerTransformer$(new A.RunningWasmServer_serve_closure(this), t1, t1)).get$bind()).call$1(channel.get$stream()); + t3 = new A.CloseGuaranteeChannel(t2._eval$1("CloseGuaranteeChannel<1>")); + t4 = t2._eval$1("_CloseGuaranteeSink<1>"); + t3.set$__CloseGuaranteeChannel__sink_F(t4._as(new A._CloseGuaranteeSink(t3, channel.get$sink(), t4))); + t2 = t2._eval$1("_CloseGuaranteeStream<1>"); + t2 = t2._as(new A._CloseGuaranteeStream(t1, t3, t2)); + t3.__CloseGuaranteeChannel__stream_F !== $ && A.throwLateFieldAI("_stream"); + t3.set$__CloseGuaranteeChannel__stream_F(t2); + this.server.serve$1(t3); + } + }; + A.RunningWasmServer_serve_closure.prototype = { + call$1(sink) { + var t1 = this.$this; + if (--t1._connectedClients === 0) + t1._lastClientDisconnected.complete$0(); + t1 = sink._async$_sink; + if ((t1._async$_state & 2) !== 0) + A.throwExpression(A.StateError$("Stream is already closed")); + t1.super$_BufferingStreamSubscription$_close(); + }, + $signature: 59 + }; + A.WasmCompatibility.prototype = {}; + A.CompleteIdbRequest_complete_closure1.prototype = { + call$1($event) { + this.completer.complete$1(this.T._as(this._this.result)); + }, + $signature: 1 + }; + A.CompleteIdbRequest_complete_closure2.prototype = { + call$1($event) { + var t1 = type$.nullable_JSObject._as(this._this.error); + if (t1 == null) + t1 = $event; + this.completer.completeError$1(t1); + }, + $signature: 1 + }; + A.SharedDriftWorker.prototype = { + start$0() { + A._EventStreamSubscription$(this.self, "connect", type$.nullable_void_Function_JSObject._as(new A.SharedDriftWorker_start_closure(this)), false, type$.JSObject); + }, + _newConnection$1($event) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, clientPort; + var $async$_newConnection$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSArray_nullable_Object._as($event.ports); + clientPort = J.$index$asx(type$.List_JSObject._is(t1) ? t1 : new A.CastList(t1, A._arrayInstanceType(t1)._eval$1("CastList<1,JSObject>")), 0); + clientPort.start(); + A._EventStreamSubscription$(clientPort, "message", type$.nullable_void_Function_JSObject._as(new A.SharedDriftWorker__newConnection_closure($async$self, clientPort)), false, type$.JSObject); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_newConnection$1, $async$completer); + }, + _messageFromClient$2(client, $event) { + return this._messageFromClient$body$SharedDriftWorker(client, $event); + }, + _messageFromClient$body$SharedDriftWorker(client, $event) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$handler = 1, $async$currentError, $async$self = this, message, _0_0, dbName, result, e, t1, exception, $async$exception; + var $async$_messageFromClient$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 3; + message = A.WasmInitializationMessage_WasmInitializationMessage$fromJs(type$.JSObject._as($event.data)); + _0_0 = message; + dbName = null; + t1 = _0_0 instanceof A.RequestCompatibilityCheck; + if (t1) + dbName = _0_0.databaseName; + $async$goto = t1 ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait($async$self._startFeatureDetection$1(dbName), $async$_messageFromClient$2); + case 9: + // returning from await. + result = $async$result; + result.sendToPort$1(client); + // goto break $label0$0 + $async$goto = 6; + break; + case 8: + // join + if (_0_0 instanceof A.ServeDriftDatabase && B.WasmStorageImplementation_2 === _0_0.storage) { + $async$self._servers.serve$1(message); + // goto break $label0$0 + $async$goto = 6; + break; + } + if (_0_0 instanceof A.ServeDriftDatabase) { + t1 = $async$self._dedicatedWorker; + t1.toString; + message.sendToWorker$1(t1); + // goto break $label0$0 + $async$goto = 6; + break; + } + t1 = A.ArgumentError$("Unknown message", null); + throw A.wrapException(t1); + case 6: + // break $label0$0 + $async$handler = 1; + // goto after finally + $async$goto = 5; + break; + case 3: + // catch + $async$handler = 2; + $async$exception = $async$currentError; + e = A.unwrapException($async$exception); + new A.WorkerError(J.toString$0$(e)).sendToPort$1(client); + client.close(); + // goto after finally + $async$goto = 5; + break; + case 2: + // uncaught + // goto rethrow + $async$goto = 1; + break; + case 5: + // after finally + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_messageFromClient$2, $async$completer); + }, + _startFeatureDetection$1(databaseName) { + return this._startFeatureDetection$body$SharedDriftWorker(databaseName); + }, + _startFeatureDetection$body$SharedDriftWorker(databaseName) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SharedWorkerCompatibilityResult), + $async$returnValue, $async$self = this, indexedDbExists, worker, t4, t5, t1, t2, t3, hasWorker, canUseIndexedDb, $async$temp1, $async$temp2, $async$temp3, $async$temp4; + var $async$_startFeatureDetection$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + t2 = type$.JSObject; + t3 = t2._as(self); + hasWorker = "Worker" in t3; + $async$goto = 3; + return A._asyncAwait(A.checkIndexedDbSupport(), $async$_startFeatureDetection$1); + case 3: + // returning from await. + canUseIndexedDb = $async$result; + $async$goto = !hasWorker ? 4 : 6; + break; + case 4: + // then + t1 = $async$self._servers.servers.$index(0, databaseName); + if (t1 == null) + indexedDbExists = null; + else { + t1 = t1.storage; + t1 = t1 === B.WasmStorageImplementation_2 || t1 === B.WasmStorageImplementation_3; + indexedDbExists = t1; + } + $async$temp1 = A; + $async$temp2 = canUseIndexedDb; + $async$temp3 = B.List_empty5; + $async$temp4 = B.ProtocolVersion_2_2_v2; + $async$goto = indexedDbExists == null ? 7 : 9; + break; + case 7: + // then + $async$goto = 10; + return A._asyncAwait(A.checkIndexedDbExists(databaseName), $async$_startFeatureDetection$1); + case 10: + // returning from await. + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$result = indexedDbExists; + case 8: + // join + $async$returnValue = new $async$temp1.SharedWorkerCompatibilityResult(false, false, $async$temp2, $async$temp3, $async$temp4, $async$result, false); + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 5; + break; + case 6: + // else + worker = $async$self._dedicatedWorker; + if (worker == null) { + worker = t2._as(new t3.Worker(A.Uri_base().toString$0(0))); + $async$self.set$_dedicatedWorker(worker); + } + new A.RequestCompatibilityCheck(databaseName).sendToWorker$1(worker); + t3 = new A._Future($.Zone__current, type$._Future_SharedWorkerCompatibilityResult); + t1.errorSubscription = t1.messageSubscription = null; + t4 = new A.SharedDriftWorker__startFeatureDetection_result(t1, new A._AsyncCompleter(t3, type$._AsyncCompleter_SharedWorkerCompatibilityResult), canUseIndexedDb); + t5 = type$.nullable_void_Function_JSObject; + t1.messageSubscription = A._EventStreamSubscription$(worker, "message", t5._as(new A.SharedDriftWorker__startFeatureDetection_closure(t4)), false, t2); + t1.errorSubscription = A._EventStreamSubscription$(worker, "error", t5._as(new A.SharedDriftWorker__startFeatureDetection_closure0($async$self, t4, worker)), false, t2); + $async$returnValue = t3; + // goto return + $async$goto = 1; + break; + case 5: + // join + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_startFeatureDetection$1, $async$completer); + }, + set$_dedicatedWorker(_dedicatedWorker) { + this._dedicatedWorker = type$.nullable_JSObject._as(_dedicatedWorker); + } + }; + A.SharedDriftWorker_start_closure.prototype = { + call$1(e) { + return this.$this._newConnection$1(e); + }, + $signature: 1 + }; + A.SharedDriftWorker__newConnection_closure.prototype = { + call$1($event) { + return this.$this._messageFromClient$2(this.clientPort, $event); + }, + $signature: 1 + }; + A.SharedDriftWorker__startFeatureDetection_result.prototype = { + call$4(opfsAvailable, opfsExists, indexedDbExists, databases) { + var t1, t2; + type$.List_Record_2_WebStorageApi_and_String._as(databases); + t1 = this.completer; + if ((t1.future._async$_state & 30) === 0) { + t1.complete$1(new A.SharedWorkerCompatibilityResult(true, opfsAvailable, this.canUseIndexedDb, databases, B.ProtocolVersion_2_2_v2, indexedDbExists, opfsExists)); + t1 = this._box_0; + t2 = t1.messageSubscription; + if (t2 != null) + t2.cancel$0(); + t1 = t1.errorSubscription; + if (t1 != null) + t1.cancel$0(); + } + }, + $signature: 60 + }; + A.SharedDriftWorker__startFeatureDetection_closure.prototype = { + call$1($event) { + var compatibilityResult = type$.DedicatedWorkerCompatibilityResult._as(A.WasmInitializationMessage_WasmInitializationMessage$fromJs(type$.JSObject._as($event.data))); + this.result.call$4(compatibilityResult.canAccessOpfs, compatibilityResult.opfsExists, compatibilityResult.indexedDbExists, compatibilityResult.existingDatabases); + }, + $signature: 1 + }; + A.SharedDriftWorker__startFeatureDetection_closure0.prototype = { + call$1($event) { + this.result.call$4(false, false, false, B.List_empty5); + this.worker.terminate(); + this.$this._dedicatedWorker = null; + }, + $signature: 1 + }; + A.WasmStorageImplementation.prototype = { + _enumToString$0() { + return "WasmStorageImplementation." + this._core$_name; + } + }; + A.WebStorageApi.prototype = { + _enumToString$0() { + return "WebStorageApi." + this._core$_name; + } + }; + A.WasmDatabase.prototype = {}; + A._WasmDelegate.prototype = { + openDatabase$0() { + var t1 = this._sqlite3.open$1(this._path); + return t1; + }, + _flush$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + t1; + var $async$_flush$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A._Future$value(null, type$.void); + $async$goto = 2; + return A._asyncAwait(t1, $async$_flush$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_flush$0, $async$completer); + }, + _runWithArgs$2(statement, args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), + $async$self = this; + var $async$_runWithArgs$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self.runWithArgsSync$2(statement, args); + $async$goto = !$async$self.isInTransaction ? 2 : 3; + break; + case 2: + // then + $async$goto = 4; + return A._asyncAwait($async$self._flush$0(), $async$_runWithArgs$2); + case 4: + // returning from await. + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_runWithArgs$2, $async$completer); + }, + runCustom$2(statement, args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$runCustom$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self._runWithArgs$2(statement, args), $async$runCustom$2); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$runCustom$2, $async$completer); + }, + runInsert$2(statement, args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.int), + $async$returnValue, $async$self = this, t1, _this; + var $async$runInsert$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._runWithArgs$2(statement, args), $async$runInsert$2); + case 3: + // returning from await. + t1 = $async$self._database.database; + _this = type$.JavaScriptBigInt._as(A.callMethod(t1.bindings._sqlite3_last_insert_rowid, "call", [null, t1.db], type$.nullable_Object)); + $async$returnValue = A._asInt(A._asDouble(self.Number(_this))); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$runInsert$2, $async$completer); + }, + runUpdate$2(statement, args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.int), + $async$returnValue, $async$self = this, t1; + var $async$runUpdate$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._runWithArgs$2(statement, args), $async$runUpdate$2); + case 3: + // returning from await. + t1 = $async$self._database.database; + $async$returnValue = A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_changes, "call", [null, t1.db], type$.nullable_Object))); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$runUpdate$2, $async$completer); + }, + runBatched$1(statements) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$runBatched$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self.runBatchSync$1(statements); + $async$goto = !$async$self.isInTransaction ? 2 : 3; + break; + case 2: + // then + $async$goto = 4; + return A._asyncAwait($async$self._flush$0(), $async$runBatched$1); + case 4: + // returning from await. + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$runBatched$1, $async$completer); + }, + close$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$close$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self.super$Sqlite3Delegate$close(), $async$close$0); + case 2: + // returning from await. + $async$self._database.dispose$0(); + $async$goto = 3; + return A._asyncAwait($async$self._flush$0(), $async$close$0); + case 3: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$close$0, $async$completer); + } + }; + A.Context.prototype = { + absolute$15(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15) { + var t1; + A._validateArgList("absolute", A._setArrayType([part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15], type$.JSArray_nullable_String)); + t1 = this.style; + t1 = t1.rootLength$1(part1) > 0 && !t1.isRootRelative$1(part1); + if (t1) + return part1; + t1 = this._context$_current; + return this.join$16(0, t1 == null ? A.current() : t1, part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15); + }, + absolute$1(part1) { + var _null = null; + return this.absolute$15(part1, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, + join$16(_, part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15, part16) { + var parts = A._setArrayType([part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15, part16], type$.JSArray_nullable_String); + A._validateArgList("join", parts); + return this.joinAll$1(new A.WhereTypeIterable(parts, type$.WhereTypeIterable_String)); + }, + join$2(_, part1, part2) { + var _null = null; + return this.join$16(0, part1, part2, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, + joinAll$1(parts) { + var t1, t2, t3, needsSeparator, isAbsoluteAndNotRootRelative, t4, t5, parsed, path, t6; + type$.Iterable_String._as(parts); + for (t1 = parts.$ti, t2 = t1._eval$1("bool(Iterable.E)")._as(new A.Context_joinAll_closure()), t3 = parts.get$iterator(0), t1 = new A.WhereIterator(t3, t2, t1._eval$1("WhereIterator")), t2 = this.style, needsSeparator = false, isAbsoluteAndNotRootRelative = false, t4 = ""; t1.moveNext$0();) { + t5 = t3.get$current(); + if (t2.isRootRelative$1(t5) && isAbsoluteAndNotRootRelative) { + parsed = A.ParsedPath_ParsedPath$parse(t5, t2); + path = t4.charCodeAt(0) == 0 ? t4 : t4; + t4 = B.JSString_methods.substring$2(path, 0, t2.rootLength$2$withDrive(path, true)); + parsed.root = t4; + if (t2.needsSeparator$1(t4)) + B.JSArray_methods.$indexSet(parsed.separators, 0, t2.get$separator()); + t4 = "" + parsed.toString$0(0); + } else if (t2.rootLength$1(t5) > 0) { + isAbsoluteAndNotRootRelative = !t2.isRootRelative$1(t5); + t4 = "" + t5; + } else { + t6 = t5.length; + if (t6 !== 0) { + if (0 >= t6) + return A.ioore(t5, 0); + t6 = t2.containsSeparator$1(t5[0]); + } else + t6 = false; + if (!t6) + if (needsSeparator) + t4 += t2.get$separator(); + t4 += t5; + } + needsSeparator = t2.needsSeparator$1(t5); + } + return t4.charCodeAt(0) == 0 ? t4 : t4; + }, + split$1(_, path) { + var parsed = A.ParsedPath_ParsedPath$parse(path, this.style), + t1 = parsed.parts, + t2 = A._arrayInstanceType(t1), + t3 = t2._eval$1("WhereIterable<1>"); + parsed.set$parts(A.List_List$of(new A.WhereIterable(t1, t2._eval$1("bool(1)")._as(new A.Context_split_closure()), t3), true, t3._eval$1("Iterable.E"))); + t1 = parsed.root; + if (t1 != null) + B.JSArray_methods.insert$2(parsed.parts, 0, t1); + return parsed.parts; + }, + normalize$1(path) { + var parsed; + if (!this._needsNormalization$1(path)) + return path; + parsed = A.ParsedPath_ParsedPath$parse(path, this.style); + parsed.normalize$0(); + return parsed.toString$0(0); + }, + _needsNormalization$1(path) { + var t2, i, start, previous, t3, previousPrevious, codeUnit, t4, + t1 = this.style, + root = t1.rootLength$1(path); + if (root !== 0) { + if (t1 === $.$get$Style_windows()) + for (t2 = path.length, i = 0; i < root; ++i) { + if (!(i < t2)) + return A.ioore(path, i); + if (path.charCodeAt(i) === 47) + return true; + } + start = root; + previous = 47; + } else { + start = 0; + previous = null; + } + for (t2 = new A.CodeUnits(path).__internal$_string, t3 = t2.length, i = start, previousPrevious = null; i < t3; ++i, previousPrevious = previous, previous = codeUnit) { + if (!(i >= 0)) + return A.ioore(t2, i); + codeUnit = t2.charCodeAt(i); + if (t1.isSeparator$1(codeUnit)) { + if (t1 === $.$get$Style_windows() && codeUnit === 47) + return true; + if (previous != null && t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t4 = previousPrevious == null || previousPrevious === 46 || t1.isSeparator$1(previousPrevious); + else + t4 = false; + if (t4) + return true; + } + } + if (previous == null) + return true; + if (t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t1 = previousPrevious == null || t1.isSeparator$1(previousPrevious) || previousPrevious === 46; + else + t1 = false; + if (t1) + return true; + return false; + }, + relative$2$from(path, from) { + var fromParsed, pathParsed, t2, t3, t4, t5, _this = this, + _s26_ = 'Unable to find a path to "', + t1 = from == null; + if (t1 && _this.style.rootLength$1(path) <= 0) + return _this.normalize$1(path); + if (t1) { + t1 = _this._context$_current; + from = t1 == null ? A.current() : t1; + } else + from = _this.absolute$1(from); + t1 = _this.style; + if (t1.rootLength$1(from) <= 0 && t1.rootLength$1(path) > 0) + return _this.normalize$1(path); + if (t1.rootLength$1(path) <= 0 || t1.isRootRelative$1(path)) + path = _this.absolute$1(path); + if (t1.rootLength$1(path) <= 0 && t1.rootLength$1(from) > 0) + throw A.wrapException(A.PathException$(_s26_ + path + '" from "' + from + '".')); + fromParsed = A.ParsedPath_ParsedPath$parse(from, t1); + fromParsed.normalize$0(); + pathParsed = A.ParsedPath_ParsedPath$parse(path, t1); + pathParsed.normalize$0(); + t2 = fromParsed.parts; + t3 = t2.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(t2, 0); + t2 = J.$eq$(t2[0], "."); + } else + t2 = false; + if (t2) + return pathParsed.toString$0(0); + t2 = fromParsed.root; + t3 = pathParsed.root; + if (t2 != t3) + t2 = t2 == null || t3 == null || !t1.pathsEqual$2(t2, t3); + else + t2 = false; + if (t2) + return pathParsed.toString$0(0); + while (true) { + t2 = fromParsed.parts; + t3 = t2.length; + if (t3 !== 0) { + t4 = pathParsed.parts; + t5 = t4.length; + if (t5 !== 0) { + if (0 >= t3) + return A.ioore(t2, 0); + t2 = t2[0]; + if (0 >= t5) + return A.ioore(t4, 0); + t4 = t1.pathsEqual$2(t2, t4[0]); + t2 = t4; + } else + t2 = false; + } else + t2 = false; + if (!t2) + break; + B.JSArray_methods.removeAt$1(fromParsed.parts, 0); + B.JSArray_methods.removeAt$1(fromParsed.separators, 1); + B.JSArray_methods.removeAt$1(pathParsed.parts, 0); + B.JSArray_methods.removeAt$1(pathParsed.separators, 1); + } + t2 = fromParsed.parts; + t3 = t2.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(t2, 0); + t2 = J.$eq$(t2[0], ".."); + } else + t2 = false; + if (t2) + throw A.wrapException(A.PathException$(_s26_ + path + '" from "' + from + '".')); + t2 = type$.String; + B.JSArray_methods.insertAll$2(pathParsed.parts, 0, A.List_List$filled(fromParsed.parts.length, "..", false, t2)); + B.JSArray_methods.$indexSet(pathParsed.separators, 0, ""); + B.JSArray_methods.insertAll$2(pathParsed.separators, 1, A.List_List$filled(fromParsed.parts.length, t1.get$separator(), false, t2)); + t1 = pathParsed.parts; + t2 = t1.length; + if (t2 === 0) + return "."; + if (t2 > 1 && J.$eq$(B.JSArray_methods.get$last(t1), ".")) { + B.JSArray_methods.removeLast$0(pathParsed.parts); + t1 = pathParsed.separators; + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + B.JSArray_methods.add$1(t1, ""); + } + pathParsed.root = ""; + pathParsed.removeTrailingSeparators$0(); + return pathParsed.toString$0(0); + }, + relative$1(path) { + return this.relative$2$from(path, null); + }, + _isWithinOrEquals$2($parent, child) { + var relative, t1, parentIsAbsolute, childIsAbsolute, childIsRootRelative, parentIsRootRelative, result, exception, _this = this; + $parent = A._asString($parent); + child = A._asString(child); + t1 = _this.style; + parentIsAbsolute = t1.rootLength$1(A._asString($parent)) > 0; + childIsAbsolute = t1.rootLength$1(A._asString(child)) > 0; + if (parentIsAbsolute && !childIsAbsolute) { + child = _this.absolute$1(child); + if (t1.isRootRelative$1($parent)) + $parent = _this.absolute$1($parent); + } else if (childIsAbsolute && !parentIsAbsolute) { + $parent = _this.absolute$1($parent); + if (t1.isRootRelative$1(child)) + child = _this.absolute$1(child); + } else if (childIsAbsolute && parentIsAbsolute) { + childIsRootRelative = t1.isRootRelative$1(child); + parentIsRootRelative = t1.isRootRelative$1($parent); + if (childIsRootRelative && !parentIsRootRelative) + child = _this.absolute$1(child); + else if (parentIsRootRelative && !childIsRootRelative) + $parent = _this.absolute$1($parent); + } + result = _this._isWithinOrEqualsFast$2($parent, child); + if (result !== B._PathRelation_inconclusive) + return result; + relative = null; + try { + relative = _this.relative$2$from(child, $parent); + } catch (exception) { + if (A.unwrapException(exception) instanceof A.PathException) + return B._PathRelation_different; + else + throw exception; + } + if (t1.rootLength$1(A._asString(relative)) > 0) + return B._PathRelation_different; + if (J.$eq$(relative, ".")) + return B._PathRelation_equal; + if (J.$eq$(relative, "..")) + return B._PathRelation_different; + return J.get$length$asx(relative) >= 3 && J.startsWith$1$s(relative, "..") && t1.isSeparator$1(J.codeUnitAt$1$s(relative, 2)) ? B._PathRelation_different : B._PathRelation_within; + }, + _isWithinOrEqualsFast$2($parent, child) { + var t1, parentRootLength, childRootLength, t2, t3, i, childIndex, parentIndex, lastCodeUnit, lastParentSeparator, parentCodeUnit, childCodeUnit, parentIndex0, t4, direction, _this = this; + if ($parent === ".") + $parent = ""; + t1 = _this.style; + parentRootLength = t1.rootLength$1($parent); + childRootLength = t1.rootLength$1(child); + if (parentRootLength !== childRootLength) + return B._PathRelation_different; + for (t2 = $parent.length, t3 = child.length, i = 0; i < parentRootLength; ++i) { + if (!(i < t2)) + return A.ioore($parent, i); + if (!(i < t3)) + return A.ioore(child, i); + if (!t1.codeUnitsEqual$2($parent.charCodeAt(i), child.charCodeAt(i))) + return B._PathRelation_different; + } + childIndex = childRootLength; + parentIndex = parentRootLength; + lastCodeUnit = 47; + lastParentSeparator = null; + while (true) { + if (!(parentIndex < t2 && childIndex < t3)) + break; + c$0: { + if (!(parentIndex >= 0 && parentIndex < t2)) + return A.ioore($parent, parentIndex); + parentCodeUnit = $parent.charCodeAt(parentIndex); + if (!(childIndex >= 0 && childIndex < t3)) + return A.ioore(child, childIndex); + childCodeUnit = child.charCodeAt(childIndex); + if (t1.codeUnitsEqual$2(parentCodeUnit, childCodeUnit)) { + if (t1.isSeparator$1(parentCodeUnit)) + lastParentSeparator = parentIndex; + ++parentIndex; + ++childIndex; + lastCodeUnit = parentCodeUnit; + break c$0; + } + if (t1.isSeparator$1(parentCodeUnit) && t1.isSeparator$1(lastCodeUnit)) { + parentIndex0 = parentIndex + 1; + lastParentSeparator = parentIndex; + parentIndex = parentIndex0; + break c$0; + } else if (t1.isSeparator$1(childCodeUnit) && t1.isSeparator$1(lastCodeUnit)) { + ++childIndex; + break c$0; + } + if (parentCodeUnit === 46 && t1.isSeparator$1(lastCodeUnit)) { + ++parentIndex; + if (parentIndex === t2) + break; + if (!(parentIndex < t2)) + return A.ioore($parent, parentIndex); + parentCodeUnit = $parent.charCodeAt(parentIndex); + if (t1.isSeparator$1(parentCodeUnit)) { + parentIndex0 = parentIndex + 1; + lastParentSeparator = parentIndex; + parentIndex = parentIndex0; + break c$0; + } + if (parentCodeUnit === 46) { + ++parentIndex; + if (parentIndex !== t2) { + if (!(parentIndex < t2)) + return A.ioore($parent, parentIndex); + t4 = t1.isSeparator$1($parent.charCodeAt(parentIndex)); + } else + t4 = true; + if (t4) + return B._PathRelation_inconclusive; + } + } + if (childCodeUnit === 46 && t1.isSeparator$1(lastCodeUnit)) { + ++childIndex; + if (childIndex === t3) + break; + if (!(childIndex < t3)) + return A.ioore(child, childIndex); + childCodeUnit = child.charCodeAt(childIndex); + if (t1.isSeparator$1(childCodeUnit)) { + ++childIndex; + break c$0; + } + if (childCodeUnit === 46) { + ++childIndex; + if (childIndex !== t3) { + if (!(childIndex < t3)) + return A.ioore(child, childIndex); + t2 = t1.isSeparator$1(child.charCodeAt(childIndex)); + t1 = t2; + } else + t1 = true; + if (t1) + return B._PathRelation_inconclusive; + } + } + if (_this._pathDirection$2(child, childIndex) !== B._PathDirection_yLX) + return B._PathRelation_inconclusive; + if (_this._pathDirection$2($parent, parentIndex) !== B._PathDirection_yLX) + return B._PathRelation_inconclusive; + return B._PathRelation_different; + } + } + if (childIndex === t3) { + if (parentIndex !== t2) { + if (!(parentIndex >= 0 && parentIndex < t2)) + return A.ioore($parent, parentIndex); + t1 = t1.isSeparator$1($parent.charCodeAt(parentIndex)); + } else + t1 = true; + if (t1) + lastParentSeparator = parentIndex; + else if (lastParentSeparator == null) + lastParentSeparator = Math.max(0, parentRootLength - 1); + direction = _this._pathDirection$2($parent, lastParentSeparator); + if (direction === B._PathDirection_8OV) + return B._PathRelation_equal; + return direction === B._PathDirection_3KU ? B._PathRelation_inconclusive : B._PathRelation_different; + } + direction = _this._pathDirection$2(child, childIndex); + if (direction === B._PathDirection_8OV) + return B._PathRelation_equal; + if (direction === B._PathDirection_3KU) + return B._PathRelation_inconclusive; + if (!(childIndex >= 0 && childIndex < t3)) + return A.ioore(child, childIndex); + return t1.isSeparator$1(child.charCodeAt(childIndex)) || t1.isSeparator$1(lastCodeUnit) ? B._PathRelation_within : B._PathRelation_different; + }, + _pathDirection$2(path, index) { + var t1, t2, i, depth, reachedRoot, t3, i0, t4; + for (t1 = path.length, t2 = this.style, i = index, depth = 0, reachedRoot = false; i < t1;) { + while (true) { + if (i < t1) { + if (!(i >= 0)) + return A.ioore(path, i); + t3 = t2.isSeparator$1(path.charCodeAt(i)); + } else + t3 = false; + if (!t3) + break; + ++i; + } + if (i === t1) + break; + i0 = i; + while (true) { + if (i0 < t1) { + if (!(i0 >= 0)) + return A.ioore(path, i0); + t3 = !t2.isSeparator$1(path.charCodeAt(i0)); + } else + t3 = false; + if (!t3) + break; + ++i0; + } + t3 = i0 - i; + if (t3 === 1) { + if (!(i >= 0 && i < t1)) + return A.ioore(path, i); + t4 = path.charCodeAt(i) === 46; + } else + t4 = false; + if (!t4) { + if (t3 === 2) { + if (!(i >= 0 && i < t1)) + return A.ioore(path, i); + if (path.charCodeAt(i) === 46) { + t3 = i + 1; + if (!(t3 < t1)) + return A.ioore(path, t3); + t3 = path.charCodeAt(t3) === 46; + } else + t3 = false; + } else + t3 = false; + if (t3) { + --depth; + if (depth < 0) + break; + if (depth === 0) + reachedRoot = true; + } else + ++depth; + } + if (i0 === t1) + break; + i = i0 + 1; + } + if (depth < 0) + return B._PathDirection_3KU; + if (depth === 0) + return B._PathDirection_8OV; + if (reachedRoot) + return B._PathDirection_e7w; + return B._PathDirection_yLX; + }, + toUri$1(path) { + var t2, + t1 = this.style; + if (t1.rootLength$1(path) <= 0) + return t1.relativePathToUri$1(path); + else { + t2 = this._context$_current; + return t1.absolutePathToUri$1(this.join$2(0, t2 == null ? A.current() : t2, path)); + } + }, + prettyUri$1(uri) { + var path, rel, _this = this, + typedUri = A._parseUri(uri); + if (typedUri.get$scheme() === "file" && _this.style === $.$get$Style_url()) + return typedUri.toString$0(0); + else if (typedUri.get$scheme() !== "file" && typedUri.get$scheme() !== "" && _this.style !== $.$get$Style_url()) + return typedUri.toString$0(0); + path = _this.normalize$1(_this.style.pathFromUri$1(A._parseUri(typedUri))); + rel = _this.relative$1(path); + return _this.split$1(0, rel).length > _this.split$1(0, path).length ? path : rel; + } + }; + A.Context_joinAll_closure.prototype = { + call$1(part) { + return A._asString(part) !== ""; + }, + $signature: 3 + }; + A.Context_split_closure.prototype = { + call$1(part) { + return A._asString(part).length !== 0; + }, + $signature: 3 + }; + A._validateArgList_closure.prototype = { + call$1(arg) { + A._asStringQ(arg); + return arg == null ? "null" : '"' + arg + '"'; + }, + $signature: 62 + }; + A._PathDirection.prototype = { + toString$0(_) { + return this.name; + } + }; + A._PathRelation.prototype = { + toString$0(_) { + return this.name; + } + }; + A.InternalStyle.prototype = { + getRoot$1(path) { + var t1, + $length = this.rootLength$1(path); + if ($length > 0) + return B.JSString_methods.substring$2(path, 0, $length); + if (this.isRootRelative$1(path)) { + if (0 >= path.length) + return A.ioore(path, 0); + t1 = path[0]; + } else + t1 = null; + return t1; + }, + relativePathToUri$1(path) { + var segments, t2, _null = null, + t1 = path.length; + if (t1 === 0) + return A._Uri__Uri(_null, _null, _null, _null); + segments = A.Context_Context(_null, this).split$1(0, path); + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + if (this.isSeparator$1(path.charCodeAt(t2))) + B.JSArray_methods.add$1(segments, ""); + return A._Uri__Uri(_null, _null, segments, _null); + }, + codeUnitsEqual$2(codeUnit1, codeUnit2) { + return codeUnit1 === codeUnit2; + }, + pathsEqual$2(path1, path2) { + return path1 === path2; + } + }; + A.ParsedPath.prototype = { + get$hasTrailingSeparator() { + var t1 = this.parts; + if (t1.length !== 0) + t1 = J.$eq$(B.JSArray_methods.get$last(t1), "") || !J.$eq$(B.JSArray_methods.get$last(this.separators), ""); + else + t1 = false; + return t1; + }, + removeTrailingSeparators$0() { + var t1, t2, _this = this; + while (true) { + t1 = _this.parts; + if (!(t1.length !== 0 && J.$eq$(B.JSArray_methods.get$last(t1), ""))) + break; + B.JSArray_methods.removeLast$0(_this.parts); + t1 = _this.separators; + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + } + t1 = _this.separators; + t2 = t1.length; + if (t2 !== 0) + B.JSArray_methods.$indexSet(t1, t2 - 1, ""); + }, + normalize$0() { + var t1, t2, leadingDoubles, _i, part, t3, _this = this, + newParts = A._setArrayType([], type$.JSArray_String); + for (t1 = _this.parts, t2 = t1.length, leadingDoubles = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + part = t1[_i]; + t3 = J.getInterceptor$(part); + if (!(t3.$eq(part, ".") || t3.$eq(part, ""))) + if (t3.$eq(part, "..")) { + t3 = newParts.length; + if (t3 !== 0) { + if (0 >= t3) + return A.ioore(newParts, -1); + newParts.pop(); + } else + ++leadingDoubles; + } else + B.JSArray_methods.add$1(newParts, part); + } + if (_this.root == null) + B.JSArray_methods.insertAll$2(newParts, 0, A.List_List$filled(leadingDoubles, "..", false, type$.String)); + if (newParts.length === 0 && _this.root == null) + B.JSArray_methods.add$1(newParts, "."); + _this.set$parts(newParts); + t1 = _this.style; + _this.set$separators(A.List_List$filled(newParts.length + 1, t1.get$separator(), true, type$.String)); + t2 = _this.root; + if (t2 == null || newParts.length === 0 || !t1.needsSeparator$1(t2)) + B.JSArray_methods.$indexSet(_this.separators, 0, ""); + t2 = _this.root; + if (t2 != null && t1 === $.$get$Style_windows()) { + t2.toString; + _this.root = A.stringReplaceAllUnchecked(t2, "/", "\\"); + } + _this.removeTrailingSeparators$0(); + }, + toString$0(_) { + var i, t2, t3, _this = this, + t1 = _this.root; + t1 = t1 != null ? "" + t1 : ""; + for (i = 0; i < _this.parts.length; ++i, t1 = t3) { + t2 = _this.separators; + if (!(i < t2.length)) + return A.ioore(t2, i); + t2 = A.S(t2[i]); + t3 = _this.parts; + if (!(i < t3.length)) + return A.ioore(t3, i); + t3 = t1 + t2 + A.S(t3[i]); + } + t1 += A.S(B.JSArray_methods.get$last(_this.separators)); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + set$parts(parts) { + this.parts = type$.List_String._as(parts); + }, + set$separators(separators) { + this.separators = type$.List_String._as(separators); + } + }; + A.PathException.prototype = { + toString$0(_) { + return "PathException: " + this.message; + }, + $isException: 1 + }; + A.Style.prototype = { + toString$0(_) { + return this.get$name(); + } + }; + A.PosixStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1(path) { + var t2, + t1 = path.length; + if (t1 !== 0) { + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + t2 = path.charCodeAt(t2) !== 47; + t1 = t2; + } else + t1 = false; + return t1; + }, + rootLength$2$withDrive(path, withDrive) { + var t1 = path.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(path, 0); + t1 = path.charCodeAt(0) === 47; + } else + t1 = false; + if (t1) + return 1; + return 0; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return false; + }, + pathFromUri$1(uri) { + var t1; + if (uri.get$scheme() === "" || uri.get$scheme() === "file") { + t1 = uri.get$path(); + return A._Uri__uriDecode(t1, 0, t1.length, B.C_Utf8Codec, false); + } + throw A.wrapException(A.ArgumentError$("Uri " + uri.toString$0(0) + " must have scheme 'file:'.", null)); + }, + absolutePathToUri$1(path) { + var parsed = A.ParsedPath_ParsedPath$parse(path, this), + t1 = parsed.parts; + if (t1.length === 0) + B.JSArray_methods.addAll$1(t1, A._setArrayType(["", ""], type$.JSArray_String)); + else if (parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + return A._Uri__Uri(null, null, parsed.parts, "file"); + }, + get$name() { + return "posix"; + }, + get$separator() { + return "/"; + } + }; + A.UrlStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1(path) { + var t2, + t1 = path.length; + if (t1 === 0) + return false; + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + if (path.charCodeAt(t2) !== 47) + return true; + return B.JSString_methods.endsWith$1(path, "://") && this.rootLength$1(path) === t1; + }, + rootLength$2$withDrive(path, withDrive) { + var i, codeUnit, index, + t1 = path.length; + if (t1 === 0) + return 0; + if (0 >= t1) + return A.ioore(path, 0); + if (path.charCodeAt(0) === 47) + return 1; + for (i = 0; i < t1; ++i) { + codeUnit = path.charCodeAt(i); + if (codeUnit === 47) + return 0; + if (codeUnit === 58) { + if (i === 0) + return 0; + index = B.JSString_methods.indexOf$2(path, "/", B.JSString_methods.startsWith$2(path, "//", i + 1) ? i + 3 : i); + if (index <= 0) + return t1; + if (!withDrive || t1 < index + 3) + return index; + if (!B.JSString_methods.startsWith$1(path, "file://")) + return index; + t1 = A.driveLetterEnd(path, index + 1); + return t1 == null ? index : t1; + } + } + return 0; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + var t1 = path.length; + if (t1 !== 0) { + if (0 >= t1) + return A.ioore(path, 0); + t1 = path.charCodeAt(0) === 47; + } else + t1 = false; + return t1; + }, + pathFromUri$1(uri) { + return uri.toString$0(0); + }, + relativePathToUri$1(path) { + return A.Uri_parse(path); + }, + absolutePathToUri$1(path) { + return A.Uri_parse(path); + }, + get$name() { + return "url"; + }, + get$separator() { + return "/"; + } + }; + A.WindowsStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47 || codeUnit === 92; + }, + needsSeparator$1(path) { + var t2, + t1 = path.length; + if (t1 === 0) + return false; + t2 = t1 - 1; + if (!(t2 >= 0)) + return A.ioore(path, t2); + t2 = path.charCodeAt(t2); + return !(t2 === 47 || t2 === 92); + }, + rootLength$2$withDrive(path, withDrive) { + var t2, index, + t1 = path.length; + if (t1 === 0) + return 0; + if (0 >= t1) + return A.ioore(path, 0); + if (path.charCodeAt(0) === 47) + return 1; + if (path.charCodeAt(0) === 92) { + if (t1 >= 2) { + if (1 >= t1) + return A.ioore(path, 1); + t2 = path.charCodeAt(1) !== 92; + } else + t2 = true; + if (t2) + return 1; + index = B.JSString_methods.indexOf$2(path, "\\", 2); + if (index > 0) { + index = B.JSString_methods.indexOf$2(path, "\\", index + 1); + if (index > 0) + return index; + } + return t1; + } + if (t1 < 3) + return 0; + if (!A.isAlphabetic(path.charCodeAt(0))) + return 0; + if (path.charCodeAt(1) !== 58) + return 0; + t1 = path.charCodeAt(2); + if (!(t1 === 47 || t1 === 92)) + return 0; + return 3; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return this.rootLength$1(path) === 1; + }, + pathFromUri$1(uri) { + var path, t1; + if (uri.get$scheme() !== "" && uri.get$scheme() !== "file") + throw A.wrapException(A.ArgumentError$("Uri " + uri.toString$0(0) + " must have scheme 'file:'.", null)); + path = uri.get$path(); + if (uri.get$host() === "") { + if (path.length >= 3 && B.JSString_methods.startsWith$1(path, "/") && A.driveLetterEnd(path, 1) != null) + path = B.JSString_methods.replaceFirst$2(path, "/", ""); + } else + path = "\\\\" + uri.get$host() + path; + t1 = A.stringReplaceAllUnchecked(path, "/", "\\"); + return A._Uri__uriDecode(t1, 0, t1.length, B.C_Utf8Codec, false); + }, + absolutePathToUri$1(path) { + var rootParts, t2, + parsed = A.ParsedPath_ParsedPath$parse(path, this), + t1 = parsed.root; + t1.toString; + if (B.JSString_methods.startsWith$1(t1, "\\\\")) { + rootParts = new A.WhereIterable(A._setArrayType(t1.split("\\"), type$.JSArray_String), type$.bool_Function_String._as(new A.WindowsStyle_absolutePathToUri_closure()), type$.WhereIterable_String); + B.JSArray_methods.insert$2(parsed.parts, 0, rootParts.get$last(0)); + if (parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + return A._Uri__Uri(rootParts.get$first(0), null, parsed.parts, "file"); + } else { + if (parsed.parts.length === 0 || parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + t1 = parsed.parts; + t2 = parsed.root; + t2.toString; + t2 = A.stringReplaceAllUnchecked(t2, "/", ""); + B.JSArray_methods.insert$2(t1, 0, A.stringReplaceAllUnchecked(t2, "\\", "")); + return A._Uri__Uri(null, null, parsed.parts, "file"); + } + }, + codeUnitsEqual$2(codeUnit1, codeUnit2) { + var upperCase1; + if (codeUnit1 === codeUnit2) + return true; + if (codeUnit1 === 47) + return codeUnit2 === 92; + if (codeUnit1 === 92) + return codeUnit2 === 47; + if ((codeUnit1 ^ codeUnit2) !== 32) + return false; + upperCase1 = codeUnit1 | 32; + return upperCase1 >= 97 && upperCase1 <= 122; + }, + pathsEqual$2(path1, path2) { + var t1, t2, i; + if (path1 === path2) + return true; + t1 = path1.length; + t2 = path2.length; + if (t1 !== t2) + return false; + for (i = 0; i < t1; ++i) { + if (!(i < t2)) + return A.ioore(path2, i); + if (!this.codeUnitsEqual$2(path1.charCodeAt(i), path2.charCodeAt(i))) + return false; + } + return true; + }, + get$name() { + return "windows"; + }, + get$separator() { + return "\\"; + } + }; + A.WindowsStyle_absolutePathToUri_closure.prototype = { + call$1(part) { + return A._asString(part) !== ""; + }, + $signature: 3 + }; + A.SqliteException.prototype = { + toString$0(_) { + var t2, t3, _this = this, + t1 = _this.operation; + t1 = t1 == null ? "" : "while " + t1 + ", "; + t1 = "SqliteException(" + _this.extendedResultCode + "): " + t1 + _this.message + ", " + _this.explanation; + t2 = _this.causingStatement; + if (t2 != null) { + t1 = t1 + "\n Causing statement: " + t2; + t2 = _this.parametersToStatement; + if (t2 != null) { + t3 = A._arrayInstanceType(t2); + t3 = t1 + (", parameters: " + new A.MappedListIterable(t2, t3._eval$1("String(1)")._as(new A.SqliteException_toString_closure()), t3._eval$1("MappedListIterable<1,String>")).join$1(0, ", ")); + t1 = t3; + } + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isException: 1 + }; + A.SqliteException_toString_closure.prototype = { + call$1(e) { + if (type$.Uint8List._is(e)) + return "blob (" + e.length + " bytes)"; + else + return J.toString$0$(e); + }, + $signature: 63 + }; + A.AllowedArgumentCount.prototype = {}; + A.RawSqliteBindings.prototype = {}; + A.SqliteResult.prototype = {}; + A.RawSqliteDatabase.prototype = {}; + A.RawStatementCompiler.prototype = {}; + A.RawSqliteStatement.prototype = {}; + A.RawSqliteContext.prototype = {}; + A.RawSqliteValue.prototype = {}; + A.FinalizableDatabase.prototype = { + dispose$0() { + var t1, t2, _i, stmt, t3, t4, code, exception; + for (t1 = this._statements, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + stmt = t1[_i]; + if (!stmt._closed) { + stmt._closed = true; + if (!stmt._inResetState) { + t3 = stmt.statement; + t4 = t3.bindings._sqlite3_reset; + t3 = [null, t3.stmt]; + A.assertInteropArgs(t3); + A._asInt(A._asDouble(t4.call.apply(t4, t3))); + stmt._inResetState = true; + } + t3 = stmt.statement; + t3.deallocateArguments$0(); + t4 = t3.bindings._sqlite3_finalize; + t3 = [null, t3.stmt]; + A.assertInteropArgs(t3); + A._asInt(A._asDouble(t4.call.apply(t4, t3))); + } + } + t1 = this.database; + code = A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_close_v2, "call", [null, t1.db], type$.nullable_Object))); + exception = code !== 0 ? A.createExceptionRaw(this.bindings, t1, code, "closing database", null, null) : null; + if (exception != null) + throw A.wrapException(exception); + } + }; + A.DatabaseImplementation.prototype = { + get$userVersion() { + var result, version, t1, + stmt = this.prepare$1("PRAGMA user_version;"); + try { + result = stmt.selectWith$1(new A.IndexedParameters(B.List_empty4)); + t1 = J.get$first$ax(result)._data; + if (0 >= t1.length) + return A.ioore(t1, 0); + version = A._asInt(t1[0]); + return version; + } finally { + stmt.dispose$0(); + } + }, + createFunction$5$argumentCount$deterministic$directOnly$function$functionName(argumentCount, deterministic, directOnly, $function, functionName) { + var t1, functionNameBytes, t2, flags, t3, t4, ptr, result, _null = null; + type$.nullable_Object_Function_List_nullable_Object._as($function); + t1 = this.database; + functionNameBytes = B.C_Utf8Encoder.convert$1(functionName); + if (functionNameBytes.length > 255) + A.throwExpression(A.ArgumentError$value(functionName, "functionName", "Must not exceed 255 bytes when utf-8 encoded")); + t2 = new Uint8Array(A._ensureNativeList(functionNameBytes)); + flags = deterministic ? 2049 : 1; + if (directOnly) + flags |= 524288; + t3 = type$.nullable_void_Function_2_RawSqliteContext_and_List_RawSqliteValue._as(new A.DatabaseImplementation_createFunction_closure($function)); + t4 = t1.bindings; + ptr = t4.allocateBytes$2$additionalLength(t2, 1); + t1 = A.callMethod(t4._create_scalar, "call", [null, t1.db, ptr, argumentCount.allowedArgs, flags, t4.callbacks.register$1(new A.RegisteredFunctionSet(t3, _null, _null))], type$.double); + result = A._asInt(t1); + A.callMethod(t4._free, "call", [null, ptr], type$.nullable_Object); + if (result !== 0) + A.throwException(this, result, _null, _null, _null); + }, + createFunction$3$directOnly$function$functionName(directOnly, $function, functionName) { + return this.createFunction$5$argumentCount$deterministic$directOnly$function$functionName(B.AllowedArgumentCount_m1, false, directOnly, $function, functionName); + }, + createFunction$4$argumentCount$deterministic$function$functionName(argumentCount, deterministic, $function, functionName) { + return this.createFunction$5$argumentCount$deterministic$directOnly$function$functionName(argumentCount, deterministic, true, $function, functionName); + }, + dispose$0() { + var t1, _i, t2, _this = this; + if (_this._isClosed) + return; + $.$get$disposeFinalizer().detach$1(_this); + _this._isClosed = true; + for (t1 = _this._updateListeners, _i = 0; false; ++_i) + t1[_i].close$0(); + t1 = _this.database; + t2 = t1.bindings; + t2.callbacks.set$installedUpdateHook(null); + A.callMethod(t2._update_hooks, "call", [null, t1.db, -1], type$.nullable_Object); + _this.finalizable.dispose$0(); + }, + execute$1(sql) { + var stmt, t1, t2, result, _this = this, + parameters = B.List_empty; + if (J.get$length$asx(parameters) === 0) { + if (_this._isClosed) + A.throwExpression(A.StateError$("This database has already been closed")); + t1 = _this.database; + t2 = t1.bindings; + stmt = t2.allocateBytes$2$additionalLength(B.C_Utf8Encoder.convert$1(sql), 1); + result = A._asInt(A.callMethod(t2._sqlite3_exec, "call", [null, t1.db, stmt, 0, 0, 0], type$.double)); + A.callMethod(t2._free, "call", [null, stmt], type$.nullable_Object); + if (result !== 0) + A.throwException(_this, result, "executing", sql, parameters); + } else { + stmt = _this.prepare$2$checkNoTail(sql, true); + try { + stmt.executeWith$1(new A.IndexedParameters(type$.List_nullable_Object._as(parameters))); + } finally { + stmt.dispose$0(); + } + } + }, + _prepareInternal$5$checkNoTail$maxStatements$persistent$vtab(sql, checkNoTail, maxStatements, persistent, vtab) { + var bytes, t1, t2, ptr, t3, t4, t5, compiler, createdStatements, freeIntermediateResults, offset, result, t6, $length, t7, endOffset, stmt, _i, _this = this, + _s24_ = "Null pointer dereference"; + if (_this._isClosed) + A.throwExpression(A.StateError$("This database has already been closed")); + bytes = B.C_Utf8Encoder.convert$1(sql); + t1 = _this.database; + type$.List_int._as(bytes); + t2 = t1.bindings; + ptr = t2.allocateBytes$1(bytes); + t3 = t2._malloc; + t4 = type$.nullable_Object; + t5 = A._asInt(A._asDouble(A.callMethod(t3, "call", [null, 4], t4))); + t4 = A._asInt(A._asDouble(A.callMethod(t3, "call", [null, 4], t4))); + compiler = new A.WasmStatementCompiler(t1, ptr, t5, t4); + createdStatements = A._setArrayType([], type$.JSArray_StatementImplementation); + freeIntermediateResults = new A.DatabaseImplementation__prepareInternal_freeIntermediateResults(compiler, createdStatements); + for (t1 = bytes.length, t3 = type$.NativeByteBuffer, t2 = t2.memory, t5 = t4 !== 0, offset = 0; offset < t1; offset = endOffset) { + result = compiler.sqlite3_prepare$3(offset, t1 - offset, 0); + t6 = result.resultCode; + if (t6 !== 0) { + freeIntermediateResults.call$0(); + A.throwException(_this, t6, "preparing statement", sql, null); + } + if (A.assertTest(t5)) + A.assertThrow(_s24_); + t6 = t3._as(t2.buffer); + $length = B.JSInt_methods._tdivFast$1(t6.byteLength - 0, 4); + t6 = new Int32Array(t6, 0, $length); + t7 = B.JSInt_methods._shrOtherPositive$1(t4, 2); + if (!(t7 < t6.length)) + return A.ioore(t6, t7); + endOffset = t6[t7] - ptr; + stmt = result.result; + if (stmt != null) + B.JSArray_methods.add$1(createdStatements, new A.StatementImplementation(stmt, _this, new A.FinalizableStatement(stmt), new A._Utf8Decoder(false)._convertGeneral$4(bytes, offset, endOffset, true))); + if (createdStatements.length === maxStatements) { + offset = endOffset; + break; + } + } + if (checkNoTail) + for (; offset < t1;) { + result = compiler.sqlite3_prepare$3(offset, t1 - offset, 0); + if (A.assertTest(t5)) + A.assertThrow(_s24_); + t6 = t3._as(t2.buffer); + $length = B.JSInt_methods._tdivFast$1(t6.byteLength - 0, 4); + t6 = new Int32Array(t6, 0, $length); + t7 = B.JSInt_methods._shrOtherPositive$1(t4, 2); + if (!(t7 < t6.length)) + return A.ioore(t6, t7); + offset = t6[t7] - ptr; + stmt = result.result; + if (stmt != null) { + B.JSArray_methods.add$1(createdStatements, new A.StatementImplementation(stmt, _this, new A.FinalizableStatement(stmt), "")); + freeIntermediateResults.call$0(); + throw A.wrapException(A.ArgumentError$value(sql, "sql", "Had an unexpected trailing statement.")); + } else if (result.resultCode !== 0) { + freeIntermediateResults.call$0(); + throw A.wrapException(A.ArgumentError$value(sql, "sql", "Has trailing data after the first sql statement:")); + } + } + compiler.close$0(); + for (t1 = createdStatements.length, t2 = _this.finalizable._statements, _i = 0; _i < createdStatements.length; createdStatements.length === t1 || (0, A.throwConcurrentModificationError)(createdStatements), ++_i) + B.JSArray_methods.add$1(t2, createdStatements[_i].finalizable); + return createdStatements; + }, + prepare$2$checkNoTail(sql, checkNoTail) { + var stmts = this._prepareInternal$5$checkNoTail$maxStatements$persistent$vtab(sql, checkNoTail, 1, false, true); + if (stmts.length === 0) + throw A.wrapException(A.ArgumentError$value(sql, "sql", "Must contain an SQL statement.")); + return B.JSArray_methods.get$first(stmts); + }, + prepare$1(sql) { + return this.prepare$2$checkNoTail(sql, false); + }, + $isCommonDatabase: 1 + }; + A.DatabaseImplementation_createFunction_closure.prototype = { + call$2(context, args) { + A._extension_0_runWithArgsAndSetResult(context, this.$function, type$.List_RawSqliteValue._as(args)); + }, + $signature: 64 + }; + A.DatabaseImplementation__prepareInternal_freeIntermediateResults.prototype = { + call$0() { + var t1, t2, _i, stmt, t3, t4, t5; + this.compiler.close$0(); + for (t1 = this.createdStatements, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + stmt = t1[_i]; + t3 = stmt.finalizable; + if (!t3._closed) { + t4 = $.$get$disposeFinalizer()._registry; + if (t4 != null) + t4.unregister(stmt); + if (!t3._closed) { + t3._closed = true; + if (!t3._inResetState) { + t4 = t3.statement; + t5 = t4.bindings._sqlite3_reset; + t4 = [null, t4.stmt]; + A.assertInteropArgs(t4); + A._asInt(A._asDouble(t5.call.apply(t5, t4))); + t3._inResetState = true; + } + t4 = t3.statement; + t4.deallocateArguments$0(); + t5 = t4.bindings._sqlite3_finalize; + t4 = [null, t4.stmt]; + A.assertInteropArgs(t4); + A._asInt(A._asDouble(t5.call.apply(t5, t4))); + } + t4 = stmt.database; + if (!t4._isClosed) + B.JSArray_methods.remove$1(t4.finalizable._statements, t3); + } + } + }, + $signature: 0 + }; + A.ValueList.prototype = { + get$length(_) { + return this.rawValues.length; + }, + $index(_, index) { + var t1, $length, t2, cached, result, t3, _this = this, _s4_ = "call"; + if (A.assertTest(_this.isValid)) + A.assertThrow("Invalid arguments. This commonly happens when an application-defined sql function leaks its arguments after it finishes running. Please use List.of(arguments) in the function to create a copy of the argument instead."); + t1 = _this.rawValues; + $length = t1.length; + if (0 > index || index >= $length) + A.throwExpression(A.IndexError$withLength(index, $length, _this, null, "index")); + t2 = _this._cachedCopies; + if (!(index >= 0 && index < t2.length)) + return A.ioore(t2, index); + cached = t2[index]; + result = t1.$index(0, index); + t1 = result.bindings; + t2 = result.value; + t3 = type$.nullable_Object; + switch (A._asInt(A._asDouble(A.callMethod(t1._sqlite3_value_type, _s4_, [null, t2], t3)))) { + case 1: + _this = type$.JavaScriptBigInt._as(t1._sqlite3_value_int64.call(null, t2)); + return A._asInt(A._asDouble(self.Number(_this))); + case 2: + return A._asDouble(t1._sqlite3_value_double.call(null, t2)); + case 3: + $length = A._asInt(A._asDouble(A.callMethod(t1._sqlite3_value_bytes, _s4_, [null, t2], t3))); + return A.WrappedMemory_readString(t1.memory, A._asInt(A._asDouble(A.callMethod(t1._sqlite3_value_text, _s4_, [null, t2], t3))), $length); + case 4: + $length = A._asInt(A._asDouble(A.callMethod(t1._sqlite3_value_bytes, _s4_, [null, t2], t3))); + return A.WrappedMemory_copyRange(t1.memory, A._asInt(A._asDouble(A.callMethod(t1._sqlite3_value_blob, _s4_, [null, t2], t3))), $length); + case 5: + default: + return null; + } + }, + $indexSet(_, index, value) { + throw A.wrapException(A.ArgumentError$("The argument list is unmodifiable", null)); + } + }; + A.FinalizablePart.prototype = {}; + A.disposeFinalizer_closure.prototype = { + call$1(element) { + type$.FinalizablePart._as(element).dispose$0(); + }, + $signature: 65 + }; + A.Sqlite3Implementation.prototype = { + open$1(filename) { + var t1, t2, namePtr, t3, outDb, result, dbPtr, t4, exception, _s4_ = "call"; + switch (2) { + case 2: + break; + } + t1 = this.bindings; + t2 = t1.bindings; + namePtr = t2.allocateBytes$2$additionalLength(B.C_Utf8Encoder.convert$1(filename), 1); + t3 = type$.nullable_Object; + outDb = A._asInt(A._asDouble(A.callMethod(t2._malloc, _s4_, [null, 4], t3))); + result = A._asInt(A._asDouble(A.callMethod(t2._sqlite3_open_v2, _s4_, [null, namePtr, outDb, 6, 0], t3))); + dbPtr = A.WrappedMemory_int32ValueOfPointer(t2.memory, outDb); + t4 = t2._free; + A.callMethod(t4, _s4_, [null, namePtr], t3); + A.callMethod(t4, _s4_, [null, 0], t3); + t4 = new A.WasmDatabase0(t2, dbPtr); + if (result !== 0) { + exception = A.createExceptionRaw(t1, t4, result, "opening the database", null, null); + A._asInt(A._asDouble(A.callMethod(t2._sqlite3_close_v2, _s4_, [null, dbPtr], t3))); + throw A.wrapException(exception); + } + A._asInt(A._asDouble(A.callMethod(t2._sqlite3_extended_result_codes, _s4_, [null, dbPtr, 1], t3))); + t2 = A._setArrayType([], type$.JSArray_MultiStreamController_SqliteUpdate); + t3 = new A.FinalizableDatabase(t1, t4, A._setArrayType([], type$.JSArray_FinalizableStatement)); + t2 = new A.DatabaseImplementation(t1, t4, t3, t2); + t4 = $.$get$disposeFinalizer(); + t4.$ti._precomputed1._as(t3); + t1 = t4._registry; + if (t1 != null) + t1.register(t2, t3, t2); + return t2; + }, + $isCommonSqlite3: 1 + }; + A.FinalizableStatement.prototype = { + dispose$0() { + var t1, _this = this; + if (!_this._closed) { + _this._closed = true; + _this._reset$0(); + t1 = _this.statement; + t1.deallocateArguments$0(); + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_finalize, "call", [null, t1.stmt], type$.nullable_Object))); + } + }, + _reset$0() { + if (!this._inResetState) { + var t1 = this.statement; + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_reset, "call", [null, t1.stmt], type$.nullable_Object))); + this._inResetState = true; + } + } + }; + A.StatementImplementation.prototype = { + get$_columnNames() { + var columnCount, t3, t4, t5, t6, i, t7, namePtr, t8, + t1 = this.statement, + t2 = t1.bindings; + t1 = t1.stmt; + columnCount = A._asInt(A._asDouble(A.callMethod(t2._sqlite3_column_count, "call", [null, t1], type$.nullable_Object))); + t3 = A._setArrayType([], type$.JSArray_String); + for (t4 = type$.List_int, t5 = type$.NativeByteBuffer, t6 = t2._sqlite3_column_name, t2 = t2.memory, i = 0; i < columnCount; ++i) { + t7 = [null, t1, i]; + A.assertInteropArgs(t7); + namePtr = A._asInt(A._asDouble(t6.call.apply(t6, t7))); + if (A.assertTest(namePtr !== 0)) + A.assertThrow("Null pointer dereference"); + t7 = t5._as(t2.buffer); + t8 = A.WrappedMemory_strlen(t2, namePtr); + t7 = t4._as(new Uint8Array(t7, namePtr, t8)); + t3.push(new A._Utf8Decoder(false)._convertGeneral$4(t7, 0, null, true)); + } + return t3; + }, + get$_tableNames() { + return null; + }, + _reset$0() { + var t1 = this.finalizable; + t1._reset$0(); + t1.statement.deallocateArguments$0(); + }, + _execute$0() { + var t4, result, _this = this, + t1 = _this.finalizable._inResetState = false, + t2 = _this.statement, + t3 = t2.stmt; + t2 = t2.bindings._sqlite3_step; + t4 = type$.nullable_Object; + do + result = A._asInt(A._asDouble(A.callMethod(t2, "call", [null, t3], t4))); + while (result === 100); + if (result !== 0 ? result !== 101 : t1) + A.throwException(_this.database, result, "executing statement", _this.sql, _this._latestArguments); + }, + _selectResults$0() { + var t2, t3, t4, columnCount, t5, resultCode, i, names, _this = this, + rows = A._setArrayType([], type$.JSArray_List_nullable_Object), + t1 = _this.finalizable._inResetState = false; + for (t2 = _this.statement, t3 = t2.bindings, t2 = t2.stmt, t4 = t3._sqlite3_step, t3 = t3._sqlite3_column_count, columnCount = -1; t5 = [null, t2], A.assertInteropArgs(t5), resultCode = A._asInt(A._asDouble(t4.call.apply(t4, t5))), resultCode === 100;) { + if (columnCount === -1) { + t5 = [null, t2]; + A.assertInteropArgs(t5); + columnCount = A._asInt(A._asDouble(t3.call.apply(t3, t5))); + } + A.assertHelper(columnCount >= 0); + t5 = []; + for (i = 0; i < columnCount; ++i) + t5.push(_this._readValue$1(i)); + B.JSArray_methods.add$1(rows, t5); + } + if (resultCode !== 0 ? resultCode !== 101 : t1) + A.throwException(_this.database, resultCode, "selecting from statement", _this.sql, _this._latestArguments); + names = _this.get$_columnNames(); + _this.get$_tableNames(); + t1 = new A.ResultSet(rows, names, B.Map_empty0); + t1._calculateIndexes$0(); + return t1; + }, + _readValue$1(index) { + var t3, _this, $length, _s4_ = "call", + t1 = this.statement, + t2 = t1.bindings; + t1 = t1.stmt; + t3 = type$.nullable_Object; + switch (A._asInt(A._asDouble(A.callMethod(t2._sqlite3_column_type, _s4_, [null, t1, index], t3)))) { + case 1: + _this = type$.JavaScriptBigInt._as(t2._sqlite3_column_int64.call(null, t1, index)); + return -9007199254740992 <= _this && _this <= 9007199254740992 ? A._asInt(A._asDouble(self.Number(_this))) : A._BigIntImpl_parse(A._asString(type$.JSObject._as(new self.Object(_this)).toString()), null); + case 2: + return A._asDouble(t2._sqlite3_column_double.call(null, t1, index)); + case 3: + return A.WrappedMemory_readString(t2.memory, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_column_text, _s4_, [null, t1, index], t3))), null); + case 4: + $length = A._asInt(A._asDouble(A.callMethod(t2._sqlite3_column_bytes, _s4_, [null, t1, index], t3))); + return A.WrappedMemory_copyRange(t2.memory, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_column_blob, _s4_, [null, t1, index], t3))), $length); + case 5: + default: + return null; + } + }, + _bindIndexedParams$1(params) { + var i, + $length = params.length, + t1 = this.statement, + count = A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_bind_parameter_count, "call", [null, t1.stmt], type$.nullable_Object))); + if ($length !== count) + A.throwExpression(A.ArgumentError$value(params, "parameters", "Expected " + count + " parameters, got " + $length)); + t1 = params.length; + if (t1 === 0) + return; + for (i = 1; i <= params.length; ++i) + this._bindParam$2(params[i - 1], i); + this._latestArguments = params; + }, + _bindParam$2(param, i) { + var t1, t2, encoded, ptr, t3, _this = this, _null = null, _s4_ = "call"; + $label0$0: { + if (param == null) { + t1 = _this.statement; + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_bind_null, _s4_, [null, t1.stmt, i], type$.nullable_Object))); + t1 = _null; + break $label0$0; + } + if (A._isInt(param)) { + t1 = _this.statement; + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_bind_int64, _s4_, [null, t1.stmt, i, type$.JavaScriptBigInt._as(self.BigInt(param))], type$.nullable_Object))); + t1 = _null; + break $label0$0; + } + if (param instanceof A._BigIntImpl) { + t1 = _this.statement; + t2 = A.BigIntRangeCheck_get_checkRange(param).toString$0(0); + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_bind_int64, _s4_, [null, t1.stmt, i, type$.JavaScriptBigInt._as(self.BigInt(t2))], type$.nullable_Object))); + t1 = _null; + break $label0$0; + } + if (A._isBool(param)) { + t1 = _this.statement; + t2 = param ? 1 : 0; + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_bind_int64, _s4_, [null, t1.stmt, i, type$.JavaScriptBigInt._as(self.BigInt(t2))], type$.nullable_Object))); + t1 = _null; + break $label0$0; + } + if (typeof param == "number") { + t1 = _this.statement; + A._asInt(A._asDouble(A.callMethod(t1.bindings._sqlite3_bind_double, _s4_, [null, t1.stmt, i, param], type$.nullable_Object))); + t1 = _null; + break $label0$0; + } + if (typeof param == "string") { + t1 = _this.statement; + encoded = B.C_Utf8Encoder.convert$1(param); + t2 = t1.bindings; + ptr = t2.allocateBytes$1(encoded); + B.JSArray_methods.add$1(t1._allocatedArguments, ptr); + A._asInt(A.callMethod(t2._sqlite3_bind_text, _s4_, [null, t1.stmt, i, ptr, encoded.length, 0], type$.double)); + t1 = _null; + break $label0$0; + } + t1 = type$.List_int; + if (t1._is(param)) { + t2 = _this.statement; + t1._as(param); + t1 = t2.bindings; + ptr = t1.allocateBytes$1(param); + B.JSArray_methods.add$1(t2._allocatedArguments, ptr); + t3 = J.get$length$asx(param); + A._asInt(A.callMethod(t1._sqlite3_bind_blob64, _s4_, [null, t2.stmt, i, ptr, type$.JavaScriptBigInt._as(self.BigInt(t3)), 0], type$.double)); + t1 = _null; + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$value(param, "params[" + i + "]", "Allowed parameters must either be null or bool, int, num, String or List.")); + } + return t1; + }, + _bindParams$1(parameters) { + $label0$0: { + this._bindIndexedParams$1(parameters.parameters); + break $label0$0; + } + }, + dispose$0() { + var t2, + t1 = this.finalizable; + if (!t1._closed) { + $.$get$disposeFinalizer().detach$1(this); + t1.dispose$0(); + t2 = this.database; + if (!t2._isClosed) + B.JSArray_methods.remove$1(t2.finalizable._statements, t1); + } + }, + selectWith$1(parameters) { + var _this = this; + if (_this.finalizable._closed) + A.throwExpression(A.StateError$(string$.Tried_)); + _this._reset$0(); + _this._bindParams$1(parameters); + return _this._selectResults$0(); + }, + executeWith$1(parameters) { + var _this = this; + if (_this.finalizable._closed) + A.throwExpression(A.StateError$(string$.Tried_)); + _this._reset$0(); + _this._bindParams$1(parameters); + _this._execute$0(); + } + }; + A.Cursor.prototype = { + _calculateIndexes$0() { + var t2, t3, _i, column, + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.int); + for (t2 = this._result_set$_columnNames, t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + column = t2[_i]; + t1.$indexSet(0, column, B.JSArray_methods.lastIndexOf$1(t2, column)); + } + this.set$_calculatedIndexes(t1); + }, + set$_calculatedIndexes(_calculatedIndexes) { + this._calculatedIndexes = type$.Map_String_int._as(_calculatedIndexes); + } + }; + A.ResultSet.prototype = { + get$iterator(_) { + return new A._ResultIterator(this); + }, + $index(_, index) { + var t1 = this.rows; + if (!(index >= 0 && index < t1.length)) + return A.ioore(t1, index); + return new A.Row(this, A.List_List$unmodifiable(t1[index], type$.nullable_Object)); + }, + $indexSet(_, index, value) { + type$.Row._as(value); + throw A.wrapException(A.UnsupportedError$("Can't change rows from a result set")); + }, + get$length(_) { + return this.rows.length; + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.Row.prototype = { + $index(_, key) { + var t1, index; + if (typeof key != "string") { + if (A._isInt(key)) { + t1 = this._data; + if (key >>> 0 !== key || key >= t1.length) + return A.ioore(t1, key); + return t1[key]; + } + return null; + } + index = this._result._calculatedIndexes.$index(0, key); + if (index == null) + return null; + t1 = this._data; + if (index >>> 0 !== index || index >= t1.length) + return A.ioore(t1, index); + return t1[index]; + }, + get$keys() { + return this._result._result_set$_columnNames; + }, + get$values() { + return this._data; + }, + $isMap: 1 + }; + A._ResultIterator.prototype = { + get$current() { + var t1 = this.result, + t2 = t1.rows, + t3 = this.index; + if (!(t3 >= 0 && t3 < t2.length)) + return A.ioore(t2, t3); + return new A.Row(t1, A.List_List$unmodifiable(t2[t3], type$.nullable_Object)); + }, + moveNext$0() { + return ++this.index < this.result.rows.length; + }, + $isIterator: 1 + }; + A._ResultSet_Cursor_ListMixin.prototype = {}; + A._ResultSet_Cursor_ListMixin_NonGrowableListMixin.prototype = {}; + A._Row_Object_UnmodifiableMapMixin.prototype = {}; + A._Row_Object_UnmodifiableMapMixin_MapMixin.prototype = {}; + A.OpenMode.prototype = { + _enumToString$0() { + return "OpenMode." + this._core$_name; + } + }; + A.CommonPreparedStatement.prototype = {}; + A.IndexedParameters.prototype = {$isStatementParameters: 1}; + A.VfsException.prototype = { + toString$0(_) { + return "VfsException(" + this.returnCode + ")"; + }, + $isException: 1 + }; + A.Sqlite3Filename.prototype = {}; + A.VirtualFileSystem.prototype = {}; + A.BaseVirtualFileSystem.prototype = { + xRandomness$1(target) { + var t1, t2, i; + for (t1 = target.length, t2 = this.random, i = 0; i < t1; ++i) + target[i] = t2.nextInt$1(256); + } + }; + A.BaseVfsFile.prototype = { + get$xDeviceCharacteristics() { + return 0; + }, + xRead$2(target, fileOffset) { + var bytesRead = this.readInto$2(target, fileOffset), + t1 = target.length; + if (bytesRead < t1) { + B.NativeUint8List_methods.fillRange$3(target, bytesRead, t1, 0); + throw A.wrapException(B.VfsException_522); + } + }, + $isVirtualFileSystemFile: 1 + }; + A.WasmSqliteBindings.prototype = {}; + A.WasmDatabase0.prototype = {}; + A.WasmStatementCompiler.prototype = { + close$0() { + var _this = this, _s4_ = "call", + t1 = _this.database.bindings._free, + t2 = type$.nullable_Object; + A.callMethod(t1, _s4_, [null, _this.sql], t2); + A.callMethod(t1, _s4_, [null, _this.stmtOut], t2); + A.callMethod(t1, _s4_, [null, _this.pzTail], t2); + }, + sqlite3_prepare$3(byteOffset, $length, prepFlag) { + var _this = this, + t1 = _this.database, + t2 = t1.bindings, + t3 = _this.stmtOut, + result = A._asInt(A.callMethod(t2._sqlite3_prepare_v3, "call", [null, t1.db, _this.sql + byteOffset, $length, prepFlag, t3, _this.pzTail], type$.double)), + stmt = A.WrappedMemory_int32ValueOfPointer(t2.memory, t3), + libraryStatement = stmt === 0 ? null : new A.WasmStatement(stmt, t2, A._setArrayType([], type$.JSArray_int)); + return new A.SqliteResult(result, libraryStatement, type$.SqliteResult_nullable_RawSqliteStatement); + } + }; + A.WasmStatement.prototype = { + deallocateArguments$0() { + var t1, t2, t3, _i, t4; + for (t1 = this._allocatedArguments, t2 = t1.length, t3 = this.bindings._free, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + t4 = [null, t1[_i]]; + A.assertInteropArgs(t4); + t3.call.apply(t3, t4); + } + B.JSArray_methods.clear$0(t1); + } + }; + A.WasmContext.prototype = {}; + A.WasmValue.prototype = {}; + A.WasmValueList.prototype = { + $index(_, index) { + var t1 = this.bindings; + return new A.WasmValue(t1, A.WrappedMemory_int32ValueOfPointer(t1.memory, this.value + index * 4)); + }, + $indexSet(_, index, value) { + type$.WasmValue._as(value); + throw A.wrapException(A.UnsupportedError$("Setting element in WasmValueList")); + }, + get$length(receiver) { + return this.length; + } + }; + A.AsyncJavaScriptIteratable.prototype = { + listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) { + var iterator, controller, _null = null, t1 = {}, + t2 = this.$ti; + t2._eval$1("~(1)?")._as(onData); + type$.nullable_void_Function._as(onDone); + iterator = type$.JSObject._as(A.JSObjectUnsafeUtilExtension__callMethod(this._jsObject, type$.JavaScriptSymbol._as(self.Symbol.asyncIterator), _null, _null, _null, _null)); + controller = A.StreamController_StreamController(_null, _null, true, t2._precomputed1); + t1.currentlyPendingPromise = null; + t2 = new A.AsyncJavaScriptIteratable_listen_fetchNext(t1, this, iterator, controller); + controller.set$onListen(t2); + controller.set$onResume(new A.AsyncJavaScriptIteratable_listen_fetchNextIfNecessary(t1, controller, t2)); + return new A._ControllerStream(controller, A._instanceType(controller)._eval$1("_ControllerStream<1>")).listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError); + }, + listen$3$onDone$onError(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + } + }; + A.AsyncJavaScriptIteratable_listen_fetchNext.prototype = { + call$0() { + var t2, currentlyPendingPromise, t3, _this = this, + t1 = _this._box_0; + A.assertHelper(t1.currentlyPendingPromise == null); + t2 = type$.JSObject; + currentlyPendingPromise = t2._as(_this.iterator.next()); + t1.currentlyPendingPromise = currentlyPendingPromise; + t3 = _this.controller; + A.promiseToFuture(currentlyPendingPromise, t2).then$1$2$onError(new A.AsyncJavaScriptIteratable_listen_fetchNext_closure(t1, _this.$this, t3, _this), t3.get$addError(), type$.Null); + }, + $signature: 0 + }; + A.AsyncJavaScriptIteratable_listen_fetchNext_closure.prototype = { + call$1(result) { + var t1, t2, value, t3, _this = this; + type$.JSObject._as(result); + t1 = A._asBoolQ(result.done); + if (t1 == null) + t1 = null; + t2 = _this.$this.$ti; + value = t2._eval$1("1?")._as(result.value); + t3 = _this.controller; + if (t1 === true) { + t3.close$0(); + _this._box_0.currentlyPendingPromise = null; + } else { + t3.add$1(0, value == null ? t2._precomputed1._as(value) : value); + _this._box_0.currentlyPendingPromise = null; + t1 = t3._async$_state; + if (!((t1 & 1) !== 0 ? (t3.get$_subscription()._async$_state & 4) !== 0 : (t1 & 2) === 0)) + _this.fetchNext.call$0(); + } + }, + $signature: 9 + }; + A.AsyncJavaScriptIteratable_listen_fetchNextIfNecessary.prototype = { + call$0() { + var t1, t2; + if (this._box_0.currentlyPendingPromise == null) { + t1 = this.controller; + t2 = t1._async$_state; + t1 = !((t2 & 1) !== 0 ? (t1.get$_subscription()._async$_state & 4) !== 0 : (t2 & 2) === 0); + } else + t1 = false; + if (t1) + this.fetchNext.call$0(); + }, + $signature: 0 + }; + A._CursorReader.prototype = { + cancel$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$cancel$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._onSuccess; + if (t1 != null) + t1.cancel$0(); + t1 = $async$self._indexed_db0$_onError; + if (t1 != null) + t1.cancel$0(); + $async$self._indexed_db0$_onError = $async$self._onSuccess = null; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$cancel$0, $async$completer); + }, + get$current() { + var t1 = this._cursor; + return t1 == null ? A.throwExpression(A.StateError$("Await moveNext() first")) : t1; + }, + moveNext$0() { + var t1, completer, t2, t3, t4, _this = this; + if (A.assertTest(_this._onSuccess == null && _this._indexed_db0$_onError == null)) + A.assertThrow("moveNext() called twice"); + t1 = _this._cursor; + if (t1 != null) + t1.continue(); + t1 = new A._Future($.Zone__current, type$._Future_bool); + completer = new A._SyncCompleter(t1, type$._SyncCompleter_bool); + t2 = _this._cursorRequest; + t3 = type$.nullable_void_Function_JSObject; + t4 = type$.JSObject; + _this._onSuccess = A._EventStreamSubscription$(t2, "success", t3._as(new A._CursorReader_moveNext_closure(_this, completer)), false, t4); + _this._indexed_db0$_onError = A._EventStreamSubscription$(t2, "error", t3._as(new A._CursorReader_moveNext_closure0(_this, completer)), false, t4); + return t1; + }, + set$_cursor(_cursor) { + this._cursor = this.$ti._eval$1("1?")._as(_cursor); + } + }; + A._CursorReader_moveNext_closure.prototype = { + call$1($event) { + var t1 = this.$this; + t1.cancel$0(); + t1.set$_cursor(t1.$ti._eval$1("1?")._as(t1._cursorRequest.result)); + this.completer.complete$1(t1._cursor != null); + }, + $signature: 1 + }; + A._CursorReader_moveNext_closure0.prototype = { + call$1($event) { + var t1 = this.$this; + t1.cancel$0(); + t1 = type$.nullable_JSObject._as(t1._cursorRequest.error); + if (t1 == null) + t1 = $event; + this.completer.completeError$1(t1); + }, + $signature: 1 + }; + A.CompleteIdbRequest_complete_closure.prototype = { + call$1($event) { + this.completer.complete$1(this.T._as(this._this.result)); + }, + $signature: 1 + }; + A.CompleteIdbRequest_complete_closure0.prototype = { + call$1($event) { + var t1 = type$.nullable_JSObject._as(this._this.error); + if (t1 == null) + t1 = $event; + this.completer.completeError$1(t1); + }, + $signature: 1 + }; + A.CompleteOpenIdbRequest_completeOrBlocked_closure.prototype = { + call$1($event) { + this.completer.complete$1(this.T._as(this._this.result)); + }, + $signature: 1 + }; + A.CompleteOpenIdbRequest_completeOrBlocked_closure0.prototype = { + call$1($event) { + var t1 = type$.nullable_JSObject._as(this._this.error); + if (t1 == null) + t1 = $event; + this.completer.completeError$1(t1); + }, + $signature: 1 + }; + A.CompleteOpenIdbRequest_completeOrBlocked_closure1.prototype = { + call$1($event) { + var t1 = type$.nullable_JSObject._as(this._this.error); + if (t1 == null) + t1 = $event; + this.completer.completeError$1(t1); + }, + $signature: 1 + }; + A.WasmInstance.prototype = { + WasmInstance$_$1(nativeInstance) { + var t4, t5, t6, key, value, + t1 = self, + t2 = type$.JSObject, + t3 = type$.JSArray_nullable_Object._as(t1.Object.keys(t2._as(nativeInstance.exports))); + t3 = B.JSArray_methods.get$iterator(t3); + t4 = type$.JavaScriptFunction; + t5 = this.globals; + t6 = this.functions; + for (; t3.moveNext$0();) { + key = A._asString(t3.get$current()); + value = t2._as(nativeInstance.exports)[key]; + if (typeof value === "function") + t6.$indexSet(0, key, t4._as(value)); + else if (value instanceof t4._as(t1.WebAssembly.Global)) + t5.$indexSet(0, key, t2._as(value)); + } + } + }; + A.WasmInstance_load_closure.prototype = { + call$2(module, moduleImports) { + var _this; + A._asString(module); + type$.Map_of_String_and_nullable_Object._as(moduleImports); + _this = {}; + this.importsJs[module] = _this; + moduleImports.forEach$1(0, new A.WasmInstance_load__closure(_this)); + }, + $signature: 66 + }; + A.WasmInstance_load__closure.prototype = { + call$2($name, value) { + this.moduleJs[A._asString($name)] = value; + }, + $signature: 67 + }; + A.WasmSqlite3.prototype = {}; + A.WasmVfs.prototype = { + _runInWorker$2$2(operation, requestData, Req, Res) { + var t2, t3, rc, + _s12_ = "_runInWorker", + t1 = type$.Message; + A.checkTypeBound(Req, t1, "Req", _s12_); + A.checkTypeBound(Res, t1, "Res", _s12_); + Req._eval$1("@<0>")._bind$1(Res)._eval$1("WorkerOperation<1,2>")._as(operation); + t1 = this.serializer; + t1.write$1(Req._as(requestData)); + t2 = this.synchronizer.int32View; + t3 = self; + A._asInt(t3.Atomics.store(t2, 1, -1)); + A._asInt(t3.Atomics.store(t2, 0, operation.index)); + A.Atomics_notify(t2, 0); + A._asString(t3.Atomics.wait(t2, 1, -1)); + rc = A._asInt(t3.Atomics.load(t2, 1)); + if (rc !== 0) + throw A.wrapException(A.VfsException$(rc)); + return operation.readResponse.call$1(t1); + }, + xAccess$2(path, flags) { + return this._runInWorker$2$2(B.WorkerOperation_Gkh, new A.NameAndInt32Flags(path, flags, 0, 0), type$.NameAndInt32Flags, type$.Flags).flag0; + }, + xDelete$2(path, syncDir) { + this._runInWorker$2$2(B.WorkerOperation_AxI, new A.NameAndInt32Flags(path, syncDir, 0, 0), type$.NameAndInt32Flags, type$.EmptyMessage); + }, + xFullPathName$1(path) { + var resolved = this.pathContext.absolute$1(path); + if ($.$get$context()._isWithinOrEquals$2("/", resolved) !== B._PathRelation_within) + throw A.wrapException(B.VfsException_14); + return resolved; + }, + xOpen$2(path, flags) { + var filePath = path.path, + result = this._runInWorker$2$2(B.WorkerOperation_readNameAndFlags_readFlags_2_xOpen, new A.NameAndInt32Flags(filePath == null ? A.GenerateFilename_randomFileName(this.random, "/") : filePath, flags, 0, 0), type$.NameAndInt32Flags, type$.Flags); + return new A._Record_2_file_outFlags(new A.WasmFile(this, result.flag1), result.flag0); + }, + xSleep$1(duration) { + this._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_5_xSleep, new A.Flags(B.JSInt_methods._tdivFast$1(duration._duration, 1000), 0, 0), type$.Flags, type$.EmptyMessage); + }, + close$0() { + var t1 = type$.EmptyMessage; + this._runInWorker$2$2(B.WorkerOperation_readEmpty_readEmpty_12_stopServer, B.C_EmptyMessage, t1, t1); + } + }; + A.WasmFile.prototype = { + get$xDeviceCharacteristics() { + return 2048; + }, + readInto$2(buffer, offset) { + var t1, t2, t3, t4, t5, t6, t7, totalBytesRead, bytesToRead, bytesRead, t8, t9, + remainingBytes = buffer.length; + for (t1 = type$.JSObject, t2 = this.vfs, t3 = this.fd, t4 = type$.Flags, t5 = t2.serializer.buffer, t6 = type$.JavaScriptFunction, t7 = type$.NativeUint8List, totalBytesRead = 0; remainingBytes > 0;) { + bytesToRead = Math.min(65536, remainingBytes); + remainingBytes -= bytesToRead; + bytesRead = t2._runInWorker$2$2(B.WorkerOperation_readFlags_readFlags_3_xRead, new A.Flags(t3, offset + totalBytesRead, bytesToRead), t4, t4).flag0; + t8 = t6._as(self.Uint8Array); + t9 = [t5]; + t9.push(0); + t9.push(bytesRead); + A.JSObjectUnsafeUtilExtension__callMethod(buffer, "set", t7._as(A.callConstructor(t8, t9, t1)), totalBytesRead, null, null); + totalBytesRead += bytesRead; + if (bytesRead < bytesToRead) + break; + } + return totalBytesRead; + }, + xCheckReservedLock$0() { + return this.lockStatus !== 0 ? 1 : 0; + }, + xClose$0() { + this.vfs._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_6_xClose, new A.Flags(this.fd, 0, 0), type$.Flags, type$.EmptyMessage); + }, + xFileSize$0() { + var t1 = type$.Flags; + return this.vfs._runInWorker$2$2(B.WorkerOperation_readFlags_readFlags_7_xFileSize, new A.Flags(this.fd, 0, 0), t1, t1).flag0; + }, + xLock$1(mode) { + var _this = this; + if (_this.lockStatus === 0) + _this.vfs._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_10_xLock, new A.Flags(_this.fd, mode, 0), type$.Flags, type$.EmptyMessage); + _this.lockStatus = mode; + }, + xSync$1(flags) { + this.vfs._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_8_xSync, new A.Flags(this.fd, 0, 0), type$.Flags, type$.EmptyMessage); + }, + xTruncate$1(size) { + this.vfs._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_9_xTruncate, new A.Flags(this.fd, size, 0), type$.Flags, type$.EmptyMessage); + }, + xUnlock$1(mode) { + if (this.lockStatus !== 0 && mode === 0) + this.vfs._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_11_xUnlock, new A.Flags(this.fd, mode, 0), type$.Flags, type$.EmptyMessage); + }, + xWrite$2(buffer, fileOffset) { + var t1, t2, t3, t4, t5, totalBytesWritten, bytesToWrite, subBuffer, t6, t7, + remainingBytes = buffer.length; + for (t1 = this.vfs, t2 = t1.serializer.byteView, t3 = this.fd, t4 = type$.Flags, t5 = type$.EmptyMessage, totalBytesWritten = 0; remainingBytes > 0;) { + bytesToWrite = Math.min(65536, remainingBytes); + if (bytesToWrite === remainingBytes) + subBuffer = buffer; + else { + t6 = buffer.buffer; + t7 = buffer.byteOffset; + subBuffer = new Uint8Array(t6, t7, bytesToWrite); + } + A.JSObjectUnsafeUtilExtension__callMethod(t2, "set", subBuffer, 0, null, null); + t1._runInWorker$2$2(B.WorkerOperation_readFlags_readEmpty_4_xWrite, new A.Flags(t3, fileOffset + totalBytesWritten, bytesToWrite), t4, t5); + totalBytesWritten += bytesToWrite; + remainingBytes -= bytesToWrite; + } + } + }; + A.RequestResponseSynchronizer.prototype = {}; + A.MessageSerializer.prototype = { + write$1(message) { + var t1, encoded; + if (!(message instanceof A.EmptyMessage)) + if (message instanceof A.Flags) { + t1 = this.dataView; + B.NativeByteData_methods._setInt32$3(t1, 0, message.flag0, false); + B.NativeByteData_methods._setInt32$3(t1, 4, message.flag1, false); + B.NativeByteData_methods._setInt32$3(t1, 8, message.flag2, false); + if (message instanceof A.NameAndInt32Flags) { + encoded = B.C_Utf8Encoder.convert$1(message.name); + B.NativeByteData_methods._setInt32$3(t1, 12, encoded.length, false); + B.NativeUint8List_methods.setAll$2(this.byteView, 16, encoded); + } + } else + throw A.wrapException(A.UnsupportedError$("Message " + message.toString$0(0))); + } + }; + A.WorkerOperation.prototype = { + _enumToString$0() { + return "WorkerOperation." + this._core$_name; + }, + readRequest$1(arg0) { + return this.readRequest.call$1(arg0); + } + }; + A.Message0.prototype = {}; + A.EmptyMessage.prototype = {}; + A.Flags.prototype = {}; + A.NameAndInt32Flags.prototype = {}; + A._ResolvedPath.prototype = {}; + A.VfsWorker.prototype = { + _resolvePath$2$createDirectories(absolutePath, createDirectories) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$._ResolvedPath), + $async$returnValue, $async$self = this, t2, $directories, file, dirHandle, _i, t1, fullPath, _0_0, _0_1; + var $async$_resolvePath$2$createDirectories = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $.$get$url(); + fullPath = t1.relative$2$from(absolutePath, "/"); + _0_0 = t1.split$1(0, fullPath); + _0_1 = _0_0.length; + t1 = _0_1 >= 1; + if (t1) { + t2 = _0_1 - 1; + $directories = B.JSArray_methods.sublist$2(_0_0, 0, t2); + if (!(t2 >= 0 && t2 < _0_0.length)) { + $async$returnValue = A.ioore(_0_0, t2); + // goto return + $async$goto = 1; + break; + } + file = _0_0[t2]; + } else { + $directories = null; + file = null; + } + if (!t1) + throw A.wrapException(A.StateError$("Pattern matching error")); + dirHandle = $async$self.root; + t1 = $directories.length, t2 = type$.JSObject, _i = 0; + case 3: + // for condition + if (!(_i < $directories.length)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(A.promiseToFuture(t2._as(dirHandle.getDirectoryHandle($directories[_i], {create: createDirectories})), t2), $async$_resolvePath$2$createDirectories); + case 6: + // returning from await. + dirHandle = $async$result; + case 4: + // for update + $directories.length === t1 || (0, A.throwConcurrentModificationError)($directories), ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = new A._ResolvedPath(fullPath, dirHandle, file); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_resolvePath$2$createDirectories, $async$completer); + }, + _resolvePath$1(absolutePath) { + return this._resolvePath$2$createDirectories(absolutePath, false); + }, + _xAccess$1(flags) { + return this._xAccess$body$VfsWorker(flags); + }, + _xAccess$body$VfsWorker(flags) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Flags), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, resolved, t1, t2, exception, $async$exception; + var $async$_xAccess$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait($async$self._resolvePath$1(flags.name), $async$_xAccess$1); + case 7: + // returning from await. + resolved = $async$result; + t1 = resolved; + t2 = type$.JSObject; + $async$goto = 8; + return A._asyncAwait(A.promiseToFuture(t2._as(t1.directory.getFileHandle(t1.filename, {create: false})), t2), $async$_xAccess$1); + case 8: + // returning from await. + $async$returnValue = new A.Flags(1, 0, 0); + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + $async$returnValue = new A.Flags(0, 0, 0); + // goto return + $async$goto = 1; + break; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_xAccess$1, $async$completer); + }, + _xDelete$1(options) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$handler = 1, $async$currentError, $async$self = this, e, exception, resolved, $async$exception; + var $async$_xDelete$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self._resolvePath$1(options.name), $async$_xDelete$1); + case 2: + // returning from await. + resolved = $async$result; + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait(A.FileSystemDirectoryHandleApi_remove(resolved.directory, resolved.filename), $async$_xDelete$1); + case 7: + // returning from await. + $async$handler = 1; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + e = A.unwrapException($async$exception); + A.S(e); + throw A.wrapException(B.VfsException_2570); + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 1; + break; + case 6: + // after finally + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_xDelete$1, $async$completer); + }, + _xOpen$1(req) { + return this._xOpen$body$VfsWorker(req); + }, + _xOpen$body$VfsWorker(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Flags), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, exception, t1, t2, t3, fileHandle, readonly, flags, create, resolved, $async$exception; + var $async$_xOpen$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + flags = req.flag0; + create = (flags & 4) !== 0; + resolved = null; + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait($async$self._resolvePath$2$createDirectories(req.name, create), $async$_xOpen$1); + case 7: + // returning from await. + resolved = $async$result; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.VfsException$(12); + throw A.wrapException(t1); + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + t1 = resolved; + t2 = A._asBool(create); + t3 = type$.JSObject; + $async$goto = 8; + return A._asyncAwait(A.promiseToFuture(t3._as(t1.directory.getFileHandle(t1.filename, {create: t2})), t3), $async$_xOpen$1); + case 8: + // returning from await. + fileHandle = $async$result; + readonly = !A.boolConversionCheck(create) && (flags & 1) !== 0; + t1 = $async$self._fdCounter++; + t2 = resolved.directory; + $async$self._openFiles.$indexSet(0, t1, new A._OpenedFileHandle(t1, readonly, (flags & 8) !== 0, resolved.fullPath, t2, resolved.filename, fileHandle)); + $async$returnValue = new A.Flags(readonly ? 1 : 0, t1, 0); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_xOpen$1, $async$completer); + }, + _xRead$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Flags), + $async$returnValue, $async$self = this, bufferLength, t1, $async$temp1, $async$temp2; + var $async$_xRead$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._openFiles.$index(0, req.flag0); + t1.toString; + bufferLength = req.flag2; + A.assertHelper(bufferLength <= 65536); + $async$temp1 = A; + $async$temp2 = A; + $async$goto = 3; + return A._asyncAwait($async$self._openForSynchronousAccess$1(t1), $async$_xRead$1); + case 3: + // returning from await. + $async$returnValue = new $async$temp1.Flags($async$temp2.FileSystemSyncAccessHandleApi_readDart($async$result, A.SharedArrayBuffer_asUint8ListSlice($async$self.messages.buffer, 0, bufferLength), {at: req.flag1}), 0, 0); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_xRead$1, $async$completer); + }, + _xWrite$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.EmptyMessage), + $async$returnValue, $async$self = this, bufferLength, t1, $async$temp1; + var $async$_xWrite$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._openFiles.$index(0, req.flag0); + t1.toString; + bufferLength = req.flag2; + A.assertHelper(bufferLength <= 65536); + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait($async$self._openForSynchronousAccess$1(t1), $async$_xWrite$1); + case 3: + // returning from await. + if ($async$temp1.FileSystemSyncAccessHandleApi_writeDart($async$result, A.SharedArrayBuffer_asUint8ListSlice($async$self.messages.buffer, 0, bufferLength), {at: req.flag1}) !== bufferLength) + throw A.wrapException(B.VfsException_778); + $async$returnValue = B.C_EmptyMessage; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_xWrite$1, $async$completer); + }, + _xClose$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, file; + var $async$_xClose$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + file = $async$self._openFiles.remove$1(0, req.flag0); + $async$self._implicitlyHeldLocks.remove$1(0, file); + if (file == null) + throw A.wrapException(B.VfsException_12); + $async$self._closeSyncHandle$1(file); + $async$goto = file.deleteOnClose ? 2 : 3; + break; + case 2: + // then + $async$goto = 4; + return A._asyncAwait(A.FileSystemDirectoryHandleApi_remove(file.directory, file.filename), $async$_xClose$1); + case 4: + // returning from await. + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_xClose$1, $async$completer); + }, + _xFileSize$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Flags), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, file, syncHandle, size, t1; + var $async$_xFileSize$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._openFiles.$index(0, req.flag0); + t1.toString; + file = t1; + $async$handler = 3; + $async$goto = 6; + return A._asyncAwait($async$self._openForSynchronousAccess$1(file), $async$_xFileSize$1); + case 6: + // returning from await. + syncHandle = $async$result; + size = A._asInt(syncHandle.getSize()); + $async$returnValue = new A.Flags(size, 0, 0); + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + t1 = type$._OpenedFileHandle._as(file); + if ($async$self._implicitlyHeldLocks.remove$1(0, t1)) + $async$self._closeSyncHandleNoThrow$1(t1); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_xFileSize$1, $async$completer); + }, + _xTruncate$1(req) { + return this._xTruncate$body$VfsWorker(req); + }, + _xTruncate$body$VfsWorker(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.EmptyMessage), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, file, syncHandle, t1; + var $async$_xTruncate$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._openFiles.$index(0, req.flag0); + t1.toString; + file = t1; + if (file.readonly) + A.throwExpression(B.VfsException_8); + $async$handler = 3; + $async$goto = 6; + return A._asyncAwait($async$self._openForSynchronousAccess$1(file), $async$_xTruncate$1); + case 6: + // returning from await. + syncHandle = $async$result; + syncHandle.truncate(req.flag1); + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + t1 = type$._OpenedFileHandle._as(file); + if ($async$self._implicitlyHeldLocks.remove$1(0, t1)) + $async$self._closeSyncHandleNoThrow$1(t1); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + $async$returnValue = B.C_EmptyMessage; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_xTruncate$1, $async$completer); + }, + _xSync$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.EmptyMessage), + $async$returnValue, $async$self = this, file, syncHandle; + var $async$_xSync$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + file = $async$self._openFiles.$index(0, req.flag0); + syncHandle = file.syncHandle; + if (!file.readonly && syncHandle != null) + syncHandle.flush(); + $async$returnValue = B.C_EmptyMessage; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_xSync$1, $async$completer); + }, + _xLock$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.EmptyMessage), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, file, exception, t1, $async$exception; + var $async$_xLock$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._openFiles.$index(0, req.flag0); + t1.toString; + file = t1; + $async$goto = file.syncHandle == null ? 3 : 5; + break; + case 3: + // then + $async$handler = 7; + $async$goto = 10; + return A._asyncAwait($async$self._openForSynchronousAccess$1(file), $async$_xLock$1); + case 10: + // returning from await. + file.explicitlyLocked = true; + $async$handler = 2; + // goto after finally + $async$goto = 9; + break; + case 7: + // catch + $async$handler = 6; + $async$exception = $async$currentError; + throw A.wrapException(B.VfsException_3850); + // goto after finally + $async$goto = 9; + break; + case 6: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 9: + // after finally + // goto join + $async$goto = 4; + break; + case 5: + // else + file.explicitlyLocked = true; + case 4: + // join + $async$returnValue = B.C_EmptyMessage; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_xLock$1, $async$completer); + }, + _xUnlock$1(req) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.EmptyMessage), + $async$returnValue, $async$self = this, file; + var $async$_xUnlock$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + file = $async$self._openFiles.$index(0, req.flag0); + if (file.syncHandle != null && req.flag1 === 0) + $async$self._closeSyncHandle$1(file); + $async$returnValue = B.C_EmptyMessage; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_xUnlock$1, $async$completer); + }, + start$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, opcode, request, rc, response, e, e0, t1, t2, t3, t4, t5, t6, t7, t8, t9, opcode0, exception, t10, $async$exception; + var $async$start$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.synchronizer.int32View, t2 = $async$self.messages, t3 = $async$self._implicitlyHeldLocks, t4 = t3.$ti._precomputed1, t5 = $async$self.get$_releaseImplicitLock(), t6 = type$.Flags, t7 = type$.NameAndInt32Flags, t8 = type$.void; + case 3: + // for condition + if (!!$async$self._stopped) { + // goto after for + $async$goto = 4; + break; + } + t9 = self; + if (A._asString(t9.Atomics.wait(t1, 0, 0, 150)) === "timed-out") { + B.JSArray_methods.forEach$1(A.List_List$of(t3, true, t4), t5); + // goto for condition + $async$goto = 3; + break; + } + opcode0 = A._asInt(t9.Atomics.load(t1, 0)); + A._asInt(t9.Atomics.store(t1, 0, 0)); + if (!(opcode0 >= 0 && opcode0 < 13)) { + $async$returnValue = A.ioore(B.List_ckn, opcode0); + // goto return + $async$goto = 1; + break; + } + opcode = B.List_ckn[opcode0]; + request = null; + rc = null; + $async$handler = 6; + response = null; + request = opcode.readRequest$1(t2); + case 9: + // switch + switch (opcode) { + case B.WorkerOperation_readFlags_readEmpty_5_xSleep: + // goto case + $async$goto = 11; + break; + case B.WorkerOperation_Gkh: + // goto case + $async$goto = 12; + break; + case B.WorkerOperation_AxI: + // goto case + $async$goto = 13; + break; + case B.WorkerOperation_readNameAndFlags_readFlags_2_xOpen: + // goto case + $async$goto = 14; + break; + case B.WorkerOperation_readFlags_readFlags_3_xRead: + // goto case + $async$goto = 15; + break; + case B.WorkerOperation_readFlags_readEmpty_4_xWrite: + // goto case + $async$goto = 16; + break; + case B.WorkerOperation_readFlags_readEmpty_6_xClose: + // goto case + $async$goto = 17; + break; + case B.WorkerOperation_readFlags_readFlags_7_xFileSize: + // goto case + $async$goto = 18; + break; + case B.WorkerOperation_readFlags_readEmpty_9_xTruncate: + // goto case + $async$goto = 19; + break; + case B.WorkerOperation_readFlags_readEmpty_8_xSync: + // goto case + $async$goto = 20; + break; + case B.WorkerOperation_readFlags_readEmpty_10_xLock: + // goto case + $async$goto = 21; + break; + case B.WorkerOperation_readFlags_readEmpty_11_xUnlock: + // goto case + $async$goto = 22; + break; + case B.WorkerOperation_readEmpty_readEmpty_12_stopServer: + // goto case + $async$goto = 23; + break; + default: + // goto after switch + $async$goto = 10; + break; + } + break; + case 11: + // case + B.JSArray_methods.forEach$1(A.List_List$of(t3, true, t4), t5); + $async$goto = 24; + return A._asyncAwait(A.Future_Future$delayed(A.Duration$(0, t6._as(request).flag0), t8), $async$start$0); + case 24: + // returning from await. + response = B.C_EmptyMessage; + // goto after switch + $async$goto = 10; + break; + case 12: + // case + $async$goto = 25; + return A._asyncAwait($async$self._xAccess$1(t7._as(request)), $async$start$0); + case 25: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 13: + // case + $async$goto = 26; + return A._asyncAwait($async$self._xDelete$1(t7._as(request)), $async$start$0); + case 26: + // returning from await. + response = B.C_EmptyMessage; + // goto after switch + $async$goto = 10; + break; + case 14: + // case + $async$goto = 27; + return A._asyncAwait($async$self._xOpen$1(t7._as(request)), $async$start$0); + case 27: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 15: + // case + $async$goto = 28; + return A._asyncAwait($async$self._xRead$1(t6._as(request)), $async$start$0); + case 28: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 16: + // case + $async$goto = 29; + return A._asyncAwait($async$self._xWrite$1(t6._as(request)), $async$start$0); + case 29: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 17: + // case + $async$goto = 30; + return A._asyncAwait($async$self._xClose$1(t6._as(request)), $async$start$0); + case 30: + // returning from await. + response = B.C_EmptyMessage; + // goto after switch + $async$goto = 10; + break; + case 18: + // case + $async$goto = 31; + return A._asyncAwait($async$self._xFileSize$1(t6._as(request)), $async$start$0); + case 31: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 19: + // case + $async$goto = 32; + return A._asyncAwait($async$self._xTruncate$1(t6._as(request)), $async$start$0); + case 32: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 20: + // case + $async$goto = 33; + return A._asyncAwait($async$self._xSync$1(t6._as(request)), $async$start$0); + case 33: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 21: + // case + $async$goto = 34; + return A._asyncAwait($async$self._xLock$1(t6._as(request)), $async$start$0); + case 34: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 22: + // case + $async$goto = 35; + return A._asyncAwait($async$self._xUnlock$1(t6._as(request)), $async$start$0); + case 35: + // returning from await. + response = $async$result; + // goto after switch + $async$goto = 10; + break; + case 23: + // case + response = B.C_EmptyMessage; + $async$self._stopped = true; + B.JSArray_methods.forEach$1(A.List_List$of(t3, true, t4), t5); + // goto after switch + $async$goto = 10; + break; + case 10: + // after switch + t2.write$1(response); + rc = 0; + $async$handler = 2; + // goto after finally + $async$goto = 8; + break; + case 6: + // catch + $async$handler = 5; + $async$exception = $async$currentError; + t10 = A.unwrapException($async$exception); + if (t10 instanceof A.VfsException) { + e = t10; + A.S(e); + A.S(opcode); + A.S(request); + rc = e.returnCode; + } else { + e0 = t10; + A.S(e0); + A.S(opcode); + A.S(request); + rc = 1; + } + // goto after finally + $async$goto = 8; + break; + case 5: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 8: + // after finally + t10 = A._asInt(rc); + A._asInt(t9.Atomics.store(t1, 1, t10)); + t9.Atomics.notify(t1, 1, 1 / 0); + // goto for condition + $async$goto = 3; + break; + case 4: + // after for + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$start$0, $async$completer); + }, + _releaseImplicitLock$1(handle) { + type$._OpenedFileHandle._as(handle); + if (this._implicitlyHeldLocks.remove$1(0, handle)) + this._closeSyncHandleNoThrow$1(handle); + }, + _openForSynchronousAccess$1(file) { + return this._openForSynchronousAccess$body$VfsWorker(file); + }, + _openForSynchronousAccess$body$VfsWorker(file) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.JSObject), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, attempt, handle, t1, t2, t3, handle0, t4, exception, existing, $async$exception; + var $async$_openForSynchronousAccess$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + existing = file.syncHandle; + if (existing != null) { + $async$returnValue = existing; + // goto return + $async$goto = 1; + break; + } + attempt = 1; + t1 = file.file, t2 = type$.JSObject, t3 = $async$self._implicitlyHeldLocks; + case 3: + // for condition + // trivial condition + $async$handler = 6; + $async$goto = 9; + return A._asyncAwait(A.promiseToFuture(t2._as(t1.createSyncAccessHandle()), t2), $async$_openForSynchronousAccess$1); + case 9: + // returning from await. + handle0 = $async$result; + file.set$syncHandle(handle0); + handle = handle0; + if (!file.explicitlyLocked) + t3.add$1(0, file); + t4 = handle; + $async$returnValue = t4; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 8; + break; + case 6: + // catch + $async$handler = 5; + $async$exception = $async$currentError; + if (J.$eq$(attempt, 6)) + throw A.wrapException(B.VfsException_10); + A.S(attempt); + t4 = attempt; + if (typeof t4 !== "number") { + $async$returnValue = t4.$add(); + // goto return + $async$goto = 1; + break; + } + attempt = t4 + 1; + // goto after finally + $async$goto = 8; + break; + case 5: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 8: + // after finally + // goto for condition + $async$goto = 3; + break; + case 4: + // after for + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_openForSynchronousAccess$1, $async$completer); + }, + _closeSyncHandleNoThrow$1(handle) { + var exception; + try { + this._closeSyncHandle$1(handle); + } catch (exception) { + } + }, + _closeSyncHandle$1(handle) { + var syncHandle = handle.syncHandle; + if (syncHandle != null) { + handle.syncHandle = null; + this._implicitlyHeldLocks.remove$1(0, handle); + handle.explicitlyLocked = false; + syncHandle.close(); + } + } + }; + A._OpenedFileHandle.prototype = { + set$syncHandle(syncHandle) { + this.syncHandle = type$.nullable_JSObject._as(syncHandle); + } + }; + A.AsynchronousIndexedDbFileSystem.prototype = { + _rangeOverFile$3$endOffsetInclusive$startOffset(fileId, endOffsetInclusive, startOffset) { + var t1 = type$.JSArray_double; + return type$.JSObject._as(self.IDBKeyRange.bound(A._setArrayType([fileId, startOffset], t1), A._setArrayType([fileId, endOffsetInclusive], t1))); + }, + _rangeOverFile$1(fileId) { + return this._rangeOverFile$3$endOffsetInclusive$startOffset(fileId, 9007199254740992, 0); + }, + _rangeOverFile$2$startOffset(fileId, startOffset) { + return this._rangeOverFile$3$endOffsetInclusive$startOffset(fileId, 9007199254740992, startOffset); + }, + open$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, openRequest, t3; + var $async$open$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = new A._Future($.Zone__current, type$._Future_JSObject); + t2 = type$.JSObject; + openRequest = t2._as(type$.nullable_JSObject._as(self.indexedDB).open($async$self._dbName, 1)); + t3 = type$.JavaScriptFunction._as(A.allowInterop(new A.AsynchronousIndexedDbFileSystem_open_closure(openRequest), type$.Function)); + if (A.assertTest(typeof t3 == "function")) + A.assertThrow(string$.Dart_f); + openRequest.onupgradeneeded = t3; + new A._SyncCompleter(t1, type$._SyncCompleter_JSObject).complete$1(A.CompleteOpenIdbRequest_completeOrBlocked(openRequest, t2)); + $async$goto = 2; + return A._asyncAwait(t1, $async$open$0); + case 2: + // returning from await. + $async$self.set$_indexed_db$_database($async$result); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$open$0, $async$completer); + }, + close$0() { + var t1 = this._indexed_db$_database; + if (t1 != null) + t1.close(); + }, + listFiles$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Map_String_int), + $async$returnValue, $async$self = this, row, t2, t1, result, iterator, $async$temp1; + var $async$listFiles$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + result = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.int); + iterator = new A._CursorReader(t1._as(t1._as(t1._as(t1._as($async$self._indexed_db$_database.transaction("files", "readonly")).objectStore("files")).index("fileName")).openKeyCursor()), type$._CursorReader_JSObject); + case 3: + // for condition + $async$temp1 = A; + $async$goto = 5; + return A._asyncAwait(iterator.moveNext$0(), $async$listFiles$0); + case 5: + // returning from await. + if (!$async$temp1.boolConversionCheck($async$result)) { + // goto after for + $async$goto = 4; + break; + } + row = iterator._cursor; + if (row == null) + row = A.throwExpression(A.StateError$("Await moveNext() first")); + t1 = row.key; + t1.toString; + A._asString(t1); + t2 = row.primaryKey; + t2.toString; + result.$indexSet(0, t1, A._asInt(A._asDouble(t2))); + // goto for condition + $async$goto = 3; + break; + case 4: + // after for + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$listFiles$0, $async$completer); + }, + fileIdForPath$1(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_int), + $async$returnValue, $async$self = this, t1, $async$temp1; + var $async$fileIdForPath$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(A.CompleteIdbRequest_complete(t1._as(t1._as(t1._as(t1._as($async$self._indexed_db$_database.transaction("files", "readonly")).objectStore("files")).index("fileName")).getKey(path)), type$.double), $async$fileIdForPath$1); + case 3: + // returning from await. + $async$returnValue = $async$temp1._asInt($async$result); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$fileIdForPath$1, $async$completer); + }, + createFile$1(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.int), + $async$returnValue, $async$self = this, t1, $async$temp1; + var $async$createFile$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(A.CompleteIdbRequest_complete(t1._as(t1._as(t1._as($async$self._indexed_db$_database.transaction("files", "readwrite")).objectStore("files")).put({name: path, length: 0})), type$.double), $async$createFile$1); + case 3: + // returning from await. + $async$returnValue = $async$temp1._asInt($async$result); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$createFile$1, $async$completer); + }, + _readFile$2(transaction, fileId) { + var t1 = type$.JSObject; + return A.CompleteIdbRequest_complete(t1._as(t1._as(transaction.objectStore("files")).get(fileId)), type$.nullable_JSObject).then$1$1(new A.AsynchronousIndexedDbFileSystem__readFile_closure(fileId), t1); + }, + readFully$1(fileId) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Uint8List), + $async$returnValue, $async$self = this, t2, transaction, blocks, file, result, readOperations, reader, row, t, rowOffset, t1, $async$temp1; + var $async$readFully$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._indexed_db$_database; + t1.toString; + t2 = type$.JSObject; + transaction = t2._as(t1.transaction($.$get$AsynchronousIndexedDbFileSystem__storesJs(), "readonly")); + blocks = t2._as(transaction.objectStore("blocks")); + $async$goto = 3; + return A._asyncAwait($async$self._readFile$2(transaction, fileId), $async$readFully$1); + case 3: + // returning from await. + file = $async$result; + t1 = A._asInt(file.length); + result = new Uint8Array(t1); + readOperations = A._setArrayType([], type$.JSArray_Future_void); + reader = new A._CursorReader(t2._as(blocks.openCursor($async$self._rangeOverFile$1(fileId))), type$._CursorReader_JSObject); + t1 = type$.void, t2 = type$.JSArray_nullable_Object; + case 4: + // for condition + $async$temp1 = A; + $async$goto = 6; + return A._asyncAwait(reader.moveNext$0(), $async$readFully$1); + case 6: + // returning from await. + if (!$async$temp1.boolConversionCheck($async$result)) { + // goto after for + $async$goto = 5; + break; + } + row = reader._cursor; + if (row == null) + row = A.throwExpression(A.StateError$("Await moveNext() first")); + t = t2._as(row.key); + if (1 < 0 || 1 >= t.length) { + $async$returnValue = A.ioore(t, 1); + // goto return + $async$goto = 1; + break; + } + rowOffset = A._asInt(A._asDouble(t[1])); + B.JSArray_methods.add$1(readOperations, A.Future_Future$sync(new A.AsynchronousIndexedDbFileSystem_readFully_closure(row, result, rowOffset, Math.min(4096, A._asInt(file.length) - rowOffset)), t1)); + // goto for condition + $async$goto = 4; + break; + case 5: + // after for + $async$goto = 7; + return A._asyncAwait(A.Future_wait(readOperations, t1), $async$readFully$1); + case 7: + // returning from await. + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$readFully$1, $async$completer); + }, + _write$2(fileId, writes) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t2, transaction, blocks, file, t3, changedOffsets, fileCursor, t1; + var $async$_write$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._indexed_db$_database; + t1.toString; + t2 = type$.JSObject; + transaction = t2._as(t1.transaction($.$get$AsynchronousIndexedDbFileSystem__storesJs(), "readwrite")); + blocks = t2._as(transaction.objectStore("blocks")); + $async$goto = 2; + return A._asyncAwait($async$self._readFile$2(transaction, fileId), $async$_write$2); + case 2: + // returning from await. + file = $async$result; + t1 = writes.replacedBlocks; + t3 = A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>"); + changedOffsets = A.List_List$of(new A.LinkedHashMapKeyIterable(t1, t3), true, t3._eval$1("Iterable.E")); + B.JSArray_methods.sort$0(changedOffsets); + t3 = A._arrayInstanceType(changedOffsets); + $async$goto = 3; + return A._asyncAwait(A.Future_wait(new A.MappedListIterable(changedOffsets, t3._eval$1("Future<~>(1)")._as(new A.AsynchronousIndexedDbFileSystem__write_closure(new A.AsynchronousIndexedDbFileSystem__write_writeBlock(blocks, fileId), writes)), t3._eval$1("MappedListIterable<1,Future<~>>")), type$.void), $async$_write$2); + case 3: + // returning from await. + $async$goto = writes.newFileLength !== A._asInt(file.length) ? 4 : 5; + break; + case 4: + // then + fileCursor = new A._CursorReader(t2._as(t2._as(transaction.objectStore("files")).openCursor(fileId)), type$._CursorReader_JSObject); + $async$goto = 6; + return A._asyncAwait(fileCursor.moveNext$0(), $async$_write$2); + case 6: + // returning from await. + $async$goto = 7; + return A._asyncAwait(A.CompleteIdbRequest_complete(t2._as(fileCursor.get$current().update({name: A._asString(file.name), length: writes.newFileLength})), type$.nullable_Object), $async$_write$2); + case 7: + // returning from await. + case 5: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_write$2, $async$completer); + }, + truncate$2(_, fileId, $length) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t2, transaction, files, blocks, file, fileCursor, t1; + var $async$truncate$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._indexed_db$_database; + t1.toString; + t2 = type$.JSObject; + transaction = t2._as(t1.transaction($.$get$AsynchronousIndexedDbFileSystem__storesJs(), "readwrite")); + files = t2._as(transaction.objectStore("files")); + blocks = t2._as(transaction.objectStore("blocks")); + $async$goto = 2; + return A._asyncAwait($async$self._readFile$2(transaction, fileId), $async$truncate$2); + case 2: + // returning from await. + file = $async$result; + $async$goto = A._asInt(file.length) > $length ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.CompleteIdbRequest_complete(t2._as(blocks.delete($async$self._rangeOverFile$2$startOffset(fileId, B.JSInt_methods._tdivFast$1($length, 4096) * 4096 + 1))), type$.nullable_Object), $async$truncate$2); + case 5: + // returning from await. + case 4: + // join + fileCursor = new A._CursorReader(t2._as(files.openCursor(fileId)), type$._CursorReader_JSObject); + $async$goto = 6; + return A._asyncAwait(fileCursor.moveNext$0(), $async$truncate$2); + case 6: + // returning from await. + $async$goto = 7; + return A._asyncAwait(A.CompleteIdbRequest_complete(t2._as(fileCursor.get$current().update({name: A._asString(file.name), length: $length})), type$.nullable_Object), $async$truncate$2); + case 7: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$truncate$2, $async$completer); + }, + deleteFile$1(id) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t2, transaction, blocksRange, t1; + var $async$deleteFile$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._indexed_db$_database; + t1.toString; + t2 = type$.JSObject; + transaction = t2._as(t1.transaction(A._setArrayType(["files", "blocks"], type$.JSArray_String), "readwrite")); + blocksRange = $async$self._rangeOverFile$3$endOffsetInclusive$startOffset(id, 9007199254740992, 0); + t1 = type$.nullable_Object; + $async$goto = 2; + return A._asyncAwait(A.Future_wait(A._setArrayType([A.CompleteIdbRequest_complete(t2._as(t2._as(transaction.objectStore("blocks")).delete(blocksRange)), t1), A.CompleteIdbRequest_complete(t2._as(t2._as(transaction.objectStore("files")).delete(id)), t1)], type$.JSArray_Future_void), type$.void), $async$deleteFile$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$deleteFile$1, $async$completer); + }, + set$_indexed_db$_database(_database) { + this._indexed_db$_database = type$.nullable_JSObject._as(_database); + } + }; + A.AsynchronousIndexedDbFileSystem_open_closure.prototype = { + call$1(change) { + var database, + t1 = type$.JSObject; + t1._as(change); + database = t1._as(this.openRequest.result); + if (A._asInt(change.oldVersion) === 0) { + t1._as(t1._as(database.createObjectStore("files", {autoIncrement: true})).createIndex("fileName", "name", {unique: true})); + t1._as(database.createObjectStore("blocks")); + } + }, + $signature: 9 + }; + A.AsynchronousIndexedDbFileSystem__readFile_closure.prototype = { + call$1(value) { + type$.nullable_JSObject._as(value); + if (value == null) + throw A.wrapException(A.ArgumentError$value(this.fileId, "fileId", "File not found in database")); + else + return value; + }, + $signature: 69 + }; + A.AsynchronousIndexedDbFileSystem_readFully_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, $async$temp1, $async$temp2, $async$temp3, $async$temp4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = B.NativeUint8List_methods; + $async$temp2 = $async$self.result; + $async$temp3 = $async$self.rowOffset; + $async$temp4 = A; + $async$goto = 2; + return A._asyncAwait(A.ReadBlob_byteBuffer(type$.JSObject._as($async$self.row.value)), $async$call$0); + case 2: + // returning from await. + $async$temp1.setAll$2($async$temp2, $async$temp3, $async$temp4.NativeUint8List_NativeUint8List$view($async$result, 0, $async$self.length)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A.AsynchronousIndexedDbFileSystem__write_writeBlock.prototype = { + call$2(blockStart, block) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, t3, t4, t5, cursor, blob; + var $async$call$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (A.assertTest(block.length === 4096)) + A.assertThrow("Invalid block size"); + t1 = $async$self.blocks; + t2 = self; + t3 = $async$self.fileId; + t4 = type$.JSArray_double; + t5 = type$.JSObject; + $async$goto = 2; + return A._asyncAwait(A.CompleteIdbRequest_complete(t5._as(t1.openCursor(t5._as(t2.IDBKeyRange.only(A._setArrayType([t3, blockStart], t4))))), type$.nullable_JSObject), $async$call$2); + case 2: + // returning from await. + cursor = $async$result; + blob = t5._as(new t2.Blob(A._setArrayType([block], type$.JSArray_NativeUint8List))); + t2 = type$.nullable_Object; + $async$goto = cursor == null ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait(A.CompleteIdbRequest_complete(t5._as(t1.put(blob, A._setArrayType([t3, blockStart], t4))), t2), $async$call$2); + case 6: + // returning from await. + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = 7; + return A._asyncAwait(A.CompleteIdbRequest_complete(t5._as(cursor.update(blob)), t2), $async$call$2); + case 7: + // returning from await. + case 4: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$2, $async$completer); + }, + $signature: 70 + }; + A.AsynchronousIndexedDbFileSystem__write_closure.prototype = { + call$1(offset) { + var t1; + A._asInt(offset); + t1 = this.writes.replacedBlocks.$index(0, offset); + t1.toString; + return this.writeBlock.call$2(offset, t1); + }, + $signature: 71 + }; + A._FileWriteRequest.prototype = { + _updateBlock$3(blockOffset, offsetInBlock, data) { + B.NativeUint8List_methods.setAll$2(this.replacedBlocks.putIfAbsent$2(blockOffset, new A._FileWriteRequest__updateBlock_closure(this, blockOffset)), offsetInBlock, data); + }, + addWrite$2(offset, data) { + var t1, offsetInData, offsetInFile, t2, offsetInBlock, t3, bytesToWrite, t4, chunk; + for (t1 = data.length, offsetInData = 0; offsetInData < t1;) { + offsetInFile = offset + offsetInData; + t2 = B.JSInt_methods._tdivFast$1(offsetInFile, 4096); + offsetInBlock = B.JSInt_methods.$mod(offsetInFile, 4096); + t3 = t1 - offsetInData; + if (offsetInBlock !== 0) + bytesToWrite = Math.min(4096 - offsetInBlock, t3); + else { + bytesToWrite = Math.min(4096, t3); + offsetInBlock = 0; + } + t3 = data.buffer; + t4 = data.byteOffset; + chunk = new Uint8Array(t3, t4 + offsetInData, bytesToWrite); + offsetInData += bytesToWrite; + this._updateBlock$3(t2 * 4096, offsetInBlock, chunk); + } + this.set$newFileLength(Math.max(this.newFileLength, offset + t1)); + }, + set$newFileLength(newFileLength) { + this.newFileLength = A._asInt(newFileLength); + } + }; + A._FileWriteRequest__updateBlock_closure.prototype = { + call$0() { + var block = new Uint8Array(4096), + t1 = this.$this.originalContent, + t2 = t1.length, + t3 = this.blockOffset; + if (t2 > t3) + B.NativeUint8List_methods.setAll$2(block, 0, A.NativeUint8List_NativeUint8List$view(t1.buffer, t1.byteOffset + t3, A._asIntQ(Math.min(4096, t2 - t3)))); + return block; + }, + $signature: 72 + }; + A._OffsetAndBuffer.prototype = {}; + A.IndexedDbFileSystem.prototype = { + _submitWork$1(work) { + var _this = this; + if (_this._isClosing || _this._asynchronous._indexed_db$_database == null) + A.throwExpression(A.VfsException$(10)); + if (work.insertInto$1(_this._pendingWork)) { + _this._startWorkingIfNeeded$0(); + return work.completer.future; + } else + return A.Future_Future$value(null, type$.void); + }, + _startWorkingIfNeeded$0() { + var t1, item, _this = this; + if (_this._currentWorkItem == null && !_this._pendingWork.get$isEmpty(0)) { + t1 = _this._pendingWork; + item = _this._currentWorkItem = t1.get$first(0); + t1.remove$1(0, item); + item.completer.complete$1(A.Future_Future(item.get$run(), type$.void).whenComplete$1(new A.IndexedDbFileSystem__startWorkingIfNeeded_closure(_this))); + } + }, + close$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, result, t1; + var $async$close$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (!$async$self._isClosing) { + result = $async$self._submitWork$1(new A._FunctionWorkItem(type$.void_Function._as($async$self._asynchronous.get$close()), new A._SyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._SyncCompleter_void))); + $async$self._isClosing = true; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } else { + t1 = $async$self._pendingWork; + if (!t1.get$isEmpty(0)) { + $async$returnValue = t1.get$last(0).completer.future; + // goto return + $async$goto = 1; + break; + } + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$close$0, $async$completer); + }, + _fileId$1(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.int), + $async$returnValue, $async$self = this, t2, t1; + var $async$_fileId$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._knownFileIds; + $async$goto = t1.containsKey$1(path) ? 3 : 5; + break; + case 3: + // then + t1 = t1.$index(0, path); + t1.toString; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = 6; + return A._asyncAwait($async$self._asynchronous.fileIdForPath$1(path), $async$_fileId$1); + case 6: + // returning from await. + t2 = $async$result; + t2.toString; + t1.$indexSet(0, path, t2); + $async$returnValue = t2; + // goto return + $async$goto = 1; + break; + case 4: + // join + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_fileId$1, $async$completer); + }, + _readFiles$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t2, t3, t4, t1, rawFiles, $async$temp1, $async$temp2; + var $async$_readFiles$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._asynchronous; + $async$goto = 2; + return A._asyncAwait(t1.listFiles$0(), $async$_readFiles$0); + case 2: + // returning from await. + rawFiles = $async$result; + $async$self._knownFileIds.addAll$1(0, rawFiles); + t2 = rawFiles.get$entries(), t2 = t2.get$iterator(t2), t3 = $async$self._memory.fileData; + case 3: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 4; + break; + } + t4 = t2.get$current(); + $async$temp1 = t3; + $async$temp2 = t4.key; + $async$goto = 5; + return A._asyncAwait(t1.readFully$1(t4.value), $async$_readFiles$0); + case 5: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, $async$result); + // goto for condition + $async$goto = 3; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_readFiles$0, $async$completer); + }, + xAccess$2(path, flags) { + return this._memory.fileData.containsKey$1(path) ? 1 : 0; + }, + xDelete$2(path, syncDir) { + var _this = this; + _this._memory.fileData.remove$1(0, path); + if (!_this._inMemoryOnlyFiles.remove$1(0, path)) + _this._submitWork$1(new A._DeleteFileWorkItem(_this, path, new A._SyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._SyncCompleter_void))); + }, + xFullPathName$1(path) { + return $.$get$url().normalize$1("/" + path); + }, + xOpen$2(path, flags) { + var t1, t2, inMemoryFile, _this = this, + pathStr = path.path; + if (pathStr == null) + pathStr = A.GenerateFilename_randomFileName(_this.random, "/"); + t1 = _this._memory; + t2 = t1.fileData.containsKey$1(pathStr) ? 1 : 0; + inMemoryFile = t1.xOpen$2(new A.Sqlite3Filename(pathStr), flags); + if (t2 === 0) + if ((flags & 8) !== 0) + _this._inMemoryOnlyFiles.add$1(0, pathStr); + else + _this._submitWork$1(new A._CreateFileWorkItem(_this, pathStr, new A._SyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._SyncCompleter_void))); + return new A._Record_2_file_outFlags(new A._IndexedDbFile(_this, inMemoryFile._0, pathStr), 0); + }, + xSleep$1(duration) { + } + }; + A.IndexedDbFileSystem__startWorkingIfNeeded_closure.prototype = { + call$0() { + var t1 = this.$this; + t1._currentWorkItem = null; + t1._startWorkingIfNeeded$0(); + }, + $signature: 8 + }; + A._IndexedDbFile.prototype = { + xRead$2(target, fileOffset) { + this.memoryFile.xRead$2(target, fileOffset); + }, + get$xDeviceCharacteristics() { + return 0; + }, + xCheckReservedLock$0() { + return this.memoryFile._lockMode >= 2 ? 1 : 0; + }, + xClose$0() { + }, + xFileSize$0() { + return this.memoryFile.xFileSize$0(); + }, + xLock$1(mode) { + this.memoryFile._lockMode = mode; + return null; + }, + xSync$1(flags) { + }, + xTruncate$1(size) { + var _this = this, + t1 = _this.vfs; + if (t1._isClosing || t1._asynchronous._indexed_db$_database == null) + A.throwExpression(A.VfsException$(10)); + _this.memoryFile.xTruncate$1(size); + if (!t1._inMemoryOnlyFiles.contains$1(0, _this.path)) + t1._submitWork$1(new A._FunctionWorkItem(type$.void_Function._as(new A._IndexedDbFile_xTruncate_closure(_this, size)), new A._SyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._SyncCompleter_void))); + }, + xUnlock$1(mode) { + this.memoryFile._lockMode = mode; + return null; + }, + xWrite$2(buffer, fileOffset) { + var t2, previousContent, copy, t3, t4, + t1 = this.vfs; + if (t1._isClosing || t1._asynchronous._indexed_db$_database == null) + A.throwExpression(A.VfsException$(10)); + t2 = this.path; + previousContent = t1._memory.fileData.$index(0, t2); + if (previousContent == null) + previousContent = new Uint8Array(0); + this.memoryFile.xWrite$2(buffer, fileOffset); + if (!t1._inMemoryOnlyFiles.contains$1(0, t2)) { + copy = new Uint8Array(buffer.length); + B.NativeUint8List_methods.setAll$2(copy, 0, buffer); + t3 = A._setArrayType([], type$.JSArray__OffsetAndBuffer); + t4 = $.Zone__current; + B.JSArray_methods.add$1(t3, new A._OffsetAndBuffer(fileOffset, copy)); + t1._submitWork$1(new A._WriteFileWorkItem(t1, t2, previousContent, t3, new A._SyncCompleter(new A._Future(t4, type$._Future_void), type$._SyncCompleter_void))); + } + }, + $isVirtualFileSystemFile: 1 + }; + A._IndexedDbFile_xTruncate_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, t1, t2, $async$temp1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = t1.vfs; + $async$temp1 = t2._asynchronous; + $async$goto = 3; + return A._asyncAwait(t2._fileId$1(t1.path), $async$call$0); + case 3: + // returning from await. + $async$returnValue = $async$temp1.truncate$2(0, $async$result, $async$self.size); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._IndexedDbWorkItem.prototype = { + insertInto$1(pending) { + type$.LinkedList__IndexedDbWorkItem._as(pending); + pending.$ti._precomputed1._as(this); + pending._insertBefore$3$updateFirst(pending._collection$_first, this, false); + return true; + } + }; + A._FunctionWorkItem.prototype = { + run$0() { + return this.work.call$0(); + } + }; + A._DeleteFileWorkItem.prototype = { + insertInto$1(pending) { + var current, t1, previous, t2; + type$.LinkedList__IndexedDbWorkItem._as(pending); + if (!pending.get$isEmpty(0)) { + current = pending.get$last(0); + for (t1 = this.path; current != null;) + if (current instanceof A._DeleteFileWorkItem) + if (current.path === t1) + return false; + else + current = current.get$previous(); + else if (current instanceof A._WriteFileWorkItem) { + previous = current.get$previous(); + if (current.path === t1) { + t2 = current._list; + t2.toString; + t2._unlink$1(A._instanceType(current)._eval$1("LinkedListEntry.E")._as(current)); + } + current = previous; + } else if (current instanceof A._CreateFileWorkItem) { + if (current.path === t1) { + t1 = current._list; + t1.toString; + t1._unlink$1(A._instanceType(current)._eval$1("LinkedListEntry.E")._as(current)); + return false; + } + current = current.get$previous(); + } else + break; + } + pending.$ti._precomputed1._as(this); + pending._insertBefore$3$updateFirst(pending._collection$_first, this, false); + return true; + }, + run$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, id; + var $async$run$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.fileSystem; + t2 = $async$self.path; + $async$goto = 2; + return A._asyncAwait(t1._fileId$1(t2), $async$run$0); + case 2: + // returning from await. + id = $async$result; + t1._knownFileIds.remove$1(0, t2); + $async$goto = 3; + return A._asyncAwait(t1._asynchronous.deleteFile$1(id), $async$run$0); + case 3: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$run$0, $async$completer); + } + }; + A._CreateFileWorkItem.prototype = { + run$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, $async$temp1, $async$temp2; + var $async$run$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.fileSystem; + t2 = $async$self.path; + $async$temp1 = t1._knownFileIds; + $async$temp2 = t2; + $async$goto = 2; + return A._asyncAwait(t1._asynchronous.createFile$1(t2), $async$run$0); + case 2: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, $async$result); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$run$0, $async$completer); + } + }; + A._WriteFileWorkItem.prototype = { + insertInto$1(pending) { + var current, t1; + type$.LinkedList__IndexedDbWorkItem._as(pending); + current = pending._collection$_length === 0 ? null : pending.get$last(0); + for (t1 = this.path; current != null;) + if (current instanceof A._WriteFileWorkItem) + if (current.path === t1) { + B.JSArray_methods.addAll$1(current.writes, this.writes); + return false; + } else + current = current.get$previous(); + else if (current instanceof A._CreateFileWorkItem) { + if (current.path === t1) + break; + current = current.get$previous(); + } else + break; + pending.$ti._precomputed1._as(this); + pending._insertBefore$3$updateFirst(pending._collection$_first, this, false); + return true; + }, + run$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t2, _i, write, t1, request, $async$temp1; + var $async$run$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.originalContent; + request = new A._FileWriteRequest(t1, A.LinkedHashMap_LinkedHashMap$_empty(type$.int, type$.Uint8List), t1.length); + for (t1 = $async$self.writes, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + write = t1[_i]; + request.addWrite$2(write.offset, write.buffer); + } + t1 = $async$self.fileSystem; + $async$temp1 = t1._asynchronous; + $async$goto = 3; + return A._asyncAwait(t1._fileId$1($async$self.path), $async$run$0); + case 3: + // returning from await. + $async$goto = 2; + return A._asyncAwait($async$temp1._write$2($async$result, request), $async$run$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$run$0, $async$completer); + } + }; + A.InMemoryFileSystem.prototype = { + xAccess$2(path, flags) { + return this.fileData.containsKey$1(path) ? 1 : 0; + }, + xDelete$2(path, syncDir) { + this.fileData.remove$1(0, path); + }, + xFullPathName$1(path) { + return $.$get$url().normalize$1("/" + path); + }, + xOpen$2(path, flags) { + var t1, + pathStr = path.path; + if (pathStr == null) + pathStr = A.GenerateFilename_randomFileName(this.random, "/"); + t1 = this.fileData; + if (!t1.containsKey$1(pathStr)) + if ((flags & 4) !== 0) + t1.$indexSet(0, pathStr, new Uint8Array(0)); + else + throw A.wrapException(A.VfsException$(14)); + return new A._Record_2_file_outFlags(new A._InMemoryFile(this, pathStr, (flags & 8) !== 0), 0); + }, + xSleep$1(duration) { + } + }; + A._InMemoryFile.prototype = { + readInto$2(buffer, offset) { + var available, + file = this.vfs.fileData.$index(0, this.path); + if (file == null || file.length <= offset) + return 0; + available = Math.min(buffer.length, file.length - offset); + B.NativeUint8List_methods.setRange$4(buffer, 0, available, file, offset); + return available; + }, + xCheckReservedLock$0() { + return this._lockMode >= 2 ? 1 : 0; + }, + xClose$0() { + if (this.deleteOnClose) + this.vfs.fileData.remove$1(0, this.path); + }, + xFileSize$0() { + return this.vfs.fileData.$index(0, this.path).length; + }, + xLock$1(mode) { + this._lockMode = mode; + }, + xSync$1(flags) { + }, + xTruncate$1(size) { + var t1 = this.vfs.fileData, + t2 = this.path, + file = t1.$index(0, t2), + result = new Uint8Array(size); + if (file != null) + B.NativeUint8List_methods.setRange$3(result, 0, Math.min(size, file.length), file); + t1.$indexSet(0, t2, result); + }, + xUnlock$1(mode) { + this._lockMode = mode; + }, + xWrite$2(buffer, fileOffset) { + var t3, t4, increasedSize, newFile, + t1 = this.vfs.fileData, + t2 = this.path, + file = t1.$index(0, t2); + if (file == null) + file = new Uint8Array(0); + t3 = fileOffset + buffer.length; + t4 = file.length; + increasedSize = t3 - t4; + if (increasedSize <= 0) + B.NativeUint8List_methods.setRange$3(file, fileOffset, t3, buffer); + else { + newFile = new Uint8Array(t4 + increasedSize); + B.NativeUint8List_methods.setAll$2(newFile, 0, file); + B.NativeUint8List_methods.setAll$2(newFile, fileOffset, buffer); + t1.$indexSet(0, t2, newFile); + } + } + }; + A.FileType.prototype = { + _enumToString$0() { + return "FileType." + this._core$_name; + } + }; + A.SimpleOpfsFileSystem.prototype = { + _markExists$2(type, exists) { + var t1 = this._existsList, + t2 = type.index, + t3 = exists ? 1 : 0; + if (!(t2 < t1.length)) + return A.ioore(t1, t2); + t1[t2] = t3; + A.FileSystemSyncAccessHandleApi_writeDart(this._metaHandle, t1, {at: 0}); + }, + xAccess$2(path, flags) { + var t1, t2, + type = $.$get$FileType_byName().$index(0, path); + if (type == null) + return this._simple_opfs$_memory.fileData.containsKey$1(path) ? 1 : 0; + else { + t1 = this._existsList; + A.FileSystemSyncAccessHandleApi_readDart(this._metaHandle, t1, {at: 0}); + t2 = type.index; + if (!(t2 < t1.length)) + return A.ioore(t1, t2); + return t1[t2]; + } + }, + xDelete$2(path, syncDir) { + var type = $.$get$FileType_byName().$index(0, path); + if (type == null) { + this._simple_opfs$_memory.fileData.remove$1(0, path); + return null; + } else + this._markExists$2(type, false); + }, + xFullPathName$1(path) { + return $.$get$url().normalize$1("/" + path); + }, + xOpen$2(path, flags) { + var recognized, t1, t2, _this = this, + pathStr = path.path; + if (pathStr == null) + return _this._simple_opfs$_memory.xOpen$2(path, flags); + recognized = $.$get$FileType_byName().$index(0, pathStr); + if (recognized == null) + return _this._simple_opfs$_memory.xOpen$2(path, flags); + t1 = _this._existsList; + A.FileSystemSyncAccessHandleApi_readDart(_this._metaHandle, t1, {at: 0}); + t2 = recognized.index; + if (!(t2 < t1.length)) + return A.ioore(t1, t2); + t2 = t1[t2]; + t1 = _this._files.$index(0, recognized); + t1.toString; + if (t2 === 0) + if ((flags & 4) !== 0) { + t1.truncate(0); + _this._markExists$2(recognized, true); + } else + throw A.wrapException(B.VfsException_14); + return new A._Record_2_file_outFlags(new A._SimpleOpfsFile(_this, recognized, t1, (flags & 8) !== 0), 0); + }, + xSleep$1(duration) { + }, + close$0() { + var t1, t2, t3; + this._metaHandle.close(); + for (t1 = this._files.get$values(), t2 = A._instanceType(t1), t2 = t2._eval$1("@<1>")._bind$1(t2._rest[1]), t1 = new A.MappedIterator(J.get$iterator$ax(t1.__internal$_iterable), t1._f, t2._eval$1("MappedIterator<1,2>")), t2 = t2._rest[1]; t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + t3.close(); + } + } + }; + A.SimpleOpfsFileSystem_inDirectory_open.prototype = { + call$1($name) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.JSObject), + $async$returnValue, $async$self = this, t1, $async$temp1, $async$temp2; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + $async$temp1 = A; + $async$temp2 = t1; + $async$goto = 4; + return A._asyncAwait(A.promiseToFuture(t1._as($async$self.root.getFileHandle($name, {create: true})), t1), $async$call$1); + case 4: + // returning from await. + $async$goto = 3; + return A._asyncAwait($async$temp1.promiseToFuture($async$temp2._as($async$result.createSyncAccessHandle()), t1), $async$call$1); + case 3: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 73 + }; + A._SimpleOpfsFile.prototype = { + readInto$2(buffer, offset) { + return A.FileSystemSyncAccessHandleApi_readDart(this.syncHandle, buffer, {at: offset}); + }, + xCheckReservedLock$0() { + return this._simple_opfs$_lockMode >= 2 ? 1 : 0; + }, + xClose$0() { + var _this = this; + _this.syncHandle.flush(); + if (_this.deleteOnClose) + _this.vfs._markExists$2(_this.type, false); + }, + xFileSize$0() { + return A._asInt(this.syncHandle.getSize()); + }, + xLock$1(mode) { + this._simple_opfs$_lockMode = mode; + }, + xSync$1(flags) { + this.syncHandle.flush(); + }, + xTruncate$1(size) { + this.syncHandle.truncate(size); + }, + xUnlock$1(mode) { + this._simple_opfs$_lockMode = mode; + }, + xWrite$2(buffer, fileOffset) { + if (A.FileSystemSyncAccessHandleApi_writeDart(this.syncHandle, buffer, {at: fileOffset}) < buffer.length) + throw A.wrapException(B.VfsException_778); + } + }; + A.WasmBindings.prototype = { + allocateBytes$2$additionalLength(bytes, additionalLength) { + var t1, ptr, t2; + type$.List_int._as(bytes); + t1 = J.getInterceptor$asx(bytes); + ptr = A._asInt(A._asDouble(A.callMethod(this._malloc, "call", [null, t1.get$length(bytes) + additionalLength], type$.nullable_Object))); + t2 = A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(this.memory.buffer), 0, null); + B.NativeUint8List_methods.setRange$3(t2, ptr, ptr + t1.get$length(bytes), bytes); + B.NativeUint8List_methods.fillRange$3(t2, ptr + t1.get$length(bytes), ptr + t1.get$length(bytes) + additionalLength, 0); + return ptr; + }, + allocateBytes$1(bytes) { + return this.allocateBytes$2$additionalLength(bytes, 0); + } + }; + A._InjectedValues.prototype = { + _InjectedValues$0() { + var t2, t3, t4, _this = this, + t1 = type$.JSObject, + memory = t1._as(new self.WebAssembly.Memory({initial: 16})); + _this.___InjectedValues_memory_A = memory; + t2 = type$.String; + t3 = type$.Function; + t4 = type$.JavaScriptFunction; + _this.set$___InjectedValues_injectedValues_A(type$.Map_of_String_and_Map_String_JSObject._as(A.LinkedHashMap_LinkedHashMap$_literal(["env", A.LinkedHashMap_LinkedHashMap$_literal(["memory", memory], t2, t1), "dart", A.LinkedHashMap_LinkedHashMap$_literal(["error_log", t4._as(A.allowInterop(new A._InjectedValues_closure(memory), t3)), "xOpen", t4._as(A.allowInterop(new A._InjectedValues_closure0(_this, memory), t3)), "xDelete", t4._as(A.allowInterop(new A._InjectedValues_closure1(_this, memory), t3)), "xAccess", t4._as(A.allowInterop(new A._InjectedValues_closure2(_this, memory), t3)), "xFullPathname", t4._as(A.allowInterop(new A._InjectedValues_closure3(_this, memory), t3)), "xRandomness", t4._as(A.allowInterop(new A._InjectedValues_closure4(_this, memory), t3)), "xSleep", t4._as(A.allowInterop(new A._InjectedValues_closure5(_this), t3)), "xCurrentTimeInt64", t4._as(A.allowInterop(new A._InjectedValues_closure6(_this, memory), t3)), "xDeviceCharacteristics", t4._as(A.allowInterop(new A._InjectedValues_closure7(_this), t3)), "xClose", t4._as(A.allowInterop(new A._InjectedValues_closure8(_this), t3)), "xRead", t4._as(A.allowInterop(new A._InjectedValues_closure9(_this, memory), t3)), "xWrite", t4._as(A.allowInterop(new A._InjectedValues_closure10(_this, memory), t3)), "xTruncate", t4._as(A.allowInterop(new A._InjectedValues_closure11(_this), t3)), "xSync", t4._as(A.allowInterop(new A._InjectedValues_closure12(_this), t3)), "xFileSize", t4._as(A.allowInterop(new A._InjectedValues_closure13(_this, memory), t3)), "xLock", t4._as(A.allowInterop(new A._InjectedValues_closure14(_this), t3)), "xUnlock", t4._as(A.allowInterop(new A._InjectedValues_closure15(_this), t3)), "xCheckReservedLock", t4._as(A.allowInterop(new A._InjectedValues_closure16(_this, memory), t3)), "function_xFunc", t4._as(A.allowInterop(new A._InjectedValues_closure17(_this), t3)), "function_xStep", t4._as(A.allowInterop(new A._InjectedValues_closure18(_this), t3)), "function_xInverse", t4._as(A.allowInterop(new A._InjectedValues_closure19(_this), t3)), "function_xFinal", t4._as(A.allowInterop(new A._InjectedValues_closure20(_this), t3)), "function_xValue", t4._as(A.allowInterop(new A._InjectedValues_closure21(_this), t3)), "function_forget", t4._as(A.allowInterop(new A._InjectedValues_closure22(_this), t3)), "function_compare", t4._as(A.allowInterop(new A._InjectedValues_closure23(_this, memory), t3)), "function_hook", t4._as(A.allowInterop(new A._InjectedValues_closure24(_this, memory), t3))], t2, t1)], t2, type$.Map_String_JSObject))); + }, + set$___InjectedValues_injectedValues_A(___InjectedValues_injectedValues_A) { + this.___InjectedValues_injectedValues_A = type$.Map_of_String_and_Map_String_JSObject._as(___InjectedValues_injectedValues_A); + } + }; + A._InjectedValues_closure.prototype = { + call$1(ptr) { + A.print("[sqlite3] " + A.WrappedMemory_readString(this.memory, A._asInt(ptr), null)); + }, + $signature: 15 + }; + A._InjectedValues_closure0.prototype = { + call$5(vfsId, zName, dartFdPtr, flags, pOutFlags) { + var t1, t2, t3; + A._asInt(vfsId); + A._asInt(zName); + A._asInt(dartFdPtr); + A._asInt(flags); + A._asInt(pOutFlags); + t1 = this.$this; + t2 = t1.callbacks.registeredVfs.$index(0, vfsId); + t2.toString; + t3 = this.memory; + return A._runVfs(new A._InjectedValues__closure13(t1, t2, new A.Sqlite3Filename(A.WrappedMemory_readNullableString(t3, zName, null)), flags, t3, dartFdPtr, pOutFlags)); + }, + "call*": "call$5", + $requiredArgCount: 5, + $signature: 31 + }; + A._InjectedValues__closure13.prototype = { + call$0() { + var _this = this, + result = _this.vfs.xOpen$2(_this.path, _this.flags), + t1 = type$.VirtualFileSystemFile._as(result._0), + t2 = _this.$this.callbacks.openedFiles, + id = t2.__js_helper$_length; + t2.$indexSet(0, id, t1); + t1 = _this.memory; + A.WrappedMemory_setInt32Value(t1, _this.dartFdPtr, id); + t2 = _this.pOutFlags; + if (t2 !== 0) + A.WrappedMemory_setInt32Value(t1, t2, result._1); + }, + $signature: 0 + }; + A._InjectedValues_closure1.prototype = { + call$3(vfsId, zName, syncDir) { + var t1; + A._asInt(vfsId); + A._asInt(zName); + A._asInt(syncDir); + t1 = this.$this.callbacks.registeredVfs.$index(0, vfsId); + t1.toString; + return A._runVfs(new A._InjectedValues__closure12(t1, A.WrappedMemory_readString(this.memory, zName, null), syncDir)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 32 + }; + A._InjectedValues__closure12.prototype = { + call$0() { + return this.vfs.xDelete$2(this.path, this.syncDir); + }, + $signature: 0 + }; + A._InjectedValues_closure2.prototype = { + call$4(vfsId, zName, flags, pResOut) { + var t1, t2; + A._asInt(vfsId); + A._asInt(zName); + A._asInt(flags); + A._asInt(pResOut); + t1 = this.$this.callbacks.registeredVfs.$index(0, vfsId); + t1.toString; + t2 = this.memory; + return A._runVfs(new A._InjectedValues__closure11(t1, A.WrappedMemory_readString(t2, zName, null), flags, t2, pResOut)); + }, + "call*": "call$4", + $requiredArgCount: 4, + $signature: 21 + }; + A._InjectedValues__closure11.prototype = { + call$0() { + var _this = this; + A.WrappedMemory_setInt32Value(_this.memory, _this.pResOut, _this.vfs.xAccess$2(_this.path, _this.flags)); + }, + $signature: 0 + }; + A._InjectedValues_closure3.prototype = { + call$4(vfsId, zName, nOut, zOut) { + var t1, t2; + A._asInt(vfsId); + A._asInt(zName); + A._asInt(nOut); + A._asInt(zOut); + t1 = this.$this.callbacks.registeredVfs.$index(0, vfsId); + t1.toString; + t2 = this.memory; + return A._runVfs(new A._InjectedValues__closure10(t1, A.WrappedMemory_readString(t2, zName, null), nOut, t2, zOut)); + }, + "call*": "call$4", + $requiredArgCount: 4, + $signature: 21 + }; + A._InjectedValues__closure10.prototype = { + call$0() { + var t2, t3, _this = this, + encoded = B.C_Utf8Encoder.convert$1(_this.vfs.xFullPathName$1(_this.path)), + t1 = encoded.length; + if (t1 > _this.nOut) + throw A.wrapException(A.VfsException$(14)); + t2 = A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(_this.memory.buffer), 0, null); + t3 = _this.zOut; + B.NativeUint8List_methods.setAll$2(t2, t3, encoded); + t1 = t3 + t1; + if (!(t1 >= 0 && t1 < t2.length)) + return A.ioore(t2, t1); + t2[t1] = 0; + }, + $signature: 0 + }; + A._InjectedValues_closure4.prototype = { + call$3(vfsId, nByte, zOut) { + var t1; + A._asInt(vfsId); + A._asInt(nByte); + A._asInt(zOut); + t1 = this.$this.callbacks.registeredVfs.$index(0, vfsId); + t1.toString; + return A._runVfs(new A._InjectedValues__closure9(t1, this.memory, zOut, nByte)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 32 + }; + A._InjectedValues__closure9.prototype = { + call$0() { + var _this = this; + _this.vfs.xRandomness$1(A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(_this.memory.buffer), _this.zOut, _this.nByte)); + }, + $signature: 0 + }; + A._InjectedValues_closure5.prototype = { + call$2(vfsId, micros) { + var t1; + A._asInt(vfsId); + A._asInt(micros); + t1 = this.$this.callbacks.registeredVfs.$index(0, vfsId); + t1.toString; + return A._runVfs(new A._InjectedValues__closure8(t1, micros)); + }, + $signature: 4 + }; + A._InjectedValues__closure8.prototype = { + call$0() { + this.vfs.xSleep$1(A.Duration$(this.micros, 0)); + }, + $signature: 0 + }; + A._InjectedValues_closure6.prototype = { + call$2(vfsId, target) { + var t1; + A._asInt(vfsId); + A._asInt(target); + this.$this.callbacks.registeredVfs.$index(0, vfsId).toString; + t1 = Date.now(); + t1 = type$.JavaScriptBigInt._as(self.BigInt(t1)); + if (A.assertTest(target !== 0)) + A.assertThrow("Null pointer dereference"); + A.JSObjectUnsafeUtilExtension__callMethod(A.NativeByteData_NativeByteData$view(type$.NativeByteBuffer._as(this.memory.buffer), 0, null), "setBigInt64", target, t1, true, null); + }, + $signature: 78 + }; + A._InjectedValues_closure7.prototype = { + call$1(fd) { + return this.$this.callbacks.openedFiles.$index(0, A._asInt(fd)).get$xDeviceCharacteristics(); + }, + $signature: 13 + }; + A._InjectedValues_closure8.prototype = { + call$1(fd) { + var t1, t2; + A._asInt(fd); + t1 = this.$this; + t2 = t1.callbacks.openedFiles.$index(0, fd); + t2.toString; + return A._runVfs(new A._InjectedValues__closure7(t1, t2, fd)); + }, + $signature: 13 + }; + A._InjectedValues__closure7.prototype = { + call$0() { + this.file.xClose$0(); + this.$this.callbacks.openedFiles.remove$1(0, this.fd); + }, + $signature: 0 + }; + A._InjectedValues_closure9.prototype = { + call$4(fd, target, amount, offset) { + var t1; + A._asInt(fd); + A._asInt(target); + A._asInt(amount); + type$.JavaScriptBigInt._as(offset); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure6(t1, this.memory, target, amount, offset)); + }, + "call*": "call$4", + $requiredArgCount: 4, + $signature: 34 + }; + A._InjectedValues__closure6.prototype = { + call$0() { + var _this = this; + _this.file.xRead$2(A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(_this.memory.buffer), _this.target, _this.amount), A._asInt(A._asDouble(self.Number(_this.offset)))); + }, + $signature: 0 + }; + A._InjectedValues_closure10.prototype = { + call$4(fd, source, amount, offset) { + var t1; + A._asInt(fd); + A._asInt(source); + A._asInt(amount); + type$.JavaScriptBigInt._as(offset); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure5(t1, this.memory, source, amount, offset)); + }, + "call*": "call$4", + $requiredArgCount: 4, + $signature: 34 + }; + A._InjectedValues__closure5.prototype = { + call$0() { + var _this = this; + _this.file.xWrite$2(A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(_this.memory.buffer), _this.source, _this.amount), A._asInt(A._asDouble(self.Number(_this.offset)))); + }, + $signature: 0 + }; + A._InjectedValues_closure11.prototype = { + call$2(fd, size) { + var t1; + A._asInt(fd); + type$.JavaScriptBigInt._as(size); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure4(t1, size)); + }, + $signature: 80 + }; + A._InjectedValues__closure4.prototype = { + call$0() { + return this.file.xTruncate$1(A._asInt(A._asDouble(self.Number(this.size)))); + }, + $signature: 0 + }; + A._InjectedValues_closure12.prototype = { + call$2(fd, flags) { + var t1; + A._asInt(fd); + A._asInt(flags); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure3(t1, flags)); + }, + $signature: 4 + }; + A._InjectedValues__closure3.prototype = { + call$0() { + return this.file.xSync$1(this.flags); + }, + $signature: 0 + }; + A._InjectedValues_closure13.prototype = { + call$2(fd, sizePtr) { + var t1; + A._asInt(fd); + A._asInt(sizePtr); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure2(t1, this.memory, sizePtr)); + }, + $signature: 4 + }; + A._InjectedValues__closure2.prototype = { + call$0() { + A.WrappedMemory_setInt32Value(this.memory, this.sizePtr, this.file.xFileSize$0()); + }, + $signature: 0 + }; + A._InjectedValues_closure14.prototype = { + call$2(fd, flags) { + var t1; + A._asInt(fd); + A._asInt(flags); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure1(t1, flags)); + }, + $signature: 4 + }; + A._InjectedValues__closure1.prototype = { + call$0() { + return this.file.xLock$1(this.flags); + }, + $signature: 0 + }; + A._InjectedValues_closure15.prototype = { + call$2(fd, flags) { + var t1; + A._asInt(fd); + A._asInt(flags); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure0(t1, flags)); + }, + $signature: 4 + }; + A._InjectedValues__closure0.prototype = { + call$0() { + return this.file.xUnlock$1(this.flags); + }, + $signature: 0 + }; + A._InjectedValues_closure16.prototype = { + call$2(fd, pResOut) { + var t1; + A._asInt(fd); + A._asInt(pResOut); + t1 = this.$this.callbacks.openedFiles.$index(0, fd); + t1.toString; + return A._runVfs(new A._InjectedValues__closure(t1, this.memory, pResOut)); + }, + $signature: 4 + }; + A._InjectedValues__closure.prototype = { + call$0() { + A.WrappedMemory_setInt32Value(this.memory, this.pResOut, this.file.xCheckReservedLock$0()); + }, + $signature: 0 + }; + A._InjectedValues_closure17.prototype = { + call$3(ctx, args, value) { + var t1, t2; + A._asInt(ctx); + A._asInt(args); + A._asInt(value); + t1 = this.$this; + t2 = t1.___InjectedValues_bindings_A; + t2 === $ && A.throwLateFieldNI("bindings"); + t2 = t1.callbacks.functions.$index(0, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_user_data, "call", [null, ctx], type$.nullable_Object)))).xFunc; + t1 = t1.___InjectedValues_bindings_A; + t2.call$2(new A.WasmContext(t1, ctx), new A.WasmValueList(t1, args, value)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 18 + }; + A._InjectedValues_closure18.prototype = { + call$3(ctx, args, value) { + var t1, t2; + A._asInt(ctx); + A._asInt(args); + A._asInt(value); + t1 = this.$this; + t2 = t1.___InjectedValues_bindings_A; + t2 === $ && A.throwLateFieldNI("bindings"); + t2 = t1.callbacks.functions.$index(0, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_user_data, "call", [null, ctx], type$.nullable_Object)))).xStep; + t1 = t1.___InjectedValues_bindings_A; + t2.call$2(new A.WasmContext(t1, ctx), new A.WasmValueList(t1, args, value)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 18 + }; + A._InjectedValues_closure19.prototype = { + call$3(ctx, args, value) { + var t1, t2; + A._asInt(ctx); + A._asInt(args); + A._asInt(value); + t1 = this.$this; + t2 = t1.___InjectedValues_bindings_A; + t2 === $ && A.throwLateFieldNI("bindings"); + t1.callbacks.functions.$index(0, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_user_data, "call", [null, ctx], type$.nullable_Object)))).toString; + t1 = t1.___InjectedValues_bindings_A; + null.call$2(new A.WasmContext(t1, ctx), new A.WasmValueList(t1, args, value)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 18 + }; + A._InjectedValues_closure20.prototype = { + call$1(ctx) { + var t1, t2; + A._asInt(ctx); + t1 = this.$this; + t2 = t1.___InjectedValues_bindings_A; + t2 === $ && A.throwLateFieldNI("bindings"); + t1.callbacks.functions.$index(0, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_user_data, "call", [null, ctx], type$.nullable_Object)))).xFinal.call$1(new A.WasmContext(t1.___InjectedValues_bindings_A, ctx)); + }, + $signature: 15 + }; + A._InjectedValues_closure21.prototype = { + call$1(ctx) { + var t1, t2; + A._asInt(ctx); + t1 = this.$this; + t2 = t1.___InjectedValues_bindings_A; + t2 === $ && A.throwLateFieldNI("bindings"); + t1.callbacks.functions.$index(0, A._asInt(A._asDouble(A.callMethod(t2._sqlite3_user_data, "call", [null, ctx], type$.nullable_Object)))).toString; + null.call$1(new A.WasmContext(t1.___InjectedValues_bindings_A, ctx)); + }, + $signature: 15 + }; + A._InjectedValues_closure22.prototype = { + call$1(ctx) { + this.$this.callbacks.functions.remove$1(0, A._asInt(ctx)); + }, + $signature: 15 + }; + A._InjectedValues_closure23.prototype = { + call$5(ctx, lengthA, a, lengthB, b) { + var t1, aStr, bStr; + A._asInt(ctx); + A._asInt(lengthA); + A._asInt(a); + A._asInt(lengthB); + A._asInt(b); + t1 = this.memory; + aStr = A.WrappedMemory_readNullableString(t1, a, lengthA); + bStr = A.WrappedMemory_readNullableString(t1, b, lengthB); + this.$this.callbacks.functions.$index(0, ctx).toString; + return null.call$2(aStr, bStr); + }, + "call*": "call$5", + $requiredArgCount: 5, + $signature: 31 + }; + A._InjectedValues_closure24.prototype = { + call$5(id, kind, _, table, rowId) { + A._asInt(id); + A._asInt(kind); + A._asInt(_); + A._asInt(table); + type$.JavaScriptBigInt._as(rowId); + A.WrappedMemory_readString(this.memory, table, null); + }, + "call*": "call$5", + $requiredArgCount: 5, + $signature: 82 + }; + A.DartCallbacks.prototype = { + register$1(set) { + var t1 = this._id++; + this.functions.$indexSet(0, t1, set); + return t1; + }, + set$installedUpdateHook(installedUpdateHook) { + this.installedUpdateHook = type$.nullable_void_Function_int_String_int._as(installedUpdateHook); + } + }; + A.RegisteredFunctionSet.prototype = {}; + A.Chain.prototype = { + toTrace$0() { + var t1 = this.traces, + t2 = A._arrayInstanceType(t1); + return A.Trace$(new A.ExpandIterable(t1, t2._eval$1("Iterable(1)")._as(new A.Chain_toTrace_closure()), t2._eval$1("ExpandIterable<1,Frame>")), null); + }, + toString$0(_) { + var t1 = this.traces, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.Chain_toString_closure(new A.MappedListIterable(t1, t2._eval$1("int(1)")._as(new A.Chain_toString_closure0()), t2._eval$1("MappedListIterable<1,int>")).fold$1$2(0, 0, B.CONSTANT, type$.int))), t2._eval$1("MappedListIterable<1,String>")).join$1(0, string$.______); + }, + $isStackTrace: 1 + }; + A.Chain_Chain$parse_closure.prototype = { + call$1(line) { + return A._asString(line).length !== 0; + }, + $signature: 3 + }; + A.Chain_toTrace_closure.prototype = { + call$1(trace) { + return type$.Trace._as(trace).get$frames(); + }, + $signature: 83 + }; + A.Chain_toString_closure0.prototype = { + call$1(trace) { + var t1 = type$.Trace._as(trace).get$frames(), + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("int(1)")._as(new A.Chain_toString__closure0()), t2._eval$1("MappedListIterable<1,int>")).fold$1$2(0, 0, B.CONSTANT, type$.int); + }, + $signature: 116 + }; + A.Chain_toString__closure0.prototype = { + call$1(frame) { + return type$.Frame._as(frame).get$location().length; + }, + $signature: 35 + }; + A.Chain_toString_closure.prototype = { + call$1(trace) { + var t1 = type$.Trace._as(trace).get$frames(), + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.Chain_toString__closure(this.longest)), t2._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $signature: 86 + }; + A.Chain_toString__closure.prototype = { + call$1(frame) { + type$.Frame._as(frame); + return B.JSString_methods.padRight$1(frame.get$location(), this.longest) + " " + A.S(frame.get$member()) + "\n"; + }, + $signature: 36 + }; + A.Frame.prototype = { + get$library() { + var t1 = this.uri; + if (t1.get$scheme() === "data") + return "data:..."; + return $.$get$context().prettyUri$1(t1); + }, + get$location() { + var t2, _this = this, + t1 = _this.line; + if (t1 == null) + return _this.get$library(); + t2 = _this.column; + if (t2 == null) + return _this.get$library() + " " + A.S(t1); + return _this.get$library() + " " + A.S(t1) + ":" + A.S(t2); + }, + toString$0(_) { + return this.get$location() + " in " + A.S(this.member); + }, + get$member() { + return this.member; + } + }; + A.Frame_Frame$parseVM_closure.prototype = { + call$0() { + var match, t2, t3, member, uri, lineAndColumn, line, _null = null, + t1 = this.frame; + if (t1 === "...") + return new A.Frame(A._Uri__Uri(_null, _null, _null, _null), _null, _null, "..."); + match = $.$get$_vmFrame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + t2.toString; + t3 = $.$get$_asyncBody(); + t2 = A.stringReplaceAllUnchecked(t2, t3, ""); + member = A.stringReplaceAllUnchecked(t2, "", ""); + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + t3 = t2; + t3.toString; + if (B.JSString_methods.startsWith$1(t3, "= t1.length) + return A.ioore(t1, 3); + lineAndColumn = t1[3].split(":"); + t1 = lineAndColumn.length; + line = t1 > 1 ? A.int_parse(lineAndColumn[1], _null) : _null; + return new A.Frame(uri, line, t1 > 2 ? A.int_parse(lineAndColumn[2], _null) : _null, member); + }, + $signature: 10 + }; + A.Frame_Frame$parseV8_closure.prototype = { + call$0() { + var t2, t3, t4, _s4_ = "", + t1 = this.frame, + match = $.$get$_v8Frame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(null, "unparsed", null, null), t1); + t1 = new A.Frame_Frame$parseV8_closure_parseLocation(t1); + t2 = match._match; + t3 = t2.length; + if (2 >= t3) + return A.ioore(t2, 2); + t4 = t2[2]; + if (t4 != null) { + t3 = t4; + t3.toString; + t2 = t2[1]; + t2.toString; + t2 = A.stringReplaceAllUnchecked(t2, "", _s4_); + t2 = A.stringReplaceAllUnchecked(t2, "Anonymous function", _s4_); + return t1.call$2(t3, A.stringReplaceAllUnchecked(t2, "(anonymous function)", _s4_)); + } else { + if (3 >= t3) + return A.ioore(t2, 3); + t2 = t2[3]; + t2.toString; + return t1.call$2(t2, _s4_); + } + }, + $signature: 10 + }; + A.Frame_Frame$parseV8_closure_parseLocation.prototype = { + call$2($location, member) { + var t2, urlMatch, uri, line, columnMatch, _null = null, + t1 = $.$get$_v8EvalLocation(), + evalMatch = t1.firstMatch$1($location); + for (; evalMatch != null; $location = t2) { + t2 = evalMatch._match; + if (1 >= t2.length) + return A.ioore(t2, 1); + t2 = t2[1]; + t2.toString; + evalMatch = t1.firstMatch$1(t2); + } + if ($location === "native") + return new A.Frame(A.Uri_parse("native"), _null, _null, member); + urlMatch = $.$get$_v8UrlLocation().firstMatch$1($location); + if (urlMatch == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), this.frame); + t1 = urlMatch._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + t2.toString; + uri = A.Frame__uriOrPathToUri(t2); + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + t2.toString; + line = A.int_parse(t2, _null); + if (3 >= t1.length) + return A.ioore(t1, 3); + columnMatch = t1[3]; + return new A.Frame(uri, line, columnMatch != null ? A.int_parse(columnMatch, _null) : _null, member); + }, + $signature: 89 + }; + A.Frame_Frame$_parseFirefoxEval_closure.prototype = { + call$0() { + var t2, member, uri, line, _null = null, + t1 = this.frame, + match = $.$get$_firefoxEvalLocation().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + t2.toString; + member = A.stringReplaceAllUnchecked(t2, "/<", ""); + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + t2.toString; + uri = A.Frame__uriOrPathToUri(t2); + if (3 >= t1.length) + return A.ioore(t1, 3); + t1 = t1[3]; + t1.toString; + line = A.int_parse(t1, _null); + return new A.Frame(uri, line, _null, member.length === 0 || member === "anonymous" ? "" : member); + }, + $signature: 10 + }; + A.Frame_Frame$parseFirefox_closure.prototype = { + call$0() { + var t2, t3, t4, uri, member, line, column, _null = null, + t1 = this.frame, + match = $.$get$_firefoxSafariFrame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t2 = match._match; + if (3 >= t2.length) + return A.ioore(t2, 3); + t3 = t2[3]; + t4 = t3; + t4.toString; + if (B.JSString_methods.contains$1(t4, " line ")) + return A.Frame_Frame$_parseFirefoxEval(t1); + t1 = t3; + t1.toString; + uri = A.Frame__uriOrPathToUri(t1); + t1 = t2.length; + if (1 >= t1) + return A.ioore(t2, 1); + member = t2[1]; + if (member != null) { + if (2 >= t1) + return A.ioore(t2, 2); + t1 = t2[2]; + t1.toString; + member += B.JSArray_methods.join$0(A.List_List$filled(B.JSString_methods.allMatches$1("/", t1).get$length(0), ".", false, type$.String)); + if (member === "") + member = ""; + member = B.JSString_methods.replaceFirst$2(member, $.$get$_initialDot(), ""); + } else + member = ""; + if (4 >= t2.length) + return A.ioore(t2, 4); + t1 = t2[4]; + if (t1 === "") + line = _null; + else { + t1 = t1; + t1.toString; + line = A.int_parse(t1, _null); + } + if (5 >= t2.length) + return A.ioore(t2, 5); + t1 = t2[5]; + if (t1 == null || t1 === "") + column = _null; + else { + t1 = t1; + t1.toString; + column = A.int_parse(t1, _null); + } + return new A.Frame(uri, line, column, member); + }, + $signature: 10 + }; + A.Frame_Frame$parseFriendly_closure.prototype = { + call$0() { + var t2, uri, line, column, _null = null, + t1 = this.frame, + match = $.$get$_friendlyFrame().firstMatch$1(t1); + if (match == null) + throw A.wrapException(A.FormatException$("Couldn't parse package:stack_trace stack trace line '" + t1 + "'.", _null, _null)); + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t2 = t1[1]; + if (t2 === "data:...") + uri = A.Uri_Uri$dataFromString(""); + else { + t2 = t2; + t2.toString; + uri = A.Uri_parse(t2); + } + if (uri.get$scheme() === "") { + t2 = $.$get$context(); + uri = t2.toUri$1(t2.absolute$15(t2.style.pathFromUri$1(A._parseUri(uri)), _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + } + if (2 >= t1.length) + return A.ioore(t1, 2); + t2 = t1[2]; + if (t2 == null) + line = _null; + else { + t2 = t2; + t2.toString; + line = A.int_parse(t2, _null); + } + if (3 >= t1.length) + return A.ioore(t1, 3); + t2 = t1[3]; + if (t2 == null) + column = _null; + else { + t2 = t2; + t2.toString; + column = A.int_parse(t2, _null); + } + if (4 >= t1.length) + return A.ioore(t1, 4); + return new A.Frame(uri, line, column, t1[4]); + }, + $signature: 10 + }; + A.LazyTrace.prototype = { + get$_lazy_trace$_trace() { + var result, _this = this, + value = _this.__LazyTrace__trace_FI; + if (value === $) { + result = _this._thunk.call$0(); + _this.__LazyTrace__trace_FI !== $ && A.throwLateFieldADI("_trace"); + _this.__LazyTrace__trace_FI = result; + value = result; + } + return value; + }, + get$frames() { + return this.get$_lazy_trace$_trace().get$frames(); + }, + toString$0(_) { + return this.get$_lazy_trace$_trace().toString$0(0); + }, + $isStackTrace: 1, + $isTrace: 1 + }; + A.Trace.prototype = { + toString$0(_) { + var t1 = this.frames, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, t2._eval$1("String(1)")._as(new A.Trace_toString_closure(new A.MappedListIterable(t1, t2._eval$1("int(1)")._as(new A.Trace_toString_closure0()), t2._eval$1("MappedListIterable<1,int>")).fold$1$2(0, 0, B.CONSTANT, type$.int))), t2._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $isStackTrace: 1, + get$frames() { + return this.frames; + } + }; + A.Trace_Trace$from_closure.prototype = { + call$0() { + return A.Trace_Trace$parse(this.trace.toString$0(0)); + }, + $signature: 90 + }; + A.Trace__parseVM_closure.prototype = { + call$1(line) { + return A._asString(line).length !== 0; + }, + $signature: 3 + }; + A.Trace$parseV8_closure.prototype = { + call$1(line) { + return !B.JSString_methods.startsWith$1(A._asString(line), $.$get$_v8TraceLine()); + }, + $signature: 3 + }; + A.Trace$parseJSCore_closure.prototype = { + call$1(line) { + return A._asString(line) !== "\tat "; + }, + $signature: 3 + }; + A.Trace$parseFirefox_closure.prototype = { + call$1(line) { + A._asString(line); + return line.length !== 0 && line !== "[native code]"; + }, + $signature: 3 + }; + A.Trace$parseFriendly_closure.prototype = { + call$1(line) { + return !B.JSString_methods.startsWith$1(A._asString(line), "====="); + }, + $signature: 3 + }; + A.Trace_toString_closure0.prototype = { + call$1(frame) { + return type$.Frame._as(frame).get$location().length; + }, + $signature: 35 + }; + A.Trace_toString_closure.prototype = { + call$1(frame) { + type$.Frame._as(frame); + if (frame instanceof A.UnparsedFrame) + return frame.toString$0(0) + "\n"; + return B.JSString_methods.padRight$1(frame.get$location(), this.longest) + " " + A.S(frame.get$member()) + "\n"; + }, + $signature: 36 + }; + A.UnparsedFrame.prototype = { + toString$0(_) { + return this.member; + }, + $isFrame: 1, + get$location() { + return "unparsed"; + }, + get$member() { + return this.member; + } + }; + A.CloseGuaranteeChannel.prototype = { + set$__CloseGuaranteeChannel__stream_F(__CloseGuaranteeChannel__stream_F) { + this.__CloseGuaranteeChannel__stream_F = this.$ti._eval$1("_CloseGuaranteeStream<1>")._as(__CloseGuaranteeChannel__stream_F); + }, + set$__CloseGuaranteeChannel__sink_F(__CloseGuaranteeChannel__sink_F) { + this.__CloseGuaranteeChannel__sink_F = this.$ti._eval$1("_CloseGuaranteeSink<1>")._as(__CloseGuaranteeChannel__sink_F); + }, + set$_close_guarantee_channel$_subscription(_subscription) { + this._close_guarantee_channel$_subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription); + } + }; + A._CloseGuaranteeStream.prototype = { + listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) { + var t1, subscription; + this.$ti._eval$1("~(1)?")._as(onData); + type$.nullable_void_Function._as(onDone); + t1 = this._channel; + if (t1._disconnected) { + onData = null; + onError = null; + } + subscription = this._inner.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError); + if (!t1._disconnected) + t1.set$_close_guarantee_channel$_subscription(subscription); + return subscription; + }, + listen$3$onDone$onError(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + }, + listen$2$onDone(onData, onDone) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, null); + } + }; + A._CloseGuaranteeSink.prototype = { + close$0() { + var subscription, + done = this.super$DelegatingStreamSink$close(), + t1 = this._channel; + t1._disconnected = true; + subscription = t1._close_guarantee_channel$_subscription; + if (subscription != null) { + subscription.onData$1(null); + subscription.onError$1(null); + } + return done; + } + }; + A.GuaranteeChannel.prototype = { + get$stream() { + var t1 = this.__GuaranteeChannel__streamController_F; + t1 === $ && A.throwLateFieldNI("_streamController"); + return new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")); + }, + get$sink() { + var t1 = this.__GuaranteeChannel__sink_F; + t1 === $ && A.throwLateFieldNI("_sink"); + return t1; + }, + GuaranteeChannel$3$allowSinkErrors(innerSink, allowSinkErrors, _box_0, $T) { + var _this = this, + t1 = _this.$ti, + t2 = t1._eval$1("_GuaranteeSink<1>")._as(new A._GuaranteeSink(innerSink, _this, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_dynamic), type$._AsyncCompleter_dynamic), true, $T._eval$1("_GuaranteeSink<0>"))); + _this.__GuaranteeChannel__sink_F !== $ && A.throwLateFieldAI("_sink"); + _this.set$__GuaranteeChannel__sink_F(t2); + t1 = t1._eval$1("StreamController<1>")._as(A.StreamController_StreamController(null, new A.GuaranteeChannel_closure(_box_0, _this, $T), true, $T)); + _this.__GuaranteeChannel__streamController_F !== $ && A.throwLateFieldAI("_streamController"); + _this.set$__GuaranteeChannel__streamController_F(t1); + }, + _onSinkDisconnected$0() { + var subscription, t1; + this._guarantee_channel$_disconnected = true; + subscription = this._guarantee_channel$_subscription; + if (subscription != null) + subscription.cancel$0(); + t1 = this.__GuaranteeChannel__streamController_F; + t1 === $ && A.throwLateFieldNI("_streamController"); + t1.close$0(); + }, + set$__GuaranteeChannel__sink_F(__GuaranteeChannel__sink_F) { + this.__GuaranteeChannel__sink_F = this.$ti._eval$1("_GuaranteeSink<1>")._as(__GuaranteeChannel__sink_F); + }, + set$__GuaranteeChannel__streamController_F(__GuaranteeChannel__streamController_F) { + this.__GuaranteeChannel__streamController_F = this.$ti._eval$1("StreamController<1>")._as(__GuaranteeChannel__streamController_F); + }, + set$_guarantee_channel$_subscription(_subscription) { + this._guarantee_channel$_subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription); + } + }; + A.GuaranteeChannel_closure.prototype = { + call$0() { + var t2, t3, + t1 = this.$this; + if (t1._guarantee_channel$_disconnected) + return; + t2 = this._box_0.innerStream; + t3 = t1.__GuaranteeChannel__streamController_F; + t3 === $ && A.throwLateFieldNI("_streamController"); + t1.set$_guarantee_channel$_subscription(t2.listen$3$onDone$onError(this.T._eval$1("~(0)")._as(t3.get$add(t3)), new A.GuaranteeChannel__closure(t1), t3.get$addError())); + }, + $signature: 0 + }; + A.GuaranteeChannel__closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1.__GuaranteeChannel__sink_F; + t2 === $ && A.throwLateFieldNI("_sink"); + t2._onStreamDisconnected$0(); + t1 = t1.__GuaranteeChannel__streamController_F; + t1 === $ && A.throwLateFieldNI("_streamController"); + t1.close$0(); + }, + $signature: 0 + }; + A._GuaranteeSink.prototype = { + add$1(_, data) { + var t1, _this = this; + _this.$ti._precomputed1._as(data); + if (_this._guarantee_channel$_closed) + throw A.wrapException(A.StateError$("Cannot add event after closing.")); + if (_this._guarantee_channel$_disconnected) + return; + t1 = _this._guarantee_channel$_inner; + t1._async$_target.add$1(0, t1.$ti._precomputed1._as(data)); + }, + addError$2(error, stackTrace) { + if (this._guarantee_channel$_closed) + throw A.wrapException(A.StateError$("Cannot add event after closing.")); + if (this._guarantee_channel$_disconnected) + return; + this._guarantee_channel$_addError$2(error, stackTrace); + }, + _guarantee_channel$_addError$2(error, stackTrace) { + this._guarantee_channel$_inner._async$_target.addError$2(error, stackTrace); + return; + }, + close$0() { + var _this = this; + if (_this._guarantee_channel$_closed) + return _this._doneCompleter.future; + _this._guarantee_channel$_closed = true; + if (!_this._guarantee_channel$_disconnected) { + _this._guarantee_channel$_channel._onSinkDisconnected$0(); + _this._doneCompleter.complete$1(_this._guarantee_channel$_inner._async$_target.close$0()); + } + return _this._doneCompleter.future; + }, + _onStreamDisconnected$0() { + this._guarantee_channel$_disconnected = true; + var t1 = this._doneCompleter; + if ((t1.future._async$_state & 30) === 0) + t1.complete$0(); + return; + }, + $isEventSink: 1, + $isStreamSink: 1 + }; + A.StreamChannelController.prototype = { + set$__StreamChannelController__local_F(__StreamChannelController__local_F) { + this.__StreamChannelController__local_F = this.$ti._eval$1("StreamChannel<1>")._as(__StreamChannelController__local_F); + }, + set$__StreamChannelController__foreign_F(__StreamChannelController__foreign_F) { + this.__StreamChannelController__foreign_F = this.$ti._eval$1("StreamChannel<1>")._as(__StreamChannelController__foreign_F); + } + }; + A.StreamChannelMixin.prototype = {$isStreamChannel: 1}; + A.EventStreamProvider.prototype = {}; + A._EventStream.prototype = { + listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError) { + var t1 = this.$ti; + t1._eval$1("~(1)?")._as(onData); + type$.nullable_void_Function._as(onDone); + return A._EventStreamSubscription$(this._target, this._eventType, onData, false, t1._precomputed1); + }, + listen$3$onDone$onError(onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(onData, null, onDone, onError); + } + }; + A._EventStreamSubscription.prototype = { + cancel$0() { + var _this = this, + emptyFuture = A.Future_Future$value(null, type$.void); + if (_this._target == null) + return emptyFuture; + _this._unlisten$0(); + _this._onData = _this._target = null; + return emptyFuture; + }, + onData$1(handleData) { + var t1, _this = this; + _this.$ti._eval$1("~(1)?")._as(handleData); + if (_this._target == null) + throw A.wrapException(A.StateError$("Subscription has been canceled.")); + _this._unlisten$0(); + if (handleData == null) + t1 = null; + else { + t1 = A._wrapZone(new A._EventStreamSubscription_onData_closure(handleData), type$.JSObject); + t1 = t1 == null ? null : type$.JavaScriptFunction._as(A.allowInterop(t1, type$.Function)); + } + _this._onData = t1; + _this._tryResume$0(); + }, + onError$1(handleError) { + }, + pause$0() { + if (this._target == null) + return; + ++this._pauseCount; + this._unlisten$0(); + }, + resume$0() { + var _this = this; + if (_this._target == null || _this._pauseCount <= 0) + return; + --_this._pauseCount; + _this._tryResume$0(); + }, + _tryResume$0() { + var _this = this, + t1 = _this._onData; + if (t1 != null && _this._pauseCount <= 0) + _this._target.addEventListener(_this._eventType, t1, false); + }, + _unlisten$0() { + var t1 = this._onData; + if (t1 != null) + this._target.removeEventListener(this._eventType, t1, false); + }, + $isStreamSubscription: 1 + }; + A._EventStreamSubscription_closure.prototype = { + call$1(e) { + return this.onData.call$1(type$.JSObject._as(e)); + }, + $signature: 1 + }; + A._EventStreamSubscription_onData_closure.prototype = { + call$1(e) { + return this.handleData.call$1(type$.JSObject._as(e)); + }, + $signature: 1 + }; + (function aliases() { + var _ = J.LegacyJavaScriptObject.prototype; + _.super$LegacyJavaScriptObject$toString = _.toString$0; + _ = A._BroadcastStreamController.prototype; + _.super$_BroadcastStreamController$_addEventError = _._addEventError$0; + _ = A._BufferingStreamSubscription.prototype; + _.super$_BufferingStreamSubscription$_add = _._async$_add$1; + _.super$_BufferingStreamSubscription$_addError = _._addError$2; + _.super$_BufferingStreamSubscription$_close = _._close$0; + _ = A._StreamSinkTransformer.prototype; + _.super$_StreamSinkTransformer$bind = _.bind$1; + _ = A.ListBase.prototype; + _.super$ListBase$setRange = _.setRange$4; + _ = A.Iterable.prototype; + _.super$Iterable$skipWhile = _.skipWhile$1; + _ = A.DelegatingStreamSink.prototype; + _.super$DelegatingStreamSink$close = _.close$0; + _ = A.Sqlite3Delegate.prototype; + _.super$Sqlite3Delegate$close = _.close$0; + })(); + (function installTearOffs() { + var _static_2 = hunkHelpers._static_2, + _static_1 = hunkHelpers._static_1, + _static_0 = hunkHelpers._static_0, + _static = hunkHelpers.installStaticTearOff, + _instance_0_u = hunkHelpers._instance_0u, + _instance = hunkHelpers.installInstanceTearOff, + _instance_2_u = hunkHelpers._instance_2u, + _instance_1_i = hunkHelpers._instance_1i, + _instance_1_u = hunkHelpers._instance_1u; + _static_2(J, "_interceptors_JSArray__compareAny$closure", "JSArray__compareAny", 91); + _static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 19); + _static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 19); + _static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 19); + _static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0); + _static_1(A, "async___nullDataHandler$closure", "_nullDataHandler", 12); + _static_2(A, "async___nullErrorHandler$closure", "_nullErrorHandler", 6); + _static_0(A, "async___nullDoneHandler$closure", "_nullDoneHandler", 0); + _static(A, "async___rootHandleUncaughtError$closure", 5, null, ["call$5"], ["_rootHandleUncaughtError"], 93, 0); + _static(A, "async___rootRun$closure", 4, null, ["call$1$4", "call$4"], ["_rootRun", function($self, $parent, zone, f) { + return A._rootRun($self, $parent, zone, f, type$.dynamic); + }], 94, 1); + _static(A, "async___rootRunUnary$closure", 5, null, ["call$2$5", "call$5"], ["_rootRunUnary", function($self, $parent, zone, f, arg) { + var t1 = type$.dynamic; + return A._rootRunUnary($self, $parent, zone, f, arg, t1, t1); + }], 95, 1); + _static(A, "async___rootRunBinary$closure", 6, null, ["call$3$6", "call$6"], ["_rootRunBinary", function($self, $parent, zone, f, arg1, arg2) { + var t1 = type$.dynamic; + return A._rootRunBinary($self, $parent, zone, f, arg1, arg2, t1, t1, t1); + }], 96, 1); + _static(A, "async___rootRegisterCallback$closure", 4, null, ["call$1$4", "call$4"], ["_rootRegisterCallback", function($self, $parent, zone, f) { + return A._rootRegisterCallback($self, $parent, zone, f, type$.dynamic); + }], 97, 0); + _static(A, "async___rootRegisterUnaryCallback$closure", 4, null, ["call$2$4", "call$4"], ["_rootRegisterUnaryCallback", function($self, $parent, zone, f) { + var t1 = type$.dynamic; + return A._rootRegisterUnaryCallback($self, $parent, zone, f, t1, t1); + }], 98, 0); + _static(A, "async___rootRegisterBinaryCallback$closure", 4, null, ["call$3$4", "call$4"], ["_rootRegisterBinaryCallback", function($self, $parent, zone, f) { + var t1 = type$.dynamic; + return A._rootRegisterBinaryCallback($self, $parent, zone, f, t1, t1, t1); + }], 99, 0); + _static(A, "async___rootErrorCallback$closure", 5, null, ["call$5"], ["_rootErrorCallback"], 100, 0); + _static(A, "async___rootScheduleMicrotask$closure", 4, null, ["call$4"], ["_rootScheduleMicrotask"], 101, 0); + _static(A, "async___rootCreateTimer$closure", 5, null, ["call$5"], ["_rootCreateTimer"], 102, 0); + _static(A, "async___rootCreatePeriodicTimer$closure", 5, null, ["call$5"], ["_rootCreatePeriodicTimer"], 103, 0); + _static(A, "async___rootPrint$closure", 4, null, ["call$4"], ["_rootPrint"], 104, 0); + _static_1(A, "async___printToZone$closure", "_printToZone", 105); + _static(A, "async___rootFork$closure", 5, null, ["call$5"], ["_rootFork"], 106, 0); + var _; + _instance_0_u(_ = A._BroadcastSubscription.prototype, "get$_onPause", "_onPause$0", 0); + _instance_0_u(_, "get$_onResume", "_onResume$0", 0); + _instance(A._Completer.prototype, "get$completeError", 0, 1, function() { + return [null]; + }, ["call$2", "call$1"], ["completeError$2", "completeError$1"], 30, 0, 0); + _instance(A._AsyncCompleter.prototype, "get$complete", 0, 0, function() { + return [null]; + }, ["call$1", "call$0"], ["complete$1", "complete$0"], 74, 0, 0); + _instance_2_u(A._Future.prototype, "get$_completeError", "_completeError$2", 6); + _instance_1_i(_ = A._StreamController.prototype, "get$add", "add$1", 7); + _instance(_, "get$addError", 0, 1, function() { + return [null]; + }, ["call$2", "call$1"], ["addError$2", "addError$1"], 30, 0, 0); + _instance_0_u(_ = A._ControllerSubscription.prototype, "get$_onPause", "_onPause$0", 0); + _instance_0_u(_, "get$_onResume", "_onResume$0", 0); + _instance_0_u(_ = A._BufferingStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0); + _instance_0_u(_, "get$_onResume", "_onResume$0", 0); + _instance_0_u(A._DoneStreamSubscription.prototype, "get$_onMicrotask", "_onMicrotask$0", 0); + _instance_1_u(_ = A._StreamIterator.prototype, "get$_async$_onData", "_async$_onData$1", 7); + _instance_2_u(_, "get$_onError", "_onError$2", 6); + _instance_0_u(_, "get$_onDone", "_onDone$0", 0); + _instance_0_u(_ = A._ForwardingStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0); + _instance_0_u(_, "get$_onResume", "_onResume$0", 0); + _instance_1_u(_, "get$_handleData", "_handleData$1", 7); + _instance_2_u(_, "get$_handleError", "_handleError$2", 84); + _instance_0_u(_, "get$_handleDone", "_handleDone$0", 0); + _instance_0_u(_ = A._SinkTransformerStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0); + _instance_0_u(_, "get$_onResume", "_onResume$0", 0); + _instance_1_u(_, "get$_handleData", "_handleData$1", 7); + _instance_2_u(_, "get$_handleError", "_handleError$2", 6); + _instance_0_u(_, "get$_handleDone", "_handleDone$0", 0); + _instance_1_u(A._StreamHandlerTransformer.prototype, "get$bind", "bind$1", "Stream<2>(Object?)"); + _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 25); + _static(A, "math__max$closure", 2, null, ["call$1$2", "call$2"], ["max", function(a, b) { + return A.max(a, b, type$.num); + }], 107, 1); + _static_1(A, "math__sqrt$closure", "sqrt", 5); + _static_1(A, "math__sin$closure", "sin", 5); + _static_1(A, "math__cos$closure", "cos", 5); + _static_1(A, "math__tan$closure", "tan", 5); + _static_1(A, "math__acos$closure", "acos", 5); + _static_1(A, "math__asin$closure", "asin", 5); + _static_1(A, "math__atan$closure", "atan", 5); + _static_1(A, "functions__applyDbFunctions$closure", "applyDbFunctions", 109); + _instance_1_u(A.DriftCommunication.prototype, "get$_handleMessage", "_handleMessage$1", 7); + _instance_1_u(A.DriftProtocol.prototype, "get$_decodeDbValue", "_decodeDbValue$1", 16); + _static_1(A, "delegates___defaultSavepoint$closure", "_defaultSavepoint", 20); + _static_1(A, "delegates___defaultRelease$closure", "_defaultRelease", 20); + _static_1(A, "delegates___defaultRollbackToSavepoint$closure", "_defaultRollbackToSavepoint", 20); + _static_1(A, "native_functions___pow$closure", "_pow", 29); + _static_1(A, "native_functions___regexpImpl$closure", "_regexpImpl", 111); + _static_1(A, "native_functions___containsImpl$closure", "_containsImpl", 112); + _instance_0_u(A.WasmVfs.prototype, "get$close", "close$0", 0); + _static_1(A, "sync_channel_MessageSerializer_readEmpty$closure", "MessageSerializer_readEmpty", 113); + _static_1(A, "sync_channel_MessageSerializer_readFlags$closure", "MessageSerializer_readFlags", 114); + _static_1(A, "sync_channel_MessageSerializer_readNameAndFlags$closure", "MessageSerializer_readNameAndFlags", 115); + _instance_1_u(A.VfsWorker.prototype, "get$_releaseImplicitLock", "_releaseImplicitLock$1", 68); + _instance_0_u(A.AsynchronousIndexedDbFileSystem.prototype, "get$close", "close$0", 0); + _instance_0_u(A.IndexedDbFileSystem.prototype, "get$close", "close$0", 2); + _instance_0_u(A._FunctionWorkItem.prototype, "get$run", "run$0", 0); + _instance_0_u(A._DeleteFileWorkItem.prototype, "get$run", "run$0", 2); + _instance_0_u(A._CreateFileWorkItem.prototype, "get$run", "run$0", 2); + _instance_0_u(A._WriteFileWorkItem.prototype, "get$run", "run$0", 2); + _instance_0_u(A.SimpleOpfsFileSystem.prototype, "get$close", "close$0", 0); + _static_1(A, "frame_Frame___parseVM_tearOff$closure", "Frame___parseVM_tearOff", 11); + _static_1(A, "frame_Frame___parseV8_tearOff$closure", "Frame___parseV8_tearOff", 11); + _static_1(A, "frame_Frame___parseFirefox_tearOff$closure", "Frame___parseFirefox_tearOff", 11); + _static_1(A, "frame_Frame___parseFriendly_tearOff$closure", "Frame___parseFriendly_tearOff", 11); + _static_1(A, "trace_Trace___parseVM_tearOff$closure", "Trace___parseVM_tearOff", 33); + _static_1(A, "trace_Trace___parseFriendly_tearOff$closure", "Trace___parseFriendly_tearOff", 33); + })(); + (function inheritance() { + var _mixin = hunkHelpers.mixin, + _inherit = hunkHelpers.inherit, + _inheritMany = hunkHelpers.inheritMany; + _inherit(A.Object, null); + _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Error, A.ListBase, A.Closure, A.SentinelValue, A.ListIterator, A.MappedIterator, A.WhereIterator, A.ExpandIterator, A.TakeIterator, A.SkipIterator, A.SkipWhileIterator, A.EmptyIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.Symbol, A._Record, A.MapView, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.JSInvocationMirror, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A._Required, A.MapBase, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A._SyncStarIterator, A.AsyncError, A.Stream, A._BufferingStreamSubscription, A._BroadcastStreamController, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.StreamTransformerBase, A._StreamController, A._SyncStreamControllerDispatch, A._AsyncStreamControllerDispatch, A._StreamSinkWrapper, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._DoneStreamSubscription, A._StreamIterator, A._EventSinkWrapper, A._HandlerEventSink, A._ZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A.SetBase, A._LinkedHashSetCell, A._LinkedHashSetIterator, A._LinkedListIterator, A.LinkedListEntry, A._MapBaseValueIterator, A._UnmodifiableMapMixin, A.Codec, A.Converter, A._Utf8Encoder, A._Utf8Decoder, A._BigIntImpl, A._FinalizationRegistryWrapper, A.DateTime, A.Duration, A._Enum, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.IntegerDivisionByZeroException, A.MapEntry, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.Expando, A.NullRejectionException, A._JSRandom, A._JSSecureRandom, A.DelegatingStreamSink, A.DefaultEquality, A.ListEquality, A.NonGrowableListMixin, A.UnmodifiableMapMixin, A.DriftCommunication, A._PendingRequest, A.ConnectionClosedException, A.DriftRemoteException, A.DriftProtocol, A.Message, A.ExecuteQuery, A.RequestCancellation, A.ExecuteBatchedStatement, A.RunNestedExecutorControl, A.EnsureOpen, A.ServerInfo, A.RunBeforeOpen, A.NotifyTablesUpdated, A.SelectResult, A.ServerImplementation, A._ServerDbUser, A.TableUpdate, A.CancellationToken, A.CancellationException, A.QueryExecutor, A.BatchedStatements, A.ArgumentsForBatchedStatement, A.QueryDelegate, A.TransactionDelegate, A.DbVersionDelegate, A.QueryResult, A.QueryInterceptor, A.OpeningDetails, A.PreparedStatementsCache, A.Lock, A.DedicatedDriftWorker, A.WasmInitializationMessage, A.DriftServerController, A.RunningWasmServer, A.WasmCompatibility, A.SharedDriftWorker, A.Context, A._PathDirection, A._PathRelation, A.Style, A.ParsedPath, A.PathException, A.SqliteException, A.AllowedArgumentCount, A.RawSqliteBindings, A.SqliteResult, A.RawSqliteDatabase, A.RawStatementCompiler, A.RawSqliteStatement, A.RawSqliteContext, A.RawSqliteValue, A.FinalizablePart, A.DatabaseImplementation, A.Sqlite3Implementation, A.CommonPreparedStatement, A.Cursor, A._Row_Object_UnmodifiableMapMixin, A._ResultIterator, A.IndexedParameters, A.VfsException, A.Sqlite3Filename, A.VirtualFileSystem, A.BaseVfsFile, A._CursorReader, A.WasmInstance, A.RequestResponseSynchronizer, A.MessageSerializer, A.Message0, A._ResolvedPath, A.VfsWorker, A._OpenedFileHandle, A.AsynchronousIndexedDbFileSystem, A._FileWriteRequest, A._OffsetAndBuffer, A._IndexedDbFile, A.WasmBindings, A._InjectedValues, A.DartCallbacks, A.RegisteredFunctionSet, A.Chain, A.Frame, A.LazyTrace, A.Trace, A.UnparsedFrame, A.StreamChannelMixin, A._GuaranteeSink, A.StreamChannelController, A.EventStreamProvider, A._EventStreamSubscription]); + _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]); + _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]); + _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]); + _inherit(J.JSUnmodifiableArray, J.JSArray); + _inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]); + _inheritMany(A.Iterable, [A._CastIterableBase, A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.ExpandIterable, A.TakeIterable, A.SkipIterable, A.SkipWhileIterable, A.WhereTypeIterable, A._KeysOrValues, A._AllMatchesIterable, A._StringAllMatchesIterable, A._SyncStarIterable, A.LinkedList]); + _inheritMany(A._CastIterableBase, [A.CastIterable, A.__CastListBase__CastIterableBase_ListMixin]); + _inherit(A._EfficientLengthCastIterable, A.CastIterable); + _inherit(A._CastListBase, A.__CastListBase__CastIterableBase_ListMixin); + _inherit(A.CastList, A._CastListBase); + _inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A._CyclicInitializationError, A.RuntimeError, A.AssertionError, A._Error, A.ArgumentError, A.NoSuchMethodError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]); + _inheritMany(A.ListBase, [A.UnmodifiableListBase, A.ValueList, A.WasmValueList]); + _inherit(A.CodeUnits, A.UnmodifiableListBase); + _inheritMany(A.Closure, [A.Closure0Args, A.Instantiation, A.Closure2Args, A.TearOffClosure, A.assertInteropArgs_closure, A.JsLinkedHashMap_values_closure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A._SyncBroadcastStreamController__sendData_closure, A._SyncBroadcastStreamController__sendError_closure, A._SyncBroadcastStreamController__sendDone_closure, A.Future_wait_closure, A._Future__chainForeignFuture_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A.Stream_length_closure, A.Stream_first_closure0, A.Stream_firstWhere_closure0, A.Stream_firstWhere__closure0, A._StreamHandlerTransformer_closure, A._CustomZone_bindUnaryCallback_closure, A._CustomZone_bindUnaryCallbackGuarded_closure, A._RootZone_bindUnaryCallback_closure, A._RootZone_bindUnaryCallbackGuarded_closure, A._HashMap_values_closure, A.MapBase_entries_closure, A._BigIntImpl_hashCode_finish, A._Uri__makePath_closure, A._createTables_setChars, A._createTables_setRange, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.dartify_convert, A.applyDbFunctions_closure, A.applyDbFunctions_closure0, A.DriftCommunication_setRequestHandler_closure, A.DriftProtocol_decodePayload_readInt, A.DriftProtocol_decodePayload_readNullableInt, A.ServerImplementation_closure, A.ServerImplementation_serve_closure, A.ServerImplementation_serve_closure0, A.ServerImplementation__waitForTurn_closure, A.QueryResult_asMap_closure, A.EnableNativeFunctions_useNativeFunctions_closure, A._unaryNumFunction_closure, A.LazyDatabase__awaitOpened_closure, A.LazyDatabase_ensureOpen_closure, A.Lock_synchronized_closure, A.WebPortToChannel_channel_closure, A.WebPortToChannel_channel_closure0, A.DedicatedDriftWorker_start_closure, A.checkIndexedDbExists_closure, A.opfsDatabases_closure, A.DriftServerController_serve___closure, A.RunningWasmServer_serve_closure, A.CompleteIdbRequest_complete_closure1, A.CompleteIdbRequest_complete_closure2, A.SharedDriftWorker_start_closure, A.SharedDriftWorker__newConnection_closure, A.SharedDriftWorker__startFeatureDetection_result, A.SharedDriftWorker__startFeatureDetection_closure, A.SharedDriftWorker__startFeatureDetection_closure0, A.Context_joinAll_closure, A.Context_split_closure, A._validateArgList_closure, A.WindowsStyle_absolutePathToUri_closure, A.SqliteException_toString_closure, A.disposeFinalizer_closure, A.AsyncJavaScriptIteratable_listen_fetchNext_closure, A._CursorReader_moveNext_closure, A._CursorReader_moveNext_closure0, A.CompleteIdbRequest_complete_closure, A.CompleteIdbRequest_complete_closure0, A.CompleteOpenIdbRequest_completeOrBlocked_closure, A.CompleteOpenIdbRequest_completeOrBlocked_closure0, A.CompleteOpenIdbRequest_completeOrBlocked_closure1, A.AsynchronousIndexedDbFileSystem_open_closure, A.AsynchronousIndexedDbFileSystem__readFile_closure, A.AsynchronousIndexedDbFileSystem__write_closure, A.SimpleOpfsFileSystem_inDirectory_open, A._InjectedValues_closure, A._InjectedValues_closure0, A._InjectedValues_closure1, A._InjectedValues_closure2, A._InjectedValues_closure3, A._InjectedValues_closure4, A._InjectedValues_closure7, A._InjectedValues_closure8, A._InjectedValues_closure9, A._InjectedValues_closure10, A._InjectedValues_closure17, A._InjectedValues_closure18, A._InjectedValues_closure19, A._InjectedValues_closure20, A._InjectedValues_closure21, A._InjectedValues_closure22, A._InjectedValues_closure23, A._InjectedValues_closure24, A.Chain_Chain$parse_closure, A.Chain_toTrace_closure, A.Chain_toString_closure0, A.Chain_toString__closure0, A.Chain_toString_closure, A.Chain_toString__closure, A.Trace__parseVM_closure, A.Trace$parseV8_closure, A.Trace$parseJSCore_closure, A.Trace$parseFirefox_closure, A.Trace$parseFriendly_closure, A.Trace_toString_closure0, A.Trace_toString_closure, A._EventStreamSubscription_closure, A._EventStreamSubscription_onData_closure]); + _inheritMany(A.Closure0Args, [A.nullFuture_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._TimerImpl$periodic_closure, A.Future_Future_closure, A.Future_Future$delayed_closure, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainForeignFuture_closure1, A._Future__chainCoreFutureAsync_closure, A._Future__asyncCompleteWithValue_closure, A._Future__asyncCompleteError_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A.Stream_length_closure0, A.Stream_first_closure, A.Stream_firstWhere_closure, A.Stream_firstWhere__closure, A._StreamController__subscribe_closure, A._StreamController__recordCancel_complete, A._BufferingStreamSubscription__sendError_sendError, A._BufferingStreamSubscription__sendDone_sendDone, A._PendingEvents_schedule_closure, A._cancelAndError_closure, A._cancelAndValue_closure, A._CustomZone_bindCallback_closure, A._CustomZone_bindCallbackGuarded_closure, A._rootHandleError_closure, A._RootZone_bindCallback_closure, A._RootZone_bindCallbackGuarded_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A.DriftCommunication_closure, A.ServerImplementation__handleRequest_closure, A.ServerImplementation__handleRequest_closure0, A.ServerImplementation__waitForTurn_idIsActive, A.runCancellable_closure, A._BaseExecutor__synchronized_closure, A._BaseExecutor_runSelect_closure, A._BaseExecutor_runDelete_closure, A._BaseExecutor_runInsert_closure, A._BaseExecutor_runCustom_closure, A._BaseExecutor_runBatched_closure, A._StatementBasedTransactionExecutor_ensureOpen_closure, A._StatementBasedTransactionExecutor_ensureOpen_closure0, A.DelegatedDatabase_ensureOpen_closure, A.DelegatedDatabase_close_closure, A._ExclusiveExecutor_ensureOpen_closure, A.Lock_synchronized_callBlockAndComplete, A.WebPortToChannel_channel_closure1, A.DedicatedDriftWorker__handleMessage_closure, A.DriftServerController_serve_closure, A.DriftServerController_serve__closure, A.DriftServerController_serve__closure0, A.DriftServerController_serve__closure1, A.DatabaseImplementation__prepareInternal_freeIntermediateResults, A.AsyncJavaScriptIteratable_listen_fetchNext, A.AsyncJavaScriptIteratable_listen_fetchNextIfNecessary, A.AsynchronousIndexedDbFileSystem_readFully_closure, A._FileWriteRequest__updateBlock_closure, A.IndexedDbFileSystem__startWorkingIfNeeded_closure, A._IndexedDbFile_xTruncate_closure, A._InjectedValues__closure13, A._InjectedValues__closure12, A._InjectedValues__closure11, A._InjectedValues__closure10, A._InjectedValues__closure9, A._InjectedValues__closure8, A._InjectedValues__closure7, A._InjectedValues__closure6, A._InjectedValues__closure5, A._InjectedValues__closure4, A._InjectedValues__closure3, A._InjectedValues__closure2, A._InjectedValues__closure1, A._InjectedValues__closure0, A._InjectedValues__closure, A.Frame_Frame$parseVM_closure, A.Frame_Frame$parseV8_closure, A.Frame_Frame$_parseFirefoxEval_closure, A.Frame_Frame$parseFirefox_closure, A.Frame_Frame$parseFriendly_closure, A.Trace_Trace$from_closure, A.GuaranteeChannel_closure, A.GuaranteeChannel__closure]); + _inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.EmptyIterable, A.LinkedHashMapKeyIterable, A._HashMapKeyIterable, A._MapBaseValueIterable]); + _inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A.ReversedListIterable]); + _inherit(A.EfficientLengthMappedIterable, A.MappedIterable); + _inherit(A.EfficientLengthTakeIterable, A.TakeIterable); + _inherit(A.EfficientLengthSkipIterable, A.SkipIterable); + _inherit(A._Record2, A._Record); + _inheritMany(A._Record2, [A._Record_2, A._Record_2_file_outFlags]); + _inherit(A._UnmodifiableMapView_MapView__UnmodifiableMapMixin, A.MapView); + _inherit(A.UnmodifiableMapView, A._UnmodifiableMapView_MapView__UnmodifiableMapMixin); + _inherit(A.ConstantMapView, A.UnmodifiableMapView); + _inherit(A.ConstantStringMap, A.ConstantMap); + _inherit(A.Instantiation1, A.Instantiation); + _inheritMany(A.Closure2Args, [A.Primitives_functionNoSuchMethod_closure, A.JsLinkedHashMap_addAll_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A.Future_wait_handleError, A._Future__chainForeignFuture_closure0, A._cancelAndErrorClosure_closure, A.HashMap_HashMap$from_closure, A.MapBase_mapToString_closure, A._BigIntImpl_hashCode_combine, A.NoSuchMethodError_toString_closure, A.Uri__parseIPv4Address_error, A.Uri_parseIPv6Address_error, A.Uri_parseIPv6Address_parseHex, A._createTables_build, A.WasmInitializationMessage_sendToWorker_closure, A.WasmInitializationMessage_sendToPort_closure, A.WasmInitializationMessage_sendToClient_closure, A.DatabaseImplementation_createFunction_closure, A.WasmInstance_load_closure, A.WasmInstance_load__closure, A.AsynchronousIndexedDbFileSystem__write_writeBlock, A._InjectedValues_closure5, A._InjectedValues_closure6, A._InjectedValues_closure11, A._InjectedValues_closure12, A._InjectedValues_closure13, A._InjectedValues_closure14, A._InjectedValues_closure15, A._InjectedValues_closure16, A.Frame_Frame$parseV8_closure_parseLocation]); + _inherit(A.NullError, A.TypeError); + _inheritMany(A.TearOffClosure, [A.StaticClosure, A.BoundClosure]); + _inherit(A._AssertionError, A.AssertionError); + _inheritMany(A.MapBase, [A.JsLinkedHashMap, A._HashMap]); + _inheritMany(A.NativeTypedData, [A.NativeByteData, A.NativeTypedArray]); + _inheritMany(A.NativeTypedArray, [A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin]); + _inherit(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin); + _inherit(A.NativeTypedArrayOfDouble, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin); + _inherit(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin); + _inherit(A.NativeTypedArrayOfInt, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin); + _inheritMany(A.NativeTypedArrayOfDouble, [A.NativeFloat32List, A.NativeFloat64List]); + _inheritMany(A.NativeTypedArrayOfInt, [A.NativeInt16List, A.NativeInt32List, A.NativeInt8List, A.NativeUint16List, A.NativeUint32List, A.NativeUint8ClampedList, A.NativeUint8List]); + _inherit(A._TypeError, A._Error); + _inheritMany(A.Stream, [A._StreamImpl, A._ForwardingStream, A._BoundSinkStream, A.AsyncJavaScriptIteratable, A._CloseGuaranteeStream, A._EventStream]); + _inherit(A._ControllerStream, A._StreamImpl); + _inherit(A._BroadcastStream, A._ControllerStream); + _inheritMany(A._BufferingStreamSubscription, [A._ControllerSubscription, A._ForwardingStreamSubscription, A._SinkTransformerStreamSubscription]); + _inherit(A._BroadcastSubscription, A._ControllerSubscription); + _inherit(A._SyncBroadcastStreamController, A._BroadcastStreamController); + _inheritMany(A._Completer, [A._AsyncCompleter, A._SyncCompleter]); + _inheritMany(A._StreamController, [A._AsyncStreamController, A._SyncStreamController]); + _inheritMany(A._DelayedEvent, [A._DelayedData, A._DelayedError]); + _inherit(A._MapStream, A._ForwardingStream); + _inherit(A._StreamSinkTransformer, A.StreamTransformerBase); + _inherit(A._StreamHandlerTransformer, A._StreamSinkTransformer); + _inheritMany(A._Zone, [A._CustomZone, A._RootZone]); + _inherit(A._IdentityHashMap, A._HashMap); + _inherit(A._SetBase, A.SetBase); + _inherit(A._LinkedHashSet, A._SetBase); + _inheritMany(A.Codec, [A.Encoding, A.Base64Codec, A._FusedCodec]); + _inheritMany(A.Encoding, [A.AsciiCodec, A.Utf8Codec]); + _inheritMany(A.Converter, [A._UnicodeSubsetEncoder, A.Base64Encoder, A.Utf8Encoder]); + _inherit(A.AsciiEncoder, A._UnicodeSubsetEncoder); + _inheritMany(A.ArgumentError, [A.RangeError, A.IndexError]); + _inherit(A._DataUri, A._Uri); + _inheritMany(A.Message, [A.Request, A.SuccessResponse, A.ErrorResponse, A.CancelledResponse]); + _inheritMany(A._Enum, [A.NoArgsRequest, A.StatementMethod, A.NestedExecutorControl, A.UpdateKind, A.SqlDialect, A.ProtocolVersion, A.WasmStorageImplementation, A.WebStorageApi, A.OpenMode, A.WorkerOperation, A.FileType]); + _inherit(A.DatabaseDelegate, A.QueryDelegate); + _inherit(A.NoTransactionDelegate, A.TransactionDelegate); + _inheritMany(A.DbVersionDelegate, [A.NoVersionDelegate, A.DynamicVersionDelegate]); + _inheritMany(A.QueryExecutor, [A._BaseExecutor, A._InterceptedExecutor, A.LazyDatabase]); + _inheritMany(A._BaseExecutor, [A._TransactionExecutor, A.DelegatedDatabase, A._BeforeOpeningExecutor, A._ExclusiveExecutor]); + _inherit(A._StatementBasedTransactionExecutor, A._TransactionExecutor); + _inherit(A._InterceptedTransactionExecutor, A._InterceptedExecutor); + _inherit(A.Sqlite3Delegate, A.DatabaseDelegate); + _inherit(A._SqliteVersionDelegate, A.DynamicVersionDelegate); + _inheritMany(A.WasmInitializationMessage, [A.CompatibilityResult, A.WorkerError, A.ServeDriftDatabase, A.RequestCompatibilityCheck, A.StartFileSystemServer, A.DeleteDatabase]); + _inheritMany(A.CompatibilityResult, [A.SharedWorkerCompatibilityResult, A.DedicatedWorkerCompatibilityResult]); + _inherit(A._CloseVfsOnClose, A.QueryInterceptor); + _inherit(A.WasmDatabase, A.DelegatedDatabase); + _inherit(A._WasmDelegate, A.Sqlite3Delegate); + _inherit(A.InternalStyle, A.Style); + _inheritMany(A.InternalStyle, [A.PosixStyle, A.UrlStyle, A.WindowsStyle]); + _inheritMany(A.FinalizablePart, [A.FinalizableDatabase, A.FinalizableStatement]); + _inherit(A.StatementImplementation, A.CommonPreparedStatement); + _inherit(A._ResultSet_Cursor_ListMixin, A.Cursor); + _inherit(A._ResultSet_Cursor_ListMixin_NonGrowableListMixin, A._ResultSet_Cursor_ListMixin); + _inherit(A.ResultSet, A._ResultSet_Cursor_ListMixin_NonGrowableListMixin); + _inherit(A._Row_Object_UnmodifiableMapMixin_MapMixin, A._Row_Object_UnmodifiableMapMixin); + _inherit(A.Row, A._Row_Object_UnmodifiableMapMixin_MapMixin); + _inherit(A.BaseVirtualFileSystem, A.VirtualFileSystem); + _inherit(A.WasmSqliteBindings, A.RawSqliteBindings); + _inherit(A.WasmDatabase0, A.RawSqliteDatabase); + _inherit(A.WasmStatementCompiler, A.RawStatementCompiler); + _inherit(A.WasmStatement, A.RawSqliteStatement); + _inherit(A.WasmContext, A.RawSqliteContext); + _inherit(A.WasmValue, A.RawSqliteValue); + _inherit(A.WasmSqlite3, A.Sqlite3Implementation); + _inheritMany(A.BaseVirtualFileSystem, [A.WasmVfs, A.IndexedDbFileSystem, A.InMemoryFileSystem, A.SimpleOpfsFileSystem]); + _inheritMany(A.BaseVfsFile, [A.WasmFile, A._InMemoryFile, A._SimpleOpfsFile]); + _inheritMany(A.Message0, [A.EmptyMessage, A.Flags]); + _inherit(A.NameAndInt32Flags, A.Flags); + _inherit(A._IndexedDbWorkItem, A.LinkedListEntry); + _inheritMany(A._IndexedDbWorkItem, [A._FunctionWorkItem, A._DeleteFileWorkItem, A._CreateFileWorkItem, A._WriteFileWorkItem]); + _inheritMany(A.StreamChannelMixin, [A.CloseGuaranteeChannel, A.GuaranteeChannel]); + _inherit(A._CloseGuaranteeSink, A.DelegatingStreamSink); + _mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin); + _mixin(A.__CastListBase__CastIterableBase_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); + _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); + _mixin(A._AsyncStreamController, A._AsyncStreamControllerDispatch); + _mixin(A._SyncStreamController, A._SyncStreamControllerDispatch); + _mixin(A._UnmodifiableMapView_MapView__UnmodifiableMapMixin, A._UnmodifiableMapMixin); + _mixin(A._ResultSet_Cursor_ListMixin, A.ListBase); + _mixin(A._ResultSet_Cursor_ListMixin_NonGrowableListMixin, A.NonGrowableListMixin); + _mixin(A._Row_Object_UnmodifiableMapMixin, A.UnmodifiableMapMixin); + _mixin(A._Row_Object_UnmodifiableMapMixin_MapMixin, A.MapBase); + })(); + var init = { + typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []}, + mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List", Object: "Object", Map: "Map"}, + mangledNames: {}, + types: ["~()", "~(JSObject)", "Future<~>()", "bool(String)", "int(int,int)", "double(num)", "~(Object,StackTrace)", "~(Object?)", "Null()", "Null(JSObject)", "Frame()", "Frame(String)", "~(@)", "int(int)", "Future()", "Null(int)", "Object?(Object?)", "~(JSObject?,List?)", "Null(int,int,int)", "~(~())", "String(int)", "int(int,int,int,int)", "bool(~)", "@()", "Null(@)", "String(String)", "~(Uint8List,String,int)", "String(List)", "Future()", "num?(List)", "~(Object[StackTrace?])", "int(int,int,int,int,int)", "int(int,int,int)", "Trace(String)", "int(int,int,int,JavaScriptBigInt)", "int(Frame)", "String(Frame)", "bool()", "@(@,String)", "bool(Object?)", "Future<@>()", "CancellationToken<@>?()", "Future()", "~(String,int)", "@(@)", "int()", "Future()", "Map(List)", "int(List)", "~(String,int?)", "Null(QueryExecutor)", "Future(~)", "Null(@,StackTrace)", "~(int,@)", "~(@,@)", "JSObject(JSArray)", "RunningWasmServer()", "Future()", "Null(bool)", "~(EventSink)", "~(bool,bool,bool,List<+(WebStorageApi,String)>)", "~(Object?,Object?)", "String(String?)", "String(Object?)", "~(RawSqliteContext,List)", "~(FinalizablePart)", "~(String,Map)", "~(String,Object?)", "~(_OpenedFileHandle)", "JSObject(JSObject?)", "Future<~>(int,Uint8List)", "Future<~>(int)", "Uint8List()", "Future(String)", "~([Object?])", "Uint8List(@,@)", "Null(~())", "~(String,@)", "Null(int,int)", "~(Symbol0,@)", "int(int,JavaScriptBigInt)", "Null(Object,StackTrace)", "Null(int,int,int,int,JavaScriptBigInt)", "List(Trace)", "~(@,StackTrace)", "Future<~>(Request)", "String(Trace)", "int?(int)", "_Future<@>(@)", "Frame(String,String)", "Trace()", "int(@,@)", "Null(~)", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)", "0^()(Zone,ZoneDelegate,Zone,0^())", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "~(String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map?)", "0^(0^,0^)", "@(Request)", "~(CommonDatabase)", "@(String)", "bool?(List)", "bool(List<@>)", "EmptyMessage(MessageSerializer)", "Flags(MessageSerializer)", "NameAndInt32Flags(MessageSerializer)", "int(Trace)", "Future()"], + interceptorsByTag: null, + leafTags: null, + arrayRti: Symbol("$ti"), + rttc: { + "2;": (t1, t2) => o => o instanceof A._Record_2 && t1._is(o._0) && t2._is(o._1), + "2;file,outFlags": (t1, t2) => o => o instanceof A._Record_2_file_outFlags && t1._is(o._0) && t2._is(o._1) + } + }; + A._Universe_addRules(init.typeUniverse, JSON.parse('{"JavaScriptFunction":"LegacyJavaScriptObject","PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"]},"JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"]},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[],"Comparable":["num"]},"JSInt":{"double":[],"int":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Comparable":["String"],"Pattern":[],"JSIndexable":["@"],"TrustedGetRuntimeType":[]},"_CastIterableBase":{"Iterable":["2"]},"CastIterator":{"Iterator":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","Iterable.E":"2"},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListIterable.E":"2","Iterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"ExpandIterable":{"Iterable":["2"],"Iterable.E":"2"},"ExpandIterator":{"Iterator":["2"]},"TakeIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthTakeIterable":{"TakeIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"TakeIterator":{"Iterator":["1"]},"SkipIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthSkipIterable":{"SkipIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"SkipIterator":{"Iterator":["1"]},"SkipWhileIterable":{"Iterable":["1"],"Iterable.E":"1"},"SkipWhileIterator":{"Iterator":["1"]},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"EmptyIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"Symbol":{"Symbol0":[]},"_Record_2":{"_Record2":[],"_Record":[]},"_Record_2_file_outFlags":{"_Record2":[],"_Record":[]},"ConstantMapView":{"UnmodifiableMapView":["1","2"],"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"_KeysOrValuesOrElementsIterator":{"Iterator":["1"]},"Instantiation":{"Closure":[],"Function":[]},"Instantiation1":{"Closure":[],"Function":[]},"JSInvocationMirror":{"Invocation":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"NullThrownFromJavaScriptException":{"Exception":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Closure":[],"Function":[]},"Closure2Args":{"Closure":[],"Function":[]},"TearOffClosure":{"Closure":[],"Function":[]},"StaticClosure":{"Closure":[],"Function":[]},"BoundClosure":{"Closure":[],"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"_Record2":{"_Record":[]},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeByteData":{"ByteData":[],"JSObject":[],"TrustedGetRuntimeType":[]},"NativeInt32List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Int32List":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint8List":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeTypedData":{"JSObject":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSObject":[],"JSIndexable":["1"]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"NativeTypedArrayOfDouble":[],"ListBase":["double"],"Float32List":[],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeFloat64List":{"NativeTypedArrayOfDouble":[],"ListBase":["double"],"Float64List":[],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeInt16List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Int16List":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt8List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Int8List":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint16List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint16List":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint32List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint32List":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8ClampedList":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint8ClampedList":[],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"AsyncError":{"Error":[]},"_Future":{"Future":["1"]},"MultiStreamController":{"StreamController":["1"],"StreamSink":["1"],"EventSink":["1"]},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_HandlerEventSink":{"EventSink":["1"]},"_TimerImpl":{"Timer":[]},"_AsyncAwaitCompleter":{"Completer":["1"]},"_SyncStarIterator":{"Iterator":["1"]},"_SyncStarIterable":{"Iterable":["1"],"Iterable.E":"1"},"_BroadcastStream":{"_ControllerStream":["1"],"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_BroadcastSubscription":{"_ControllerSubscription":["1"],"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_BroadcastStreamController":{"StreamController":["1"],"StreamSink":["1"],"EventSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncBroadcastStreamController":{"_BroadcastStreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"EventSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_Completer":{"Completer":["1"]},"_AsyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_SyncCompleter":{"_Completer":["1"],"Completer":["1"]},"StreamTransformerBase":{"StreamTransformer":["1","2"]},"_StreamController":{"StreamController":["1"],"StreamSink":["1"],"EventSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_AsyncStreamController":{"_AsyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"EventSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncStreamController":{"_SyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"EventSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamSinkWrapper":{"StreamSink":["1"],"EventSink":["1"]},"_StreamImpl":{"Stream":["1"]},"_DelayedData":{"_DelayedEvent":["1"]},"_DelayedError":{"_DelayedEvent":["@"]},"_DelayedDone":{"_DelayedEvent":["@"]},"_DoneStreamSubscription":{"StreamSubscription":["1"]},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_MapStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2"},"_EventSinkWrapper":{"EventSink":["1"]},"_SinkTransformerStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_StreamSinkTransformer":{"StreamTransformer":["1","2"]},"_BoundSinkStream":{"Stream":["2"],"Stream.T":"2"},"_StreamHandlerTransformer":{"_StreamSinkTransformer":["1","2"],"StreamTransformer":["1","2"]},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"_Zone":[],"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_HashMap":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"_LinkedHashSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_LinkedHashSetIterator":{"Iterator":["1"]},"LinkedList":{"Iterable":["1"],"Iterable.E":"1"},"_LinkedListIterator":{"Iterator":["1"]},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"_MapBaseValueIterable":{"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_MapBaseValueIterator":{"Iterator":["2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"AsciiCodec":{"Codec":["String","List"]},"_UnicodeSubsetEncoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"AsciiEncoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"Base64Codec":{"Codec":["List","String"]},"Base64Encoder":{"Converter":["List","String"],"StreamTransformer":["List","String"]},"_FusedCodec":{"Codec":["1","3"]},"Converter":{"StreamTransformer":["1","2"]},"Encoding":{"Codec":["String","List"]},"Utf8Codec":{"Codec":["String","List"]},"Utf8Encoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"BigInt":{"Comparable":["BigInt"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"Duration":{"Comparable":["Duration"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExpMatch":{"Match":[]},"String":{"Comparable":["String"],"Pattern":[]},"_BigIntImpl":{"BigInt":[],"Comparable":["BigInt"]},"_Enum":{"Enum":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"NoSuchMethodError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_Exception":{"Exception":[]},"FormatException":{"Exception":[]},"IntegerDivisionByZeroException":{"Exception":[],"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"NullRejectionException":{"Exception":[]},"_JSRandom":{"Random":[]},"_JSSecureRandom":{"Random":[]},"DelegatingStreamSink":{"StreamSink":["1"],"EventSink":["1"]},"ConnectionClosedException":{"Exception":[]},"DriftRemoteException":{"Exception":[]},"Request":{"Message":[]},"StatementMethod":{"Enum":[]},"NestedExecutorControl":{"Enum":[]},"SuccessResponse":{"Message":[]},"ErrorResponse":{"Message":[]},"CancelledResponse":{"Message":[]},"NoArgsRequest":{"Enum":[]},"ServerImplementation":{"DriftServer":[]},"_ServerDbUser":{"QueryExecutorUser":[]},"UpdateKind":{"Enum":[]},"CancellationException":{"Exception":[]},"NoVersionDelegate":{"DbVersionDelegate":[]},"DynamicVersionDelegate":{"DbVersionDelegate":[]},"_BaseExecutor":{"QueryExecutor":[]},"_TransactionExecutor":{"_BaseExecutor":[],"TransactionExecutor":[],"QueryExecutor":[]},"_StatementBasedTransactionExecutor":{"_BaseExecutor":[],"TransactionExecutor":[],"QueryExecutor":[]},"DelegatedDatabase":{"_BaseExecutor":[],"QueryExecutor":[]},"_BeforeOpeningExecutor":{"_BaseExecutor":[],"QueryExecutor":[]},"_ExclusiveExecutor":{"_BaseExecutor":[],"QueryExecutor":[]},"_InterceptedExecutor":{"QueryExecutor":[]},"_InterceptedTransactionExecutor":{"TransactionExecutor":[],"QueryExecutor":[]},"SqlDialect":{"Enum":[]},"Sqlite3Delegate":{"DatabaseDelegate":[]},"_SqliteVersionDelegate":{"DbVersionDelegate":[]},"LazyDatabase":{"QueryExecutor":[]},"SharedWorkerCompatibilityResult":{"WasmInitializationMessage":[]},"ProtocolVersion":{"Enum":[]},"CompatibilityResult":{"WasmInitializationMessage":[]},"WorkerError":{"WasmInitializationMessage":[],"Exception":[]},"ServeDriftDatabase":{"WasmInitializationMessage":[]},"RequestCompatibilityCheck":{"WasmInitializationMessage":[]},"DedicatedWorkerCompatibilityResult":{"WasmInitializationMessage":[]},"StartFileSystemServer":{"WasmInitializationMessage":[]},"DeleteDatabase":{"WasmInitializationMessage":[]},"_CloseVfsOnClose":{"QueryInterceptor":[]},"WasmStorageImplementation":{"Enum":[]},"WebStorageApi":{"Enum":[]},"WasmDatabase":{"DelegatedDatabase":[],"_BaseExecutor":[],"QueryExecutor":[]},"_WasmDelegate":{"Sqlite3Delegate":["CommonDatabase"],"DatabaseDelegate":[],"Sqlite3Delegate.0":"CommonDatabase"},"PathException":{"Exception":[]},"PosixStyle":{"InternalStyle":[]},"UrlStyle":{"InternalStyle":[]},"WindowsStyle":{"InternalStyle":[]},"SqliteException":{"Exception":[]},"FinalizableDatabase":{"FinalizablePart":[]},"DatabaseImplementation":{"CommonDatabase":[]},"ValueList":{"ListBase":["Object?"],"List":["Object?"],"EfficientLengthIterable":["Object?"],"Iterable":["Object?"],"ListBase.E":"Object?"},"Sqlite3Implementation":{"CommonSqlite3":[]},"FinalizableStatement":{"FinalizablePart":[]},"StatementImplementation":{"CommonPreparedStatement":[]},"Row":{"UnmodifiableMapMixin":["String","@"],"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"ResultSet":{"ListBase":["Row"],"NonGrowableListMixin":["Row"],"List":["Row"],"EfficientLengthIterable":["Row"],"Cursor":[],"Iterable":["Row"],"ListBase.E":"Row"},"_ResultIterator":{"Iterator":["Row"]},"OpenMode":{"Enum":[]},"IndexedParameters":{"StatementParameters":[]},"VfsException":{"Exception":[]},"BaseVirtualFileSystem":{"VirtualFileSystem":[]},"BaseVfsFile":{"VirtualFileSystemFile":[]},"WasmValue":{"RawSqliteValue":[]},"WasmSqliteBindings":{"RawSqliteBindings":[]},"WasmDatabase0":{"RawSqliteDatabase":[]},"WasmStatement":{"RawSqliteStatement":[]},"WasmContext":{"RawSqliteContext":[]},"WasmValueList":{"ListBase":["WasmValue"],"List":["WasmValue"],"EfficientLengthIterable":["WasmValue"],"Iterable":["WasmValue"],"ListBase.E":"WasmValue"},"AsyncJavaScriptIteratable":{"Stream":["1"],"Stream.T":"1"},"WasmSqlite3":{"CommonSqlite3":[]},"WasmVfs":{"VirtualFileSystem":[]},"WasmFile":{"VirtualFileSystemFile":[]},"WorkerOperation":{"Enum":[]},"EmptyMessage":{"Message0":[]},"Flags":{"Message0":[]},"NameAndInt32Flags":{"Flags":[],"Message0":[]},"IndexedDbFileSystem":{"VirtualFileSystem":[]},"_IndexedDbWorkItem":{"LinkedListEntry":["_IndexedDbWorkItem"]},"_IndexedDbFile":{"VirtualFileSystemFile":[]},"_FunctionWorkItem":{"_IndexedDbWorkItem":[],"LinkedListEntry":["_IndexedDbWorkItem"],"LinkedListEntry.E":"_IndexedDbWorkItem"},"_DeleteFileWorkItem":{"_IndexedDbWorkItem":[],"LinkedListEntry":["_IndexedDbWorkItem"],"LinkedListEntry.E":"_IndexedDbWorkItem"},"_CreateFileWorkItem":{"_IndexedDbWorkItem":[],"LinkedListEntry":["_IndexedDbWorkItem"],"LinkedListEntry.E":"_IndexedDbWorkItem"},"_WriteFileWorkItem":{"_IndexedDbWorkItem":[],"LinkedListEntry":["_IndexedDbWorkItem"],"LinkedListEntry.E":"_IndexedDbWorkItem"},"InMemoryFileSystem":{"VirtualFileSystem":[]},"_InMemoryFile":{"VirtualFileSystemFile":[]},"FileType":{"Enum":[]},"SimpleOpfsFileSystem":{"VirtualFileSystem":[]},"_SimpleOpfsFile":{"VirtualFileSystemFile":[]},"Chain":{"StackTrace":[]},"LazyTrace":{"Trace":[],"StackTrace":[]},"Trace":{"StackTrace":[]},"UnparsedFrame":{"Frame":[]},"CloseGuaranteeChannel":{"StreamChannelMixin":["1"],"StreamChannel":["1"]},"_CloseGuaranteeStream":{"Stream":["1"],"Stream.T":"1"},"_CloseGuaranteeSink":{"DelegatingStreamSink":["1"],"StreamSink":["1"],"EventSink":["1"]},"GuaranteeChannel":{"StreamChannelMixin":["1"],"StreamChannel":["1"]},"_GuaranteeSink":{"StreamSink":["1"],"EventSink":["1"]},"StreamChannelMixin":{"StreamChannel":["1"]},"_EventStream":{"Stream":["1"],"Stream.T":"1"},"_EventStreamSubscription":{"StreamSubscription":["1"]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]}}')); + A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"NativeTypedArray":1,"StreamTransformerBase":2,"_DelayedEvent":1,"_SetBase":1,"AggregateContext":1}')); + var string$ = { + ______: "===== asynchronous gap ===========================\n", + Cannoteff: "Cannot extract a file path from a URI with a fragment component", + Cannotefq: "Cannot extract a file path from a URI with a query component", + Cannoten: "Cannot extract a non-Windows file path from a file URI with an authority", + Cannotf: "Cannot fire new event. Controller is already firing an event", + Dart_f: "Dart function requires `allowInterop` to be passed to JavaScript.", + Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type", + Tried_: "Tried to operate on a released prepared statement", + max_mu: "max must be in range 0 < max \u2264 2^32, was " + }; + var type$ = (function rtii() { + var findType = A.findType; + return { + AggregateContext_nullable_Object: findType("AggregateContext"), + AsyncError: findType("AsyncError"), + AsyncJavaScriptIteratable_JSArray_nullable_Object: findType("AsyncJavaScriptIteratable>"), + ByteBuffer: findType("ByteBuffer"), + ByteData: findType("ByteData"), + CancellationToken_dynamic: findType("CancellationToken<@>"), + CommonPreparedStatement: findType("CommonPreparedStatement"), + Comparable_dynamic: findType("Comparable<@>"), + ConstantMapView_Symbol_dynamic: findType("ConstantMapView"), + DateTime: findType("DateTime"), + DedicatedWorkerCompatibilityResult: findType("DedicatedWorkerCompatibilityResult"), + DriftCommunication: findType("DriftCommunication"), + Duration: findType("Duration"), + EfficientLengthIterable_dynamic: findType("EfficientLengthIterable<@>"), + EmptyMessage: findType("EmptyMessage"), + Error: findType("Error"), + Exception: findType("Exception"), + FileType: findType("FileType"), + FinalizablePart: findType("FinalizablePart"), + Flags: findType("Flags"), + Float32List: findType("Float32List"), + Float64List: findType("Float64List"), + Frame: findType("Frame"), + Frame_Function_String: findType("Frame(String)"), + Function: findType("Function"), + Future_bool: findType("Future"), + Future_dynamic: findType("Future<@>"), + Future_nullable_Uint8List: findType("Future"), + IndexedDbFileSystem: findType("IndexedDbFileSystem"), + Int16List: findType("Int16List"), + Int32List: findType("Int32List"), + Int8List: findType("Int8List"), + Invocation: findType("Invocation"), + Iterable_String: findType("Iterable"), + Iterable_double: findType("Iterable"), + Iterable_dynamic: findType("Iterable<@>"), + Iterable_int: findType("Iterable"), + Iterable_nullable_Object: findType("Iterable"), + JSArray_ArgumentsForBatchedStatement: findType("JSArray"), + JSArray_CommonPreparedStatement: findType("JSArray"), + JSArray_FinalizableStatement: findType("JSArray"), + JSArray_Frame: findType("JSArray"), + JSArray_Future_void: findType("JSArray>"), + JSArray_JSObject: findType("JSArray"), + JSArray_List_dynamic: findType("JSArray>"), + JSArray_List_nullable_Object: findType("JSArray>"), + JSArray_Map_of_String_and_nullable_Object: findType("JSArray>"), + JSArray_MultiStreamController_SqliteUpdate: findType("JSArray>"), + JSArray_NativeUint8List: findType("JSArray"), + JSArray_Object: findType("JSArray"), + JSArray_Record_2_WebStorageApi_and_String: findType("JSArray<+(WebStorageApi,String)>"), + JSArray_StatementImplementation: findType("JSArray"), + JSArray_String: findType("JSArray"), + JSArray_TableUpdate: findType("JSArray"), + JSArray_Trace: findType("JSArray"), + JSArray__OffsetAndBuffer: findType("JSArray<_OffsetAndBuffer>"), + JSArray_double: findType("JSArray"), + JSArray_dynamic: findType("JSArray<@>"), + JSArray_int: findType("JSArray"), + JSArray_nullable_Object: findType("JSArray"), + JSArray_nullable_String: findType("JSArray"), + JSArray_nullable_int: findType("JSArray"), + JSArray_of_void_Function: findType("JSArray<~()>"), + JSIndexable_dynamic: findType("JSIndexable<@>"), + JSNull: findType("JSNull"), + JSObject: findType("JSObject"), + JavaScriptBigInt: findType("JavaScriptBigInt"), + JavaScriptFunction: findType("JavaScriptFunction"), + JavaScriptIndexingBehavior_dynamic: findType("JavaScriptIndexingBehavior<@>"), + JavaScriptSymbol: findType("JavaScriptSymbol"), + JsLinkedHashMap_Symbol_dynamic: findType("JsLinkedHashMap"), + LinkedList__IndexedDbWorkItem: findType("LinkedList<_IndexedDbWorkItem>"), + List_JSObject: findType("List"), + List_Map_of_String_and_nullable_Object: findType("List>"), + List_RawSqliteValue: findType("List"), + List_Record_2_WebStorageApi_and_String: findType("List<+(WebStorageApi,String)>"), + List_String: findType("List"), + List_dynamic: findType("List<@>"), + List_int: findType("List"), + List_nullable_Object: findType("List"), + Map_String_JSObject: findType("Map"), + Map_String_int: findType("Map"), + Map_of_String_and_Map_String_JSObject: findType("Map>"), + Map_of_String_and_nullable_Object: findType("Map"), + Map_of_nullable_Object_and_nullable_Object: findType("Map"), + MappedIterable_String_Frame: findType("MappedIterable"), + MappedListIterable_String_Trace: findType("MappedListIterable"), + MappedListIterable_String_dynamic: findType("MappedListIterable"), + Message: findType("Message0"), + NameAndInt32Flags: findType("NameAndInt32Flags"), + NativeByteBuffer: findType("NativeByteBuffer"), + NativeByteData: findType("NativeByteData"), + NativeInt32List: findType("NativeInt32List"), + NativeTypedArrayOfDouble: findType("NativeTypedArrayOfDouble"), + NativeTypedArrayOfInt: findType("NativeTypedArrayOfInt"), + NativeUint8List: findType("NativeUint8List"), + NotifyTablesUpdated: findType("NotifyTablesUpdated"), + Null: findType("Null"), + Object: findType("Object"), + QueryExecutor: findType("QueryExecutor"), + QueryResult: findType("QueryResult"), + Record: findType("Record"), + Record_0: findType("+()"), + RegExpMatch: findType("RegExpMatch"), + RegisteredFunctionSet: findType("RegisteredFunctionSet"), + Request: findType("Request"), + ReversedListIterable_String: findType("ReversedListIterable"), + Row: findType("Row"), + RunningWasmServer: findType("RunningWasmServer"), + ServeDriftDatabase: findType("ServeDriftDatabase"), + SharedWorkerCompatibilityResult: findType("SharedWorkerCompatibilityResult"), + SimpleOpfsFileSystem: findType("SimpleOpfsFileSystem"), + SqlDialect: findType("SqlDialect"), + SqliteResult_nullable_RawSqliteStatement: findType("SqliteResult"), + StackTrace: findType("StackTrace"), + StatementImplementation: findType("StatementImplementation"), + StreamChannelController_nullable_Object: findType("StreamChannelController"), + String: findType("String"), + Symbol: findType("Symbol0"), + Timer: findType("Timer"), + Trace: findType("Trace"), + Trace_Function_String: findType("Trace(String)"), + TransactionExecutor: findType("TransactionExecutor"), + TrustedGetRuntimeType: findType("TrustedGetRuntimeType"), + TypeError: findType("TypeError"), + Uint16List: findType("Uint16List"), + Uint32List: findType("Uint32List"), + Uint8ClampedList: findType("Uint8ClampedList"), + Uint8List: findType("Uint8List"), + UnknownJavaScriptObject: findType("UnknownJavaScriptObject"), + Uri: findType("Uri"), + VfsWorker: findType("VfsWorker"), + VirtualFileSystem: findType("VirtualFileSystem"), + VirtualFileSystemFile: findType("VirtualFileSystemFile"), + WasmBindings: findType("WasmBindings"), + WasmInstance: findType("WasmInstance"), + WasmSqlite3: findType("WasmSqlite3"), + WasmStorageImplementation: findType("WasmStorageImplementation"), + WasmValue: findType("WasmValue"), + WasmVfs: findType("WasmVfs"), + WhereIterable_String: findType("WhereIterable"), + WhereTypeIterable_String: findType("WhereTypeIterable"), + WorkerOperation_Flags_EmptyMessage: findType("WorkerOperation"), + WorkerOperation_Flags_Flags: findType("WorkerOperation"), + WorkerOperation_NameAndInt32Flags_Flags: findType("WorkerOperation"), + Zone: findType("Zone"), + _AsyncCompleter_SharedWorkerCompatibilityResult: findType("_AsyncCompleter"), + _AsyncCompleter_bool: findType("_AsyncCompleter"), + _AsyncCompleter_dynamic: findType("_AsyncCompleter<@>"), + _AsyncCompleter_nullable_Uint8List: findType("_AsyncCompleter"), + _AsyncCompleter_void: findType("_AsyncCompleter<~>"), + _BigIntImpl: findType("_BigIntImpl"), + _CursorReader_JSObject: findType("_CursorReader"), + _EventStream_JSObject: findType("_EventStream"), + _Future_JSObject: findType("_Future"), + _Future_SharedWorkerCompatibilityResult: findType("_Future"), + _Future_bool: findType("_Future"), + _Future_dynamic: findType("_Future<@>"), + _Future_int: findType("_Future"), + _Future_nullable_Uint8List: findType("_Future"), + _Future_void: findType("_Future<~>"), + _IdentityHashMap_of_nullable_Object_and_nullable_Object: findType("_IdentityHashMap"), + _OpenedFileHandle: findType("_OpenedFileHandle"), + _PendingRequest: findType("_PendingRequest"), + _ResolvedPath: findType("_ResolvedPath"), + _StreamControllerAddStreamState_nullable_Object: findType("_StreamControllerAddStreamState"), + _StreamIterator_JSObject: findType("_StreamIterator"), + _SyncBroadcastStreamController_void: findType("_SyncBroadcastStreamController<~>"), + _SyncCompleter_JSObject: findType("_SyncCompleter"), + _SyncCompleter_bool: findType("_SyncCompleter"), + _SyncCompleter_void: findType("_SyncCompleter<~>"), + _ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace: findType("_ZoneFunction<~(Zone,ZoneDelegate,Zone,Object,StackTrace)>"), + bool: findType("bool"), + bool_Function_Object: findType("bool(Object)"), + bool_Function_String: findType("bool(String)"), + double: findType("double"), + dynamic: findType("@"), + dynamic_Function: findType("@()"), + dynamic_Function_Object: findType("@(Object)"), + dynamic_Function_Object_StackTrace: findType("@(Object,StackTrace)"), + dynamic_Function_Request: findType("@(Request)"), + dynamic_Function_String: findType("@(String)"), + int: findType("int"), + legacy_Never: findType("0&*"), + legacy_Object: findType("Object*"), + nullable_Completer_bool: findType("Completer?"), + nullable_FutureOr_nullable_Uint8List_Function: findType("Uint8List?/()?"), + nullable_Future_Null: findType("Future?"), + nullable_JSObject: findType("JSObject?"), + nullable_List_JSObject: findType("List?"), + nullable_Map_of_nullable_Object_and_nullable_Object: findType("Map?"), + nullable_NativeUint8List: findType("NativeUint8List?"), + nullable_Object: findType("Object?"), + nullable_Object_Function_List_nullable_Object: findType("Object?(List)"), + nullable_Record_2_Object_and_StackTrace: findType("+(Object,StackTrace)?"), + nullable_StackTrace: findType("StackTrace?"), + nullable_Uint8List: findType("Uint8List?"), + nullable_Zone: findType("Zone?"), + nullable_ZoneDelegate: findType("ZoneDelegate?"), + nullable_ZoneSpecification: findType("ZoneSpecification?"), + nullable__DelayedEvent_dynamic: findType("_DelayedEvent<@>?"), + nullable__FutureListener_dynamic_dynamic: findType("_FutureListener<@,@>?"), + nullable__LinkedHashSetCell: findType("_LinkedHashSetCell?"), + nullable_int: findType("int?"), + nullable_void_Function: findType("~()?"), + nullable_void_Function_2_RawSqliteContext_and_List_RawSqliteValue: findType("~(RawSqliteContext,List)?"), + nullable_void_Function_JSObject: findType("~(JSObject)?"), + nullable_void_Function_int_String_int: findType("~(int,String,int)?"), + num: findType("num"), + void: findType("~"), + void_Function: findType("~()"), + void_Function_$opt_void: findType("~([~])"), + void_Function_2_nullable_JSObject_and_nullable_List_JSObject: findType("~(JSObject?,List?)"), + void_Function_Object: findType("~(Object)"), + void_Function_Object_StackTrace: findType("~(Object,StackTrace)"), + void_Function_Timer: findType("~(Timer)") + }; + })(); + (function constants() { + var makeConstList = hunkHelpers.makeConstList; + B.Interceptor_methods = J.Interceptor.prototype; + B.JSArray_methods = J.JSArray.prototype; + B.JSInt_methods = J.JSInt.prototype; + B.JSNumber_methods = J.JSNumber.prototype; + B.JSString_methods = J.JSString.prototype; + B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype; + B.JavaScriptObject_methods = J.JavaScriptObject.prototype; + B.NativeByteData_methods = A.NativeByteData.prototype; + B.NativeUint8List_methods = A.NativeUint8List.prototype; + B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype; + B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype; + B.AllowedArgumentCount_0 = new A.AllowedArgumentCount(0); + B.AllowedArgumentCount_1 = new A.AllowedArgumentCount(1); + B.AllowedArgumentCount_2 = new A.AllowedArgumentCount(2); + B.AllowedArgumentCount_3 = new A.AllowedArgumentCount(3); + B.AllowedArgumentCount_m1 = new A.AllowedArgumentCount(-1); + B.AsciiEncoder_127 = new A.AsciiEncoder(127); + B.CONSTANT = new A.Instantiation1(A.math__max$closure(), A.findType("Instantiation1")); + B.C_AsciiCodec = new A.AsciiCodec(); + B.C_Base64Encoder = new A.Base64Encoder(); + B.C_Base64Codec = new A.Base64Codec(); + B.C_CancellationException = new A.CancellationException(); + B.C_ConnectionClosedException = new A.ConnectionClosedException(); + B.C_DefaultEquality = new A.DefaultEquality(A.findType("DefaultEquality<0&>")); + B.C_DriftProtocol = new A.DriftProtocol(); + B.C_EmptyIterator = new A.EmptyIterator(A.findType("EmptyIterator<0&>")); + B.C_EmptyMessage = new A.EmptyMessage(); + B.C_IntegerDivisionByZeroException = new A.IntegerDivisionByZeroException(); + B.C_JS_CONST = function getTagFallback(o) { + var s = Object.prototype.toString.call(o); + return s.substring(8, s.length - 1); +}; + B.C_JS_CONST0 = function() { + var toStringFunction = Object.prototype.toString; + function getTag(o) { + var s = toStringFunction.call(o); + return s.substring(8, s.length - 1); + } + function getUnknownTag(object, tag) { + if (/^HTML[A-Z].*Element$/.test(tag)) { + var name = toStringFunction.call(object); + if (name == "[object Object]") return null; + return "HTMLElement"; + } + } + function getUnknownTagGenericBrowser(object, tag) { + if (object instanceof HTMLElement) return "HTMLElement"; + return getUnknownTag(object, tag); + } + function prototypeForTag(tag) { + if (typeof window == "undefined") return null; + if (typeof window[tag] == "undefined") return null; + var constructor = window[tag]; + if (typeof constructor != "function") return null; + return constructor.prototype; + } + function discriminator(tag) { return null; } + var isBrowser = typeof HTMLElement == "function"; + return { + getTag: getTag, + getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, + prototypeForTag: prototypeForTag, + discriminator: discriminator }; +}; + B.C_JS_CONST6 = function(getTagFallback) { + return function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("DumpRenderTree") >= 0) return hooks; + if (userAgent.indexOf("Chrome") >= 0) { + function confirm(p) { + return typeof window == "object" && window[p] && window[p].name == p; + } + if (confirm("Window") && confirm("HTMLElement")) return hooks; + } + hooks.getTag = getTagFallback; + }; +}; + B.C_JS_CONST1 = function(hooks) { + if (typeof dartExperimentalFixupGetTag != "function") return hooks; + hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); +}; + B.C_JS_CONST5 = function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("Firefox") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "GeoGeolocation": "Geolocation", + "Location": "!Location", + "WorkerMessageEvent": "MessageEvent", + "XMLDocument": "!Document"}; + function getTagFirefox(o) { + var tag = getTag(o); + return quickMap[tag] || tag; + } + hooks.getTag = getTagFirefox; +}; + B.C_JS_CONST4 = function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("Trident/") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "HTMLDDElement": "HTMLElement", + "HTMLDTElement": "HTMLElement", + "HTMLPhraseElement": "HTMLElement", + "Position": "Geoposition" + }; + function getTagIE(o) { + var tag = getTag(o); + var newTag = quickMap[tag]; + if (newTag) return newTag; + if (tag == "Object") { + if (window.DataView && (o instanceof window.DataView)) return "DataView"; + } + return tag; + } + function prototypeForTagIE(tag) { + var constructor = window[tag]; + if (constructor == null) return null; + return constructor.prototype; + } + hooks.getTag = getTagIE; + hooks.prototypeForTag = prototypeForTagIE; +}; + B.C_JS_CONST2 = function(hooks) { + var getTag = hooks.getTag; + var prototypeForTag = hooks.prototypeForTag; + function getTagFixed(o) { + var tag = getTag(o); + if (tag == "Document") { + if (!!o.xmlVersion) return "!Document"; + return "!HTMLDocument"; + } + return tag; + } + function prototypeForTagFixed(tag) { + if (tag == "Document") return null; + return prototypeForTag(tag); + } + hooks.getTag = getTagFixed; + hooks.prototypeForTag = prototypeForTagFixed; +}; + B.C_JS_CONST3 = function(hooks) { return hooks; } +; + B.C_ListEquality = new A.ListEquality(A.findType("ListEquality")); + B.C_NoTransactionDelegate = new A.NoTransactionDelegate(); + B.C_NoVersionDelegate = new A.NoVersionDelegate(); + B.C_OutOfMemoryError = new A.OutOfMemoryError(); + B.C_SentinelValue = new A.SentinelValue(); + B.C_Utf8Codec = new A.Utf8Codec(); + B.C_Utf8Encoder = new A.Utf8Encoder(); + B.C__DelayedDone = new A._DelayedDone(); + B.C__JSRandom = new A._JSRandom(); + B.C__Required = new A._Required(); + B.C__RootZone = new A._RootZone(); + B.Duration_0 = new A.Duration(0); + B.FormatException_ZGD = new A.FormatException("Cannot read message", null, null); + B.FormatException_urD = new A.FormatException("Unknown tag", null, null); + B.List_11 = A._setArrayType(makeConstList([11]), type$.JSArray_int); + B.List_2jN = A._setArrayType(makeConstList([0, 0, 32722, 12287, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_42A = A._setArrayType(makeConstList([0, 0, 65490, 45055, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_4AN = A._setArrayType(makeConstList([0, 0, 32754, 11263, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_GVy = A._setArrayType(makeConstList([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]), type$.JSArray_int); + B.List_M2I0 = A._setArrayType(makeConstList([0, 0, 32722, 12287, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_M2I = A._setArrayType(makeConstList([0, 0, 65490, 12287, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_VOY = A._setArrayType(makeConstList([0, 0, 32776, 33792, 1, 10240, 0, 0]), type$.JSArray_int); + B.WebStorageApi_0 = new A.WebStorageApi(0, "opfs"); + B.WebStorageApi_1 = new A.WebStorageApi(1, "indexedDb"); + B.List_WebStorageApi_0_WebStorageApi_1 = A._setArrayType(makeConstList([B.WebStorageApi_0, B.WebStorageApi_1]), A.findType("JSArray")); + B.UpdateKind_0 = new A.UpdateKind(0, "insert"); + B.UpdateKind_1 = new A.UpdateKind(1, "update"); + B.UpdateKind_2 = new A.UpdateKind(2, "delete"); + B.List_c4R = A._setArrayType(makeConstList([B.UpdateKind_0, B.UpdateKind_1, B.UpdateKind_2]), A.findType("JSArray")); + B.WorkerOperation_Gkh = new A.WorkerOperation(A.sync_channel_MessageSerializer_readNameAndFlags$closure(), A.sync_channel_MessageSerializer_readFlags$closure(), 0, "xAccess", type$.WorkerOperation_NameAndInt32Flags_Flags); + B.WorkerOperation_AxI = new A.WorkerOperation(A.sync_channel_MessageSerializer_readNameAndFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 1, "xDelete", A.findType("WorkerOperation")); + B.WorkerOperation_readNameAndFlags_readFlags_2_xOpen = new A.WorkerOperation(A.sync_channel_MessageSerializer_readNameAndFlags$closure(), A.sync_channel_MessageSerializer_readFlags$closure(), 2, "xOpen", type$.WorkerOperation_NameAndInt32Flags_Flags); + B.WorkerOperation_readFlags_readFlags_3_xRead = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readFlags$closure(), 3, "xRead", type$.WorkerOperation_Flags_Flags); + B.WorkerOperation_readFlags_readEmpty_4_xWrite = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 4, "xWrite", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readFlags_readEmpty_5_xSleep = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 5, "xSleep", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readFlags_readEmpty_6_xClose = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 6, "xClose", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readFlags_readFlags_7_xFileSize = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readFlags$closure(), 7, "xFileSize", type$.WorkerOperation_Flags_Flags); + B.WorkerOperation_readFlags_readEmpty_8_xSync = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 8, "xSync", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readFlags_readEmpty_9_xTruncate = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 9, "xTruncate", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readFlags_readEmpty_10_xLock = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 10, "xLock", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readFlags_readEmpty_11_xUnlock = new A.WorkerOperation(A.sync_channel_MessageSerializer_readFlags$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 11, "xUnlock", type$.WorkerOperation_Flags_EmptyMessage); + B.WorkerOperation_readEmpty_readEmpty_12_stopServer = new A.WorkerOperation(A.sync_channel_MessageSerializer_readEmpty$closure(), A.sync_channel_MessageSerializer_readEmpty$closure(), 12, "stopServer", A.findType("WorkerOperation")); + B.List_ckn = A._setArrayType(makeConstList([B.WorkerOperation_Gkh, B.WorkerOperation_AxI, B.WorkerOperation_readNameAndFlags_readFlags_2_xOpen, B.WorkerOperation_readFlags_readFlags_3_xRead, B.WorkerOperation_readFlags_readEmpty_4_xWrite, B.WorkerOperation_readFlags_readEmpty_5_xSleep, B.WorkerOperation_readFlags_readEmpty_6_xClose, B.WorkerOperation_readFlags_readFlags_7_xFileSize, B.WorkerOperation_readFlags_readEmpty_8_xSync, B.WorkerOperation_readFlags_readEmpty_9_xTruncate, B.WorkerOperation_readFlags_readEmpty_10_xLock, B.WorkerOperation_readFlags_readEmpty_11_xUnlock, B.WorkerOperation_readEmpty_readEmpty_12_stopServer]), A.findType("JSArray>")); + B.List_empty1 = A._setArrayType(makeConstList([]), type$.JSArray_JSObject); + B.List_empty3 = A._setArrayType(makeConstList([]), type$.JSArray_List_nullable_Object); + B.List_empty4 = A._setArrayType(makeConstList([]), type$.JSArray_Object); + B.List_empty2 = A._setArrayType(makeConstList([]), type$.JSArray_String); + B.List_empty0 = A._setArrayType(makeConstList([]), type$.JSArray_dynamic); + B.List_empty = A._setArrayType(makeConstList([]), type$.JSArray_nullable_Object); + B.List_empty5 = A._setArrayType(makeConstList([]), type$.JSArray_Record_2_WebStorageApi_and_String); + B.WasmStorageImplementation_0 = new A.WasmStorageImplementation(0, "opfsShared"); + B.WasmStorageImplementation_1 = new A.WasmStorageImplementation(1, "opfsLocks"); + B.WasmStorageImplementation_2 = new A.WasmStorageImplementation(2, "sharedIndexedDb"); + B.WasmStorageImplementation_3 = new A.WasmStorageImplementation(3, "unsafeIndexedDb"); + B.WasmStorageImplementation_4 = new A.WasmStorageImplementation(4, "inMemory"); + B.List_gqi = A._setArrayType(makeConstList([B.WasmStorageImplementation_0, B.WasmStorageImplementation_1, B.WasmStorageImplementation_2, B.WasmStorageImplementation_3, B.WasmStorageImplementation_4]), A.findType("JSArray")); + B.StatementMethod_0 = new A.StatementMethod(0, "custom"); + B.StatementMethod_1 = new A.StatementMethod(1, "deleteOrUpdate"); + B.StatementMethod_2 = new A.StatementMethod(2, "insert"); + B.StatementMethod_3 = new A.StatementMethod(3, "select"); + B.List_kYu = A._setArrayType(makeConstList([B.StatementMethod_0, B.StatementMethod_1, B.StatementMethod_2, B.StatementMethod_3]), A.findType("JSArray")); + B.FileType_s7J = new A.FileType("/database", 0, "database"); + B.FileType_ADx = new A.FileType("/database-journal", 1, "journal"); + B.List_oyU = A._setArrayType(makeConstList([B.FileType_s7J, B.FileType_ADx]), A.findType("JSArray")); + B.NestedExecutorControl_0 = new A.NestedExecutorControl(0, "beginTransaction"); + B.NestedExecutorControl_1 = new A.NestedExecutorControl(1, "commit"); + B.NestedExecutorControl_2 = new A.NestedExecutorControl(2, "rollback"); + B.NestedExecutorControl_3 = new A.NestedExecutorControl(3, "startExclusive"); + B.NestedExecutorControl_4 = new A.NestedExecutorControl(4, "endExclusive"); + B.List_p2F = A._setArrayType(makeConstList([B.NestedExecutorControl_0, B.NestedExecutorControl_1, B.NestedExecutorControl_2, B.NestedExecutorControl_3, B.NestedExecutorControl_4]), A.findType("JSArray")); + B.List_piR = A._setArrayType(makeConstList([0, 0, 24576, 1023, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.SqlDialect_0_sqlite = new A.SqlDialect(0, "sqlite"); + B.SqlDialect_1_mysql = new A.SqlDialect(1, "mysql"); + B.SqlDialect_2_postgres = new A.SqlDialect(2, "postgres"); + B.SqlDialect_3_mariadb = new A.SqlDialect(3, "mariadb"); + B.List_yTp = A._setArrayType(makeConstList([B.SqlDialect_0_sqlite, B.SqlDialect_1_mysql, B.SqlDialect_2_postgres, B.SqlDialect_3_mariadb]), A.findType("JSArray")); + B.Object_empty = {}; + B.Map_empty0 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.NoArgsRequest_0 = new A.NoArgsRequest(0, "terminateAll"); + B.OpenMode_2 = new A.OpenMode(2, "readWriteCreate"); + B.ProtocolVersion_0_0_legacy = new A.ProtocolVersion(0, 0, "legacy"); + B.ProtocolVersion_1_1_v1 = new A.ProtocolVersion(1, 1, "v1"); + B.ProtocolVersion_2_2_v2 = new A.ProtocolVersion(2, 2, "v2"); + B.List_empty6 = A._setArrayType(makeConstList([]), type$.JSArray_Map_of_String_and_nullable_Object); + B.SelectResult_List_empty = new A.SelectResult(B.List_empty6); + B.Symbol_call = new A.Symbol("call"); + B.Symbol_uzx = new A.Symbol("drift.runtime.cancellation"); + B.Type_ByteBuffer_EOZ = A.typeLiteral("ByteBuffer"); + B.Type_ByteData_mF8 = A.typeLiteral("ByteData"); + B.Type_Float32List_Ymk = A.typeLiteral("Float32List"); + B.Type_Float64List_Ymk = A.typeLiteral("Float64List"); + B.Type_Int16List_cot = A.typeLiteral("Int16List"); + B.Type_Int32List_m1p = A.typeLiteral("Int32List"); + B.Type_Int8List_woc = A.typeLiteral("Int8List"); + B.Type_Object_QJv = A.typeLiteral("Object"); + B.Type_Uint16List_2mh = A.typeLiteral("Uint16List"); + B.Type_Uint32List_2mh = A.typeLiteral("Uint32List"); + B.Type_Uint8ClampedList_9Bb = A.typeLiteral("Uint8ClampedList"); + B.Type_Uint8List_CSc = A.typeLiteral("Uint8List"); + B.VfsException_10 = new A.VfsException(10); + B.VfsException_12 = new A.VfsException(12); + B.VfsException_14 = new A.VfsException(14); + B.VfsException_2570 = new A.VfsException(2570); + B.VfsException_3850 = new A.VfsException(3850); + B.VfsException_522 = new A.VfsException(522); + B.VfsException_778 = new A.VfsException(778); + B.VfsException_8 = new A.VfsException(8); + B._PathDirection_3KU = new A._PathDirection("above root"); + B._PathDirection_8OV = new A._PathDirection("at root"); + B._PathDirection_e7w = new A._PathDirection("reaches root"); + B._PathDirection_yLX = new A._PathDirection("below root"); + B._PathRelation_different = new A._PathRelation("different"); + B._PathRelation_equal = new A._PathRelation("equal"); + B._PathRelation_inconclusive = new A._PathRelation("inconclusive"); + B._PathRelation_within = new A._PathRelation("within"); + B._StringStackTrace_uwd = new A._StringStackTrace(""); + B._ZoneFunction_NIe = new A._ZoneFunction(B.C__RootZone, A.async___rootHandleUncaughtError$closure(), type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace); + B._ZoneFunction_QOa = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterUnaryCallback$closure(), A.findType("_ZoneFunction<0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))>")); + B._ZoneFunction__RootZone__rootCreateTimer = new A._ZoneFunction(B.C__RootZone, A.async___rootCreateTimer$closure(), A.findType("_ZoneFunction")); + B._ZoneFunction__RootZone__rootErrorCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootErrorCallback$closure(), A.findType("_ZoneFunction")); + B._ZoneFunction__RootZone__rootFork = new A._ZoneFunction(B.C__RootZone, A.async___rootFork$closure(), A.findType("_ZoneFunction?)>")); + B._ZoneFunction__RootZone__rootPrint = new A._ZoneFunction(B.C__RootZone, A.async___rootPrint$closure(), A.findType("_ZoneFunction<~(Zone,ZoneDelegate,Zone,String)>")); + B._ZoneFunction__RootZone__rootRegisterCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterCallback$closure(), A.findType("_ZoneFunction<0^()(Zone,ZoneDelegate,Zone,0^())>")); + B._ZoneFunction__RootZone__rootRun = new A._ZoneFunction(B.C__RootZone, A.async___rootRun$closure(), A.findType("_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^())>")); + B._ZoneFunction__RootZone__rootRunBinary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunBinary$closure(), A.findType("_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^(1^,2^),1^,2^)>")); + B._ZoneFunction__RootZone__rootRunUnary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunUnary$closure(), A.findType("_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^(1^),1^)>")); + B._ZoneFunction__RootZone__rootScheduleMicrotask = new A._ZoneFunction(B.C__RootZone, A.async___rootScheduleMicrotask$closure(), A.findType("_ZoneFunction<~(Zone,ZoneDelegate,Zone,~())>")); + B._ZoneFunction_kWM = new A._ZoneFunction(B.C__RootZone, A.async___rootCreatePeriodicTimer$closure(), A.findType("_ZoneFunction")); + B._ZoneFunction_qxw = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterBinaryCallback$closure(), A.findType("_ZoneFunction<0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))>")); + B._ZoneSpecification_48t = new A._ZoneSpecification(null, null, null, null, null, null, null, null, null, null, null, null, null); + })(); + (function staticFields() { + $._JS_INTEROP_INTERCEPTOR_TAG = null; + $.toStringVisiting = A._setArrayType([], type$.JSArray_Object); + $.printToZone = null; + $.Primitives__identityHashCodeProperty = null; + $.BoundClosure__receiverFieldNameCache = null; + $.BoundClosure__interceptorFieldNameCache = null; + $.getTagFunction = null; + $.alternateTagFunction = null; + $.prototypeForTagFunction = null; + $.dispatchRecordsForInstanceTags = null; + $.interceptorsForUncacheableTags = null; + $.initNativeDispatchFlag = null; + $._Record__computedFieldKeys = A._setArrayType([], A.findType("JSArray?>")); + $._nextCallback = null; + $._lastCallback = null; + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + $.Zone__current = B.C__RootZone; + $._RootZone__rootDelegate = null; + $._BigIntImpl__lastDividendDigits = null; + $._BigIntImpl__lastDividendUsed = null; + $._BigIntImpl__lastDivisorDigits = null; + $._BigIntImpl__lastDivisorUsed = null; + $._BigIntImpl____lastQuoRemDigits = A._Cell$named("_lastQuoRemDigits"); + $._BigIntImpl____lastQuoRemUsed = A._Cell$named("_lastQuoRemUsed"); + $._BigIntImpl____lastRemUsed = A._Cell$named("_lastRemUsed"); + $._BigIntImpl____lastRem_nsh = A._Cell$named("_lastRem_nsh"); + $.Uri__cachedBaseString = ""; + $.Uri__cachedBaseUri = null; + $._currentUriBase = null; + $._current = null; + })(); + (function lazyInitializers() { + var _lazyFinal = hunkHelpers.lazyFinal, + _lazy = hunkHelpers.lazy; + _lazyFinal($, "DART_CLOSURE_PROPERTY_NAME", "$get$DART_CLOSURE_PROPERTY_NAME", () => A.getIsolateAffinityTag("_$dart_dartClosure")); + _lazyFinal($, "nullFuture", "$get$nullFuture", () => B.C__RootZone.run$1$1(new A.nullFuture_closure(), A.findType("Future"))); + _lazyFinal($, "TypeErrorDecoder_noSuchMethodPattern", "$get$TypeErrorDecoder_noSuchMethodPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({ + toString: function() { + return "$receiver$"; + } + }))); + _lazyFinal($, "TypeErrorDecoder_notClosurePattern", "$get$TypeErrorDecoder_notClosurePattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({$method$: null, + toString: function() { + return "$receiver$"; + } + }))); + _lazyFinal($, "TypeErrorDecoder_nullCallPattern", "$get$TypeErrorDecoder_nullCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(null))); + _lazyFinal($, "TypeErrorDecoder_nullLiteralCallPattern", "$get$TypeErrorDecoder_nullLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { + var $argumentsExpr$ = "$arguments$"; + try { + null.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_undefinedCallPattern", "$get$TypeErrorDecoder_undefinedCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(void 0))); + _lazyFinal($, "TypeErrorDecoder_undefinedLiteralCallPattern", "$get$TypeErrorDecoder_undefinedLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { + var $argumentsExpr$ = "$arguments$"; + try { + (void 0).$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_nullPropertyPattern", "$get$TypeErrorDecoder_nullPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(null))); + _lazyFinal($, "TypeErrorDecoder_nullLiteralPropertyPattern", "$get$TypeErrorDecoder_nullLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { + try { + null.$method$; + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_undefinedPropertyPattern", "$get$TypeErrorDecoder_undefinedPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(void 0))); + _lazyFinal($, "TypeErrorDecoder_undefinedLiteralPropertyPattern", "$get$TypeErrorDecoder_undefinedLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { + try { + (void 0).$method$; + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "_AsyncRun__scheduleImmediateClosure", "$get$_AsyncRun__scheduleImmediateClosure", () => A._AsyncRun__initializeScheduleImmediate()); + _lazyFinal($, "Future__nullFuture", "$get$Future__nullFuture", () => A.findType("_Future")._as($.$get$nullFuture())); + _lazyFinal($, "Future__falseFuture", "$get$Future__falseFuture", () => A._Future$zoneValue(false, B.C__RootZone, type$.bool)); + _lazyFinal($, "_RootZone__rootMap", "$get$_RootZone__rootMap", () => { + var t1 = type$.dynamic; + return A.HashMap_HashMap(t1, t1); + }); + _lazyFinal($, "_Utf8Decoder__reusableBuffer", "$get$_Utf8Decoder__reusableBuffer", () => A.NativeUint8List_NativeUint8List(4096)); + _lazyFinal($, "_Utf8Decoder__decoder", "$get$_Utf8Decoder__decoder", () => new A._Utf8Decoder__decoder_closure().call$0()); + _lazyFinal($, "_Utf8Decoder__decoderNonfatal", "$get$_Utf8Decoder__decoderNonfatal", () => new A._Utf8Decoder__decoderNonfatal_closure().call$0()); + _lazyFinal($, "_Base64Decoder__inverseAlphabet", "$get$_Base64Decoder__inverseAlphabet", () => A.NativeInt8List__create1(A._ensureNativeList(A._setArrayType([-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, 62, -2, 62, -2, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -1, -2, -2, -2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, 63, -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2], type$.JSArray_int)))); + _lazyFinal($, "_BigIntImpl_zero", "$get$_BigIntImpl_zero", () => A._BigIntImpl__BigIntImpl$_fromInt(0)); + _lazyFinal($, "_BigIntImpl_one", "$get$_BigIntImpl_one", () => A._BigIntImpl__BigIntImpl$_fromInt(1)); + _lazyFinal($, "_BigIntImpl_two", "$get$_BigIntImpl_two", () => A._BigIntImpl__BigIntImpl$_fromInt(2)); + _lazyFinal($, "_BigIntImpl__minusOne", "$get$_BigIntImpl__minusOne", () => $.$get$_BigIntImpl_one().$negate(0)); + _lazyFinal($, "_BigIntImpl__bigInt10000", "$get$_BigIntImpl__bigInt10000", () => A._BigIntImpl__BigIntImpl$_fromInt(10000)); + _lazy($, "_BigIntImpl__parseRE", "$get$_BigIntImpl__parseRE", () => A.RegExp_RegExp("^\\s*([+-]?)((0x[a-f0-9]+)|(\\d+)|([a-z0-9]+))\\s*$", false, false, false, false)); + _lazyFinal($, "_BigIntImpl__bitsForFromDouble", "$get$_BigIntImpl__bitsForFromDouble", () => A.NativeUint8List_NativeUint8List(8)); + _lazyFinal($, "_FinalizationRegistryWrapper__finalizationRegistryConstructor", "$get$_FinalizationRegistryWrapper__finalizationRegistryConstructor", () => typeof FinalizationRegistry == "function" ? FinalizationRegistry : null); + _lazyFinal($, "_Uri__needsNoEncoding", "$get$_Uri__needsNoEncoding", () => A.RegExp_RegExp("^[\\-\\.0-9A-Z_a-z~]*$", true, false, false, false)); + _lazyFinal($, "_hashSeed", "$get$_hashSeed", () => A.objectHashCode(B.Type_Object_QJv)); + _lazyFinal($, "_scannerTables", "$get$_scannerTables", () => A._createTables()); + _lazyFinal($, "Random__secureRandom", "$get$Random__secureRandom", () => { + var t1 = new A._JSSecureRandom(new DataView(new ArrayBuffer(A._checkLength(8)))); + t1._JSSecureRandom$0(); + return t1; + }); + _lazyFinal($, "WebStorageApi_byName", "$get$WebStorageApi_byName", () => A.EnumByName_asNameMap(B.List_WebStorageApi_0_WebStorageApi_1, A.findType("WebStorageApi"))); + _lazyFinal($, "windows", "$get$windows", () => A.Context_Context(null, $.$get$Style_windows())); + _lazyFinal($, "url", "$get$url", () => A.Context_Context(null, $.$get$Style_url())); + _lazyFinal($, "context", "$get$context", () => new A.Context($.$get$Style_platform(), null)); + _lazyFinal($, "Style_posix", "$get$Style_posix", () => new A.PosixStyle(A.RegExp_RegExp("/", true, false, false, false), A.RegExp_RegExp("[^/]$", true, false, false, false), A.RegExp_RegExp("^/", true, false, false, false))); + _lazyFinal($, "Style_windows", "$get$Style_windows", () => new A.WindowsStyle(A.RegExp_RegExp("[/\\\\]", true, false, false, false), A.RegExp_RegExp("[^/\\\\]$", true, false, false, false), A.RegExp_RegExp("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])", true, false, false, false), A.RegExp_RegExp("^[/\\\\](?![/\\\\])", true, false, false, false))); + _lazyFinal($, "Style_url", "$get$Style_url", () => new A.UrlStyle(A.RegExp_RegExp("/", true, false, false, false), A.RegExp_RegExp("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$", true, false, false, false), A.RegExp_RegExp("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*", true, false, false, false), A.RegExp_RegExp("^/", true, false, false, false))); + _lazyFinal($, "Style_platform", "$get$Style_platform", () => A.Style__getPlatformStyle()); + _lazyFinal($, "bigIntMinValue64", "$get$bigIntMinValue64", () => A.BigInt_parse("-9223372036854775808")); + _lazyFinal($, "bigIntMaxValue64", "$get$bigIntMaxValue64", () => A.BigInt_parse("9223372036854775807")); + _lazyFinal($, "disposeFinalizer", "$get$disposeFinalizer", () => { + var t1 = $.$get$_FinalizationRegistryWrapper__finalizationRegistryConstructor(); + t1 = t1 == null ? null : new t1(A.convertDartClosureToJS(A.wrapZoneUnaryCallback(new A.disposeFinalizer_closure(), type$.FinalizablePart), 1)); + return new A._FinalizationRegistryWrapper(t1, A.findType("_FinalizationRegistryWrapper")); + }); + _lazyFinal($, "AsynchronousIndexedDbFileSystem__storesJs", "$get$AsynchronousIndexedDbFileSystem__storesJs", () => A.ListToJSArray_get_toJS(A._setArrayType([A.StringToJSString_get_toJS("files"), A.StringToJSString_get_toJS("blocks")], type$.JSArray_String), type$.String)); + _lazyFinal($, "FileType_byName", "$get$FileType_byName", () => { + var _i, entry, + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.FileType); + for (_i = 0; _i < 2; ++_i) { + entry = B.List_oyU[_i]; + t1.$indexSet(0, entry.filePath, entry); + } + return t1; + }); + _lazyFinal($, "DartCallbacks_sqliteVfsPointer", "$get$DartCallbacks_sqliteVfsPointer", () => new A.Expando(new WeakMap(), A.findType("Expando"))); + _lazyFinal($, "_vmFrame", "$get$_vmFrame", () => A.RegExp_RegExp("^#\\d+\\s+(\\S.*) \\((.+?)((?::\\d+){0,2})\\)$", true, false, false, false)); + _lazyFinal($, "_v8Frame", "$get$_v8Frame", () => A.RegExp_RegExp("^\\s*at (?:(\\S.*?)(?: \\[as [^\\]]+\\])? \\((.*)\\)|(.*))$", true, false, false, false)); + _lazyFinal($, "_v8UrlLocation", "$get$_v8UrlLocation", () => A.RegExp_RegExp("^(.*?):(\\d+)(?::(\\d+))?$|native$", true, false, false, false)); + _lazyFinal($, "_v8EvalLocation", "$get$_v8EvalLocation", () => A.RegExp_RegExp("^eval at (?:\\S.*?) \\((.*)\\)(?:, .*?:\\d+:\\d+)?$", true, false, false, false)); + _lazyFinal($, "_firefoxEvalLocation", "$get$_firefoxEvalLocation", () => A.RegExp_RegExp("(\\S+)@(\\S+) line (\\d+) >.* (Function|eval):\\d+:\\d+", true, false, false, false)); + _lazyFinal($, "_firefoxSafariFrame", "$get$_firefoxSafariFrame", () => A.RegExp_RegExp("^(?:([^@(/]*)(?:\\(.*\\))?((?:/[^/]*)*)(?:\\(.*\\))?@)?(.*?):(\\d*)(?::(\\d*))?$", true, false, false, false)); + _lazyFinal($, "_friendlyFrame", "$get$_friendlyFrame", () => A.RegExp_RegExp("^(\\S+)(?: (\\d+)(?::(\\d+))?)?\\s+([^\\d].*)$", true, false, false, false)); + _lazyFinal($, "_asyncBody", "$get$_asyncBody", () => A.RegExp_RegExp("<(|[^>]+)_async_body>", true, false, false, false)); + _lazyFinal($, "_initialDot", "$get$_initialDot", () => A.RegExp_RegExp("^\\.", true, false, false, false)); + _lazyFinal($, "Frame__uriRegExp", "$get$Frame__uriRegExp", () => A.RegExp_RegExp("^[a-zA-Z][-+.a-zA-Z\\d]*://", true, false, false, false)); + _lazyFinal($, "Frame__windowsRegExp", "$get$Frame__windowsRegExp", () => A.RegExp_RegExp("^([a-zA-Z]:[\\\\/]|\\\\\\\\)", true, false, false, false)); + _lazyFinal($, "_v8Trace", "$get$_v8Trace", () => A.RegExp_RegExp("\\n ?at ", true, false, false, false)); + _lazyFinal($, "_v8TraceLine", "$get$_v8TraceLine", () => A.RegExp_RegExp(" ?at ", true, false, false, false)); + _lazyFinal($, "_firefoxEvalTrace", "$get$_firefoxEvalTrace", () => A.RegExp_RegExp("@\\S+ line \\d+ >.* (Function|eval):\\d+:\\d+", true, false, false, false)); + _lazyFinal($, "_firefoxSafariTrace", "$get$_firefoxSafariTrace", () => A.RegExp_RegExp("^(([.0-9A-Za-z_$/<]|\\(.*\\))*@)?[^\\s]*:\\d*$", true, false, true, false)); + _lazyFinal($, "_friendlyTrace", "$get$_friendlyTrace", () => A.RegExp_RegExp("^[^\\s<][^\\s]*( \\d+(:\\d+)?)?[ \\t]+[^\\s]+$", true, false, true, false)); + _lazyFinal($, "vmChainGap", "$get$vmChainGap", () => A.RegExp_RegExp("^\\n?$", true, false, true, false)); + })(); + (function nativeSupport() { + !function() { + var intern = function(s) { + var o = {}; + o[s] = 1; + return Object.keys(hunkHelpers.convertToFastObject(o))[0]; + }; + init.getIsolateTag = function(name) { + return intern("___dart_" + name + init.isolateTag); + }; + var tableProperty = "___dart_isolate_tags_"; + var usedProperties = Object[tableProperty] || (Object[tableProperty] = Object.create(null)); + var rootProperty = "_ZxYxX"; + for (var i = 0;; i++) { + var property = intern(rootProperty + "_" + i + "_"); + if (!(property in usedProperties)) { + usedProperties[property] = 1; + init.isolateTag = property; + break; + } + } + init.dispatchPropertyName = init.getIsolateTag("dispatch_record"); + }(); + hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer: A.NativeByteBuffer, ArrayBufferView: A.NativeTypedData, DataView: A.NativeByteData, Float32Array: A.NativeFloat32List, Float64Array: A.NativeFloat64List, Int16Array: A.NativeInt16List, Int32Array: A.NativeInt32List, Int8Array: A.NativeInt8List, Uint16Array: A.NativeUint16List, Uint32Array: A.NativeUint32List, Uint8ClampedArray: A.NativeUint8ClampedList, CanvasPixelArray: A.NativeUint8ClampedList, Uint8Array: A.NativeUint8List}); + hunkHelpers.setOrUpdateLeafTags({ArrayBuffer: true, ArrayBufferView: false, DataView: true, Float32Array: true, Float64Array: true, Int16Array: true, Int32Array: true, Int8Array: true, Uint16Array: true, Uint32Array: true, Uint8ClampedArray: true, CanvasPixelArray: true, Uint8Array: false}); + A.NativeTypedArray.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A.NativeTypedArrayOfDouble.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A.NativeTypedArrayOfInt.$nativeSuperclassTag = "ArrayBufferView"; + })(); + Function.prototype.call$0 = function() { + return this(); + }; + Function.prototype.call$1 = function(a) { + return this(a); + }; + Function.prototype.call$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$1$1 = function(a) { + return this(a); + }; + Function.prototype.call$3$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$2$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$2$1 = function(a) { + return this(a); + }; + Function.prototype.call$3$1 = function(a) { + return this(a); + }; + Function.prototype.call$2$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$1$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$5 = function(a, b, c, d, e) { + return this(a, b, c, d, e); + }; + Function.prototype.call$3$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$2$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$1$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$3$6 = function(a, b, c, d, e, f) { + return this(a, b, c, d, e, f); + }; + Function.prototype.call$2$5 = function(a, b, c, d, e) { + return this(a, b, c, d, e); + }; + Function.prototype.call$1$0 = function() { + return this(); + }; + convertAllToFastObject(holders); + convertToFastObject($); + (function(callback) { + if (typeof document === "undefined") { + callback(null); + return; + } + if (typeof document.currentScript != "undefined") { + callback(document.currentScript); + return; + } + var scripts = document.scripts; + function onLoad(event) { + for (var i = 0; i < scripts.length; ++i) { + scripts[i].removeEventListener("load", onLoad, false); + } + callback(event.target); + } + for (var i = 0; i < scripts.length; ++i) { + scripts[i].addEventListener("load", onLoad, false); + } + })(function(currentScript) { + init.currentScript = currentScript; + var callMain = A.main; + if (typeof dartMainRunner === "function") { + dartMainRunner(callMain, []); + } else { + callMain([]); + } + }); +})(); + +//# sourceMappingURL=worker.dart.js.map diff --git a/experimental/http_get_cache/example/web/favicon.png b/experimental/http_get_cache/example/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/experimental/http_get_cache/example/web/favicon.png differ diff --git a/experimental/http_get_cache/example/web/icons/Icon-192.png b/experimental/http_get_cache/example/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/experimental/http_get_cache/example/web/icons/Icon-192.png differ diff --git a/experimental/http_get_cache/example/web/icons/Icon-512.png b/experimental/http_get_cache/example/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/experimental/http_get_cache/example/web/icons/Icon-512.png differ diff --git a/experimental/http_get_cache/example/web/icons/Icon-maskable-192.png b/experimental/http_get_cache/example/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/experimental/http_get_cache/example/web/icons/Icon-maskable-192.png differ diff --git a/experimental/http_get_cache/example/web/icons/Icon-maskable-512.png b/experimental/http_get_cache/example/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/experimental/http_get_cache/example/web/icons/Icon-maskable-512.png differ diff --git a/experimental/http_get_cache/example/web/index.html b/experimental/http_get_cache/example/web/index.html new file mode 100644 index 0000000..1aa025d --- /dev/null +++ b/experimental/http_get_cache/example/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + diff --git a/experimental/http_get_cache/example/web/manifest.json b/experimental/http_get_cache/example/web/manifest.json new file mode 100644 index 0000000..096edf8 --- /dev/null +++ b/experimental/http_get_cache/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/experimental/http_get_cache/example/web/sqlite3.debug.wasm b/experimental/http_get_cache/example/web/sqlite3.debug.wasm new file mode 100644 index 0000000..1d76779 Binary files /dev/null and b/experimental/http_get_cache/example/web/sqlite3.debug.wasm differ diff --git a/experimental/http_get_cache/example/web/sqlite3.wasm b/experimental/http_get_cache/example/web/sqlite3.wasm new file mode 100644 index 0000000..f5a0421 Binary files /dev/null and b/experimental/http_get_cache/example/web/sqlite3.wasm differ diff --git a/experimental/http_get_cache/example/windows/.gitignore b/experimental/http_get_cache/example/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/experimental/http_get_cache/example/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/experimental/http_get_cache/example/windows/CMakeLists.txt b/experimental/http_get_cache/example/windows/CMakeLists.txt new file mode 100644 index 0000000..d960948 --- /dev/null +++ b/experimental/http_get_cache/example/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(example LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/experimental/http_get_cache/example/windows/flutter/CMakeLists.txt b/experimental/http_get_cache/example/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..903f489 --- /dev/null +++ b/experimental/http_get_cache/example/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/experimental/http_get_cache/example/windows/flutter/generated_plugin_registrant.cc b/experimental/http_get_cache/example/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..988f3c8 --- /dev/null +++ b/experimental/http_get_cache/example/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + Sqlite3FlutterLibsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); +} diff --git a/experimental/http_get_cache/example/windows/flutter/generated_plugin_registrant.h b/experimental/http_get_cache/example/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/experimental/http_get_cache/example/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/experimental/http_get_cache/example/windows/flutter/generated_plugins.cmake b/experimental/http_get_cache/example/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..8abff95 --- /dev/null +++ b/experimental/http_get_cache/example/windows/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + sqlite3_flutter_libs +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/experimental/http_get_cache/example/windows/runner/CMakeLists.txt b/experimental/http_get_cache/example/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..394917c --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/experimental/http_get_cache/example/windows/runner/Runner.rc b/experimental/http_get_cache/example/windows/runner/Runner.rc new file mode 100644 index 0000000..687e6bd --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "example" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "example" "\0" + VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "example.exe" "\0" + VALUE "ProductName", "example" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/experimental/http_get_cache/example/windows/runner/flutter_window.cpp b/experimental/http_get_cache/example/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..955ee30 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/experimental/http_get_cache/example/windows/runner/flutter_window.h b/experimental/http_get_cache/example/windows/runner/flutter_window.h new file mode 100644 index 0000000..6da0652 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/experimental/http_get_cache/example/windows/runner/main.cpp b/experimental/http_get_cache/example/windows/runner/main.cpp new file mode 100644 index 0000000..a61bf80 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"example", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/experimental/http_get_cache/example/windows/runner/resource.h b/experimental/http_get_cache/example/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/experimental/http_get_cache/example/windows/runner/resources/app_icon.ico b/experimental/http_get_cache/example/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/experimental/http_get_cache/example/windows/runner/resources/app_icon.ico differ diff --git a/experimental/http_get_cache/example/windows/runner/runner.exe.manifest b/experimental/http_get_cache/example/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..a42ea76 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/experimental/http_get_cache/example/windows/runner/utils.cpp b/experimental/http_get_cache/example/windows/runner/utils.cpp new file mode 100644 index 0000000..3a0b465 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/experimental/http_get_cache/example/windows/runner/utils.h b/experimental/http_get_cache/example/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/experimental/http_get_cache/example/windows/runner/win32_window.cpp b/experimental/http_get_cache/example/windows/runner/win32_window.cpp new file mode 100644 index 0000000..60608d0 --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/experimental/http_get_cache/example/windows/runner/win32_window.h b/experimental/http_get_cache/example/windows/runner/win32_window.h new file mode 100644 index 0000000..e901dde --- /dev/null +++ b/experimental/http_get_cache/example/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/experimental/http_get_cache/lib/http_get_cache.dart b/experimental/http_get_cache/lib/http_get_cache.dart new file mode 100644 index 0000000..c0c3d0a --- /dev/null +++ b/experimental/http_get_cache/lib/http_get_cache.dart @@ -0,0 +1,44 @@ +export 'src/client/http_client.dart'; +export 'src/http_get_cache.dart'; + +import 'dart:typed_data'; + +import 'package:sqlite3/common.dart'; + +import 'http_get_cache.dart'; +import 'src/constants.dart'; + +export 'src/store/base.dart'; +export 'src/store/sqlite.dart'; +export 'src/database/settings.dart'; +export 'src/database/connection/connect.dart'; +export 'src/database/database.dart'; + +Future initHttpGetCache({ + String name = 'http-get-cache', + bool logStatements = false, + String driftWorkerUri = 'drift_worker.js', + String sqlite3Uri = kDebugMode ? 'sqlite3.debug.wasm' : 'sqlite3.wasm', + void Function(CommonDatabase)? setup, + Future Function()? initializeDatabase, + required String cachePath, + required String databasePath, +}) async { + final settings = DatabaseSettings( + name, + logStatements: logStatements, + driftWorkerUri: driftWorkerUri, + sqlite3Uri: sqlite3Uri, + setup: setup, + initializeDatabase: initializeDatabase, + cacheDir: cachePath, + databaseDir: databasePath, + ); + final e = createExecutor(settings); + final database = HttpGetCacheDatabase(settings, e); + HttpGetCacheDatabase.instance = database; + if (!kIsWeb) { + SqliteHttpCacheStore.deleteExpired(database).ignore(); + } + return database; +} diff --git a/experimental/http_get_cache/lib/http_get_cache_flutter.dart b/experimental/http_get_cache/lib/http_get_cache_flutter.dart new file mode 100644 index 0000000..783d37c --- /dev/null +++ b/experimental/http_get_cache/lib/http_get_cache_flutter.dart @@ -0,0 +1,28 @@ +import 'package:drift/drift.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:sqlite3/common.dart'; + +import 'http_get_cache.dart'; +import 'src/constants.dart'; + +Future initFlutterHttpGetCache({ + String name = 'http-get-cache', + bool logStatements = false, + String driftWorkerUri = 'drift_worker.js', + String sqlite3Uri = kDebugMode ? 'sqlite3.debug.wasm' : 'sqlite3.wasm', + void Function(CommonDatabase)? setup, + Future Function()? initializeDatabase, +}) async { + final cacheDir = await getApplicationCacheDirectory(); + final databaseDir = await getApplicationDocumentsDirectory(); + return await initHttpGetCache( + cachePath: cacheDir.path, + databasePath: databaseDir.path, + name: name, + driftWorkerUri: driftWorkerUri, + sqlite3Uri: sqlite3Uri, + setup: setup, + initializeDatabase: initializeDatabase, + logStatements: logStatements, + ); +} diff --git a/experimental/http_get_cache/lib/http_image_provider.dart b/experimental/http_get_cache/lib/http_image_provider.dart new file mode 100644 index 0000000..c7db126 --- /dev/null +++ b/experimental/http_get_cache/lib/http_image_provider.dart @@ -0,0 +1,188 @@ +import 'dart:async'; +import 'dart:ui' as ui; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/widgets.dart'; + +import 'package:http/http.dart'; + +import 'http_get_cache.dart'; + +/// Fetches the given URL from the network, associating it with the given scale. +/// +/// The image will be cached regardless of cache headers from the server. +/// +/// See also: +/// +/// * [Image.network]. +/// * https://pub.dev/packages/dio_image_provider +/// * https://github.com/dart-lang/http/tree/master/pkgs/flutter_http_example +@immutable +class HttpImageProvider extends ImageProvider { + /// Can be set to override the default [Client] for the + /// [HttpImageProvider]. + static Client defaultClient = httpClient(); + + final Future Function(Request request)? readFromCache; + final Future Function(Request request, Uint8List bytes)? writeToCache; + + /// Creates an object that fetches the image at the given URL. + /// + /// The arguments [url] and [scale] must not be null. + /// [client] will be the default [Client] if not set. + HttpImageProvider.string( + String url, { + this.scale = 1.0, + this.headers, + Client? client, + this.readFromCache, + this.writeToCache, + }) : client = client ?? defaultClient, + url = Uri.parse(url); + + /// Creates an object that fetches the image at the given URL. + /// + /// The arguments [url] and [scale] must not be null. + /// [client] will be the default [Client] if not set. + HttpImageProvider( + this.url, { + this.scale = 1.0, + this.headers, + Client? client, + this.readFromCache, + this.writeToCache, + }) : client = client ?? defaultClient; + + /// The URL from which the image will be fetched. + final Uri url; + + /// The scale to place in the [ImageInfo] object of the image. + final double scale; + + /// The HTTP headers that will be used with [Client.get] to fetch image from network. + /// + /// When running flutter on the web, headers are not used. + final Map? headers; + + /// [client] will be the default [Client] if not set. + final Client client; + + @override + Future obtainKey(ImageConfiguration configuration) { + return SynchronousFuture(this); + } + + final controller = StreamController(); + + @override + ImageStreamCompleter loadImage( + HttpImageProvider key, + ImageDecoderCallback decode, + ) { + return MultiFrameImageStreamCompleter( + codec: _loadAsync(key, decode), + scale: key.scale, + debugLabel: key.url.toString(), + informationCollector: () => [ + DiagnosticsProperty('Image provider', this), + DiagnosticsProperty('Image key', key), + ], + chunkEvents: controller.stream, + ); + } + + Future _loadAsync( + HttpImageProvider key, + ImageDecoderCallback decode, + ) async { + try { + assert(key == this); + + // final head = await client.head(url, headers: headers); + // if (head.statusCode == 200) { + // final contentLength = head.headers['content-length']; + // if (contentLength != null) { + // totalBytes = int.tryParse(contentLength); + // } + // } + + int? totalBytes; + int currentBytes = 0; + final list = []; + final req = Request('GET', url); + if (headers != null) req.headers.addAll(headers!); + + // Check cache + if (readFromCache != null) { + final bytes = await readFromCache!(req); + if (bytes != null) { + final buffer = await ui.ImmutableBuffer.fromUint8List(bytes); + return decode(buffer); + } + } + + final res = await client.send(req); + totalBytes = res.contentLength; + if (res.statusCode != 200) { + throw NetworkImageLoadException( + uri: url, + statusCode: res.statusCode, + ); + } + + await res.stream.asyncMap((e) { + currentBytes += e.length; + controller.add(ImageChunkEvent( + expectedTotalBytes: totalBytes, + cumulativeBytesLoaded: currentBytes, + )); + list.addAll(e); + return e; + }).last; + + final bytes = Uint8List.fromList(list); + if (bytes.lengthInBytes == 0) { + throw NetworkImageLoadException( + uri: url, + statusCode: res.statusCode, + ); + } + + // Write to cache + if (writeToCache != null) { + await writeToCache!(req, bytes); + } + + final buffer = await ui.ImmutableBuffer.fromUint8List(bytes); + return decode(buffer); + } catch (e) { + // Depending on where the exception was thrown, the image cache may not + // have had a chance to track the key in the cache at all. + // Schedule a microtask to give the cache a chance to add the key. + scheduleMicrotask(() { + PaintingBinding.instance.imageCache.evict(key); + }); + rethrow; + } + } + + @override + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) { + return false; + } + return other is HttpImageProvider && + other.url == url && + other.scale == scale; + } + + @override + int get hashCode => Object.hash(url, scale); + + @override + String toString() => + '${objectRuntimeType(this, 'HttpImageProvider')}("$url", scale: $scale)'; +} + +@Deprecated('Use HttpImageProvider instead') +typedef HttpImage = HttpImageProvider; diff --git a/experimental/http_get_cache/lib/src/cache_control.dart b/experimental/http_get_cache/lib/src/cache_control.dart new file mode 100644 index 0000000..cf01348 --- /dev/null +++ b/experimental/http_get_cache/lib/src/cache_control.dart @@ -0,0 +1,56 @@ +import 'package:collection/collection.dart'; + +// Clear-Site-Data: cache can be used to clear every stored response for a site in the browser cache, so use this with care. Note that this will not affected shared or intermediate caches. +class CacheControl { + final String value; + CacheControl(this.value); + + Iterable<(String, String?)> get parts => value.split(',').map((e) { + final p = e.split('=').map((e) => e.trim()).toList(); + return (p.first, p.length > 1 ? p.last : null); + }); + + int _getSeconds(String key, [bool allowBool = false]) { + final part = parts.firstWhereOrNull((e) { + return e.$1.toLowerCase() == key.toLowerCase(); + }); + final val = int.tryParse(part?.$2 ?? ''); + if (val != null) return val; + if (allowBool && _getBool(key)) return double.minPositive.toInt(); + return 0; + } + + bool _getBool(String key) { + return parts.any((e) => e.$1.toLowerCase() == key.toLowerCase()); + } + + (int, bool) _getMixed(String key) => (_getSeconds(key), _getBool(key)); +} + +class RequestCacheControl extends CacheControl { + RequestCacheControl(super.value); + int get maxAge => _getSeconds('max-age'); + int get maxStale => _getSeconds('max-stale'); + int get minFresh => _getSeconds('min-fresh'); + bool get noCache => _getBool('no-cache'); + bool get noStore => _getBool('no-store'); + bool get noTransform => _getBool('no-transform'); + bool get onlyIfCached => _getBool('only-of-cached'); + (int, bool) get staleIfError => _getMixed('stale-if-error'); +} + +class ResponseCacheControl extends CacheControl { + ResponseCacheControl(super.value); + int get maxAge => _getSeconds('max-age'); + int get sMaxAge => _getSeconds('s-maxage'); + bool get noCache => _getBool('no-cache'); + bool get noStore => _getBool('no-store'); + bool get noTransform => _getBool('no-transform'); + bool get mustRevalidate => _getBool('must-revalidate'); + bool get mustUnderstand => _getBool('must-understand'); + bool get private => _getBool('private'); + bool get public => _getBool('public'); + bool get immutable => _getBool('immutable'); + (int, bool) get staleWhileRevalidate => _getMixed('stale-while-revalidate'); + (int, bool) get staleIfError => _getMixed('stale-if-error'); +} diff --git a/experimental/http_get_cache/lib/src/client/http_client.dart b/experimental/http_get_cache/lib/src/client/http_client.dart new file mode 100644 index 0000000..4fdaf57 --- /dev/null +++ b/experimental/http_get_cache/lib/src/client/http_client.dart @@ -0,0 +1,2 @@ +export 'http_client_factory.dart' + if (dart.library.js_interop) 'http_client_factory_web.dart'; diff --git a/experimental/http_get_cache/lib/src/client/http_client_factory.dart b/experimental/http_get_cache/lib/src/client/http_client_factory.dart new file mode 100644 index 0000000..4e9b381 --- /dev/null +++ b/experimental/http_get_cache/lib/src/client/http_client_factory.dart @@ -0,0 +1,30 @@ +import 'dart:io'; + +import 'package:http/http.dart'; +import 'package:http/io_client.dart'; + +import '../database/database.dart'; +import '../http_get_cache.dart'; +import '../store/base.dart'; +import '../store/sqlite.dart'; + +Client httpClient({ + String userAgent = 'Example', + Client? innerClient, + HttpCacheStore? store, +}) { + final db = HttpGetCacheDatabase.instance; + assert( + db != null, + 'Database not initialized "HttpGetCacheDatabase.instance = ..."', + ); + return HttpGetCache( + () { + if (innerClient != null) return innerClient; + final client = HttpClient(); + client.userAgent = userAgent; + return IOClient(client); + }(), + store ?? SqliteHttpCacheStore(db!), + ); +} diff --git a/experimental/http_get_cache/lib/src/client/http_client_factory_web.dart b/experimental/http_get_cache/lib/src/client/http_client_factory_web.dart new file mode 100644 index 0000000..df9f064 --- /dev/null +++ b/experimental/http_get_cache/lib/src/client/http_client_factory_web.dart @@ -0,0 +1,23 @@ +import 'package:fetch_client/fetch_client.dart'; +import 'package:http/http.dart'; + +import '../http_get_cache.dart'; +import '../store/base.dart'; + +Client httpClient({ + String userAgent = 'Example', + Client? innerClient, + HttpCacheStore? store, +}) { + return HttpGetCache( + () { + if (innerClient != null) return innerClient; + return FetchClient( + mode: RequestMode.cors, + cache: RequestCache.byDefault, + // streamRequests: true, + ); + }(), + store ?? HttpCacheStore(), + ); +} diff --git a/experimental/http_get_cache/lib/src/constants.dart b/experimental/http_get_cache/lib/src/constants.dart new file mode 100644 index 0000000..f90a92b --- /dev/null +++ b/experimental/http_get_cache/lib/src/constants.dart @@ -0,0 +1,4 @@ +const bool kReleaseMode = bool.fromEnvironment('dart.vm.product'); +const bool kProfileMode = bool.fromEnvironment('dart.vm.profile'); +const bool kDebugMode = !kReleaseMode && !kProfileMode; +bool kIsWeb = const bool.fromEnvironment('dart.library.js_util'); \ No newline at end of file diff --git a/experimental/http_get_cache/lib/src/database/connection/connect.dart b/experimental/http_get_cache/lib/src/database/connection/connect.dart new file mode 100644 index 0000000..a10d4b7 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/connection/connect.dart @@ -0,0 +1 @@ +export 'connect.web.dart' if (dart.library.ffi) 'connect.io.dart'; diff --git a/experimental/http_get_cache/lib/src/database/connection/connect.io.dart b/experimental/http_get_cache/lib/src/database/connection/connect.io.dart new file mode 100644 index 0000000..d5a3ac5 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/connection/connect.io.dart @@ -0,0 +1,27 @@ +import 'dart:io'; + +import 'package:path/path.dart' as p; +import 'package:drift/drift.dart'; +import 'package:drift/native.dart'; + +import '../settings.dart'; + +LazyDatabase createExecutor(DatabaseSettings settings) { + return LazyDatabase(() async { + final dbFile = File(p.join(settings.dbPath, settings.name)); + if (!dbFile.existsSync()) { + await dbFile.create(recursive: true); + if (settings.initializeDatabase != null) { + final bytes = await settings.initializeDatabase!(); + if (bytes != null) { + await dbFile.writeAsBytes(bytes); + } + } + } + return NativeDatabase.createInBackground( + dbFile, + setup: settings.setup, + logStatements: settings.logStatements, + ); + }); +} diff --git a/experimental/http_get_cache/lib/src/database/connection/connect.memory.dart b/experimental/http_get_cache/lib/src/database/connection/connect.memory.dart new file mode 100644 index 0000000..5d004b9 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/connection/connect.memory.dart @@ -0,0 +1,12 @@ +import 'package:drift/native.dart'; + +import '../database.dart'; +import '../settings.dart'; + +HttpGetCacheDatabase createMemoryDatabase(DatabaseSettings settings) { + final e = NativeDatabase.memory( + logStatements: settings.logStatements, + setup: settings.setup, + ); + return HttpGetCacheDatabase(settings, e); +} diff --git a/experimental/http_get_cache/lib/src/database/connection/connect.web.dart b/experimental/http_get_cache/lib/src/database/connection/connect.web.dart new file mode 100644 index 0000000..381ff23 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/connection/connect.web.dart @@ -0,0 +1,27 @@ +import 'dart:developer'; + +import 'package:drift/drift.dart'; +import 'package:drift/wasm.dart'; + +import '../settings.dart'; + +QueryExecutor createExecutor(DatabaseSettings settings) { + return DatabaseConnection.delayed(Future(() async { + final db = await WasmDatabase.open( + databaseName: settings.name.split('.').first, + sqlite3Uri: Uri.parse(settings.sqlite3Uri), + driftWorkerUri: Uri.parse(settings.driftWorkerUri), + localSetup: settings.setup, + initializeDatabase: settings.initializeDatabase, + ); + + if (db.missingFeatures.isNotEmpty) { + log( + 'Using ${db.chosenImplementation} due to unsupported ' + 'browser features: ${db.missingFeatures}', + ); + } + + return db.resolvedExecutor; + })); +} diff --git a/experimental/http_get_cache/lib/src/database/database.dart b/experimental/http_get_cache/lib/src/database/database.dart new file mode 100644 index 0000000..c892e07 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/database.dart @@ -0,0 +1,35 @@ +import 'package:drift/drift.dart'; +import 'settings.dart'; + +part 'database.g.dart'; + +@DriftDatabase(include: { + "sql/http_cache.drift", +}) +class HttpGetCacheDatabase extends _$HttpGetCacheDatabase { + final DatabaseSettings settings; + + HttpGetCacheDatabase(this.settings, super.e); + + @override + int get schemaVersion => 2; + + static HttpGetCacheDatabase? instance; + + @override + MigrationStrategy get migration { + return MigrationStrategy( + onCreate: (Migrator m) async { + await m.createAll(); + }, + onUpgrade: (Migrator m, int from, int to) async { + if (from < 1) { + await m.createAll(); + } + if (from < 2) { + await m.addColumn(httpCache, httpCache.requestHeaders); + } + }, + ); + } +} diff --git a/experimental/http_get_cache/lib/src/database/database.g.dart b/experimental/http_get_cache/lib/src/database/database.g.dart new file mode 100644 index 0000000..3d1b80a --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/database.g.dart @@ -0,0 +1,865 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'database.dart'; + +// ignore_for_file: type=lint +class HttpCache extends Table with TableInfo { + @override + final GeneratedDatabase attachedDatabase; + final String? _alias; + HttpCache(this.attachedDatabase, [this._alias]); + static const VerificationMeta _idMeta = const VerificationMeta('id'); + late final GeneratedColumn id = GeneratedColumn( + 'id', aliasedName, false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + $customConstraints: 'NOT NULL PRIMARY KEY AUTOINCREMENT'); + static const VerificationMeta _urlMeta = const VerificationMeta('url'); + late final GeneratedColumn url = GeneratedColumn( + 'url', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _headersMeta = + const VerificationMeta('headers'); + late final GeneratedColumn headers = GeneratedColumn( + 'headers', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _requestHeadersMeta = + const VerificationMeta('requestHeaders'); + late final GeneratedColumn requestHeaders = GeneratedColumn( + 'request_headers', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _bodyMeta = const VerificationMeta('body'); + late final GeneratedColumn body = GeneratedColumn( + 'body', aliasedName, false, + type: DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _dateMeta = const VerificationMeta('date'); + late final GeneratedColumn date = GeneratedColumn( + 'date', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _maxAgeMeta = const VerificationMeta('maxAge'); + late final GeneratedColumn maxAge = GeneratedColumn( + 'max_age', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _staleWhileRevalidateMeta = + const VerificationMeta('staleWhileRevalidate'); + late final GeneratedColumn staleWhileRevalidate = GeneratedColumn( + 'stale_while_revalidate', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _staleIfErrorMeta = + const VerificationMeta('staleIfError'); + late final GeneratedColumn staleIfError = GeneratedColumn( + 'stale_if_error', aliasedName, false, + type: DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + static const VerificationMeta _immutableMeta = + const VerificationMeta('immutable'); + late final GeneratedColumn immutable = GeneratedColumn( + 'immutable', aliasedName, false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL'); + @override + List get $columns => [ + id, + url, + headers, + requestHeaders, + body, + date, + maxAge, + staleWhileRevalidate, + staleIfError, + immutable + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'http_cache'; + @override + VerificationContext validateIntegrity(Insertable instance, + {bool isInserting = false}) { + final context = VerificationContext(); + final data = instance.toColumns(true); + if (data.containsKey('id')) { + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); + } + if (data.containsKey('url')) { + context.handle( + _urlMeta, url.isAcceptableOrUnknown(data['url']!, _urlMeta)); + } else if (isInserting) { + context.missing(_urlMeta); + } + if (data.containsKey('headers')) { + context.handle(_headersMeta, + headers.isAcceptableOrUnknown(data['headers']!, _headersMeta)); + } else if (isInserting) { + context.missing(_headersMeta); + } + if (data.containsKey('request_headers')) { + context.handle( + _requestHeadersMeta, + requestHeaders.isAcceptableOrUnknown( + data['request_headers']!, _requestHeadersMeta)); + } else if (isInserting) { + context.missing(_requestHeadersMeta); + } + if (data.containsKey('body')) { + context.handle( + _bodyMeta, body.isAcceptableOrUnknown(data['body']!, _bodyMeta)); + } else if (isInserting) { + context.missing(_bodyMeta); + } + if (data.containsKey('date')) { + context.handle( + _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta)); + } else if (isInserting) { + context.missing(_dateMeta); + } + if (data.containsKey('max_age')) { + context.handle(_maxAgeMeta, + maxAge.isAcceptableOrUnknown(data['max_age']!, _maxAgeMeta)); + } else if (isInserting) { + context.missing(_maxAgeMeta); + } + if (data.containsKey('stale_while_revalidate')) { + context.handle( + _staleWhileRevalidateMeta, + staleWhileRevalidate.isAcceptableOrUnknown( + data['stale_while_revalidate']!, _staleWhileRevalidateMeta)); + } else if (isInserting) { + context.missing(_staleWhileRevalidateMeta); + } + if (data.containsKey('stale_if_error')) { + context.handle( + _staleIfErrorMeta, + staleIfError.isAcceptableOrUnknown( + data['stale_if_error']!, _staleIfErrorMeta)); + } else if (isInserting) { + context.missing(_staleIfErrorMeta); + } + if (data.containsKey('immutable')) { + context.handle(_immutableMeta, + immutable.isAcceptableOrUnknown(data['immutable']!, _immutableMeta)); + } else if (isInserting) { + context.missing(_immutableMeta); + } + return context; + } + + @override + Set get $primaryKey => {id}; + @override + List> get uniqueKeys => [ + {url, requestHeaders}, + ]; + @override + HttpCacheData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return HttpCacheData( + id: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}id'])!, + url: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}url'])!, + headers: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}headers'])!, + requestHeaders: attachedDatabase.typeMapping.read( + DriftSqlType.string, data['${effectivePrefix}request_headers'])!, + body: attachedDatabase.typeMapping + .read(DriftSqlType.string, data['${effectivePrefix}body'])!, + date: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}date'])!, + maxAge: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}max_age'])!, + staleWhileRevalidate: attachedDatabase.typeMapping.read( + DriftSqlType.int, data['${effectivePrefix}stale_while_revalidate'])!, + staleIfError: attachedDatabase.typeMapping + .read(DriftSqlType.int, data['${effectivePrefix}stale_if_error'])!, + immutable: attachedDatabase.typeMapping + .read(DriftSqlType.bool, data['${effectivePrefix}immutable'])!, + ); + } + + @override + HttpCache createAlias(String alias) { + return HttpCache(attachedDatabase, alias); + } + + @override + List get customConstraints => const ['UNIQUE(url, request_headers)']; + @override + bool get dontWriteConstraints => true; +} + +class HttpCacheData extends DataClass implements Insertable { + int id; + String url; + String headers; + String requestHeaders; + String body; + int date; + int maxAge; + int staleWhileRevalidate; + int staleIfError; + bool immutable; + HttpCacheData( + {required this.id, + required this.url, + required this.headers, + required this.requestHeaders, + required this.body, + required this.date, + required this.maxAge, + required this.staleWhileRevalidate, + required this.staleIfError, + required this.immutable}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = Variable(id); + map['url'] = Variable(url); + map['headers'] = Variable(headers); + map['request_headers'] = Variable(requestHeaders); + map['body'] = Variable(body); + map['date'] = Variable(date); + map['max_age'] = Variable(maxAge); + map['stale_while_revalidate'] = Variable(staleWhileRevalidate); + map['stale_if_error'] = Variable(staleIfError); + map['immutable'] = Variable(immutable); + return map; + } + + HttpCacheCompanion toCompanion(bool nullToAbsent) { + return HttpCacheCompanion( + id: Value(id), + url: Value(url), + headers: Value(headers), + requestHeaders: Value(requestHeaders), + body: Value(body), + date: Value(date), + maxAge: Value(maxAge), + staleWhileRevalidate: Value(staleWhileRevalidate), + staleIfError: Value(staleIfError), + immutable: Value(immutable), + ); + } + + factory HttpCacheData.fromJson(Map json, + {ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return HttpCacheData( + id: serializer.fromJson(json['id']), + url: serializer.fromJson(json['url']), + headers: serializer.fromJson(json['headers']), + requestHeaders: serializer.fromJson(json['request_headers']), + body: serializer.fromJson(json['body']), + date: serializer.fromJson(json['date']), + maxAge: serializer.fromJson(json['max_age']), + staleWhileRevalidate: + serializer.fromJson(json['stale_while_revalidate']), + staleIfError: serializer.fromJson(json['stale_if_error']), + immutable: serializer.fromJson(json['immutable']), + ); + } + @override + Map toJson({ValueSerializer? serializer}) { + serializer ??= driftRuntimeOptions.defaultSerializer; + return { + 'id': serializer.toJson(id), + 'url': serializer.toJson(url), + 'headers': serializer.toJson(headers), + 'request_headers': serializer.toJson(requestHeaders), + 'body': serializer.toJson(body), + 'date': serializer.toJson(date), + 'max_age': serializer.toJson(maxAge), + 'stale_while_revalidate': serializer.toJson(staleWhileRevalidate), + 'stale_if_error': serializer.toJson(staleIfError), + 'immutable': serializer.toJson(immutable), + }; + } + + HttpCacheData copyWith( + {int? id, + String? url, + String? headers, + String? requestHeaders, + String? body, + int? date, + int? maxAge, + int? staleWhileRevalidate, + int? staleIfError, + bool? immutable}) => + HttpCacheData( + id: id ?? this.id, + url: url ?? this.url, + headers: headers ?? this.headers, + requestHeaders: requestHeaders ?? this.requestHeaders, + body: body ?? this.body, + date: date ?? this.date, + maxAge: maxAge ?? this.maxAge, + staleWhileRevalidate: staleWhileRevalidate ?? this.staleWhileRevalidate, + staleIfError: staleIfError ?? this.staleIfError, + immutable: immutable ?? this.immutable, + ); + HttpCacheData copyWithCompanion(HttpCacheCompanion data) { + return HttpCacheData( + id: data.id.present ? data.id.value : this.id, + url: data.url.present ? data.url.value : this.url, + headers: data.headers.present ? data.headers.value : this.headers, + requestHeaders: data.requestHeaders.present + ? data.requestHeaders.value + : this.requestHeaders, + body: data.body.present ? data.body.value : this.body, + date: data.date.present ? data.date.value : this.date, + maxAge: data.maxAge.present ? data.maxAge.value : this.maxAge, + staleWhileRevalidate: data.staleWhileRevalidate.present + ? data.staleWhileRevalidate.value + : this.staleWhileRevalidate, + staleIfError: data.staleIfError.present + ? data.staleIfError.value + : this.staleIfError, + immutable: data.immutable.present ? data.immutable.value : this.immutable, + ); + } + + @override + String toString() { + return (StringBuffer('HttpCacheData(') + ..write('id: $id, ') + ..write('url: $url, ') + ..write('headers: $headers, ') + ..write('requestHeaders: $requestHeaders, ') + ..write('body: $body, ') + ..write('date: $date, ') + ..write('maxAge: $maxAge, ') + ..write('staleWhileRevalidate: $staleWhileRevalidate, ') + ..write('staleIfError: $staleIfError, ') + ..write('immutable: $immutable') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(id, url, headers, requestHeaders, body, date, + maxAge, staleWhileRevalidate, staleIfError, immutable); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is HttpCacheData && + other.id == this.id && + other.url == this.url && + other.headers == this.headers && + other.requestHeaders == this.requestHeaders && + other.body == this.body && + other.date == this.date && + other.maxAge == this.maxAge && + other.staleWhileRevalidate == this.staleWhileRevalidate && + other.staleIfError == this.staleIfError && + other.immutable == this.immutable); +} + +class HttpCacheCompanion extends UpdateCompanion { + Value id; + Value url; + Value headers; + Value requestHeaders; + Value body; + Value date; + Value maxAge; + Value staleWhileRevalidate; + Value staleIfError; + Value immutable; + HttpCacheCompanion({ + this.id = const Value.absent(), + this.url = const Value.absent(), + this.headers = const Value.absent(), + this.requestHeaders = const Value.absent(), + this.body = const Value.absent(), + this.date = const Value.absent(), + this.maxAge = const Value.absent(), + this.staleWhileRevalidate = const Value.absent(), + this.staleIfError = const Value.absent(), + this.immutable = const Value.absent(), + }); + HttpCacheCompanion.insert({ + this.id = const Value.absent(), + required String url, + required String headers, + required String requestHeaders, + required String body, + required int date, + required int maxAge, + required int staleWhileRevalidate, + required int staleIfError, + required bool immutable, + }) : url = Value(url), + headers = Value(headers), + requestHeaders = Value(requestHeaders), + body = Value(body), + date = Value(date), + maxAge = Value(maxAge), + staleWhileRevalidate = Value(staleWhileRevalidate), + staleIfError = Value(staleIfError), + immutable = Value(immutable); + static Insertable custom({ + Expression? id, + Expression? url, + Expression? headers, + Expression? requestHeaders, + Expression? body, + Expression? date, + Expression? maxAge, + Expression? staleWhileRevalidate, + Expression? staleIfError, + Expression? immutable, + }) { + return RawValuesInsertable({ + if (id != null) 'id': id, + if (url != null) 'url': url, + if (headers != null) 'headers': headers, + if (requestHeaders != null) 'request_headers': requestHeaders, + if (body != null) 'body': body, + if (date != null) 'date': date, + if (maxAge != null) 'max_age': maxAge, + if (staleWhileRevalidate != null) + 'stale_while_revalidate': staleWhileRevalidate, + if (staleIfError != null) 'stale_if_error': staleIfError, + if (immutable != null) 'immutable': immutable, + }); + } + + HttpCacheCompanion copyWith( + {Value? id, + Value? url, + Value? headers, + Value? requestHeaders, + Value? body, + Value? date, + Value? maxAge, + Value? staleWhileRevalidate, + Value? staleIfError, + Value? immutable}) { + return HttpCacheCompanion( + id: id ?? this.id, + url: url ?? this.url, + headers: headers ?? this.headers, + requestHeaders: requestHeaders ?? this.requestHeaders, + body: body ?? this.body, + date: date ?? this.date, + maxAge: maxAge ?? this.maxAge, + staleWhileRevalidate: staleWhileRevalidate ?? this.staleWhileRevalidate, + staleIfError: staleIfError ?? this.staleIfError, + immutable: immutable ?? this.immutable, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = Variable(id.value); + } + if (url.present) { + map['url'] = Variable(url.value); + } + if (headers.present) { + map['headers'] = Variable(headers.value); + } + if (requestHeaders.present) { + map['request_headers'] = Variable(requestHeaders.value); + } + if (body.present) { + map['body'] = Variable(body.value); + } + if (date.present) { + map['date'] = Variable(date.value); + } + if (maxAge.present) { + map['max_age'] = Variable(maxAge.value); + } + if (staleWhileRevalidate.present) { + map['stale_while_revalidate'] = Variable(staleWhileRevalidate.value); + } + if (staleIfError.present) { + map['stale_if_error'] = Variable(staleIfError.value); + } + if (immutable.present) { + map['immutable'] = Variable(immutable.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('HttpCacheCompanion(') + ..write('id: $id, ') + ..write('url: $url, ') + ..write('headers: $headers, ') + ..write('requestHeaders: $requestHeaders, ') + ..write('body: $body, ') + ..write('date: $date, ') + ..write('maxAge: $maxAge, ') + ..write('staleWhileRevalidate: $staleWhileRevalidate, ') + ..write('staleIfError: $staleIfError, ') + ..write('immutable: $immutable') + ..write(')')) + .toString(); + } +} + +abstract class _$HttpGetCacheDatabase extends GeneratedDatabase { + _$HttpGetCacheDatabase(QueryExecutor e) : super(e); + $HttpGetCacheDatabaseManager get managers => + $HttpGetCacheDatabaseManager(this); + late final HttpCache httpCache = HttpCache(this); + late final Index httpCacheIdx = Index('http_cache_idx', + 'CREATE UNIQUE INDEX http_cache_idx ON http_cache (url, request_headers, date, max_age, stale_if_error, stale_while_revalidate)'); + Future> setHttpCache( + {required String url, + required String headers, + required String requestHeaders, + required String body, + required int date, + required int maxAge, + required int staleWhileRevalidate, + required int staleIfError, + required bool immutable}) { + return customWriteReturning( + 'INSERT OR REPLACE INTO http_cache (url, headers, request_headers, body, date, max_age, stale_while_revalidate, stale_if_error, immutable) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9) RETURNING *', + variables: [ + Variable(url), + Variable(headers), + Variable(requestHeaders), + Variable(body), + Variable(date), + Variable(maxAge), + Variable(staleWhileRevalidate), + Variable(staleIfError), + Variable(immutable) + ], + updates: { + httpCache + }).then((rows) => Future.wait(rows.map(httpCache.mapFromRow))); + } + + Selectable getHttpCacheByUrl({required String url}) { + return customSelect('SELECT * FROM http_cache WHERE url = ?1', variables: [ + Variable(url) + ], readsFrom: { + httpCache, + }).asyncMap(httpCache.mapFromRow); + } + + Selectable getHttpCache({required String url}) { + return customSelect('SELECT * FROM http_cache WHERE url = ?1', variables: [ + Variable(url) + ], readsFrom: { + httpCache, + }).asyncMap(httpCache.mapFromRow); + } + + Future deleteHttpCache({required String url}) { + return customUpdate( + 'DELETE FROM http_cache WHERE url = ?1', + variables: [Variable(url)], + updates: {httpCache}, + updateKind: UpdateKind.delete, + ); + } + + Future deleteHttpCacheStale() { + return customUpdate( + 'DELETE FROM http_cache WHERE unixepoch() >(date +(max_age * 1000)+(MAX(stale_while_revalidate, stale_if_error) * 1000))', + variables: [], + updates: {httpCache}, + updateKind: UpdateKind.delete, + ); + } + + Future deleteHttpCacheStaleWithoutRevalidate() { + return customUpdate( + 'DELETE FROM http_cache WHERE unixepoch() >(date +(max_age * 1000))', + variables: [], + updates: {httpCache}, + updateKind: UpdateKind.delete, + ); + } + + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [httpCache, httpCacheIdx]; + @override + DriftDatabaseOptions get options => + const DriftDatabaseOptions(storeDateTimeAsText: true); +} + +typedef $HttpCacheCreateCompanionBuilder = HttpCacheCompanion Function({ + Value id, + required String url, + required String headers, + required String requestHeaders, + required String body, + required int date, + required int maxAge, + required int staleWhileRevalidate, + required int staleIfError, + required bool immutable, +}); +typedef $HttpCacheUpdateCompanionBuilder = HttpCacheCompanion Function({ + Value id, + Value url, + Value headers, + Value requestHeaders, + Value body, + Value date, + Value maxAge, + Value staleWhileRevalidate, + Value staleIfError, + Value immutable, +}); + +class $HttpCacheFilterComposer + extends Composer<_$HttpGetCacheDatabase, HttpCache> { + $HttpCacheFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get url => $composableBuilder( + column: $table.url, builder: (column) => ColumnFilters(column)); + + ColumnFilters get headers => $composableBuilder( + column: $table.headers, builder: (column) => ColumnFilters(column)); + + ColumnFilters get requestHeaders => $composableBuilder( + column: $table.requestHeaders, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get body => $composableBuilder( + column: $table.body, builder: (column) => ColumnFilters(column)); + + ColumnFilters get date => $composableBuilder( + column: $table.date, builder: (column) => ColumnFilters(column)); + + ColumnFilters get maxAge => $composableBuilder( + column: $table.maxAge, builder: (column) => ColumnFilters(column)); + + ColumnFilters get staleWhileRevalidate => $composableBuilder( + column: $table.staleWhileRevalidate, + builder: (column) => ColumnFilters(column)); + + ColumnFilters get staleIfError => $composableBuilder( + column: $table.staleIfError, builder: (column) => ColumnFilters(column)); + + ColumnFilters get immutable => $composableBuilder( + column: $table.immutable, builder: (column) => ColumnFilters(column)); +} + +class $HttpCacheOrderingComposer + extends Composer<_$HttpGetCacheDatabase, HttpCache> { + $HttpCacheOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get url => $composableBuilder( + column: $table.url, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get headers => $composableBuilder( + column: $table.headers, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get requestHeaders => $composableBuilder( + column: $table.requestHeaders, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get body => $composableBuilder( + column: $table.body, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get date => $composableBuilder( + column: $table.date, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get maxAge => $composableBuilder( + column: $table.maxAge, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get staleWhileRevalidate => $composableBuilder( + column: $table.staleWhileRevalidate, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get staleIfError => $composableBuilder( + column: $table.staleIfError, + builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get immutable => $composableBuilder( + column: $table.immutable, builder: (column) => ColumnOrderings(column)); +} + +class $HttpCacheAnnotationComposer + extends Composer<_$HttpGetCacheDatabase, HttpCache> { + $HttpCacheAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get url => + $composableBuilder(column: $table.url, builder: (column) => column); + + GeneratedColumn get headers => + $composableBuilder(column: $table.headers, builder: (column) => column); + + GeneratedColumn get requestHeaders => $composableBuilder( + column: $table.requestHeaders, builder: (column) => column); + + GeneratedColumn get body => + $composableBuilder(column: $table.body, builder: (column) => column); + + GeneratedColumn get date => + $composableBuilder(column: $table.date, builder: (column) => column); + + GeneratedColumn get maxAge => + $composableBuilder(column: $table.maxAge, builder: (column) => column); + + GeneratedColumn get staleWhileRevalidate => $composableBuilder( + column: $table.staleWhileRevalidate, builder: (column) => column); + + GeneratedColumn get staleIfError => $composableBuilder( + column: $table.staleIfError, builder: (column) => column); + + GeneratedColumn get immutable => + $composableBuilder(column: $table.immutable, builder: (column) => column); +} + +class $HttpCacheTableManager extends RootTableManager< + _$HttpGetCacheDatabase, + HttpCache, + HttpCacheData, + $HttpCacheFilterComposer, + $HttpCacheOrderingComposer, + $HttpCacheAnnotationComposer, + $HttpCacheCreateCompanionBuilder, + $HttpCacheUpdateCompanionBuilder, + ( + HttpCacheData, + BaseReferences<_$HttpGetCacheDatabase, HttpCache, HttpCacheData> + ), + HttpCacheData, + PrefetchHooks Function()> { + $HttpCacheTableManager(_$HttpGetCacheDatabase db, HttpCache table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $HttpCacheFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $HttpCacheOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $HttpCacheAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value url = const Value.absent(), + Value headers = const Value.absent(), + Value requestHeaders = const Value.absent(), + Value body = const Value.absent(), + Value date = const Value.absent(), + Value maxAge = const Value.absent(), + Value staleWhileRevalidate = const Value.absent(), + Value staleIfError = const Value.absent(), + Value immutable = const Value.absent(), + }) => + HttpCacheCompanion( + id: id, + url: url, + headers: headers, + requestHeaders: requestHeaders, + body: body, + date: date, + maxAge: maxAge, + staleWhileRevalidate: staleWhileRevalidate, + staleIfError: staleIfError, + immutable: immutable, + ), + createCompanionCallback: ({ + Value id = const Value.absent(), + required String url, + required String headers, + required String requestHeaders, + required String body, + required int date, + required int maxAge, + required int staleWhileRevalidate, + required int staleIfError, + required bool immutable, + }) => + HttpCacheCompanion.insert( + id: id, + url: url, + headers: headers, + requestHeaders: requestHeaders, + body: body, + date: date, + maxAge: maxAge, + staleWhileRevalidate: staleWhileRevalidate, + staleIfError: staleIfError, + immutable: immutable, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $HttpCacheProcessedTableManager = ProcessedTableManager< + _$HttpGetCacheDatabase, + HttpCache, + HttpCacheData, + $HttpCacheFilterComposer, + $HttpCacheOrderingComposer, + $HttpCacheAnnotationComposer, + $HttpCacheCreateCompanionBuilder, + $HttpCacheUpdateCompanionBuilder, + ( + HttpCacheData, + BaseReferences<_$HttpGetCacheDatabase, HttpCache, HttpCacheData> + ), + HttpCacheData, + PrefetchHooks Function()>; + +class $HttpGetCacheDatabaseManager { + final _$HttpGetCacheDatabase _db; + $HttpGetCacheDatabaseManager(this._db); + $HttpCacheTableManager get httpCache => + $HttpCacheTableManager(_db, _db.httpCache); +} diff --git a/experimental/http_get_cache/lib/src/database/settings.dart b/experimental/http_get_cache/lib/src/database/settings.dart new file mode 100644 index 0000000..b6c5228 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/settings.dart @@ -0,0 +1,31 @@ +import 'dart:typed_data'; + +import 'package:path/path.dart' as p; +import 'package:sqlite3/common.dart'; + +import '../constants.dart'; + +class DatabaseSettings { + final String name; + final bool logStatements; + final String driftWorkerUri; + final String sqlite3Uri; + final String databaseDir; + final String cacheDir; + final void Function(CommonDatabase)? setup; + final Future Function()? initializeDatabase; + + const DatabaseSettings( + this.name, { + this.logStatements = false, + this.driftWorkerUri = 'drift_worker.js', + this.sqlite3Uri = kDebugMode ? 'sqlite3.debug.wasm' : 'sqlite3.wasm', + this.setup, + this.initializeDatabase, + required this.databaseDir, + required this.cacheDir, + }); + + String get dbPath => p.join(databaseDir, name); + String get cachePath => p.join(cacheDir, 'cache'); +} diff --git a/experimental/http_get_cache/lib/src/database/sql/http_cache.drift b/experimental/http_get_cache/lib/src/database/sql/http_cache.drift new file mode 100644 index 0000000..b0c34b3 --- /dev/null +++ b/experimental/http_get_cache/lib/src/database/sql/http_cache.drift @@ -0,0 +1,68 @@ +CREATE TABLE http_cache ( + id INT NOT NULL PRIMARY KEY AUTOINCREMENT, + url TEXT NOT NULL, + headers TEXT NOT NULL, + request_headers TEXT NOT NULL, + body TEXT NOT NULL, + date INT NOT NULL, + max_age INT NOT NULL, + stale_while_revalidate INT NOT NULL, + stale_if_error INT NOT NULL, + immutable BOOLEAN NOT NULL, + UNIQUE(url, request_headers) +); + +CREATE UNIQUE INDEX http_cache_idx ON http_cache ( + url, + request_headers, + date, + max_age, + stale_if_error, + stale_while_revalidate +); + +setHttpCache: +INSERT OR REPLACE +INTO http_cache ( + url, + headers, + request_headers, + body, + date, + max_age, + stale_while_revalidate, + stale_if_error, + immutable +) +VALUES ( + :url, + :headers, + :requestHeaders, + :body, + :date, + :maxAge, + :staleWhileRevalidate, + :staleIfError, + :immutable +) +RETURNING *; + +getHttpCacheByUrl: +SELECT * FROM http_cache +WHERE url = :url; + +getHttpCache: +SELECT * FROM http_cache +WHERE url = :url; + +deleteHttpCache: +DELETE FROM http_cache +WHERE url = :url; + +deleteHttpCacheStale: +DELETE FROM http_cache +WHERE unixepoch() > (date + (max_age * 1000) + (MAX(stale_while_revalidate, stale_if_error) * 1000)); + +deleteHttpCacheStaleWithoutRevalidate: +DELETE FROM http_cache +WHERE unixepoch() > (date + (max_age * 1000)); diff --git a/experimental/http_get_cache/lib/src/date_parser.dart b/experimental/http_get_cache/lib/src/date_parser.dart new file mode 100644 index 0000000..a7f85ee --- /dev/null +++ b/experimental/http_get_cache/lib/src/date_parser.dart @@ -0,0 +1,48 @@ +/// Parse a date from a request/response header value into +/// a valid dart DateTime. +/// +/// Example: Wed, 17 Jul 2024 23:19:37 GMT +class DateParser { + const DateParser(); + DateTime? call(String value) { + if (value.isEmpty) return null; + final d = DateTime.tryParse(value); + if (d != null) return d; + final [ + _, + dayOfMonth, + monthName, + yearName, + time, + _, + ] = value.trim().split(' '); + var year = int.parse(yearName).toString(); + var month = (switch (monthName.toLowerCase()) { + 'jan' => DateTime.january, + 'feb' => DateTime.february, + 'mar' => DateTime.march, + 'apr' => DateTime.april, + 'may' => DateTime.may, + 'jun' => DateTime.june, + 'jul' => DateTime.july, + 'aug' => DateTime.august, + 'sep' => DateTime.september, + 'oct' => DateTime.october, + 'nov' => DateTime.november, + 'dec' => DateTime.december, + (_) => -1, + }) + .toString() + .padLeft(2, '0'); + var day = int.parse(dayOfMonth).toString().padLeft(2, '0'); + final str = '$year-$month-$day $time'; + return DateTime.tryParse(str); + } +} + +DateTime getDate() => DateTime.now(); +int getDateInt() => getDate().toSeconds(); + +extension DateTimeUtils on DateTime { + int toSeconds() => Duration(milliseconds: millisecondsSinceEpoch).inSeconds; +} diff --git a/experimental/http_get_cache/lib/src/extensions.dart b/experimental/http_get_cache/lib/src/extensions.dart new file mode 100644 index 0000000..3f576b0 --- /dev/null +++ b/experimental/http_get_cache/lib/src/extensions.dart @@ -0,0 +1,26 @@ +import 'package:cachecontrol/cachecontrol.dart'; +import 'package:http/http.dart'; + +const _cacheControlHeader = 'cache-control'; + +extension CacheControlRequest on BaseRequest { + RequestCacheControl get cacheControl { + final raw = headers[_cacheControlHeader] ?? ''; + return RequestCacheControl.parse(raw); + } + + set cacheControl(RequestCacheControl value) { + headers[_cacheControlHeader] = value.toString(); + } +} + +extension CacheControlBaseResponse on BaseResponse { + ResponseCacheControl get cacheControl { + final raw = headers[_cacheControlHeader] ?? ''; + return ResponseCacheControl.parse(raw); + } + + set cacheControl(ResponseCacheControl value) { + headers[_cacheControlHeader] = value.toString(); + } +} diff --git a/experimental/http_get_cache/lib/src/http_get_cache.dart b/experimental/http_get_cache/lib/src/http_get_cache.dart new file mode 100644 index 0000000..74992ef --- /dev/null +++ b/experimental/http_get_cache/lib/src/http_get_cache.dart @@ -0,0 +1,145 @@ +import 'dart:convert'; +import 'dart:math'; + +import 'package:http/http.dart'; + +import 'constants.dart'; +import 'request_headers.dart'; +import 'date_parser.dart'; +import 'store/base.dart'; + +class HttpGetCache extends BaseClient { + final HttpCacheStore store; + final Client inner; + + HttpGetCache(this.inner, this.store); + + static Future networkError(Object? error) async { + return StreamedResponse( + Stream.value(utf8.encode('$error')), + 500, + ); + } + + static Future offlineError(Object? error) async { + return StreamedResponse( + Stream.value(utf8.encode('$error')), + 503, + ); + } + + static Future gatewayTimeout() async { + return StreamedResponse( + Stream.value(utf8.encode('Gateway Timeout')), + 504, + ); + } + + Future save(BaseRequest request) async { + final reqCC = request.cacheControl; + final res = await inner.send(request); + final resCC = res.cacheControl; + if (res.statusCode == 200) { + if (reqCC.noStore || resCC.noStore || resCC.noCache) { + return res; + } else { + return await store.set(request, res); + } + } else { + final cached = await store.get(request); + if (cached != null) { + final cachedCC = cached.cacheControl; + final now = getDateInt(); + final date = cached.requestHeaders.created; + if (reqCC.staleIfError.$2 || resCC.staleIfError.$2) { + return cached; + } else if (date != null && + now < + (date + + cachedCC.maxAge + + max( + cachedCC.staleIfError.$1, + reqCC.staleIfError.$1, + ))) { + return cached; + } + } + } + return res; + } + + Stream stream(BaseRequest request) async* { + final method = request.method.toLowerCase(); + final reqCC = request.cacheControl; + + if (kIsWeb || method != 'get') { + yield await inner.send(request); + return; + } + + // Check for early fetch + var cached = await store.get(request); + bool needsUpdate = true; + + if (cached == null && reqCC.onlyIfCached) { + yield await gatewayTimeout(); + return; + } + + // Check for cache + if (cached != null) { + final cachedCC = cached.cacheControl; + if (cachedCC.mustRevalidate || cachedCC.noCache || reqCC.noCache) { + needsUpdate = true; + } else { + final now = getDateInt(); + final date = cached.requestHeaders.created; + if (date != null && now < (date + cachedCC.maxAge)) { + needsUpdate = false; + yield cached; + } else if (date != null && + now < (date + cachedCC.maxAge + cachedCC.staleWhileRevalidate.$1)) { + yield cached; + } else if (cachedCC.staleWhileRevalidate.$2) { + yield cached; + } + + if (!cachedCC.immutable && needsUpdate) { + // Check for new eTag, Last-Modified change + final headRes = await inner.head(request.url); + final headHeaders = headRes.requestHeaders; + if (headRes.statusCode == 200) { + // Check eTag + if ((cached.requestHeaders.eTag + headHeaders.eTag).isNotEmpty && + cached.requestHeaders.eTag == headHeaders.eTag) { + needsUpdate = false; + } + if ((max( + cached.requestHeaders.lastModified ?? 0, + headHeaders.lastModified ?? 0, + ) > + 0) && + cached.requestHeaders.lastModified == + headHeaders.lastModified) { + needsUpdate = false; + } + } else if (headRes.statusCode == 304) { + // Or 304 cache is still good to reuse + needsUpdate = false; + if (cachedCC.mustRevalidate || cachedCC.noCache || reqCC.noCache) { + yield cached; + } + } + } + } + } + + if (!needsUpdate) return; + yield await save(request); + } + + @override + Future send(BaseRequest request) { + return stream(request).last; + } +} diff --git a/experimental/http_get_cache/lib/src/request_headers.dart b/experimental/http_get_cache/lib/src/request_headers.dart new file mode 100644 index 0000000..fa3de11 --- /dev/null +++ b/experimental/http_get_cache/lib/src/request_headers.dart @@ -0,0 +1,75 @@ +import 'package:collection/collection.dart'; +import 'package:http/http.dart'; + +import 'cache_control.dart'; +import 'date_parser.dart'; + +class RequestHeaders { + final Map value; + RequestHeaders(this.value); + + static DateParser dateParser = const DateParser(); + + String getValue(String key) { + final result = value.entries.firstWhere( + (e) => e.key.toLowerCase() == key.toLowerCase(), + orElse: () => MapEntry(key, ''), + ); + return result.value; + } + + String get eTag => getValue('eTag'); + + int get age => int.tryParse(getValue('Age')) ?? 0; + + int? get lastModified => dateParser(getValue('Last-Modified'))?.toSeconds(); + + int? get date => dateParser(getValue('Date'))?.toSeconds(); + + int? get expires => dateParser(getValue('Expires'))?.toSeconds(); + + int? get created { + final lastModifiedKey = value.keys.firstWhereOrNull( + (e) => e.toLowerCase() == 'last-modified', + ); + final dateKey = value.keys.firstWhereOrNull( + (e) => e.toLowerCase() == 'date', + ); + final key = lastModifiedKey ?? dateKey; + if (key != null) { + final d = dateParser(value[key]!); + if (d != null) return d.millisecondsSinceEpoch; + } + return null; + } +} + +extension BaseRequestCCUtils on BaseRequest { + RequestHeaders get requestHeaders { + return RequestHeaders(headers); + } + + RequestCacheControl get cacheControl { + return RequestCacheControl(requestHeaders.getValue('cache-control')); + } +} + +extension StreamedResponseCCUtils on StreamedResponse { + RequestHeaders get requestHeaders { + return RequestHeaders(headers); + } + + ResponseCacheControl get cacheControl { + return ResponseCacheControl(requestHeaders.getValue('cache-control')); + } +} + +extension ResponseCCUtils on Response { + RequestHeaders get requestHeaders { + return RequestHeaders(headers); + } + + ResponseCacheControl get cacheControl { + return ResponseCacheControl(requestHeaders.getValue('cache-control')); + } +} diff --git a/experimental/http_get_cache/lib/src/store/base.dart b/experimental/http_get_cache/lib/src/store/base.dart new file mode 100644 index 0000000..ede6aca --- /dev/null +++ b/experimental/http_get_cache/lib/src/store/base.dart @@ -0,0 +1,14 @@ +import 'package:http/http.dart'; + +class HttpCacheStore { + Future get(BaseRequest request) async { + return null; + } + + Future set( + BaseRequest request, + StreamedResponse response, + ) async { + return response; + } +} diff --git a/experimental/http_get_cache/lib/src/store/sqlite.dart b/experimental/http_get_cache/lib/src/store/sqlite.dart new file mode 100644 index 0000000..b0fc12d --- /dev/null +++ b/experimental/http_get_cache/lib/src/store/sqlite.dart @@ -0,0 +1,221 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:crypto/crypto.dart'; +import 'package:http/http.dart'; +import 'package:path/path.dart' as p; + +import '../constants.dart'; +import '../database/database.dart'; +import '../date_parser.dart'; +import '../request_headers.dart'; +import 'base.dart'; + +class SqliteHttpCacheStore extends HttpCacheStore { + final HttpGetCacheDatabase database; + + SqliteHttpCacheStore(this.database); + + static Future getCacheDir(HttpGetCacheDatabase database) async { + if (kIsWeb) return ''; + final cachePath = database.settings.cachePath; + final cacheDir = Directory(cachePath); + if (!cacheDir.existsSync()) { + await cacheDir.create(recursive: true); + } + return cacheDir.path; + } + + static Future deleteCacheDir(HttpGetCacheDatabase database) async { + if (kIsWeb) return; + final cachePath = await getCacheDir(database); + if (cachePath.isEmpty) return; + final cacheDir = Directory(cachePath); + + if (cacheDir.existsSync()) { + cacheDir.deleteSync(recursive: true); + } + } + + static Future getCacheDirSize(HttpGetCacheDatabase database) async { + if (kIsWeb) return 0; + final cachePath = await getCacheDir(database); + if (cachePath.isEmpty) return 0; + final cacheDir = Directory(cachePath); + + if (cacheDir.existsSync()) { + final files = await cacheDir.list(recursive: true).toList(); + final dirSize = + files.fold(0, (int sum, file) => sum + file.statSync().size); + return dirSize; + } + + return 0; + } + + static Future deleteExpired(HttpGetCacheDatabase database) async { + await database.deleteHttpCacheStale(); + } + + Stream> _streamAndSaveBytes( + BaseRequest req, + StreamedResponse res, + File file, + ) async* { + final date = res.requestHeaders.created ?? getDateInt(); + if (!file.existsSync()) { + await file.create(recursive: true); + } + final writer = file.openWrite(); + await for (final event in res.stream) { + yield event; + writer.add(event); + } + await writer.flush(); + await writer.close(); + + final vary = res.headers['vary'] ?? ''; + final requestHeaders = {}; + if (vary.isNotEmpty && vary != '*') { + final keys = + vary.split(',').map((e) => e.trim()).where((e) => e.isNotEmpty); + for (final key in keys) { + requestHeaders[key] = req.headers[key] ?? ''; + } + } + + await database.setHttpCache( + url: req.url.key, + headers: jsonEncode(res.headers), + requestHeaders: jsonEncode(requestHeaders), + body: file.path, + maxAge: res.cacheControl.maxAge, + staleWhileRevalidate: res.cacheControl.staleWhileRevalidate.$1, + staleIfError: res.cacheControl.staleIfError.$1, + immutable: res.cacheControl.immutable, + date: date, + ); + } + + @override + Future set( + BaseRequest request, + StreamedResponse response, + ) async { + if (kIsWeb) return response; + // Don't cache if Vary is * + if (response.headers['vary'] == '*') { + return response; + } + + if (response.cacheControl.noStore || request.cacheControl.noStore) { + return response; + } + final dirPath = await getCacheDir(database); + if (dirPath.isEmpty) return response; + final dir = Directory(dirPath); + // Use a unique file name to allow multiple responses per URL. + // We can't rely just on URL key anymore. + // We'll append a random string or use UUID if we had it, but here just use random hash or + // simply use the existing method but append request headers hash. + // To safe space and keep it simple, let's use a combination. + // However, if we change the file naming, we orphan old files or we need to manage them. + // Since we delete by DB entry (which stores path), it's fine. + // Just need a unique name. + + // Simple unique name strategy: hash(url + vary request headers) + // But we don't know vary headers yet... wait, we do get them from response. + // We computed `requestHeaders` in _streamAndSaveBytes. + // Ideally we compute path there too? But we pass file into it. + + // Let's modify behavior: Generate a random ID for the file? + // Or just make `key` unique-ish. + // sha256(url + timestamp + random) is safe enough. + + final uniqueId = sha256 + .convert(utf8.encode( + '${request.url.key}${DateTime.now().microsecondsSinceEpoch}')) + .toString(); + final file = File(p.join(dir.path, uniqueId)); + + return StreamedResponse( + _streamAndSaveBytes(request, response, file), + response.statusCode, + contentLength: response.contentLength, + request: response.request, + headers: response.headers, + isRedirect: response.isRedirect, + persistentConnection: response.persistentConnection, + reasonPhrase: response.reasonPhrase, + ); + } + + @override + Future get(BaseRequest request) async { + final candidates = await database // + .getHttpCache(url: request.url.key) + .get(); + + for (final candidate in candidates) { + final responseHeaders = _parseHeaders(candidate.headers); + final vary = responseHeaders['vary']; + + if (vary == '*') { + continue; // Should not happen if we don't store it, but check anyway. + } + + bool match = true; + if (vary != null && vary.isNotEmpty) { + final storedRequestHeaders = _parseHeaders(candidate.requestHeaders); + final varyKeys = + vary.split(',').map((e) => e.trim()).where((e) => e.isNotEmpty); + for (final key in varyKeys) { + if (request.headers[key] != storedRequestHeaders[key]) { + match = false; + break; + } + } + } + + if (match) { + final path = candidate.body; + final file = File(path); + if (await file.exists()) { + final stats = await file.stat(); + final h = {...responseHeaders}; + final rq = RequestHeaders(h); + if (rq.created == null) { + final d = DateTime.fromMillisecondsSinceEpoch(candidate.date); + h['Date'] = d.toIso8601String(); + } + return StreamedResponse( + file.openRead(), + 200, + contentLength: stats.size, + headers: h, + ); + } + } + } + return null; + } +} + +// extension on BaseRequest { +// String get key => sha256.convert(utf8.encode(url.key)).toString(); +// } + +extension on Uri { + String get key => toString(); +} + +Map _parseHeaders(String key) { + final headers = {}; + if (key.isNotEmpty) { + final data = jsonDecode(key) as Map; + for (final entry in data.entries) { + headers[entry.key] = entry.value?.toString() ?? ''; + } + } + return headers; +} diff --git a/experimental/http_get_cache/pubspec.yaml b/experimental/http_get_cache/pubspec.yaml new file mode 100644 index 0000000..2199409 --- /dev/null +++ b/experimental/http_get_cache/pubspec.yaml @@ -0,0 +1,33 @@ +name: http_get_cache +description: "HTTP Compliant cache for Flutter" +version: 0.1.0 +homepage: https://github.com/rodydavis/packages.dart +repository: https://github.com/rodydavis/packages.dart +maintainer: Rody Davis (@rodydavis) + +environment: + sdk: ^3.5.0 + flutter: ">=1.17.0" + +dependencies: + cachecontrol: ^0.1.0 + collection: ^1.19.0 + crypto: ^3.0.6 + drift: ^2.24.2 + drift_flutter: ^0.2.8 + fetch_client: ^1.1.2 + flutter: + sdk: flutter + http: ^1.3.0 + path: ^1.9.0 + path_provider: ^2.1.3 + sqlite3: ^2.5.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + drift_dev: ^2.24.2 + build_runner: ^2.4.11 + +flutter: diff --git a/experimental/http_get_cache/test/date_parser_test.dart b/experimental/http_get_cache/test/date_parser_test.dart new file mode 100644 index 0000000..aafe05b --- /dev/null +++ b/experimental/http_get_cache/test/date_parser_test.dart @@ -0,0 +1,11 @@ +import 'package:http_get_cache/src/date_parser.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('date-parse', () { + const str = 'Wed, 17 Jul 2024 23:19:37 GMT'; + const parser = DateParser(); + final date = parser(str); + expect(date != null, true); + }); +} diff --git a/experimental/http_get_cache/test/flutter_http_cache_test.dart b/experimental/http_get_cache/test/flutter_http_cache_test.dart new file mode 100644 index 0000000..a3d5720 --- /dev/null +++ b/experimental/http_get_cache/test/flutter_http_cache_test.dart @@ -0,0 +1,204 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:http_get_cache/http_get_cache.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:http/http.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + late HttpGetCacheDatabase db; + late SqliteHttpCacheStore store; + + setUp(() async { + db = await initHttpGetCache( + cachePath: 'temp', + databasePath: 'temp' + ); + store = SqliteHttpCacheStore(db); + }); + + tearDown(() async { + await db.close(); + }); + + tearDownAll(() async { + await Directory(db.settings.cacheDir).delete(recursive: true); + // await Directory(db.settings.databaseDir).delete(recursive: true); + }); + + group('HttpGetCache', () { + test('check for no cache headers', () async { + final inner = TestHttpClient(); + final client = HttpGetCache(inner, store); + + var res = await client.get(Uri.http('example.com')); + + expect(res.statusCode, 200); + expect(inner.calls, 1); + + res = await client.get(Uri.http('example.com')); + + expect(res.statusCode, 200); + expect(inner.calls, 2); + }); + + test('check if cache-control header is respected', () async { + final inner = TestHttpClient(); + const target = 'http://example.com/cache-control'; + inner.handle = (req) async { + return Response('', 200, headers: { + 'Cache-Control': 'public, immutable', + }); + }; + final client = HttpGetCache(inner, store); + + var res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], 'public, immutable'); + expect(inner.calls, 1); + + res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], 'public, immutable'); + expect(inner.calls, 2); + }); + + test('check if max-age is respected', () async { + final inner = TestHttpClient(); + const target = 'http://example.com/max-age'; + const ma = 5; + inner.handle = (req) async { + return Response.bytes(utf8.encode('Success!'), 200, headers: { + 'Cache-Control': 'max-age=$ma', + }); + }; + final client = HttpGetCache(inner, store); + + var res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], 'max-age=$ma'); + expect(inner.calls, 1); + + res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], 'max-age=$ma'); + expect(inner.calls, 1); + + await Future.delayed(const Duration(seconds: ma + 1)); + res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], 'max-age=$ma'); + expect(inner.calls, 2); + }); + + test('check if max-age + stale-while-revalidate is respected', () async { + final inner = TestHttpClient(); + const target = 'http://example.com/max-age/stale-while-revalidate'; + const ma = 3; + const swr = 5; + inner.handle = (req) async { + return Response.bytes(utf8.encode('Success!'), 200, headers: { + 'Cache-Control': 'max-age=$ma, stale-while-revalidate=$swr', + }); + }; + final client = HttpGetCache(inner, store); + + var res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], + 'max-age=$ma, stale-while-revalidate=$swr'); + expect(inner.calls, 1); + + res = await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], + 'max-age=$ma, stale-while-revalidate=$swr'); + expect(inner.calls, 1); + + await Future.delayed(const Duration(seconds: ma)); + await client.stream(Request('GET', Uri.parse(target))).first; + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], + 'max-age=$ma, stale-while-revalidate=$swr'); + expect(inner.calls, 1); + + await Future.delayed(const Duration(seconds: swr + 1)); + await client.get(Uri.parse(target)); + + expect(res.statusCode, 200); + expect(res.headers['Cache-Control'], + 'max-age=$ma, stale-while-revalidate=$swr'); + expect(inner.calls, 2); + }); + + test('stale-if-error', () async { + final inner = TestHttpClient(); + const ma = 3; + const sie = 5; + const target = 'http://example.com/error-check'; + int count = 0; + bool error = false; + inner.handle = (req) async { + if (error) return Response('', 500); + if (req.method == 'GET') count++; + return Response.bytes(utf8.encode('count: $count'), 200, headers: { + 'Cache-Control': 'max-age=$ma, stale-if-error=$sie', + }); + }; + final client = HttpGetCache(inner, store); + final url = Uri.parse(target); + + var res = await client.get(url); + + expect(res.statusCode, 200); + expect(res.body, 'count: 1'); + + error = true; + await Future.delayed(const Duration(seconds: ma + 1)); + res = await client.get(url); + + expect(res.statusCode, 200); + expect(res.body, 'count: 1'); + + await Future.delayed(const Duration(seconds: sie + 1)); + res = await client.get(url); + + expect(res.statusCode, 500); + }); + }); +} + +class TestHttpClient extends BaseClient { + TestHttpClient(); + + int calls = 0; + + Future Function(BaseRequest request) handle = (req) async { + return Response('', 200); + }; + + @override + Future send(BaseRequest request) async { + final res = await handle(request); + if (request.method == 'GET') calls++; + return StreamedResponse( + Stream.value(res.bodyBytes), + res.statusCode, + headers: res.headers, + request: request, + isRedirect: res.isRedirect, + persistentConnection: res.persistentConnection, + reasonPhrase: res.reasonPhrase, + contentLength: res.contentLength, + ); + } +} diff --git a/experimental/http_get_cache/test/vary_header_test.dart b/experimental/http_get_cache/test/vary_header_test.dart new file mode 100644 index 0000000..15f60b9 --- /dev/null +++ b/experimental/http_get_cache/test/vary_header_test.dart @@ -0,0 +1,77 @@ +import 'dart:io'; + +import 'package:drift/native.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:http/http.dart'; +import 'package:http/testing.dart'; +import 'package:http_get_cache/http_get_cache.dart'; + +void main() { + late Directory tempDir; + late HttpGetCacheDatabase db; + late SqliteHttpCacheStore store; + + setUp(() { + tempDir = Directory.systemTemp.createTempSync('http_get_cache_test_'); + final settings = DatabaseSettings( + 'test.db', + databaseDir: tempDir.path, + cacheDir: tempDir.path, + ); + db = HttpGetCacheDatabase(settings, NativeDatabase.memory()); + store = SqliteHttpCacheStore(db); + }); + + tearDown(() { + db.close(); + if (tempDir.existsSync()) { + tempDir.deleteSync(recursive: true); + } + }); + + test('Vary header differentiates cache entries', () async { + final client = MockClient((request) async { + return Response( + 'Response for ${request.headers['User-Agent']}', + 200, + headers: { + 'cache-control': 'max-age=100', + 'vary': 'User-Agent', + }, + ); + }); + + final cache = HttpGetCache(client, store); + + // Request 1: User-Agent A + final req1 = Request('GET', Uri.parse('https://example.com/api')); + req1.headers['User-Agent'] = 'AgentA'; + final res1 = await cache.save(req1); + expect(await res1.stream.bytesToString(), 'Response for AgentA'); + + // Request 2: User-Agent B + final req2 = Request('GET', Uri.parse('https://example.com/api')); + req2.headers['User-Agent'] = 'AgentB'; + final res2 = await cache.save(req2); + expect(await res2.stream.bytesToString(), 'Response for AgentB'); + + // Verify correct cache hits + + // Using a fail-client to ensure we hit the cache + final clientFail = + MockClient((req) async => throw Exception('Network call made!')); + final cacheHit = HttpGetCache(clientFail, store); + + // Request 3: User-Agent A again -> Should get Cached A + final req3 = Request('GET', Uri.parse('https://example.com/api')); + req3.headers['User-Agent'] = 'AgentA'; + final res3 = await (cacheHit.send(req3)); + expect(await res3.stream.bytesToString(), 'Response for AgentA'); + + // Request 4: User-Agent B again -> Should get Cached B + final req4 = Request('GET', Uri.parse('https://example.com/api')); + req4.headers['User-Agent'] = 'AgentB'; + final res4 = await (cacheHit.send(req4)); + expect(await res4.stream.bytesToString(), 'Response for AgentB'); + }); +}