diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f37cb1b9c4cc4792a4ba9149b3a498162b4ddb9f..612a585f6efd5aea1edf47fe2ecc23658c390db5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,30 +7,26 @@ on:
jobs:
check-format:
- name: Check format using dart format.
- runs-on: ubuntu-latest
+ name: Check format using flutter format
+ runs-on: ubuntu-latest
+ container: cirrusci/flutter:stable
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
- - name: Flutter Action
- uses: subosito/flutter-action@v2
- - name: Check format
- run: dart format . --set-exit-if-changed
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+ - name: Check format
+ run: flutter format -n --set-exit-if-changed .
lint:
name: Lint
runs-on: ubuntu-latest
+ container: cirrusci/flutter:stable
steps:
- name: Checkout code
- uses: actions/checkout@v2
- - name: Flutter Action
- uses: subosito/flutter-action@v2
- - name: Install Package Dependencies
- run: flutter packages get
+ uses: actions/checkout@v3
- name: Get dependencies for example
run: flutter pub get
working-directory: example
- name: Lint using flutter analyze
- run: flutter analyze .
\ No newline at end of file
+ run: flutter analyze
diff --git a/.gitignore b/.gitignore
index 9edef099a7ec37acc12ae6e443c1a5e0fce73e1f..a07e487e1033b4b63e40c883f6661b28daac322f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ ios/Runner/GeneratedPluginRegistrant.*
example/macos/Flutter/
example/linux/flutter/
+*.txt
android/.gradle
.flutter-plugins
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 784cc5b7f2f5f4a36d87c7f77b9c53e7f4eb3c74..e121735a950d65e57e0eb8708b56ffc0ad9c870c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,3 @@
-## 0.8.0
-* [BREAKING_CHANGE] Updated min android version to 22 and target/compile version to 34.
-* Updated dependencies version.
-* Replaced lint with very_good_analysis package.
-* Fixed screenshot manger not creating screenshots.
-* Update pub.dev metadata.
-
## 0.7.0
* [BREAKING_CHANGE] Update to Flutter 3 by Nico Mexis (https://github.com/ThexXTURBOXx).
* [BREAKING_CHANGE] Update device_info_plus and added android_id plugin by Nico Mexis (https://github.com/ThexXTURBOXx).
diff --git a/OAT.xml b/OAT.xml
new file mode 100644
index 0000000000000000000000000000000000000000..30286af08591c42bfce0673d280154f17e726dd0
--- /dev/null
+++ b/OAT.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 78aaefa12ea7496abf78ff66d5c2348fe302d49d..f825200628be8520b9f8305f533139b25b83e1bc 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Catcher supports Android, iOS, Web, Linux, Windows and MacOS platforms.
Add this line to your **pubspec.yaml**:
```yaml
dependencies:
- catcher: ^0.8.0
+ catcher: ^0.7.0
```
Then run this command:
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 6b181fb56de818b68caaa2ae78b1e9453fdfb02f..0dfe50c2636fab1d33cbfa343f7b748a63c1725e 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,16 +1,22 @@
-include: package:very_good_analysis/analysis_options.yaml
+#include: package:lint/analysis_options_package.yaml
+
+analyzer:
+ strong-mode:
+ implicit-dynamic: false
linter:
rules:
- public_member_api_docs: false
- flutter_style_todos: false
- avoid_final_parameters: false
+ close_sinks: true
sort_constructors_first: false
- avoid_function_literals_in_foreach_calls: false
+ avoid_classes_with_only_static_members: false
+ avoid_void_async: false
avoid_positional_boolean_parameters: false
- use_if_null_to_convert_nulls_to_bools: false
- use_build_context_synchronously: false
+ avoid_function_literals_in_foreach_calls: false
prefer_constructors_over_static_methods: false
- use_setters_to_change_properties: false
- avoid_print: false
- sort_pub_dependencies: false
\ No newline at end of file
+ sort_unnamed_constructors_first: false
+ sized_box_for_whitespace: false
+ invalid_dependency: false
+ sort_pub_dependencies: false
+ import_of_legacy_library_into_null_safe: false
+ use_build_context_synchronously: false
+ use_setters_to_change_properties: false
\ No newline at end of file
diff --git a/android/build.gradle b/android/build.gradle
index dbe1723778580cd0f43f38251424eaac5852c749..18fb25096bb2f1a51282c574e40b53e38e401714 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -25,13 +25,13 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
- compileSdkVersion 34
+ compileSdkVersion 33
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
- minSdkVersion 22
+ minSdkVersion 16
}
}
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index eb9ac7452d6da4fc1bf08e380ed4ce09b8426b31..db00efd0960ec568c1a5dde9bdbaaa33b6293d20 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -26,22 +26,25 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 34
+ compileSdkVersion 33
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.jhomlala.catcher_example"
- minSdkVersion 22
- targetSdkVersion 34
+ minSdkVersion 16
+ targetSdkVersion 33
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
}
}
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index ad4983e709d8a8ed139fa64128fad448932e8764..e615d99deddadf8a2aaf380004e1cf8f7be00b3a 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -30,13 +30,4 @@
android:name="flutterEmbedding"
android:value="2" />
-
-
-
-
-
-
-
-
-
diff --git a/example/android/build.gradle b/example/android/build.gradle
index 977a71b1b023b9abaede7330565f81598391e127..20411f5f31a99755c8b9b215e6150266225c6955 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
-tasks.register("clean", Delete) {
+task clean(type: Delete) {
delete rootProject.buildDir
}
diff --git a/example/lib/basic_example.dart b/example/lib/basic_example.dart
index eb90786f7bacb147cd01a9c3fefe6b63b22ead22..d5b4a157ddbc76b12fa9e047e4872f64ab0b3951 100644
--- a/example/lib/basic_example.dart
+++ b/example/lib/basic_example.dart
@@ -2,29 +2,24 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(DialogReportMode(), [
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
ConsoleHandler(),
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@e mail.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- runAppFunction: () {
- runApp(const MyApp());
- },
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ runAppFunction: () {
+ runApp(MyApp());
+ },
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -38,27 +33,26 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/change_custom_parameters_example.dart b/example/lib/change_custom_parameters_example.dart
index d25e2ac2e4f32f564628af12209769d33f769369..48c33a6a3b90488ba1f6b444db86027ae2c0c229 100644
--- a/example/lib/change_custom_parameters_example.dart
+++ b/example/lib/change_custom_parameters_example.dart
@@ -4,33 +4,28 @@ import 'package:flutter/material.dart';
late Catcher catcher;
void main() {
- final customParameters = {};
- customParameters['First'] = 'First parameter';
- final debugOptions = CatcherOptions(
- PageReportMode(),
- [
- ConsoleHandler(enableCustomParameters: true),
- ],
- customParameters: customParameters,
- );
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ Map customParameters = new Map();
+ customParameters["First"] = "First parameter";
+ CatcherOptions debugOptions = CatcherOptions(
+ PageReportMode(),
+ [
+ ConsoleHandler(enableCustomParameters: true),
+ ],
+ customParameters: customParameters);
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
catcher = Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -44,40 +39,33 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return Column(
- children: [
- ElevatedButton(
- onPressed: _changeCustomParameters,
- child: const Text('Change custom parameters'),
- ),
- ElevatedButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- ),
- ],
- );
+ return Container(
+ child: Column(children: [
+ ElevatedButton(
+ child: Text("Change custom parameters"),
+ onPressed: _changeCustomParameters),
+ ElevatedButton(
+ child: Text("Generate error"), onPressed: () => generateError())
+ ]));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
void _changeCustomParameters() {
- final options = catcher.getCurrentConfig()!;
- options.customParameters['Second'] = 'Second parameter';
+ CatcherOptions options = catcher.getCurrentConfig()!;
+ options.customParameters["Second"] = "Second parameter";
}
}
diff --git a/example/lib/crashlytics_example.dart b/example/lib/crashlytics_example.dart
index 85a72e73140001c02dad8b6e3265975ff23325b9..9b73a3257f6db62466b19a9179568edb3668eaa4 100644
--- a/example/lib/crashlytics_example.dart
+++ b/example/lib/crashlytics_example.dart
@@ -31,7 +31,7 @@ class CrashlyticsHandler extends ReportHandler {
assert(printLogs != null, "printLogs can't be null");
@override
List getSupportedPlatforms() {
- return [PlatformType.android, PlatformType.iOS];
+ return [PlatformType.android, PlatformType.iOS, PlatformType.ohos];
}
@@ -44,11 +44,9 @@ class CrashlyticsHandler extends ReportHandler {
crashlytics.log(_getLogMessage(report));
if (report.errorDetails != null) {
// ignore: cast_nullable_to_non_nullable
- await crashlytics.recordFlutterError(report.errorDetails as
- FlutterErrorDetails);
+ await crashlytics.recordFlutterError(report.errorDetails as FlutterErrorDetails);
} else {
- await crashlytics.recordError(report.error, report.stackTrace as
- StackTrace);
+ await crashlytics.recordError(report.error, report.stackTrace as StackTrace);
}
_printLog("Crashlytics report sent");
return true;
diff --git a/example/lib/cupertino_example.dart b/example/lib/cupertino_example.dart
index c9e71c023adf1467bb9c77c72bd162c67ede789e..68e680ae2d6538b7f2e45138e203e746b7504bd9 100644
--- a/example/lib/cupertino_example.dart
+++ b/example/lib/cupertino_example.dart
@@ -3,33 +3,26 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(DialogReportMode(), [
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
//EmailManualHandler(["recipient@email.com"]),
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://jsonplaceholder.typicode.com/posts'),
- printLogs: true,
- ),
- ConsoleHandler(),
+ HttpHandler(HttpRequestType.post,
+ Uri.parse("https://jsonplaceholder.typicode.com/posts"),
+ printLogs: true),
+ ConsoleHandler()
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ rootWidget: MyApp(),
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -42,9 +35,9 @@ class _MyAppState extends State {
Widget build(BuildContext context) {
return CupertinoApp(
navigatorKey: Catcher.navigatorKey,
- home: const CupertinoPageScaffold(
+ home: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
- middle: Text('Cupertino example'),
+ middle: const Text('Cupertino example'),
),
child: SafeArea(
child: ChildWidget(),
@@ -55,20 +48,18 @@ class _MyAppState extends State {
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return ColoredBox(
+ return Container(
color: Colors.orange,
child: TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/custom_logger_example.dart b/example/lib/custom_logger_example.dart
index 051b985e4a2bf4a283886afcf49b2d58642bde79..d4f8d25a3f4a4a38af13ec437adb189fd7b66d17 100644
--- a/example/lib/custom_logger_example.dart
+++ b/example/lib/custom_logger_example.dart
@@ -2,33 +2,28 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(
+ CatcherOptions debugOptions = CatcherOptions(
DialogReportMode(),
[
ConsoleHandler(),
],
logger: CustomCatcherLogger(),
);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- runAppFunction: () {
- runApp(const MyApp());
- },
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ runAppFunction: () {
+ runApp(MyApp());
+ },
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -42,49 +37,44 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
class CustomCatcherLogger extends CatcherLogger {
- @override
void info(String message) {
- print('Custom Catcher Logger | Info | $message');
+ print("Custom Catcher Logger | Info | $message");
}
- @override
void fine(String message) {
- print('Custom Catcher Logger | Fine | $message');
+ print("Custom Catcher Logger | Fine | $message");
}
- @override
void warning(String message) {
- print('Custom Catcher Logger | Warning | $message');
+ print("Custom Catcher Logger | Warning | $message");
}
- @override
void severe(String message) {
- print('Custom Catcher Logger | Servere | $message');
+ print("Custom Catcher Logger | Servere | $message");
}
}
diff --git a/example/lib/custom_navigator_key_example.dart b/example/lib/custom_navigator_key_example.dart
index 99e877901a49ade9aa058f4f4338b1ddd45b897e..3cdd81b6da4047b4ba991086c21448f458b4f89c 100644
--- a/example/lib/custom_navigator_key_example.dart
+++ b/example/lib/custom_navigator_key_example.dart
@@ -2,15 +2,15 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(DialogReportMode(), [
- EmailManualHandler(['recipient@email.com']),
- ConsoleHandler(),
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
+ EmailManualHandler(["recipient@email.com"]),
+ ConsoleHandler()
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
- final navigatorKey = GlobalKey();
+ GlobalKey navigatorKey = new GlobalKey();
Catcher(
rootWidget: MyApp(navigatorKey),
debugConfig: debugOptions,
@@ -22,12 +22,10 @@ void main() {
class MyApp extends StatefulWidget {
final GlobalKey navigatorKey;
- const MyApp(this.navigatorKey, {Key? key}) : super(key: key);
+ const MyApp(this.navigatorKey);
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -41,27 +39,23 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: widget.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/custom_report_mode_example.dart b/example/lib/custom_report_mode_example.dart
index 5d36ab30a0e15940495c20f071484b7b9524f8d6..29286e5c1adc436065ef19f56921aa9734a2f7d8 100644
--- a/example/lib/custom_report_mode_example.dart
+++ b/example/lib/custom_report_mode_example.dart
@@ -3,28 +3,24 @@ import 'package:catcher/model/platform_type.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(CustomPageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
- ConsoleHandler(),
+ CatcherOptions debugOptions = CatcherOptions(CustomPageReportMode(), [
+ EmailManualHandler(["recipient@email.com"]),
+ ConsoleHandler()
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -38,27 +34,26 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
@@ -71,12 +66,9 @@ class CustomPageReportMode extends ReportMode {
}
}
- Future _navigateToPageWidget(
- Report report,
- BuildContext context,
- ) async {
+ void _navigateToPageWidget(Report report, BuildContext context) async {
await Future.delayed(Duration.zero);
- await Navigator.push(
+ Navigator.push(
context,
MaterialPageRoute(builder: (context) => CustomPage(this, report)),
);
@@ -89,38 +81,37 @@ class CustomPageReportMode extends ReportMode {
@override
List getSupportedPlatforms() =>
- [PlatformType.web, PlatformType.android, PlatformType.iOS];
+ [PlatformType.web, PlatformType.android, PlatformType.iOS, PlatformType.ohos];
}
class CustomPage extends StatelessWidget {
final ReportMode reportMode;
final Report report;
- const CustomPage(this.reportMode, this.report, {Key? key}) : super(key: key);
+ CustomPage(this.reportMode, this.report);
@override
Widget build(BuildContext context) {
return Scaffold(
- appBar: AppBar(
- title: const Text('Test'),
- ),
- body: Row(
- children: [
- ElevatedButton(
- child: const Text('Send report'),
- onPressed: () {
- reportMode.onActionConfirmed(report);
- },
- ),
- ElevatedButton(
- child: const Text('Cancel report'),
- onPressed: () {
- reportMode.onActionRejected(report);
- Navigator.pop(context);
- },
- ),
- ],
- ),
- );
+ appBar: AppBar(
+ title: Text("Test"),
+ ),
+ body: Container(
+ child: Row(children: [
+ ElevatedButton(
+ child: Text("Send report"),
+ onPressed: () {
+ reportMode.onActionConfirmed(report);
+ },
+ ),
+ ElevatedButton(
+ child: Text("Cancel report"),
+ onPressed: () {
+ reportMode.onActionRejected(report);
+ Navigator.pop(context);
+ },
+ )
+ ]),
+ ));
}
}
diff --git a/example/lib/discord_handler_example.dart b/example/lib/discord_handler_example.dart
index b9da1d0f55ea67e2ccbec6adeea9d7d8e6c3ed92..4bb452f37d517f720fc138ce4031c9cb471e9cba 100644
--- a/example/lib/discord_handler_example.dart
+++ b/example/lib/discord_handler_example.dart
@@ -2,34 +2,28 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(SilentReportMode(), [
- DiscordHandler(
- '',
- enableDeviceParameters: true,
- enableApplicationParameters: true,
- enableCustomParameters: true,
- enableStackTrace: true,
- printLogs: true,
- ),
+ CatcherOptions debugOptions = CatcherOptions(SilentReportMode(), [
+ DiscordHandler("",
+ enableDeviceParameters: true,
+ enableApplicationParameters: true,
+ enableCustomParameters: true,
+ enableStackTrace: true,
+ printLogs: true),
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -43,27 +37,23 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/email_manual_handler_example.dart b/example/lib/email_manual_handler_example.dart
index 03d5f929cefcc4fbfb67876fdb2730ed4265602d..f13c4e0b99ae65b02227f4b73b964614ee6354c2 100644
--- a/example/lib/email_manual_handler_example.dart
+++ b/example/lib/email_manual_handler_example.dart
@@ -2,35 +2,30 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(
- DialogReportMode(),
- [
- EmailManualHandler(
- ['email1@email.com', 'email2@email.com'],
- emailTitle: 'Sample Title',
- emailHeader: 'Sample Header',
- printLogs: true,
- ),
- ],
- customParameters: {
- 'Test': 'Test12345',
- 'Test2': 'Test54321',
- },
- );
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
+ EmailManualHandler(["email1@email.com", "email2@email.com"],
+ enableDeviceParameters: true,
+ enableStackTrace: true,
+ enableCustomParameters: true,
+ enableApplicationParameters: true,
+ sendHtml: true,
+ emailTitle: "Sample Title",
+ emailHeader: "Sample Header",
+ printLogs: true)
+ ], customParameters: {
+ "Test": "Test12345",
+ "Test2": "Test54321"
+ });
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -44,27 +39,26 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
- throw Exception('Test exception');
+ void generateError() async {
+ throw "Test exception";
}
}
diff --git a/example/lib/error_widget_example.dart b/example/lib/error_widget_example.dart
index 4e53a1d6cb771adc39dbddf38a578741bcb0af77..57ced73b5ec4e7df9836ee2fbe1d2b50c1d8ad56 100644
--- a/example/lib/error_widget_example.dart
+++ b/example/lib/error_widget_example.dart
@@ -2,27 +2,23 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(SilentReportMode(), [
+ CatcherOptions debugOptions = CatcherOptions(SilentReportMode(), [
ConsoleHandler(),
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -37,9 +33,10 @@ class _MyAppState extends State {
navigatorKey: Catcher.navigatorKey,
builder: (BuildContext context, Widget? widget) {
Catcher.addDefaultErrorWidget(
- title: 'Custom title',
- description: 'Custom description',
- );
+ showStacktrace: true,
+ title: "Custom title",
+ description: "Custom description",
+ maxWidthForSmallMode: 150);
return widget!;
},
home: Scaffold(
@@ -58,26 +55,23 @@ class _MyAppState extends State {
///Trigger "small" mode
Widget _buildSmallErrorWidget() {
- return GridView.count(
- crossAxisCount: 3,
- children: const [
- ChildWidget(),
- ChildWidget(),
- ChildWidget(),
- ],
- );
+ return GridView.count(crossAxisCount: 3, children: [
+ ChildWidget(),
+ ChildWidget(),
+ ChildWidget(),
+ ]);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(onPressed: generateError, child: const Text('Test'));
+ return Container(
+ child: TextButton(child: Text("Test"), onPressed: generateError),
+ );
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/excluded_parameters_example.dart b/example/lib/excluded_parameters_example.dart
index 32dfee77a29a6576a2f538e023f2b39e805a182c..c3843cfee8458fbd2e0dbb6bdc972216b87866d8 100644
--- a/example/lib/excluded_parameters_example.dart
+++ b/example/lib/excluded_parameters_example.dart
@@ -2,42 +2,35 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(
+ CatcherOptions debugOptions = CatcherOptions(
DialogReportMode(),
[
//EmailManualHandler(["recipient@email.com"]),
ToastHandler(),
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://jsonplaceholder.typicode.com/posts'),
- printLogs: true,
- ),
- ConsoleHandler(),
+ HttpHandler(HttpRequestType.post,
+ Uri.parse("https://jsonplaceholder.typicode.com/posts"),
+ printLogs: true),
+ ConsoleHandler()
],
//Exclude these parameters from report. These params are device info params.
- excludedParameters: ['androidId', 'model'],
+ excludedParameters: ["androidId", "model"],
);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- runAppFunction: () {
- runApp(const MyApp());
- },
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ runAppFunction: () {
+ runApp(MyApp());
+ },
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -51,27 +44,26 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/explicit_error_report_handler_map_example.dart b/example/lib/explicit_error_report_handler_map_example.dart
index d6aa3ab4541f153c681909f08bfec1f55d12a3f9..c387a909bfa5382e326ab33f3f1885f50724ac87 100644
--- a/example/lib/explicit_error_report_handler_map_example.dart
+++ b/example/lib/explicit_error_report_handler_map_example.dart
@@ -2,37 +2,29 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final explicitMap = {'FormatException': ConsoleHandler()};
- final debugOptions = CatcherOptions(
- DialogReportMode(),
- [
- ConsoleHandler(),
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://httpstat.us/200'),
- printLogs: true,
- ),
- ],
- explicitExceptionHandlersMap: explicitMap,
- );
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ var explicitMap = {"FormatException": ConsoleHandler()};
+ CatcherOptions debugOptions = CatcherOptions(
+ DialogReportMode(),
+ [
+ ConsoleHandler(),
+ HttpHandler(HttpRequestType.post, Uri.parse("https://httpstat.us/200"),
+ printLogs: true)
+ ],
+ explicitExceptionHandlersMap: explicitMap);
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -46,27 +38,26 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
- throw const FormatException('Example Error');
+ void generateError() async {
+ throw new FormatException("Example Error");
}
}
diff --git a/example/lib/explicit_error_report_mode_map_example.dart b/example/lib/explicit_error_report_mode_map_example.dart
index 3a93dfd994eb1eb55f4c590fb3eb415fcebd56ca..9507da87e32677332c4d8408f93ee433dfe482f7 100644
--- a/example/lib/explicit_error_report_mode_map_example.dart
+++ b/example/lib/explicit_error_report_mode_map_example.dart
@@ -2,37 +2,30 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final explicitReportModesMap = {'FormatException': PageReportMode()};
- final debugOptions = CatcherOptions(
+ var explicitReportModesMap = {"FormatException": PageReportMode()};
+ CatcherOptions debugOptions = CatcherOptions(
DialogReportMode(),
[
ConsoleHandler(),
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://httpstat.us/200'),
- printLogs: true,
- ),
+ HttpHandler(HttpRequestType.post, Uri.parse("https://httpstat.us/200"),
+ printLogs: true)
],
explicitExceptionReportModesMap: explicitReportModesMap,
);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -46,39 +39,35 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return Column(
- children: [
+ return Container(
+ child: Column(children: [
TextButton(
- onPressed: generateFirstError,
- child: const Text('Generate first error'),
- ),
+ child: Text("Generate first error"),
+ onPressed: () => generateFirstError()),
TextButton(
- onPressed: generateSecondError,
- child: const Text('Generate second error'),
- ),
- ],
+ child: Text("Generate second error"),
+ onPressed: () => generateSecondError(),
+ )
+ ]),
);
}
- Future generateFirstError() async {
- throw const FormatException('Example Error');
+ void generateFirstError() async {
+ throw new FormatException("Example Error");
}
- Future generateSecondError() async {
- throw ArgumentError('Normal error');
+ void generateSecondError() async {
+ throw new ArgumentError("Normal error");
}
}
diff --git a/example/lib/file_example.dart b/example/lib/file_example.dart
index 88223268376d8c21c64276e2df16c1a56a8d71dc..3354e2249d260e93b9acd66ce8a5eca079041458 100644
--- a/example/lib/file_example.dart
+++ b/example/lib/file_example.dart
@@ -6,7 +6,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
void main() async {
- final catcher = Catcher(rootWidget: const MyApp(), ensureInitialized: true);
+ var catcher = Catcher(rootWidget: MyApp(), ensureInitialized: true);
Directory? externalDir;
if (Platform.isAndroid || Platform.isIOS) {
externalDir = await getExternalStorageDirectory();
@@ -14,30 +14,23 @@ void main() async {
if (Platform.isMacOS) {
externalDir = await getApplicationDocumentsDirectory();
}
- var path = '';
+ String path = "";
if (externalDir != null) {
- path = '${externalDir.path}/log.txt';
+ path = externalDir.path.toString() + "/log.txt";
}
+ print("PATH: " + path);
- final debugOptions = CatcherOptions(
- DialogReportMode(),
- [FileHandler(File(path), printLogs: true)],
- );
- final releaseOptions =
+ CatcherOptions debugOptions = CatcherOptions(
+ DialogReportMode(), [FileHandler(File(path), printLogs: true)]);
+ CatcherOptions releaseOptions =
CatcherOptions(DialogReportMode(), [FileHandler(File(path))]);
catcher.updateConfig(
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ debugConfig: debugOptions, releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -51,43 +44,42 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return Column(
- children: [
- TextButton(
- onPressed: checkPermissions,
- child: const Text('Check permission'),
- ),
- TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- ),
- ],
+ return Container(
+ child: Column(
+ children: [
+ TextButton(
+ child: Text("Check permission"),
+ onPressed: checkPermissions,
+ ),
+ TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ )
+ ],
+ ),
);
}
- Future checkPermissions() async {
- final status = await Permission.storage.status;
- print('Status: $status');
+ void checkPermissions() async {
+ var status = await Permission.storage.status;
+ print("Status: $status");
if (!status.isGranted) {
- print('Requested');
+ print("Requested");
}
}
- Future generateError() async {
- throw Exception('Test exception');
+ void generateError() async {
+ throw "Test exception";
}
}
diff --git a/example/lib/filter_example.dart b/example/lib/filter_example.dart
index 8a137323a38086aa7fe3f0b95585b7a821e0d590..c9e51f6055483b2579c60c35ae13daab5749170f 100644
--- a/example/lib/filter_example.dart
+++ b/example/lib/filter_example.dart
@@ -2,27 +2,23 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(
- DialogReportMode(),
- [
- ConsoleHandler(),
- ToastHandler(),
- ],
- filterFunction: (Report report) {
- if (report.error is ArgumentError) {
- return false;
- } else {
- return true;
- }
- },
- );
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
+ ConsoleHandler(),
+ ToastHandler(),
+ ], filterFunction: (Report report) {
+ if (report.error is ArgumentError) {
+ return false;
+ } else {
+ return true;
+ }
+ });
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
runAppFunction: () {
- runApp(const MyApp());
+ runApp(MyApp());
},
debugConfig: debugOptions,
releaseConfig: releaseOptions,
@@ -30,12 +26,8 @@ void main() {
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -55,12 +47,12 @@ class _MyAppState extends State {
body: Column(
children: [
TextButton(
- onPressed: generateNormalError,
- child: const Text('Generate normal error'),
+ child: Text("Generate normal error"),
+ onPressed: () => generateNormalError(),
),
TextButton(
- onPressed: generateFilteredError,
- child: const Text('Generate filtered error'),
+ child: Text("Generate filtered error"),
+ onPressed: () => generateFilteredError(),
),
],
),
@@ -68,11 +60,11 @@ class _MyAppState extends State {
);
}
- Future generateNormalError() async {
- throw StateError('Example error');
+ void generateNormalError() async {
+ throw StateError("Example error");
}
- Future generateFilteredError() async {
- throw ArgumentError('Example error');
+ void generateFilteredError() async {
+ throw ArgumentError("Example error");
}
}
diff --git a/example/lib/http_handler_update_headers_example.dart b/example/lib/http_handler_update_headers_example.dart
index e0c7e4f03d7fa3a73166e64a2d3b770738dc6d3c..e53ce124f73e7dd27e7c0428ca3a37269e573f11 100644
--- a/example/lib/http_handler_update_headers_example.dart
+++ b/example/lib/http_handler_update_headers_example.dart
@@ -3,24 +3,25 @@ import 'package:flutter/material.dart';
void main() {
///Http handler instance
- final httpHandler = HttpHandler(
+ var httpHandler = HttpHandler(
HttpRequestType.post,
- Uri.parse('https://jsonplaceholder.typicode.com/posts'),
+ Uri.parse("https://jsonplaceholder.typicode.com/posts"),
printLogs: true,
+ enableCustomParameters: false,
enableStackTrace: false,
enableApplicationParameters: false,
enableDeviceParameters: false,
);
///Init catcher
- final debugOptions =
+ CatcherOptions debugOptions =
CatcherOptions(DialogReportMode(), [httpHandler, ConsoleHandler()]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
@@ -28,16 +29,12 @@ void main() {
///At some point of time, you're updating headers:
httpHandler.headers.clear();
- httpHandler.headers['my_header'] = 'Test';
+ httpHandler.headers["my_header"] = "Test";
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -51,27 +48,23 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/local_notification_example.dart b/example/lib/local_notification_example.dart
index ba816ce950f8b630e2a111531fcf6436c173e84c..c8b17a655eb0b638a3201ad6b3fcc03c19a07e95 100644
--- a/example/lib/local_notification_example.dart
+++ b/example/lib/local_notification_example.dart
@@ -4,28 +4,24 @@ import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
void main() {
- final debugOptions = CatcherOptions(NotificationReportMode(), [
- EmailManualHandler(['recipient@email.com']),
- ConsoleHandler(),
+ CatcherOptions debugOptions = CatcherOptions(NotificationReportMode(), [
+ EmailManualHandler(["recipient@email.com"]),
+ ConsoleHandler()
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -42,24 +38,21 @@ class _MyAppState extends State {
appBar: AppBar(
title: const Text('Plugin example app'),
),
- body: const ChildWidget(),
+ body: ChildWidget(),
),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
@@ -73,15 +66,14 @@ class NotificationReportMode extends ReportMode {
final String channelDescription;
final String icon;
- NotificationReportMode({
- this.channelId = 'Catcher',
- this.channelName = 'Catcher',
- this.channelDescription = 'Catcher default channel',
- this.icon = '@mipmap/ic_launcher',
- });
+ NotificationReportMode(
+ {this.channelId = "Catcher",
+ this.channelName = "Catcher",
+ this.channelDescription = "Catcher default channel",
+ this.icon = "@mipmap/ic_launcher"});
@override
- void setReportModeAction(ReportModeAction reportModeAction) {
+ setReportModeAction(ReportModeAction reportModeAction) {
_initializeNotificationsPlugin();
return super.setReportModeAction(reportModeAction);
}
@@ -91,18 +83,15 @@ class NotificationReportMode extends ReportMode {
/// mode, only notification report mode from second catcher options will be
/// initialized correctly. That's why init is delayed.
void _initializeNotificationsPlugin() {
- _flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
- final initializationSettingsAndroid = AndroidInitializationSettings(icon);
- const initializationSettingsIOS = DarwinInitializationSettings();
- final initializationSettings = InitializationSettings(
+ _flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
+ var initializationSettingsAndroid = new AndroidInitializationSettings(icon);
+ var initializationSettingsIOS = new IOSInitializationSettings();
+ var initializationSettings = new InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
);
-
- _flutterLocalNotificationsPlugin.initialize(
- initializationSettings,
- onDidReceiveNotificationResponse: onSelectedNotification,
- );
+ _flutterLocalNotificationsPlugin.initialize(initializationSettings,
+ onSelectNotification: onSelectedNotification);
}
@override
@@ -111,33 +100,31 @@ class NotificationReportMode extends ReportMode {
_sendNotification();
}
- Future onSelectedNotification(NotificationResponse response) {
+ Future onSelectedNotification(String? payload) {
onActionConfirmed(_lastReport);
return Future.value(0);
}
- Future _sendNotification() async {
- final androidPlatformChannelSpecifics = AndroidNotificationDetails(
- channelId,
- channelName,
- channelDescription: channelDescription,
- );
- const iOSPlatformChannelSpecifics = DarwinNotificationDetails();
- final platformChannelSpecifics = NotificationDetails(
- android: androidPlatformChannelSpecifics,
- iOS: iOSPlatformChannelSpecifics,
- );
+ void _sendNotification() async {
+ var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
+ channelId, channelName,
+ channelDescription: channelDescription,
+ importance: Importance.defaultImportance,
+ priority: Priority.defaultPriority);
+ var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
+ var platformChannelSpecifics = new NotificationDetails(
+ android: androidPlatformChannelSpecifics,
+ iOS: iOSPlatformChannelSpecifics);
await _flutterLocalNotificationsPlugin.show(
- 0,
- localizationOptions.notificationReportModeTitle,
- localizationOptions.notificationReportModeContent,
- platformChannelSpecifics,
- payload: '',
- );
+ 0,
+ localizationOptions.notificationReportModeTitle,
+ localizationOptions.notificationReportModeContent,
+ platformChannelSpecifics,
+ payload: "");
}
@override
List getSupportedPlatforms() =>
- [PlatformType.android, PlatformType.iOS];
+ [PlatformType.android, PlatformType.iOS, PlatformType.ohos];
}
diff --git a/example/lib/localization_example.dart b/example/lib/localization_example.dart
index 0e4951ba65fc6b94c67bf841b853fd3c9245a87e..cd41e24c6dbcc662e5b80a809d58c21ba5d9c6f0 100644
--- a/example/lib/localization_example.dart
+++ b/example/lib/localization_example.dart
@@ -3,64 +3,46 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
void main() {
- final debugOptions = CatcherOptions(
- DialogReportMode(),
- [
- ConsoleHandler(),
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://httpstat.us/200'),
- printLogs: true,
- ),
- ],
- localizationOptions: [
- LocalizationOptions(
- 'en',
- dialogReportModeTitle: 'Custom message',
- dialogReportModeDescription: 'Custom message',
- dialogReportModeAccept: 'YES',
- dialogReportModeCancel: 'NO',
- ),
- LocalizationOptions(
- 'pl',
- notificationReportModeTitle: 'Wystąpił błąd aplikacji',
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
+ ConsoleHandler(),
+ HttpHandler(HttpRequestType.post, Uri.parse("https://httpstat.us/200"),
+ printLogs: true)
+ ], localizationOptions: [
+ LocalizationOptions(
+ "en",
+ dialogReportModeTitle: "Custom message",
+ dialogReportModeDescription: "Custom message",
+ dialogReportModeAccept: "YES",
+ dialogReportModeCancel: "NO",
+ ),
+ LocalizationOptions("pl",
+ notificationReportModeTitle: "Wystąpił błąd aplikacji",
notificationReportModeContent:
- 'Naciśnij tutaj aby wysłać report do zespołu wpsarcia',
- dialogReportModeTitle: 'Błąd appliance',
+ "Naciśnij tutaj aby wysłać raport do zespołu wpsarcia",
+ dialogReportModeTitle: "Błąd aplikacji",
dialogReportModeDescription:
- 'Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest '
- 'gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj '
- 'aby wysłać raport lub odrzuć aby odrzucić raport.',
- dialogReportModeAccept: 'Akceptuj',
- dialogReportModeCancel: 'Odrzuć',
- pageReportModeTitle: 'Błąd aplikacji',
+ "Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj aby wysłać raport lub odrzuć aby odrzucić raport.",
+ dialogReportModeAccept: "Akceptuj",
+ dialogReportModeCancel: "Odrzuć",
+ pageReportModeTitle: "Błąd aplikacji",
pageReportModeDescription:
- 'Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest '
- 'gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj aby'
- ' wysłać raport lub odrzuć aby odrzucić raport.',
- pageReportModeAccept: 'Akceptuj',
- pageReportModeCancel: 'Odrzuć',
- ),
- ],
- );
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ "Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj aby wysłać raport lub odrzuć aby odrzucić raport.",
+ pageReportModeAccept: "Akceptuj",
+ pageReportModeCancel: "Odrzuć")
+ ]);
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ rootWidget: MyApp(),
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -73,36 +55,32 @@ class _MyAppState extends State {
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
- localizationsDelegates: const [
+ localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
- supportedLocales: const [
- Locale('en', 'US'),
- Locale('pl', 'PL'),
+ supportedLocales: [
+ const Locale('en', 'US'),
+ const Locale('pl', 'PL'),
],
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
- throw Exception('Test exception');
+ void generateError() async {
+ throw "Test exception";
}
}
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 04cf1d89e47a78053cf3ba320af103f173a796c1..50743f3614bca9b1912f6620b7bfe2f2104589db 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -4,31 +4,29 @@ import 'package:sentry/sentry.dart';
void main() {
///Configure your debug options (settings used in development mode)
- final debugOptions = CatcherOptions(
+ CatcherOptions debugOptions = CatcherOptions(
///Show information about caught error in dialog
DialogReportMode(),
[
///Send logs to HTTP server
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://jsonplaceholder.typicode.com/posts'),
- printLogs: true,
- ),
+ HttpHandler(HttpRequestType.post,
+ Uri.parse("https://jsonplaceholder.typicode.com/posts"),
+ printLogs: true),
///Print logs in console
- ConsoleHandler(),
+ ConsoleHandler()
],
);
///Configure your production options (settings used in release mode)
- final releaseOptions = CatcherOptions(
+ CatcherOptions releaseOptions = CatcherOptions(
///Show new page with information about caught error
PageReportMode(),
[
///Send logs to Sentry
SentryHandler(
SentryClient(
- SentryOptions(dsn: ''),
+ SentryOptions(dsn: ""),
),
),
@@ -41,7 +39,7 @@ void main() {
///error to your configured services!
Catcher(
runAppFunction: () {
- runApp(const MyApp());
+ runApp(MyApp());
},
debugConfig: debugOptions,
releaseConfig: releaseOptions,
@@ -49,12 +47,8 @@ void main() {
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -71,27 +65,27 @@ class _MyAppState extends State {
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
appBar: AppBar(
- title: const Text('Catcher example'),
+ title: const Text("Catcher example"),
),
- body: const ChildWidget(),
+ body: ChildWidget(),
),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
///Simply just trigger some error.
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/occurences_timeout_example.dart b/example/lib/occurences_timeout_example.dart
index 57ab837a2d60cef8f08e09af53c8d97dd1bae005..7471f7931d8e894740f26cadec94809510a5223e 100644
--- a/example/lib/occurences_timeout_example.dart
+++ b/example/lib/occurences_timeout_example.dart
@@ -2,34 +2,28 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(
- SilentReportMode(),
- [
- ConsoleHandler(),
- ToastHandler(),
- ],
- reportOccurrenceTimeout: 30000,
- );
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions debugOptions = CatcherOptions(
+ SilentReportMode(),
+ [
+ ConsoleHandler(),
+ ToastHandler(),
+ ],
+ reportOccurrenceTimeout: 30000);
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- runAppFunction: () {
- runApp(const MyApp());
- },
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ runAppFunction: () {
+ runApp(MyApp());
+ },
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -43,27 +37,26 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/report_modes_example.dart b/example/lib/report_modes_example.dart
index 5a33a89b511d7612d47d7dac38dd1eab02c7ddeb..6bcab1ce88a51809feb9ac610617c66b1ed7a0fb 100644
--- a/example/lib/report_modes_example.dart
+++ b/example/lib/report_modes_example.dart
@@ -16,20 +16,16 @@ void main() {
cancelText: "Back");*/
//page:
- final ReportMode reportMode = PageReportMode(showStackTrace: false);
+ ReportMode reportMode = PageReportMode(showStackTrace: false);
- final debugOptions = CatcherOptions(reportMode, [ConsoleHandler()]);
+ CatcherOptions debugOptions = CatcherOptions(reportMode, [ConsoleHandler()]);
- Catcher(rootWidget: const MyApp(), debugConfig: debugOptions);
+ Catcher(rootWidget: MyApp(), debugConfig: debugOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -43,27 +39,23 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
- Catcher.sendTestException();
+ void generateError() async {
+ throw "Test exception";
}
}
diff --git a/example/lib/screenshot_example.dart b/example/lib/screenshot_example.dart
index 7a0e958cdd569dd3e5d25217ddb215b90f5f9482..56c83f22b997c29295a8d03c42894805b9f1e9be 100644
--- a/example/lib/screenshot_example.dart
+++ b/example/lib/screenshot_example.dart
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
void main() async {
- final catcher = Catcher(rootWidget: const MyApp(), ensureInitialized: true);
+ var catcher = Catcher(rootWidget: MyApp(), ensureInitialized: true);
Directory? externalDir;
if (Platform.isAndroid) {
externalDir = await getExternalStorageDirectory();
@@ -13,24 +13,27 @@ void main() async {
if (Platform.isIOS || Platform.isMacOS) {
externalDir = await getApplicationDocumentsDirectory();
}
- var path = '';
+ String path = "";
if (externalDir != null) {
- path = externalDir.path;
+ path = externalDir.path.toString();
}
- final debugOptions = CatcherOptions(
+ CatcherOptions debugOptions = CatcherOptions(
DialogReportMode(),
[
- EmailManualHandler(
- ['email1@email.com', 'email2@email.com'],
- emailTitle: 'Sample Title',
- emailHeader: 'Sample Header',
- printLogs: true,
- ),
+ EmailManualHandler(["email1@email.com", "email2@email.com"],
+ enableDeviceParameters: true,
+ enableStackTrace: true,
+ enableCustomParameters: true,
+ enableApplicationParameters: true,
+ sendHtml: true,
+ emailTitle: "Sample Title",
+ emailHeader: "Sample Header",
+ printLogs: true)
],
customParameters: {
- 'Test': 'Test12345',
- 'Test2': 'Test54321',
+ "Test": "Test12345",
+ "Test2": "Test54321"
},
screenshotsPath: path,
);
@@ -39,12 +42,8 @@ void main() async {
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -57,13 +56,13 @@ class _MyAppState extends State {
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
- home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: CatcherScreenshot(
- catcher: Catcher.getInstance(),
- child: const ChildWidget(),
+ home: CatcherScreenshot(
+ catcher: Catcher.getInstance(),
+ child: Scaffold(
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget(),
),
),
);
@@ -71,17 +70,17 @@ class _MyAppState extends State {
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/sentry_example.dart b/example/lib/sentry_example.dart
index b2b813dffd71cf7a90e6fbc87e8216efe8128684..b514948cfa4dc1c031db7053c8ae0e1cddd3833e 100644
--- a/example/lib/sentry_example.dart
+++ b/example/lib/sentry_example.dart
@@ -3,29 +3,26 @@ import 'package:flutter/material.dart';
import 'package:sentry/sentry.dart';
void main() {
- final debugOptions = CatcherOptions(DialogReportMode(), [
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
SentryHandler(
SentryClient(SentryOptions(dsn: 'YOUR DSN HERE')),
- ),
+ printLogs: true,
+ )
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -39,27 +36,23 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/slack_handler_example.dart b/example/lib/slack_handler_example.dart
index 14ebc12b8bcd043e9e0a79438c094e14b4c5c431..e0c8e33480882c28f37d6de1e0310c1e17da8bc8 100644
--- a/example/lib/slack_handler_example.dart
+++ b/example/lib/slack_handler_example.dart
@@ -2,38 +2,31 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(SilentReportMode(), [
- SlackHandler(
- '',
- '#catcher',
- username: 'CatcherTest',
- iconEmoji: ':thinking_face:',
- enableDeviceParameters: true,
- enableApplicationParameters: true,
- enableCustomParameters: true,
- enableStackTrace: true,
- printLogs: true,
- ),
+ CatcherOptions debugOptions = CatcherOptions(SilentReportMode(), [
+ SlackHandler("", "#catcher",
+ username: "CatcherTest",
+ iconEmoji: ":thinking_face:",
+ enableDeviceParameters: true,
+ enableApplicationParameters: true,
+ enableCustomParameters: true,
+ enableStackTrace: true,
+ printLogs: true),
//ConsoleHandler()
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -47,27 +40,23 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
- );
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"), onPressed: () => generateError()));
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/snackbar_handler_example.dart b/example/lib/snackbar_handler_example.dart
index d1e2d9cc97bb145e987054f861c37f8f2b683577..41f389a0a6dac6b287ce860e9d59f464dc4f6534 100644
--- a/example/lib/snackbar_handler_example.dart
+++ b/example/lib/snackbar_handler_example.dart
@@ -2,34 +2,33 @@ import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
void main() {
- final debugOptions = CatcherOptions(DialogReportMode(), [
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
SnackbarHandler(
- const Duration(seconds: 5),
+ Duration(seconds: 5),
backgroundColor: Colors.green,
elevation: 2,
- margin: const EdgeInsets.all(16),
- padding: const EdgeInsets.all(16),
+ margin: EdgeInsets.all(16),
+ padding: EdgeInsets.all(16),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
behavior: SnackBarBehavior.floating,
action: SnackBarAction(
- label: 'Button',
- onPressed: () {
- print('Click!');
- },
- ),
- textStyle: const TextStyle(
+ label: "Button",
+ onPressed: () {
+ print("Click!");
+ }),
+ textStyle: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
]);
- final releaseOptions = CatcherOptions(DialogReportMode(), [
+ CatcherOptions releaseOptions = CatcherOptions(DialogReportMode(), [
SnackbarHandler(
- const Duration(seconds: 5),
+ Duration(seconds: 5),
backgroundColor: Colors.green,
elevation: 2,
- padding: const EdgeInsets.all(16),
- textStyle: const TextStyle(
+ padding: EdgeInsets.all(16),
+ textStyle: TextStyle(
color: Colors.white,
fontSize: 16,
),
@@ -37,21 +36,16 @@ void main() {
]);
Catcher(
- runAppFunction: () {
- runApp(const MyApp());
- },
- debugConfig: debugOptions,
- releaseConfig: releaseOptions,
- );
+ runAppFunction: () {
+ runApp(MyApp());
+ },
+ debugConfig: debugOptions,
+ releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -68,24 +62,24 @@ class _MyAppState extends State {
appBar: AppBar(
title: const Text('Snackbar handler example'),
),
- body: const ChildWidget(),
+ body: ChildWidget(),
),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ return Container(
+ child: TextButton(
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
+ ),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
}
diff --git a/example/lib/update_config_example.dart b/example/lib/update_config_example.dart
index 0e65097ab18c47aad22dd046d570ce01dce9ab11..e847ced55da3a800378c0d6c957dcdb3c9fc0a4d 100644
--- a/example/lib/update_config_example.dart
+++ b/example/lib/update_config_example.dart
@@ -4,33 +4,27 @@ import 'package:flutter/material.dart';
late Catcher catcher;
void main() {
- final debugOptions = CatcherOptions(DialogReportMode(), [
+ CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
//EmailManualHandler(["recipient@email.com"]),
- HttpHandler(
- HttpRequestType.post,
- Uri.parse('https://jsonplaceholder.typicode.com/posts'),
- printLogs: true,
- ),
- ConsoleHandler(),
+ HttpHandler(HttpRequestType.post,
+ Uri.parse("https://jsonplaceholder.typicode.com/posts"),
+ printLogs: true),
+ ConsoleHandler()
]);
- final releaseOptions = CatcherOptions(PageReportMode(), [
- EmailManualHandler(['recipient@email.com']),
+ CatcherOptions releaseOptions = CatcherOptions(PageReportMode(), [
+ EmailManualHandler(["recipient@email.com"])
]);
catcher = Catcher(
- rootWidget: const MyApp(),
+ rootWidget: MyApp(),
debugConfig: debugOptions,
releaseConfig: releaseOptions,
);
}
class MyApp extends StatefulWidget {
- const MyApp({Key? key}) : super(key: key);
-
@override
- State createState() {
- return _MyAppState();
- }
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -44,35 +38,32 @@ class _MyAppState extends State {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: const ChildWidget(),
- ),
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: ChildWidget()),
);
}
}
class ChildWidget extends StatelessWidget {
- const ChildWidget({Key? key}) : super(key: key);
-
@override
Widget build(BuildContext context) {
- return Row(
- children: [
+ return Container(
+ child: Row(children: [
TextButton(
- onPressed: changeConfig,
- child: const Text('Change config'),
+ child: Text("Change config"),
+ onPressed: () => changeConfig(),
),
TextButton(
- onPressed: generateError,
- child: const Text('Generate error'),
+ child: Text("Generate error"),
+ onPressed: () => generateError(),
),
- ],
+ ]),
);
}
- Future generateError() async {
+ void generateError() async {
Catcher.sendTestException();
}
diff --git a/example/ohos/.gitignore b/example/ohos/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..4929dd187ebe2147c74f2b10e0ab808e0ea818c9
--- /dev/null
+++ b/example/ohos/.gitignore
@@ -0,0 +1,21 @@
+/node_modules
+/oh_modules
+/har
+/local.properties
+/.idea
+**/build
+/.hvigor
+.cxx
+/.clangd
+/.clang-format
+/.clang-tidy
+**/.test
+*.har
+**/BuildProfile.ets
+**/oh-package-lock.json5
+
+**/src/main/resources/rawfile/flutter_assets/
+**/libs/arm64-v8a/libapp.so
+**/libs/arm64-v8a/libflutter.so
+**/libs/arm64-v8a/libvmservice_snapshot.so
+**/libs/arm64-v8a/libc++_shared.so
diff --git a/example/ohos/AppScope/app.json5 b/example/ohos/AppScope/app.json5
new file mode 100644
index 0000000000000000000000000000000000000000..c9d9a658684dc4dafa04af1d70354f43747647c1
--- /dev/null
+++ b/example/ohos/AppScope/app.json5
@@ -0,0 +1,10 @@
+{
+ "app": {
+ "bundleName": "com.jhomlala.catcher_example",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name"
+ }
+}
diff --git a/example/ohos/AppScope/resources/base/element/string.json b/example/ohos/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..44f66e29875a487b17cd351a5a8ea099206a6fa9
--- /dev/null
+++ b/example/ohos/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "catcher_example"
+ }
+ ]
+}
diff --git a/example/ohos/AppScope/resources/base/media/app_icon.png b/example/ohos/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/example/ohos/AppScope/resources/base/media/app_icon.png differ
diff --git a/example/ohos/build-profile.json5 b/example/ohos/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..a6f1e04c238b5264323839f7f27e7e91275737e1
--- /dev/null
+++ b/example/ohos/build-profile.json5
@@ -0,0 +1,28 @@
+{
+ "app": {
+ "signingConfigs": [],
+ "products": [
+ {
+ "name": "default",
+ "signingConfig": "default",
+ "compileSdkVersion": "4.1.0(11)",
+ "compatibleSdkVersion": "4.1.0(11)",
+ "runtimeOS": "HarmonyOS"
+ }
+ ]
+ },
+ "modules": [
+ {
+ "name": "entry",
+ "srcPath": "./entry",
+ "targets": [
+ {
+ "name": "default",
+ "applyToProducts": [
+ "default"
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/example/ohos/dta/icudtl.dat b/example/ohos/dta/icudtl.dat
new file mode 100644
index 0000000000000000000000000000000000000000..d1f10917ab52e3ebd251abd7f5377d7196b80d67
Binary files /dev/null and b/example/ohos/dta/icudtl.dat differ
diff --git a/example/ohos/entry/.gitignore b/example/ohos/entry/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..2795a1c5b1fe53659dd1b71d90ba0592eaf7e043
--- /dev/null
+++ b/example/ohos/entry/.gitignore
@@ -0,0 +1,7 @@
+
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test
\ No newline at end of file
diff --git a/example/ohos/entry/build-profile.json5 b/example/ohos/entry/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..6dcdb08ce26e97fd9653cb77128f9e50d8d0aaac
--- /dev/null
+++ b/example/ohos/entry/build-profile.json5
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+{
+ "apiType": 'stageMode',
+ "buildOption": {
+ },
+ "targets": [
+ {
+ "name": "default",
+ "runtimeOS": "HarmonyOS"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/example/ohos/entry/hvigorfile.ts b/example/ohos/entry/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..277733184c887b87be73d6fff132094317d46c33
--- /dev/null
+++ b/example/ohos/entry/hvigorfile.ts
@@ -0,0 +1,17 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
+export { hapTasks } from '@ohos/hvigor-ohos-plugin';
diff --git a/example/ohos/entry/oh-package.json5 b/example/ohos/entry/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..a49157c1a1efb78ca68bd03f93bcc1bf9c1255f5
--- /dev/null
+++ b/example/ohos/entry/oh-package.json5
@@ -0,0 +1,11 @@
+{
+ "name": "entry",
+ "version": "1.0.0",
+ "description": "Please describe the basic information.",
+ "main": "",
+ "author": "",
+ "license": "",
+ "dependencies": {
+ "catcher": "file:../har/catcher.har"
+ }
+}
\ No newline at end of file
diff --git a/example/ohos/entry/src/main/ets/entryability/EntryAbility.ets b/example/ohos/entry/src/main/ets/entryability/EntryAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..eb318d83953abec2dce0e079263be6d5fe449554
--- /dev/null
+++ b/example/ohos/entry/src/main/ets/entryability/EntryAbility.ets
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+import { FlutterAbility } from '@ohos/flutter_ohos'
+import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant';
+import FlutterEngine from '@ohos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngine';
+
+export default class EntryAbility extends FlutterAbility {
+ configureFlutterEngine(flutterEngine: FlutterEngine) {
+ super.configureFlutterEngine(flutterEngine)
+ GeneratedPluginRegistrant.registerWith(flutterEngine)
+ }
+}
diff --git a/example/ohos/entry/src/main/ets/pages/Index.ets b/example/ohos/entry/src/main/ets/pages/Index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e8470332e5215b67c9bd84a12fd40370744a05fd
--- /dev/null
+++ b/example/ohos/entry/src/main/ets/pages/Index.ets
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+import common from '@ohos.app.ability.common';
+import { FlutterPage } from '@ohos/flutter_ohos'
+
+let storage = LocalStorage.getShared()
+const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS'
+
+@Entry(storage)
+@Component
+struct Index {
+ private context = getContext(this) as common.UIAbilityContext
+ @LocalStorageLink('viewId') viewId: string = "";
+
+ build() {
+ Column() {
+ FlutterPage({ viewId: this.viewId })
+ }
+ }
+
+ onBackPress(): boolean {
+ this.context.eventHub.emit(EVENT_BACK_PRESS)
+ return true
+ }
+}
\ No newline at end of file
diff --git a/example/ohos/entry/src/main/module.json5 b/example/ohos/entry/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..b7ea937d5cf0533ed81ee0653cbb10f6b40dfa13
--- /dev/null
+++ b/example/ohos/entry/src/main/module.json5
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "description": "$string:module_desc",
+ "mainElement": "EntryAbility",
+ "deviceTypes": [
+ "phone"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "abilities": [
+ {
+ "name": "EntryAbility",
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
+ "description": "$string:EntryAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:EntryAbility_label",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:start_window_background",
+ "exported": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "requestPermissions": [
+ {"name" : "ohos.permission.INTERNET"},
+ ]
+ }
+}
\ No newline at end of file
diff --git a/example/ohos/entry/src/main/resources/base/element/color.json b/example/ohos/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02
--- /dev/null
+++ b/example/ohos/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,8 @@
+{
+ "color": [
+ {
+ "name": "start_window_background",
+ "value": "#FFFFFF"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/example/ohos/entry/src/main/resources/base/element/string.json b/example/ohos/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..e9f3cf01a6407f240ac13ef8d809e4d8ed6c2087
--- /dev/null
+++ b/example/ohos/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "module_desc",
+ "value": "module description"
+ },
+ {
+ "name": "EntryAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "EntryAbility_label",
+ "value": "catcher_example"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/example/ohos/entry/src/main/resources/base/media/icon.png b/example/ohos/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/example/ohos/entry/src/main/resources/base/media/icon.png differ
diff --git a/example/ohos/entry/src/main/resources/base/profile/main_pages.json b/example/ohos/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce
--- /dev/null
+++ b/example/ohos/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/Index"
+ ]
+}
diff --git a/example/ohos/entry/src/main/resources/en_US/element/string.json b/example/ohos/entry/src/main/resources/en_US/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..e9f3cf01a6407f240ac13ef8d809e4d8ed6c2087
--- /dev/null
+++ b/example/ohos/entry/src/main/resources/en_US/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "module_desc",
+ "value": "module description"
+ },
+ {
+ "name": "EntryAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "EntryAbility_label",
+ "value": "catcher_example"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/example/ohos/entry/src/main/resources/zh_CN/element/string.json b/example/ohos/entry/src/main/resources/zh_CN/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ca361d7a200b93513e222d412b42b66481badd95
--- /dev/null
+++ b/example/ohos/entry/src/main/resources/zh_CN/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "module_desc",
+ "value": "模块描述"
+ },
+ {
+ "name": "EntryAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "EntryAbility_label",
+ "value": "catcher_example"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/example/ohos/hvigor/hvigor-config.json5 b/example/ohos/hvigor/hvigor-config.json5
new file mode 100644
index 0000000000000000000000000000000000000000..0daae43d95102aacaef1ecb5d7f30fce79540157
--- /dev/null
+++ b/example/ohos/hvigor/hvigor-config.json5
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+{
+ "hvigorVersion": "4.1.2",
+ "dependencies": {
+ "@ohos/hvigor-ohos-plugin": "4.1.2"
+ }
+}
\ No newline at end of file
diff --git a/example/ohos/hvigor/hvigor-wrapper.js b/example/ohos/hvigor/hvigor-wrapper.js
new file mode 100644
index 0000000000000000000000000000000000000000..9809b36c4e57180c34bf2c3b8a6309548936ba73
--- /dev/null
+++ b/example/ohos/hvigor/hvigor-wrapper.js
@@ -0,0 +1,2 @@
+"use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),a=require("constants"),c=require("stream"),l=require("assert"),f=require("zlib"),D=require("net"),d=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},E={},h={},C=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h,"__esModule",{value:!0}),h.maxPathLength=h.isMac=h.isLinux=h.isWindows=void 0;const m=C(t),F="Windows_NT",y="Darwin";function g(){return m.default.type()===F}function A(){return m.default.type()===y}h.isWindows=g,h.isLinux=function(){return"Linux"===m.default.type()},h.isMac=A,h.maxPathLength=function(){return A()?1016:g()?259:4095},function(n){var r=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),u=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return u(t,e),t};Object.defineProperty(n,"__esModule",{value:!0}),n.LOG_LEVEL=n.ANALYZE=n.PARALLEL=n.INCREMENTAL=n.DAEMON=n.DOT=n.PROPERTIES=n.HVIGOR_POOL_CACHE_TTL=n.HVIGOR_POOL_CACHE_CAPACITY=n.HVIGOR_POOL_MAX_CORE_SIZE=n.HVIGOR_POOL_MAX_SIZE=n.ENABLE_SIGN_TASK_KEY=n.HVIGOR_CACHE_DIR_KEY=n.WORK_SPACE=n.HVIGOR_PROJECT_WRAPPER_HOME=n.HVIGOR_PROJECT_ROOT_DIR=n.HVIGOR_PROJECT_CACHES_HOME=n.HVIGOR_PNPM_STORE_PATH=n.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.PROJECT_CACHES=n.HVIGOR_WRAPPER_TOOLS_HOME=n.HVIGOR_USER_HOME=n.DEFAULT_PACKAGE_JSON=n.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=n.PNPM=n.HVIGOR=n.NPM_TOOL=n.PNPM_TOOL=n.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const i=o(t),s=o(e),a=h;n.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",n.PNPM_TOOL=(0,a.isWindows)()?"pnpm.cmd":"pnpm",n.NPM_TOOL=(0,a.isWindows)()?"npm.cmd":"npm",n.HVIGOR="hvigor",n.PNPM="pnpm",n.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",n.DEFAULT_PACKAGE_JSON="package.json",n.HVIGOR_USER_HOME=s.resolve(i.homedir(),".hvigor"),n.HVIGOR_WRAPPER_TOOLS_HOME=s.resolve(n.HVIGOR_USER_HOME,"wrapper","tools"),n.PROJECT_CACHES="project_caches",n.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=s.resolve(n.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",n.PNPM_TOOL),n.HVIGOR_PNPM_STORE_PATH=s.resolve(n.HVIGOR_USER_HOME,"caches"),n.HVIGOR_PROJECT_CACHES_HOME=s.resolve(n.HVIGOR_USER_HOME,n.PROJECT_CACHES),n.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),n.HVIGOR_PROJECT_WRAPPER_HOME=s.resolve(n.HVIGOR_PROJECT_ROOT_DIR,n.HVIGOR),n.WORK_SPACE="workspace",n.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",n.ENABLE_SIGN_TASK_KEY="enableSignTask",n.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",n.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",n.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",n.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",n.PROPERTIES="properties",n.DOT=".",n.DAEMON="daemon",n.INCREMENTAL="incremental",n.PARALLEL="typeCheck",n.ANALYZE="analyze",n.LOG_LEVEL="logLevel"}(E);var v={},S={};Object.defineProperty(S,"__esModule",{value:!0}),S.logError=S.logInfo=S.logErrorAndExit=void 0,S.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},S.logInfo=function(e){console.log(e)},S.logError=function(e){console.error(e)};var w=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),O=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),_=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&w(t,e,n);return O(t,e),t};Object.defineProperty(v,"__esModule",{value:!0});var b=v.executeBuild=void 0;const B=_(n),x=_(e),P=S,I=r;b=v.executeBuild=function(e){const t=x.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=B.realpathSync(t),n=process.argv.slice(2),r=(0,I.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,P.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,P.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,P.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var N,T,k,R,M,L={},j={},$={exports:{}},H={exports:{}};function G(){if(T)return N;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return N=function(s,a){a=a||{};var c=typeof s;if("string"===c&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"weeks":case"week":case"w":return a*u;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(s);if("number"===c&&isFinite(s))return a.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function V(){if(R)return k;return R=1,k=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),W={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function Q(){return K||(K=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=X();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=V()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Y,Y.exports)),Y.exports}q=$,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?q.exports=(M||(M=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=V()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(H,H.exports)),H.exports):q.exports=Q();var ee=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=te(s);else{var a=t.indexOf(s);o[i]=-1!==a?n[a]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=te(s);else{var a=t.indexOf(s);o[i]=-1!==a?n[a]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,se=e=>e&&"object"==typeof e&&!Array.isArray(e),ae=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ne.inspect(e,{depth:5})}) - ${n}`)}))};var ce={configure:e=>{re("New configuration to be validated: ",e),ae(e,ie(se(e)),"must be an object."),re(`Calling pre-processing listeners (${ue.length})`),ue.forEach((t=>t(e))),re("Configuration pre-processing finished."),re(`Calling configuration listeners (${oe.length})`),oe.forEach((t=>t(e))),re("Configuration finished.")},addListener:e=>{oe.push(e),re(`Added listener, now ${oe.length} listeners`)},addPreProcessingListener:e=>{ue.push(e),re(`Added pre-processing listener, now ${ue.length} listeners`)},throwExceptionIf:ae,anObject:se,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ie},le={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:a,l=n(u.getHours()),f=n(u.getMinutes()),D=n(u.getSeconds()),d=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,c).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,D).replace(/SSS/g,d).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],a=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),c=s.filter((function(e){return e.index>-1}));c.sort((function(e,t){return e.index-t.index}));var l=new RegExp(a.regexp).exec(n);if(l){var f=r||e.exports.now();return c.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(le);const fe=le.exports,De=t,de=i,pe=e,Ee=s,he=$.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function me(e){return e?`[${Ce[e][0]}m`:""}function Fe(e){return e?`[${Ce[e][1]}m`:""}function ye(e,t){return n=de.format("[%s] [%s] %s - ",fe.asString(e.startTime),e.level.toString(),e.categoryName),me(r=t)+n+Fe(r);var n,r}function ge(e){return ye(e)+de.format(...e.data)}function Ae(e){return ye(e,e.level.colour)+de.format(...e.data)}function ve(e){return de.format(...e.data)}function Se(e){return e.data[0]}function we(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(pe.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.lengthve,basic:()=>ge,colored:()=>Ae,coloured:()=>Ae,pattern:e=>we(e&&e.pattern,e&&e.tokens),dummy:()=>Se};var _e={basicLayout:ge,messagePassThroughLayout:ve,patternLayout:we,colouredLayout:Ae,coloredLayout:Ae,dummyLayout:Se,addLayout(e,t){Oe[e]=t},layout:(e,t)=>Oe[e]&&Oe[e](t)};const be=ce,Be=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class xe{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof xe?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),xe[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();xe[n]=new xe(e[t].value,n,e[t].colour);const r=xe.levels.findIndex((e=>e.levelStr===n));r>-1?xe.levels[r]=xe[n]:xe.levels.push(xe[n])})),xe.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=xe.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=xe.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=xe.getLevel(e)),this.level===e.level}}xe.levels=[],xe.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),be.addListener((e=>{const t=e.levels;if(t){be.throwExceptionIf(e,be.not(be.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{be.throwExceptionIf(e,be.not(be.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),be.throwExceptionIf(e,be.not(be.anObject(t[n])),`level "${n}" must be an object`),be.throwExceptionIf(e,be.not(t[n].value),`level "${n}" must have a 'value' property`),be.throwExceptionIf(e,be.not(be.anInteger(t[n].value)),`level "${n}".value must have an integer value`),be.throwExceptionIf(e,be.not(t[n].colour),`level "${n}" must have a 'colour' property`),be.throwExceptionIf(e,be.not(Be.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Be.join(", ")}`)}))}})),be.addListener((e=>{xe.addLevels(e.levels)}));var Pe=xe,Ie={exports:{}},Ne={};/*! (c) 2020 Andrea Giammarchi */
+const{parse:Te,stringify:ke}=JSON,{keys:Re}=Object,Me=String,Le="string",je={},$e="object",He=(e,t)=>t,Ge=e=>e instanceof Me?Me(e):e,Ve=(e,t)=>typeof t===Le?new Me(t):t,Je=(e,t,n,r)=>{const u=[];for(let o=Re(n),{length:i}=o,s=0;s{const r=Me(t.push(n)-1);return e.set(n,r),r},We=(e,t)=>{const n=Te(e,Ve).map(Ge),r=n[0],u=t||He,o=typeof r===$e&&r?Je(n,new Set,r,u):r;return u.call({"":o},"",o)};Ne.parse=We;const ze=(e,t,n)=>{const r=t&&typeof t===$e?(e,n)=>""===e||-1Te(ze(e));Ne.fromJSON=e=>We(ke(e));const Ke=Ne,qe=Pe;const Ye=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Ze=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ke.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Ye.serialise(t))))}static deserialise(e){let t;try{const n=Ke.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Ye.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Ze(n.categoryName,qe.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Ze("log4js",qe.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var Xe=Ze;const Qe=$.exports("log4js:clustering"),et=Xe,tt=ce;let nt=!1,rt=null;try{rt=require("cluster")}catch(e){Qe("cluster module not present"),nt=!0}const ut=[];let ot=!1,it="NODE_APP_INSTANCE";const st=()=>ot&&"0"===process.env[it],at=()=>nt||rt&&rt.isMaster||st(),ct=e=>{ut.forEach((t=>t(e)))},lt=(e,t)=>{if(Qe("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Qe("received message: ",t.data);const e=et.deserialise(t.data);ct(e)}};nt||tt.addListener((e=>{ut.length=0,({pm2:ot,disableClustering:nt,pm2InstanceVar:it="NODE_APP_INSTANCE"}=e),Qe(`clustering disabled ? ${nt}`),Qe(`cluster.isMaster ? ${rt&&rt.isMaster}`),Qe(`pm2 enabled ? ${ot}`),Qe(`pm2InstanceVar = ${it}`),Qe(`process.env[${it}] = ${process.env[it]}`),ot&&process.removeListener("message",lt),rt&&rt.removeListener&&rt.removeListener("message",lt),nt||e.disableClustering?Qe("Not listening for cluster messages, because clustering disabled."):st()?(Qe("listening for PM2 broadcast messages"),process.on("message",lt)):rt&&rt.isMaster?(Qe("listening for cluster messages"),rt.on("message",lt)):Qe("not listening for messages, because we are not a master process")}));var ft={onlyOnMaster:(e,t)=>at()?e():t,isMaster:at,send:e=>{at()?ct(e):(ot||(e.cluster={workerId:rt.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{ut.push(e)}},Dt={};function dt(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function pt(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:dt},e)}const Et={dateFile:pt,file:pt,fileSync:pt};Dt.modifyConfig=e=>Et[e.type]?Et[e.type](e):e;var ht={};const Ct=console.log.bind(console);ht.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var mt={};mt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var yt={};yt.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var gt={};const At=$.exports("log4js:categoryFilter");gt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{At(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(At("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var vt={};const St=$.exports("log4js:noLogFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{St(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={},Ot={exports:{}},_t={},bt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},Bt=a,xt=process.cwd,Pt=null,It=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Pt||(Pt=xt.call(process)),Pt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Nt=process.chdir;process.chdir=function(e){Pt=null,Nt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Nt)}var Tt=function(e){Bt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,Bt.O_WRONLY|Bt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,Bt.O_WRONLY|Bt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){Bt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,Bt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,Bt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===It&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(a){if(a&&("EACCES"===a.code||"EPERM"===a.code||"EBUSY"===a.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(a)}))}),i),void(i<100&&(i+=10));u&&u(a)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var a;if(s&&"function"==typeof s){var c=0;a=function(l,f,D){if(l&&"EAGAIN"===l.code&&c<10)return c++,t.call(e,n,r,u,o,i,a);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,a)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(a=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return a.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var a};var kt=c.Stream,Rt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);kt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);kt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Mt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:Lt(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Lt=Object.getPrototypeOf||function(e){return e.__proto__};var jt,$t,Ht=n,Gt=Tt,Vt=Rt,Jt=Mt,Ut=i;function Wt(e,t){Object.defineProperty(e,jt,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(jt=Symbol.for("graceful-fs.queue"),$t=Symbol.for("graceful-fs.previous")):(jt="___graceful-fs.queue",$t="___graceful-fs.previous");var zt=function(){};if(Ut.debuglog?zt=Ut.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(zt=function(){var e=Ut.format.apply(Ut,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Ht[jt]){var Kt=p[jt]||[];Wt(Ht,Kt),Ht.close=function(e){function t(t,n){return e.call(Ht,t,(function(e){e||Qt(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,$t,{value:e}),t}(Ht.close),Ht.closeSync=function(e){function t(t){e.apply(Ht,arguments),Qt()}return Object.defineProperty(t,$t,{value:e}),t}(Ht.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){zt(Ht[jt]),l.equal(Ht[jt].length,0)}))}p[jt]||Wt(p,Ht[jt]);var qt,Yt=Zt(Jt(Ht));function Zt(e){Gt(e),e.gracefulify=Zt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):Xt([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):Xt([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):Xt([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):Xt([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):Xt([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Vt(e);D=s.ReadStream,d=s.WriteStream}var a=e.ReadStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var c=e.WriteStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var l=D;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=d;function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):Xt([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function Xt(e){zt("ENQUEUE",e[0].name,e[1]),Ht[jt].push(e),en()}function Qt(){for(var e=Date.now(),t=0;t2&&(Ht[jt][t][3]=e,Ht[jt][t][4]=e);en()}function en(){if(clearTimeout(qt),qt=void 0,0!==Ht[jt].length){var e=Ht[jt].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)zt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){zt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,a=Math.max(o-u,1);s>=Math.min(1.2*a,100)?(zt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Ht[jt].push(e)}void 0===qt&&(qt=setTimeout(en,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ht.__patched&&(Yt=Zt(Ht),Ht.__patched=!0),function(e){const t=bt.fromCallback,n=Yt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(_t);const tn=e;function nn(e){return(e=tn.normalize(tn.resolve(e)).split(tn.sep)).length>0?e[0]:null}const rn=/[<>:"|?*]/;var un=function(e){const t=nn(e);return e=e.replace(t,""),rn.test(e)};const on=Yt,sn=e,an=un,cn=parseInt("0777",8);var ln=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&an(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||on;void 0===o&&(o=cn&~process.umask()),u||(u=null),r=r||function(){},t=sn.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(sn.dirname(t)===t)return r(o);e(sn.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const fn=Yt,Dn=e,dn=un,pn=parseInt("0777",8);var En=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||fn;if("win32"===process.platform&&dn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=pn&~process.umask()),r||(r=null),t=Dn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Dn.dirname(t)===t)throw u;r=e(Dn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const hn=(0,bt.fromCallback)(ln);var Cn={mkdirs:hn,mkdirsSync:En,mkdirp:hn,mkdirpSync:En,ensureDir:hn,ensureDirSync:En};const mn=Yt;var Fn=function(e,t,n,r){mn.open(e,"r+",((e,u)=>{if(e)return r(e);mn.futimes(u,t,n,(e=>{mn.close(u,(t=>{r&&r(e||t)}))}))}))},yn=function(e,t,n){const r=mn.openSync(e,"r+");return mn.futimesSync(r,t,n),mn.closeSync(r)};const gn=Yt,An=e,vn=10,Sn=5,wn=0,On=process.versions.node.split("."),_n=Number.parseInt(On[0],10),bn=Number.parseInt(On[1],10),Bn=Number.parseInt(On[2],10);function xn(){if(_n>vn)return!0;if(_n===vn){if(bn>Sn)return!0;if(bn===Sn&&Bn>=wn)return!0}return!1}function Pn(e,t){const n=An.resolve(e).split(An.sep).filter((e=>e)),r=An.resolve(t).split(An.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function In(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Nn,Tn,kn={checkPaths:function(e,t,n,r){!function(e,t,n){xn()?gn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);gn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):gn.stat(e,((e,r)=>{if(e)return n(e);gn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&Pn(e,t)?r(new Error(In(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=xn()?gn.statSync(e,{bigint:!0}):gn.statSync(e);try{r=xn()?gn.statSync(t,{bigint:!0}):gn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&Pn(e,t))throw new Error(In(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=An.resolve(An.dirname(t)),s=An.resolve(An.dirname(r));if(s===i||s===An.parse(s).root)return o();xn()?gn.stat(s,{bigint:!0},((i,a)=>i?"ENOENT"===i.code?o():o(i):a.ino&&a.dev&&a.ino===n.ino&&a.dev===n.dev?o(new Error(In(t,r,u))):e(t,n,s,u,o))):gn.stat(s,((i,a)=>i?"ENOENT"===i.code?o():o(i):a.ino&&a.dev&&a.ino===n.ino&&a.dev===n.dev?o(new Error(In(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=An.resolve(An.dirname(t)),i=An.resolve(An.dirname(r));if(i===o||i===An.parse(i).root)return;let s;try{s=xn()?gn.statSync(i,{bigint:!0}):gn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(In(t,r,u));return e(t,n,i,u)},isSrcSubdir:Pn};const Rn=Yt,Mn=e,Ln=Cn.mkdirsSync,jn=yn,$n=kn;function Hn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Rn.statSync:Rn.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Rn.mkdirSync(n),Vn(t,n,r),Rn.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Vn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Rn.unlinkSync(n),Gn(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Gn(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Rn.readlinkSync(t);r.dereference&&(u=Mn.resolve(process.cwd(),u));if(e){let e;try{e=Rn.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Rn.symlinkSync(u,n);throw e}if(r.dereference&&(e=Mn.resolve(process.cwd(),e)),$n.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Rn.statSync(n).isDirectory()&&$n.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Rn.unlinkSync(t),Rn.symlinkSync(e,t)}(u,n)}return Rn.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Gn(e,t,n,r){return"function"==typeof Rn.copyFileSync?(Rn.copyFileSync(t,n),Rn.chmodSync(n,e.mode),r.preserveTimestamps?jn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Nn:(Tn=1,Nn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Rn.openSync(t,"r"),s=Rn.openSync(n,"w",e.mode);let a=0;for(;afunction(e,t,n,r){const u=Mn.join(t,e),o=Mn.join(n,e),{destStat:i}=$n.checkPathsSync(u,o,"copy");return Hn(i,u,o,r)}(r,e,t,n)))}var Jn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=$n.checkPathsSync(e,t,"copy");return $n.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=Mn.dirname(n);Rn.existsSync(u)||Ln(u);return Hn(e,t,n,r)}(u,e,t,n)},Un={copySync:Jn};const Wn=bt.fromPromise,zn=_t;var Kn={pathExists:Wn((function(e){return zn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:zn.existsSync};const qn=Yt,Yn=e,Zn=Cn.mkdirs,Xn=Kn.pathExists,Qn=Fn,er=kn;function tr(e,t,n,r,u){const o=Yn.dirname(n);Xn(o,((i,s)=>i?u(i):s?rr(e,t,n,r,u):void Zn(o,(o=>o?u(o):rr(e,t,n,r,u)))))}function nr(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function rr(e,t,n,r,u){return r.filter?nr(ur,e,t,n,r,u):ur(e,t,n,r,u)}function ur(e,t,n,r,u){(r.dereference?qn.stat:qn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){qn.mkdir(n,(o=>{if(o)return u(o);sr(t,n,r,(t=>t?u(t):qn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return sr(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();qn.unlink(n,(o=>o?u(o):or(e,t,n,r,u)))}(e,n,r,u,o):or(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){qn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Yn.resolve(process.cwd(),o)),e?void qn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?qn.symlink(o,n,u):u(t):(r.dereference&&(i=Yn.resolve(process.cwd(),i)),er.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&er.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){qn.unlink(t,(r=>r?n(r):qn.symlink(e,t,n)))}(o,n,u)))):qn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function or(e,t,n,r,u){return"function"==typeof qn.copyFile?qn.copyFile(t,n,(t=>t?u(t):ir(e,n,r,u))):function(e,t,n,r,u){const o=qn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=qn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>ir(e,n,r,u)))}))}(e,t,n,r,u)}function ir(e,t,n,r){qn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?Qn(t,e.atime,e.mtime,r):r()))}function sr(e,t,n,r){qn.readdir(e,((u,o)=>u?r(u):ar(o,e,t,n,r)))}function ar(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Yn.join(n,t),s=Yn.join(r,t);er.checkPaths(i,s,"copy",((t,a)=>{if(t)return o(t);const{destStat:c}=a;rr(c,i,s,u,(t=>t?o(t):ar(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var cr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),er.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;er.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?nr(tr,s,e,t,n,r):tr(s,e,t,n,r)))}))};var lr={copy:(0,bt.fromCallback)(cr)};const fr=Yt,Dr=e,dr=l,pr="win32"===process.platform;function Er(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||fr[t],e[t+="Sync"]=e[t]||fr[t]})),e.maxBusyTries=e.maxBusyTries||3}function hr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),dr(e,"rimraf: missing path"),dr.strictEqual(typeof e,"string","rimraf: path should be a string"),dr.strictEqual(typeof n,"function","rimraf: callback function required"),dr(t,"rimraf: invalid options argument provided"),dr.strictEqual(typeof t,"object","rimraf: options should be object"),Er(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rCr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){dr(e),dr(t),dr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&pr?mr(e,t,r,n):u&&u.isDirectory()?yr(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return pr?mr(e,t,r,n):yr(e,t,r,n);if("EISDIR"===r.code)return yr(e,t,r,n)}return n(r)}))))}function mr(e,t,n,r){dr(e),dr(t),dr("function"==typeof r),n&&dr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?yr(e,t,n,r):t.unlink(e,r)}))}))}function Fr(e,t,n){let r;dr(e),dr(t),n&&dr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Ar(e,t,n):t.unlinkSync(e)}function yr(e,t,n,r){dr(e),dr(t),n&&dr(n instanceof Error),dr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){dr(e),dr(t),dr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{hr(Dr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function gr(e,t){let n;Er(t=t||{}),dr(e,"rimraf: missing path"),dr.strictEqual(typeof e,"string","rimraf: path should be a string"),dr(t,"rimraf: missing options"),dr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&pr&&Fr(e,t,n)}try{n&&n.isDirectory()?Ar(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return pr?Fr(e,t,n):Ar(e,t,n);if("EISDIR"!==n.code)throw n;Ar(e,t,n)}}function Ar(e,t,n){dr(e),dr(t),n&&dr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(dr(e),dr(t),t.readdirSync(e).forEach((n=>gr(Dr.join(e,n),t))),!pr){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var vr=hr;hr.sync=gr;const Sr=vr;var wr={remove:(0,bt.fromCallback)(Sr),removeSync:Sr.sync};const Or=bt.fromCallback,_r=Yt,br=e,Br=Cn,xr=wr,Pr=Or((function(e,t){t=t||function(){},_r.readdir(e,((n,r)=>{if(n)return Br.mkdirs(e,t);r=r.map((t=>br.join(e,t))),function e(){const n=r.pop();if(!n)return t();xr.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Ir(e){let t;try{t=_r.readdirSync(e)}catch(t){return Br.mkdirsSync(e)}t.forEach((t=>{t=br.join(e,t),xr.removeSync(t)}))}var Nr={emptyDirSync:Ir,emptydirSync:Ir,emptyDir:Pr,emptydir:Pr};const Tr=bt.fromCallback,kr=e,Rr=Yt,Mr=Cn,Lr=Kn.pathExists;var jr={createFile:Tr((function(e,t){function n(){Rr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Rr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=kr.dirname(e);Lr(o,((e,r)=>e?t(e):r?n():void Mr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Rr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=kr.dirname(e);Rr.existsSync(n)||Mr.mkdirsSync(n),Rr.writeFileSync(e,"")}};const $r=bt.fromCallback,Hr=e,Gr=Yt,Vr=Cn,Jr=Kn.pathExists;var Ur={createLink:$r((function(e,t,n){function r(e,t){Gr.link(e,t,(e=>{if(e)return n(e);n(null)}))}Jr(t,((u,o)=>u?n(u):o?n(null):void Gr.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Hr.dirname(t);Jr(o,((u,i)=>u?n(u):i?r(e,t):void Vr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Gr.existsSync(t))return;try{Gr.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Hr.dirname(t);return Gr.existsSync(n)||Vr.mkdirsSync(n),Gr.linkSync(e,t)}};const Wr=e,zr=Yt,Kr=Kn.pathExists;var qr={symlinkPaths:function(e,t,n){if(Wr.isAbsolute(e))return zr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Wr.dirname(t),u=Wr.join(r,e);return Kr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):zr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Wr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Wr.isAbsolute(e)){if(n=zr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Wr.dirname(t),u=Wr.join(r,e);if(n=zr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=zr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Wr.relative(r,e)}}}};const Yr=Yt;var Zr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Yr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Yr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Xr=bt.fromCallback,Qr=e,eu=Yt,tu=Cn.mkdirs,nu=Cn.mkdirsSync,ru=qr.symlinkPaths,uu=qr.symlinkPathsSync,ou=Zr.symlinkType,iu=Zr.symlinkTypeSync,su=Kn.pathExists;var au={createSymlink:Xr((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,su(t,((u,o)=>u?r(u):o?r(null):void ru(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,ou(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=Qr.dirname(t);su(o,((n,i)=>n?r(n):i?eu.symlink(e,t,u,r):void tu(o,(n=>{if(n)return r(n);eu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(eu.existsSync(t))return;const r=uu(e,t);e=r.toDst,n=iu(r.toCwd,n);const u=Qr.dirname(t);return eu.existsSync(u)||nu(u),eu.symlinkSync(e,t,n)}};var cu,lu={createFile:jr.createFile,createFileSync:jr.createFileSync,ensureFile:jr.createFile,ensureFileSync:jr.createFileSync,createLink:Ur.createLink,createLinkSync:Ur.createLinkSync,ensureLink:Ur.createLink,ensureLinkSync:Ur.createLinkSync,createSymlink:au.createSymlink,createSymlinkSync:au.createSymlinkSync,ensureSymlink:au.createSymlink,ensureSymlinkSync:au.createSymlinkSync};try{cu=Yt}catch(e){cu=n}function fu(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Du(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var du={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||cu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Du(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||cu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Du(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||cu,o="";try{o=fu(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||cu,u=fu(t,n);return r.writeFileSync(e,u,n)}},pu=du;const Eu=bt.fromCallback,hu=pu;var Cu={readJson:Eu(hu.readFile),readJsonSync:hu.readFileSync,writeJson:Eu(hu.writeFile),writeJsonSync:hu.writeFileSync};const mu=e,Fu=Cn,yu=Kn.pathExists,gu=Cu;var Au=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=mu.dirname(e);yu(u,((o,i)=>o?r(o):i?gu.writeJson(e,t,n,r):void Fu.mkdirs(u,(u=>{if(u)return r(u);gu.writeJson(e,t,n,r)}))))};const vu=Yt,Su=e,wu=Cn,Ou=Cu;var _u=function(e,t,n){const r=Su.dirname(e);vu.existsSync(r)||wu.mkdirsSync(r),Ou.writeJsonSync(e,t,n)};const bu=bt.fromCallback,Bu=Cu;Bu.outputJson=bu(Au),Bu.outputJsonSync=_u,Bu.outputJSON=Bu.outputJson,Bu.outputJSONSync=Bu.outputJsonSync,Bu.writeJSON=Bu.writeJson,Bu.writeJSONSync=Bu.writeJsonSync,Bu.readJSON=Bu.readJson,Bu.readJSONSync=Bu.readJsonSync;var xu=Bu;const Pu=Yt,Iu=e,Nu=Un.copySync,Tu=wr.removeSync,ku=Cn.mkdirpSync,Ru=kn;function Mu(e,t,n){try{Pu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Nu(e,t,r),Tu(e)}(e,t,n)}}var Lu=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Ru.checkPathsSync(e,t,"move");return Ru.checkParentPathsSync(e,u,t,"move"),ku(Iu.dirname(t)),function(e,t,n){if(n)return Tu(t),Mu(e,t,n);if(Pu.existsSync(t))throw new Error("dest already exists.");return Mu(e,t,n)}(e,t,r)},ju={moveSync:Lu};const $u=Yt,Hu=e,Gu=lr.copy,Vu=wr.remove,Ju=Cn.mkdirp,Uu=Kn.pathExists,Wu=kn;function zu(e,t,n,r){$u.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Gu(e,t,u,(t=>t?r(t):Vu(e,r)))}(e,t,n,r):r()))}var Ku=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Wu.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Wu.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Ju(Hu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Vu(t,(u=>u?r(u):zu(e,t,n,r)));Uu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):zu(e,t,n,r)))}(e,t,u,r)))}))}))};var qu={move:(0,bt.fromCallback)(Ku)};const Yu=bt.fromCallback,Zu=Yt,Xu=e,Qu=Cn,eo=Kn.pathExists;var to={outputFile:Yu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Xu.dirname(e);eo(u,((o,i)=>o?r(o):i?Zu.writeFile(e,t,n,r):void Qu.mkdirs(u,(u=>{if(u)return r(u);Zu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Xu.dirname(e);if(Zu.existsSync(n))return Zu.writeFileSync(e,...t);Qu.mkdirsSync(n),Zu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},_t,Un,lr,Nr,lu,xu,Cn,ju,qu,to,Kn,wr);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(Ot);const no=$.exports("streamroller:fileNameFormatter"),ro=e;const uo=$.exports("streamroller:fileNameParser"),oo=le.exports;const io=$.exports("streamroller:moveAndMaybeCompressFile"),so=Ot.exports,ao=f;var co=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return io(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await so.pathExists(e))if(io(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=so.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=so.createReadStream(e).on("open",(()=>{t.pipe(ao.createGzip()).pipe(i)})).on("error",(t=>{io(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{io(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),so.unlink(e).then(r).catch((t=>{io(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),so.truncate(e).then(r).catch((t=>{io(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(io(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),so.unlink(t).then((()=>{u(e)})).catch((e=>{io(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(io(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{io(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await so.move(e,t,{overwrite:!0})}catch(n){if(io(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){io("moveAndMaybeCompressFile: trying copy+truncate instead");try{await so.copy(e,t,{overwrite:!0}),await so.truncate(e)}catch(e){io("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else io("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const lo=$.exports("streamroller:RollingFileWriteStream"),fo=Ot.exports,Do=e,po=t,Eo=()=>new Date,ho=le.exports,{Writable:Co}=c,mo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=ro.join(e.dir,e.name),a=t=>t+e.ext,c=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,D=t?[l,c,a,f]:[a,l,c,f];return({date:e,index:t})=>(no(`_formatFileName: date=${e}, index=${t}`),D.reduce(((n,r)=>r(n,t,e)),s))},Fo=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(uo("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(uo("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(uo("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];uo("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),uo(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=oo.parse(n,i,new Date(0,0));return oo.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return uo(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(uo("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},yo=co;var go=class extends Co{constructor(e,t){if(lo(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Do.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Do.sep}`)&&(e=e.replace("~",po.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Do.parse(e),""===this.fileObject.dir&&(this.fileObject=Do.parse(Do.join(process.cwd(),e))),this.fileFormatter=mo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return lo(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{lo(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(lo(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==ho(this.options.pattern,Eo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return lo("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){lo(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await yo(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?ho(this.options.pattern,Eo()):null,lo(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await fo.readdir(this.fileObject.dir).catch((()=>[]));lo(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:Eo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return fo.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Do.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(fo.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;fo.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=fo.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(lo(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),lo("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Do.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,lo(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>fo.unlink(e).catch((t=>{lo(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Ao=go;var vo=class extends Ao{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const So=go;var wo={RollingFileWriteStream:go,RollingFileStream:vo,DateRollingFileStream:class extends So{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Oo=$.exports("log4js:file"),_o=e,bo=wo,Bo=t,xo=Bo.EOL;let Po=!1;const Io=new Set;function No(){Io.forEach((e=>{e.sighupHandler()}))}wt.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(_o.sep))throw new Error(`Filename is a directory: ${e}`);function i(e,t,n,r){const u=new bo.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}e=e.replace(new RegExp(`^~(?=${_o.sep}.+)`),Bo.homedir()),e=_o.normalize(e),Oo("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let s=i(e,n,r,u);const a=function(e){if(s.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}s.write(t(e,o)+xo,"utf8")||process.emit("log4js:pause",!0)}};return a.reopen=function(){s.end((()=>{s=i(e,n,r,u)}))},a.sighupHandler=function(){Oo("SIGHUP handler called."),a.reopen()},a.shutdown=function(e){Io.delete(a),0===Io.size&&Po&&(process.removeListener("SIGHUP",No),Po=!1),s.end("","utf-8",e)},Io.add(a),Po||(process.on("SIGHUP",No),Po=!0),a}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var To={};const ko=wo,Ro=t.EOL;function Mo(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new ko.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Ro,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}To.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Mo(e.filename,e.pattern,n,e,e.timezoneOffset)};var Lo={};const jo=$.exports("log4js:fileSync"),$o=e,Ho=n,Go=t,Vo=Go.EOL;function Jo(e,t){const n=e=>{try{return Ho.mkdirSync(e,{recursive:!0})}catch(t){if("ENOENT"===t.code)return n($o.dirname(e)),n(e);if("EEXIST"!==t.code&&"EROFS"!==t.code)throw t;try{if(Ho.statSync(e).isDirectory())return e;throw t}catch(e){throw t}}};n($o.dirname(e)),Ho.appendFileSync(e,"",{mode:t.mode,flag:t.flags})}class Uo{constructor(e,t,n,r){if(jo("In RollingFileStream"),t<0)throw new Error(`maxLogSize (${t}) should be > 0`);this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=Ho.statSync(e).size}catch(t){Jo(e,r)}return t}(this.filename)}shouldRoll(){return jo("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${$o.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.slice(`${$o.basename(e)}.`.length),10)||0}function o(e,t){return u(e)-u(t)}function i(n){const r=u(n);if(jo(`Index of ${n} is ${r}`),0===t.backups)Ho.truncateSync(e,0);else if(r ${e}.${r+1}`),Ho.renameSync($o.join($o.dirname(e),n),`${e}.${r+1}`)}}jo("Rolling, rolling, rolling"),jo("Renaming the old files"),Ho.readdirSync($o.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;jo("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),jo("writing the chunk to the file"),n.currentSize+=e.length,Ho.appendFileSync(n.filename,e)}}Lo.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith($o.sep))throw new Error(`Filename is a directory: ${e}`);e=e.replace(new RegExp(`^~(?=${$o.sep}.+)`),Go.homedir()),e=$o.normalize(e),jo("Creating fileSync appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");const i=function(e,t,n){let r;var o;return t?r=new Uo(e,t,n,u):(Jo(o=e,u),r={write(e){Ho.appendFileSync(o,e)}}),r}(e,n,r);return e=>{i.write(t(e,o)+Vo)}}(e.filename,n,e.maxLogSize,e.backups,r,e.timezoneOffset)};var Wo={};const zo=$.exports("log4js:tcp"),Ko=D;Wo.configure=function(e,t){zo(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){zo("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function a(){let e;for(zo("emptying buffer");e=r.shift();)s(e)}function c(e){n?s(e):(zo("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){zo(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=Ko.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{zo("socket connected"),a(),n=!0})),u.on("drain",(()=>{zo("drain event received, emptying buffer"),n=!0,a()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{zo("connection error",e),n=!1,a()})),u.on("close",t)}(),c.shutdown=function(e){zo("shutdown called"),r.length&&o?(zo("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{c.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},c}(e,n)};const qo=e,Yo=$.exports("log4js:appenders"),Zo=ce,Xo=ft,Qo=Pe,ei=_e,ti=Dt,ni=new Map;ni.set("console",ht),ni.set("stdout",mt),ni.set("stderr",Ft),ni.set("logLevelFilter",yt),ni.set("categoryFilter",gt),ni.set("noLogFilter",vt),ni.set("file",wt),ni.set("dateFile",To),ni.set("fileSync",Lo),ni.set("tcp",Wo);const ri=new Map,ui=(e,t)=>{let n;try{const t=`${e}.cjs`;n=require.resolve(t),Yo("Loading module from ",t)}catch(t){n=e,Yo("Loading module from ",e)}try{return require(n)}catch(n){return void Zo.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},oi=new Set,ii=(e,t)=>{if(ri.has(e))return ri.get(e);if(!t.appenders[e])return!1;if(oi.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);oi.add(e),Yo(`Creating appender ${e}`);const n=si(e,t);return oi.delete(e),ri.set(e,n),n},si=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ni.get(e)||ui(`./${e}`,t)||ui(e,t)||require.main&&require.main.filename&&ui(qo.join(qo.dirname(require.main.filename),e),t)||ui(qo.join(process.cwd(),e),t))(n.type,t);return Zo.throwExceptionIf(t,Zo.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&(process.emitWarning(`Appender ${n.type} exports an appender function.`,"DeprecationWarning","log4js-node-DEP0001"),Yo("[log4js-node-DEP0001]",`DEPRECATION: Appender ${n.type} exports an appender function.`)),r.shutdown&&(process.emitWarning(`Appender ${n.type} exports a shutdown function.`,"DeprecationWarning","log4js-node-DEP0002"),Yo("[log4js-node-DEP0002]",`DEPRECATION: Appender ${n.type} exports a shutdown function.`)),Yo(`${e}: clustering.isMaster ? ${Xo.isMaster()}`),Yo(`${e}: appenderModule is ${i.inspect(r)}`),Xo.onlyOnMaster((()=>(Yo(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ti.modifyConfig(n),ei,(e=>ii(e,t)),Qo))),(()=>{}))},ai=e=>{if(ri.clear(),oi.clear(),!e)return;const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type||"multiprocess"===e.appenders[n].type)&&ii(n,e)}))},ci=()=>{ai()};ci(),Zo.addListener((e=>{Zo.throwExceptionIf(e,Zo.not(Zo.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);Zo.throwExceptionIf(e,Zo.not(t.length),"must define at least one appender."),t.forEach((t=>{Zo.throwExceptionIf(e,Zo.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),Zo.addListener(ai),Ie.exports=ri,Ie.exports.init=ci;var li={exports:{}};!function(e){const t=$.exports("log4js:categories"),n=ce,r=Pe,u=Ie.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.slice(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const a=e=>{if(o.clear(),!e)return;Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},c=()=>{a()};c(),n.addListener(a);const l=e=>{if(t(`configForCategory: searching for config for ${e}`),o.has(e))return t(`configForCategory: ${e} exists in config, returning it`),o.get(e);let n;return e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, cloning from parents`),n={...l(e.slice(0,e.lastIndexOf(".")))}):(o.has("default")||a({categories:{default:{appenders:["out"],level:"OFF"}}}),t("configForCategory: cloning default category"),n={...o.get("default")}),o.set(e,n),n};e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,t)=>{l(e).level=t},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:c})}(li);const fi=$.exports("log4js:logger"),Di=Xe,di=Pe,pi=ft,Ei=li.exports,hi=ce,Ci=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function mi(e,t=4){try{const n=e.stack.split("\n").slice(t);if(!n.length)return null;const r=Ci.exec(n[0]);if(r&&6===r.length){let e="",t="",u="";return r[1]&&""!==r[1]&&([t,u]=r[1].replace(/[[\]]/g,"").split(" as "),u=u||"",t.includes(".")&&([e,t]=t.split("."))),{fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n"),className:e,functionName:t,functionAlias:u,callerName:r[1]||""}}console.error("log4js.logger - defaultParseCallStack error")}catch(e){console.error("log4js.logger - defaultParseCallStack error",e)}return null}let Fi=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.callStackSkipIndex=0,this.parseCallStack=mi,fi(`Logger created (${this.category}, ${this.level})`)}get level(){return di.getLevel(Ei.getLevelForCategory(this.category),di.OFF)}set level(e){Ei.setLevelForCategory(this.category,di.getLevel(e,this.level))}get useCallStack(){return Ei.getEnableCallStackForCategory(this.category)}set useCallStack(e){Ei.setEnableCallStackForCategory(this.category,!0===e)}get callStackLinesToSkip(){return this.callStackSkipIndex}set callStackLinesToSkip(e){if("number"!=typeof e)throw new TypeError("Must be a number");if(e<0)throw new RangeError("Must be >= 0");this.callStackSkipIndex=e}log(e,...t){const n=di.getLevel(e);n?this.isLevelEnabled(n)&&this._log(n,t):hi.validIdentifier(e)&&t.length>0?(this.log(di.WARN,"log4js:logger.log: valid log-level not found as first parameter given:",e),this.log(di.INFO,`[${e}]`,...t)):this.log(di.INFO,e,...t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){fi(`sending log data (${e}) to appenders`);const n=t.find((e=>e instanceof Error));let r;if(this.useCallStack){try{n&&(r=this.parseCallStack(n,this.callStackSkipIndex+1))}catch(e){}r=r||this.parseCallStack(new Error,this.callStackSkipIndex+3+1)}const u=new Di(this.category,e,t,this.context,r,n);pi.send(u)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){if("function"==typeof e)this.parseCallStack=e;else{if(void 0!==e)throw new TypeError("Invalid type passed to setParseCallStackFunction");this.parseCallStack=mi}}};function yi(e){const t=di.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Fi.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Fi.prototype[n]=function(...e){this.log(t,...e)}}di.levels.forEach(yi),hi.addListener((()=>{di.levels.forEach(yi)}));var gi=Fi;const Ai=Pe;function vi(e){return e.originalUrl||e.url}function Si(e,t){for(let n=0;n{if(void 0!==e._logging)return i();if("function"!=typeof t.nolog){const n=function(e){let t=null;if(e instanceof RegExp&&(t=e),"string"==typeof e&&(t=new RegExp(e)),Array.isArray(e)){const n=e.map((e=>e.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);if(n&&n.test(e.originalUrl))return i()}if(n.isLevelEnabled(r)||"auto"===t.level){const i=new Date,{writeHead:s}=o;e._logging=!0,o.writeHead=(e,t)=>{o.writeHead=s,o.writeHead(e,t),o.__statusCode=e,o.__headers=t||{}};let a=!1;const c=()=>{if(a)return;if(a=!0,"function"==typeof t.nolog&&!0===t.nolog(e,o))return void(e._logging=!1);o.responseTime=new Date-i,o.statusCode&&"auto"===t.level&&(r=Ai.INFO,o.statusCode>=300&&(r=Ai.WARN),o.statusCode>=400&&(r=Ai.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ai.getLevel(t.level,r))}return r}(o.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:vi(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eSi(e,s)));t&&n.log(r,t)}else n.log(r,Si(u,s));t.context&&n.removeContext("res")};o.on("end",c),o.on("finish",c),o.on("error",c),o.on("close",c)}return i()}},Hi=Bi;let Gi=!1;function Vi(e){if(!Gi)return;xi("Received log event ",e);Mi.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function Ji(e){Gi&&Ui();let t=e;return"string"==typeof t&&(t=function(e){xi(`Loading configuration from ${e}`);try{return JSON.parse(Pi.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),xi(`Configuration is ${t}`),Ni.configure(Ii(t)),ji.onMessage(Vi),Gi=!0,Wi}function Ui(e=(()=>{})){if("function"!=typeof e)throw new TypeError("Invalid callback passed to shutdown");xi("Shutdown called. Disabling all log writing."),Gi=!1;const t=Array.from(Ri.values());Ri.init(),Mi.init();const n=t.reduce(((e,t)=>t.shutdown?e+1:e),0);0===n&&(xi("No appenders with shutdown functions found."),e());let r,u=0;function o(t){r=r||t,u+=1,xi(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(xi("All shutdown functions completed."),e(r))}xi(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o)))}const Wi={getLogger:function(e){return Gi||Ji(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Li(e||"default")},configure:Ji,shutdown:Ui,connectLogger:$i,levels:ki,addLayout:Ti.addLayout,recording:function(){return Hi}};var zi=Wi;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.addCustomPLlugin=e.addCustomTask=e.hvigorTrace=void 0;const t=zi;e.hvigorTrace={totalTime:0,moduleNum:0,taskTime:{},isIncremental:!0,hasIncremental:!1,isParallel:!0,IS_DAEMON:!0,LOG_LEVEL:t.levels.INFO.levelStr,IS_HVIGORFILE_TYPE_CHECK:!1},e.addCustomTask=function(t){var n;let r=null!==(n=e.hvigorTrace.CUSTOM_TASKS)&&void 0!==n?n:[];r.length>0&&(r=r.filter((e=>e.NAME!==t.NAME))),r.push(t),e.hvigorTrace.CUSTOM_TASKS=r},e.addCustomPLlugin=function(t){var n;let r=null!==(n=e.hvigorTrace.CUSTOM_PLUGINS)&&void 0!==n?n:[];r.length>0&&(r=r.filter((e=>e.PLUGIN_ID!==t.PLUGIN_ID))),r.push({PLUGIN_ID:t.PLUGIN_ID}),e.hvigorTrace.CUSTOM_PLUGINS=r}}(j);var Ki={};!function(e){var t=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.hashFile=e.hash=e.createHash=void 0;const r=t(d),u=t(n);e.createHash=(e="MD5")=>r.default.createHash(e);e.hash=(t,n)=>(0,e.createHash)(n).update(t).digest("hex");e.hashFile=(t,n)=>{if(u.default.existsSync(t))return(0,e.hash)(u.default.readFileSync(t,"utf-8"),n)}}(Ki);var qi={},Yi={},Zi={};Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.Unicode=void 0;class Xi{}Zi.Unicode=Xi,Xi.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Xi.ID_START=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Xi.ID_CONTINUE=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.JudgeUtil=void 0;const Qi=Zi;Yi.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&Qi.Unicode.SPACE_SEPARATOR.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||Qi.Unicode.ID_START.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||Qi.Unicode.ID_CONTINUE.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var es=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qi,"__esModule",{value:!0}),qi.parseJsonText=qi.parseJsonFile=void 0;const ts=es(n),ns=es(t),rs=es(e),us=Yi;var os;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(os||(os={}));let is,ss,as,cs,ls,fs,Ds="start",ds=[],ps=0,Es=1,hs=0,Cs=!1,ms="default",Fs="'",ys=1;function gs(e,t=!1){ss=String(e),Ds="start",ds=[],ps=0,Es=1,hs=0,cs=void 0,Cs=t;do{is=As(),Bs[Ds]()}while("eof"!==is.type);return cs}function As(){for(ms="default",ls="",Fs="'",ys=1;;){fs=vs();const e=ws[ms]();if(e)return e}}function vs(){if(ss[ps])return String.fromCodePoint(ss.codePointAt(ps))}function Ss(){const e=vs();return"\n"===e?(Es++,hs=0):e?hs+=e.length:hs++,e&&(ps+=e.length),e}qi.parseJsonFile=function(e,t=!1,n="utf-8"){const r=ts.default.readFileSync(rs.default.resolve(e),{encoding:n});try{return gs(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");if(2===n.length)throw new Error(`${n[0].trim()}${ns.default.EOL}\t at ${e}:${n[1].trim()}`)}throw new Error(`${e} is not in valid JSON/JSON5 format.`)}},qi.parseJsonText=gs;const ws={default(){switch(fs){case"/":return Ss(),void(ms="comment");case void 0:return Ss(),Os("eof")}if(!us.JudgeUtil.isIgnoreChar(fs)&&!us.JudgeUtil.isSpaceSeparator(fs))return ws[Ds]();Ss()},start(){ms="value"},beforePropertyName(){switch(fs){case"$":case"_":return ls=Ss(),void(ms="identifierName");case"\\":return Ss(),void(ms="identifierNameStartEscape");case"}":return Os("punctuator",Ss());case'"':case"'":return Fs=fs,Ss(),void(ms="string")}if(us.JudgeUtil.isIdStartChar(fs))return ls+=Ss(),void(ms="identifierName");throw Ns(os.Char,Ss())},afterPropertyName(){if(":"===fs)return Os("punctuator",Ss());throw Ns(os.Char,Ss())},beforePropertyValue(){ms="value"},afterPropertyValue(){switch(fs){case",":case"}":return Os("punctuator",Ss())}throw Ns(os.Char,Ss())},beforeArrayValue(){if("]"===fs)return Os("punctuator",Ss());ms="value"},afterArrayValue(){switch(fs){case",":case"]":return Os("punctuator",Ss())}throw Ns(os.Char,Ss())},end(){throw Ns(os.Char,Ss())},comment(){switch(fs){case"*":return Ss(),void(ms="multiLineComment");case"/":return Ss(),void(ms="singleLineComment")}throw Ns(os.Char,Ss())},multiLineComment(){switch(fs){case"*":return Ss(),void(ms="multiLineCommentAsterisk");case void 0:throw Ns(os.Char,Ss())}Ss()},multiLineCommentAsterisk(){switch(fs){case"*":return void Ss();case"/":return Ss(),void(ms="default");case void 0:throw Ns(os.Char,Ss())}Ss(),ms="multiLineComment"},singleLineComment(){switch(fs){case"\n":case"\r":case"\u2028":case"\u2029":return Ss(),void(ms="default");case void 0:return Ss(),Os("eof")}Ss()},value(){switch(fs){case"{":case"[":return Os("punctuator",Ss());case"n":return Ss(),_s("ull"),Os("null",null);case"t":return Ss(),_s("rue"),Os("boolean",!0);case"f":return Ss(),_s("alse"),Os("boolean",!1);case"-":case"+":return"-"===Ss()&&(ys=-1),void(ms="numerical");case".":case"0":case"I":case"N":return void(ms="numerical");case'"':case"'":return Fs=fs,Ss(),ls="",void(ms="string")}if(void 0===fs||!us.JudgeUtil.isDigitWithoutZero(fs))throw Ns(os.Char,Ss());ms="numerical"},numerical(){switch(fs){case".":return ls=Ss(),void(ms="decimalPointLeading");case"0":return ls=Ss(),void(ms="zero");case"I":return Ss(),_s("nfinity"),Os("numeric",ys*(1/0));case"N":return Ss(),_s("aN"),Os("numeric",NaN)}if(void 0!==fs&&us.JudgeUtil.isDigitWithoutZero(fs))return ls=Ss(),void(ms="decimalInteger");throw Ns(os.Char,Ss())},zero(){switch(fs){case".":case"e":case"E":return void(ms="decimal");case"x":case"X":return ls+=Ss(),void(ms="hexadecimal")}return Os("numeric",0)},decimalInteger(){switch(fs){case".":case"e":case"E":return void(ms="decimal")}if(!us.JudgeUtil.isDigit(fs))return Os("numeric",ys*Number(ls));ls+=Ss()},decimal(){switch(fs){case".":ls+=Ss(),ms="decimalFraction";break;case"e":case"E":ls+=Ss(),ms="decimalExponent"}},decimalPointLeading(){if(us.JudgeUtil.isDigit(fs))return ls+=Ss(),void(ms="decimalFraction");throw Ns(os.Char,Ss())},decimalFraction(){switch(fs){case"e":case"E":return ls+=Ss(),void(ms="decimalExponent")}if(!us.JudgeUtil.isDigit(fs))return Os("numeric",ys*Number(ls));ls+=Ss()},decimalExponent(){switch(fs){case"+":case"-":return ls+=Ss(),void(ms="decimalExponentSign")}if(us.JudgeUtil.isDigit(fs))return ls+=Ss(),void(ms="decimalExponentInteger");throw Ns(os.Char,Ss())},decimalExponentSign(){if(us.JudgeUtil.isDigit(fs))return ls+=Ss(),void(ms="decimalExponentInteger");throw Ns(os.Char,Ss())},decimalExponentInteger(){if(!us.JudgeUtil.isDigit(fs))return Os("numeric",ys*Number(ls));ls+=Ss()},hexadecimal(){if(us.JudgeUtil.isHexDigit(fs))return ls+=Ss(),void(ms="hexadecimalInteger");throw Ns(os.Char,Ss())},hexadecimalInteger(){if(!us.JudgeUtil.isHexDigit(fs))return Os("numeric",ys*Number(ls));ls+=Ss()},identifierNameStartEscape(){if("u"!==fs)throw Ns(os.Char,Ss());Ss();const e=bs();switch(e){case"$":case"_":break;default:if(!us.JudgeUtil.isIdStartChar(e))throw Ns(os.Identifier)}ls+=e,ms="identifierName"},identifierName(){switch(fs){case"$":case"_":case"":case"":return void(ls+=Ss());case"\\":return Ss(),void(ms="identifierNameEscape")}if(!us.JudgeUtil.isIdContinueChar(fs))return Os("identifier",ls);ls+=Ss()},identifierNameEscape(){if("u"!==fs)throw Ns(os.Char,Ss());Ss();const e=bs();switch(e){case"$":case"_":case"":case"":break;default:if(!us.JudgeUtil.isIdContinueChar(e))throw Ns(os.Identifier)}ls+=e,ms="identifierName"},string(){switch(fs){case"\\":return Ss(),void(ls+=function(){const e=vs(),t=function(){switch(vs()){case"b":return Ss(),"\b";case"f":return Ss(),"\f";case"n":return Ss(),"\n";case"r":return Ss(),"\r";case"t":return Ss(),"\t";case"v":return Ss(),"\v"}return}();if(t)return t;switch(e){case"0":if(Ss(),us.JudgeUtil.isDigit(vs()))throw Ns(os.Char,Ss());return"\0";case"x":return Ss(),function(){let e="",t=vs();if(!us.JudgeUtil.isHexDigit(t))throw Ns(os.Char,Ss());if(e+=Ss(),t=vs(),!us.JudgeUtil.isHexDigit(t))throw Ns(os.Char,Ss());return e+=Ss(),String.fromCodePoint(parseInt(e,16))}();case"u":return Ss(),bs();case"\n":case"\u2028":case"\u2029":return Ss(),"";case"\r":return Ss(),"\n"===vs()&&Ss(),""}if(void 0===e||us.JudgeUtil.isDigitWithoutZero(e))throw Ns(os.Char,Ss());return Ss()}());case'"':case"'":if(fs===Fs){const e=Os("string",ls);return Ss(),e}return void(ls+=Ss());case"\n":case"\r":case void 0:throw Ns(os.Char,Ss());case"\u2028":case"\u2029":!function(e){console.warn(`JSON5: '${Is(e)}' in strings is not valid ECMAScript; consider escaping.`)}(fs)}ls+=Ss()}};function Os(e,t){return{type:e,value:t,line:Es,column:hs}}function _s(e){for(const t of e){if(vs()!==t)throw Ns(os.Char,Ss());Ss()}}function bs(){let e="",t=4;for(;t-- >0;){const t=vs();if(!us.JudgeUtil.isHexDigit(t))throw Ns(os.Char,Ss());e+=Ss()}return String.fromCodePoint(parseInt(e,16))}const Bs={start(){if("eof"===is.type)throw Ns(os.EOF);xs()},beforePropertyName(){switch(is.type){case"identifier":case"string":return as=is.value,void(Ds="afterPropertyName");case"punctuator":return void Ps();case"eof":throw Ns(os.EOF)}},afterPropertyName(){if("eof"===is.type)throw Ns(os.EOF);Ds="beforePropertyValue"},beforePropertyValue(){if("eof"===is.type)throw Ns(os.EOF);xs()},afterPropertyValue(){if("eof"===is.type)throw Ns(os.EOF);switch(is.value){case",":return void(Ds="beforePropertyName");case"}":Ps()}},beforeArrayValue(){if("eof"===is.type)throw Ns(os.EOF);"punctuator"!==is.type||"]"!==is.value?xs():Ps()},afterArrayValue(){if("eof"===is.type)throw Ns(os.EOF);switch(is.value){case",":return void(Ds="beforeArrayValue");case"]":Ps()}},end(){}};function xs(){const e=function(){let e;switch(is.type){case"punctuator":switch(is.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=is.value}return e}();if(Cs&&"object"==typeof e&&(e._line=Es,e._column=hs),void 0===cs)cs=e;else{const t=ds[ds.length-1];Array.isArray(t)?Cs&&"object"!=typeof e?t.push({value:e,_line:Es,_column:hs}):t.push(e):t[as]=Cs&&"object"!=typeof e?{value:e,_line:Es,_column:hs}:e}!function(e){if(e&&"object"==typeof e)ds.push(e),Ds=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=ds[ds.length-1];Ds=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ps(){ds.pop();const e=ds[ds.length-1];Ds=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function Is(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function Ns(e,t){let n="";switch(e){case os.Char:n=void 0===t?`JSON5: invalid end of input at ${Es}:${hs}`:`JSON5: invalid character '${Is(t)}' at ${Es}:${hs}`;break;case os.EOF:n=`JSON5: invalid end of input at ${Es}:${hs}`;break;case os.Identifier:hs-=5,n=`JSON5: invalid identifier character at ${Es}:${hs}`}const r=new Ts(n);return r.lineNumber=Es,r.columnNumber=hs,r}class Ts extends SyntaxError{}var ks={},Rs=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),Ms=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ls=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Rs(t,e,n);return Ms(t,e),t},js=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.isFileExists=ks.offlinePluginConversion=ks.executeCommand=ks.getNpmPath=ks.hasNpmPackInPaths=void 0;const $s=r,Hs=js(n),Gs=Ls(e),Vs=E,Js=S;ks.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},ks.getNpmPath=function(){const e=process.execPath;return Gs.join(Gs.dirname(e),Vs.NPM_TOOL)},ks.executeCommand=function(e,t,n){0!==(0,$s.spawnSync)(e,t,n).status&&(0,Js.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},ks.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?Gs.resolve(e,Vs.HVIGOR,t.replace("file:","")):t},ks.isFileExists=function(e){return Hs.default.existsSync(e)&&Hs.default.statSync(e).isFile()};var Us={};!function(u){var o=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},a=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u,"__esModule",{value:!0}),u.executeInstallPnpm=u.isPnpmInstalled=u.environmentHandler=u.checkNpmConifg=u.PNPM_VERSION=void 0;const c=r,l=s(n),f=a(t),D=s(e),d=E,h=S,C=ks;u.PNPM_VERSION="7.30.0",u.checkNpmConifg=function(){const e=D.resolve(d.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=D.resolve(f.default.homedir(),".npmrc");if((0,C.isFileExists)(e)||(0,C.isFileExists)(t))return;const n=(0,C.getNpmPath)(),r=(0,c.spawnSync)(n,["config","get","prefix"],{cwd:d.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,h.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=D.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,C.isFileExists)(u)||(0,h.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},u.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},u.isPnpmInstalled=function(){return!!l.existsSync(d.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,C.hasNpmPackInPaths)("pnpm",[d.HVIGOR_WRAPPER_TOOLS_HOME])},u.executeInstallPnpm=function(){(0,h.logInfo)(`Installing pnpm@${u.PNPM_VERSION}...`);const e=(0,C.getNpmPath)();!function(){const e=D.resolve(d.HVIGOR_WRAPPER_TOOLS_HOME,d.DEFAULT_PACKAGE_JSON);try{l.existsSync(d.HVIGOR_WRAPPER_TOOLS_HOME)||l.mkdirSync(d.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const t={dependencies:{}};t.dependencies[d.PNPM]=u.PNPM_VERSION,l.writeFileSync(e,JSON.stringify(t))}catch(t){(0,h.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${e} failed.`)}}(),(0,C.executeCommand)(e,["install","pnpm"],{cwd:d.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,h.logInfo)("Pnpm install success.")}}(Us);var Ws=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),zs=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ks=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Ws(t,e,n);return zs(t,e),t},qs=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L,"__esModule",{value:!0});var Ys=L.initProjectWorkSpace=void 0;const Zs=Ks(n),Xs=qs(t),Qs=Ks(e),ea=qs(u),ta=j,na=E,ra=Ki,ua=qi,oa=S,ia=ks,sa=Us;let aa,ca,la;function fa(e,t,n){return void 0!==n.dependencies&&(0,ia.offlinePluginConversion)(na.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===Qs.normalize(n.dependencies[e])}Ys=L.initProjectWorkSpace=function(){if(aa=function(){const e=Qs.resolve(na.HVIGOR_PROJECT_WRAPPER_HOME,na.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);Zs.existsSync(e)||(0,oa.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`);return(0,ua.parseJsonFile)(e)}(),la=function(e){let t;t=function(e){const t=e.hvigorVersion;if(t.startsWith("file:")||t.endsWith(".tgz"))return!1;const n=e.dependencies,r=Object.getOwnPropertyNames(n);for(const e of r){const t=n[e];if(t.startsWith("file:")||t.endsWith(".tgz"))return!1}if(1===r.length&&"@ohos/hvigor-ohos-plugin"===r[0])return t>"2.5.0";return!1}(e)?function(e){let t=`${na.HVIGOR_ENGINE_PACKAGE_NAME}@${e.hvigorVersion}`;const n=e.dependencies;if(n){Object.getOwnPropertyNames(n).sort().forEach((e=>{t+=`,${e}@${n[e]}`}))}return(0,ra.hash)(t)}(e):(0,ra.hash)(ea.default.cwd());return Qs.resolve(Xs.default.homedir(),".hvigor","project_caches",t)}(aa),ca=function(){const e=Qs.resolve(la,na.WORK_SPACE,na.DEFAULT_PACKAGE_JSON);return Zs.existsSync(e)?(0,ua.parseJsonFile)(e):{dependencies:{}}}(),function(){const e=Qs.resolve(na.HVIGOR_USER_HOME,na.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(Zs.existsSync(e))(0,ua.parseJsonFile)(e)}(),!(0,ia.hasNpmPackInPaths)(na.HVIGOR_ENGINE_PACKAGE_NAME,[Qs.join(la,na.WORK_SPACE)])||(0,ia.offlinePluginConversion)(na.HVIGOR_PROJECT_ROOT_DIR,aa.hvigorVersion)!==ca.dependencies[na.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}const t=e(aa),n=e(ca);if(t+1!==n)return!1;for(const e in null==aa?void 0:aa.dependencies)if(!(0,ia.hasNpmPackInPaths)(e,[Qs.join(la,na.WORK_SPACE)])||!fa(e,aa,ca))return!1;return!0}())try{const e=ea.default.hrtime();(0,sa.checkNpmConifg)(),function(){(0,oa.logInfo)("Hvigor installing...");for(const e in aa.dependencies)aa.dependencies[e]&&(aa.dependencies[e]=(0,ia.offlinePluginConversion)(na.HVIGOR_PROJECT_ROOT_DIR,aa.dependencies[e]));const e={dependencies:{...aa.dependencies}};e.dependencies[na.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ia.offlinePluginConversion)(na.HVIGOR_PROJECT_ROOT_DIR,aa.hvigorVersion);const t=Qs.join(la,na.WORK_SPACE);try{Zs.mkdirSync(t,{recursive:!0});const n=Qs.resolve(t,na.DEFAULT_PACKAGE_JSON);Zs.writeFileSync(n,JSON.stringify(e))}catch(e){(0,oa.logErrorAndExit)(e)}(function(){const e=["config","set","store-dir",na.HVIGOR_PNPM_STORE_PATH],t={cwd:Qs.join(la,na.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,ia.executeCommand)(na.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,t)})(),function(){const e=["install"],t={cwd:Qs.join(la,na.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,ia.executeCommand)(na.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,t)}(),(0,oa.logInfo)("Hvigor install success.")}();const t=ea.default.hrtime(e);ta.hvigorTrace.HVIGOR_INSTALL_TIME=1e9*t[0]+t[1]}catch(e){!function(){const e=Qs.join(la,na.WORK_SPACE);if((0,oa.logInfo)("Hvigor cleaning..."),!Zs.existsSync(e))return;const t=Zs.readdirSync(e);if(!t||0===t.length)return;const n=Qs.resolve(la,"node_modules","@ohos","hvigor","bin","hvigor.js");Zs.existsSync(n)&&(0,ia.executeCommand)(ea.default.argv[0],[n,"--stop-daemon"],{});try{t.forEach((t=>{Zs.rmSync(Qs.resolve(e,t),{recursive:!0})}))}catch(t){(0,oa.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${e}.`)}}()}return la},function(){Us.environmentHandler(),Us.isPnpmInstalled()||(Us.checkNpmConifg(),Us.executeInstallPnpm());const t=Ys();b(e.join(t,E.WORK_SPACE))}();
\ No newline at end of file
diff --git a/example/ohos/hvigorfile.ts b/example/ohos/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..69a097075892c059c8494a43530d8a3d8be7edf9
--- /dev/null
+++ b/example/ohos/hvigorfile.ts
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+import { appTasks } from '@ohos/hvigor-ohos-plugin';
+
+export default {
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
+}
\ No newline at end of file
diff --git a/example/ohos/hvigorw b/example/ohos/hvigorw
new file mode 100644
index 0000000000000000000000000000000000000000..b41365001a5c032cdf23a49a95729bdedb34c314
--- /dev/null
+++ b/example/ohos/hvigorw
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+# 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.
+
+# ----------------------------------------------------------------------------
+# Hvigor startup script, version 1.0.0
+#
+# Required ENV vars:
+# ------------------
+# NODE_HOME - location of a Node home dir
+# or
+# Add /usr/local/nodejs/bin to the PATH environment variable
+# ----------------------------------------------------------------------------
+
+HVIGOR_APP_HOME=$(dirname $(readlink -f $0))
+HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js
+warn() {
+ echo ""
+ echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
+}
+
+error() {
+ echo ""
+ echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
+}
+
+fail() {
+ error "$@"
+ exit 1
+}
+
+# Determine node to start hvigor wrapper script
+if [ -n "${NODE_HOME}" ];then
+ EXECUTABLE_NODE="${NODE_HOME}/bin/node"
+ if [ ! -x "$EXECUTABLE_NODE" ];then
+ fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed"
+ fi
+else
+ EXECUTABLE_NODE="node"
+ which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path"
+fi
+
+# Check hvigor wrapper script
+if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then
+ fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}"
+fi
+
+# start hvigor-wrapper script
+exec "${EXECUTABLE_NODE}" \
+ "${HVIGOR_WRAPPER_SCRIPT}" "$@"
diff --git a/example/ohos/hvigorw.bat b/example/ohos/hvigorw.bat
new file mode 100644
index 0000000000000000000000000000000000000000..b40d9a1fe223eaec537c10bae9b889d163d1e79d
--- /dev/null
+++ b/example/ohos/hvigorw.bat
@@ -0,0 +1,77 @@
+:: Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+:: 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.
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Hvigor startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
+set NODE_EXE=node.exe
+
+goto start
+
+:start
+@rem Find node.exe
+if defined NODE_HOME goto findNodeFromNodeHome
+
+%NODE_EXE% --version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
+echo.
+echo Please set the NODE_HOME variable in your environment to match the
+echo location of your NodeJs installation.
+
+goto fail
+
+:findNodeFromNodeHome
+set NODE_HOME=%NODE_HOME:"=%
+set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
+
+if exist "%NODE_EXE_PATH%" goto execute
+echo.
+echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
+echo.
+echo Please set the NODE_HOME variable in your environment to match the
+echo location of your NodeJs installation.
+
+goto fail
+
+:execute
+@rem Execute hvigor
+"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
+
+if "%ERRORLEVEL%" == "0" goto hvigorwEnd
+
+:fail
+exit /b 1
+
+:hvigorwEnd
+if "%OS%" == "Windows_NT" endlocal
+
+:end
diff --git a/example/ohos/oh-package.json5 b/example/ohos/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..92f8a576a414e7a8388680bb05cb6486c5e55f6a
--- /dev/null
+++ b/example/ohos/oh-package.json5
@@ -0,0 +1,17 @@
+{
+ "name": "catcher_example",
+ "version": "1.0.0",
+ "description": "Please describe the basic information.",
+ "main": "",
+ "author": "",
+ "license": "",
+ "dependencies": {
+ "@ohos/flutter_ohos": "file:./har/flutter.har"
+ },
+ "devDependencies": {
+ "@ohos/hypium": "1.0.6"
+ },
+ "overrides": {
+ "@ohos/flutter_ohos": "file:./har/flutter.har"
+ }
+}
\ No newline at end of file
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 2d8ffbf527618712a1d80d1f8f015a144806924d..eeb5a370cd2a18e16a78fc7e2b459d0b49e89705 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -25,15 +25,17 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
- path_provider: ^2.0.1
+ path_provider:
+ git:
+ url: "https://gitee.com/openharmony-sig/flutter_packages.git"
+ path: "packages/path_provider/path_provider"
path_provider_macos: ^2.0.0
- dio: ^5.3.3
- permission_handler: ^11.0.1
- flutter_local_notifications: ^16.1.0
- sentry: ^7.12.0
- catcher:
- path: ../
-
+ dio: ^4.0.0
+ flutter_local_notifications: ^9.0.0
+ permission_handler:
+ git:
+ url: "https://gitee.com/openharmony-sig/flutter_permission_handler.git"
+ path: "permission_handler"
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
@@ -42,6 +44,8 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
+ catcher:
+ path: ../
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
diff --git a/lib/catcher.dart b/lib/catcher.dart
index 342096aa35c4b55ca74702da172706807027c913..7c98cdbe93cf2b0551a61185385bc789fdad30ed 100644
--- a/lib/catcher.dart
+++ b/lib/catcher.dart
@@ -1,15 +1,17 @@
+library catcher;
+
export 'package:catcher/core/catcher.dart';
export 'package:catcher/core/catcher_screenshot.dart';
-export 'package:catcher/handlers/console_handler.dart';
-export 'package:catcher/handlers/discord_handler.dart';
-export 'package:catcher/handlers/email_auto_handler.dart';
-export 'package:catcher/handlers/email_manual_handler.dart';
-export 'package:catcher/handlers/file_handler.dart';
-export 'package:catcher/handlers/http_handler.dart';
-export 'package:catcher/handlers/sentry_handler.dart';
-export 'package:catcher/handlers/slack_handler.dart';
-export 'package:catcher/handlers/snackbar_handler.dart';
-export 'package:catcher/handlers/toast_handler.dart';
+export "package:catcher/handlers/console_handler.dart";
+export "package:catcher/handlers/discord_handler.dart";
+export "package:catcher/handlers/email_auto_handler.dart";
+export "package:catcher/handlers/email_manual_handler.dart";
+export "package:catcher/handlers/file_handler.dart";
+export "package:catcher/handlers/http_handler.dart";
+export "package:catcher/handlers/sentry_handler.dart";
+export "package:catcher/handlers/slack_handler.dart";
+export "package:catcher/handlers/snackbar_handler.dart";
+export "package:catcher/handlers/toast_handler.dart";
export 'package:catcher/mode/dialog_report_mode.dart';
export 'package:catcher/mode/page_report_mode.dart';
export 'package:catcher/mode/report_mode_action_confirmed.dart';
diff --git a/lib/catcher_web_plugin.dart b/lib/catcher_web_plugin.dart
index aacd1fbab561c5f55d51f5880c95e2a6092fab1e..12f8dc9dc1d4f3bc41eab7ea70e0efd7fdf1b269 100644
--- a/lib/catcher_web_plugin.dart
+++ b/lib/catcher_web_plugin.dart
@@ -1,12 +1,11 @@
import 'dart:async';
-
import 'package:flutter/services.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
/// A web implementation of the Catcher plugin.
class CatcherWebPlugin {
static void registerWith(Registrar registrar) {
- final channel = MethodChannel(
+ final MethodChannel channel = MethodChannel(
'catcher',
const StandardMethodCodec(),
registrar,
diff --git a/lib/core/application_profile_manager.dart b/lib/core/application_profile_manager.dart
index 361c2de88205da2a29ae30b5f3504923b036a91f..e4e153ed3fc2c21736485f11dcc79ad048266b00 100644
--- a/lib/core/application_profile_manager.dart
+++ b/lib/core/application_profile_manager.dart
@@ -36,4 +36,7 @@ class ApplicationProfileManager {
///Check if current platform is macOS
static bool isMacOS() => Platform.isMacOS;
+
+ ///Check if current platform is ohos
+ static bool isHarmonyOS() => Platform.operatingSystem == 'ohos';
}
diff --git a/lib/core/catcher.dart b/lib/core/catcher.dart
index dfd18da14deff05d3ef238419fd4aa1e4a53776a..e732795eb519aab40881bd544806cbd4b28a4318 100644
--- a/lib/core/catcher.dart
+++ b/lib/core/catcher.dart
@@ -41,8 +41,7 @@ class Catcher with ReportModeAction {
/// Should catcher logs be enabled
final bool enableLogger;
- /// Should catcher run WidgetsFlutterBinding.ensureInitialized() during
- /// initialization.
+ /// Should catcher run WidgetsFlutterBinding.ensureInitialized() during initialization.
final bool ensureInitialized;
late CatcherOptions _currentConfig;
@@ -51,7 +50,7 @@ class Catcher with ReportModeAction {
final Map _deviceParameters = {};
final Map _applicationParameters = {};
final List _cachedReports = [];
- final Map _reportsOccurrenceMap = {};
+ final Map _reportsOcurrenceMap = {};
LocalizationOptions? _localizationOptions;
/// Instance of navigator key
@@ -71,7 +70,7 @@ class Catcher with ReportModeAction {
GlobalKey? navigatorKey,
}) : assert(
rootWidget != null || runAppFunction != null,
- 'You need to provide rootWidget or runAppFunction',
+ "You need to provide rootWidget or runAppFunction",
) {
_configure(navigatorKey);
}
@@ -90,11 +89,11 @@ class Catcher with ReportModeAction {
if (_currentConfig.handlers.isEmpty) {
_logger.warning(
- 'Handlers list is empty. Configure at least one handler to '
- 'process error reports.',
+ "Handlers list is empty. Configure at least one handler to "
+ "process error reports.",
);
} else {
- _logger.fine('Catcher configured successfully.');
+ _logger.fine("Catcher configured successfully.");
}
}
@@ -184,13 +183,9 @@ class Catcher with ReportModeAction {
});
}
- Future _setupErrorHooks() async {
+ Future _setupErrorHooks() async {
FlutterError.onError = (FlutterErrorDetails details) async {
- await _reportError(
- details.exception,
- details.stack,
- errorDetails: details,
- );
+ _reportError(details.exception, details.stack, errorDetails: details);
};
///Web doesn't have Isolate error listener support
@@ -198,7 +193,7 @@ class Catcher with ReportModeAction {
Isolate.current.addErrorListener(
RawReceivePort((dynamic pair) async {
final isolateError = pair as List;
- await _reportError(
+ _reportError(
isolateError.first.toString(),
isolateError.last.toString(),
);
@@ -215,20 +210,19 @@ class Catcher with ReportModeAction {
runAppFunction!();
});
} else {
- throw ArgumentError('Provide rootWidget or runAppFunction to Catcher.');
+ throw ArgumentError("Provide rootWidget or runAppFunction to Catcher.");
}
}
void _runZonedGuarded(void Function() callback) {
- runZonedGuarded>(
- () async {
- if (ensureInitialized) {
- WidgetsFlutterBinding.ensureInitialized();
- }
- callback();
- },
- _reportError,
- );
+ runZonedGuarded>(() async {
+ if (ensureInitialized) {
+ WidgetsFlutterBinding.ensureInitialized();
+ }
+ callback();
+ }, (dynamic error, StackTrace stackTrace) {
+ _reportError(error, stackTrace);
+ });
}
void _configureLogger() {
@@ -247,7 +241,7 @@ class Catcher with ReportModeAction {
}
void _loadDeviceInfo() {
- final deviceInfo = DeviceInfoPlugin();
+ final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
if (ApplicationProfileManager.isWeb()) {
deviceInfo.webBrowserInfo.then((webBrowserInfo) {
_loadWebParameters(webBrowserInfo);
@@ -278,6 +272,11 @@ class Catcher with ReportModeAction {
_loadIosParameters(iosInfo);
_removeExcludedParameters();
});
+ } else if (ApplicationProfileManager.isHarmonyOS()) {
+ deviceInfo.ohosInfo.then((ohosInfo) {
+ _loadOhosParameters(ohosInfo);
+ _removeExcludedParameters();
+ });
} else {
_logger.info("Couldn't load device info for unsupported device type.");
}
@@ -285,147 +284,191 @@ class Catcher with ReportModeAction {
///Remove excluded parameters from device parameters.
void _removeExcludedParameters() {
- _currentConfig.excludedParameters.forEach(_deviceParameters.remove);
+ _currentConfig.excludedParameters.forEach((parameter) {
+ _deviceParameters.remove(parameter);
+ });
}
void _loadLinuxParameters(LinuxDeviceInfo linuxDeviceInfo) {
try {
- _deviceParameters['name'] = linuxDeviceInfo.name;
- _deviceParameters['version'] = linuxDeviceInfo.version;
- _deviceParameters['id'] = linuxDeviceInfo.id;
- _deviceParameters['idLike'] = linuxDeviceInfo.idLike;
- _deviceParameters['versionCodename'] = linuxDeviceInfo.versionCodename;
- _deviceParameters['versionId'] = linuxDeviceInfo.versionId;
- _deviceParameters['prettyName'] = linuxDeviceInfo.prettyName;
- _deviceParameters['buildId'] = linuxDeviceInfo.buildId;
- _deviceParameters['variant'] = linuxDeviceInfo.variant;
- _deviceParameters['variantId'] = linuxDeviceInfo.variantId;
- _deviceParameters['machineId'] = linuxDeviceInfo.machineId;
+ _deviceParameters["name"] = linuxDeviceInfo.name;
+ _deviceParameters["version"] = linuxDeviceInfo.version;
+ _deviceParameters["id"] = linuxDeviceInfo.id;
+ _deviceParameters["idLike"] = linuxDeviceInfo.idLike;
+ _deviceParameters["versionCodename"] = linuxDeviceInfo.versionCodename;
+ _deviceParameters["versionId"] = linuxDeviceInfo.versionId;
+ _deviceParameters["prettyName"] = linuxDeviceInfo.prettyName;
+ _deviceParameters["buildId"] = linuxDeviceInfo.buildId;
+ _deviceParameters["variant"] = linuxDeviceInfo.variant;
+ _deviceParameters["variantId"] = linuxDeviceInfo.variantId;
+ _deviceParameters["machineId"] = linuxDeviceInfo.machineId;
} catch (exception) {
- _logger.warning('Load Linux parameters failed: $exception');
+ _logger.warning("Load Linux parameters failed: $exception");
}
}
void _loadMacOSParameters(MacOsDeviceInfo macOsDeviceInfo) {
try {
- _deviceParameters['computerName'] = macOsDeviceInfo.computerName;
- _deviceParameters['hostName'] = macOsDeviceInfo.hostName;
- _deviceParameters['arch'] = macOsDeviceInfo.arch;
- _deviceParameters['model'] = macOsDeviceInfo.model;
- _deviceParameters['kernelVersion'] = macOsDeviceInfo.kernelVersion;
- _deviceParameters['osRelease'] = macOsDeviceInfo.osRelease;
- _deviceParameters['activeCPUs'] = macOsDeviceInfo.activeCPUs;
- _deviceParameters['memorySize'] = macOsDeviceInfo.memorySize;
- _deviceParameters['cpuFrequency'] = macOsDeviceInfo.cpuFrequency;
+ _deviceParameters["computerName"] = macOsDeviceInfo.computerName;
+ _deviceParameters["hostName"] = macOsDeviceInfo.hostName;
+ _deviceParameters["arch"] = macOsDeviceInfo.arch;
+ _deviceParameters["model"] = macOsDeviceInfo.model;
+ _deviceParameters["kernelVersion"] = macOsDeviceInfo.kernelVersion;
+ _deviceParameters["osRelease"] = macOsDeviceInfo.osRelease;
+ _deviceParameters["activeCPUs"] = macOsDeviceInfo.activeCPUs;
+ _deviceParameters["memorySize"] = macOsDeviceInfo.memorySize;
+ _deviceParameters["cpuFrequency"] = macOsDeviceInfo.cpuFrequency;
} catch (exception) {
- _logger.warning('Load MacOS parameters failed: $exception');
+ _logger.warning("Load MacOS parameters failed: $exception");
}
}
void _loadWindowsParameters(WindowsDeviceInfo windowsDeviceInfo) {
try {
- _deviceParameters['computerName'] = windowsDeviceInfo.computerName;
- _deviceParameters['numberOfCores'] = windowsDeviceInfo.numberOfCores;
- _deviceParameters['systemMemoryInMegabytes'] =
+ _deviceParameters["computerName"] = windowsDeviceInfo.computerName;
+ _deviceParameters["numberOfCores"] = windowsDeviceInfo.numberOfCores;
+ _deviceParameters["systemMemoryInMegabytes"] =
windowsDeviceInfo.systemMemoryInMegabytes;
} catch (exception) {
- _logger.warning('Load Windows parameters failed: $exception');
+ _logger.warning("Load Windows parameters failed: $exception");
}
}
- Future _loadWebParameters(WebBrowserInfo webBrowserInfo) async {
+ void _loadWebParameters(WebBrowserInfo webBrowserInfo) async {
try {
- _deviceParameters['language'] = webBrowserInfo.language;
- _deviceParameters['appCodeName'] = webBrowserInfo.appCodeName;
- _deviceParameters['appName'] = webBrowserInfo.appName;
- _deviceParameters['appVersion'] = webBrowserInfo.appVersion;
- _deviceParameters['browserName'] = webBrowserInfo.browserName.toString();
- _deviceParameters['deviceMemory'] = webBrowserInfo.deviceMemory;
- _deviceParameters['hardwareConcurrency'] =
+ _deviceParameters["language"] = webBrowserInfo.language;
+ _deviceParameters["appCodeName"] = webBrowserInfo.appCodeName;
+ _deviceParameters["appName"] = webBrowserInfo.appName;
+ _deviceParameters["appVersion"] = webBrowserInfo.appVersion;
+ _deviceParameters["browserName"] = webBrowserInfo.browserName.toString();
+ _deviceParameters["deviceMemory"] = webBrowserInfo.deviceMemory;
+ _deviceParameters["hardwareConcurrency"] =
webBrowserInfo.hardwareConcurrency;
- _deviceParameters['languages'] = webBrowserInfo.languages;
- _deviceParameters['maxTouchPoints'] = webBrowserInfo.maxTouchPoints;
- _deviceParameters['platform'] = webBrowserInfo.platform;
- _deviceParameters['product'] = webBrowserInfo.product;
- _deviceParameters['productSub'] = webBrowserInfo.productSub;
- _deviceParameters['userAgent'] = webBrowserInfo.userAgent;
- _deviceParameters['vendor'] = webBrowserInfo.vendor;
- _deviceParameters['vendorSub'] = webBrowserInfo.vendorSub;
+ _deviceParameters["languages"] = webBrowserInfo.languages;
+ _deviceParameters["maxTouchPoints"] = webBrowserInfo.maxTouchPoints;
+ _deviceParameters["platform"] = webBrowserInfo.platform;
+ _deviceParameters["product"] = webBrowserInfo.product;
+ _deviceParameters["productSub"] = webBrowserInfo.productSub;
+ _deviceParameters["userAgent"] = webBrowserInfo.userAgent;
+ _deviceParameters["vendor"] = webBrowserInfo.vendor;
+ _deviceParameters["vendorSub"] = webBrowserInfo.vendorSub;
} catch (exception) {
- _logger.warning('Load Web parameters failed: $exception');
+ _logger.warning("Load Web parameters failed: $exception");
}
}
void _loadAndroidParameters(AndroidDeviceInfo androidDeviceInfo) {
try {
- _deviceParameters['id'] = androidDeviceInfo.id;
- // TODO(*): _deviceParameters['androidId'] = androidDeviceInfo.androidId;
- _deviceParameters['board'] = androidDeviceInfo.board;
- _deviceParameters['bootloader'] = androidDeviceInfo.bootloader;
- _deviceParameters['brand'] = androidDeviceInfo.brand;
- _deviceParameters['device'] = androidDeviceInfo.device;
- _deviceParameters['display'] = androidDeviceInfo.display;
- _deviceParameters['fingerprint'] = androidDeviceInfo.fingerprint;
- _deviceParameters['hardware'] = androidDeviceInfo.hardware;
- _deviceParameters['host'] = androidDeviceInfo.host;
- _deviceParameters['isPhysicalDevice'] =
+ _deviceParameters["id"] = androidDeviceInfo.id;
+ // TODO(*): _deviceParameters["androidId"] = androidDeviceInfo.androidId;
+ _deviceParameters["board"] = androidDeviceInfo.board;
+ _deviceParameters["bootloader"] = androidDeviceInfo.bootloader;
+ _deviceParameters["brand"] = androidDeviceInfo.brand;
+ _deviceParameters["device"] = androidDeviceInfo.device;
+ _deviceParameters["display"] = androidDeviceInfo.display;
+ _deviceParameters["fingerprint"] = androidDeviceInfo.fingerprint;
+ _deviceParameters["hardware"] = androidDeviceInfo.hardware;
+ _deviceParameters["host"] = androidDeviceInfo.host;
+ _deviceParameters["isPhysicalDevice"] =
androidDeviceInfo.isPhysicalDevice;
- _deviceParameters['manufacturer'] = androidDeviceInfo.manufacturer;
- _deviceParameters['model'] = androidDeviceInfo.model;
- _deviceParameters['product'] = androidDeviceInfo.product;
- _deviceParameters['tags'] = androidDeviceInfo.tags;
- _deviceParameters['type'] = androidDeviceInfo.type;
- _deviceParameters['versionBaseOs'] = androidDeviceInfo.version.baseOS;
- _deviceParameters['versionCodename'] = androidDeviceInfo.version.codename;
- _deviceParameters['versionIncremental'] =
+ _deviceParameters["manufacturer"] = androidDeviceInfo.manufacturer;
+ _deviceParameters["model"] = androidDeviceInfo.model;
+ _deviceParameters["product"] = androidDeviceInfo.product;
+ _deviceParameters["tags"] = androidDeviceInfo.tags;
+ _deviceParameters["type"] = androidDeviceInfo.type;
+ _deviceParameters["versionBaseOs"] = androidDeviceInfo.version.baseOS;
+ _deviceParameters["versionCodename"] = androidDeviceInfo.version.codename;
+ _deviceParameters["versionIncremental"] =
androidDeviceInfo.version.incremental;
- _deviceParameters['versionPreviewSdk'] =
+ _deviceParameters["versionPreviewSdk"] =
androidDeviceInfo.version.previewSdkInt;
- _deviceParameters['versionRelease'] = androidDeviceInfo.version.release;
- _deviceParameters['versionSdk'] = androidDeviceInfo.version.sdkInt;
- _deviceParameters['versionSecurityPatch'] =
+ _deviceParameters["versionRelease"] = androidDeviceInfo.version.release;
+ _deviceParameters["versionSdk"] = androidDeviceInfo.version.sdkInt;
+ _deviceParameters["versionSecurityPatch"] =
androidDeviceInfo.version.securityPatch;
} catch (exception) {
- _logger.warning('Load Android parameters failed: $exception');
+ _logger.warning("Load Android parameters failed: $exception");
+ }
+ }
+
+ void _loadOhosParameters(OhosDeviceInfo ohosDeviceInfo) {
+ try {
+ _deviceParameters["abiList"] = ohosDeviceInfo.abiList;
+ _deviceParameters["bootloaderVersion"] = ohosDeviceInfo.bootloaderVersion;
+ _deviceParameters["brand"] = ohosDeviceInfo.brand;
+ _deviceParameters["buildHost"] = ohosDeviceInfo.buildHost;
+ _deviceParameters["buildRootHash"] = ohosDeviceInfo.buildRootHash;
+ _deviceParameters["buildTime"] = ohosDeviceInfo.buildTime;
+ _deviceParameters["buildType"] = ohosDeviceInfo.buildType;
+ _deviceParameters["buildUser"] = ohosDeviceInfo.buildUser;
+ _deviceParameters["buildVersion"] = ohosDeviceInfo.buildVersion;
+ _deviceParameters["deviceType"] = ohosDeviceInfo.deviceType;
+ _deviceParameters["displayVersion"] = ohosDeviceInfo.displayVersion;
+ _deviceParameters["distributionOSApiVersion"] = ohosDeviceInfo.distributionOSApiVersion;
+ _deviceParameters["distributionOSName"] = ohosDeviceInfo.distributionOSName;
+ _deviceParameters["distributionOSReleaseType"] = ohosDeviceInfo.distributionOSReleaseType;
+ _deviceParameters["distributionOSVersion"] = ohosDeviceInfo.distributionOSVersion;
+ _deviceParameters["featureVersion"] = ohosDeviceInfo.featureVersion;
+ _deviceParameters["firstApiVersion"] = ohosDeviceInfo.firstApiVersion;
+ _deviceParameters["hardwareModel"] = ohosDeviceInfo.hardwareModel;
+ _deviceParameters["hardwareProfile"] = ohosDeviceInfo.hardwareProfile;
+ _deviceParameters["incrementalVersion"] = ohosDeviceInfo.incrementalVersion;
+ _deviceParameters["majorVersion"] = ohosDeviceInfo.majorVersion;
+ _deviceParameters["manufacture"] = ohosDeviceInfo.manufacture;
+ _deviceParameters["marketName"] = ohosDeviceInfo.marketName;
+ _deviceParameters["osFullName"] = ohosDeviceInfo.osFullName;
+ _deviceParameters["osReleaseType"] = ohosDeviceInfo.osReleaseType;
+ _deviceParameters["productModel"] = ohosDeviceInfo.productModel;
+ _deviceParameters["productSeries"] = ohosDeviceInfo.productSeries;
+ _deviceParameters["sdkApiVersion"] = ohosDeviceInfo.sdkApiVersion;
+ _deviceParameters["securityPatchTag"] = ohosDeviceInfo.securityPatchTag;
+ _deviceParameters["seniorVersion"] = ohosDeviceInfo.seniorVersion;
+ _deviceParameters["serial"] = ohosDeviceInfo.serial;
+ _deviceParameters["softwareModel"] = ohosDeviceInfo.softwareModel;
+ _deviceParameters["udid"] = ohosDeviceInfo.udid;
+ _deviceParameters["versionId"] = ohosDeviceInfo.versionId;
+ _deviceParameters["data"] = ohosDeviceInfo.data;
+ } catch (exception) {
+ _logger.warning("Load HarmonyOS parameters failed: $exception");
}
}
void _loadIosParameters(IosDeviceInfo iosInfo) {
try {
- _deviceParameters['model'] = iosInfo.model;
- _deviceParameters['isPhysicalDevice'] = iosInfo.isPhysicalDevice;
- _deviceParameters['name'] = iosInfo.name;
- _deviceParameters['identifierForVendor'] = iosInfo.identifierForVendor;
- _deviceParameters['localizedModel'] = iosInfo.localizedModel;
- _deviceParameters['systemName'] = iosInfo.systemName;
- _deviceParameters['utsnameVersion'] = iosInfo.utsname.version;
- _deviceParameters['utsnameRelease'] = iosInfo.utsname.release;
- _deviceParameters['utsnameMachine'] = iosInfo.utsname.machine;
- _deviceParameters['utsnameNodename'] = iosInfo.utsname.nodename;
- _deviceParameters['utsnameSysname'] = iosInfo.utsname.sysname;
+ _deviceParameters["model"] = iosInfo.model;
+ _deviceParameters["isPhysicalDevice"] = iosInfo.isPhysicalDevice;
+ _deviceParameters["name"] = iosInfo.name;
+ _deviceParameters["identifierForVendor"] = iosInfo.identifierForVendor;
+ _deviceParameters["localizedModel"] = iosInfo.localizedModel;
+ _deviceParameters["systemName"] = iosInfo.systemName;
+ _deviceParameters["utsnameVersion"] = iosInfo.utsname.version;
+ _deviceParameters["utsnameRelease"] = iosInfo.utsname.release;
+ _deviceParameters["utsnameMachine"] = iosInfo.utsname.machine;
+ _deviceParameters["utsnameNodename"] = iosInfo.utsname.nodename;
+ _deviceParameters["utsnameSysname"] = iosInfo.utsname.sysname;
} catch (exception) {
- _logger.warning('Load iOS parameters failed: $exception');
+ _logger.warning("Load iOS parameters failed: $exception");
}
}
void _loadApplicationInfo() {
- _applicationParameters['environment'] =
+ _applicationParameters["environment"] =
describeEnum(ApplicationProfileManager.getApplicationProfile());
PackageInfo.fromPlatform().then((packageInfo) {
- _applicationParameters['version'] = packageInfo.version;
- _applicationParameters['appName'] = packageInfo.appName;
- _applicationParameters['buildNumber'] = packageInfo.buildNumber;
- _applicationParameters['packageName'] = packageInfo.packageName;
+ _applicationParameters["version"] = packageInfo.version;
+ _applicationParameters["appName"] = packageInfo.appName;
+ _applicationParameters["buildNumber"] = packageInfo.buildNumber;
+ _applicationParameters["packageName"] = packageInfo.packageName;
});
}
///We need to setup localizations lazily because context needed to setup these
///localizations can be used after app was build for the first time.
void _setupLocalization() {
- var locale = const Locale('en', 'US');
+ Locale locale = const Locale("en", "US");
if (_isContextValid()) {
- final context = _getContext();
+ final BuildContext? context = _getContext();
if (context != null) {
locale = Localizations.localeOf(context);
}
@@ -449,31 +492,31 @@ class Catcher with ReportModeAction {
String language,
) {
switch (language.toLowerCase()) {
- case 'en':
+ case "en":
return LocalizationOptions.buildDefaultEnglishOptions();
- case 'zh':
+ case "zh":
return LocalizationOptions.buildDefaultChineseOptions();
- case 'hi':
+ case "hi":
return LocalizationOptions.buildDefaultHindiOptions();
- case 'es':
+ case "es":
return LocalizationOptions.buildDefaultSpanishOptions();
- case 'ms':
+ case "ms":
return LocalizationOptions.buildDefaultMalayOptions();
- case 'ru':
+ case "ru":
return LocalizationOptions.buildDefaultRussianOptions();
- case 'pt':
+ case "pt":
return LocalizationOptions.buildDefaultPortugueseOptions();
- case 'fr':
+ case "fr":
return LocalizationOptions.buildDefaultFrenchOptions();
- case 'pl':
+ case "pl":
return LocalizationOptions.buildDefaultPolishOptions();
- case 'it':
+ case "it":
return LocalizationOptions.buildDefaultItalianOptions();
- case 'ko':
+ case "ko":
return LocalizationOptions.buildDefaultKoreanOptions();
- case 'nl':
+ case "nl":
return LocalizationOptions.buildDefaultDutchOptions();
- case 'de':
+ case "de":
return LocalizationOptions.buildDefaultGermanOptions();
default:
return LocalizationOptions.buildDefaultEnglishOptions();
@@ -483,7 +526,7 @@ class Catcher with ReportModeAction {
///Setup screenshot manager's screenshots path.
void _setupScreenshotManager() {
screenshotManager = CatcherScreenshotManager(_logger);
- final screenshotsPath = _currentConfig.screenshotsPath;
+ final String screenshotsPath = _currentConfig.screenshotsPath;
if (!ApplicationProfileManager.isWeb() && screenshotsPath.isEmpty) {
_logger.warning("Screenshots path is empty. Screenshots won't work.");
}
@@ -495,37 +538,37 @@ class Catcher with ReportModeAction {
static void reportCheckedError(dynamic error, dynamic stackTrace) {
dynamic errorValue = error;
dynamic stackTraceValue = stackTrace;
- errorValue ??= 'undefined error';
+ errorValue ??= "undefined error";
stackTraceValue ??= StackTrace.current;
_instance._reportError(error, stackTrace);
}
- Future _reportError(
+ void _reportError(
dynamic error,
dynamic stackTrace, {
FlutterErrorDetails? errorDetails,
}) async {
- if (errorDetails?.silent ??
- false == true && _currentConfig.handleSilentError == false) {
+ if (errorDetails?.silent == true &&
+ _currentConfig.handleSilentError == false) {
_logger.info(
- 'Report error skipped for error: $error. HandleSilentError is false.',
+ "Report error skipped for error: $error. HandleSilentError is false.",
);
return;
}
if (_localizationOptions == null) {
- _logger.info('Setup localization lazily!');
+ _logger.info("Setup localization lazily!");
_setupLocalization();
}
- _cleanPastReportsOccurrences();
+ _cleanPastReportsOccurences();
File? screenshot;
if (!ApplicationProfileManager.isWeb()) {
screenshot = await screenshotManager.captureAndSave();
}
- final report = Report(
+ final Report report = Report(
error,
stackTrace,
DateTime.now(),
@@ -537,10 +580,9 @@ class Catcher with ReportModeAction {
screenshot,
);
- if (_isReportInReportsOccurrencesMap(report)) {
+ if (_isReportInReportsOccurencesMap(report)) {
_logger.fine(
- "Error: '$error' has been skipped to due to duplication occurrence "
- 'within ${_currentConfig.reportOccurrenceTimeout} ms.',
+ "Error: '$error' has been skipped to due to duplication occurence within ${_currentConfig.reportOccurrenceTimeout} ms.",
);
return;
}
@@ -548,22 +590,21 @@ class Catcher with ReportModeAction {
if (_currentConfig.filterFunction != null &&
_currentConfig.filterFunction!(report) == false) {
_logger.fine(
- "Error: '$error' has been filtered from Catcher logs. Report will be "
- 'skipped.',
+ "Error: '$error' has been filtered from Catcher logs. Report will be skipped.",
);
return;
}
_cachedReports.add(report);
- var reportMode = _getReportModeFromExplicitExceptionReportModeMap(error);
+ ReportMode? reportMode =
+ _getReportModeFromExplicitExceptionReportModeMap(error);
if (reportMode != null) {
- _logger.info('Using explicit report mode for error');
+ _logger.info("Using explicit report mode for error");
} else {
reportMode = _currentConfig.reportMode;
}
if (!isReportModeSupportedInPlatform(report, reportMode)) {
_logger.warning(
- '$reportMode in not supported for ${describeEnum(report.platformType)}'
- 'platform',
+ "$reportMode in not supported for ${describeEnum(report.platformType)} platform",
);
return;
}
@@ -575,8 +616,7 @@ class Catcher with ReportModeAction {
reportMode.requestAction(report, _getContext());
} else {
_logger.warning(
- "Couldn't use report mode because you didn't provide navigator key."
- ' Add navigator key to use this report mode.',
+ "Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode.",
);
}
} else {
@@ -594,7 +634,7 @@ class Catcher with ReportModeAction {
}
ReportMode? _getReportModeFromExplicitExceptionReportModeMap(dynamic error) {
- final errorName = error != null ? error.toString().toLowerCase() : '';
+ final errorName = error != null ? error.toString().toLowerCase() : "";
ReportMode? reportMode;
_currentConfig.explicitExceptionReportModesMap.forEach((key, value) {
if (errorName.contains(key.toLowerCase())) {
@@ -608,7 +648,7 @@ class Catcher with ReportModeAction {
ReportHandler? _getReportHandlerFromExplicitExceptionHandlerMap(
dynamic error,
) {
- final errorName = error != null ? error.toString().toLowerCase() : '';
+ final errorName = error != null ? error.toString().toLowerCase() : "";
ReportHandler? reportHandler;
_currentConfig.explicitExceptionHandlersMap.forEach((key, value) {
if (errorName.contains(key.toLowerCase())) {
@@ -621,15 +661,15 @@ class Catcher with ReportModeAction {
@override
void onActionConfirmed(Report report) {
- final reportHandler =
+ final ReportHandler? reportHandler =
_getReportHandlerFromExplicitExceptionHandlerMap(report.error);
if (reportHandler != null) {
- _logger.info('Using explicit report handler');
+ _logger.info("Using explicit report handler");
_handleReport(report, reportHandler);
return;
}
- for (final handler in _currentConfig.handlers) {
+ for (final ReportHandler handler in _currentConfig.handlers) {
_handleReport(report, handler);
}
}
@@ -637,16 +677,14 @@ class Catcher with ReportModeAction {
void _handleReport(Report report, ReportHandler reportHandler) {
if (!isReportHandlerSupportedInPlatform(report, reportHandler)) {
_logger.warning(
- '$reportHandler in not supported for '
- '${describeEnum(report.platformType)} platform',
+ "$reportHandler in not supported for ${describeEnum(report.platformType)} platform",
);
return;
}
if (reportHandler.isContextRequired() && !_isContextValid()) {
_logger.warning(
- "Couldn't use report handler because you didn't provide navigator key."
- ' Add navigator key to use this report mode',
+ "Couldn't use report handler because you didn't provide navigator key. Add navigator key to use this report mode.",
);
return;
}
@@ -655,13 +693,12 @@ class Catcher with ReportModeAction {
.handle(report, _getContext())
.catchError((dynamic handlerError) {
_logger.warning(
- 'Error occurred in $reportHandler: $handlerError',
+ "Error occurred in ${reportHandler.toString()}: ${handlerError.toString()}",
);
- return true;
}).then((result) {
- _logger.info('${report.runtimeType} result: $result');
+ _logger.info("${report.runtimeType} result: $result");
if (!result) {
- _logger.warning('$reportHandler failed to report error');
+ _logger.warning("${reportHandler.toString()} failed to report error");
} else {
_cachedReports.remove(report);
}
@@ -669,7 +706,7 @@ class Catcher with ReportModeAction {
Duration(milliseconds: _currentConfig.handlerTimeout),
onTimeout: () {
_logger.warning(
- '$reportHandler failed to report error because of timeout',
+ "${reportHandler.toString()} failed to report error because of timeout",
);
},
);
@@ -713,16 +750,16 @@ class Catcher with ReportModeAction {
/// Send text exception. Used to test Catcher configuration.
static void sendTestException() {
- throw const FormatException('Test exception generated by Catcher');
+ throw const FormatException("Test exception generated by Catcher");
}
/// Add default error widget which replaces red screen of death (RSOD).
static void addDefaultErrorWidget({
bool showStacktrace = true,
- String title = 'An application error has occurred',
+ String title = "An application error has occurred",
String description =
- 'There was unexpected situation in application. Application has been '
- 'able to recover from error state.',
+ "There was unexpected situation in application. Application has been "
+ "able to recover from error state.",
double maxWidthForSmallMode = 150,
}) {
ErrorWidget.builder = (FlutterErrorDetails details) {
@@ -756,25 +793,27 @@ class Catcher with ReportModeAction {
if (ApplicationProfileManager.isMacOS()) {
return PlatformType.macOS;
}
-
+ if (ApplicationProfileManager.isHarmonyOS()) {
+ return PlatformType.ohos;
+ }
return PlatformType.unknown;
}
- ///Clean report occurrencess from the past.
- void _cleanPastReportsOccurrences() {
- final occurrenceTimeout = _currentConfig.reportOccurrenceTimeout;
- final nowDateTime = DateTime.now();
- _reportsOccurrenceMap.removeWhere((key, value) {
- final occurrenceWithTimeout =
- key.add(Duration(milliseconds: occurrenceTimeout));
- return nowDateTime.isAfter(occurrenceWithTimeout);
+ ///Clean report ocucrences from the past.
+ void _cleanPastReportsOccurences() {
+ final int occurenceTimeout = _currentConfig.reportOccurrenceTimeout;
+ final DateTime nowDateTime = DateTime.now();
+ _reportsOcurrenceMap.removeWhere((key, value) {
+ final DateTime occurenceWithTimeout =
+ key.add(Duration(milliseconds: occurenceTimeout));
+ return nowDateTime.isAfter(occurenceWithTimeout);
});
}
///Check whether reports occurence map contains given report.
- bool _isReportInReportsOccurrencesMap(Report report) {
+ bool _isReportInReportsOccurencesMap(Report report) {
if (report.error != null) {
- return _reportsOccurrenceMap.containsValue(report.error.toString());
+ return _reportsOcurrenceMap.containsValue(report.error.toString());
} else {
return false;
}
@@ -784,7 +823,7 @@ class Catcher with ReportModeAction {
///error is not null and report occurence timeout is greater than 0.
void _addReportInReportsOccurencesMap(Report report) {
if (report.error != null && _currentConfig.reportOccurrenceTimeout > 0) {
- _reportsOccurrenceMap[DateTime.now()] = report.error.toString();
+ _reportsOcurrenceMap[DateTime.now()] = report.error.toString();
}
}
diff --git a/lib/core/catcher_screenshot.dart b/lib/core/catcher_screenshot.dart
index fcb544894c5f64cd89bd16e3a029d66aa23c0e5b..9187753896e7950f7ae65a2ba3653d7152b63edd 100644
--- a/lib/core/catcher_screenshot.dart
+++ b/lib/core/catcher_screenshot.dart
@@ -7,10 +7,10 @@ class CatcherScreenshot extends StatefulWidget {
final Catcher catcher;
const CatcherScreenshot({
+ Key? key,
required this.child,
required this.catcher,
- super.key,
- });
+ }) : super(key: key);
@override
State createState() {
diff --git a/lib/core/catcher_screenshot_manager.dart b/lib/core/catcher_screenshot_manager.dart
index 4539f3f807bc7731b8b85b9bca381b54df2dc284..dad857c251f4cf8a7e479f0c66b945a27e0ff645 100644
--- a/lib/core/catcher_screenshot_manager.dart
+++ b/lib/core/catcher_screenshot_manager.dart
@@ -1,3 +1,5 @@
+library screenshot;
+
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
@@ -29,10 +31,10 @@ class CatcherScreenshotManager {
Duration delay = const Duration(milliseconds: 20),
}) async {
try {
- if (_path?.isEmpty ?? false == true) {
+ if (_path?.isEmpty == true) {
return null;
}
- final content = await _capture(
+ final Uint8List? content = await _capture(
pixelRatio: pixelRatio,
delay: delay,
);
@@ -41,74 +43,60 @@ class CatcherScreenshotManager {
return saveFile(content);
}
} catch (exception) {
- _logger.warning('Failed to create screenshot file: $exception');
+ _logger.warning("Failed to create screenshot file: $exception");
}
return null;
}
Future saveFile(Uint8List fileContent) async {
- final name = 'catcher_${DateTime.now().microsecondsSinceEpoch}.png';
- final file = await File('$_path/$name').create(recursive: true);
+ final name = "catcher_${DateTime.now().microsecondsSinceEpoch}.png";
+ final File file = await File("$_path/$name").create(recursive: true);
file.writeAsBytesSync(fileContent);
return file;
}
Future _capture({
double? pixelRatio,
- Duration delay = const Duration(milliseconds: 20),
+ Duration? delay = const Duration(milliseconds: 20),
}) {
- //Delay is required. See Issue https://github.com/flutter/flutter/issues/22308
- return Future.delayed(delay, () async {
- try {
- final image = await captureAsUiImage(
- delay: Duration.zero,
- pixelRatio: pixelRatio,
- );
- final byteData =
- await image?.toByteData(format: ui.ImageByteFormat.png);
- image?.dispose();
-
- final pngBytes = byteData?.buffer.asUint8List();
+ return Future.delayed(delay ?? const Duration(milliseconds: 20), () async {
+ final ui.Image image = await _captureAsUiImage(
+ delay: Duration.zero,
+ pixelRatio: pixelRatio,
+ );
+ final ByteData? byteData =
+ await image.toByteData(format: ui.ImageByteFormat.png);
+ final Uint8List? pngBytes = byteData?.buffer.asUint8List();
- return pngBytes;
- } catch (exception) {
- _logger.severe('Failed to capture screenshot: $exception');
- }
- return null;
+ return pngBytes;
});
}
- Future captureAsUiImage({
- double? pixelRatio = 1,
+ Future _captureAsUiImage({
+ double? pixelRatio,
Duration delay = const Duration(milliseconds: 20),
}) {
- //Delay is required. See Issue https://github.com/flutter/flutter/issues/22308
return Future.delayed(delay, () async {
- try {
- final findRenderObject =
- _containerKey.currentContext?.findRenderObject();
+ // ignore: cast_nullable_to_non_nullable
+ final RenderRepaintBoundary boundary = _containerKey.currentContext
+ ?.findRenderObject() as RenderRepaintBoundary;
- print(containerKey.currentContext);
- print(_containerKey.currentContext?.findRenderObject());
- if (findRenderObject == null) {
- return null;
- }
+ // ignore: unnecessary_null_comparison
+ if (boundary == null) {
+ throw StateError("No boundary found");
+ }
- final boundary = findRenderObject as RenderRepaintBoundary;
- final context = _containerKey.currentContext;
- var pixelRatioValue = pixelRatio;
- if (pixelRatio == null) {
- if (context != null) {
- pixelRatioValue =
- pixelRatio ?? MediaQuery.of(context).devicePixelRatio;
- }
+ final BuildContext? context = _containerKey.currentContext;
+ double? pixelRatioValue = pixelRatio;
+ if (pixelRatioValue == null) {
+ if (context != null) {
+ pixelRatioValue =
+ pixelRatioValue ?? MediaQuery.of(context).devicePixelRatio;
}
- final image = await boundary.toImage(pixelRatio: pixelRatioValue ?? 1);
- return image;
- } catch (exception) {
- _logger.severe('Failed to capture screenshot: $exception');
}
- return null;
+ final ui.Image image =
+ await boundary.toImage(pixelRatio: pixelRatio ?? 1);
+ return image;
});
}
diff --git a/lib/handlers/base_email_handler.dart b/lib/handlers/base_email_handler.dart
index 82f9cf3540e2abc55035a31a830e266e936b4b46..6f7aa61202e11f31c2bbf855ca442ff237e61d96 100644
--- a/lib/handlers/base_email_handler.dart
+++ b/lib/handlers/base_email_handler.dart
@@ -24,60 +24,58 @@ abstract class BaseEmailHandler extends ReportHandler {
///Setup email title from [report].
String getEmailTitle(Report report) {
- if (emailTitle?.isNotEmpty ?? false == true) {
+ if (emailTitle?.isNotEmpty == true) {
return emailTitle!;
} else {
- return 'Error report: >> ${report.error} <<';
+ return "Error report: >> ${report.error} <<";
}
}
///Setup html email message from [report].
String setupHtmlMessageText(Report report) {
- final buffer = StringBuffer();
+ final StringBuffer buffer = StringBuffer();
if (emailHeader?.isNotEmpty == true) {
- buffer
- ..write(_escapeHtmlValue(emailHeader ?? ''))
- ..write('
');
+ buffer.write(_escapeHtmlValue(emailHeader ?? ""));
+ buffer.write("
");
}
- buffer
- ..write('Error:
')
- ..write(_escapeHtmlValue(report.error.toString()))
- ..write('
');
+ buffer.write("Error:
");
+ buffer.write(_escapeHtmlValue(report.error.toString()));
+ buffer.write("
");
if (enableStackTrace) {
- buffer.write('Stack trace:
');
+ buffer.write("Stack trace:
");
_escapeHtmlValue(report.stackTrace.toString())
- .split('\n')
+ .split("\n")
.forEach((element) {
- buffer.write('$element
');
+ buffer.write("$element
");
});
- buffer.write('
');
+ buffer.write("
");
}
if (enableDeviceParameters) {
- buffer.write('Device parameters:
');
+ buffer.write("Device parameters:
");
for (final entry in report.deviceParameters.entries) {
buffer
- .write('${entry.key}: ${_escapeHtmlValue(entry.value)}
');
+ .write("${entry.key}: ${_escapeHtmlValue(entry.value)}
");
}
- buffer.write('
');
+ buffer.write("
");
}
if (enableApplicationParameters) {
- buffer.write('Application parameters:
');
+ buffer.write("Application parameters:
");
for (final entry in report.applicationParameters.entries) {
buffer
- .write('${entry.key}: ${_escapeHtmlValue(entry.value)}
');
+ .write("${entry.key}: ${_escapeHtmlValue(entry.value)}
");
}
- buffer.write('
');
+ buffer.write("
");
}
if (enableCustomParameters) {
- buffer.write('Custom parameters:
');
+ buffer.write("Custom parameters:
");
for (final entry in report.customParameters.entries) {
buffer
- .write('${entry.key}: ${_escapeHtmlValue(entry.value)}
');
+ .write("${entry.key}: ${_escapeHtmlValue(entry.value)}
");
}
- buffer.write('
');
+ buffer.write("
");
}
return buffer.toString();
@@ -90,43 +88,40 @@ abstract class BaseEmailHandler extends ReportHandler {
///Setup raw text email message from [report].
String setupRawMessageText(Report report) {
- final buffer = StringBuffer();
+ final StringBuffer buffer = StringBuffer();
if (emailHeader?.isNotEmpty == true) {
- buffer
- ..write(emailHeader)
- ..write('\n\n');
+ buffer.write(emailHeader);
+ buffer.write("\n\n");
}
- buffer
- ..write('Error:\n')
- ..write(report.error.toString())
- ..write('\n\n');
+ buffer.write("Error:\n");
+ buffer.write(report.error.toString());
+ buffer.write("\n\n");
if (enableStackTrace) {
- buffer
- ..write('Stack trace:\n')
- ..write(report.stackTrace.toString())
- ..write('\n\n');
+ buffer.write("Stack trace:\n");
+ buffer.write(report.stackTrace.toString());
+ buffer.write("\n\n");
}
if (enableDeviceParameters) {
- buffer.write('Device parameters:\n');
+ buffer.write("Device parameters:\n");
for (final entry in report.deviceParameters.entries) {
- buffer.write('${entry.key}: ${entry.value}\n');
+ buffer.write("${entry.key}: ${entry.value}\n");
}
- buffer.write('\n\n');
+ buffer.write("\n\n");
}
if (enableApplicationParameters) {
- buffer.write('Application parameters:\n');
+ buffer.write("Application parameters:\n");
for (final entry in report.applicationParameters.entries) {
- buffer.write('${entry.key}: ${entry.value}\n');
+ buffer.write("${entry.key}: ${entry.value}\n");
}
- buffer.write('\n\n');
+ buffer.write("\n\n");
}
if (enableCustomParameters) {
- buffer.write('Custom parameters:\n');
+ buffer.write("Custom parameters:\n");
for (final entry in report.customParameters.entries) {
- buffer.write('${entry.key}: ${entry.value}\n');
+ buffer.write("${entry.key}: ${entry.value}\n");
}
- buffer.write('\n\n');
+ buffer.write("\n\n");
}
return buffer.toString();
}
diff --git a/lib/handlers/console_handler.dart b/lib/handlers/console_handler.dart
index 88b1df99e71ece546247415c00103c0999f26d93..89bdf8b658d66cc4c89f08065128b5f841501112 100644
--- a/lib/handlers/console_handler.dart
+++ b/lib/handlers/console_handler.dart
@@ -20,24 +20,22 @@ class ConsoleHandler extends ReportHandler {
@override
Future handle(Report report, BuildContext? context) {
- logger
- ..info(
- '============================ CATCHER LOG ============================',
- )
- ..info('Crash occurred on ${report.dateTime}')
- ..info('');
+ logger.info(
+ "============================== CATCHER LOG ==============================",
+ );
+ logger.info("Crash occurred on ${report.dateTime}");
+ logger.info("");
if (enableDeviceParameters) {
_printDeviceParametersFormatted(report.deviceParameters);
- logger.info('');
+ logger.info("");
}
if (enableApplicationParameters) {
_printApplicationParametersFormatted(report.applicationParameters);
- logger.info('');
+ logger.info("");
}
- logger
- ..info('---------- ERROR ----------')
- ..info('${report.error}')
- ..info('');
+ logger.info("---------- ERROR ----------");
+ logger.info("${report.error}");
+ logger.info("");
if (enableStackTrace) {
_printStackTraceFormatted(report.stackTrace as StackTrace?);
}
@@ -45,37 +43,37 @@ class ConsoleHandler extends ReportHandler {
_printCustomParametersFormatted(report.customParameters);
}
logger.info(
- '======================================================================',
+ "======================================================================",
);
return Future.value(true);
}
void _printDeviceParametersFormatted(Map deviceParameters) {
- logger.info('------- DEVICE INFO -------');
+ logger.info("------- DEVICE INFO -------");
for (final entry in deviceParameters.entries) {
- logger.info('${entry.key}: ${entry.value}');
+ logger.info("${entry.key}: ${entry.value}");
}
}
void _printApplicationParametersFormatted(
Map applicationParameters,
) {
- logger.info('------- APP INFO -------');
+ logger.info("------- APP INFO -------");
for (final entry in applicationParameters.entries) {
- logger.info('${entry.key}: ${entry.value}');
+ logger.info("${entry.key}: ${entry.value}");
}
}
void _printCustomParametersFormatted(Map customParameters) {
- logger.info('------- CUSTOM INFO -------');
+ logger.info("------- CUSTOM INFO -------");
for (final entry in customParameters.entries) {
- logger.info('${entry.key}: ${entry.value}');
+ logger.info("${entry.key}: ${entry.value}");
}
}
void _printStackTraceFormatted(StackTrace? stackTrace) {
- logger.info('------- STACK TRACE -------');
- for (final entry in stackTrace.toString().split('\n')) {
+ logger.info("------- STACK TRACE -------");
+ for (final entry in stackTrace.toString().split("\n")) {
logger.info(entry);
}
}
@@ -88,6 +86,7 @@ class ConsoleHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
@override
diff --git a/lib/handlers/discord_handler.dart b/lib/handlers/discord_handler.dart
index 141266a4a6f865b699364bf6064058580259d7fb..8052e386155659a3203012b4d2b24c5e27af0527 100644
--- a/lib/handlers/discord_handler.dart
+++ b/lib/handlers/discord_handler.dart
@@ -34,22 +34,22 @@ class DiscordHandler extends ReportHandler {
Future handle(Report report, BuildContext? context) async {
if (report.platformType != PlatformType.web) {
if (!(await CatcherUtils.isInternetConnectionAvailable())) {
- _printLog('No internet connection available');
+ _printLog("No internet connection available");
return false;
}
}
- var message = '';
+ String message = "";
if (customMessageBuilder != null) {
message = await customMessageBuilder!(report);
} else {
message = _buildMessage(report);
}
- final messages = _setupMessages(message);
+ final List messages = _setupMessages(message);
for (final value in messages) {
- final isLastMessage = messages.indexOf(value) == messages.length - 1;
- final result =
+ final bool isLastMessage = messages.indexOf(value) == messages.length - 1;
+ final bool result =
await _sendContent(value, isLastMessage ? report.screenshot : null);
if (!result) {
return result;
@@ -60,12 +60,12 @@ class DiscordHandler extends ReportHandler {
}
List _setupMessages(String message) {
- final messages = [];
- final splits = (message.length / 2000).ceil();
- final messageLength = message.length;
- for (var index = 0; index < splits; index++) {
- final startIndex = index * 2000;
- var endIndex = startIndex + 2000;
+ final List messages = [];
+ final int splits = (message.length / 2000).ceil();
+ final int messageLength = message.length;
+ for (int index = 0; index < splits; index++) {
+ final int startIndex = index * 2000;
+ int endIndex = startIndex + 2000;
if (endIndex > messageLength) {
endIndex = messageLength;
}
@@ -75,64 +75,63 @@ class DiscordHandler extends ReportHandler {
}
String _buildMessage(Report report) {
- final stringBuffer = StringBuffer()
- ..write('**Error:**\n${report.error}\n\n');
+ final StringBuffer stringBuffer = StringBuffer();
+ stringBuffer.write("**Error:**\n${report.error}\n\n");
if (enableStackTrace) {
- stringBuffer.write('**Stack trace:**\n${report.stackTrace}\n\n');
+ stringBuffer.write("**Stack trace:**\n${report.stackTrace}\n\n");
}
if (enableDeviceParameters && report.deviceParameters.isNotEmpty) {
- stringBuffer.write('**Device parameters:**\n');
+ stringBuffer.write("**Device parameters:**\n");
for (final entry in report.deviceParameters.entries) {
- stringBuffer.write('${entry.key}: ${entry.value}\n');
+ stringBuffer.write("${entry.key}: ${entry.value}\n");
}
- stringBuffer.write('\n\n');
+ stringBuffer.write("\n\n");
}
if (enableApplicationParameters &&
report.applicationParameters.isNotEmpty) {
- stringBuffer.write('**Application parameters:**\n');
+ stringBuffer.write("**Application parameters:**\n");
for (final entry in report.applicationParameters.entries) {
- stringBuffer.write('${entry.key}: ${entry.value}\n');
+ stringBuffer.write("${entry.key}: ${entry.value}\n");
}
- stringBuffer.write('\n\n');
+ stringBuffer.write("\n\n");
}
if (enableCustomParameters && report.customParameters.isNotEmpty) {
- stringBuffer.write('**Custom parameters:**\n');
+ stringBuffer.write("**Custom parameters:**\n");
for (final entry in report.customParameters.entries) {
- stringBuffer.write('${entry.key}: ${entry.value}\n');
+ stringBuffer.write("${entry.key}: ${entry.value}\n");
}
- stringBuffer.write('\n\n');
+ stringBuffer.write("\n\n");
}
return stringBuffer.toString();
}
Future _sendContent(String content, File? screenshot) async {
try {
- _printLog('Sending request to Discord server...');
- Response? response;
+ _printLog("Sending request to Discord server...");
+ Response? response;
if (screenshot != null) {
final screenshotPath = screenshot.path;
- final formData = FormData.fromMap({
- 'content': content,
- 'file': await MultipartFile.fromFile(screenshotPath),
+ final FormData formData = FormData.fromMap({
+ "content": content,
+ "file": await MultipartFile.fromFile(screenshotPath)
});
response = await _dio.post(webhookUrl, data: formData);
} else {
final data = {
- 'content': content,
+ "content": content,
};
response = await _dio.post(webhookUrl, data: data);
}
_printLog(
- 'Server responded with code: ${response.statusCode} and message:'
- ' ${response.statusMessage}',
+ "Server responded with code: ${response.statusCode} and message: ${response.statusMessage}",
);
final statusCode = response.statusCode ?? 0;
return statusCode >= 200 && statusCode < 300;
} catch (exception) {
- _printLog('Failed to send data to Discord server: $exception');
+ _printLog("Failed to send data to Discord server: $exception");
return false;
}
}
@@ -151,5 +150,6 @@ class DiscordHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/email_auto_handler.dart b/lib/handlers/email_auto_handler.dart
index 48519a9ca4dcc21f9f5f1c845a1f65458002e00b..9cafc31ea803a21bf9555c58482b74829a42f073 100644
--- a/lib/handlers/email_auto_handler.dart
+++ b/lib/handlers/email_auto_handler.dart
@@ -43,8 +43,8 @@ class EmailAutoHandler extends BaseEmailHandler {
);
@override
- Future handle(Report report, BuildContext? context) {
- return _sendMail(report);
+ Future handle(Report error, BuildContext? context) {
+ return _sendMail(error);
}
Future _sendMail(Report report) async {
@@ -62,14 +62,14 @@ class EmailAutoHandler extends BaseEmailHandler {
if (sendHtml) {
message.html = setupHtmlMessageText(report);
}
- _printLog('Sending email...');
+ _printLog("Sending email...");
final result = await send(message, _setupSmtpServer());
_printLog(
- 'Email result: mail: ${result.mail} '
- 'sending start time: ${result.messageSendingStart} '
- 'sending end time: ${result.messageSendingEnd}',
+ "Email result: mail: ${result.mail} "
+ "sending start time: ${result.messageSendingStart} "
+ "sending end time: ${result.messageSendingEnd}",
);
return true;
@@ -104,5 +104,6 @@ class EmailAutoHandler extends BaseEmailHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/email_manual_handler.dart b/lib/handlers/email_manual_handler.dart
index 95917e78b43b7f3e9b1395571f2a6d33f3e72bf7..7febf914497f0ffba9884d0f57967c12020251ef 100644
--- a/lib/handlers/email_manual_handler.dart
+++ b/lib/handlers/email_manual_handler.dart
@@ -36,21 +36,21 @@ class EmailManualHandler extends BaseEmailHandler {
Future _sendEmail(Report report) async {
try {
- final mailOptions = MailOptions(
+ final MailOptions mailOptions = MailOptions(
body: _getEmailBody(report),
subject: getEmailTitle(report),
recipients: recipients,
isHTML: sendHtml,
attachments: [
- report.screenshot?.path ?? '',
+ report.screenshot?.path ?? "",
],
);
- _printLog('Creating mail request');
+ _printLog("Creating mail request");
await FlutterMailer.send(mailOptions);
- _printLog('Creating mail request success');
+ _printLog("Creating mail request success");
return true;
} catch (exc, stackTrace) {
- _printLog('Exception occurred: $exc stack: $stackTrace');
+ _printLog("Exception occurred: $exc stack: $stackTrace");
return false;
}
}
@@ -73,5 +73,6 @@ class EmailManualHandler extends BaseEmailHandler {
List getSupportedPlatforms() => [
PlatformType.android,
PlatformType.iOS,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/file_handler.dart b/lib/handlers/file_handler.dart
index d96cfcd20b163c9a5e382ed84da794af22ca97b2..20f0a6e415f861b7499c82043095f408990e59cb 100644
--- a/lib/handlers/file_handler.dart
+++ b/lib/handlers/file_handler.dart
@@ -38,7 +38,7 @@ class FileHandler extends ReportHandler {
}
return await _processReport(report);
} catch (exc, stackTrace) {
- _printLog('Exception occurred: $exc stack: $stackTrace');
+ _printLog("Exception occurred: $exc stack: $stackTrace");
return false;
}
}
@@ -46,7 +46,7 @@ class FileHandler extends ReportHandler {
Future _processReport(Report report) async {
if (_fileValidationResult) {
await _openFile();
- await _writeReportToFile(report);
+ _writeReportToFile(report);
await _closeFile();
return true;
} else {
@@ -56,85 +56,86 @@ class FileHandler extends ReportHandler {
Future _checkFile() async {
try {
- final exists = file.existsSync();
+ final bool exists = await file.exists();
if (!exists) {
file.createSync();
}
- final sink = file.openWrite(mode: FileMode.append)..write('');
+ final IOSink sink = file.openWrite(mode: FileMode.append);
+ sink.write("");
await sink.flush();
await sink.close();
return true;
} catch (exc, stackTrace) {
- _printLog('Exception occurred: $exc stack: $stackTrace');
+ _printLog("Exception occurred: $exc stack: $stackTrace");
return false;
}
}
- Future _openFile() async {
+ Future _openFile() async {
_sink = file.openWrite(mode: FileMode.append);
- _printLog('Opened file');
+ _printLog("Opened file");
}
void _writeLineToFile(String text) {
_sink.add(utf8.encode('$text\n'));
}
- Future _closeFile() async {
+ Future _closeFile() async {
await _sink.flush();
await _sink.close();
- _printLog('Closed file');
+ _printLog("Closed file");
}
- Future _writeReportToFile(Report report) async {
- _printLog('Writing report to file');
+ void _writeReportToFile(Report report) async {
+ _printLog("Writing report to file");
_writeLineToFile(
- '============================ CATCHER LOG ============================',
+ "============================== CATCHER LOG ==============================",
);
- _writeLineToFile('Crash occurred on ${report.dateTime}');
- _writeLineToFile('');
+ _writeLineToFile("Crash occurred on ${report.dateTime}");
+ _writeLineToFile("");
if (enableDeviceParameters) {
_logDeviceParametersFormatted(report.deviceParameters);
- _writeLineToFile('');
+ _writeLineToFile("");
}
if (enableApplicationParameters) {
_logApplicationParametersFormatted(report.applicationParameters);
- _writeLineToFile('');
+ _writeLineToFile("");
}
- _writeLineToFile('---------- ERROR ----------');
- _writeLineToFile('${report.error}');
- _writeLineToFile('');
+ _writeLineToFile("---------- ERROR ----------");
+ _writeLineToFile("${report.error}");
+ _writeLineToFile("");
if (enableStackTrace) {
- _writeLineToFile('------- STACK TRACE -------');
- _writeLineToFile('${report.stackTrace}');
+ _writeLineToFile("------- STACK TRACE -------");
+ _writeLineToFile("${report.stackTrace}");
}
if (enableCustomParameters) {
_logCustomParametersFormatted(report.customParameters);
}
_writeLineToFile(
- '======================================================================',
+ "======================================================================",
);
}
void _logDeviceParametersFormatted(Map deviceParameters) {
- _writeLineToFile('------- DEVICE INFO -------');
+ _writeLineToFile("------- DEVICE INFO -------");
for (final entry in deviceParameters.entries) {
- _writeLineToFile('${entry.key}: ${entry.value}');
+ _writeLineToFile("${entry.key}: ${entry.value}");
}
}
void _logApplicationParametersFormatted(
Map applicationParameters,
) {
- _writeLineToFile('------- APP INFO -------');
+ _writeLineToFile("------- APP INFO -------");
for (final entry in applicationParameters.entries) {
- _writeLineToFile('${entry.key}: ${entry.value}');
+ _writeLineToFile("${entry.key}: ${entry.value}");
}
}
void _logCustomParametersFormatted(Map customParameters) {
- _writeLineToFile('------- CUSTOM INFO -------');
+ _writeLineToFile("------- CUSTOM INFO -------");
for (final entry in customParameters.entries) {
- _writeLineToFile('${entry.key}: ${entry.value}');
+ _writeLineToFile("${entry.key}: ${entry.value}");
}
}
@@ -151,6 +152,7 @@ class FileHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
@override
diff --git a/lib/handlers/http_handler.dart b/lib/handlers/http_handler.dart
index b8fd0b1ab59526e565de26fd2aeb31af32ed6ed8..687c9ccb9207b8cc31c86dbd6e2392761d595086 100644
--- a/lib/handlers/http_handler.dart
+++ b/lib/handlers/http_handler.dart
@@ -36,16 +36,16 @@ class HttpHandler extends ReportHandler {
}) : headers = headers ?? {};
@override
- Future handle(Report report, BuildContext? context) async {
- if (report.platformType != PlatformType.web) {
+ Future handle(Report error, BuildContext? context) async {
+ if (error.platformType != PlatformType.web) {
if (!(await CatcherUtils.isInternetConnectionAvailable())) {
- _printLog('No internet connection available');
+ _printLog("No internet connection available");
return false;
}
}
if (requestType == HttpRequestType.post) {
- return _sendPost(report);
+ return _sendPost(error);
}
return true;
}
@@ -58,24 +58,25 @@ class HttpHandler extends ReportHandler {
enableStackTrace: enableStackTrace,
enableCustomParameters: enableCustomParameters,
);
- final mutableHeaders = HashMap();
+ final HashMap mutableHeaders =
+ HashMap();
if (headers.isNotEmpty == true) {
mutableHeaders.addAll(headers);
}
- final options = Options(
- sendTimeout: Duration(milliseconds: requestTimeout),
- receiveTimeout: Duration(milliseconds: responseTimeout),
+ final Options options = Options(
+ sendTimeout: requestTimeout,
+ receiveTimeout: responseTimeout,
headers: mutableHeaders,
);
- Response? response;
- _printLog('Calling: $endpointUri');
+ Response? response;
+ _printLog("Calling: ${endpointUri.toString()}");
if (report.screenshot != null) {
- final screenshotPath = report.screenshot?.path ?? '';
- final formData = FormData.fromMap({
- 'payload_json': json,
- 'file': await MultipartFile.fromFile(screenshotPath),
+ final screenshotPath = report.screenshot?.path ?? "";
+ final FormData formData = FormData.fromMap({
+ "payload_json": json,
+ "file": await MultipartFile.fromFile(screenshotPath)
});
response = await _dio.post(
endpointUri.toString(),
@@ -90,12 +91,11 @@ class HttpHandler extends ReportHandler {
);
}
_printLog(
- 'HttpHandler response status: ${response.statusCode!} body:'
- ' ${response.data!}',
+ "HttpHandler response status: ${response.statusCode!} body: ${response.data!}",
);
return true;
} catch (error, stackTrace) {
- _printLog('HttpHandler error: $error, stackTrace: $stackTrace');
+ _printLog("HttpHandler error: $error, stackTrace: $stackTrace");
return false;
}
}
@@ -119,5 +119,6 @@ class HttpHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/sentry_handler.dart b/lib/handlers/sentry_handler.dart
index 0fc4cd3c6d622b3dd0ac51e76be80f8c2cba7702..e8062a0709e12d0da7708f5c61397db7458631c8 100644
--- a/lib/handlers/sentry_handler.dart
+++ b/lib/handlers/sentry_handler.dart
@@ -41,58 +41,58 @@ class SentryHandler extends ReportHandler {
});
@override
- Future handle(Report report, BuildContext? context) async {
+ Future handle(Report error, BuildContext? context) async {
try {
- _printLog('Logging to sentry...');
+ _printLog("Logging to sentry...");
final tags = {};
if (enableApplicationParameters) {
- tags.addAll(report.applicationParameters);
+ tags.addAll(error.applicationParameters);
}
if (enableDeviceParameters) {
- tags.addAll(report.deviceParameters);
+ tags.addAll(error.deviceParameters);
}
if (enableCustomParameters) {
- tags.addAll(report.customParameters);
+ tags.addAll(error.customParameters);
}
- final event = buildEvent(report, tags);
+ final event = buildEvent(error, tags);
await sentryClient.captureEvent(event);
- _printLog('Logged to sentry!');
+ _printLog("Logged to sentry!");
return true;
} catch (exception, stackTrace) {
- _printLog('Failed to send sentry event: $exception $stackTrace');
+ _printLog("Failed to send sentry event: $exception $stackTrace");
return false;
}
}
String _getApplicationVersion(Report report) {
- var applicationVersion = '';
+ String applicationVersion = "";
final applicationParameters = report.applicationParameters;
- if (applicationParameters.containsKey('appName')) {
- applicationVersion += (applicationParameters['appName'] as String?)!;
+ if (applicationParameters.containsKey("appName")) {
+ applicationVersion += (applicationParameters["appName"] as String?)!;
}
- if (applicationParameters.containsKey('version')) {
- applicationVersion += ' ${applicationParameters['version']}';
+ if (applicationParameters.containsKey("version")) {
+ applicationVersion += " ${applicationParameters["version"]}";
}
if (applicationVersion.isEmpty) {
- applicationVersion = '?';
+ applicationVersion = "?";
}
return applicationVersion;
}
SentryEvent buildEvent(Report report, Map tags) {
return SentryEvent(
- logger: 'Catcher',
- serverName: 'Catcher',
+ logger: "Catcher",
+ serverName: "Catcher",
release: customRelease ?? _getApplicationVersion(report),
environment: customEnvironment ??
- (report.applicationParameters['environment'] as String?),
- message: const SentryMessage('Error handled by Catcher'),
+ (report.applicationParameters["environment"] as String?),
+ message: const SentryMessage("Error handled by Catcher"),
throwable: report.error,
level: SentryLevel.error,
- culprit: '',
+ culprit: "",
tags: changeToSentryMap(tags),
user: userContext,
);
@@ -102,7 +102,7 @@ class SentryHandler extends ReportHandler {
final sentryMap = {};
map.forEach((key, dynamic value) {
if (value.toString().isEmpty) {
- sentryMap[key] = 'none';
+ sentryMap[key] = "none";
} else {
sentryMap[key] = value.toString();
}
@@ -124,5 +124,6 @@ class SentryHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/slack_handler.dart b/lib/handlers/slack_handler.dart
index b0beda31f1aac818db1fa9c62daa251b0c17c565..95691cf270b822b17a70e8cb4e2da6e4cdf3b9b4 100644
--- a/lib/handlers/slack_handler.dart
+++ b/lib/handlers/slack_handler.dart
@@ -26,8 +26,8 @@ class SlackHandler extends ReportHandler {
SlackHandler(
this.webhookUrl,
this.channel, {
- this.username = 'Catcher',
- this.iconEmoji = ':bangbang:',
+ this.username = "Catcher",
+ this.iconEmoji = ":bangbang:",
this.printLogs = false,
this.enableDeviceParameters = false,
this.enableApplicationParameters = false,
@@ -40,10 +40,10 @@ class SlackHandler extends ReportHandler {
Future handle(Report report, BuildContext? context) async {
try {
if (!(await CatcherUtils.isInternetConnectionAvailable())) {
- _printLog('No internet connection available');
+ _printLog("No internet connection available");
return false;
}
- var message = '';
+ String message = "";
if (customMessageBuilder != null) {
message = await customMessageBuilder!(report);
} else {
@@ -51,54 +51,54 @@ class SlackHandler extends ReportHandler {
}
final data = {
- 'text': message,
- 'channel': channel,
- 'username': username,
- 'icon_emoji': iconEmoji,
+ "text": message,
+ "channel": channel,
+ "username": username,
+ "icon_emoji": iconEmoji
};
- _printLog('Sending request to Slack server...');
- final response = await _dio.post(webhookUrl, data: data);
+ _printLog("Sending request to Slack server...");
+ final Response response =
+ await _dio.post(webhookUrl, data: data);
_printLog(
- 'Server responded with code: ${response.statusCode} and message:'
- ' ${response.statusMessage}',
+ "Server responded with code: ${response.statusCode} and message: ${response.statusMessage}",
);
final statusCode = response.statusCode ?? 0;
return statusCode >= 200 && statusCode < 300;
} catch (exception) {
- _printLog('Failed to send slack message: $exception');
+ _printLog("Failed to send slack message: $exception");
return false;
}
}
String _buildMessage(Report report) {
- final stringBuffer = StringBuffer()
- ..write('*Error:* ```${report.error}```\n');
+ final StringBuffer stringBuffer = StringBuffer();
+ stringBuffer.write("*Error:* ```${report.error}```\n");
if (enableStackTrace) {
- stringBuffer.write('*Stack trace:* ```${report.stackTrace}```\n');
+ stringBuffer.write("*Stack trace:* ```${report.stackTrace}```\n");
}
if (enableDeviceParameters && report.deviceParameters.isNotEmpty) {
- stringBuffer.write('*Device parameters:* ```');
+ stringBuffer.write("*Device parameters:* ```");
for (final entry in report.deviceParameters.entries) {
- stringBuffer.write('${entry.key}: ${entry.value}\n');
+ stringBuffer.write("${entry.key}: ${entry.value}\n");
}
- stringBuffer.write('```\n');
+ stringBuffer.write("```\n");
}
if (enableApplicationParameters &&
report.applicationParameters.isNotEmpty) {
- stringBuffer.write('*Application parameters:* ```');
+ stringBuffer.write("*Application parameters:* ```");
for (final entry in report.applicationParameters.entries) {
- stringBuffer.write('${entry.key}: ${entry.value}\n');
+ stringBuffer.write("${entry.key}: ${entry.value}\n");
}
- stringBuffer.write('```\n');
+ stringBuffer.write("```\n");
}
if (enableCustomParameters && report.customParameters.isNotEmpty) {
- stringBuffer.write('*Custom parameters:* ```');
+ stringBuffer.write("*Custom parameters:* ```");
for (final entry in report.customParameters.entries) {
- stringBuffer.write('${entry.key}: ${entry.value}\n');
+ stringBuffer.write("${entry.key}: ${entry.value}\n");
}
- stringBuffer.write('```\n');
+ stringBuffer.write("```\n");
}
return stringBuffer.toString();
}
@@ -117,5 +117,6 @@ class SlackHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/snackbar_handler.dart b/lib/handlers/snackbar_handler.dart
index 2aab90c3784dac4c477709572a2c5d0b190c2606..ddc3f6e48bd5352d63337a0763ed13efc3bf09a4 100644
--- a/lib/handlers/snackbar_handler.dart
+++ b/lib/handlers/snackbar_handler.dart
@@ -70,7 +70,7 @@ class SnackbarHandler extends ReportHandler {
Future handle(Report error, BuildContext? context) async {
try {
if (!_hasScaffoldMessenger(context!)) {
- _printLog('Passed context has no ScaffoldMessenger in widget ancestor');
+ _printLog("Passed context has no ScaffoldMessenger in widget ancestor");
return false;
}
@@ -95,7 +95,7 @@ class SnackbarHandler extends ReportHandler {
);
return true;
} catch (exception, stackTrace) {
- _printLog('Failed to show snackbar: $exception, $stackTrace');
+ _printLog("Failed to show snackbar: $exception, $stackTrace");
return false;
}
}
@@ -105,7 +105,7 @@ class SnackbarHandler extends ReportHandler {
try {
return context.findAncestorWidgetOfExactType() != null;
} catch (exception, stackTrace) {
- _printLog('_hasScaffoldMessenger failed: $exception, $stackTrace');
+ _printLog("_hasScaffoldMessenger failed: $exception, $stackTrace");
return false;
}
}
@@ -115,7 +115,7 @@ class SnackbarHandler extends ReportHandler {
if (customMessage?.isNotEmpty == true) {
return customMessage!;
} else {
- return '${localizationOptions.toastHandlerDescription} ${error.error}';
+ return "${localizationOptions.toastHandlerDescription} ${error.error}";
}
}
@@ -138,5 +138,6 @@ class SnackbarHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/handlers/toast_handler.dart b/lib/handlers/toast_handler.dart
index 69b883edfdd02684292387126464fa4d3bdb4f4f..14a441aead89df6c4d33036a842b68926413bbbc 100644
--- a/lib/handlers/toast_handler.dart
+++ b/lib/handlers/toast_handler.dart
@@ -28,12 +28,12 @@ class ToastHandler extends ReportHandler {
});
@override
- Future handle(Report report, BuildContext? context) async {
+ Future handle(Report error, BuildContext? buildContext) async {
if (ApplicationProfileManager.isAndroid() ||
ApplicationProfileManager.isIos() ||
ApplicationProfileManager.isWeb()) {
- await Fluttertoast.showToast(
- msg: _getErrorMessage(report),
+ Fluttertoast.showToast(
+ msg: _getErrorMessage(error),
toastLength: _getLength(),
gravity: _getGravity(),
timeInSecForIosWeb: _getLengthIos(),
@@ -46,11 +46,11 @@ class ToastHandler extends ReportHandler {
const Duration(milliseconds: 500),
() {
Navigator.push(
- context!,
+ buildContext!,
PageRouteBuilder(
opaque: false,
pageBuilder: (_, __, ___) => FlutterToastPage(
- _getErrorMessage(report),
+ _getErrorMessage(error),
_getGravity(),
Duration(seconds: _getLengthIos()),
backgroundColor,
@@ -97,7 +97,7 @@ class ToastHandler extends ReportHandler {
if (customMessage?.isNotEmpty == true) {
return customMessage!;
} else {
- return '${localizationOptions.toastHandlerDescription} ${error.error}';
+ return "${localizationOptions.toastHandlerDescription} ${error.error}";
}
}
@@ -109,6 +109,7 @@ class ToastHandler extends ReportHandler {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
@override
@@ -137,13 +138,11 @@ class FlutterToastPage extends StatefulWidget {
this.backgroundColor,
this.textColor,
this.textSize, {
- super.key,
- });
+ Key? key,
+ }) : super(key: key);
@override
- State createState() {
- return _FlutterToastPageState();
- }
+ _FlutterToastPageState createState() => _FlutterToastPageState();
}
class _FlutterToastPageState extends State {
@@ -163,7 +162,7 @@ class _FlutterToastPageState extends State {
void showToast() {
_fToast.showToast(
- child: ColoredBox(
+ child: Container(
color: widget.backgroundColor,
child: Text(
widget.text,
diff --git a/lib/mode/dialog_report_mode.dart b/lib/mode/dialog_report_mode.dart
index 5f0e7aae11fde735f0c8869d4f5596bf51d1d934..84c079937b55b8b01444cb802b19447f42effaaf 100644
--- a/lib/mode/dialog_report_mode.dart
+++ b/lib/mode/dialog_report_mode.dart
@@ -11,12 +11,13 @@ class DialogReportMode extends ReportMode {
_showDialog(report, context);
}
- Future _showDialog(Report report, BuildContext? context) async {
+ Future _showDialog(Report report, BuildContext? context) async {
await Future.delayed(Duration.zero);
if (context != null) {
if (CatcherUtils.isCupertinoAppAncestor(context)) {
return showCupertinoDialog(
context: context,
+ barrierDismissible: false,
builder: (context) => _buildCupertinoDialog(report, context),
);
} else {
@@ -98,5 +99,6 @@ class DialogReportMode extends ReportMode {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/mode/page_report_mode.dart b/lib/mode/page_report_mode.dart
index 5c03e10e1866fc413201f820d6178737c96a0f35..aef99208452e4f3ecb2621ce40bd49dce5ec6f9a 100644
--- a/lib/mode/page_report_mode.dart
+++ b/lib/mode/page_report_mode.dart
@@ -18,12 +18,9 @@ class PageReportMode extends ReportMode {
}
}
- Future _navigateToPageWidget(
- Report report,
- BuildContext context,
- ) async {
+ void _navigateToPageWidget(Report report, BuildContext context) async {
await Future.delayed(Duration.zero);
- await Navigator.push(
+ Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PageWidget(this, report),
@@ -44,6 +41,7 @@ class PageReportMode extends ReportMode {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
@@ -54,8 +52,8 @@ class PageWidget extends StatefulWidget {
const PageWidget(
this.pageReportMode,
this.report, {
- super.key,
- });
+ Key? key,
+ }) : super(key: key);
@override
PageWidgetState createState() {
@@ -132,21 +130,21 @@ class PageWidgetState extends State {
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
- onPressed: _onAcceptClicked,
+ onPressed: () => _onAcceptClicked(),
child: Text(
widget
.pageReportMode.localizationOptions.pageReportModeAccept,
),
),
TextButton(
- onPressed: _onCancelClicked,
+ onPressed: () => _onCancelClicked(),
child: Text(
widget
.pageReportMode.localizationOptions.pageReportModeCancel,
),
),
],
- ),
+ )
],
),
);
@@ -161,21 +159,21 @@ class PageWidgetState extends State {
Widget _getStackTraceWidget() {
if (widget.pageReportMode.showStackTrace) {
- var error = '';
+ String error = "";
if (widget.report.error != null) {
error = widget.report.error.toString();
} else if (widget.report.errorDetails != null) {
error = widget.report.errorDetails.toString();
}
- final items = [
+ final List items = [
error,
- ...widget.report.stackTrace.toString().split('\n'),
+ ...widget.report.stackTrace.toString().split("\n"),
];
return SizedBox(
- height: 300,
+ height: 300.0,
child: ListView.builder(
- padding: const EdgeInsets.all(8),
+ padding: const EdgeInsets.all(8.0),
itemCount: items.length,
itemBuilder: (BuildContext context, int index) {
return Text(
diff --git a/lib/mode/silent_report_mode.dart b/lib/mode/silent_report_mode.dart
index 8f8e5de90e37e85963a65239bb39ff8fbe4bb180..6a3d8b8a5c026559b37c57d79fca4b9ff522c760 100644
--- a/lib/mode/silent_report_mode.dart
+++ b/lib/mode/silent_report_mode.dart
@@ -18,5 +18,6 @@ class SilentReportMode extends ReportMode {
PlatformType.linux,
PlatformType.macOS,
PlatformType.windows,
+ PlatformType.ohos
];
}
diff --git a/lib/model/catcher_options.dart b/lib/model/catcher_options.dart
index 42010a1978a623f21781eec11160f11557841bae..4b92cee624696908d7627afb748335062eb617d8 100644
--- a/lib/model/catcher_options.dart
+++ b/lib/model/catcher_options.dart
@@ -20,8 +20,8 @@ class CatcherOptions {
/// Localization options (translations)
final List localizationOptions;
- /// Explicit report modes map which will be used to trigger specific report
- /// mode for specific error
+ /// Explicit report modes map which will be used to trigger specific report mode
+ /// for specific error
final Map explicitExceptionReportModesMap;
/// Explicit report handler map which will be used to trigger specific report
@@ -64,7 +64,7 @@ class CatcherOptions {
this.explicitExceptionReportModesMap = const {},
this.explicitExceptionHandlersMap = const {},
this.handleSilentError = true,
- this.screenshotsPath = '',
+ this.screenshotsPath = "",
this.excludedParameters = const [],
this.filterFunction,
this.reportOccurrenceTimeout = 3000,
@@ -81,7 +81,7 @@ class CatcherOptions {
explicitExceptionReportModesMap = {},
explicitExceptionHandlersMap = {},
handleSilentError = true,
- screenshotsPath = '',
+ screenshotsPath = "",
excludedParameters = const [],
filterFunction = null,
reportOccurrenceTimeout = 3000,
@@ -97,7 +97,7 @@ class CatcherOptions {
explicitExceptionReportModesMap = {},
explicitExceptionHandlersMap = {},
handleSilentError = true,
- screenshotsPath = '',
+ screenshotsPath = "",
excludedParameters = const [],
filterFunction = null,
reportOccurrenceTimeout = 3000,
@@ -113,7 +113,7 @@ class CatcherOptions {
explicitExceptionReportModesMap = {},
explicitExceptionHandlersMap = {},
handleSilentError = true,
- screenshotsPath = '',
+ screenshotsPath = "",
excludedParameters = const [],
filterFunction = null,
reportOccurrenceTimeout = 3000,
diff --git a/lib/model/localization_options.dart b/lib/model/localization_options.dart
index 3f93364f0a94ca3cbe8e6398f8a98510538dadeb..aa501fbaa31b44fb1ba38eb96963564ddd810d43 100644
--- a/lib/model/localization_options.dart
+++ b/lib/model/localization_options.dart
@@ -18,336 +18,274 @@ class LocalizationOptions {
LocalizationOptions(
this.languageCode, {
- this.notificationReportModeTitle = 'Application error occurred',
+ this.notificationReportModeTitle = "Application error occurred",
this.notificationReportModeContent =
- 'Click here to send error report to support team.',
- this.dialogReportModeTitle = 'Crash',
+ "Click here to send error report to support team.",
+ this.dialogReportModeTitle = "Crash",
this.dialogReportModeDescription =
- 'Unexpected error occurred in application. Error report is ready to'
- ' send to support team. Please click Accept to send error report '
- 'or Cancel to dismiss report.',
- this.dialogReportModeAccept = 'Accept',
- this.dialogReportModeCancel = 'Cancel',
- this.pageReportModeTitle = 'Crash',
+ "Unexpected error occurred in application. Error report is ready to send to support team. Please click Accept to send error report or Cancel to dismiss report.",
+ this.dialogReportModeAccept = "Accept",
+ this.dialogReportModeCancel = "Cancel",
+ this.pageReportModeTitle = "Crash",
this.pageReportModeDescription =
- 'Unexpected error occurred in application. Error report is ready to'
- ' send to support team. Please click Accept to send error report '
- 'or Cancel to dismiss report.',
- this.pageReportModeAccept = 'Accept',
- this.pageReportModeCancel = 'Cancel',
- this.toastHandlerDescription = 'Error occurred:',
- this.snackbarHandlerDescription = 'Error occurred:',
+ "Unexpected error occurred in application. Error report is ready to send to support team. Please click Accept to send error report or Cancel to dismiss report.",
+ this.pageReportModeAccept = "Accept",
+ this.pageReportModeCancel = "Cancel",
+ this.toastHandlerDescription = "Error occurred:",
+ this.snackbarHandlerDescription = "Error occurred:",
});
static LocalizationOptions buildDefaultEnglishOptions() {
- return LocalizationOptions('en');
+ return LocalizationOptions("en");
}
static LocalizationOptions buildDefaultChineseOptions() {
return LocalizationOptions(
- 'zh',
- notificationReportModeTitle: '发生应用错误',
- notificationReportModeContent: '单击此处将错误报告发送给支持团队。',
- dialogReportModeTitle: '错误',
+ "zh",
+ notificationReportModeTitle: "发生应用错误",
+ notificationReportModeContent: "单击此处将错误报告发送给支持团队。",
+ dialogReportModeTitle: "错误",
dialogReportModeDescription:
- '应用程序中发生意外错误。 错误报告已准备好发送给支持团队。 请单击“接受”以发送错误报告,或单击“取消”以关闭报告。',
- dialogReportModeAccept: '接受',
- dialogReportModeCancel: '取消',
- pageReportModeTitle: '错误',
+ "应用程序中发生意外错误。 错误报告已准备好发送给支持团队。 请单击“接受”以发送错误报告,或单击“取消”以关闭报告。",
+ dialogReportModeAccept: "接受",
+ dialogReportModeCancel: "取消",
+ pageReportModeTitle: "错误",
pageReportModeDescription:
- '应用程序中发生意外错误。 错误报告已准备好发送给支持团队。 请单击“接受”以发送错误报告,或单击“取消”以关闭报告。',
- pageReportModeAccept: '接受',
- pageReportModeCancel: '取消',
- toastHandlerDescription: '发生了错误:',
- snackbarHandlerDescription: '发生了错误:',
+ "应用程序中发生意外错误。 错误报告已准备好发送给支持团队。 请单击“接受”以发送错误报告,或单击“取消”以关闭报告。",
+ pageReportModeAccept: "接受",
+ pageReportModeCancel: "取消",
+ toastHandlerDescription: "发生了错误:",
+ snackbarHandlerDescription: "发生了错误:",
);
}
static LocalizationOptions buildDefaultHindiOptions() {
return LocalizationOptions(
- 'hi',
- notificationReportModeTitle: 'एप्लिकेशन त्रुटि हुई',
+ "hi",
+ notificationReportModeTitle: "एप्लिकेशन त्रुटि हुई",
notificationReportModeContent:
- 'समर्थन टीम को त्रुटि रिपोर्ट भेजने के लिए यहां क्लिक करें।.',
- dialogReportModeTitle: 'दुर्घटना',
+ "समर्थन टीम को त्रुटि रिपोर्ट भेजने के लिए यहां क्लिक करें।.",
+ dialogReportModeTitle: "दुर्घटना",
dialogReportModeDescription:
- 'आवेदन में अप्रत्याशित त्रुटि हुई। त्रुटि रिपोर्ट समर्थन टीम को '
- 'भेजने के लिए तैयार है। कृपया त्रुटि रिपोर्ट भेजने के लिए '
- 'स्वीकार करें या रिपोर्ट को रद्द करने के लिए रद्द करें पर क्लिक '
- 'करें।',
- dialogReportModeAccept: 'स्वीकार करना',
- dialogReportModeCancel: 'रद्द करना',
- pageReportModeTitle: 'दुर्घटना',
+ "आवेदन में अप्रत्याशित त्रुटि हुई। त्रुटि रिपोर्ट समर्थन टीम को भेजने के लिए तैयार है। कृपया त्रुटि रिपोर्ट भेजने के लिए स्वीकार करें या रिपोर्ट को रद्द करने के लिए रद्द करें पर क्लिक करें।",
+ dialogReportModeAccept: "स्वीकार करना",
+ dialogReportModeCancel: "रद्द करना",
+ pageReportModeTitle: "दुर्घटना",
pageReportModeDescription:
- 'आवेदन में अप्रत्याशित त्रुटि हुई। त्रुटि रिपोर्ट समर्थन टीम को '
- 'भेजने के लिए तैयार है। कृपया त्रुटि रिपोर्ट भेजने के लिए '
- 'स्वीकार करें या रिपोर्ट को रद्द करने के लिए रद्द करें पर क्लिक '
- 'करें।',
- pageReportModeAccept: 'स्वीकार करना',
- pageReportModeCancel: 'रद्द करना',
- toastHandlerDescription: 'त्रुटि हुई:',
- snackbarHandlerDescription: 'त्रुटि हुई:',
+ "आवेदन में अप्रत्याशित त्रुटि हुई। त्रुटि रिपोर्ट समर्थन टीम को भेजने के लिए तैयार है। कृपया त्रुटि रिपोर्ट भेजने के लिए स्वीकार करें या रिपोर्ट को रद्द करने के लिए रद्द करें पर क्लिक करें।",
+ pageReportModeAccept: "स्वीकार करना",
+ pageReportModeCancel: "रद्द करना",
+ toastHandlerDescription: "त्रुटि हुई:",
+ snackbarHandlerDescription: "त्रुटि हुई:",
);
}
static LocalizationOptions buildDefaultSpanishOptions() {
return LocalizationOptions(
- 'es',
- notificationReportModeTitle: 'Error de aplicación ocurrió',
+ "es",
+ notificationReportModeTitle: "Error de aplicación ocurrió",
notificationReportModeContent:
- 'Haga clic aquí para enviar un informe de error al equipo de '
- 'soporte.',
- dialogReportModeTitle: 'Choque',
+ "Haga clic aquí para enviar un informe de error al equipo de soporte.",
+ dialogReportModeTitle: "Choque",
dialogReportModeDescription:
- 'Se ha producido un error inesperado en la aplicación. El informe '
- 'de errores está listo para enviar al equipo de soporte. '
- 'Haga clic en Aceptar para enviar el informe de errores o en '
- 'Cancelar para cancelar el informe.',
- dialogReportModeAccept: 'Aceptar',
- dialogReportModeCancel: 'Cancelar',
- pageReportModeTitle: 'Choque',
+ "Se ha producido un error inesperado en la aplicación. El informe de errores está listo para enviar al equipo de soporte. Haga clic en Aceptar para enviar el informe de errores o en Cancelar para cancelar el informe.",
+ dialogReportModeAccept: "Aceptar",
+ dialogReportModeCancel: "Cancelar",
+ pageReportModeTitle: "Choque",
pageReportModeDescription:
- 'Se ha producido un error inesperado en la aplicación. El informe '
- 'de errores está listo para enviar al equipo de soporte. Haga '
- 'clic en Aceptar para enviar el informe de errores o en '
- 'Cancelar para cancelar el informe.',
- pageReportModeAccept: 'Aceptar',
- pageReportModeCancel: 'Cancelar',
- toastHandlerDescription: 'Se produjo un error:',
- snackbarHandlerDescription: 'Se produjo un error:',
+ "Se ha producido un error inesperado en la aplicación. El informe de errores está listo para enviar al equipo de soporte. Haga clic en Aceptar para enviar el informe de errores o en Cancelar para cancelar el informe.",
+ pageReportModeAccept: "Aceptar",
+ pageReportModeCancel: "Cancelar",
+ toastHandlerDescription: "Se produjo un error:",
+ snackbarHandlerDescription: "Se produjo un error:",
);
}
static LocalizationOptions buildDefaultMalayOptions() {
return LocalizationOptions(
- 'ms',
- notificationReportModeTitle: 'Ralat permohonan berlaku',
+ "ms",
+ notificationReportModeTitle: "Ralat permohonan berlaku",
notificationReportModeContent:
- 'Klik di sini untuk menghantar laporan ralat untuk menyokong '
- 'pasukan.',
- dialogReportModeTitle: 'Kemalangan',
+ "Klik di sini untuk menghantar laporan ralat untuk menyokong pasukan.",
+ dialogReportModeTitle: "Kemalangan",
dialogReportModeDescription:
- 'Ralat tidak dijangka berlaku dalam aplikasi. Laporan ralat sedia '
- 'dihantar untuk menyokong pasukan. Sila klik Terima untuk '
- 'menghantar laporan ralat atau Batal untuk menolak laporan.',
- dialogReportModeAccept: 'Terima',
- dialogReportModeCancel: 'Batalkan',
- pageReportModeTitle: 'Kemalangan',
+ "Ralat tidak dijangka berlaku dalam aplikasi. Laporan ralat sedia dihantar untuk menyokong pasukan. Sila klik Terima untuk menghantar laporan ralat atau Batal untuk menolak laporan.",
+ dialogReportModeAccept: "Terima",
+ dialogReportModeCancel: "Batalkan",
+ pageReportModeTitle: "Kemalangan",
pageReportModeDescription:
- 'Ralat tidak dijangka berlaku dalam aplikasi. Laporan ralat sedia'
- ' dihantar untuk menyokong pasukan. Sila klik Terima untuk '
- 'menghantar laporan ralat atau Batal untuk menolak laporan.',
- pageReportModeAccept: 'Terima',
- pageReportModeCancel: 'Batalkan',
- toastHandlerDescription: 'Ralat berlaku:',
- snackbarHandlerDescription: 'Ralat berlaku:',
+ "Ralat tidak dijangka berlaku dalam aplikasi. Laporan ralat sedia dihantar untuk menyokong pasukan. Sila klik Terima untuk menghantar laporan ralat atau Batal untuk menolak laporan.",
+ pageReportModeAccept: "Terima",
+ pageReportModeCancel: "Batalkan",
+ toastHandlerDescription: "Ralat berlaku:",
+ snackbarHandlerDescription: "Ralat berlaku:",
);
}
static LocalizationOptions buildDefaultRussianOptions() {
return LocalizationOptions(
- 'ru',
- notificationReportModeTitle: 'Произошла ошибка приложения',
+ "ru",
+ notificationReportModeTitle: "Произошла ошибка приложения",
notificationReportModeContent:
- 'Нажмите здесь, чтобы отправить отчет об ошибке в службу поддержки.',
- dialogReportModeTitle: 'авария',
+ "Нажмите здесь, чтобы отправить отчет об ошибке в службу поддержки.",
+ dialogReportModeTitle: "авария",
dialogReportModeDescription:
- 'В приложении произошла непредвиденная ошибка. Отчет об ошибке готов '
- 'к отправке в службу поддержки. Пожалуйста, нажмите Принять, чтобы '
- 'отправить отчет об ошибке или Отмена, чтобы закрыть отчет.',
- dialogReportModeAccept: 'принимать',
- dialogReportModeCancel: 'отменить',
- pageReportModeTitle: 'авария',
+ "В приложении произошла непредвиденная ошибка. Отчет об ошибке готов к отправке в службу поддержки. Пожалуйста, нажмите Принять, чтобы отправить отчет об ошибке или Отмена, чтобы закрыть отчет.",
+ dialogReportModeAccept: "принимать",
+ dialogReportModeCancel: "отменить",
+ pageReportModeTitle: "авария",
pageReportModeDescription:
- 'В приложении произошла непредвиденная ошибка. Отчет об ошибке готов '
- 'к отправке в службу поддержки. Пожалуйста, нажмите Принять, чтобы '
- 'отправить отчет об ошибке или Отмена, чтобы закрыть отчет.',
- pageReportModeAccept: 'принимать',
- pageReportModeCancel: 'отменить',
- toastHandlerDescription: 'Произошла ошибка:',
- snackbarHandlerDescription: 'Произошла ошибка:',
+ "В приложении произошла непредвиденная ошибка. Отчет об ошибке готов к отправке в службу поддержки. Пожалуйста, нажмите Принять, чтобы отправить отчет об ошибке или Отмена, чтобы закрыть отчет.",
+ pageReportModeAccept: "принимать",
+ pageReportModeCancel: "отменить",
+ toastHandlerDescription: "Произошла ошибка:",
+ snackbarHandlerDescription: "Произошла ошибка:",
);
}
static LocalizationOptions buildDefaultPortugueseOptions() {
return LocalizationOptions(
- 'pt',
- notificationReportModeTitle: 'Erro na aplicação',
+ "pt",
+ notificationReportModeTitle: "Erro na aplicação",
notificationReportModeContent:
- 'Clique aqui para enviar o relatório de erros à equipe de suporte.',
- dialogReportModeTitle: 'Erro',
+ "Clique aqui para enviar o relatório de erros à equipe de suporte.",
+ dialogReportModeTitle: "Erro",
dialogReportModeDescription:
- 'Ocorreu um erro inesperado no aplicativo. O relatório de erros está '
- 'pronto para ser enviado à equipe de suporte. Por favor, clique em '
- 'Aceitar para enviar o relatório de erros ou em Cancelar para '
- 'descartar o relatório.',
- dialogReportModeAccept: 'Aceitar',
- dialogReportModeCancel: 'Cancelar',
- pageReportModeTitle: 'Erro',
+ "Ocorreu um erro inesperado no aplicativo. O relatório de erros está pronto para ser enviado à equipe de suporte. Por favor, clique em Aceitar para enviar o relatório de erros ou em Cancelar para descartar o relatório.",
+ dialogReportModeAccept: "Aceitar",
+ dialogReportModeCancel: "Cancelar",
+ pageReportModeTitle: "Erro",
pageReportModeDescription:
- 'Ocorreu um erro inesperado no aplicativo. O relatório de erros '
- 'está pronto para ser enviado à equipe de suporte. Por favor, clique '
- 'em Aceitar para enviar o relatório de erros ou em Cancelar para '
- 'descartar o relatório.',
- pageReportModeAccept: 'Aceitar',
- pageReportModeCancel: 'Cancelar',
- toastHandlerDescription: 'Ocorreu um erro:',
- snackbarHandlerDescription: 'Ocorreu um erro:',
+ "Ocorreu um erro inesperado no aplicativo. O relatório de erros está pronto para ser enviado à equipe de suporte. Por favor, clique em Aceitar para enviar o relatório de erros ou em Cancelar para descartar o relatório.",
+ pageReportModeAccept: "Aceitar",
+ pageReportModeCancel: "Cancelar",
+ toastHandlerDescription: "Ocorreu um erro:",
+ snackbarHandlerDescription: "Ocorreu um erro:",
);
}
static LocalizationOptions buildDefaultFrenchOptions() {
return LocalizationOptions(
- 'fr',
+ "fr",
notificationReportModeTitle: "Une erreur d'application s'est produite",
notificationReportModeContent:
"Cliquez ici pour envoyer un rapport d'erreur à l'équipe de support.",
- dialogReportModeTitle: 'Fracas',
+ dialogReportModeTitle: "Fracas",
dialogReportModeDescription:
- "Une erreur inattendue s'est produite dans l'application. Le rapport "
- "d'erreur est prêt à être envoyé à l'équipe de support. Cliquez sur "
- "Accepter pour envoyer le rapport d'erreur ou sur Annuler pour"
- ' rejeter le rapport.',
- dialogReportModeAccept: 'Acceptez',
- dialogReportModeCancel: 'Annuler',
- pageReportModeTitle: 'Fracas',
+ "Une erreur inattendue s'est produite dans l'application. Le rapport d'erreur est prêt à être envoyé à l'équipe de support. Cliquez sur Accepter pour envoyer le rapport d'erreur ou sur Annuler pour rejeter le rapport.",
+ dialogReportModeAccept: "Acceptez",
+ dialogReportModeCancel: "Annuler",
+ pageReportModeTitle: "Fracas",
pageReportModeDescription:
- "Une erreur inattendue s'est produite dans l'application. Le rapport "
- "d'erreur est prêt à être envoyé à l'équipe de support. Cliquez sur "
- "Accepter pour envoyer le rapport d'erreur ou sur Annuler pour "
- 'rejeter le rapport.',
- pageReportModeAccept: 'Acceptez',
- pageReportModeCancel: 'Annuler',
- toastHandlerDescription: 'Erreur est survenue:',
- snackbarHandlerDescription: 'Erreur est survenue:',
+ "Une erreur inattendue s'est produite dans l'application. Le rapport d'erreur est prêt à être envoyé à l'équipe de support. Cliquez sur Accepter pour envoyer le rapport d'erreur ou sur Annuler pour rejeter le rapport.",
+ pageReportModeAccept: "Acceptez",
+ pageReportModeCancel: "Annuler",
+ toastHandlerDescription: "Erreur est survenue:",
+ snackbarHandlerDescription: "Erreur est survenue:",
);
}
static LocalizationOptions buildDefaultPolishOptions() {
return LocalizationOptions(
- 'pl',
- notificationReportModeTitle: 'Wystąpił błąd aplikacji',
+ "pl",
+ notificationReportModeTitle: "Wystąpił błąd aplikacji",
notificationReportModeContent:
- 'Naciśnij tutaj aby wysłać raport do zespołu wpsarcia',
- dialogReportModeTitle: 'Błąd aplikacji',
+ "Naciśnij tutaj aby wysłać raport do zespołu wpsarcia",
+ dialogReportModeTitle: "Błąd aplikacji",
dialogReportModeDescription:
- 'Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest gotowy '
- 'do wysłania do zespołu wsparcia. Naciśnij akceptuj aby wysłać'
- ' raport lub odrzuć aby odrzucić raport.',
- dialogReportModeAccept: 'Akceptuj',
- dialogReportModeCancel: 'Odrzuć',
- pageReportModeTitle: 'Błąd aplikacji',
+ "Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj aby wysłać raport lub odrzuć aby odrzucić raport.",
+ dialogReportModeAccept: "Akceptuj",
+ dialogReportModeCancel: "Odrzuć",
+ pageReportModeTitle: "Błąd aplikacji",
pageReportModeDescription:
- 'Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest '
- 'gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj aby '
- 'wysłać raport lub odrzuć aby odrzucić raport.',
- pageReportModeAccept: 'Akceptuj',
- pageReportModeCancel: 'Odrzuć',
- toastHandlerDescription: 'Wystąpił błąd:',
- snackbarHandlerDescription: 'Wystąpił błąd:',
+ "Wystąpił niespodziewany błąd aplikacji. Raport z błędem jest gotowy do wysłania do zespołu wsparcia. Naciśnij akceptuj aby wysłać raport lub odrzuć aby odrzucić raport.",
+ pageReportModeAccept: "Akceptuj",
+ pageReportModeCancel: "Odrzuć",
+ toastHandlerDescription: "Wystąpił błąd:",
+ snackbarHandlerDescription: "Wystąpił błąd:",
);
}
static LocalizationOptions buildDefaultItalianOptions() {
return LocalizationOptions(
'it',
- notificationReportModeTitle: 'Si è verificato un errore',
+ notificationReportModeTitle: "Si è verificato un errore",
notificationReportModeContent:
- "Clicca qui per inviare il report relativo all'errore al team di "
- 'support.',
- dialogReportModeTitle: 'Errore',
+ "Clicca qui per inviare il report relativo all'errore al team di supporto.",
+ dialogReportModeTitle: "Errore",
dialogReportModeDescription:
- "Si è verificato un errore imprevisto durante l'esecuzione. "
- 'Il report è pronto per essere inviato al team di supporto. '
- 'Clicca Acetate per inviare il report or Annulla per rifiutare.',
- dialogReportModeAccept: 'Accetta',
- dialogReportModeCancel: 'Annulla',
- pageReportModeTitle: 'Errore',
+ "Si è verificato un errore imprevisto durante l'esecuzione. Il report è pronto per essere inviato al team di supporto. Clicca Accetta per inviare il report or Annulla per rifiutare.",
+ dialogReportModeAccept: "Accetta",
+ dialogReportModeCancel: "Annulla",
+ pageReportModeTitle: "Errore",
pageReportModeDescription:
- "Si è verificato un errore imprevisto durante l'esecuzione. "
- 'Il report è pronto per essere inviato al team di supporto. '
- 'Clicca Acetate per inviare il report or Annulla per rifiutare.',
- pageReportModeAccept: 'Accetta',
- pageReportModeCancel: 'Annulla',
- toastHandlerDescription: 'Errore:',
- snackbarHandlerDescription: 'Errore:',
+ "Si è verificato un errore imprevisto durante l'esecuzione. Il report è pronto per essere inviato al team di supporto. Clicca Accetta per inviare il report or Annulla per rifiutare.",
+ pageReportModeAccept: "Accetta",
+ pageReportModeCancel: "Annulla",
+ toastHandlerDescription: "Errore:",
+ snackbarHandlerDescription: "Errore:",
);
}
static LocalizationOptions buildDefaultKoreanOptions() {
return LocalizationOptions(
'ko',
- notificationReportModeTitle: '어플리케이션 에러 발생',
- notificationReportModeContent: '지원팀에 오류를 보고하시려면 여기를 클릭하세요',
- dialogReportModeTitle: '에러',
+ notificationReportModeTitle: "어플리케이션 에러 발생",
+ notificationReportModeContent: "지원팀에 오류를 보고하시려면 여기를 클릭하세요",
+ dialogReportModeTitle: "에러",
dialogReportModeDescription:
- '어플리케이션에서 예기치 않은 오류가 발생했습니다. 지원팀에 오류를 보고할 준비가 되어'
- ' 있으니 수락을 클릭하여 오류 보고서를 전송하시거나 취소를 클릭하여 보고서를 닫으세요.',
- dialogReportModeAccept: '수락',
- dialogReportModeCancel: '취소',
- pageReportModeTitle: '에러',
- pageReportModeDescription: '어플리케이션에서 예기치 않은 오류가 발생했습니다. 지원팀에 오류를 보고할 '
- '준비가 되어 있으니 수락을 클릭하여 오류 보고서를 전송하시거나 취소를 클릭하여 보고서를 닫으세요.',
- pageReportModeAccept: '수락',
- pageReportModeCancel: '취소',
- toastHandlerDescription: '오류가 발생했습니다:',
- snackbarHandlerDescription: '오류가 발생했습니다:',
+ "어플리케이션에서 예기치 않은 오류가 발생했습니다. 지원팀에 오류를 보고할 준비가 되어 있으니 수락을 클릭하여 오류 보고서를 전송하시거나 취소를 클릭하여 보고서를 닫으세요.",
+ dialogReportModeAccept: "수락",
+ dialogReportModeCancel: "취소",
+ pageReportModeTitle: "에러",
+ pageReportModeDescription:
+ "어플리케이션에서 예기치 않은 오류가 발생했습니다. 지원팀에 오류를 보고할 준비가 되어 있으니 수락을 클릭하여 오류 보고서를 전송하시거나 취소를 클릭하여 보고서를 닫으세요.",
+ pageReportModeAccept: "수락",
+ pageReportModeCancel: "취소",
+ toastHandlerDescription: "오류가 발생했습니다:",
+ snackbarHandlerDescription: "오류가 발생했습니다:",
);
}
static LocalizationOptions buildDefaultDutchOptions() {
return LocalizationOptions(
- 'nl',
- notificationReportModeTitle: 'Er is een fout opgetreden',
+ "nl",
+ notificationReportModeTitle: "Er is een fout opgetreden",
notificationReportModeContent:
- 'Klik hier om het foutrapport te versturen naar het '
- 'ondersteuningsteam.',
- dialogReportModeTitle: 'Error',
+ "Klik hier om het foutrapport te versturen naar het ondersteuningsteam.",
+ dialogReportModeTitle: "Error",
dialogReportModeDescription:
- 'Er is een onverwachte fout opgetreden in de applicatie. '
- 'Het foutrapport is klaar om naar het ondersteuningsteam te '
- 'worden verstuurd. Druk op accepteer om het rapport te versturen '
- 'of op annuleer om het rapport te verwijderen.',
- dialogReportModeAccept: 'Accepteer',
- dialogReportModeCancel: 'Annuleer',
- pageReportModeTitle: 'Error',
+ "Er is een onverwachte fout opgetreden in de applicatie. Het foutrapport is klaar om naar het ondersteuningsteam te worden verstuurd. Druk op accepteer om het rapport te versturen of op annuleer om het rapport te verwijderen.",
+ dialogReportModeAccept: "Accepteer",
+ dialogReportModeCancel: "Annuleer",
+ pageReportModeTitle: "Error",
pageReportModeDescription:
- 'Er is een onverwachte fout opgetreden in de applicatie. Het '
- 'foutrapport is klaar om naar het ondersteuningsteam te worden '
- 'verstuurd. Druk op accepteer om het rapport te versturen of op '
- 'annuleer om het rapport te verwijderen.',
- pageReportModeAccept: 'Accepteer',
- pageReportModeCancel: 'Annuleer',
- toastHandlerDescription: 'Der er sket en fejl:',
- snackbarHandlerDescription: 'Der er sket en fejl:',
+ "Er is een onverwachte fout opgetreden in de applicatie. Het foutrapport is klaar om naar het ondersteuningsteam te worden verstuurd. Druk op accepteer om het rapport te versturen of op annuleer om het rapport te verwijderen.",
+ pageReportModeAccept: "Accepteer",
+ pageReportModeCancel: "Annuleer",
+ toastHandlerDescription: "Der er sket en fejl:",
+ snackbarHandlerDescription: "Der er sket en fejl:",
);
}
static LocalizationOptions buildDefaultGermanOptions() {
return LocalizationOptions(
- 'de',
- notificationReportModeTitle: 'Ein Anwendungsfehler ist aufgetreten',
+ "de",
+ notificationReportModeTitle: "Ein Anwendungsfehler ist aufgetreten",
notificationReportModeContent:
- 'Klicken Sie hier, um einen Fehlerbericht an das Support-Team zu '
- 'senden.',
- dialogReportModeTitle: 'Absturz',
+ "Klicken Sie hier, um einen Fehlerbericht an das Support-Team zu senden.",
+ dialogReportModeTitle: "Absturz",
dialogReportModeDescription:
- 'Unerwarteter Fehler in der Anwendung aufgetreten. Der '
- 'Fehlerbericht ist bereit zum Senden an das Support-Team. '
- 'Bitte klicken Sie auf Akzeptieren, um den Fehlerbericht zu '
- 'senden, oder auf Abbrechen, um den Bericht zu verwerfen.',
- dialogReportModeAccept: 'Akzeptieren',
- dialogReportModeCancel: 'Abbrechen',
- pageReportModeTitle: 'Absturz',
+ "Unerwarteter Fehler in der Anwendung aufgetreten. Der Fehlerbericht ist bereit zum Senden an das Support-Team. Bitte klicken Sie auf Akzeptieren, um den Fehlerbericht zu senden, oder auf Abbrechen, um den Bericht zu verwerfen.",
+ dialogReportModeAccept: "Akzeptieren",
+ dialogReportModeCancel: "Abbrechen",
+ pageReportModeTitle: "Absturz",
pageReportModeDescription:
- 'Unerwarteter Fehler in der Anwendung aufgetreten. Der Fehlerbericht'
- ' ist bereit zum Senden an das Support-Team. Bitte klicken Sie '
- 'auf Akzeptieren, um den Fehlerbericht zu senden, oder auf Abbrechen,'
- ' um den Bericht zu verwerfen.',
- pageReportModeAccept: 'Akzeptieren',
- pageReportModeCancel: 'Abbrechen',
- toastHandlerDescription: 'Es ist ein Fehler aufgetreten:',
- snackbarHandlerDescription: 'Es ist ein Fehler aufgetreten:',
+ "Unerwarteter Fehler in der Anwendung aufgetreten. Der Fehlerbericht ist bereit zum Senden an das Support-Team. Bitte klicken Sie auf Akzeptieren, um den Fehlerbericht zu senden, oder auf Abbrechen, um den Bericht zu verwerfen.",
+ pageReportModeAccept: "Akzeptieren",
+ pageReportModeCancel: "Abbrechen",
+ toastHandlerDescription: "Es ist ein Fehler aufgetreten:",
+ snackbarHandlerDescription: "Es ist ein Fehler aufgetreten:",
);
}
diff --git a/lib/model/platform_type.dart b/lib/model/platform_type.dart
index cb5bf064f162cb8b25c21bd5d6163af9a97a7fd4..c7d7759690442a038b31f64696fb7963bbe84a84 100644
--- a/lib/model/platform_type.dart
+++ b/lib/model/platform_type.dart
@@ -5,5 +5,6 @@ enum PlatformType {
macOS,
linux,
windows,
+ ohos,
unknown,
}
diff --git a/lib/model/report.dart b/lib/model/report.dart
index 90029329a554d2d19b697cdae3d8f226e744eadc..40452ebe71bae3193c5ede67cb53d96576024c8b 100644
--- a/lib/model/report.dart
+++ b/lib/model/report.dart
@@ -52,23 +52,23 @@ class Report {
bool enableStackTrace = true,
bool enableCustomParameters = false,
}) {
- final json = {
- 'error': error.toString(),
- 'customParameters': customParameters,
- 'dateTime': dateTime.toIso8601String(),
- 'platformType': describeEnum(platformType),
+ final Map json = {
+ "error": error.toString(),
+ "customParameters": customParameters,
+ "dateTime": dateTime.toIso8601String(),
+ "platformType": describeEnum(platformType),
};
if (enableDeviceParameters) {
- json['deviceParameters'] = deviceParameters;
+ json["deviceParameters"] = deviceParameters;
}
if (enableApplicationParameters) {
- json['applicationParameters'] = applicationParameters;
+ json["applicationParameters"] = applicationParameters;
}
if (enableStackTrace) {
- json['stackTrace'] = stackTrace.toString();
+ json["stackTrace"] = stackTrace.toString();
}
if (enableCustomParameters) {
- json['customParameters'] = customParameters;
+ json["customParameters"] = customParameters;
}
return json;
}
diff --git a/lib/model/report_handler.dart b/lib/model/report_handler.dart
index 265ee196de2753d3826347af22c2e5e9d4b5e5a3..5140708ab0a5db93a770c81218abe7cebb0a70c4 100644
--- a/lib/model/report_handler.dart
+++ b/lib/model/report_handler.dart
@@ -1,15 +1,16 @@
-import 'package:catcher/model/localization_options.dart';
import 'package:catcher/model/platform_type.dart';
import 'package:catcher/model/report.dart';
import 'package:catcher/utils/catcher_logger.dart';
import 'package:flutter/material.dart';
+import 'localization_options.dart';
+
abstract class ReportHandler {
///Logger instance
late CatcherLogger logger;
/// Method called when report has been accepted by user
- Future handle(Report report, BuildContext? context);
+ Future handle(Report error, BuildContext? context);
/// Get list of supported platforms
List getSupportedPlatforms();
diff --git a/lib/utils/catcher_error_widget.dart b/lib/utils/catcher_error_widget.dart
index 32dcb16852c58b39c01eef7fcc7e97455f8a8778..841727a4ab8cc8e5e9d42ffaa9090f5fe83a89b7 100644
--- a/lib/utils/catcher_error_widget.dart
+++ b/lib/utils/catcher_error_widget.dart
@@ -8,16 +8,14 @@ class CatcherErrorWidget extends StatelessWidget {
final double maxWidthForSmallMode;
const CatcherErrorWidget({
+ Key? key,
+ this.details,
required this.showStacktrace,
required this.title,
required this.description,
required this.maxWidthForSmallMode,
- super.key,
- this.details,
- }) : assert(
- maxWidthForSmallMode > 0,
- 'Max width for small mode must be greater than 0',
- );
+ }) : assert(maxWidthForSmallMode > 0),
+ super(key: key);
@override
Widget build(BuildContext context) {
@@ -60,7 +58,7 @@ class CatcherErrorWidget extends StatelessWidget {
textAlign: TextAlign.center,
),
const SizedBox(height: 10),
- _buildStackTraceWidget(),
+ _buildStackTraceWidget()
],
),
),
@@ -77,19 +75,18 @@ class CatcherErrorWidget extends StatelessWidget {
Widget _buildStackTraceWidget() {
if (showStacktrace) {
- final items = [];
+ final List items = [];
if (details != null) {
- items
- ..add(details!.exception.toString())
- ..addAll(details!.stack.toString().split('\n'));
+ items.add(details!.exception.toString());
+ items.addAll(details!.stack.toString().split("\n"));
}
return ListView.builder(
- padding: const EdgeInsets.all(8),
+ padding: const EdgeInsets.all(8.0),
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
itemCount: items.length,
itemBuilder: (BuildContext context, int index) {
- final line = items[index];
+ final String line = items[index];
if (line.isNotEmpty == true) {
return Text(line);
} else {
@@ -103,9 +100,9 @@ class CatcherErrorWidget extends StatelessWidget {
}
String _getDescription() {
- var descriptionText = description;
+ String descriptionText = description;
if (showStacktrace) {
- descriptionText += ' See details below.';
+ descriptionText += " See details below.";
}
return descriptionText;
}
diff --git a/lib/utils/catcher_logger.dart b/lib/utils/catcher_logger.dart
index 73c03503d01fc166f438bd3f74c216cccc89b52e..d20768b2b78d9049b56a91b23075af242cc1c4ec 100644
--- a/lib/utils/catcher_logger.dart
+++ b/lib/utils/catcher_logger.dart
@@ -2,7 +2,7 @@ import 'package:logging/logging.dart';
///Class used to provide logger for Catcher.
class CatcherLogger {
- final Logger _logger = Logger('Catcher');
+ final Logger _logger = Logger("Catcher");
///Setup logger configuration.
void setup() {
@@ -11,8 +11,7 @@ class CatcherLogger {
(LogRecord rec) {
// ignore: avoid_print
print(
- '[${rec.time} | ${rec.loggerName} | ${rec.level.name}] '
- '${rec.message}',
+ '[${rec.time} | ${rec.loggerName} | ${rec.level.name}] ${rec.message}',
);
},
);
diff --git a/ohos/.gitignore b/ohos/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..17627396ed3099d98c9d07fba45fc49e9f698449
--- /dev/null
+++ b/ohos/.gitignore
@@ -0,0 +1,9 @@
+/node_modules
+/oh_modules
+/.preview
+/build
+/.cxx
+/.test
+/default
+**/oh-package-lock.json5
+**/BuildProfile.ets
\ No newline at end of file
diff --git a/ohos/build-profile.json5 b/ohos/build-profile.json5
new file mode 100644
index 0000000000000000000000000000000000000000..79961f96a6fe0507354b7952a378c3be2ae4bfab
--- /dev/null
+++ b/ohos/build-profile.json5
@@ -0,0 +1,10 @@
+{
+ "apiType": "stageMode",
+ "buildOption": {
+ },
+ "targets": [
+ {
+ "name": "default"
+ }
+ ]
+}
diff --git a/ohos/hvigorfile.ts b/ohos/hvigorfile.ts
new file mode 100644
index 0000000000000000000000000000000000000000..968e0982d02d2e5cb4348c7233e8227f0b39ca25
--- /dev/null
+++ b/ohos/hvigorfile.ts
@@ -0,0 +1,17 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
+export { harTasks } from '@ohos/hvigor-ohos-plugin';
\ No newline at end of file
diff --git a/ohos/index.ets b/ohos/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c3cf5e0379055e39849180abdbeadacf1251698a
--- /dev/null
+++ b/ohos/index.ets
@@ -0,0 +1,17 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+import CatcherPlugin from './src/main/ets/com/jhomlala/catcher/CatcherPlugin';
+export default CatcherPlugin;
diff --git a/ohos/oh-package.json5 b/ohos/oh-package.json5
new file mode 100644
index 0000000000000000000000000000000000000000..e1e2ce5da46bc0acaf4adcb235e0036815bbf558
--- /dev/null
+++ b/ohos/oh-package.json5
@@ -0,0 +1,11 @@
+{
+ "name": "catcher",
+ "version": "1.0.0",
+ "description": "Please describe the basic information.",
+ "main": "index.ets",
+ "author": "",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@ohos/flutter_ohos": "file:./har/flutter.har"
+ }
+}
diff --git a/ohos/src/main/ets/com/jhomlala/catcher/CatcherPlugin.ets b/ohos/src/main/ets/com/jhomlala/catcher/CatcherPlugin.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6b3cec8f162d7e65fb5d1ccd3449d998824910cc
--- /dev/null
+++ b/ohos/src/main/ets/com/jhomlala/catcher/CatcherPlugin.ets
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+* 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.
+*/
+
+import { FlutterPlugin, FlutterPluginBinding } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/plugins/FlutterPlugin';
+import MethodChannel, { MethodCallHandler, MethodResult } from '@ohos/flutter_ohos/src/main/ets/plugin/common/MethodChannel';
+import MethodCall from '@ohos/flutter_ohos/src/main/ets/plugin/common/MethodCall';
+
+/** CatcherPlugin **/
+export default class CatcherPlugin implements FlutterPlugin, MethodCallHandler {
+ private channel: MethodChannel | null = null;
+
+ constructor() {
+ }
+
+ getUniqueClassName(): string {
+ return "CatcherPlugin"
+ }
+
+ onAttachedToEngine(binding: FlutterPluginBinding): void {
+ this.channel = new MethodChannel(binding.getBinaryMessenger(), "catcher");
+ this.channel.setMethodCallHandler(this)
+ }
+
+ onDetachedFromEngine(binding: FlutterPluginBinding): void {
+ if (this.channel != null) {
+ this.channel.setMethodCallHandler(null)
+ }
+ }
+
+ onMethodCall(call: MethodCall, result: MethodResult): void {
+ if (call.method == "getPlatformVersion") {
+ result.success("OpenHarmony ^ ^ ")
+ } else {
+ result.notImplemented()
+ }
+ }
+}
\ No newline at end of file
diff --git a/ohos/src/main/module.json5 b/ohos/src/main/module.json5
new file mode 100644
index 0000000000000000000000000000000000000000..ed49e26c8645cf2867863e07b36511a8c6915648
--- /dev/null
+++ b/ohos/src/main/module.json5
@@ -0,0 +1,10 @@
+{
+ "module": {
+ "name": "catcher",
+ "type": "har",
+ "deviceTypes": [
+ "default",
+ "tablet"
+ ]
+ }
+}
diff --git a/ohos/src/main/resources/base/element/string.json b/ohos/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed
--- /dev/null
+++ b/ohos/src/main/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "page_show",
+ "value": "page from npm package"
+ }
+ ]
+}
diff --git a/ohos/src/main/resources/en_US/element/string.json b/ohos/src/main/resources/en_US/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed
--- /dev/null
+++ b/ohos/src/main/resources/en_US/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "page_show",
+ "value": "page from npm package"
+ }
+ ]
+}
diff --git a/ohos/src/main/resources/zh_CN/element/string.json b/ohos/src/main/resources/zh_CN/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed
--- /dev/null
+++ b/ohos/src/main/resources/zh_CN/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "page_show",
+ "value": "page from npm package"
+ }
+ ]
+}
diff --git a/pubspec.yaml b/pubspec.yaml
index 8b18a841955568dedf68e327378f32242238e57a..445b80aabbb7e0e10e525bafd536c6e4c1339d0e 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,19 +1,11 @@
name: catcher
description: Plugin for error catching which provides multiple handlers for dealing with errors when they are not caught by the developer.
-version: 0.8.0
+version: 0.7.0
#author: Jakub Homlala
homepage: https://github.com/jhomlala/catcher
-repository: https://github.com/jhomlala/catcher
-issue_tracker: https://github.com/jhomlala/catcher/issues
-topics:
- - error
- - errors
- - logs
- - devtools
- - tool
environment:
- sdk: '>=2.19.6 <4.0.0'
+ sdk: '>=2.12.0 <3.0.0'
flutter: ">=3.0.0"
dependencies:
@@ -21,20 +13,29 @@ dependencies:
sdk: flutter
flutter_web_plugins:
sdk: flutter
- fluttertoast: ^8.2.3
- device_info_plus: ^9.1.0
device_info_plus_platform_interface: ^7.0.0
- package_info_plus: ^4.2.0
- mailer: ^6.0.1
- dio: ^5.3.3
- flutter_mailer: ^2.0.0
+ mailer: ^5.0.2
+ dio: ^4.0.1
+ flutter_mailer:
+ git:
+ url: "https://gitee.com/openharmony-sig/fluttertpc_flutter_mailer.git"
logging: ^1.0.2
- sentry: ^7.12.0
+ sentry: ^6.1.0
universal_io: ^2.0.4
- very_good_analysis: ^5.1.0
+ fluttertoast:
+ git:
+ url: "https://gitee.com/openharmony-sig/flutter_fluttertoast.git"
+ device_info_plus:
+ git:
+ url: "https://gitee.com/openharmony-sig/flutter_plus_plugins.git"
+ path: "packages/device_info_plus/device_info_plus"
+ package_info_plus:
+ git:
+ url: "https://gitee.com/openharmony-sig/flutter_plus_plugins.git"
+ path: "packages/package_info_plus/package_info_plus"
dev_dependencies:
- lint: ^2.1.2
+ lint: ^1.7.2
flutter:
plugin:
@@ -53,3 +54,6 @@ flutter:
pluginClass: CatcherPlugin
linux:
pluginClass: CatcherPlugin
+ ohos:
+ pluginClass: CatcherPlugin
+
diff --git a/test/catcher_test.dart b/test/catcher_test.dart
deleted file mode 100644
index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000
--- a/test/catcher_test.dart
+++ /dev/null
@@ -1 +0,0 @@
-