diff --git a/Ability/UIAbilityLifeCycle/AppScope/app.json5 b/Ability/UIAbilityLifeCycle/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1648b84731ab5394f0079adb9d9dc9c4296a7a3f --- /dev/null +++ b/Ability/UIAbilityLifeCycle/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.uiabilitylifecycle", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/Ability/UIAbilityLifeCycle/AppScope/resources/base/element/string.json b/Ability/UIAbilityLifeCycle/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f6e67ad30ee68ce88de92cab89a5f153769d0cd7 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "UIAbilityLifeCycle" + } + ] +} diff --git a/Ability/UIAbilityLifeCycle/AppScope/resources/base/media/app_icon.png b/Ability/UIAbilityLifeCycle/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Ability/UIAbilityLifeCycle/AppScope/resources/base/media/app_icon.png differ diff --git a/Ability/UIAbilityLifeCycle/LICENSE b/Ability/UIAbilityLifeCycle/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/README.md b/Ability/UIAbilityLifeCycle/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bd188c3e3c6381b2d575aacfc438e4903c39c050 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/README.md @@ -0,0 +1,261 @@ +# UIAbility和自定义组件生命周期(ArkTS) + +## 介绍 + +本文档主要描述了应用运行过程中UIAbility和自定义组件的生命周期。对于UIAbility,描述了Create、Foreground、Background、Destroy四种生命周期。对于页面和自定义组件描述了aboutToAppear、onPageShow、onPageHide、onBackPress、aboutToDisappear五种生命周期。 + +### 相关概念 + +- [UIAbility](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md):UIAbility是包含UI界面的应用组件,提供组件创建、销毁、前后台切换等生命周期回调,同时也具备组件协同的能力。 +- [自定义组件的生命周期](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-custom-component-lifecycle.md#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F):自定义组件的生命周期回调函数用于通知用户该自定义组件的生命周期,这些回调函数是私有的,在运行时由开发框架在特定的时间进行调用,不能从应用程序中手动调用这些回调函数。 +- [窗口开发指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/windowmanager/window-overview.md):窗口模块用于在同一块物理屏幕上,提供多个应用界面显示、交互的机制。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001554588725.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──constants +│ │ │ └──CommonConstants.ets // 公共常量类 +│ │ └──util +│ │ └──Logger.ets // 日志管理工具类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ └──pages +│ └──LifeCyclePage.ets // 跳转页 +└──entry/src/main/resources // 资源文件目录 +``` + +## UIAbility生命周期 + +当用户打开、切换和返回到应用时,UIAbility实例会在其生命周期的不同状态之间转换。UIAbility类提供了一系列回调,通过这些回调可以知道当前UIAbility实例的某个状态发生改变,UIAbility实例的创建和销毁,或者UIAbility实例发生了前后台的状态切换。Create、Foreground、Background、Destroy四个状态,如图所示: + +![](/figures/UIAbility全生命周期.png) + +**Create状态**:在应用首次创建UIAbility实例时触发,此时系统会调用onCreate\(\)回调。可以在该回调中进行应用初始化操作,例如变量定义资源加载等,用于后续的UI界面展示。 + +```typescript +// EntryAbility.ts +import UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + // 初始化应用 + ... + } + ... +} +``` + +**WindowStageCreate和WindowStageDestory状态**:UIAbility实例创建完成之后,在进入Foreground之前,系统会创建一个WindowStage。WindowStage创建完成后会进入onWindowStageCreate\(\)回调,可以在该回调中设置UI界面加载、设置WindowStage的事件订阅。 + +![](/figures/WindowStage状态.png) + +在onWindowStageCreate\(\)回调中通过loadContent\(\)方法设置应用要加载的页面,并根据需要调用on\('windowStageEvent'\)方法订阅WindowStage的事件(获焦/失焦、可见/不可见)。 + +```typescript +// EntryAbility.ts +import UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + ... + onWindowStageCreate(windowStage: Window.WindowStage) { + // 设置WindowStage事件订阅(获取/失焦、可见/不可见) + try { + windowStage.on('windowStageEvent', (data) => { + hilog.info(0x0000, 'testTag', 'Succeeded in enabling the listener for window stage event changes. Data: ' + + JSON.stringify(data)); + }); + } catch (exception) { + hilog.info(0x0000, 'testTag', 'Failed to enable the listener for window stage event changes. Cause:' + + JSON.stringify(exception)); + } + // 设置UI加载 + windowStage.loadContent('pages/LifeCyclePage', (err, data) => { + ... + }); + } +} +``` + +**Foreground和Background状态** + +Foreground和Background状态分别在UIAbility实例切换至前台和切换至后台时触发,对应于onForeground\(\)回调和onBackground\(\)回调。 + +- onForeground\(\)回调,在UIAbility的UI界面可见之前,如UIAbility切换至前台时触发。可以在onForeground\(\)回调中申请系统需要的资源,或者重新申请在onBackground\(\)中释放的资源。 +- onBackground\(\)回调,在UIAbility的UI界面完全不可见之后,如UIAbility切换至后台时触发。可以在onBackground\(\)回调中释放UI界面不可见时无用的资源,或者在此回调中执行较为耗时的操作,例如状态保存等。 + +例如应用在使用过程中需要使用用户定位时,假设应用已获得用户的定位权限授权。在UI界面显示之前,可以在onForeground\(\)回调中开启定位功能,从而获取到当前的位置信息。 + +当应用切换到后台状态,可以在onBackground\(\)回调中停止定位功能,以节省系统的资源消耗。 + +```typescript +// EntryAbility.ts +import UIAbility from '@ohos.app.ability.UIAbility'; + +export default class EntryAbility extends UIAbility { + ... + onForeground() { + // 申请系统所需的资源或在onBackground中申请释放的资源 + } + + onBackground() { + // UI不可见时释放无用资源,或在此回调中执行耗时操作 + // 例如,状态保存 + } +} +``` + +**Destory状态** + +Destroy状态在UIAbility实例销毁时触发。可以在onDestroy\(\)回调中进行系统资源的释放、数据的保存等操作。 + +例如调用terminateSelf\(\)方法停止当前UIAbility实例,从而完成UIAbility实例的销毁;或者用户使用最近任务列表关闭该UIAbility实例,完成UIAbility的销毁。 + +```typescript +// EntryAbility.ts +import UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + ... + onDestroy() { + // 释放系统资源,保存数据 + } +} +``` + +## 自定义组件生命周期 + +自定义组件的生命周期回调函数用于通知用户该自定义组件的生命周期,这些回调函数是私有的,在运行时由开发框架在特定的时间进行调用,不能从应用程序中手动调用这些回调函数。 + +>![](/public_sys-resources/icon-note.gif) **说明:** +> +>- 允许在生命周期函数中使用Promise和异步回调函数,比如网络资源获取,定时器设置等。 + +自定义组件的生命周期包括aboutToAppear、onPageShow、onPageHide、onBackPress、aboutToDisappear五种状态,如图所示: + +![](/figures/zh-cn_image_0000001547389382.png) + +- **aboutToAppear** + + aboutToAppear?\(\): void + + aboutToAppear函数在创建自定义组件的新实例后,在执行其build\(\)函数之前执行。允许在aboutToAppear函数中改变状态变量,更改将在后续执行build\(\)函数中生效。 + + +- **aboutToDisappear** + + aboutToDisappear?\(\): void + + aboutToDisappear函数在自定义组件析构销毁之前执行。不允许在aboutToDisappear函数中改变状态变量,特别是@Link变量的修改可能会导致应用程序行为不稳定。 + + +- **onPageShow** + + onPageShow?\(\): void + + 页面每次显示时触发一次,包括路由过程、应用进入前后台等场景,仅**@Entry**修饰的自定义组件生效。 + + +- **onPageHide** + + onPageHide?\(\): void + + 页面每次隐藏时触发一次,包括路由过程、应用进入前后台等场景,仅**@Entry**修饰的自定义组件生效。 + + +- **onBackPress** + + onBackPress?\(\): void + + 当用户点击返回按钮时触发,仅**@Entry**装饰的自定义组件生效。 + + ```typescript + // LifeCyclePage.ets + @Entry + @Component + struct LifeCyclePage { + @State textColor: Color = Color.Black; + + aboutToAppear() { + this.textColor = Color.Blue; + Logger.info('[LifeCyclePage] LifeCyclePage aboutToAppear') + } + + onPageShow() { + this.textColor = Color.Brown; + Logger.info('[LifeCyclePage] LifeCyclePage onPageShow') + } + + onPageHide() { + Logger.info('[LifeCyclePage] LifeCyclePage onPageHide') + } + + onBackPress() { + this.textColor = Color.Red; + Logger.info('[LifeCyclePage] LifeCyclePage onBackPress') + return false; + } + + aboutToDisappear() { + Logger.info('[LifeCyclePage] LifeCyclePage aboutToDisappear') + } + + build() { + Column() { + Text($r('app.string.hello_message')) + .fontSize(CommonConstants.DEFAULT_FONT_SIZE) + .fontColor(this.textColor) + .margin(CommonConstants.DEFAULT_MARGIN) + .fontWeight(FontWeight.Bold) + } + .width(CommonConstants.FULL_WIDTH) + } + } + ``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. UIAbility生命周期。 + +2. 自定义组件生命周期。 + +![](figures/zh-cn_image_0000001509916136.gif) \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/build-profile.json5 b/Ability/UIAbilityLifeCycle/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/build-profile.json5 b/Ability/UIAbilityLifeCycle/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/hvigorfile.ts b/Ability/UIAbilityLifeCycle/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/Ability/UIAbilityLifeCycle/entry/oh-package.json5 b/Ability/UIAbilityLifeCycle/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/constants/CommonConstants.ets b/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..bd4f788eaaee8a8475a00a446043dffe2e7391df --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export default class CommonConstants{ + /** + * The text high + */ + static TEXT_HEIGHT: number = 50; + + /** + * The text width + */ + static DEFAULT_MARGIN: number = 30; + + /** + * Full the width. + */ + static FULL_WIDTH: string = '100%'; + + /** + * Full the height. + */ + static FULL_HEIGHT: string = '100%'; + + /** + * Default fontSize + */ + static DEFAULT_FONT_SIZE: number = 30; + + /* + * Log Domain + * */ + static DOMAIN: number = 0x0000; +} diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/util/Logger.ets b/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/util/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..b80b518a37fcda3b94145589136db036d3ca7058 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/util/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('UIAbilityLifeCycle', 0xFF00) \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/ets/entryability/EntryAbility.ts b/Ability/UIAbilityLifeCycle/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..196e7c9416dade499c01a47d217bf34cc4ef02ef --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; +import Want from '@ohos.app.ability.Want'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + +export default class EntryAbility extends UIAbility { + windowStage: window.WindowStage; + tag: string = 'EntryAbility'; + domain: number = 0x0000; + want: Want; + launchParam: AbilityConstant.LaunchParam; + + onCreate(want, launchParam) { + this.want = want; + this.launchParam = launchParam; + hilog.info(this.domain, this.tag, 'Ability is onCreate.'); + } + + onDestroy() { + hilog.info(this.domain, this.tag, 'Ability is onDestroy.'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + this.windowStage = windowStage; + + // Setting Event Subscription for WindowStage (Obtained/Out-of-focus, Visible/Invisible) + try { + windowStage.on('windowStageEvent', (data) => { + hilog.info( + this.domain, + 'Succeeded in enabling the listener for window stage event changes. Data: %{public}', + JSON.stringify(data)?? '' + ); + }); + } catch (exception) { + hilog.error( + this.domain, + 'Failed to enable the listener for window stage event changes. Cause: %{public}', + JSON.stringify(exception)?? '' + ); + } + + // Main window is created, set main page for this ability + // Setting UI Loading + windowStage.loadContent('pages/LifeCyclePage', (err, data) => { + if (err.code) { + hilog.error(this.domain, 'testTag', 'Failed to load the content. Cause: %{public}s', + JSON.stringify(err) ?? ''); + return; + } + hilog.info(this.domain, this.tag, 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Releasing UI Resources + // Unregisters the WindowStage event for getting/out of focus in onWindowStageDestroy() + try { + this.windowStage.off('windowStageEvent'); + } catch (exception) { + hilog.error(this.domain, 'Failed to disable the listener for window stage event changes. Cause: %{public}s', + JSON.stringify(exception)); + } + } + + onForeground() { + // Ability has brought to foreground + hilog.info(this.domain, this.tag, 'Ability is onForeground.'); + } + + onBackground() { + // Ability has back to background + hilog.info(this.domain, this.tag, 'Ability is onBackground.'); + } +} diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/ets/pages/LifeCyclePage.ets b/Ability/UIAbilityLifeCycle/entry/src/main/ets/pages/LifeCyclePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a34d1755105e4325c6207172b06f0c472e21755 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/ets/pages/LifeCyclePage.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Logger from '../common/util/Logger'; +import CommonConstants from '../common/constants/CommonConstants'; + +@Entry +@Component +struct LifeCyclePage { + @State textColor: Color = Color.Black; + + aboutToAppear() { + this.textColor = Color.Blue; + Logger.info('[LifeCyclePage] LifeCyclePage aboutToAppear'); + } + + onPageShow() { + this.textColor = Color.Brown; + Logger.info('[LifeCyclePage] LifeCyclePage onPageShow'); + } + + onPageHide() { + Logger.info('[LifeCyclePage] LifeCyclePage onPageHide'); + } + + onBackPress() { + this.textColor = Color.Red; + Logger.info('[LifeCyclePage] LifeCyclePage onBackPress'); + return false; + } + + aboutToDisappear() { + Logger.info('[LifeCyclePage] LifeCyclePage aboutToDisappear'); + } + + build() { + Column() { + Text($r('app.string.hello_message')) + .fontSize(CommonConstants.DEFAULT_FONT_SIZE) + .fontColor(this.textColor) + .margin(CommonConstants.DEFAULT_MARGIN) + .fontWeight(FontWeight.Bold) + } + .width(CommonConstants.FULL_WIDTH) + } +} \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/module.json5 b/Ability/UIAbilityLifeCycle/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bf200cf76105205a9bfd171943debd39ecac28de --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/module.json5 @@ -0,0 +1,36 @@ +{ + "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.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/element/color.json b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/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/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/element/string.json b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4b78ca0cebe6be09dac9cadafc5d32a5ea432b14 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "UIAbilityLifeCycle" + }, + { + "name": "hello_message", + "value": "Hello World" + }, + { + "name": "button_name", + "value": "jump" + } + ] +} \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/media/icon.png b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/media/icon.png differ diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/profile/main_pages.json b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..807f94a9a0b4c525286fcabce73164930d521c3d --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/LifeCyclePage" + ] +} diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/resources/en_US/element/string.json b/Ability/UIAbilityLifeCycle/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4b78ca0cebe6be09dac9cadafc5d32a5ea432b14 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "UIAbilityLifeCycle" + }, + { + "name": "hello_message", + "value": "Hello World" + }, + { + "name": "button_name", + "value": "jump" + } + ] +} \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/entry/src/main/resources/zh_CN/element/string.json b/Ability/UIAbilityLifeCycle/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b3d86b8f957487a4574d81cdc7857091e937cf24 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "生命周期" + }, + { + "name": "hello_message", + "value": "你好世界" + }, + { + "name": "button_name", + "value": "跳转" + } + ] +} \ No newline at end of file diff --git "a/Ability/UIAbilityLifeCycle/figures/UIAbility\345\205\250\347\224\237\345\221\275\345\221\250\346\234\237.png" "b/Ability/UIAbilityLifeCycle/figures/UIAbility\345\205\250\347\224\237\345\221\275\345\221\250\346\234\237.png" new file mode 100644 index 0000000000000000000000000000000000000000..979e24315c096c6bb779f518620a18f825a54e62 Binary files /dev/null and "b/Ability/UIAbilityLifeCycle/figures/UIAbility\345\205\250\347\224\237\345\221\275\345\221\250\346\234\237.png" differ diff --git "a/Ability/UIAbilityLifeCycle/figures/WindowStage\347\212\266\346\200\201.png" "b/Ability/UIAbilityLifeCycle/figures/WindowStage\347\212\266\346\200\201.png" new file mode 100644 index 0000000000000000000000000000000000000000..ad94bd239b40221c4cd2b906fc927daf5f746b22 Binary files /dev/null and "b/Ability/UIAbilityLifeCycle/figures/WindowStage\347\212\266\346\200\201.png" differ diff --git a/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001509916136.gif b/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001509916136.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001509916136.gif differ diff --git a/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001547389382.png b/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001547389382.png new file mode 100644 index 0000000000000000000000000000000000000000..8f541251655e04f9552fdf11ec923e38c723a040 Binary files /dev/null and b/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001547389382.png differ diff --git a/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001554588725.png b/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001554588725.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/Ability/UIAbilityLifeCycle/figures/zh-cn_image_0000001554588725.png differ diff --git "a/Ability/UIAbilityLifeCycle/figures/\350\207\252\345\256\232\344\271\211\347\273\204\344\273\266\347\224\237\345\221\275\345\221\250\346\234\237.png" "b/Ability/UIAbilityLifeCycle/figures/\350\207\252\345\256\232\344\271\211\347\273\204\344\273\266\347\224\237\345\221\275\345\221\250\346\234\237.png" new file mode 100644 index 0000000000000000000000000000000000000000..2cce7943ffe56bab2775742fb2f1440176dac113 Binary files /dev/null and "b/Ability/UIAbilityLifeCycle/figures/\350\207\252\345\256\232\344\271\211\347\273\204\344\273\266\347\224\237\345\221\275\345\221\250\346\234\237.png" differ diff --git a/Ability/UIAbilityLifeCycle/hvigor/hvigor-config.json5 b/Ability/UIAbilityLifeCycle/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e5bf1bf2b10d77ae8849c97d378d3831f13480b2 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.1.1", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.1.1" + } +} diff --git a/Ability/UIAbilityLifeCycle/hvigor/hvigor-wrapper.js b/Ability/UIAbilityLifeCycle/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..994f22987bd0739b9faa07c966b066c2d9218602 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/hvigor/hvigor-wrapper.js @@ -0,0 +1,2 @@ +"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__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]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__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)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__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]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__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]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__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)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__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]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.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]/,ee.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(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.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&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.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||te.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 ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.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,ue.O_WRONLY|ue.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){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.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,ue.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"===se&&(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(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}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 c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.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);le.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 de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,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):be([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):be([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):be([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):be([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)):be([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=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;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.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;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.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?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.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):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),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.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(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 at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,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();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=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"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=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}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),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()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);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()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("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){Bt(e),Bt(t),Bt("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=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);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(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.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=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=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 wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&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 c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.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 Rr(){if(_r)return br;return _r=1,br=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{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||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=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return 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","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;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:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();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=Rr()(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)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=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=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=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]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]: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]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]: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,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,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,a).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)}}],c=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:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.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"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={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 cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;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(iu.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||""}};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.substr(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.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{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 Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.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"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ +const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(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:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.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 co={};co.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 ao={};ao.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;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`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)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={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})}};!function(e){const t=yo.fromCallback,n=we,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))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(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||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.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 _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.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 No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.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()&&Ko(e,t)?r(new Error(qo(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=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.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()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.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(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(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 Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=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}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(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 Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.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){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.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 Si(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();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=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"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(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()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(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()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("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){Pi(e),Pi(t),Pi("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=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(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(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){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 $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.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=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(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 Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(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||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(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||Os,o="";try{o=_s(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||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(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,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("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];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("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}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({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 bc(`_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((()=>{bc(`_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())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_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--){bc(`_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 Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_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 _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().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 _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.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;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{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 $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{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 Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.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}Eo.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){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.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))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.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)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.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,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("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(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.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){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`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){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();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)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.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.substring(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 c=e=>{o.clear();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})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.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=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(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;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__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]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__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)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(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 tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__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]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__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)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__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]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__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)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/hvigorfile.ts b/Ability/UIAbilityLifeCycle/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/Ability/UIAbilityLifeCycle/oh-package.json5 b/Ability/UIAbilityLifeCycle/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4f34bdfc0eebd0ced8addafd68cd249a1d847ea9 --- /dev/null +++ b/Ability/UIAbilityLifeCycle/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "uiabilitylifecycle", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Ability/UIAbilityLifeCycle/public_sys-resources/icon-caution.gif b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-caution.gif differ diff --git a/Ability/UIAbilityLifeCycle/public_sys-resources/icon-danger.gif b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-danger.gif differ diff --git a/Ability/UIAbilityLifeCycle/public_sys-resources/icon-note.gif b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-note.gif differ diff --git a/Ability/UIAbilityLifeCycle/public_sys-resources/icon-notice.gif b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-notice.gif differ diff --git a/Ability/UIAbilityLifeCycle/public_sys-resources/icon-tip.gif b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-tip.gif differ diff --git a/Ability/UIAbilityLifeCycle/public_sys-resources/icon-warning.gif b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Ability/UIAbilityLifeCycle/public_sys-resources/icon-warning.gif differ diff --git a/Card/MovieCard/AppScope/app.json5 b/Card/MovieCard/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4b0f9000597fbbdcbe227ad35829524c9d1057e3 --- /dev/null +++ b/Card/MovieCard/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.moviecard", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/Card/MovieCard/AppScope/resources/base/element/string.json b/Card/MovieCard/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c8f6fe3271b3c103bea64438bb29be5cf6353898 --- /dev/null +++ b/Card/MovieCard/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MovieCard" + } + ] +} diff --git a/Card/MovieCard/AppScope/resources/base/media/app_icon.png b/Card/MovieCard/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Card/MovieCard/AppScope/resources/base/media/app_icon.png differ diff --git a/Card/MovieCard/LICENSE b/Card/MovieCard/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/Card/MovieCard/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Card/MovieCard/README.md b/Card/MovieCard/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d4d7c8487f1f7e17c5baedda291bd448a863aa8a --- /dev/null +++ b/Card/MovieCard/README.md @@ -0,0 +1,442 @@ +# 电影卡片(JS) + +## 介绍 +本篇Codelab基于元服务卡片的能力,实现带有卡片的电影应用,介绍卡片的开发过程和生命周期实现。需要完成以下功能: + +1. 元服务卡片,用于在桌面上添加2x2或2x4规格元服务卡片。 +2. 关系型数据库,用于创建、查询、添加、删除卡片数据。 + +![](figures/MovieCard.gif) + +### 相关概念 + +- [关系型数据库](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-relationalStore.md):关系型数据库基于SQLite组件提供了一套完整的对本地数据库进行管理的机制,对外提供了一系列的增、删、改、查等接口,也可以直接运行用户输入的SQL语句来满足复杂的场景需要。 +- [元服务卡片](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md):卡片是一种界面展示形式,可以将应用的重要信息或操作前置到卡片,以达到服务直达、减少体验层级的目的。 + - 卡片提供方:显示卡片内容,控制卡片布局以及控件点击事件。 + - 卡片使用方:显示卡片内容的宿主应用,控制卡片在宿主中展示的位置。 + - 卡片管理服务:用于管理系统中所添加卡片的常驻代理服务,包括卡片对象的管理与使用,以及卡片周期性刷新等。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──FormBean.ets // 卡片对象 +│ │ │ └──MovieDataBean.ets // 电影详情bean类 +│ │ ├──constants +│ │ │ ├──CommonConstants.ets // 常量类 +│ │ │ └──StyleConstants.ets // 格式常量类 +│ │ ├──datasource +│ │ │ ├──DataSource.ets // 懒加载数据源 +│ │ │ └──MovieListData.ets // 电影列表数据 +│ │ └──utils +│ │ ├──CommonUtils.ets // 数据操作工具类 +│ │ └──Logger.ets // 日志打印工具类 +│ ├──detailsability +│ │ └──EntryDetailsAbility.ets // 电影详情入口类 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entryformability +│ │ └──EntryFormAbility.ets // 卡片创建,更新,删除操作类 +│ ├──pages +│ │ ├──MovieDetailsPage.ets // 电影详情页 +│ │ └──MovieListPage.ets // 主页面 +│ └──view +│ ├──MovieDetailsTitle.ets // 电影详情头部组件 +│ ├──MovieItem.ets // 列表item组件 +│ ├──MovieStarring.ets // 电影主演组件 +│ ├──MovieStills.ets // 电影剧照组件 +│ ├──StarsWidget.ets // 电影评分组件 +│ └──StoryIntroduce.ets // 电影简介组件 +├──entry/src/main/js // js代码区 +│ ├──card2x2 // 2x2卡片目录 +│ ├──card2x4 // 2x4卡片目录 +│ └──common // 卡片资源目录 +└──entry/src/main/resources // 资源文件目录 +``` + +## 关系型数据库 + +元服务卡片需要用数据库保存不同卡片数据,而且在添加多张卡片情况下,需要保持数据同步刷新。因此需要创建一张表,用于保存卡片信息。 + +1. 数据库创建使用的SQLite。 + + ```typescript + // CommonConstants.ets + // 创建数据库表结构 + static readonly CREATE_TABLE_FORM: string = 'CREATE TABLE IF NOT EXISTS Form ' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, formId TEXT NOT NULL, formName TEXT NOT NULL, dimension INTEGER)'; + ``` + +2. 在EntryAbility的onCreate方法通过CommonUtils.createRdbStore方法创建数据库,并创建相应的表。 + + ```typescript + // EntryAbility.ets + export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + ... + // 创建数据库 + CommonUtil.createRdbStore(this.context); + } + } + + // CommonUtils.ets + import relationalStore from '@ohos.data.relationalStore'; + async createRdbStore(context: Context) { + if (this.isEmpty(globalThis.rdbStore)) { + await relationalStore.getRdbStore(context, CommonConstants.STORE_CONFIG) + .then((rdbStore: relationalStore.RdbStore) => { + if (!this.isEmpty(rdbStore)) { + // 创建卡片表 + rdbStore.executeSql(CommonConstants.CREATE_TABLE_FORM).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'executeSql error ' + JSON.stringify(error)); + }); + globalThis.rdbStore = rdbStore; + } + }).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'createRdbStore error ' + JSON.stringify(error)); + }); + } + return globalThis.rdbStore; + } + ``` + +## 构建应用页面 + +电影卡片应用有两个页面,分别是电影列表和电影详情。 + +## 电影列表 + +电影列表采用Column容器嵌套List和自定义组件MovieItem形式完成页面整体布局,效果如图所示: + +![](figures/MovieList.jpg) + +```typescript +// MovieListPage.ets +build() { + Column() { + ... + List({ space: StyleConstants.LIST_COMPONENT_SPACE }) { + LazyForEach(this.dataSource, (item: MovieDataBean) => { + ListItem() { + // 电影item + MovieItem({ movieItem: item }); + } + }, item => JSON.stringify(item)) + } + ... + } + ... +} + +// MovieItem.ets +aboutToAppear() { + if (CommonUtils.isEmpty(this.movieItem)) { + Logger.error(CommonConstants.TAG_MOVIE_ITEM, 'movieItem is null'); + return; + } + // 获取电影索引 + this.sort = this.movieItem.sort; + ... +} + +build() { + Row(){ + ... + Text($r('app.string.want_to_see')) + ... + .onClick(() => { + router.pushUrl({ + url: CommonConstants.SEE_BUTTON_PUSH, + params: { + index: this.sort + } + }).catch((error) => { + ... + }); + }) + } + ... +} +``` + +## 电影详情 + +电影详情采用Column容器嵌套自定义组件MovieDetailsTitle、StoryIntroduce、MovieStarring和MovieStills形式完成页面整体布局,效果如图所示: + +![](figures/MovieDetails.jpg) + +```typescript +// MovieDetailPage.ets +aboutToAppear() { + let index: number = 0; + if (!CommonUtils.isEmpty(router.getParams())) { + // 获取从电影列表页面传过来的索引 + index = router.getParams()[CommonConstants.INDEX_KEY] ?? 0; + } + ... + let listData: MovieDataBean[] = CommonUtils.getListData(); + if (CommonUtils.isEmptyArr(listData)) { + Logger.error(CommonConstants.TAG_DETAILS_PAGE, 'listData is 0'); + return; + } + // 获取当前电影信息 + this.movieData = listData[index]; + ... +} + +build() { + Column() { + ... + Column() { + // 电影详情头部组件 + MovieDetailsTitle({ + movieDetail: this.movieData + }) + // 剧情简介组件 + StoryIntroduce({ + introduction: this.introduction + }) + } + ... + // 电影主演组件 + MovieStarring() + // 电影剧照组件 + MovieStills() + } + ... +} +``` + +## 元服务卡片 + +使用元服务卡片分为四步:创建、初始化、更新、删除。 + +### 创建元服务卡片目录 + +1. 在main目录下,点击鼠标右键 > New > Service Widget。 + + ![](figures/CreateJSDirectory.png) + +2. 然后选择第一个选项下面带有Hello World字样,点击下一步Next。 + + ![](figures/SelectModule.png) + +3. 填写卡片名字(Service widget name)、卡片介绍(Description)、是否开启低代码开发(Enable Super Visual)、开发语言(ArkTS和JS)、支持卡片规格(Support dimension)、关联表单(Ability name)点击Finish完成创建。如需创建多个卡片目录重新按照步骤1执行。 + + ![](figures/EnterJSInfo.png) + +4. 创建完卡片后,同级目录出现js目录,然后开发者在js目录下使用hml+css+json开发js卡片页面。 + + ![](figures/JSDirectory.png) + +### 初始化元服务卡片 + +应用选择添加元服务卡片到桌面后,在EntryFormAbility的onAddForm方法进行卡片初始化操作,效果如图所示: + +![](figures/CardHome.jpg) + +```typescript +// EntryFormAbility.ets +onAddForm(want: Want) { + let formId: string = want.parameters[CommonConstants.IDENTITY_KEY] as string; + let formName: string = want.parameters[CommonConstants.NAME_KEY] as string; + let dimensionFlag: number = want.parameters[CommonConstants.DIMENSION_KEY] as number; + // 创建数据库 + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + let form: Form = new Form(); + form.formId = formId; + form.formName = formName; + form.dimension = dimensionFlag; + // 插入卡片信息 + CommonUtils.insertForm(form, rdbStore); + }).catch((error) => { + ... + }); + ... + let listData: MovieDataBean[] = CommonUtils.getListData(); + let formData = CommonUtils.getFormData(listData); + return formBindingData.createFormBindingData(formData); +} +``` + +### 更新元服务卡片 + +1. 初始化加载电影列表布局之前,在MovieListPage的aboutToAppear方法中,通过CommonUtils.startTimer方法开启定时器,时间到则调用updateMovieCardData方法更新电影卡片数据。 + + ```typescript + // MovieListPage.ets + aboutToAppear() { + ... + // 启动定时器,每5分钟更新一次电影卡片数据。 + CommonUtils.startTimer(); + } + + // CommonUtils.ets + startTimer() { + if (this.isEmpty(globalThis.intervalId)) { + globalThis.intervalId = setInterval(() => { + this.updateMovieCardData(globalThis.rdbStore); + }, CommonConstants.INTERVAL_DELAY_TIME); + } + } + + // 更新电影卡片数据 + updateMovieCardData(rdbStore: relationalStore.RdbStore) { + ... + let predicates: relationalStore.RdbPredicates = + new relationalStore.RdbPredicates(CommonConstants.TABLE_NAME); + rdbStore.query(predicates).then((resultSet: relationalStore.ResultSet) => { + ... + let listData: MovieDataBean[] = this.getListData(); + resultSet.goToFirstRow(); + do { + let formData = this.getFormData(listData); + let formId: string = resultSet.getString(resultSet.getColumnIndex(CommonConstants.FORM_ID)); + formProvider.updateForm(formId, formBindingData.createFormBindingData(formData)) + .catch((error) => { + ... + }); + } while (resultSet.goToNextRow()); + resultSet.close(); + }).catch((error) => { + ... + }); + } + ``` + +2. 卡片添加到桌面后,在EntryFormAbility的onAddForm方法中,调用formProvider.setFormNextRefreshTime方法设置倒计时。时间到了则通过CommonUtils.updateMovieCardData方法更新电影卡片数据。 + + ```typescript + // EntryFormAbility.ets + onAddForm(want: Want) { + ... + // 五分钟倒计时 + formProvider.setFormNextRefreshTime(formId, CommonConstants.FIVE_MINUTES, (error, data) => { + ... + }); + } + + onUpdateForm(formId: string) { + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + CommonUtils.updateMovieCardData(rdbStore); + }).catch((error) => { + ... + }); + ... + } + ``` + +3. 通过src/main/resources/base/profile/form_config.json配置文件,根据updateDuration或者scheduledUpdateTime字段配置刷新时间。updateDuration优先级高于scheduledUpdateTime,两者同时配置时,以updateDuration配置的刷新时间为准。当配置的刷新时间到了,系统调用onUpdateForm方法进行更新。 + + ```typescript + // form_config.json + { + // 卡片的类名 + "name": "card2x2", + // 卡片的描述 + "description": "This is a service widget.", + // 卡片对应完整路径 + "src": "./js/card2x2/pages/index/index", + // 定义与显示窗口相关的配置 + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + // 卡片的主题样式 + "colorMode": "auto", + // 是否为默认卡片 + "isDefault": true, + // 卡片是否支持周期性刷新 + "updateEnabled": true, + // 采用24小时制,精确到分钟 + "scheduledUpdateTime": "00:00", + // 当取值为0时,表示该参数不生效,当取值为正整数N时,表示刷新周期为30*N分钟。 + "updateDuration": 1, + // 卡片默认外观规格 + "defaultDimension": "2*2", + // 卡片支持外观规格 + "supportDimensions": [ + "2*2" + ] + } + ... + + // EntryFormAbility.ets + onUpdateForm(formId: string) { + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + CommonUtils.updateMovieCardData(rdbStore); + }).catch((error) => { + ... + }); + ... + } + ``` + +### 删除元服务卡片 + +当用户需要删除元服务卡片时,可以在EntryFormAbility的onRemoveForm方法中,通过CommonUtils.deleteFormData方法删除数据库中对应的卡片信息。 + +```typescript +// EntryFormAbility.ets +onRemoveForm(formId: string) { + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + // 从数据库中删除电影卡片信息 + CommonUtils.deleteFormData(formId, rdbStore); + }).catch((error) => { + ... + }); +} + +// CommonUtils.ets +deleteFormData(formId: string, rdbStore: relationalStore.RdbStore) { + ... + let predicates: relationalStore.RdbPredicates = + new relationalStore.RdbPredicates(CommonConstants.TABLE_NAME); + predicates.equalTo(CommonConstants.FORM_ID, formId); + rdbStore.delete(predicates).catch((error) => { + ... + }); +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用关系型数据库插入、更新、删除卡片数据。 +2. 使用FormExtensionAbility创建、更新、删除元服务卡片。 + +![](figures/Congratulations.gif) \ No newline at end of file diff --git a/Card/MovieCard/build-profile.json5 b/Card/MovieCard/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7e443c9990df03928f4c23604aba62b3b5323ec1 --- /dev/null +++ b/Card/MovieCard/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/build-profile.json5 b/Card/MovieCard/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/Card/MovieCard/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/hvigorfile.ts b/Card/MovieCard/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/Card/MovieCard/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/Card/MovieCard/entry/oh-package.json5 b/Card/MovieCard/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/Card/MovieCard/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Card/MovieCard/entry/src/main/ets/common/bean/FormBean.ets b/Card/MovieCard/entry/src/main/ets/common/bean/FormBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..d03831a42dee8d30990cc5f7054a573299cfc7a9 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/bean/FormBean.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Database form entity class. + */ +export default class FormBean { + /** + * Form ID + */ + formId: string; + + /** + * Form name + */ + formName: string; + + /** + * Card dimension + */ + dimension: number; + + /** + * Get inserted form data. + * + * @return Return form data + */ + toValuesBucket() { + return { + 'formId': this.formId, + 'formName': this.formName, + 'dimension': this.dimension + }; + } +} diff --git a/Card/MovieCard/entry/src/main/ets/common/bean/MovieDataBean.ets b/Card/MovieCard/entry/src/main/ets/common/bean/MovieDataBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..d15ebc8163888498c631b3a40a6977936f39a54c --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/bean/MovieDataBean.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Movie details info bean. + */ +export default class MovieDataBean { + /** + * Movie sort number + */ + sort: number; + + /** + * Is show sort image + */ + isShowSort: boolean; + + /*** + * Movie sort image + */ + sortImage: Resource; + + /** + * Movie title + */ + title: string; + + /** + * Movie describe + */ + describe: string; + + /** + * Movie image + */ + movieImage: Resource; + + /** + * Show card image + */ + cardImage: string; + + /** + * Movie stars + */ + stars: Resource[]; + + /** + * Movie rating + */ + rating: string; + + /** + * Movie introduction + */ + introduction: string; +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/common/constants/CommonConstants.ets b/Card/MovieCard/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f77faac4ed4dbcec6886b2f69bb79c9aca3e86b --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2023 Huawei Device 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 relationalStore from '@ohos.data.relationalStore'; + +/** + * Common constants for all features. + */ +export default class CommonConstants { + /** + * The entry ability tag. + */ + static readonly TAG_ABILITY: string = 'EntryAbility'; + + /** + * The entry details ability tag. + */ + static readonly TAG_DETAILS: string = 'EntryDetailsAbility'; + + /** + * The movie list page tag. + */ + static readonly TAG_MOVIE_LIST: string = 'MovieListPage'; + + /** + * The movie details page tag. + */ + static readonly TAG_DETAILS_PAGE: string = 'MovieDetailsPage'; + + /** + * The entry form ability tag. + */ + static readonly TAG_FORM_ABILITY: string = 'EntryFormAbility'; + + /** + * The movie item component tag. + */ + static readonly TAG_MOVIE_ITEM: string = 'MovieItem'; + + /** + * The movie details item component tag. + */ + static readonly TAG_DETAILS_COMPONENT: string = 'MovieDetailTitle'; + + /** + * The common utils tag. + */ + static readonly TAG_COMMON_UTILS: string = 'CommonUtils'; + + /** + * Database store configuration. + */ + static readonly STORE_CONFIG: relationalStore.StoreConfig = { + name: 'FormDatabase.db', securityLevel: relationalStore.SecurityLevel.S1, encrypt: false + }; + + /** + * SQL statement for creating a form. + */ + static readonly CREATE_TABLE_FORM: string = 'CREATE TABLE IF NOT EXISTS Form ' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, formId TEXT NOT NULL, formName TEXT NOT NULL, dimension INTEGER)'; + + /** + * ID parameter for creating a form. + */ + static readonly IDENTITY_KEY: string = 'ohos.extra.param.key.form_identity'; + + /** + * Name parameter for creating a form. + */ + static readonly NAME_KEY: string = 'ohos.extra.param.key.form_name'; + + /** + * Dimension parameter for creating a form. + */ + static readonly DIMENSION_KEY: string = 'ohos.extra.param.key.form_dimension'; + + /** + * Table name + */ + static readonly TABLE_NAME: string = 'Form'; + + /** + * Refresh time in 5 minute. + */ + static readonly FIVE_MINUTES: number = 5; + + /** + * Form ID field in the database table. + */ + static readonly FORM_ID: string = 'formId'; + + /** + * Time interval of the 300000. + */ + static readonly INTERVAL_DELAY_TIME: number = 300000; + + /** + * Notification id of the 1008. + */ + static readonly NOTIFICATIONS_ID: number = 1008; + + /** + * Random multiply ten. + */ + static readonly MULTIPLY_TEN: number = 10; + + /** + * Random minus two. + */ + static readonly MINUS_TWO: number = 2; + + /** + * Default lines of the 5. + */ + static readonly DEFAULT_LINES: number = 5; + + /** + * Max lines of the 10. + */ + static readonly MAX_LINES: number = 10; + + /** + * Index key + */ + static readonly INDEX_KEY: string = 'index'; + + /** + * See button push page url. + */ + static readonly SEE_BUTTON_PUSH: string = 'pages/MovieDetailsPage'; +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/common/constants/StyleConstants.ets b/Card/MovieCard/entry/src/main/ets/common/constants/StyleConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e89bd9f6757453e3cb15722fee2a923800e4675 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/constants/StyleConstants.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Style constants for all features. + */ +export default class StyleConstants { + /** + * Common left the percentage of the 6.7. + */ + static readonly COMMON_MARGIN_LEFT: string = '6.7%'; + + /** + * Details common margin size the percentage of the 1.5. + */ + static readonly DETAILS_COMMON_MARGIN: string = '1.5%'; + + /** + * Column details width the percentage of the 93.4. + */ + static readonly COLUMN_DETAILS_WIDTH: string = '93.4%'; + + /** + * Starring text width the percentage of the 76.6. + */ + static readonly STARRING_TEXT_WIDTH: string = '76.6%'; + + /** + * Common margin top the percentage of the 3.2. + */ + static readonly COMMON_MARGIN_TOP: string = '3.2%'; + + /** + * Common margin right the percentage of the 3.3. + */ + static readonly COMMON_MARGIN_RIGHT: string = '3.3%'; + + /** + * Common margin bottom the percentage of the 1. + */ + static readonly COMMON_MARGIN_BOTTOM: string = '1%'; + + /** + * Starring width the percentage of the 90. + */ + static readonly STARRING_WIDTH: string = '90%'; + + /** + * Starring space of the 8. + */ + static readonly STARRING_SPACE: number = 8; + /** + * Rstarring list width the percentage of the 93.3. + */ + static readonly STARRING_LIST_WIDTH: string = '93.3%'; + + /** + * Rstarring list height the percentage of the 14.4. + */ + static readonly STARRING_LIST_HEIGHT: string = '14.4%'; + + /** + * Stills text width the percentage of the 76.6. + */ + static readonly STILLS_TEXT_WIDTH: string = '76.6%'; + + /** + * Stills width the percentage of the 90. + */ + static readonly STILLS_WIDTH: string = '90%'; + + /** + * Stills list space of the 4. + */ + static readonly STILLS_LIST_SPACE: number = 4; + + /** + * Stills list width the percentage of the 93.3. + */ + static readonly STILLS_LIST_WIDTH: string = '93.3%'; + + /** + * List title margin the percentage of the 1.5. + */ + static readonly LIST_TITLE_MARGIN: string = '1.5%'; + + /** + * List compoent space of the 12. + */ + static readonly LIST_COMPONENT_SPACE: number = 12; + + /** + * Item width the percentage of the 93.4. + */ + static readonly ITEM_WIDTH: string = '93.4%'; + + /** + * Stars list space of the 3. + */ + static readonly STARS_LIST_SPACE: number = 3; + + /** + * Layout weight size of the 1. + */ + static readonly WEIGHT_ONE: number = 1; + + /** + * Width the percentage of the 100. + */ + static readonly FULL_WIDTH: string = '100%'; + + /** + * Height the percentage of the 100. + */ + static readonly FULL_HEIGHT: string = '100%'; + +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/common/datasource/DataSource.ets b/Card/MovieCard/entry/src/main/ets/common/datasource/DataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..8715b35e21a894591d134310f5e63468e3672ab9 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/datasource/DataSource.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Classes required for LazyForEach loading. + */ +export default class DataSource implements IDataSource { + private listData: T[]; + + constructor(listData: T[]) { + this.listData = listData; + } + + totalCount() { + return this.listData.length; + } + + getData(index: number) { + return this.listData[index]; + } + + registerDataChangeListener() { + + } + + unregisterDataChangeListener() { + } +} diff --git a/Card/MovieCard/entry/src/main/ets/common/datasource/MovieListData.ets b/Card/MovieCard/entry/src/main/ets/common/datasource/MovieListData.ets new file mode 100644 index 0000000000000000000000000000000000000000..8ad5cf1858d14b2d905ab41d416b88bb40aff44d --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/datasource/MovieListData.ets @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Movie list Data + */ +export const MOVIE_LIST_DATA = [ + { + 'sort': 0, + 'isShowSort': true, + 'sortImage': $r('app.media.ic_first'), + 'title': '冰上姐妹', + 'describe': '讲述冰上女运动员之间团结友爱,互帮互助的故事', + 'movieImage': $r('app.media.ic_movie_one'), + 'cardImage': '/common/ic_movie_one.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star')], + 'rating': '9.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 1, + 'isShowSort': true, + 'sortImage': $r('app.media.ic_second'), + 'title': '冲破黎明前的黑暗', + 'describe': '通过地道战的方式与日寇作斗争的故事', + 'movieImage': $r('app.media.ic_movie_two'), + 'cardImage': '/common/ic_movie_two.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star')], + 'rating': '9.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 2, + 'isShowSort': true, + 'sortImage': $r('app.media.ic_third'), + 'title': '党的女儿', + 'describe': '带领群众继续作斗争,最后壮烈牺牲的故事', + 'movieImage': $r('app.media.ic_movie_three'), + 'cardImage': '/common/ic_movie_three.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star')], + 'rating': '9.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 3, + 'isShowSort': true, + 'sortImage': $r('app.media.ic_fourth'), + 'title': '古刹钟声', + 'describe': '抗日战争时期,八路军剿灭日本特务的故事', + 'movieImage': $r('app.media.ic_movie_four'), + 'cardImage': '/common/ic_movie_four.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_empty_star')], + 'rating': '9.0', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 4, + 'isShowSort': true, + 'sortImage': $r('app.media.ic_fifth'), + 'title': '花木兰', + 'describe': '花木兰替父从军,英姿飒爽的故事', + 'movieImage': $r('app.media.ic_movie_five'), + 'cardImage': '/common/ic_movie_five.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_empty_star')], + 'rating': '9.0', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 5, + 'isShowSort': false, + 'sortImage': $r('app.media.icon'), + 'title': '画中人', + 'describe': '讲述了一对相爱的年轻人,受到昏君的迫害,遇到仙人相助的故事', + 'movieImage': $r('app.media.ic_movie_six'), + 'cardImage': '/common/ic_movie_six.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star'), $r('app.media.ic_empty_star')], + 'rating': '8.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 6, + 'isShowSort': false, + 'sortImage': $r('app.media.icon'), + 'title': '马兰花开', + 'describe': '讲述一位家庭妇女,为了参加新中国的建设,主动要学习驾驶推土机一系列故事', + 'movieImage': $r('app.media.ic_movie_seven'), + 'cardImage': '/common/ic_movie_seven.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star'), $r('app.media.ic_empty_star')], + 'rating': '8.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 7, + 'isShowSort': false, + 'sortImage': $r('app.media.icon'), + 'title': '五朵金花', + 'describe': '讲述了大理地区,一对男女青年之间,产生了阴差阳错误会的爱情故事', + 'movieImage': $r('app.media.ic_movie_eight'), + 'cardImage': '/common/ic_movie_eight.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star'), $r('app.media.ic_empty_star')], + 'rating': '8.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 8, + 'isShowSort': false, + 'sortImage': $r('app.media.icon'), + 'title': '战火中的青春', + 'describe': '讲述了解放战争期间,女扮男装高山参加解放军,成为副排长,与排长共同战斗的故事', + 'movieImage': $r('app.media.ic_movie_eight'), + 'cardImage': '/common/ic_movie_eight.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star'), $r('app.media.ic_empty_star')], + 'rating': '8.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + }, + { + 'sort': 9, + 'isShowSort': false, + 'sortImage': $r('app.media.icon'), + 'title': '祖国的花朵', + 'describe': '讲述了北京的一所小学,五年级的同学们先进帮后进的故事', + 'movieImage': $r('app.media.ic_movie_seven'), + 'cardImage': '/common/ic_movie_seven.png', + 'stars': [$r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_star'), $r('app.media.ic_half_star'), $r('app.media.ic_empty_star')], + 'rating': '8.5', + 'introduction': '剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介。简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情简介剧情。' + } +]; + +/** + * Starring data + */ +export const STARRING_DATA: Resource[] = [ + $r("app.media.ic_movie_one"), + $r("app.media.ic_movie_two"), + $r("app.media.ic_movie_three"), + $r("app.media.ic_movie_four"), + $r("app.media.ic_movie_five"), + $r("app.media.ic_movie_six") +]; + + +/** + * Stills data + */ +export const STILLS_DATA: Resource[] = [ + $r("app.media.ic_movie_one"), + $r("app.media.ic_movie_seven"), + $r("app.media.ic_movie_eight"), + $r("app.media.ic_movie_three") +]; diff --git a/Card/MovieCard/entry/src/main/ets/common/utils/CommonUtils.ets b/Card/MovieCard/entry/src/main/ets/common/utils/CommonUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..547ff409e5a349228b4dbcc232fdb219d266ebbe --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/utils/CommonUtils.ets @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2023 Huawei Device 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 relationalStore from '@ohos.data.relationalStore'; +import formProvider from '@ohos.app.form.formProvider'; +import formBindingData from '@ohos.app.form.formBindingData'; +import FormBean from '../bean/FormBean'; +import CommonConstants from '../constants/CommonConstants'; +import MovieDataBean from '../bean/MovieDataBean'; +import Logger from './Logger'; +import { MOVIE_LIST_DATA, STARRING_DATA, STILLS_DATA } from '../datasource/MovieListData'; + +/** + * Movie data common class. + */ +export class CommonUtils { + /** + * Create rdb store. + * + * @param {context} Context + * @return {globalThis.rdbStore} return rdbStore RDB database + */ + async createRdbStore(context: Context) { + if (this.isEmpty(globalThis.rdbStore)) { + await relationalStore.getRdbStore(context, CommonConstants.STORE_CONFIG) + .then((rdbStore: relationalStore.RdbStore) => { + if (!this.isEmpty(rdbStore)) { + rdbStore.executeSql(CommonConstants.CREATE_TABLE_FORM).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'executeSql error ' + JSON.stringify(error)); + }); + globalThis.rdbStore = rdbStore; + } + }).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'createRdbStore error ' + JSON.stringify(error)); + }); + } + return globalThis.rdbStore; + } + + /** + * Insert form data. + * + * @param {FormBean} form Form entity + * @param {relationalStore.RdbStore} rdbStore RDB database + * @return {Promise} return the row ID if the operation is successful. return -1 otherwise. + */ + insertForm(form: FormBean, rdbStore: relationalStore.RdbStore) { + if ((this.isEmpty(rdbStore)) || (this.isEmpty(form))) { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'insertForm rdbStore or form is null'); + return; + } + rdbStore.insert(CommonConstants.TABLE_NAME, form.toValuesBucket()).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'insertForm error ' + JSON.stringify(error)); + }); + } + + /** + * Update movie data show in to the card. + * + * @param {relationalStore.RdbStore} rdbStore RDB database + */ + updateMovieCardData(rdbStore: relationalStore.RdbStore) { + if (this.isEmpty(rdbStore)) { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'rdbStore is null'); + return; + } + let predicates: relationalStore.RdbPredicates = new relationalStore.RdbPredicates(CommonConstants.TABLE_NAME); + rdbStore.query(predicates).then((resultSet: relationalStore.ResultSet) => { + if (resultSet.rowCount <= 0) { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'updateCardMovieData rowCount <= 0'); + return; + } + let listData: MovieDataBean[] = this.getListData(); + resultSet.goToFirstRow(); + do { + let formData = this.getFormData(listData); + let formId: string = resultSet.getString(resultSet.getColumnIndex(CommonConstants.FORM_ID)); + formProvider.updateForm(formId, formBindingData.createFormBindingData(formData)) + .catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'updateForm error ' + JSON.stringify(error)); + }); + } while (resultSet.goToNextRow()); + resultSet.close(); + }).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'updateCardMovieData error ' + JSON.stringify(error)); + }); + } + + /** + * Get movie a random number. + * + * @return {movieRandom} return a random number + */ + getRandomInt(randomNumber: number): number { + let roundNumber: number = Math.round(Math.random() * CommonConstants.MULTIPLY_TEN); + if (roundNumber === randomNumber) { + roundNumber = this.getRandomInt(randomNumber); + } + return roundNumber; + } + + /** + * Delete form data. + * + * @param {string} formId Form ID + * @param {relationalStore.RdbStore} rdbStore RDB database + */ + deleteFormData(formId: string, rdbStore: relationalStore.RdbStore) { + if (this.isEmpty(rdbStore)) { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'rdbStore is null'); + return; + } + let predicates: relationalStore.RdbPredicates = new relationalStore.RdbPredicates(CommonConstants.TABLE_NAME); + predicates.equalTo(CommonConstants.FORM_ID, formId); + rdbStore.delete(predicates).catch((error) => { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'deleteFormData error ' + JSON.stringify(error)); + }); + } + + /** + * Get Movie data list. + * + * @return {listMovieData} return list movie data + */ + getListData(): MovieDataBean[] { + if (this.isEmptyArr(globalThis.listMovieData)) { + let listMovieData: MovieDataBean[] = []; + MOVIE_LIST_DATA.forEach((itemMovie) => { + let movieItem: MovieDataBean = { + sort: itemMovie.sort, + isShowSort: itemMovie.isShowSort, + sortImage: itemMovie.sortImage, + title: itemMovie.title, + describe: itemMovie.describe, + movieImage: itemMovie.movieImage, + cardImage: itemMovie.cardImage, + stars: itemMovie.stars, + rating: itemMovie.rating, + introduction: itemMovie.introduction, + }; + listMovieData.push(movieItem); + }); + globalThis.listMovieData = listMovieData; + } + return globalThis.listMovieData; + } + + /** + * Get form data used to assign values to cards. + * + * @return {formData} return form data + */ + getFormData(listData: MovieDataBean[]): object { + if (this.isEmptyArr(listData)) { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'getFormData listData is empty'); + return; + } + let oneRandom: number = this.getRandomInt(listData.length); + let twoRandom: number = this.getRandomInt(oneRandom); + let topMovie: MovieDataBean = listData[oneRandom]; + let bottomMovie: MovieDataBean = listData[twoRandom]; + let formData = { + topIndex: topMovie.sort, + topMovieImage: topMovie.cardImage, + topTitle: topMovie.title, + topDescribe: topMovie.describe, + bottomIndex: bottomMovie.sort, + bottomMovieImage: bottomMovie.cardImage, + bottomTitle: bottomMovie.title, + bottomDescribe: bottomMovie.describe + }; + return formData; + } + + /** + * Start timer + */ + startTimer() { + if (this.isEmpty(globalThis.intervalId)) { + globalThis.intervalId = setInterval(() => { + this.updateMovieCardData(globalThis.rdbStore); + }, CommonConstants.INTERVAL_DELAY_TIME); + } + } + + /** + * Get starring data. + * + * @return {starring} return starring Resource. + */ + getStarringData(): Resource[] { + let starring: Resource[] = []; + STARRING_DATA.forEach((starringItem: Resource) => { + starring.push(starringItem); + }); + return starring; + } + + /** + * Get stills data. + * + * @return {stills} return stills Resource. + */ + getStillsData(): Resource[] { + let stills: Resource[] = []; + STILLS_DATA.forEach((stillsItem: Resource) => { + stills.push(stillsItem); + }); + return stills; + } + + /** + * Check obj is empty. + * + * @param {object} obj + * @return {boolean} true(empty) + */ + isEmpty(obj): boolean { + return (obj === undefined || obj === null || obj === ''); + } + + /** + * Check array is empty. + * + * @param {Array}array + * @return {boolean} true(empty) + */ + isEmptyArr(array): boolean { + return (this.isEmpty(array) || array.length === 0); + } +} + +export default new CommonUtils(); \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/common/utils/Logger.ets b/Card/MovieCard/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..43d37dd0dda6307c80ea7439d4d95fd5f1fc4f35 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('MovieCard', 0xFF00) \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/detailsability/EntryDetailsAbility.ets b/Card/MovieCard/entry/src/main/ets/detailsability/EntryDetailsAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..78330607a51448d46bc9fe13b45e9912fa39d114 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/detailsability/EntryDetailsAbility.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import window from '@ohos.window'; +import CommonConstants from '../common/constants/CommonConstants'; +import Logger from '../common/utils/Logger'; + +/** + * Lift cycle management of Ability. + */ +export default class EntryDetailsAbility extends UIAbility { + onCreate(want, launchParam) { + Logger.info(CommonConstants.TAG_DETAILS, 'want =' + JSON.stringify(want)); + Logger.info(CommonConstants.TAG_DETAILS, 'launchParam =' + JSON.stringify(launchParam)); + let params = want?.parameters?.params; + Logger.info(CommonConstants.TAG_DETAILS, 'params ' + params); + let parseParams = JSON.parse(params); + Logger.info(CommonConstants.TAG_DETAILS, 'parseParams ' + parseParams); + let index = parseParams?.index; + globalThis.position = index; + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability. + windowStage.loadContent('pages/MovieDetailsPage', (err, data) => { + if (err.code) { + Logger.error(CommonConstants.TAG_DETAILS, 'Failed to load ' + JSON.stringify(err)); + return; + } + Logger.info(CommonConstants.TAG_DETAILS, 'Succeeded loading ' + JSON.stringify(data)); + }); + } +} diff --git a/Card/MovieCard/entry/src/main/ets/entryability/EntryAbility.ets b/Card/MovieCard/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a3253cf91ffd34722552f9881f03c0ff542b697 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import Want from '@ohos.app.ability.Want'; +import Window from '@ohos.window'; +import CommonConstants from '../common/constants/CommonConstants'; +import CommonUtils from '../common/utils/CommonUtils'; +import Logger from '../common/utils/Logger'; + +/** + * Lift cycle management of Ability. + */ +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + Logger.info(CommonConstants.TAG_ABILITY, 'want = ' + JSON.stringify(want)); + Logger.info(CommonConstants.TAG_ABILITY, 'launchParam = ' + JSON.stringify(launchParam)); + CommonUtils.createRdbStore(this.context); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability. + windowStage.loadContent('pages/MovieListPage', (err, data) => { + if (err.code) { + Logger.error(CommonConstants.TAG_ABILITY, 'Failed to load ' + JSON.stringify(err)); + return; + } + Logger.info(CommonConstants.TAG_ABILITY, 'Succeeded loading ' + JSON.stringify(data)); + }); + } +} diff --git a/Card/MovieCard/entry/src/main/ets/entryformability/EntryFormAbility.ets b/Card/MovieCard/entry/src/main/ets/entryformability/EntryFormAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..a9a29db58270e064662f95adfa084b59a1551245 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/entryformability/EntryFormAbility.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2023 Huawei Device 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 relationalStore from '@ohos.data.relationalStore'; +import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; +import formBindingData from '@ohos.app.form.formBindingData'; +import formProvider from '@ohos.app.form.formProvider'; +import Want from '@ohos.app.ability.Want'; +import CommonConstants from '../common/constants/CommonConstants'; +import FormBean from '../common/bean/FormBean'; +import CommonUtils from '../common/utils/CommonUtils'; +import MovieDataBean from '../common/bean/MovieDataBean'; +import Logger from '../common/utils/Logger'; + +/** + * Form management of Ability. + */ +export default class EntryFormAbility extends FormExtensionAbility { + onAddForm(want: Want) { + let formId: string = want.parameters[CommonConstants.IDENTITY_KEY] as string; + let formName: string = want.parameters[CommonConstants.NAME_KEY] as string; + let dimensionFlag: number = want.parameters[CommonConstants.DIMENSION_KEY] as number; + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + let form: FormBean = new FormBean(); + form.formId = formId; + form.formName = formName; + form.dimension = dimensionFlag; + CommonUtils.insertForm(form, rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.TAG_FORM_ABILITY, 'onAddForm create rdb error ' + JSON.stringify(error)); + }); + + // Refresh every five minutes. + formProvider.setFormNextRefreshTime(formId, CommonConstants.FIVE_MINUTES, (error, data) => { + if (error) { + Logger.error(CommonConstants.TAG_FORM_ABILITY, 'setRefreshTime error ' + JSON.stringify(error)); + } else { + Logger.info(CommonConstants.TAG_FORM_ABILITY, 'setRefreshTime success ' + JSON.stringify(data)); + } + }); + let listData: MovieDataBean[] = CommonUtils.getListData(); + let formData = CommonUtils.getFormData(listData); + return formBindingData.createFormBindingData(formData); + } + + onUpdateForm(formId: string) { + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + CommonUtils.updateMovieCardData(rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.TAG_FORM_ABILITY, 'onUpdateForm create rdb error ' + JSON.stringify(error)); + }); + // Refresh every five minutes. + formProvider.setFormNextRefreshTime(formId, CommonConstants.FIVE_MINUTES, (error, data) => { + if (error) { + Logger.error(CommonConstants.TAG_FORM_ABILITY, 'update setTime error' + JSON.stringify(error)); + } else { + Logger.info(CommonConstants.TAG_FORM_ABILITY, 'update setTime success ' + JSON.stringify(data)); + } + }); + } + + onRemoveForm(formId: string) { + // Deleting card information from the database. + CommonUtils.createRdbStore(this.context).then((rdbStore: relationalStore.RdbStore) => { + CommonUtils.deleteFormData(formId, rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.TAG_FORM_ABILITY, 'removeForm create rdb error ' + JSON.stringify(error)); + }); + } +}; \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/pages/MovieDetailsPage.ets b/Card/MovieCard/entry/src/main/ets/pages/MovieDetailsPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..baa66f361d11e331228247ab5c992923b5ccec03 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/pages/MovieDetailsPage.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import MovieStills from '../view/MovieStills'; +import MovieStarring from '../view/MovieStarring'; +import CommonConstants from '../common/constants/CommonConstants'; +import StyleConstants from '../common/constants/StyleConstants'; +import CommonUtils from '../common/utils/CommonUtils'; +import MovieDataBean from '../common/bean/MovieDataBean'; +import StoryIntroduce from '../view/StoryIntroduce'; +import MovieDetailsTitle from '../view/MovieDetailsTitle'; +import Logger from '../common/utils/Logger'; + +@Entry +@Component +struct MovieDetailPage { + private introduction: string; + private movieData: MovieDataBean; + + aboutToAppear() { + let index: number = 0; + if (!CommonUtils.isEmpty(router.getParams())) { + index = router.getParams()[CommonConstants.INDEX_KEY] ?? 0; + } else { + index = globalThis.position ?? 0; + } + let listData: MovieDataBean[] = CommonUtils.getListData(); + if (CommonUtils.isEmptyArr(listData)) { + Logger.error(CommonConstants.TAG_DETAILS_PAGE, 'listData is 0'); + return; + } + this.movieData = listData[index]; + this.introduction = listData[index].introduction; + } + + build() { + Column() { + Text($r('app.string.text_movie_details')) + .fontWeight(FontWeight.Bolder) + .fontSize($r('app.float.movie_details_size')) + .alignSelf(ItemAlign.Start) + .margin({ + left: StyleConstants.COMMON_MARGIN_LEFT, + top: StyleConstants.DETAILS_COMMON_MARGIN, + bottom: StyleConstants.DETAILS_COMMON_MARGIN + }) + .height($r('app.float.details_text_height')) + Column() { + MovieDetailsTitle({ + movieDetail: this.movieData + }) + StoryIntroduce({ + introduction: this.introduction + }) + } + .margin({ + left: $r("app.float.column_margin"), + right: $r("app.float.column_margin") + }) + .padding({ + left: $r("app.float.column_padding"), + top: $r("app.float.column_padding"), + right: $r("app.float.column_padding"), + bottom: $r('app.float.column_padding_bottom') }) + .borderRadius($r('app.float.column_details_radius')) + .backgroundColor(Color.White) + .width(StyleConstants.COLUMN_DETAILS_WIDTH) + + MovieStarring() + MovieStills() + } + .backgroundColor($r("app.color.common_background_color")) + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/pages/MovieListPage.ets b/Card/MovieCard/entry/src/main/ets/pages/MovieListPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7bed75b03e3946bfbe689a92a882ebb2ca232dd --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/pages/MovieListPage.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device 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 StyleConstants from '../common/constants/StyleConstants'; +import DataSource from '../common/datasource/DataSource'; +import MovieDataBean from '../common/bean/MovieDataBean'; +import MovieItem from '../view/MovieItem'; +import CommonUtils from '../common/utils/CommonUtils'; + +/** + * MovieListPage is the program entry and displays movie ranking data. + * The message is displayed on the notification bar. The card data can be updated normally. + * Developers can open the notification bar. + */ +@Entry +@Component +struct MovieListPage { + // Lazy loading of matching data sources. + private dataSource: DataSource; + + aboutToAppear() { + this.dataSource = new DataSource(CommonUtils.getListData()); + // Start the timer and update the card data every 10 seconds. + CommonUtils.startTimer(); + } + + aboutToDisappear() { + clearInterval(globalThis.intervalId); + } + + build() { + Column() { + Text($r('app.string.list_page_title')) + .fontWeight(FontWeight.Bolder) + .fontSize($r('app.float.list_title_size')) + .alignSelf(ItemAlign.Start) + .margin({ + left: StyleConstants.COMMON_MARGIN_LEFT, + top: StyleConstants.COMMON_MARGIN_TOP, + bottom: StyleConstants.LIST_TITLE_MARGIN + }) + .height($r('app.float.list_title_height')) + List({ space: StyleConstants.LIST_COMPONENT_SPACE }) { + LazyForEach(this.dataSource, (item: MovieDataBean) => { + ListItem() { + MovieItem({ movieItem: item }); + } + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Vertical) + .edgeEffect(EdgeEffect.None) + .layoutWeight(StyleConstants.WEIGHT_ONE) + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + } + .backgroundColor($r('app.color.common_background_color')) + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/view/MovieDetailsTitle.ets b/Card/MovieCard/entry/src/main/ets/view/MovieDetailsTitle.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d4013a413c333f32cc061efbb689bd6edcaa672 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/view/MovieDetailsTitle.ets @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constants/CommonConstants'; +import StyleConstants from '../common/constants/StyleConstants'; +import CommonUtils from '../common/utils/CommonUtils'; +import MovieDataBean from '../common/bean/MovieDataBean'; +import StarsWidget from './StarsWidget'; +import Logger from '../common/utils/Logger'; + +@Component +export default struct MovieDetailsTitle { + private movieDetail: MovieDataBean; + private movieImage: Resource; + private title: string; + private rating: string; + private stars: Resource[]; + private describe: string; + + aboutToAppear() { + if (CommonUtils.isEmpty(this.movieDetail)) { + Logger.error(CommonConstants.TAG_DETAILS_COMPONENT, 'movieDetail is null'); + return; + } + this.movieImage = this.movieDetail.movieImage; + this.title = this.movieDetail.title; + this.rating = this.movieDetail.rating; + this.stars = this.movieDetail.stars; + this.describe = this.movieDetail.describe; + } + + build() { + Row() { + Image(this.movieImage) + .objectFit(ImageFit.Cover) + .borderRadius($r('app.float.title_image_radius')) + .width($r('app.float.title_image_width')) + .height($r('app.float.title_image_height')) + Column() { + Text(this.title) + .fontSize($r('app.float.title_size')) + .fontWeight(FontWeight.Bolder) + .fontColor($r('app.color.common_font_color')) + .alignSelf(ItemAlign.Start) + StarsWidget({ + rating: this.rating, + stars: this.stars + }) + Text(this.describe) + .fontSize($r('app.float.describe_size')) + .fontColor($r('app.color.common_font_color')) + .fontWeight(FontWeight.Normal) + .opacity($r('app.float.common_opacity')) + .alignSelf(ItemAlign.Start) + .margin({ bottom: $r("app.float.describe_bottom") }) + Text($r('app.string.want_to_see')) + .fontWeight(FontWeight.Bolder) + .fontSize($r("app.float.see_button_size")) + .textAlign(TextAlign.Center) + .fontColor(Color.White) + .borderRadius($r("app.float.see_button_radius")) + .alignSelf(ItemAlign.Start) + .backgroundColor($r("app.color.see_button_background")) + .width($r("app.float.see_button_width")) + .height($r("app.float.see_button_height")) + } + .layoutWeight(StyleConstants.WEIGHT_ONE) + .margin({ left: $r('app.float.see_button_left') }) + } + .alignSelf(ItemAlign.Start) + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/view/MovieItem.ets b/Card/MovieCard/entry/src/main/ets/view/MovieItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..df1204c0c47bf2c5cf8160a016a4a0f0cd7b1275 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/view/MovieItem.ets @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import Logger from '../common/utils/Logger'; +import CommonConstants from '../common/constants/CommonConstants'; +import StyleConstants from '../common/constants/StyleConstants'; +import MovieDataBean from '../common/bean/MovieDataBean'; +import StarsWidget from './StarsWidget'; +import CommonUtils from '../common/utils/CommonUtils'; + +@Component +export default struct MovieItem { + private movieItem: MovieDataBean; + private sort: number; + private isShowSort: boolean; + private sortImage: Resource; + private title: string; + private describe: string; + private movieImage: Resource; + private stars: Resource[]; + private rating: string; + + aboutToAppear() { + if (CommonUtils.isEmpty(this.movieItem)) { + Logger.error(CommonConstants.TAG_MOVIE_ITEM, 'movieItem is null'); + return; + } + this.sort = this.movieItem.sort; + this.isShowSort = this.movieItem.isShowSort; + this.sortImage = this.movieItem.sortImage; + this.title = this.movieItem.title; + this.describe = this.movieItem.describe; + this.movieImage = this.movieItem.movieImage; + this.stars = this.movieItem.stars; + this.rating = this.movieItem.rating; + } + + build() { + Row() { + Stack({ alignContent: Alignment.TopStart }) { + Image(this.movieImage) + .objectFit(ImageFit.Cover) + .borderRadius($r('app.float.movie_image_radius')) + .width($r('app.float.movie_image_width')) + .height($r('app.float.movie_image_height')) + if (this.isShowSort) { + Image(this.sortImage) + .width($r('app.float.sort_image_size')) + .height($r('app.float.sort_image_size')) + } + } + .margin({ left: $r('app.float.movie_image_left') }) + + Column() { + Text(this.title) + .fontSize($r('app.float.movie_text_size')) + .fontWeight(FontWeight.Bolder) + .fontColor($r('app.color.common_font_color')) + .alignSelf(ItemAlign.Start) + StarsWidget({ + rating: this.rating, + stars: this.stars + }) + Text(this.describe) + .fontSize($r('app.float.describe_text_size')) + .fontColor($r('app.color.common_font_color')) + .fontWeight(FontWeight.Normal) + .opacity($r('app.float.common_opacity')) + .alignSelf(ItemAlign.Start) + } + .layoutWeight(StyleConstants.WEIGHT_ONE) + .margin({ + left: $r('app.float.contents_layout_left'), + right: $r('app.float.contents_layout_right') + }) + + Text($r('app.string.want_to_see')) + .fontWeight(FontWeight.Bolder) + .fontSize($r("app.float.see_button_size")) + .textAlign(TextAlign.Center) + .fontColor(Color.White) + .borderRadius($r("app.float.see_button_radius")) + .backgroundColor($r("app.color.see_button_background")) + .margin({ right: $r('app.float.see_button_right') }) + .width($r("app.float.see_button_width")) + .height($r("app.float.see_button_height")) + .onClick(() => { + router.pushUrl({ + url: CommonConstants.SEE_BUTTON_PUSH, + params: { + index: this.sort + } + }).catch((error) => { + Logger.error(CommonConstants.TAG_MOVIE_ITEM, 'push error ' + JSON.stringify(error)); + }); + }) + } + .borderRadius($r('app.float.item_radius')) + .backgroundColor(Color.White) + .margin({ + left: $r('app.float.item_left'), + right: $r('app.float.item_right') + }) + .width(StyleConstants.ITEM_WIDTH) + .height($r('app.float.item_height')) + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/view/MovieStarring.ets b/Card/MovieCard/entry/src/main/ets/view/MovieStarring.ets new file mode 100644 index 0000000000000000000000000000000000000000..0083c2a0d9c73460c98117a577c2bee5e52ff899 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/view/MovieStarring.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonUtils from '../common/utils/CommonUtils'; +import StyleConstants from '../common/constants/StyleConstants'; +import DataSource from '../common/datasource/DataSource'; + +@Component +export default struct MovieStarring { + private dataSource: DataSource; + + aboutToAppear() { + this.dataSource = new DataSource(CommonUtils.getStarringData()); + } + + build() { + Column() { + Row() { + Text($r("app.string.starring_text")) + .fontSize($r('app.float.starring_title_size')) + .fontColor($r('app.color.common_font_color')) + .fontWeight(FontWeight.Bolder) + Text($r('app.string.starring_count')) + .fontSize($r('app.float.starring_content_size')) + .opacity($r('app.float.common_opacity')) + .fontColor($r('app.color.common_font_color')) + .layoutWeight(StyleConstants.WEIGHT_ONE) + .width(StyleConstants.STARRING_TEXT_WIDTH) + .textAlign(TextAlign.End) + .fontWeight(FontWeight.Normal) + .margin({ right: $r('app.float.starring_text_margin') }) + Image($r("app.media.ic_arrow")) + .width($r('app.float.image_arrow_width')) + .height($r('app.float.image_arrow_height')) + } + .margin({ + left: StyleConstants.COMMON_MARGIN_LEFT, + top: StyleConstants.COMMON_MARGIN_TOP, + right: StyleConstants.COMMON_MARGIN_RIGHT, + bottom: StyleConstants.COMMON_MARGIN_BOTTOM + }) + .width(StyleConstants.STARRING_WIDTH) + + List({ space: StyleConstants.STARRING_SPACE }) { + LazyForEach(this.dataSource, (item: Resource) => { + ListItem() { + Column() { + Image(item) + .width($r('app.float.starring_image_size')) + .height($r('app.float.starring_image_size')) + .borderRadius($r('app.float.starring_image_radius')) + Text($r('app.string.actors')) + .fontSize($r('app.float.actors_font_size')) + .fontColor($r('app.color.common_font_color')) + .fontWeight(FontWeight.Normal) + .alignSelf(ItemAlign.Start) + .margin({ + top: $r('app.float.actors_margin_top'), + bottom: $r('app.float.actors_margin_bottom') + }) + Text($r('app.string.play_the_role')) + .fontSize($r('app.float.role_font_size')) + .opacity($r('app.float.common_opacity')) + .fontColor($r('app.color.common_font_color')) + .alignSelf(ItemAlign.Start) + .fontWeight(FontWeight.Normal) + } + } + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Horizontal) + .edgeEffect(EdgeEffect.None) + .margin({ left: StyleConstants.COMMON_MARGIN_LEFT }) + .width(StyleConstants.STARRING_LIST_WIDTH) + .height(StyleConstants.STARRING_LIST_HEIGHT) + } + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/view/MovieStills.ets b/Card/MovieCard/entry/src/main/ets/view/MovieStills.ets new file mode 100644 index 0000000000000000000000000000000000000000..11a55f3ce439269d6625a5b0e6fd6da6fba3fe2b --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/view/MovieStills.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonUtils from '../common/utils/CommonUtils'; +import StyleConstants from '../common/constants/StyleConstants'; +import DataSource from '../common/datasource/DataSource'; + +@Component +export default struct MovieStills { + private dataSource: DataSource; + + aboutToAppear() { + this.dataSource = new DataSource(CommonUtils.getStillsData()); + } + + build() { + Column() { + Row() { + Text($r('app.string.stills')) + .fontSize($r('app.float.stills_title_size')) + .fontColor($r('app.color.common_font_color')) + .fontWeight(FontWeight.Bolder) + Text($r('app.string.stills_count')) + .fontSize($r('app.float.stills_content_size')) + .opacity($r('app.float.common_opacity')) + .fontColor($r('app.color.common_font_color')) + .layoutWeight(StyleConstants.WEIGHT_ONE) + .width(StyleConstants.STILLS_TEXT_WIDTH) + .textAlign(TextAlign.End) + .fontWeight(FontWeight.Normal) + .margin({ right: $r('app.float.stills_margin_right') }) + Image($r("app.media.ic_arrow")) + .width($r('app.float.image_arrow_width')) + .height($r('app.float.image_arrow_height')) + } + .margin({ + left: StyleConstants.COMMON_MARGIN_LEFT, + top: StyleConstants.COMMON_MARGIN_TOP, + right: StyleConstants.COMMON_MARGIN_RIGHT, + bottom: StyleConstants.COMMON_MARGIN_BOTTOM + }) + .width(StyleConstants.STILLS_WIDTH) + + List({ space: StyleConstants.STILLS_LIST_SPACE }) { + LazyForEach(this.dataSource, (item: Resource) => { + ListItem() { + Image(item) + .width($r('app.float.stills_image_width')) + .height($r('app.float.stills_image_height')) + .borderRadius($r('app.float.stills_image_radius')) + } + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Horizontal) + .edgeEffect(EdgeEffect.None) + .margin({ left: StyleConstants.COMMON_MARGIN_LEFT }) + .width(StyleConstants.STILLS_LIST_WIDTH) + .height($r('app.float.stills_list_height')) + } + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/view/StarsWidget.ets b/Card/MovieCard/entry/src/main/ets/view/StarsWidget.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5ea6157535b8028ab9b520d476ca1eba46b0643 --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/view/StarsWidget.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 StyleConstants from '../common/constants/StyleConstants'; + +@Component +export default struct StarsWidget { + private rating: string = ''; + private stars: Resource[]; + + build() { + Row() { + List({ space: StyleConstants.STARS_LIST_SPACE }) { + ForEach(this.stars, (item) => { + ListItem() { + Image(item) + .width($r('app.float.stars_image_size')) + .height($r('app.float.stars_image_size')) + } + }, (item, index) => JSON.stringify(item) + index) + } + .listDirection(Axis.Horizontal) + .edgeEffect(EdgeEffect.None) + .height($r('app.float.stars_list_height')) + .width($r('app.float.stars_list_width')) + + Blank().width($r('app.float.blank_width')) + Text(this.rating) + .fontSize($r('app.float.rating_text_size')) + .fontWeight(FontWeight.Bolder) + .fontColor($r('app.color.common_font_color')) + } + .margin({ + top: $r('app.float.stars_margin_size'), + bottom: $r('app.float.stars_margin_size') + }) + .alignSelf(ItemAlign.Start) + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/ets/view/StoryIntroduce.ets b/Card/MovieCard/entry/src/main/ets/view/StoryIntroduce.ets new file mode 100644 index 0000000000000000000000000000000000000000..472f49af57a5027d540923e57def2e7c41b46dce --- /dev/null +++ b/Card/MovieCard/entry/src/main/ets/view/StoryIntroduce.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constants/CommonConstants'; + +@Component +export default struct StoryIntroduce { + @State tipsTextLines: number = CommonConstants.DEFAULT_LINES; + @State tipsText: Resource = $r("app.string.expand_text"); + private introduction: string; + + build() { + Column() { + Text($r('app.string.story_introduction')) + .fontSize($r('app.float.story_font_size')) + .fontWeight(FontWeight.Bolder) + .fontColor($r('app.color.common_font_color')) + .alignSelf(ItemAlign.Start) + .margin({ + top: $r('app.float.story_margin_left'), + bottom: $r('app.float.story_margin_right') + }) + Stack({ alignContent: Alignment.BottomEnd }) { + Text(this.introduction) + .fontSize($r('app.float.introduction_font_size')) + .lineHeight($r('app.float.introduction_line_height')) + .fontColor($r('app.color.common_font_color')) + .opacity($r('app.float.common_opacity')) + .fontWeight(FontWeight.Normal) + .maxLines(this.tipsTextLines) + Image($r("app.media.ic_masking")) + .width($r('app.float.masking_width')) + .height($r('app.float.masking_height')) + Text(this.tipsText) + .fontColor($r('app.color.tips_text_color')) + .fontSize($r('app.float.tips_font_size')) + .lineHeight($r('app.float.tips_line_height')) + .fontWeight(FontWeight.Bolder) + .backgroundColor(Color.White) + .textAlign(TextAlign.End) + .onClick(() => { + if (this.tipsTextLines === CommonConstants.DEFAULT_LINES) { + this.tipsTextLines = CommonConstants.MAX_LINES; + this.tipsText = $r('app.string.collapse_text'); + } else { + this.tipsTextLines = CommonConstants.DEFAULT_LINES; + this.tipsText = $r('app.string.expand_text'); + } + }) + } + } + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.css b/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..e218fd1c38aaa8a20509f3b30567d880763f0a7a --- /dev/null +++ b/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.css @@ -0,0 +1,76 @@ +.card-root-layout { + width: 100%; + height: 100%; + justify-content: center; + align-content: center; + align-items: center; + position: relative; +} + +.card-background-layout { + width: 100%; + height: 100%; + background-color: #182431; + position: absolute; + opacity: 0.6; +} + +.card-layout { + width: 100%; + height: 100%; + padding: 12px; + position: absolute; + justify-content: center; + align-content: center; + flex-direction: column; +} + +.card-top-layout { + width: 100%; + height: 57px; + flex-direction: row; +} + +.card-bottom-layout { + width: 100%; + height: 57px; + margin-top: 12px; + flex-direction: row; +} + +.card-image { + width: 44px; + height: 57px; + border-radius: 10px; +} + +.card-text-layout { + width: 76px; + height: 100%; + margin-left: 6px; + justify-content: center; + align-content: center; + flex-direction: column; +} + +.card-text-title { + font-size: 14px; + color: #FFFFFF; + max-lines: 1; + text-overflow: ellipsis; + text-align: left; + line-height: 19px; + font-weight: 500; +} + +.card-text-content { + opacity: 0.6; + font-size: 12px; + max-lines: 2; + text-overflow: ellipsis; + color: #FFFFFF; + text-align: left; + line-height: 16px; + font-weight: 400; +} + diff --git a/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.hml b/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..08a2a9a793fec60caf1f652e24e9aa701018da2f --- /dev/null +++ b/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.hml @@ -0,0 +1,21 @@ +
+
+
+
+ +
+ {{ topTitle }} + {{ topDescribe }} +
+
+ +
+ +
+ {{ bottomTitle }} + {{ bottomDescribe }} +
+
+
+
+ diff --git a/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.json b/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d75fafe6ccdb87d37890fa5b9d414bffdef00091 --- /dev/null +++ b/Card/MovieCard/entry/src/main/js/card2x2/pages/index/index.json @@ -0,0 +1,28 @@ +{ + "data": { + "topIndex": 0, + "topMovieImage": "/common/ic_movie_one.png", + "topTitle": "冰上姐妹", + "topDescribe": "讲述冰上女运动员之间团结友爱、互帮互助的故事", + "bottomIndex": 1, + "bottomMovieImage": "/common/ic_movie_two.png", + "bottomTitle": "冲破黎明前的黑暗", + "bottomDescribe": "通过地道战的方式与日寇作斗争的故事" + }, + "actions": { + "topClickEvent": { + "action": "router", + "abilityName": "EntryDetailsAbility", + "params": { + "index": "{{topIndex}}" + } + }, + "bottomClickEvent": { + "action": "router", + "abilityName": "EntryDetailsAbility", + "params": { + "index": "{{bottomIndex}}" + } + } + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.css b/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..d0b45095bf27024ff5f87086142f0a027bc3792a --- /dev/null +++ b/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.css @@ -0,0 +1,69 @@ +.card-root-layout { + width: 100%; + height: 100%; + justify-content: center; + align-content: center; + align-items: center; + position: relative; +} + +.card-background-layout { + width: 100%; + height: 100%; + background-color: #182431; + position: absolute; + opacity: 0.6; +} + +.card-layout { + width: 100%; + height: 100%; + padding: 12px; + position: absolute; + justify-content: center; + flex-direction: row; +} + +.card-left-layout { + width: 140px; + height: 100%; + justify-content: center; + flex-direction: column; +} + +.card-right-layout { + width: 140px; + height: 100%; + margin-left: 12px; + justify-content: center; + flex-direction: column; +} + +.card-image { + width: 140px; + height: 80px; + border-radius: 10px; +} + +.card-text-title { + font-size: 16px; + color: #FFFFFF; + text-align: left; + line-height: 21px; + font-weight: 500; + margin-top: 6px; + max-lines: 1; + text-overflow: ellipsis; +} + +.card-text-content { + opacity: 0.6; + font-size: 14px; + color: #FFFFFF; + text-align: left; + line-height: 19px; + font-weight: 400; + max-lines: 1; + text-overflow: ellipsis; +} + diff --git a/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.hml b/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..41d7902f0849e3de82323eec19b0cf2b4cc90b1e --- /dev/null +++ b/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.hml @@ -0,0 +1,16 @@ +
+
+
+
+ + {{ topTitle }} + {{ topDescribe }} +
+ +
+ + {{ bottomTitle }} + {{ bottomDescribe }} +
+
+
diff --git a/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.json b/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..1f8a573b068c754668c5147807e77f3fe1d86f24 --- /dev/null +++ b/Card/MovieCard/entry/src/main/js/card2x4/pages/index/index.json @@ -0,0 +1,28 @@ +{ + "data": { + "topIndex": 3, + "topMovieImage": "/common/ic_movie_three.png", + "topTitle": "古刹钟声", + "topDescribe": "抗日战争时期,八路军剿灭日本特务的故事", + "bottomIndex": 4, + "bottomMovieImage": "/common/ic_movie_three.png", + "bottomTitle": "花木兰", + "bottomDescribe": "花木兰替父从军,英姿飒爽的故事" + }, + "actions": { + "leftClickEvent": { + "action": "router", + "abilityName": "EntryDetailsAbility", + "params": { + "index": "{{topIndex}}" + } + }, + "rightClickEvent": { + "action": "router", + "abilityName": "EntryDetailsAbility", + "params": { + "index": "{{bottomIndex}}" + } + } + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_eight.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_eight.png new file mode 100644 index 0000000000000000000000000000000000000000..5c6f13d0d8cc91491b3e4091bbf2b5021f787486 Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_eight.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_five.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_five.png new file mode 100644 index 0000000000000000000000000000000000000000..a662bc449c5ba9675dd53eee9f75963e67801e65 Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_five.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_four.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_four.png new file mode 100644 index 0000000000000000000000000000000000000000..b8bc160d5ef334e0b891968bf98db1716bdfff0e Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_four.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_one.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_one.png new file mode 100644 index 0000000000000000000000000000000000000000..536b4b192a178c1615def56c7590d6423b55eeda Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_one.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_seven.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_seven.png new file mode 100644 index 0000000000000000000000000000000000000000..ecd64a83117500937937c99e368731a320e0e506 Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_seven.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_six.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_six.png new file mode 100644 index 0000000000000000000000000000000000000000..5e2e2e0b7ecf7b3fa28b201830b6b296ca5a2571 Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_six.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_three.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_three.png new file mode 100644 index 0000000000000000000000000000000000000000..57ae355aca2abd2a6668b8a85f917f941366bdf0 Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_three.png differ diff --git a/Card/MovieCard/entry/src/main/js/common/ic_movie_two.png b/Card/MovieCard/entry/src/main/js/common/ic_movie_two.png new file mode 100644 index 0000000000000000000000000000000000000000..4f19d89b571ff415729425ab847d45faa023458b Binary files /dev/null and b/Card/MovieCard/entry/src/main/js/common/ic_movie_two.png differ diff --git a/Card/MovieCard/entry/src/main/module.json5 b/Card/MovieCard/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..cf34f768c71f0546df15f96b8a10d11c1167fc56 --- /dev/null +++ b/Card/MovieCard/entry/src/main/module.json5 @@ -0,0 +1,62 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "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", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + }, + { + "name": "EntryDetailsAbility", + "srcEntry": "./ets/detailsability/EntryDetailsAbility.ets", + "description": "$string:MovieDetailsAbility_desc", + "icon": "$media:icon", + "label": "$string:MovieDetailsAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true + } + ], + "extensionAbilities": [ + { + "name": "EntryFormAbility", + "srcEntry": "./ets/entryformability/EntryFormAbility.ets", + "label": "$string:EntryFormAbility_label", + "description": "$string:EntryFormAbility_desc", + "type": "form", + "metadata": [ + { + "name": "ohos.extension.form", + "resource": "$profile:form_config" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/element/color.json b/Card/MovieCard/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..48eed2d6c49dc139f401a35e0177b5953c9cbfee --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/element/color.json @@ -0,0 +1,24 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "common_background_color", + "value": "#F1F3F5" + }, + { + "name": "common_font_color", + "value": "#182431" + }, + { + "name": "tips_text_color", + "value": "#007DFF" + }, + { + "name": "see_button_background", + "value": "#007DFF" + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/element/float.json b/Card/MovieCard/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..ceb163536571f00df126f1704c47ed3c61924dfd --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/element/float.json @@ -0,0 +1,272 @@ +{ + "float": [ + { + "name": "movie_details_size", + "value": "24fp" + }, + { + "name": "details_text_height", + "value": "32vp" + }, + { + "name": "column_margin", + "value": "12vp" + }, + { + "name": "column_padding", + "value": "12vp" + }, + { + "name": "column_padding_bottom", + "value": "16vp" + }, + { + "name": "column_details_radius", + "value": "24vp" + }, + { + "name": "list_title_size", + "value": "24fp" + }, + { + "name": "list_title_height", + "value": "32vp" + }, + { + "name": "title_image_radius", + "value": "10vp" + }, + { + "name": "title_image_width", + "value": "120vp" + }, + { + "name": "title_image_height", + "value": "160vp" + }, + { + "name": "title_size", + "value": "21fp" + }, + { + "name": "describe_size", + "value": "12fp" + }, + { + "name": "common_opacity", + "value": "0.6" + }, + { + "name": "describe_bottom", + "value": "24vp" + }, + { + "name": "see_button_size", + "value": "12fp" + }, + { + "name": "see_button_radius", + "value": "14vp" + }, + { + "name": "see_button_width", + "value": "56vp" + }, + { + "name": "see_button_height", + "value": "28vp" + }, + { + "name": "see_button_left", + "value": "12vp" + }, + { + "name": "see_button_right", + "value": "12vp" + }, + { + "name": "movie_image_radius", + "value": "10vp" + }, + { + "name": "movie_image_width", + "value": "72vp" + }, + { + "name": "movie_image_height", + "value": "96vp" + }, + { + "name": "sort_image_size", + "value": "16vp" + }, + { + "name": "movie_image_left", + "value": "12vp" + }, + { + "name": "movie_text_size", + "value": "16fp" + }, + { + "name": "describe_text_size", + "value": "12fp" + }, + { + "name": "contents_layout_left", + "value": "12vp" + }, + { + "name": "contents_layout_right", + "value": "12vp" + }, + { + "name": "item_radius", + "value": "18vp" + }, + { + "name": "item_left", + "value": "12vp" + }, + { + "name": "item_right", + "value": "12vp" + }, + { + "name": "item_height", + "value": "116vp" + }, + { + "name": "stills_title_size", + "value": "16fp" + }, + { + "name": "stills_content_size", + "value": "14fp" + }, + { + "name": "stills_margin_right", + "value": "4vp" + }, + { + "name": "image_arrow_width", + "value": "12vp" + }, + { + "name": "image_arrow_height", + "value": "24vp" + }, + { + "name": "stills_image_width", + "value": "128vp" + }, + { + "name": "stills_image_height", + "value": "72vp" + }, + { + "name": "stills_image_radius", + "value": "10vp" + }, + { + "name": "stills_list_height", + "value": "72vp" + }, + { + "name": "story_font_size", + "value": "16fp" + }, + { + "name": "story_margin_left", + "value": "13vp" + }, + { + "name": "story_margin_right", + "value": "8vp" + }, + { + "name": "introduction_font_size", + "value": "14fp" + }, + { + "name": "introduction_line_height", + "value": "19vp" + }, + { + "name": "masking_width", + "value": "56vp" + }, + { + "name": "masking_height", + "value": "19vp" + }, + { + "name": "tips_font_size", + "value": "14vp" + }, + { + "name": "tips_line_height", + "value": "19vp" + }, + { + "name": "stars_image_size", + "value": "12vp" + }, + { + "name": "stars_list_height", + "value": "12vp" + }, + { + "name": "stars_list_width", + "value": "72vp" + }, + { + "name": "blank_width", + "value": "7vp" + }, + { + "name": "rating_text_size", + "value": "12fp" + }, + { + "name": "stars_margin_size", + "value": "6vp" + }, + { + "name": "starring_title_size", + "value": "16fp" + }, + { + "name": "starring_content_size", + "value": "14fp" + }, + { + "name": "starring_text_margin", + "value": "4vp" + }, + { + "name": "starring_image_size", + "value": "72vp" + }, + { + "name": "starring_image_radius", + "value": "10vp" + }, + { + "name": "actors_font_size", + "value": "12fp" + }, + { + "name": "actors_margin_top", + "value": "8vp" + }, + { + "name": "actors_margin_bottom", + "value": "2vp" + }, + { + "name": "role_font_size", + "value": "10fp" + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/element/string.json b/Card/MovieCard/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3f1d7366fe78578c249be297b2ad0c955ee8a786 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/element/string.json @@ -0,0 +1,80 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "Main program entry" + }, + { + "name": "EntryAbility_label", + "value": "MovieCard" + }, + { + "name": "EntryFormAbility_desc", + "value": "Service Card Entry" + }, + { + "name": "EntryFormAbility_label", + "value": "Service Card" + }, + { + "name": "expand_text", + "value": "Unfolding" + }, + { + "name": "collapse_text", + "value": "Collapse " + }, + { + "name": "text_movie_details", + "value": "Movie Details " + }, + { + "name": "want_to_see", + "value": "Want to see" + }, + { + "name": "story_introduction", + "value": "Synopsis of the story" + }, + { + "name": "starring_text", + "value": "Starring" + }, + { + "name": "starring_count", + "value": "All 6" + }, + { + "name": "actors", + "value": "Xiao Ming" + }, + { + "name": "play_the_role", + "value": "Decorated Da Bai" + }, + { + "name": "stills", + "value": "Stills" + }, + { + "name": "stills_count", + "value": "All 4" + }, + { + "name": "list_page_title", + "value": "Popular Movie Rankings" + }, + { + "name": "MovieDetailsAbility_desc", + "value": "MovieDetailsDescription" + }, + { + "name": "MovieDetailsAbility_label", + "value": "MovieCardDetails" + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_arrow.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_arrow.svg new file mode 100644 index 0000000000000000000000000000000000000000..0da26cc9188c3771c82e72e3093916fc65629305 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_arrow.svg @@ -0,0 +1,13 @@ + + + ic_arrow + + + + + + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_empty_star.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_empty_star.svg new file mode 100644 index 0000000000000000000000000000000000000000..87a3985281469803bb53335b7a31b0f71c0b8228 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_empty_star.svg @@ -0,0 +1,13 @@ + + + ic_star + + + + + + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_fifth.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_fifth.svg new file mode 100644 index 0000000000000000000000000000000000000000..1d8d34a5c5bdf476995716c0cb393ecc04b2558b --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_fifth.svg @@ -0,0 +1,8 @@ + + + ic_No5 + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_first.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_first.svg new file mode 100644 index 0000000000000000000000000000000000000000..378b11f493434aaa58cfcad65c8bab614f39e94a --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_first.svg @@ -0,0 +1,8 @@ + + + ic_No1 + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_fourth.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_fourth.svg new file mode 100644 index 0000000000000000000000000000000000000000..aeb7fa02f51ca3d947d9a6c5073b54655ba9e362 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_fourth.svg @@ -0,0 +1,8 @@ + + + ic_No4 + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_half_star.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_half_star.svg new file mode 100644 index 0000000000000000000000000000000000000000..8b6893b02e21395eb4118fe264a542451099645b --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_half_star.svg @@ -0,0 +1,14 @@ + + + ic_star3 + + + + + + + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_masking.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_masking.svg new file mode 100644 index 0000000000000000000000000000000000000000..11b10d2055dca8f0448e6401b03db9b784c0843d --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_masking.svg @@ -0,0 +1,16 @@ + + + 遮罩 + + + + + + + + + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_eight.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_eight.png new file mode 100644 index 0000000000000000000000000000000000000000..5c6f13d0d8cc91491b3e4091bbf2b5021f787486 Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_eight.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_five.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_five.png new file mode 100644 index 0000000000000000000000000000000000000000..a662bc449c5ba9675dd53eee9f75963e67801e65 Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_five.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_four.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_four.png new file mode 100644 index 0000000000000000000000000000000000000000..b8bc160d5ef334e0b891968bf98db1716bdfff0e Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_four.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_one.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_one.png new file mode 100644 index 0000000000000000000000000000000000000000..536b4b192a178c1615def56c7590d6423b55eeda Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_one.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_seven.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_seven.png new file mode 100644 index 0000000000000000000000000000000000000000..ecd64a83117500937937c99e368731a320e0e506 Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_seven.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_six.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_six.png new file mode 100644 index 0000000000000000000000000000000000000000..5e2e2e0b7ecf7b3fa28b201830b6b296ca5a2571 Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_six.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_three.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_three.png new file mode 100644 index 0000000000000000000000000000000000000000..57ae355aca2abd2a6668b8a85f917f941366bdf0 Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_three.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_two.png b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_two.png new file mode 100644 index 0000000000000000000000000000000000000000..4f19d89b571ff415729425ab847d45faa023458b Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/ic_movie_two.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_second.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_second.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a27347787e15b89b24fe27ccc59c27e5d461737 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_second.svg @@ -0,0 +1,8 @@ + + + ic_No2 + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_star.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_star.svg new file mode 100644 index 0000000000000000000000000000000000000000..707b43f5a0561dd05e189a4c6ea17db815c9044a --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_star.svg @@ -0,0 +1,13 @@ + + + ic_star2 + + + + + + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/ic_third.svg b/Card/MovieCard/entry/src/main/resources/base/media/ic_third.svg new file mode 100644 index 0000000000000000000000000000000000000000..f3c9cafb84d317e12fc5c8b97f16f9aa5e7c0833 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/media/ic_third.svg @@ -0,0 +1,8 @@ + + + ic_No3 + + + + + \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/media/icon.png b/Card/MovieCard/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Card/MovieCard/entry/src/main/resources/base/media/icon.png differ diff --git a/Card/MovieCard/entry/src/main/resources/base/profile/form_config.json b/Card/MovieCard/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 0000000000000000000000000000000000000000..65b11a1c4ee4f7d5906547234c96756b1eb91763 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,40 @@ +{ + "forms": [ + { + "name": "card2x2", + "description": "This is a service widget.", + "src": "./js/card2x2/pages/index/index", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDefault": true, + "updateEnabled": true, + "scheduledUpdateTime": "00:00", + "updateDuration": 1, + "defaultDimension": "2*2", + "supportDimensions": [ + "2*2" + ] + }, + { + "name": "card2x4", + "description": "This is a service widget.", + "src": "./js/card2x4/pages/index/index", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDefault": false, + "updateEnabled": true, + "scheduledUpdateTime": "00:00", + "updateDuration": 1, + "defaultDimension": "2*4", + "supportDimensions": [ + "2*4" + ] + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/base/profile/main_pages.json b/Card/MovieCard/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..02dd10a95e8c88c71f26e2869f188c784f744c24 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/MovieListPage", + "pages/MovieDetailsPage" + ] +} diff --git a/Card/MovieCard/entry/src/main/resources/en_US/element/string.json b/Card/MovieCard/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3f1d7366fe78578c249be297b2ad0c955ee8a786 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,80 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "Main program entry" + }, + { + "name": "EntryAbility_label", + "value": "MovieCard" + }, + { + "name": "EntryFormAbility_desc", + "value": "Service Card Entry" + }, + { + "name": "EntryFormAbility_label", + "value": "Service Card" + }, + { + "name": "expand_text", + "value": "Unfolding" + }, + { + "name": "collapse_text", + "value": "Collapse " + }, + { + "name": "text_movie_details", + "value": "Movie Details " + }, + { + "name": "want_to_see", + "value": "Want to see" + }, + { + "name": "story_introduction", + "value": "Synopsis of the story" + }, + { + "name": "starring_text", + "value": "Starring" + }, + { + "name": "starring_count", + "value": "All 6" + }, + { + "name": "actors", + "value": "Xiao Ming" + }, + { + "name": "play_the_role", + "value": "Decorated Da Bai" + }, + { + "name": "stills", + "value": "Stills" + }, + { + "name": "stills_count", + "value": "All 4" + }, + { + "name": "list_page_title", + "value": "Popular Movie Rankings" + }, + { + "name": "MovieDetailsAbility_desc", + "value": "MovieDetailsDescription" + }, + { + "name": "MovieDetailsAbility_label", + "value": "MovieCardDetails" + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/entry/src/main/resources/zh_CN/element/string.json b/Card/MovieCard/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d552fff9db1e605035b2da145b555d1bf3f8ee99 --- /dev/null +++ b/Card/MovieCard/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,80 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "主程序入口" + }, + { + "name": "EntryAbility_label", + "value": "电影卡片" + }, + { + "name": "EntryFormAbility_desc", + "value": "服务卡片入口" + }, + { + "name": "EntryFormAbility_label", + "value": "服务卡片" + }, + { + "name": "expand_text", + "value": "展开" + }, + { + "name": "collapse_text", + "value": "收起" + }, + { + "name": "text_movie_details", + "value": "电影详情" + }, + { + "name": "want_to_see", + "value": "想看" + }, + { + "name": "story_introduction", + "value": "剧情简介" + }, + { + "name": "starring_text", + "value": "主演" + }, + { + "name": "starring_count", + "value": "全部 6" + }, + { + "name": "actors", + "value": "小明" + }, + { + "name": "play_the_role", + "value": "饰 大白" + }, + { + "name": "stills", + "value": "剧照" + }, + { + "name": "stills_count", + "value": "全部 4" + }, + { + "name": "list_page_title", + "value": "热门电影排行" + }, + { + "name": "MovieDetailsAbility_desc", + "value": "电影详情描述" + }, + { + "name": "MovieDetailsAbility_label", + "value": "电影详情" + } + ] +} \ No newline at end of file diff --git a/Card/MovieCard/figures/CardHome.jpg b/Card/MovieCard/figures/CardHome.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8988ba7f861397a614495e971f806353f06fbcc6 Binary files /dev/null and b/Card/MovieCard/figures/CardHome.jpg differ diff --git a/Card/MovieCard/figures/Congratulations.gif b/Card/MovieCard/figures/Congratulations.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/Card/MovieCard/figures/Congratulations.gif differ diff --git a/Card/MovieCard/figures/CreateJSDirectory.png b/Card/MovieCard/figures/CreateJSDirectory.png new file mode 100644 index 0000000000000000000000000000000000000000..fa0770bc2252130535d6fd733b92368aa6f587a2 Binary files /dev/null and b/Card/MovieCard/figures/CreateJSDirectory.png differ diff --git a/Card/MovieCard/figures/EnterJSInfo.png b/Card/MovieCard/figures/EnterJSInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..3f01b4850f700954c9a31269e0ff4e394edaaa9c Binary files /dev/null and b/Card/MovieCard/figures/EnterJSInfo.png differ diff --git a/Card/MovieCard/figures/JSDirectory.png b/Card/MovieCard/figures/JSDirectory.png new file mode 100644 index 0000000000000000000000000000000000000000..c444431020b4fb0509f18f3237d6c967e2391e56 Binary files /dev/null and b/Card/MovieCard/figures/JSDirectory.png differ diff --git a/Card/MovieCard/figures/MovieCard.gif b/Card/MovieCard/figures/MovieCard.gif new file mode 100644 index 0000000000000000000000000000000000000000..990ab3d09fd53d96497de4076ceac712514ee0bd Binary files /dev/null and b/Card/MovieCard/figures/MovieCard.gif differ diff --git a/Card/MovieCard/figures/MovieDetails.jpg b/Card/MovieCard/figures/MovieDetails.jpg new file mode 100644 index 0000000000000000000000000000000000000000..875128c7b42a1881594aeadfafd94876ae374780 Binary files /dev/null and b/Card/MovieCard/figures/MovieDetails.jpg differ diff --git a/Card/MovieCard/figures/MovieList.jpg b/Card/MovieCard/figures/MovieList.jpg new file mode 100644 index 0000000000000000000000000000000000000000..643f907d7c313559778da771977be60f33e702f4 Binary files /dev/null and b/Card/MovieCard/figures/MovieList.jpg differ diff --git a/Card/MovieCard/figures/SelectModule.png b/Card/MovieCard/figures/SelectModule.png new file mode 100644 index 0000000000000000000000000000000000000000..312254b1f1945094efdccdc93a3dcdd9718d1210 Binary files /dev/null and b/Card/MovieCard/figures/SelectModule.png differ diff --git a/Card/MovieCard/figures/zh-cn_image_0000001569303293.png b/Card/MovieCard/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/Card/MovieCard/figures/zh-cn_image_0000001569303293.png differ diff --git a/Card/MovieCard/hvigor/hvigor-config.json5 b/Card/MovieCard/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/Card/MovieCard/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/Card/MovieCard/hvigor/hvigor-wrapper.js b/Card/MovieCard/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/Card/MovieCard/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/Card/MovieCard/hvigorfile.ts b/Card/MovieCard/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/Card/MovieCard/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/Card/MovieCard/oh-package.json5 b/Card/MovieCard/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..846f2cccc85cbbef9fe93e98854033e56c49c90d --- /dev/null +++ b/Card/MovieCard/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "moviecard", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Card/MovieCard/public_sys-resources/icon-caution.gif b/Card/MovieCard/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Card/MovieCard/public_sys-resources/icon-caution.gif differ diff --git a/Card/MovieCard/public_sys-resources/icon-danger.gif b/Card/MovieCard/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Card/MovieCard/public_sys-resources/icon-danger.gif differ diff --git a/Card/MovieCard/public_sys-resources/icon-note.gif b/Card/MovieCard/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/Card/MovieCard/public_sys-resources/icon-note.gif differ diff --git a/Card/MovieCard/public_sys-resources/icon-notice.gif b/Card/MovieCard/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/Card/MovieCard/public_sys-resources/icon-notice.gif differ diff --git a/Card/MovieCard/public_sys-resources/icon-tip.gif b/Card/MovieCard/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/Card/MovieCard/public_sys-resources/icon-tip.gif differ diff --git a/Card/MovieCard/public_sys-resources/icon-warning.gif b/Card/MovieCard/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Card/MovieCard/public_sys-resources/icon-warning.gif differ diff --git a/Card/StepsCardJS/AppScope/app.json5 b/Card/StepsCardJS/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f4505690c94d118cef6d171a961c7276ef5d6780 --- /dev/null +++ b/Card/StepsCardJS/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.stepscard", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/Card/StepsCardJS/AppScope/resources/base/element/string.json b/Card/StepsCardJS/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..231bb978c29f1876c4cfbd62e0548d634ad2a586 --- /dev/null +++ b/Card/StepsCardJS/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "StepsCard" + } + ] +} diff --git a/Card/StepsCardJS/AppScope/resources/base/media/app_icon.png b/Card/StepsCardJS/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Card/StepsCardJS/AppScope/resources/base/media/app_icon.png differ diff --git a/Card/StepsCardJS/LICENSE b/Card/StepsCardJS/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/Card/StepsCardJS/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Card/StepsCardJS/README.md b/Card/StepsCardJS/README.md new file mode 100644 index 0000000000000000000000000000000000000000..682ea2139d50ad27707b868cd326287fcecf07ad --- /dev/null +++ b/Card/StepsCardJS/README.md @@ -0,0 +1,402 @@ +# 计步器卡片(JS) + +## 介绍 +本篇Codelab基于Stage模型实现带有卡片的计步应用,用于介绍卡片的开发及生命周期实现。需要完成以下功能: + +1. 消息通知栏,通知用户今天所行走步数。 +2. 元服务卡片,在桌面上添加2x2或2x4规格元服务卡片,能看到步数变化,也能看到当天所行走的进度。 +3. 关系型数据库,用于查询,添加用户行走的数据。 + +![](figures/StepsCard.gif) + +### 相关概念 + +- [消息通知](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-notificationManager.md):提供通知管理的能力,包括发布、取消发布通知,创建、获取、移除通知通道,订阅、取消订阅通知,获取通知的使能状态、角标使能状态,获取通知的相关信息等。 +- [关系型数据库](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-relationalStore.md):关系型数据库基于SQLite组件提供了一套完整的对本地数据库进行管理的机制,对外提供了一系列的增、删、改、查等接口,也可以直接运行用户输入的SQL语句来满足复杂的场景需要。 +- [元服务卡片开发](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md):卡片是一种界面展示形式,可以将应用的重要信息或操作前置到卡片,以达到服务直达、减少体验层级的目的。 + - 卡片提供方:显示卡片内容,控制卡片布局以及控件点击事件。 + - 卡片使用方:显示卡片内容的宿主应用,控制卡片在宿主中展示的位置。 + - 卡片管理服务:用于管理系统中所添加卡片的常驻代理服务,包括卡片对象的管理与使用,以及卡片周期性刷新等。 + + + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──ChartPoint.ets // 图表点bean +│ │ │ ├──ChartValues.ets // 图表值bean +│ │ │ ├──FormData.ets // 表单数据bean +│ │ │ └──PointStyle.ets // 图表点样式bean +│ │ ├──constants +│ │ │ └──CommonConstants.ets // 常量类 +│ │ ├──database +│ │ │ ├──Form.ets // 数据库卡片操作 +│ │ │ └──SensorData.ets // 数据库行走步数操作 +│ │ └──utils +│ │ ├──ChartDataUtils.ets // 图表数据操作工具类 +│ │ ├──DatabaseUtils.ets // 数据库工具类 +│ │ ├──DateUtils.ets // 日期工具类 +│ │ └──Logger.ets // 日志打印工具类 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entryformability +│ │ └──EntryFormAbility.ets // 卡片创建,更新,删除操作类 +│ └──pages +│ └──MainPage.ets // 主界面 +├──entry/src/main/js // js代码区 +│ ├──card2x2 // 2x2卡片目录 +│ ├──card2x4 // 2x4卡片目录 +│ ├──common // 卡片资源目录 +│ └──i18n // 卡片国际化目录 +└──entry/src/main/resources // 资源文件目录 +``` + +## 关系型数据库 + +元服务卡片需要用数据库保存不同时间、不同卡片的数据,而且在添加多张卡片情况下,需要保持数据同步刷新。因此需要创建两张表,一张是保存卡片信息,另一张是记录当天行走步数。 + +1. 数据库创建使用的SQLite。 + + ```typescript + // CommonConstants.ets + // 表单SQLite + static readonly CREATE_TABLE_FORM: string = 'CREATE TABLE IF NOT EXISTS Form ' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, formId STRING, formName STRING, dimension INTEGER)'; + // 行走步数SQLite + static readonly CREATE_TABLE_SENSOR_DATA: string = 'CREATE TABLE IF NOT EXISTS SensorData ' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, date STRING, stepsValue INTEGER)'; + ``` + +2. 在EntryAbility的onCreate方法通过DatabaseUtils.createRdbStore方法创建数据库,并创建相应的表。 + + ```typescript + // EntryAbility.ets + onCreate(want: Want) { + globalThis.abilityWant = want; + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + // 添加前三天行走模拟数据 + DatabaseUtils.addSimulationData(rdbStore); + }).catch((error) => { + ... + }); + } + ``` + +## 消息通知 + +需要在MainPage的aboutToAppear调用requestNotification方法申请通知栏权限,效果如图所示: + +![](figures/NitificationWindow.png) + +```typescript +// MainPage.ets +aboutToAppear() { + // 申请通知栏权限 + this.requestNotification(); + ... +} + +requestNotification() { + Notification.requestEnableNotification().then(() => { + ... + }).catch((err) => { + ... + }); +} +``` + +通过aboutToAppear的setInterval方法开启定时器,当定时器到10秒后,通过DatabaseUtils.sendNotifications方法发送消息到通知栏。效果如图所示: + +![](figures/Notication.png) + +```typescript +// DatabaseUtils.ets +// 发送通知 +sendNotifications(stepsValue: string, notificationId: number) { + // 获取当前系统语言 + let Language: string = I18n.System.getSystemLanguage(); + let notificationBarTitle: string; + // 判断是否为中文 + if (Language.match(CommonConstants.CHINESE_LANGUAGE)) { + notificationBarTitle = CommonConstants.NOTIFICATIONS_TITLE_GONE_TODAY_ZH + + stepsValue + CommonConstants.NOTIFICATIONS_TITLE_STEPS_ZH; + } else { + notificationBarTitle = CommonConstants.NOTIFICATIONS_TITLE_GONE_TODAY_EN + + stepsValue + CommonConstants.NOTIFICATIONS_TITLE_STEPS_EN; + } + // 构造NotificationRequest对象. + let notificationRequest = { + id: notificationId, + content: { + contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: notificationBarTitle, + text: '' + } + } + }; + Notification.publish(notificationRequest).then(() => { + ... + }); +} +``` + +## 元服务卡片 + +使用元服务卡片分为四步:创建、初始化、更新、删除。 + +### 创建元服务卡片目录 + +1. 在main目录下,点击鼠标右键 > New > Service Widget。 + + ![](figures/CreateJSDirectory.png) + +2. 然后选择第一个选项下面带有Hello World字样,点击下一步Next。 + + ![](figures/SelectModule.png) + +3. 填写卡片名字(Service widget name)、卡片介绍(Description)、是否开启低代码开发(Enable Super Visual)、开发语言(ArkTS和JS)、支持卡片规格(Support dimension)、关联表单(Ability name)点击Finish完成创建。如需创建多个卡片目录重新按照步骤1执行。 + + ![](figures/EnterJSInfo.png) + +4. 创建完卡片后,同级目录出现js目录,然后开发者在js目录下使用hml+css+json开发js卡片页面。 + + ![](figures/JSDirectory.png) + + + +### 初始化元服务卡片 + +应用选择添加元服务卡片到桌面后,在EntryFormAbility的onAddForm方法进行卡片初始化操作,效果如图所示: + +![](figures/AddCard.png) + +```typescript +// EntryFormAbility.ets +onAddForm(want: Want) { + let formId: string = want.parameters[CommonConstants.FORM_PARAM_IDENTITY_KEY] as string; + let formName: string = want.parameters[CommonConstants.FORM_PARAM_NAME_KEY] as string; + let dimensionFlag: number = want.parameters[CommonConstants.FORM_PARAM_DIMENSION_KEY] as number; + // 创建数据库 + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + // 存储卡片信息 + let form: Form = new Form(); + form.formId = formId; + form.formName = formName; + form.dimension = dimensionFlag; + ... + DatabaseUtils.insertForm(form, rdbStore); + }).catch((error) => { + ... + }); + ... + // 初始化卡片数据 + let formData: FormData = new FormData(); + formData.percent = 0; + formData.steps = 0; + return FormBindingData.createFormBindingData(formData); +}; +``` + +### 更新元服务卡片 + +1. 初始化加载主页面布局之前,在MainPage的aboutToAppear方法中,调用setInterval方法开启定时器。时间到则先通过DatabaseUtils.insertValues方法把步数插入到数据库,再通过DatabaseUtils.updateForms方法更新卡片步数。 + ```typescript + // MainPage.ets + aboutToAppear() { + ... + DatabaseUtils.getSensorData(globalThis.rdbStore, DateUtils.getDate(0)) + .then((sensorData: SensorData) => { + if (sensorData != null) { + this.stepsValue = sensorData.stepsValue; + } + // 开启定时器 + this.intervalId = setInterval(() => { + ... + DatabaseUtils.insertValues(this.stepsValue, globalThis.rdbStore); + DatabaseUtils.updateForms(this.stepsValue,globalThis.rdbStore); + }, CommonConstants.INTERVAL_DELAY_TIME); + }); + } + + // DatabaseUtils.ets + updateForms(stepValue: number, rdbStore: DataRdb.RdbStore) { + let predicates: DataRdb.RdbPredicates = + new DataRdb.RdbPredicates(CommonConstants.TABLE_FORM); + // 查询卡片 + rdbStore.query(predicates).then((resultSet: DataRdb.ResultSet) => { + ... + // 查询第一行 + resultSet.goToFirstRow(); + do { + let formId: string = resultSet.getString(resultSet.getColumnIndex(CommonConstants.FIELD_FORM_ID)); + let dimension: number = resultSet.getLong(resultSet.getColumnIndex(CommonConstants.FIELD_DIMENSION)); + ChartDataUtils.getFormData(formId, stepValue, dimension, rdbStore) + .then((formData: FormData) => { + // 更新多张卡片 + FormProvider.updateForm(formData.formId, FormBindingData.createFormBindingData(formData)) + .catch((error) => { + ... + }); + }).catch((error) => { + ... + }); + } while (resultSet.goToNextRow()); + resultSet.close(); + }).catch((error) => { + ... + }); + } + ``` + +2. 卡片添加到桌面后,在EntryFormAbility的onAddForm方法中,调用formProvider.setFormNextRefreshTime方法设置倒计时。时间到了则通过updateSensorData方法更新卡片步数。 + ```typescript + // EntryFormAbility.ets + onAddForm(want: Want) { + ... + // 五分钟倒计时 + formProvider.setFormNextRefreshTime(formId, CommonConstants.FIVE_MINUTES, (error, data) => { + ... + }); + } + + onUpdateForm(formId: string) { + // 更新步数 + updateSensorData(); + ... + } + + function updateSensorData() { + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + ... + // 获取今天步数 + let getSensorData: Promise = DatabaseUtils.getSensorData(rdbStore, + DateUtils.getDate(0)); + getSensorData.then((sensorData: SensorData) => { + let stepValue: number = 0; + if (sensorData) { + stepValue = sensorData.stepsValue; + } + // 更新卡片数据 + DatabaseUtils.updateForms(stepValue, rdbStore); + }).catch((error) => { + ... + }); + }).catch((error) => { + ... + }); + } + ``` + +3. 通过src/main/resources/base/profile/form_config.json配置文件,根据updateDuration或者scheduledUpdateTime字段配置刷新时间。updateDuration优先级高于scheduledUpdateTime,两者同时配置时,以updateDuration配置的刷新时间为准。当配置的刷新时间到了,系统调用onUpdateForm方法进行更新。 + ```typescript + // form_config.json + { + // 卡片的类名 + "name": "card2x2", + // 卡片的描述 + "description": "This is a service widget.", + // 卡片对应完整路径 + "src": "./js/card2x2/pages/index/index", + // 定义与显示窗口相关的配置 + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + // 卡片的主题样式 + "colorMode": "auto", + // 是否为默认卡片 + "isDefault": true, + // 卡片是否支持周期性刷新 + "updateEnabled": true, + // 采用24小时制,精确到分钟 + "scheduledUpdateTime": "00:00", + // 当取值为0时,表示该参数不生效,当取值为正整数N时,表示刷新周期为30*N分钟。 + "updateDuration": 1, + // 卡片默认外观规格 + "defaultDimension": "2*2", + // 卡片支持外观规格 + "supportDimensions": [ + "2*2" + ] + } + + // EntryFormAbility.ets + onUpdateForm(formId: string) { + // 更新步数 + updateSensorData(); + ... + } + ``` + +### 删除元服务卡片 + +当用户需要删除元服务卡片时,可以在EntryFormAbility的onRemoveForm方法中,通过DatabaseUtils.deleteFormData方法删除数据库中对应的卡片信息。 +```typescript +// EntryFormAbility.ets +onRemoveForm(formId: string) { + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + ... + // 删除数据库中对应的卡片信息 + DatabaseUtils.deleteFormData(formId, rdbStore); + }).catch((error) => { + ... + }); +} + +// DatabaseUtils.ets +deleteFormData(formId: string, rdbStore: DataRdb.RdbStore) { + let predicates: DataRdb.RdbPredicates = new DataRdb.RdbPredicates(CommonConstants.TABLE_FORM); + predicates.equalTo(CommonConstants.FIELD_FORM_ID, formId); + rdbStore.delete(predicates).catch((error) => { + ... + }); +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用notification发布通知。 +2. 使用关系型数据库插入、更新、删除卡片数据。 +3. 使用FormExtensionAbility创建、更新、删除元服务卡片。 + +![](figures/Congratulations.gif) + diff --git a/Card/StepsCardJS/build-profile.json5 b/Card/StepsCardJS/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7e443c9990df03928f4c23604aba62b3b5323ec1 --- /dev/null +++ b/Card/StepsCardJS/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/build-profile.json5 b/Card/StepsCardJS/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/Card/StepsCardJS/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/hvigorfile.ts b/Card/StepsCardJS/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/Card/StepsCardJS/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/Card/StepsCardJS/entry/oh-package.json5 b/Card/StepsCardJS/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/Card/StepsCardJS/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Card/StepsCardJS/entry/src/main/ets/common/bean/ChartPoint.ets b/Card/StepsCardJS/entry/src/main/ets/common/bean/ChartPoint.ets new file mode 100644 index 0000000000000000000000000000000000000000..326c543ffea8ebcd937a366a7532d85dc92e3b67 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/bean/ChartPoint.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device 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 PointStyle from './PointStyle'; + +/** + * Chart point entity class. + */ +export default class ChartPoint { + /** + * Step value. + */ + value: number; + + /** + * Style of chart points. + */ + pointStyle: PointStyle; + + /** + * Description of icon points. + */ + description: string; + + /** + * Chart text position. + */ + textLocation: string; + + /** + * Chart text color. + */ + textColor: string; +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/bean/ChartValues.ets b/Card/StepsCardJS/entry/src/main/ets/common/bean/ChartValues.ets new file mode 100644 index 0000000000000000000000000000000000000000..7cd480b29eaabcbb8946fe642d8eeaccf696ac0c --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/bean/ChartValues.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Huawei Device 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 ChartPoint from './ChartPoint'; + +/** + * Chart value entity class. + */ +export default class ChartValues { + /** + * Chart fill color. + */ + fillColor: string; + + /** + * Chart line color. + */ + strokeColor: string; + + /** + * Sets whether to display the fill gradient color. + */ + gradient: boolean; + + /** + * Draw a set of points in a line type chart. + */ + data: Array; +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/bean/FormData.ets b/Card/StepsCardJS/entry/src/main/ets/common/bean/FormData.ets new file mode 100644 index 0000000000000000000000000000000000000000..136c47c71be875f156e6d513412e7e9c1d2f4ad8 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/bean/FormData.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device 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 ChartValues from '../bean/ChartValues'; + +/** + * Form data entity class. + */ +export default class FormData { + /** + * Form ID + */ + formId: string; + + /** + * Step percentage. + */ + percent: number; + + /** + * Form steps. + */ + steps: number; + + /** + * Chart data point collection. + */ + datasets: Array; + + /** + * Travel mileage. + */ + mileage: number; +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/bean/PointStyle.ets b/Card/StepsCardJS/entry/src/main/ets/common/bean/PointStyle.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f6c6b44e8645bd50a3b0c7549bc054e7d384346 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/bean/PointStyle.ets @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Chart point style entity class. + */ +export default class PointStyle { + /** + * The shape of the point. + */ + shape: string; + + /** + * Fill color. + */ + fillColor: string; + + /** + * Border color. + */ + strokeColor: string; + + /** + * Size of high bright spots. + */ + size: number; +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/constants/CommonConstants.ets b/Card/StepsCardJS/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4235f65a315a1c1cca7fb994d6869fcb599ce20 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2023 Huawei Device 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 relationalStore from '@ohos.data.relationalStore'; + +/** + * Common constants for all features. + */ +export default class CommonConstants { + /** + * The entry ability tag. + */ + static readonly ENTRY_ABILITY_TAG: string = 'EntryAbility'; + + /** + * The main page tag. + */ + static readonly MAIN_PAGE_TAG: string = 'MainPage'; + + /** + * The entry form ability tag. + */ + static readonly ENTRY_FORM_ABILITY_TAG: string = 'EntryFormAbility'; + + /** + * The database tag. + */ + static readonly DATABASE_TAG: string = 'DatabaseUtils'; + + /** + * The chart data tag. + */ + static readonly TAG_CHART: string = 'ChartDataUtils'; + + /** + * Database store configuration. + */ + static readonly RDB_STORE_CONFIG: relationalStore.StoreConfig = { + name: 'FormDatabase.db', securityLevel: relationalStore.SecurityLevel.S1, encrypt: false + }; + + /** + * SQL statement for creating a form. + */ + static readonly CREATE_TABLE_FORM: string = 'CREATE TABLE IF NOT EXISTS Form ' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, formId TEXT NOT NULL, formName TEXT NOT NULL, dimension INTEGER)'; + + /** + * SQL statement for creating steps. + */ + static readonly CREATE_TABLE_SENSOR_DATA: string = 'CREATE TABLE IF NOT EXISTS SensorData ' + + '(id INTEGER PRIMARY KEY AUTOINCREMENT, date TEXT NOT NULL, stepsValue INTEGER)'; + + /** + * Table sensor name. + */ + static readonly TABLE_SENSOR: string = 'SensorData'; + + /** + * Table form name. + */ + static readonly TABLE_FORM: string = 'Form'; + + /** + * Step count superimposed value. + */ + static readonly INTERVAL_STEPS_VALUE: number = 2; + + /** + * Time interval. + */ + static readonly INTERVAL_DELAY_TIME: number = 10000; + + /** + * The notification id is increased by 1. + */ + static readonly ID_VALUE: number = 1; + + /** + * Chinese field judgment. + */ + static readonly CHINESE_LANGUAGE: string = 'zh'; + + /** + * Title of the notification bar in Chinese. + */ + static readonly NOTIFICATIONS_TITLE_GONE_TODAY_ZH: string = '今天走了'; + + /** + * Title of the notification bar in English. + */ + static readonly NOTIFICATIONS_TITLE_GONE_TODAY_EN: string = 'Gone today '; + + /** + * Title of the notification bar in Chinese. + */ + static readonly NOTIFICATIONS_TITLE_STEPS_ZH: string = '步'; + + /** + * Title of the notification bar in English. + */ + static readonly NOTIFICATIONS_TITLE_STEPS_EN: string = ' steps'; + + /** + * Form ID field in the database table. + */ + static readonly FIELD_FORM_ID: string = 'formId'; + + /** + * Specification fields in the database table. + */ + static readonly FIELD_DIMENSION: string = 'dimension'; + + /** + * Time field in the database table. + */ + static readonly FIELD_DATE_NAME: string = 'date'; + + /** + * Steps value field in the database table. + */ + static readonly FIELD_STEPS_NAME: string = 'stepsValue'; + + /** + * Top margin of main page text. + */ + static readonly MAIN_TITLE_TEXT_MARGIN_TOP: number = 243; + + /** + * Bottom margin of main page text. + */ + static readonly MAIN_TITLE_TEXT_MARGIN_BOTTOM: number = 30; + + /** + * Main page title text size. + */ + static readonly MAIN_TITLE_TEXT_FONT_SIZE: number = 20; + + /** + * Main page content text size. + */ + static readonly MAIN_CONTENT_TEXT_FONT_SIZE: number = 60; + + /** + * ID parameter for creating a form. + */ + static readonly FORM_PARAM_IDENTITY_KEY: string = 'ohos.extra.param.key.form_identity'; + + /** + * Name parameter for creating a form. + */ + static readonly FORM_PARAM_NAME_KEY: string = 'ohos.extra.param.key.form_name'; + + /** + * Dimension parameter for creating a form. + */ + static readonly FORM_PARAM_DIMENSION_KEY: string = 'ohos.extra.param.key.form_dimension'; + + /** + * Refresh time, in seconds. + */ + static readonly FORM_NEXT_REFRESH_TIME: number = 5; + + /** + * Chart point text position. + */ + static readonly TEXT_LOCATION: string = 'top'; + + /** + * Chart point draw shape. + */ + static readonly SHAPE_CIRCLE: string = 'circle'; + + /** + * Fill white color. + */ + static readonly WHITE_COLOR: string = '#FFFFFF'; + + /** + * Fill line color. + */ + static readonly CHART_VALUES_STROKE_COLOR: string = '#40FFFFFF'; + + /** + * Chart point fill color. + */ + static readonly CHART_VALUES_FILL_COLOR: string = '#00000000'; + + /** + * Target steps. + */ + static readonly TARGET_STEPS: number = 1000; + + /** + * 2x2 Card steps progress. + */ + static readonly HUNDRED_PERCENT: number = 100; + + /** + * 2x4 Card dimension. + */ + static readonly DIMENSION_TWO_BY_FOUR: number = 3; + + /** + * Chart point size. + */ + static readonly POINT_SIZE: number = 5; + + /** + * Meter per step. + */ + static readonly METER_PER_STEP: number = 0.6; + + /** + * Obtain the data of the last three days. + */ + static readonly THE_FIRST_THREE_DAYS: number = 3; + + /** + * Number of milliseconds in a day. + */ + static readonly TODAY_MILLI_SECOND: number = 86400000; + + /** + * Add yesterday's simulation data. + */ + static readonly SIMULATION_YESTERDAY_VALUE: number = 800; + + /** + * Add the simulation data of the day before yesterday. + */ + static readonly SIMULATION_BEFORE_YESTERDAY_VALUE: number = 560; + + /** + * Add the simulation data of three days ago. + */ + static readonly SIMULATION_THREE_DAYS_AGO_VALUE: number = 990; + + /** + * Current month plus one. + */ + static readonly MONTH_PLUS_ONE: number = 1; + + /** + * Yesterday's value. + */ + static readonly YESTERDAY: number = 1; + + /** + * Value of the day before yesterday. + */ + static readonly BEFORE_YESTERDAY: number = 2; + + /** + * The value three days ago. + */ + static readonly THREE_DAYS_AGO: number = 3; + + /** + * Width the percentage of the 100. + */ + static readonly FULL_WIDTH: string = '100%'; + + /** + * Height the percentage of the 100. + */ + static readonly FULL_HEIGHT: string = '100%'; +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/database/Form.ets b/Card/StepsCardJS/entry/src/main/ets/common/database/Form.ets new file mode 100644 index 0000000000000000000000000000000000000000..f970899a0ff9cacfa46694d71bf39d2c6f2b386d --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/database/Form.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Database form entity class. + */ +export default class Form { + /** + * Form ID. + */ + formId: string; + + /** + * Form name. + */ + formName: string; + + /** + * Card dimension. + */ + dimension: number; + + /** + * Get inserted form data. + * + * @return Return form data. + */ + toValuesBucket() { + return { + 'formId': this.formId, + 'formName': this.formName, + 'dimension': this.dimension + }; + } +} diff --git a/Card/StepsCardJS/entry/src/main/ets/common/database/SensorData.ets b/Card/StepsCardJS/entry/src/main/ets/common/database/SensorData.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9d97b124908cba68fe5120d1b46066a4cab0d5a --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/database/SensorData.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Database sensor steps entity class. + */ +export default class SensorData { + /** + * Time of walking steps. + */ + date: string; + + /** + * Value of steps. + */ + stepsValue: number; + + /** + * Gets the number of steps to insert a form. + * + * @return Return steps. + */ + toValuesBucket() { + return { + 'date': this.date, + 'stepsValue': this.stepsValue + }; + } +} diff --git a/Card/StepsCardJS/entry/src/main/ets/common/utils/ChartDataUtils.ets b/Card/StepsCardJS/entry/src/main/ets/common/utils/ChartDataUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..489d104a09ba9c0bf6fc4ca828910aedecd7c4ba --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/utils/ChartDataUtils.ets @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2023 Huawei Device 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 DataRdb from '@ohos.data.relationalStore'; +import ChartValues from '../bean/ChartValues'; +import ChartPoint from '../bean/ChartPoint'; +import PointStyle from '../bean/PointStyle'; +import DatabaseUtils from './DatabaseUtils'; +import CommonConstants from '../constants/CommonConstants'; +import FormData from '../bean/FormData'; +import Logger from '../utils/Logger'; + +/** + * Chart data operation tool class. + */ +export class ChartDataUtils { + /** + * Get chart points. + * + * @param {DataRdb.RdbStore} rdbStore RDB database. + * @return Return the steps value of the last three days. + */ + async getChartPoints(rdbStore: DataRdb.RdbStore) { + let chartPoints = await DatabaseUtils.getLastThreeDaysValue(rdbStore).catch((error) => { + Logger.error(CommonConstants.TAG_CHART, 'getLastThreeDaysValue error ' + JSON.stringify(error)); + }); + return chartPoints; + } + + /** + * Get chart values. + * + * @param {number} stepsValue Value of steps. + * @param {DataRdb.RdbStore} rdbStore RDB database. + * @return {ChartValues} chartValues. + */ + async getChartValues(stepsValue: number, rdbStore: DataRdb.RdbStore) { + let chartValues: ChartValues = new ChartValues(); + // Set fill color. + chartValues.fillColor = CommonConstants.CHART_VALUES_FILL_COLOR; + // Set the color of the line. + chartValues.strokeColor = CommonConstants.CHART_VALUES_STROKE_COLOR; + chartValues.gradient = true; + // Gets a collection of points from the previous three days. + let chartPoints: Array; + await this.getChartPoints(rdbStore).then((pointArray: Array) => { + chartPoints = pointArray; + }).catch((error) => { + Logger.error(CommonConstants.TAG_CHART, 'getChartPoints error ' + JSON.stringify(error)); + }); + let nowChartPoint: ChartPoint = this.getChartPoint(stepsValue); + // Join today's steps value. + chartPoints.push(nowChartPoint); + chartValues.data = chartPoints; + return chartValues; + } + + /** + * Get chart point. + * + * @param {number} stepsValue Value of steps. + * @return {ChartPoint} chartPoint. + */ + getChartPoint(stepsValue: number) { + let chartPoint: ChartPoint = new ChartPoint(); + // Value of a chart point. if the value exceeds 1000, only 1000 is displayed. + chartPoint.value = Math.min(CommonConstants.TARGET_STEPS, stepsValue); + chartPoint.description = stepsValue.toString(); + // Display position of the chart point. set this parameter to above. + chartPoint.textLocation = CommonConstants.TEXT_LOCATION; + // Sets the color of the description font. + chartPoint.textColor = CommonConstants.WHITE_COLOR; + let pointStyle: PointStyle = new PointStyle(); + pointStyle.size = CommonConstants.POINT_SIZE; + pointStyle.fillColor = CommonConstants.WHITE_COLOR; + pointStyle.strokeColor = CommonConstants.WHITE_COLOR; + pointStyle.shape = CommonConstants.SHAPE_CIRCLE; + chartPoint.pointStyle = pointStyle; + return chartPoint; + } + + /** + * Get form data. + * + * @param {number} stepValue Value of steps. + * @param {number} dimension Card Specifications. + * @param {DataRdb.RdbStore} rdbStore RDB database. + * @return {FormData} formData. + */ + async getFormData(formId: string, stepValue: number, dimension: number, rdbStore: DataRdb.RdbStore) { + let round: number; + if (stepValue >= CommonConstants.TARGET_STEPS) { + round = CommonConstants.HUNDRED_PERCENT; + } else { + round = Math.round(stepValue / CommonConstants.TARGET_STEPS * CommonConstants.HUNDRED_PERCENT); + } + let formData: FormData = new FormData(); + formData.percent = round; + formData.steps = stepValue; + formData.formId = formId; + // Check whether the card type is 2x4. + if (dimension === CommonConstants.DIMENSION_TWO_BY_FOUR) { + let dataSets: Array = new Array(); + // Get chart point set data. + await this.getChartValues(stepValue, rdbStore).then((result) => { + dataSets.push(result); + }).catch((error) => { + Logger.error(CommonConstants.TAG_CHART, 'getFormData chartValues error ' + JSON.stringify(error)); + }); + // Add Field. + formData.datasets = dataSets; + formData.mileage = Math.round(stepValue * CommonConstants.METER_PER_STEP); + } + return formData; + } +} + +export default new ChartDataUtils(); \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/utils/DatabaseUtils.ets b/Card/StepsCardJS/entry/src/main/ets/common/utils/DatabaseUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..77f16950eaa97c391a1152e35e4848474668d9a6 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/utils/DatabaseUtils.ets @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2023 Huawei Device 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 I18n from '@ohos.i18n'; +import DataRdb from '@ohos.data.relationalStore'; +import Notification from '@ohos.notificationManager'; +import FormProvider from '@ohos.app.form.formProvider'; +import FormBindingData from '@ohos.app.form.formBindingData'; +import Form from '../database/Form'; +import SensorData from '../database/SensorData'; +import DateUtils from './DateUtils'; +import ChartPoint from '../bean/ChartPoint'; +import ChartDataUtils from '../utils/ChartDataUtils'; +import CommonConstants from '../constants/CommonConstants'; +import FormData from '../bean/FormData'; +import Logger from '../utils/Logger'; + +/** + * Database operation tool class. + */ +export class DatabaseUtils { + /** + * Create rdb store + * + * @param {context} Context + * @return {globalThis.rdbStore} return rdbStore RDB database + */ + async createRdbStore(context: Context) { + if (!globalThis.rdbStore) { + await DataRdb.getRdbStore(context, CommonConstants.RDB_STORE_CONFIG) + .then((rdbStore: DataRdb.RdbStore) => { + if (rdbStore) { + rdbStore.executeSql(CommonConstants.CREATE_TABLE_FORM).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'executeSql Form error ' + JSON.stringify(error)); + }); + rdbStore.executeSql(CommonConstants.CREATE_TABLE_SENSOR_DATA).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'executeSql Sensor error ' + JSON.stringify(error)); + }); + globalThis.rdbStore = rdbStore; + } + }).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'createRdbStore error ' + JSON.stringify(error)); + }); + } + return globalThis.rdbStore; + } + + /** + * Insert form data. + * + * @param {Form} form Form entity. + * @param {DataRdb.RdbStore} rdbStore RDB database. + * @return Return the operation information. + */ + insertForm(form: Form, rdbStore: DataRdb.RdbStore) { + rdbStore.insert(CommonConstants.TABLE_FORM, form.toValuesBucket()).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'insertForm error ' + JSON.stringify(error)); + }); + } + + /** + * Insert steps to database. + * + * @param {number} stepsValue Value of steps. + * @param {DataRdb.RdbStore} rdbStore RDB database. + */ + async insertValues(stepsValue: number, rdbStore: DataRdb.RdbStore) { + let now: string = DateUtils.getDate(0); + let sensorData: SensorData = new SensorData(); + sensorData.date = now; + sensorData.stepsValue = stepsValue; + // Check whether there is data today. + let todayData: SensorData = await this.getSensorData(rdbStore, now); + if (todayData === undefined) { + rdbStore.insert(CommonConstants.TABLE_SENSOR, sensorData.toValuesBucket()); + } else { + todayData.stepsValue = sensorData.stepsValue; + let predicates: DataRdb.RdbPredicates = new DataRdb.RdbPredicates(CommonConstants.TABLE_SENSOR); + predicates.equalTo(CommonConstants.FIELD_DATE_NAME, now); + rdbStore.update(todayData.toValuesBucket(), predicates).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'insertValues update error ' + JSON.stringify(error)); + }); + } + } + + /** + * Update card. + * + * @param {number} stepValue Number of steps to be updated. + * @param {DataRdb.RdbStore} rdbStore RDB database. + */ + updateForms(stepValue: number, rdbStore: DataRdb.RdbStore) { + let predicates: DataRdb.RdbPredicates = new DataRdb.RdbPredicates(CommonConstants.TABLE_FORM); + rdbStore.query(predicates).then((resultSet: DataRdb.ResultSet) => { + if (resultSet.rowCount <= 0) { + Logger.error(CommonConstants.DATABASE_TAG, 'updateForms rowCount <= 0'); + return; + } + // Query the first line. + resultSet.goToFirstRow(); + do { + let formId: string = resultSet.getString(resultSet.getColumnIndex(CommonConstants.FIELD_FORM_ID)); + let dimension: number = resultSet.getLong(resultSet.getColumnIndex(CommonConstants.FIELD_DIMENSION)); + ChartDataUtils.getFormData(formId, stepValue, dimension, rdbStore).then((formData: FormData) => { + // Update multiple cards. + FormProvider.updateForm(formData.formId, FormBindingData.createFormBindingData(formData)) + .catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'updateForm error ' + JSON.stringify(error)); + }); + }).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'updateForms getFormData error ' + JSON.stringify(error)); + }); + } while (resultSet.goToNextRow()); + resultSet.close(); + }).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'updateForms query error ' + JSON.stringify(error)); + }); + } + + /** + * Get sensor data. + * + * @param {DataRdb.RdbStore} rdbStore RDB database. + * @param {string} date Step time. + */ + async getSensorData(rdbStore: DataRdb.RdbStore, date: string) { + let formPredicates: DataRdb.RdbPredicates = new DataRdb.RdbPredicates(CommonConstants.TABLE_SENSOR); + formPredicates.equalTo(CommonConstants.FIELD_DATE_NAME, date); + let sensorData: SensorData; + await rdbStore.query(formPredicates).then((resultSet: DataRdb.ResultSet) => { + if (resultSet.rowCount <= 0) { + Logger.error(CommonConstants.DATABASE_TAG, 'getSensorData rowCount <=0'); + return; + } + resultSet.goToFirstRow(); + let date: string = resultSet.getString(resultSet.getColumnIndex(CommonConstants.FIELD_DATE_NAME)); + let stepsValue: number = resultSet.getLong(resultSet.getColumnIndex(CommonConstants.FIELD_STEPS_NAME)); + resultSet.close(); + sensorData = new SensorData(); + sensorData.date = date; + sensorData.stepsValue = stepsValue; + }).catch((err) => { + Logger.error(CommonConstants.DATABASE_TAG, 'Get Sensor Data, err: ' + JSON.stringify(err)); + }); + return sensorData; + } + + /** + * Delete form data. + * + * @param {string} formId Form ID. + * @param {DataRdb.RdbStore} rdbStore RDB database. + */ + deleteFormData(formId: string, rdbStore: DataRdb.RdbStore) { + let predicates: DataRdb.RdbPredicates = new DataRdb.RdbPredicates(CommonConstants.TABLE_FORM); + predicates.equalTo(CommonConstants.FIELD_FORM_ID, formId); + rdbStore.delete(predicates).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'deleteFormData delete error ' + JSON.stringify(error)); + }); + } + + /** + * Get the steps value of the last three days. + * + * @param {Array} results. + */ + async getLastThreeDaysValue(rdbStore: DataRdb.RdbStore) { + let results: Array = new Array(); + let index = CommonConstants.THE_FIRST_THREE_DAYS; + while (index > 0) { + let predicates: DataRdb.RdbPredicates = new DataRdb.RdbPredicates(CommonConstants.TABLE_SENSOR); + predicates.equalTo(CommonConstants.FIELD_DATE_NAME, DateUtils.getDate(index)); + await rdbStore.query(predicates).then((resultSet: DataRdb.ResultSet) => { + resultSet.goToFirstRow(); + if (resultSet.rowCount === 0) { + results.push(ChartDataUtils.getChartPoint(0)); + } else { + let stepsValue: number = resultSet.getLong(resultSet.getColumnIndex(CommonConstants.FIELD_STEPS_NAME)); + results.push(ChartDataUtils.getChartPoint(stepsValue)); + } + resultSet.close(); + }).catch((err) => { + Logger.error(CommonConstants.DATABASE_TAG, 'getLastThreeDaysValue err: ' + JSON.stringify(err)); + }); + index--; + } + return results; + } + + /** + * Send Notifications + * + * @param {string} stepsValue Steps displayed. + * @param {number} notificationId Notification id. + */ + async sendNotifications(stepsValue: string, notificationId: number) { + let notificationBarTitle: string; + let Language: string = I18n.System.getSystemLanguage(); + if (Language.match(CommonConstants.CHINESE_LANGUAGE)) { + notificationBarTitle = CommonConstants.NOTIFICATIONS_TITLE_GONE_TODAY_ZH + + stepsValue + CommonConstants.NOTIFICATIONS_TITLE_STEPS_ZH; + } else { + notificationBarTitle = CommonConstants.NOTIFICATIONS_TITLE_GONE_TODAY_EN + + stepsValue + CommonConstants.NOTIFICATIONS_TITLE_STEPS_EN; + } + // Construct the notificationRequest object. + let notificationRequest = { + id: notificationId, + content: { + contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: notificationBarTitle, + text: '' + } + } + }; + Notification.publish(notificationRequest).then(() => { + if (notificationId > CommonConstants.ID_VALUE) { + // Cancel a sent message + Notification.cancel(notificationId - CommonConstants.ID_VALUE); + } + }).catch((err) => { + Logger.error(CommonConstants.DATABASE_TAG, 'publish promise failed because ' + JSON.stringify(err)); + }); + } + + /** + * Add simulation data. + * + * @param {DataRdb.RdbStore} rdbStore RDB database. + */ + addSimulationData(rdbStore: DataRdb.RdbStore) { + if (!rdbStore) { + Logger.error(CommonConstants.DATABASE_TAG, 'addSimulationData rdbStore is undefined'); + return; + } + // Add the simulation data of yesterday. + let yesterday: SensorData = new SensorData(); + yesterday.date = DateUtils.getDate(CommonConstants.YESTERDAY); + yesterday.stepsValue = CommonConstants.SIMULATION_YESTERDAY_VALUE; + rdbStore.insert(CommonConstants.TABLE_SENSOR, yesterday.toValuesBucket()).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'yesterday insert error ' + JSON.stringify(error)); + }); + // Add the simulation data of the day before yesterday. + let beforeYesterday: SensorData = new SensorData(); + beforeYesterday.date = DateUtils.getDate(CommonConstants.BEFORE_YESTERDAY) + beforeYesterday.stepsValue = CommonConstants.SIMULATION_BEFORE_YESTERDAY_VALUE; + rdbStore.insert(CommonConstants.TABLE_SENSOR, beforeYesterday.toValuesBucket()).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'beforeYesterday insert error ' + JSON.stringify(error)); + }); + // Add the simulation data of three days ago. + let threeDaysAgo: SensorData = new SensorData(); + threeDaysAgo.date = DateUtils.getDate(CommonConstants.THREE_DAYS_AGO); + threeDaysAgo.stepsValue = CommonConstants.SIMULATION_THREE_DAYS_AGO_VALUE; + rdbStore.insert(CommonConstants.TABLE_SENSOR, threeDaysAgo.toValuesBucket()).catch((error) => { + Logger.error(CommonConstants.DATABASE_TAG, 'threeDaysAgo insert error ' + JSON.stringify(error)); + }); + } +} + +export default new DatabaseUtils(); \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/utils/DateUtils.ets b/Card/StepsCardJS/entry/src/main/ets/common/utils/DateUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..5973cf20f0e061adac6e24489a830d1c723e0ee0 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/utils/DateUtils.ets @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../constants/CommonConstants'; + +/** + * Time operation tool class. + */ +export class DateUtils { + /** + * Obtaining time. + * + * @param {number} days Days. + * @return Return the specific year, month, day, and time. + */ + getDate(days: number) { + let date: Date = new Date(new Date().getTime() - days * CommonConstants.TODAY_MILLI_SECOND); + let year: number = date.getFullYear(); + let month: number = date.getMonth() + CommonConstants.MONTH_PLUS_ONE; + let day: number = date.getDate(); + return '' + year + month + day; + } +} + +export default new DateUtils(); \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/common/utils/Logger.ets b/Card/StepsCardJS/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c03497a7ce71b3966d1ba60a676e8ff3d551d8e --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('StepsCard', 0xFF00) \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/entryability/EntryAbility.ets b/Card/StepsCardJS/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a9103074df9230e015784a44c59692a1ab2c5aa --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import Want from '@ohos.app.ability.Want'; +import DataRdb from '@ohos.data.relationalStore'; +import window from '@ohos.window'; +import Logger from '../common/utils/Logger'; +import CommonConstants from '../common/constants/CommonConstants'; +import DatabaseUtils from '../common/utils/DatabaseUtils'; + +/** + * Lift cycle management of Ability. + */ +export default class EntryAbility extends UIAbility { + onCreate(want: Want, param: AbilityConstant.LaunchParam) { + globalThis.abilityWant = want; + globalThis.abilityParam = param; + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + DatabaseUtils.addSimulationData(rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_ABILITY_TAG, 'onCreate rdb error ' + JSON.stringify(error)); + }); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + Logger.info(CommonConstants.ENTRY_ABILITY_TAG, 'onWindowStageCreate'); + windowStage.loadContent('pages/MainPage', (err, data) => { + if (err.code) { + Logger.error(CommonConstants.ENTRY_ABILITY_TAG, 'Failed to load the content. Cause:' + JSON.stringify(err)); + return; + } + Logger.info(CommonConstants.ENTRY_ABILITY_TAG, 'Succeeded in loading the content. Data: ' + JSON.stringify(data)); + }); + } +}; \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/ets/entryformability/EntryFormAbility.ets b/Card/StepsCardJS/entry/src/main/ets/entryformability/EntryFormAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..884683a8da46eafeda5795f8991c48187629c546 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/entryformability/EntryFormAbility.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2023 Huawei Device 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 FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; +import FormBindingData from '@ohos.app.form.formBindingData'; +import FormProvider from '@ohos.app.form.formProvider'; +import Want from '@ohos.app.ability.Want'; +import DataRdb from '@ohos.data.relationalStore'; +import Logger from '../common/utils/Logger'; +import Form from '../common/database/Form'; +import DatabaseUtils from '../common/utils/DatabaseUtils'; +import DateUtils from '../common/utils/DateUtils'; +import ChartDataUtils from '../common/utils/ChartDataUtils'; +import SensorData from '../common/database/SensorData'; +import CommonConstants from '../common/constants/CommonConstants'; +import FormData from '../common/bean/FormData'; + +/** + * Form management of Ability. + */ +export default class EntryFormAbility extends FormExtensionAbility { + onAddForm(want: Want) { + let formId: string = want.parameters[CommonConstants.FORM_PARAM_IDENTITY_KEY] as string; + let formName: string = want.parameters[CommonConstants.FORM_PARAM_NAME_KEY] as string; + let dimensionFlag: number = want.parameters[CommonConstants.FORM_PARAM_DIMENSION_KEY] as number; + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + // Stores card information. + let form: Form = new Form(); + form.formId = formId; + form.formName = formName; + form.dimension = dimensionFlag; + DatabaseUtils.addSimulationData(rdbStore); + DatabaseUtils.insertForm(form, rdbStore); + getToDaySteps(rdbStore, dimensionFlag, formId); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'onAddForm rdb error ' + JSON.stringify(error)); + }); + // Refresh every five minutes. + FormProvider.setFormNextRefreshTime(formId, CommonConstants.FORM_NEXT_REFRESH_TIME, (error, data) => { + if (error) { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'refreshTime, error:' + JSON.stringify(error)); + } else { + Logger.info(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'refreshTime success ' + JSON.stringify(data)); + } + }); + let formData: FormData = new FormData(); + formData.percent = 0; + formData.steps = 0; + return FormBindingData.createFormBindingData(formData); + } + + onUpdateForm(formId: string) { + updateSensorData(); + // Refresh every five minutes. + FormProvider.setFormNextRefreshTime(formId, CommonConstants.FORM_NEXT_REFRESH_TIME, (error, data) => { + if (error) { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'onUpdate refreshTime error:' + JSON.stringify(error)); + } else { + Logger.info(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'onUpdate refreshTime success ' + JSON.stringify(data)); + } + }); + } + + onRemoveForm(formId: string) { + // Deleting card information from the database. + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + if (!rdbStore) { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'update sensor data rdbStore is null'); + return; + } + DatabaseUtils.deleteFormData(formId, rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'onRemoveForm rdb error ' + JSON.stringify(error)); + }); + } +}; + +/** + * Get today's steps. + * + * @param {DataRdb.RdbStore} rdbStore RDB database. + * @param {number} dimensionFlag Card Specifications. + * @param {string} formId Form ID. + */ +function getToDaySteps(rdbStore: DataRdb.RdbStore, dimensionFlag: number, formId: string) { + let getSensorData: Promise = DatabaseUtils.getSensorData(rdbStore, DateUtils.getDate(0)); + getSensorData.then((sensorData: SensorData) => { + let stepValue: number = 0; + if (sensorData) { + stepValue = sensorData.stepsValue; + } + getFormData(formId, stepValue, dimensionFlag, rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'getToDaySteps error ' + JSON.stringify(error)); + }); +} + +/** + * Update Steps. + */ +function updateSensorData() { + // Get today's steps. + DatabaseUtils.createRdbStore(this.context).then((rdbStore: DataRdb.RdbStore) => { + if (!rdbStore) { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'update sensor data rdbStore is null'); + return; + } + let getSensorData: Promise = DatabaseUtils.getSensorData(rdbStore, DateUtils.getDate(0)); + getSensorData.then((sensorData: SensorData) => { + let stepValue: number = 0; + if (sensorData) { + stepValue = sensorData.stepsValue; + } + DatabaseUtils.updateForms(stepValue, rdbStore); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'updateSensor getSensorData err ' + JSON.stringify(error)); + }); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'updateSensor rdb err ' + JSON.stringify(error)); + }); +} + +/** + * Get form and update data. + * + * @param {formId} formId Form ID. + * @param {number} stepValue Value of steps. + * @param {number} dimensionFlag Card Specifications. + * @param {DataRdb.RdbStore} rdbStore rdbStore RDB database. + */ +function getFormData(formId: string, stepValue: number, dimensionFlag: number, rdbStore: DataRdb.RdbStore) { + ChartDataUtils.getFormData(formId, stepValue, dimensionFlag, rdbStore) + .then((formData: FormData) => { + FormProvider.updateForm(formData.formId, FormBindingData.createFormBindingData(formData)); + }).catch((error) => { + Logger.error(CommonConstants.ENTRY_FORM_ABILITY_TAG, 'getFormData formData error ' + JSON.stringify(error)); + }); +} + diff --git a/Card/StepsCardJS/entry/src/main/ets/pages/MainPage.ets b/Card/StepsCardJS/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8cf64d78fc18436203a3731b2cc9cbf37af7b80 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Notification from '@ohos.notificationManager'; +import DatabaseUtils from '../common/utils/DatabaseUtils'; +import DateUtils from '../common/utils/DateUtils'; +import Logger from "../common/utils/Logger" +import SensorData from '../common/database/SensorData'; +import CommonConstants from '../common/constants/CommonConstants'; + +/** + * The MainPage is the entry point of the application and shows how to develop the MainPage. + * Steps are added every 10 seconds on the main page. + * Messages are displayed on the notification bar. Card data can be updated normally. + * Developers can modify the interval and self-open notification bar messages. + */ +@Entry +@Component +struct MainPage { + @State stepsValue: number = 0; + private intervalId: number = 0; + private notificationId: number = 0; + private iconStepsBackground: Resource = $r('app.media.icon_steps_background'); + + aboutToAppear() { + this.requestNotification(); + DatabaseUtils.getSensorData(globalThis.rdbStore, DateUtils.getDate(0)) + .then((sensorData: SensorData) => { + if (sensorData) { + this.stepsValue = sensorData.stepsValue; + } + // Start the timer. + this.intervalId = setInterval(() => { + this.notificationId += CommonConstants.ID_VALUE; + this.stepsValue += CommonConstants.INTERVAL_STEPS_VALUE; + DatabaseUtils.insertValues(this.stepsValue, globalThis.rdbStore); + DatabaseUtils.updateForms(this.stepsValue, globalThis.rdbStore); + DatabaseUtils.sendNotifications(this.stepsValue.toString(), this.notificationId); + }, CommonConstants.INTERVAL_DELAY_TIME); + }).catch((error) => { + Logger.error(CommonConstants.MAIN_PAGE_TAG, 'getSensorData error ' + JSON.stringify(error)); + }); + } + + aboutToDisappear() { + clearInterval(this.intervalId); + // Cancel message all notifications. + Notification.cancelAll((data) => { + Logger.info(CommonConstants.MAIN_PAGE_TAG, 'cancelAll data ' + JSON.stringify(data)); + }); + } + + // Request notification bar permissions. + requestNotification() { + Notification.requestEnableNotification().then(() => { + Logger.info(CommonConstants.MAIN_PAGE_TAG, 'requestEnableNotification success'); + }).catch((err) => { + Logger.error(CommonConstants.MAIN_PAGE_TAG, 'requestEnableNotification failed : ' + JSON.stringify(err)); + }); + } + + build() { + Stack() { + Image(this.iconStepsBackground) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + .objectFit(ImageFit.Cover) + + Column() { + Text($r('app.string.main_text_title')) + .progressTextStyle(CommonConstants.MAIN_TITLE_TEXT_FONT_SIZE, FontWeight.Medium) + .margin({ + top: CommonConstants.MAIN_TITLE_TEXT_MARGIN_TOP, + bottom: CommonConstants.MAIN_TITLE_TEXT_MARGIN_BOTTOM + }) + + Row() { + Text(this.stepsValue.toString()) + .progressTextStyle(CommonConstants.MAIN_CONTENT_TEXT_FONT_SIZE, FontWeight.Bold) + + Text($r('app.string.steps')) + .progressTextStyle(CommonConstants.MAIN_TITLE_TEXT_FONT_SIZE, FontWeight.Medium) + } + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } + } +} + +// Steps text common style. +@Extend(Text) function progressTextStyle(styleFontSize: number, styleFontWeight: number) { + .fontColor(Color.White) + .fontSize(styleFontSize) + .fontWeight(styleFontWeight) +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.css b/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..d3a878666d6906ab4736c6555dac190e24706f9d --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.css @@ -0,0 +1,67 @@ +.card_root_layout { + width: 100%; + height: 100%; + position: relative; +} + +.div_basic_container { + position: absolute; + top: 0px; + left: 0px; + flex-direction: row; + width: 100%; + height: 100%; +} + +.div_image_container { + background-repeat: no-repeat; + position: absolute; + flex-direction: row; + width: 100%; + height: 100%; +} + +.div_steps_container { + align-items: center; + flex-direction: column; + align-content: center; + justify-content: center; + position: absolute; + margin: 10%; +} + +.div_progress { + color: #FFFFFF; + background-color: #40FFFFFF; + stroke-width: 12.36px; + z-index: 0; + margin: 10%; + position: absolute; +} + +.title_container { + align-items: center; + flex-direction: column; + align-content: center; + justify-content: center; + width: 100%; + height: 100%; + z-index: 1; + position: absolute; +} + +.item_title { + font-weight: 400; + color: #FFFFFF; + font-size: 26.49px; +} + +.item_content { + color: #FFFFFF; + opacity: 0.9; + font-size: 10.47px; + margin-top: 2px; + font-weight: 700; + +} + diff --git a/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.hml b/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..3f1180be09ea7b4a66c2eb85727dd1560e380fa0 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.hml @@ -0,0 +1,18 @@ +
+
+
+ +
+
+ +
+ {{ $t('strings.number_of_steps') }} + + {{ steps }} + + {{ $t('strings.step') }} + +
+
+
+
\ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.json b/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..252bcc26f710407a5c496d336d6952840a57e2ef --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/card2x2/pages/index/index.json @@ -0,0 +1,13 @@ +{ + "data": { + "percent": 0, + "steps": 0, + "isShow": true + }, + "actions": { + "routerEvent": { + "action": "router", + "abilityName": "EntryAbility" + } + } +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.css b/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..30111d9fb703dda5cf6ac1f7b151c2813198a2fe --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.css @@ -0,0 +1,114 @@ +.card_root_layout { + width: 100%; + height: 100%; + position: relative; +} + +.div_basic_container { + background-repeat: no-repeat; + position: absolute; + top: 0px; + left: 0px; + flex-direction: row; + width: 100%; + height: 100%; +} + +.div_image_container { + position: absolute; + width: 100%; + height: 100%; +} + +.left_items { + height: 100%; + width: 50%; + align-content: flex-start; + flex-direction: column; + top: 24px; + left: 20px; +} + +.left_items_top { + width: 100%; + flex-direction: row; + align-content: flex-start; +} + +.left_items_center { + width: 100%; + top: 8px; + align-items: flex-end; + position: relative; +} + +.right_items { + width: 45%; + height: 50%; + left: 4.3%; + top: 60%; + align-items: flex-end; +} + +#Chart { + font-size: 10px; + color: #FFFFFF; +} + +.chartArea { + bottom: 15px; +} + +.text { + font-size: 16px; + opacity: 0.9; + font-weight: 400; + color: #FFFFFF; +} + +.steps_data_text { + font-size: 40px; + color: #FFFFFF; + font-weight: 700; +} + +.steps_text { + opacity: 0.9; + color: #FFFFFF; + bottom: 8px; + font-size: 16px; + font-weight: 400; +} + +.progress { + width: 100%; + height: 40%; + flex-direction: row; + margin-top: 18px; + align-content: flex-start; +} + +.progress_text { + color: #FFFFFF; + font-size: 16px; + font-weight: 400; +} + +.progressDiv { + width: 132px; + top: 10px; + bottom: 0; +} + +#Progress { + stroke-width: 6px; + background-color: #40FFFFFF; + align-content: flex-end; + position: absolute; + color: #FFFFFF; +} + +.progressText { + flex-direction: row; + top: 5px; +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.hml b/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..e3197767edade808dc244aec90b7c0b2bf00a03a --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.hml @@ -0,0 +1,41 @@ +
+
+
+ + + +
+
+
+ {{ $t('strings.today') }} + {{ mileage }} + {{ $t('strings.unit') }} +
+ + +
+ {{ steps }} + {{ $t('strings.step') }} +
+ + +
+ {{ percent }} + % +
+ + +
+ +
+ +
+
+ + +
+ +
+
+
+
\ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.json b/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.json new file mode 100644 index 0000000000000000000000000000000000000000..c5ad7df0610da5d44d7526e16249934fee7360eb --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/card2x4/pages/index/index.json @@ -0,0 +1,88 @@ +{ + "data": { + "datasets": [ + { + "strokeColor": "#40FFFFFF", + "fillColor": "#00000000", + "data": [ + { + "value": 0, + "description": "0", + "textLocation": "top", + "textColor": "#FFFFFF", + "pointStyle": { + "shape": "circle", + "size": 6, + "fillColor": "#FFFFFF", + "strokeColor": "#FFFFFF" + } + }, + { + "value": 0, + "description": "0", + "textLocation": "top", + "textColor": "#FFFFFF", + "pointStyle": { + "shape": "circle", + "size": 6, + "fillColor": "#FFFFFF", + "strokeColor": "#FFFFFF" + } + }, + { + "value": 0, + "description": "0", + "textLocation": "top", + "textColor": "#FFFFFF", + "pointStyle": { + "shape": "circle", + "size": 6, + "fillColor": "#FFFFFF", + "strokeColor": "#FFFFFF" + } + }, + { + "value": 0, + "description": "0", + "textLocation": "top", + "textColor": "#FFFFFF", + "pointStyle": { + "shape": "circle", + "size": 6, + "fillColor": "#FFFFFF", + "strokeColor": "#FFFFFF" + } + } + ], + "gradient": true + } + ], + "options": { + "xAxis": { + "min": 0, + "max": 3, + "display": false, + "axisTick": 4 + }, + "yAxis": { + "min": 0, + "max": 1000 + }, + "series": { + "lineStyle": { + "width": "4px" + } + } + }, + "steps": 0, + "percent": 0, + "mileage": 0 + }, + "actions": { + "routerEvent": { + "action": "router", + "abilityName": "EntryAbility" + } + } +} + diff --git a/Card/StepsCardJS/entry/src/main/js/common/icon_2x2_card_background.png b/Card/StepsCardJS/entry/src/main/js/common/icon_2x2_card_background.png new file mode 100644 index 0000000000000000000000000000000000000000..896a7c1a35aacedfba378d74b30589e69c4f17b1 Binary files /dev/null and b/Card/StepsCardJS/entry/src/main/js/common/icon_2x2_card_background.png differ diff --git a/Card/StepsCardJS/entry/src/main/js/common/icon_2x4_card_background.png b/Card/StepsCardJS/entry/src/main/js/common/icon_2x4_card_background.png new file mode 100644 index 0000000000000000000000000000000000000000..0fcaf4865c71e8077f558323294de25e09f75226 Binary files /dev/null and b/Card/StepsCardJS/entry/src/main/js/common/icon_2x4_card_background.png differ diff --git a/Card/StepsCardJS/entry/src/main/js/i18n/en-US.json b/Card/StepsCardJS/entry/src/main/js/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..b58717dc7ccf032e0a9654a8ed2e1b473c3f0013 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "today": "Today ", + "unit": " m", + "step": " steps", + "number_of_steps": "number of steps" + } +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/js/i18n/zh-CN.json b/Card/StepsCardJS/entry/src/main/js/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..47cf082f42e39236e4a4ad92ec261070ebd11b8d --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/js/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "today": "今天走了 ", + "unit": " 米", + "step": " 步", + "number_of_steps": "步数" + } +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/module.json5 b/Card/StepsCardJS/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1d67526095cfc9d41ddf635060dfaeedaba25d05 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "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", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryFormAbility", + "srcEntry": "./ets/entryformability/EntryFormAbility.ets", + "label": "$string:EntryFormAbility_label", + "description": "$string:EntryFormAbility_desc", + "type": "form", + "metadata": [ + { + "name": "ohos.extension.form", + "resource": "$profile:form_config" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/resources/base/element/color.json b/Card/StepsCardJS/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/Card/StepsCardJS/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/Card/StepsCardJS/entry/src/main/resources/base/element/string.json b/Card/StepsCardJS/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c131df7cb11150f0a358133d70f330ba54138ff8 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/resources/base/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "Main program entry" + }, + { + "name": "EntryAbility_label", + "value": "StepsCard" + }, + { + "name": "EntryFormAbility_desc", + "value": "Entry for creating, deleting, modifying, and querying cards." + }, + { + "name": "EntryFormAbility_label", + "value": "Service Card" + }, + { + "name": "main_text_title", + "value": "I'm leaving today." + }, + { + "name": "steps", + "value": " steps" + }, + { + "name": "notifications_title", + "value": "Gone today %s steps" + } + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/resources/base/media/icon.png b/Card/StepsCardJS/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Card/StepsCardJS/entry/src/main/resources/base/media/icon.png differ diff --git a/Card/StepsCardJS/entry/src/main/resources/base/media/icon_steps_background.png b/Card/StepsCardJS/entry/src/main/resources/base/media/icon_steps_background.png new file mode 100644 index 0000000000000000000000000000000000000000..a94d7fc1be8e8b15ce9920b4ef6cf88768b9f094 Binary files /dev/null and b/Card/StepsCardJS/entry/src/main/resources/base/media/icon_steps_background.png differ diff --git a/Card/StepsCardJS/entry/src/main/resources/base/profile/form_config.json b/Card/StepsCardJS/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 0000000000000000000000000000000000000000..067130827a101493e74511895cc75ee2e0089474 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,42 @@ +{ + "forms": [ + { + "name": "card2x2", + "description": "This is a service widget.", + "src": "./js/card2x2/pages/index/index", + "formConfigAbility": "ability://com.huawei.stepscard.EntryAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDefault": true, + "updateEnabled": true, + "scheduledUpdateTime": "00:00", + "updateDuration": 1, + "defaultDimension": "2*2", + "supportDimensions": [ + "2*2" + ] + }, + { + "name": "card2x4", + "description": "This is a service widget.", + "src": "./js/card2x4/pages/index/index", + "formConfigAbility": "ability://com.huawei.stepscard.EntryAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDefault": false, + "updateEnabled": true, + "scheduledUpdateTime": "00:00", + "updateDuration": 1, + "defaultDimension": "2*4", + "supportDimensions": [ + "2*4" + ] + } + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/resources/base/profile/main_pages.json b/Card/StepsCardJS/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..c89f1c1a4bcc3b2a9180f1d55d1527740b0f0c13 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/MainPage" + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/resources/en_US/element/string.json b/Card/StepsCardJS/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c131df7cb11150f0a358133d70f330ba54138ff8 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "description" + }, + { + "name": "EntryAbility_desc", + "value": "Main program entry" + }, + { + "name": "EntryAbility_label", + "value": "StepsCard" + }, + { + "name": "EntryFormAbility_desc", + "value": "Entry for creating, deleting, modifying, and querying cards." + }, + { + "name": "EntryFormAbility_label", + "value": "Service Card" + }, + { + "name": "main_text_title", + "value": "I'm leaving today." + }, + { + "name": "steps", + "value": " steps" + }, + { + "name": "notifications_title", + "value": "Gone today %s steps" + } + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/entry/src/main/resources/zh_CN/element/string.json b/Card/StepsCardJS/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9628748733150cf2e676190a9c0f06c7b22a0456 --- /dev/null +++ b/Card/StepsCardJS/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "主程序入口" + }, + { + "name": "EntryAbility_label", + "value": "计步器卡片" + }, + { + "name": "EntryFormAbility_desc", + "value": "卡片创建,删除,修改,查询等操作入口" + }, + { + "name": "EntryFormAbility_label", + "value": "服务卡片" + }, + { + "name": "main_text_title", + "value": "今天一共走了" + }, + { + "name": "steps", + "value": " 步" + }, + { + "name": "notifications_title", + "value": "今天走了%s步" + } + ] +} \ No newline at end of file diff --git a/Card/StepsCardJS/figures/AddCard.png b/Card/StepsCardJS/figures/AddCard.png new file mode 100644 index 0000000000000000000000000000000000000000..98aefef64eedf3d73f5be5668eed2eafc8b0626e Binary files /dev/null and b/Card/StepsCardJS/figures/AddCard.png differ diff --git a/Card/StepsCardJS/figures/Congratulations.gif b/Card/StepsCardJS/figures/Congratulations.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/Card/StepsCardJS/figures/Congratulations.gif differ diff --git a/Card/StepsCardJS/figures/CreateJSDirectory.png b/Card/StepsCardJS/figures/CreateJSDirectory.png new file mode 100644 index 0000000000000000000000000000000000000000..fa0770bc2252130535d6fd733b92368aa6f587a2 Binary files /dev/null and b/Card/StepsCardJS/figures/CreateJSDirectory.png differ diff --git a/Card/StepsCardJS/figures/EnterJSInfo.png b/Card/StepsCardJS/figures/EnterJSInfo.png new file mode 100644 index 0000000000000000000000000000000000000000..3f01b4850f700954c9a31269e0ff4e394edaaa9c Binary files /dev/null and b/Card/StepsCardJS/figures/EnterJSInfo.png differ diff --git a/Card/StepsCardJS/figures/JSDirectory.png b/Card/StepsCardJS/figures/JSDirectory.png new file mode 100644 index 0000000000000000000000000000000000000000..c444431020b4fb0509f18f3237d6c967e2391e56 Binary files /dev/null and b/Card/StepsCardJS/figures/JSDirectory.png differ diff --git a/Card/StepsCardJS/figures/NitificationWindow.png b/Card/StepsCardJS/figures/NitificationWindow.png new file mode 100644 index 0000000000000000000000000000000000000000..be0ff9a5f2fc293e328c524e3f41010fb62fa9a2 Binary files /dev/null and b/Card/StepsCardJS/figures/NitificationWindow.png differ diff --git a/Card/StepsCardJS/figures/Notication.png b/Card/StepsCardJS/figures/Notication.png new file mode 100644 index 0000000000000000000000000000000000000000..a11bb28a827a4f609fe15369a465bdd80915e75c Binary files /dev/null and b/Card/StepsCardJS/figures/Notication.png differ diff --git a/Card/StepsCardJS/figures/SelectModule.png b/Card/StepsCardJS/figures/SelectModule.png new file mode 100644 index 0000000000000000000000000000000000000000..312254b1f1945094efdccdc93a3dcdd9718d1210 Binary files /dev/null and b/Card/StepsCardJS/figures/SelectModule.png differ diff --git a/Card/StepsCardJS/figures/StepsCard.gif b/Card/StepsCardJS/figures/StepsCard.gif new file mode 100644 index 0000000000000000000000000000000000000000..14caf260813387415c7735b9a065b400f1630f36 Binary files /dev/null and b/Card/StepsCardJS/figures/StepsCard.gif differ diff --git a/Card/StepsCardJS/figures/zh-cn_image_0000001569303293.png b/Card/StepsCardJS/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/Card/StepsCardJS/figures/zh-cn_image_0000001569303293.png differ diff --git a/Card/StepsCardJS/hvigor/hvigor-config.json5 b/Card/StepsCardJS/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/Card/StepsCardJS/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/Card/StepsCardJS/hvigor/hvigor-wrapper.js b/Card/StepsCardJS/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/Card/StepsCardJS/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/Card/StepsCardJS/hvigorfile.ts b/Card/StepsCardJS/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/Card/StepsCardJS/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/Card/StepsCardJS/oh-package.json5 b/Card/StepsCardJS/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..dead385bb2966155cd053d20fdf5d7199e3491f4 --- /dev/null +++ b/Card/StepsCardJS/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "stepscard", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Card/StepsCardJS/public_sys-resources/icon-caution.gif b/Card/StepsCardJS/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Card/StepsCardJS/public_sys-resources/icon-caution.gif differ diff --git a/Card/StepsCardJS/public_sys-resources/icon-danger.gif b/Card/StepsCardJS/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Card/StepsCardJS/public_sys-resources/icon-danger.gif differ diff --git a/Card/StepsCardJS/public_sys-resources/icon-note.gif b/Card/StepsCardJS/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/Card/StepsCardJS/public_sys-resources/icon-note.gif differ diff --git a/Card/StepsCardJS/public_sys-resources/icon-notice.gif b/Card/StepsCardJS/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/Card/StepsCardJS/public_sys-resources/icon-notice.gif differ diff --git a/Card/StepsCardJS/public_sys-resources/icon-tip.gif b/Card/StepsCardJS/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/Card/StepsCardJS/public_sys-resources/icon-tip.gif differ diff --git a/Card/StepsCardJS/public_sys-resources/icon-warning.gif b/Card/StepsCardJS/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Card/StepsCardJS/public_sys-resources/icon-warning.gif differ diff --git a/CommonEventAndNotification/AlarmClock/AppScope/app.json5 b/CommonEventAndNotification/AlarmClock/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..00ff99ff66e6427ede10ea6cc010542e86e18871 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.alarmclock", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/CommonEventAndNotification/AlarmClock/AppScope/resources/base/element/string.json b/CommonEventAndNotification/AlarmClock/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0135ac818a531d0adc91a4f9f9d765deed56c748 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "AlarmClock" + } + ] +} diff --git a/CommonEventAndNotification/AlarmClock/AppScope/resources/base/media/app_icon.png b/CommonEventAndNotification/AlarmClock/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/AppScope/resources/base/media/app_icon.png differ diff --git a/CommonEventAndNotification/AlarmClock/LICENSE b/CommonEventAndNotification/AlarmClock/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/README.md b/CommonEventAndNotification/AlarmClock/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e68d75f5cf416aeb3b320eca032e85d0cbcfbd69 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/README.md @@ -0,0 +1,445 @@ +# 闹钟(ArkTS) + +## 介绍 +本篇Codelab将介绍如何使用后台代理提醒,实现一个简易闹钟。要求完成以下功能: +1. 展示指针表盘或数字时间。 +2. 添加、修改和删除闹钟。 +3. 展示闹钟列表,并可打开和关闭单个闹钟。 +4. 闹钟到设定的时间后弹出提醒。 +5. 将闹钟的定时数据保存到轻量级数据库。 + +![](figures/zh-cn_image_0000001550422610.gif) + +### 相关概念 + +- [Canvas](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md):提供画布组件,用于自定义绘制图形。 +- [CanvasRenderingContext2D](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md):使用RenderingContext在Canvas组件上进行绘制,绘制对象可以是矩形、文本、图片等。 +- [后台代理提醒](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/task-management/reminder-agent-development.md):开发应用时,开发者可以调用后台提醒发布的接口创建定时提醒,包括倒计时、日历、闹钟三种提醒类型。使用后台代理提醒能力后,应用可以被冻结或退出,计时和弹出提醒的功能将被后台系统服务代理。本应用中主要使用到后台代理提醒的两个接口: + - **publishReminder** + 发布一个后台代理提醒,使用callback方式实现异步调用,该方法需要申请通知弹窗Notification.requestEnableNotification后才能调用。 + - **cancelReminder** + 取消指定id的提醒,使用callback方式实现异步调用。 + +### 相关权限 + +本篇Codelab使用了后台代理提醒,需要在配置文件module.json5文件里添加权限:ohos.permission.PUBLISH_AGENT_REMINDER。 + +``` +{ + "module": { + "name": "entry", + ... + "requestPermissions": [ + { + "name": "ohos.permission.PUBLISH_AGENT_REMINDER" + } + ] + } +} +``` + +## 环境搭建 + + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + + + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──AlarmItemBean.ets // 闹钟属性类 +│ │ │ ├──AlarmSettingBean.ets // 闹钟设置属性类 +│ │ │ └──ReminderItemBean.ets // 后台提醒属性类 +│ │ ├──constants +│ │ │ ├──AlarmSettingType.ets // 闹钟设置类型枚举 +│ │ │ ├──CommonConstants.ets // 公共常量类 +│ │ │ ├──DetailConstant.ets // 详情页常量类 +│ │ │ └──MainConstant.ets // 首页常量类 +│ │ └──utils +│ │ ├──DataTypeUtils.ets // 数据类型工具类 +│ │ └──DimensionUtil.ets // 屏幕适配工具类 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──model +│ │ ├──database +│ │ │ ├──PreferencesHandler.ets // 轻量级数据库操作类 +│ │ │ └──PreferencesListener.ets // 轻量级数据库回调接口 +│ │ └──ReminderService.ets // 系统后台提醒服务类 +│ │──pages +│ │ ├──DetailIndex.ets // 详情页入口文件 +│ │ └──MainIndex.ets // 主页入口文件 +│ │──view +│ │ ├──Detail +│ │ │ ├──dialog +│ │ │ │ ├──CommonDialog.ets // 公共Dialog组件 +│ │ │ │ ├──DurationDialog.ets // 闹铃时长选择Dialog组件 +│ │ │ │ ├──IntervalDialog.ets // 闹铃间隔选择Dialog组件 +│ │ │ │ ├──RenameDialog.ets // 闹铃名设置Dialog组件 +│ │ │ │ └──RepeatDialog.ets // 闹铃重复设置Dialog组件 +│ │ │ ├──DatePickArea.ets // 详情页时间选择组件 +│ │ │ └──SettingItem.ets // 详情页设置组件 +│ │ ├──Main +│ │ │ ├──AlarmList.ets // 主页闹钟列表组件 +│ │ │ ├──AlarmListItem.ets // 主页闹钟列表子项组件 +│ │ │ └──ClockArea.ets // 主页时钟组件 +│ │ └──BackContainer.ets // 自定义头部组件 +│ └──viewmodel +│ ├──DetailViewModel.ets // 详情模块逻辑功能类 +│ └──MainViewModel.ets // 主页逻辑功能类 +└──entry/src/main/resources // 资源文件目录 +``` + +## 闹钟主界面 + +闹钟界面包括当前时间、闹钟列表、添加闹钟子组件,具体包括以下模块: + +- 展示当前时间。 +- 展示闹钟列表。 +- 添加闹钟。 +- 后台代理提醒。 + +![](figures/zh-cn_image_0000001550583498.gif) + +### 展示当前时间 + +当前时间使用了Canvas组件绘制,默认展示指针表盘,点击表盘区域切换为数字时钟。 + +![](figures/zh-cn_image_0000001550903682.png) + +在主页的ClockArea组件中初始化Canvas画布,并绑定指针表盘和数字时钟切换事件。 + +```typescript +// ClockArea.ets +@Component +export default struct ClockArea { + build() { + Canvas(this.renderContext) + .width(this.canvasSize) + .aspectRatio(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .onReady(() => { + if (this.drawInterval === CommonConstants.DEFAULT_NUMBER_NEGATIVE) { + this.startDrawTask(); + } + }) + .onClick(() => { + this.showClock = !this.showClock; + }) + } + ... + // 启动绘画任务 + private startDrawTask() { + let that = this; + that.renderContext.translate( + this.canvasSize / CommonConstants.DEFAULT_DOUBLE, + this.canvasSize / CommonConstants.DEFAULT_DOUBLE); + that.drawClockArea(); + this.drawInterval = setInterval(() => { + that.drawClockArea(); + }, MainConstant.DEFAULT_ONE_SECOND_MS); + } +} +``` + + +绘画任务是使用CanvasRenderingContext2D对象在Canvas画布组件上绘制指针表盘和数字时钟。 + +```typescript +// ClockArea.ets +// 开始绘制时钟区域 +private drawClockArea(): void{ + this.renderContext.clearRect( + -this.canvasSize, + -this.canvasSize / Constants.DEFAULT_DOUBLE, + this.canvasSize * Constants.DEFAULT_DOUBLE, + this.canvasSize); + let date = new Date(); + let hours = date.getHours(); + let minutes = date.getMinutes(); + let seconds = date.getSeconds(); + if (this.showClock) { + // 绘制表盘时钟 + } else { + // 绘制数字时钟 + } +} +``` +### 展示闹钟列表 + +闹钟列表组件,展示已添加的闹钟信息,可对闹钟进行启停操作,点击闹钟可跳转到闹钟操作界面(修改和删除闹钟)。主页启动后获取轻量级数据库中的闹钟定时数据,并监控数据库数据变化。 + +```typescript +// MainViewModel.ets +public queryAlarmsTasker(callback: (alarms: Array) => void) { + let that = this; + that.queryDatabaseAlarms(callback); + globalThis.preference.addPreferencesListener({ + onDataChanged() { + that.queryDatabaseAlarms(callback); + } + }) +} +``` + +在AlarmList.ets中添加闹钟列表子组件,并绑定启停、跳转事件。 + +```typescript +// AlarmList.ets +@Component +export default struct AlarmList { + @Link alarmItems: Array; + + build() { + List({ space: DimensionUtil.getVp($r('app.float.alarm_list_space')) }) { + ForEach(this.alarmItems, (item: AlarmItem) => { + ListItem() { + AlarmListItem({ alarmItem: item }) + }.onClick(() => { + router.pushUrl({ url: "pages/DetailIndex", params: { alarmItem: item } }); + }) + }, + item => item.id.toString()) + } + .padding({ + left: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')), + right: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')) + }) + .listDirection(Axis.Vertical) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .margin({ top: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')) }) + } +} +``` +### 添加闹钟 + +添加闹钟,点击界面底部闹钟添加按钮,跳转到闹钟操作界面(新增闹钟)。 + +![](figures/zh-cn_image_0000001550584842.gif) + +在MainIndex.ets中为添加按钮绑定跳转事件。 + +```typescript +// MainIndex.ets +@Entry +@Component +struct MainIndex { + ... + build() { + Column() { + ... + Button() { + Image($r('app.media.ic_add')).objectFit(ImageFit.Fill) + } + ... + .onClick(() => { + router.pushUrl({ url: "pages/DetailIndex" }); + }) + } + ... + } +} +``` +### 后台代理提醒 + +后台代理提醒,根据闹钟列表中的数据来设置(启停)闹钟实例。 + +```typescript +// MainViewModel.ets +// 开启/关闭闹钟 +public openAlarm(id: number, isOpen: boolean) { + for (let i = 0; i < this.alarms.length; i++) { + if (this.alarms[i].id === id) { + this.alarms[i].isOpen = isOpen; + if (isOpen) { + this.reminderService.addReminder(this.alarms[i]); + } else { + this.reminderService.deleteReminder(this.alarms[i].id); + } + globalThis.preference.set(ALARM_KEY, JSON.stringify(this.alarms)); + break; + } + } +} +``` +## 闹钟详情界面 + +闹钟操作界面分为新增和修改界面,其中在修改界面可删除闹钟。具体包括以下模块: + +- 退出或保存详情。 +- 设置闹钟时间。 +- 设置闹钟详情。 +- 提供后台代理提醒能力 + +![](figures/zh-cn_image_0000001601778449.gif) +### 退出或保存详情 + +点击左上角“x”图标关闭操作界面,关闭闹钟操作界面子组件,点击右上角“√”图标,保存当前设置并关闭操作界面。 + +![](figures/zh-cn_image_0000001601625241.png) + +在DetailIndex.ets入口页面中引入头部组件BackContainer,自定义了返回按钮和返回逻辑操作,添加确定(“√”)子组件,并绑定点击事件。 + +```typescript +// DetailIndex.ets +build() { + Row() { + Button() { + Image(this.backImgRes == null ? $r('app.media.ic_public_back') : this.backImgRes).objectFit(ImageFit.Fill) + } + .backgroundColor($r('app.color.trans_parent')) + .width(DimensionUtil.getVp($r('app.float.title_button_size'))) + .height(DimensionUtil.getVp($r('app.float.title_button_size'))) + .onClick(() => { + this.backFunc ? this.backFunc() : router.back(); + }) + + Text(this.header) + .fontSize(DimensionUtil.getFp($r('app.float.detail_title_font_size'))) + .lineHeight(DimensionUtil.getVp($r('app.float.title_line_height'))) + .margin({ left: DimensionUtil.getVp($r('app.float.title_margin')) }) + .fontColor($r('app.color.grey_divider')) + .fontWeight(FontWeight.Bold) + Blank() + if (this.closer) { + this.closer(); + } + } + .padding({ + left: DimensionUtil.getVp($r('app.float.title_horizon_margin')), + right: DimensionUtil.getVp($r('app.float.title_horizon_margin')) + }) + .height(DimensionUtil.getVp($r('app.float.page_title_height'))) + .width(CommonConstants.FULL_LENGTH) +} +``` +### 设置闹钟时间 + +设置闹钟提醒时间,在闹钟操作界面可通过滑动选择器设置闹钟的提醒时间(包括:时段、小时、分钟)。详情页DetailIndex.ets中添加闹钟时间选择器子组件DatePickArea.ets。 + +```typescript +// DatePickArea.ets +@Component +export default struct DatePickArea { + build() { + Stack({ alignContent: Alignment.Center }) { + Row() { + ForEach(DetailConstant.DAY_DATA, (item) => { + TextPicker({ range: item.data, selected: item.delSelect }) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .backgroundColor($r('app.color.grey_light')) + .onChange((value: string, index: number) => { + item.delSelect = index; + }) + }, item => item.timeType) + } + } + .height(DimensionUtil.getVp($r('app.float.date_picker_height'))) + .padding({ + left: DimensionUtil.getVp($r('app.float.date_picker_padding_horizon')), + right: DimensionUtil.getVp($r('app.float.date_picker_padding_horizon')) + }) + } +} +``` + +### 设置闹钟详情 + +点击详情页DetailIndex.ets设置条目组件SettingItem.ets,支持设置闹钟重复时间、闹钟名称、重复次数和闹铃时长。 + +```typescript +// SettingItem.ets +build() { + Column() { + ForEach(this.settingInfo, (item: SettingInfo, index: number) => { + Divider() + ... + Row() { + Text(item.title)... + Text(item.content)... + Image($r('app.media.ic_right'))... + } + ... + .onClick(() => { + this.showSettingDialog(item.sType); + }) + }, (item, index) => JSON.stringify(item) + index) + } + ... +} +``` + +### 提供后台代理提醒能力 + +导入系统提醒服务类ReminderService.ets,它由系统后台代理提醒能力封装,支持新增、修改、删除系统闹钟功能,在设置、删除闹钟后同步更新到轻量级数据库中并刷新主页页面。 + +```typescript +// DetailViewModel.ets +public async setAlarmRemind(alarmItem: AlarmItem) { + alarmItem.hour = this.getAlarmTime(Constants.DEFAULT_SINGLE); + alarmItem.minute = this.getAlarmTime(Constants.DEFAULT_DATA_PICKER_HOUR_SELECTION); + let index = await this.findAlarmWithId(alarmItem.id); + if (index !== Constants.DEFAULT_NUMBER_NEGATIVE) { + // 已存在,删除原有提醒 + this.reminderService.deleteReminder(alarmItem.id); + } else { + // 不存在,以数据长度为notificationId新增闹钟数据 + index = this.alarms.length; + alarmItem.notificationId = index; + this.alarms.push(alarmItem); + } + this.reminderService.addReminder(alarmItem, (newId) => { + alarmItem.id = newId; + alarmItem.isOpen = true; + this.alarms[index] = alarmItem; + globalThis.preference.set(ALARM_KEY, JSON.stringify(this.alarms)); + }) +} + +public async removeAlarmRemind(id: number) { + this.reminderService.deleteReminder(id); + let index = await this.findAlarmWithId(id); + if (index !== Constants.DEFAULT_NUMBER_NEGATIVE) { + this.alarms.splice(index, Constants.DEFAULT_SINGLE); + } + globalThis.preference.set(ALARM_KEY, JSON.stringify(this.alarms)); +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. Canvas画布组件的使用。 +2. 后台代理提醒的使用。 + +![](figures/zh-cn_image_0000001601208789.gif) \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/build-profile.json5 b/CommonEventAndNotification/AlarmClock/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7d18441853f8bbde636911803a4b3f3d5668cd97 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/build-profile.json5 @@ -0,0 +1,26 @@ +{ + "app": { + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/build-profile.json5 b/CommonEventAndNotification/AlarmClock/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..befa10141dfc5999e35f60a36a9f948e664732b1 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/hvigorfile.ts b/CommonEventAndNotification/AlarmClock/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/CommonEventAndNotification/AlarmClock/entry/oh-package.json5 b/CommonEventAndNotification/AlarmClock/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..a7afd4ec1017198e9d8017e9f28e8e1d786a9e39 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/AlarmItemBean.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/AlarmItemBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..a071be657a15166b4f76cf5fd9931e55dcf1d4c5 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/AlarmItemBean.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 Huawei Device 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 ReminderItem from './ReminderItemBean'; + +/** + * Alarm item description. + */ +@Observed export default class AlarmItemBean extends ReminderItem { + /** + * Custom alarm name. + */ + name = '闹钟'; + + /** + * Custom alarm is open. + */ + isOpen: boolean = true; + + /** + * Custom alarm is repeat. + */ + isRepeat: boolean = false; + + /** + * Custom alarm duration. + */ + duration: number = 5; + + /** + * Custom alarm interval minute. + */ + intervalMinute: number = 10; + + /** + * Custom alarm interval times. + */ + intervalTimes: number = 3; + + /** + * Custom alarm notification id. + */ + notificationId: number; +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/AlarmSettingBean.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/AlarmSettingBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..fbc5e480314000b387c07e4b183a2ab7c7a9e94a --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/AlarmSettingBean.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { AlarmSettingType } from '../constants/AlarmSettingType'; + +/** + * Alarm setting bean information. + */ +export default class AlarmSettingBean { + /** + * Alarm setting title. + */ + public title: string; + + /** + * Alarm setting content. + */ + public content: string; + + /** + * Alarm setting type. + */ + public sType: AlarmSettingType; + + constructor(title, content, sType) { + this.title = title; + this.content = content; + this.sType = sType; + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/ReminderItemBean.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/ReminderItemBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..c77d2fc30cfcd8bc0f21c43423659cbc6a0f67ef --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/bean/ReminderItemBean.ets @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 Huawei Device 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 reminderAgent from '@ohos.reminderAgentManager'; + +export default class ReminderItemBean { + id: number; + remindType: reminderAgent.ReminderType = reminderAgent.ReminderType.REMINDER_TYPE_ALARM; + name: string; + hour: number; + minute: number; + duration: number; + intervalMinute: number; + intervalTimes: number; + repeatDays: Array = []; + notificationId: number; +} + diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/AlarmSettingType.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/AlarmSettingType.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fb1bab182077ae8353df2928364d3ae62a18855 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/AlarmSettingType.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +//export { AlarmSettingBean }; + +/** + * Alarm setting type enum description. + */ +export enum AlarmSettingType { + /** + * Alarm setting type repeat. + */ + REPEAT, + + /** + * Alarm setting type name. + */ + ALARM_NAME, + + /** + * Alarm setting type ring duration. + */ + RING_DURATION, + + /** + * Alarm setting type interval. + */ + INTERVAL +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/CommonConstants.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..15ac20646a2f30252c41cff0a8da531b7c574795 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +/** + * database preference id. + */ +export const PREFERENCE_ID = 'storageId'; + +/** + * database alarm data key. + */ +export const ALARM_KEY = 'alarmData'; + +/** + * database alarm item key. + */ +export const PARAM_KEY = 'alarmItem'; + +export const CommonConstants = { + /** + * common full length + */ + FULL_LENGTH: '100%', + + /** + * default string space. + */ + DEFAULT_STRING_SPACE: ' ', + + /** + * default string comma. + */ + DEFAULT_STRING_COMMA: ',', + + /** + * default string no repeat. + */ + DEFAULT_STRING_NO_REPEAT: '不重复', + + /** + * default number negative. + */ + DEFAULT_NUMBER_NEGATIVE: -1, + + /** + * default layout weight. + */ + DEFAULT_LAYOUT_WEIGHT: 1, + + /** + * default number monday. + */ + DEFAULT_NUMBER_MONDAY: 1, + + /** + * default number tuesday. + */ + DEFAULT_NUMBER_TUESDAY: 2, + + /** + * default number wednesday. + */ + DEFAULT_NUMBER_WEDNESDAY: 3, + + /** + * default number thursday. + */ + DEFAULT_NUMBER_THURSDAY: 4, + + /** + * default number friday. + */ + DEFAULT_NUMBER_FRIDAY: 5, + + /** + * default number saturday. + */ + DEFAULT_NUMBER_SATURDAY: 6, + + /** + * default number sunday. + */ + DEFAULT_NUMBER_SUNDAY: 7, + + /** + * default single. + */ + DEFAULT_SINGLE: 1, + + /** + * default double. + */ + DEFAULT_DOUBLE: 2, + + /** + * default data picker hour selection. + */ + DEFAULT_DATA_PICKER_HOUR_SELECTION: 2, + + /** + * default total minute. + */ + DEFAULT_TOTAL_MINUTE: 60, + + /** + * default string monday. + */ + DEFAULT_STRING_MONDAY: '周一', + + /** + * default string tuesday. + */ + DEFAULT_STRING_TUESDAY: '周二', + + /** + * default string wednesday. + */ + DEFAULT_STRING_WEDNESDAY: '周三', + + /** + * default string thursday. + */ + DEFAULT_STRING_THURSDAY: '周四', + + /** + * default string friday. + */ + DEFAULT_STRING_FRIDAY: '周五', + + /** + * default string saturday. + */ + DEFAULT_STRING_SATURDAY: '周六', + + /** + * default string sunday. + */ + DEFAULT_STRING_SUNDAY: '周日', + + /** + * default number moment. + */ + DEFAULT_NUMBER_MOMENT: 3, + + /** + * default interval step. + */ + DEFAULT_INTERVAL_STEP: 5, + + /** + * default common degree + */ + DEFAULT_COMMON_DEGREE: 6, + + /** + * default pointer width. + */ + DEFAULT_POINTER_WIDTH: 10, + + /** + * default total hour. + */ + DEFAULT_TOTAL_HOUR: 12, + + /** + * default interval time max. + */ + DEFAULT_INTERVAL_TIME_MAX: 10, + + /** + * default interval minute max. + */ + DEFAULT_INTERVAL_MINUTE_MAX: 30, +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/DetailConstant.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/DetailConstant.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d8e114439644e6b241258d56d0f140d7954e757 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/DetailConstant.ets @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +/** + * Detail page constant description. + */ +export const DetailConstant = { + /** + * detail page day data. + */ + DAY_DATA: [ + { timeType: 0, delSelect: 0, data: ['上午', '下午'] }, + { timeType: 1, delSelect: 0, data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] }, + { timeType: 2, delSelect: 0, data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', + '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', + '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', + '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', + '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '00', + ] } + ], + + /** + * week day data. + */ + WEEKDAY_DATA: [1, 2, 3, 4, 5, 6, 7], + + /** + * ring duration list data. + */ + RING_DURATION: [1, 5, 10, 15, 20, 30], + + /** + * default string minute. + */ + DEFAULT_STRING_MINUTE: '分钟', + + /** + * default string group name. + */ + DEFAULT_STRING_GROUP_NAME: 'radioGroup', + + /** + * default string provider key. + */ + DEFAULT_PROVIDER_KEY: 'alarmItemProvide', + + /** + * default string repeat. + */ + DEFAULT_STRING_REPEAT: '重复', + + /** + * default string alarm name. + */ + DEFAULT_STRING_ALARM_NAME: '闹钟名', + + /** + * default string interval. + */ + DEFAULT_STRING_INTERVAL: '再响间隔', + + /** + * default string duration. + */ + DEFAULT_STRING_DURATION: '闹铃时长', + + /** + * default string times. + */ + DEFAULT_STRING_TIMES: '次', +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/MainConstant.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/MainConstant.ets new file mode 100644 index 0000000000000000000000000000000000000000..20aaeaa749bf916d71d081f226c4358d5052e476 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/constants/MainConstant.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +/** + * Main page constant description. + */ +export const MainConstant = { + /** + * Main page times list. + */ + TIMES: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2], + + /** + * Default single digit max. + */ + DEFAULT_SINGLE_DIGIT_MAX: 9, + + /** + * Default horizontal angle. + */ + DEFAULT_HORIZONTAL_ANGLE: 180, + + /** + * Default one second ms. + */ + DEFAULT_ONE_SECOND_MS: 1000, + + /** + * Default zeroing. + */ + DEFAULT_ZEROING: "0", + + /** + * Default string morning. + */ + DEFAULT_STRING_MORNING: '上午', + + /** + * Default string afternoon. + */ + DEFAULT_STRING_AFTERNOON: '下午', + + /** + * Default string alarm name. + */ + DEFAULT_STRING_ALARM: '闹钟', + + /** + * Default string quotation. + */ + DEFAULT_STRING_NULL: "", + + /** + * Default string colon. + */ + DEFAULT_STRING_COLON: ':', + + /** + * Default clock time font size unit. + */ + CLOCK_TIME_FONT_SIZE_UNIT: 'px', + + /** + * Hour pointer image url. + */ + HOUR_POINTER_IMAGE_URL: "../../../resources/base/media/ic_hour_pointer.png", + + /** + * Minute pointer image url. + */ + MINUTE_POINTER_IMAGE_URL: "../../../resources/base/media/ic_minute_pointer.png", + + /** + * Second pointer image url. + */ + SECOND_POINTER_IMAGE_URL: "../../../resources/base/media/ic_second_pointer.png", + + /** + * Clock pan image url. + */ + CLOCK_PAN_IMAGE_URL: '../../../resources/base/media/ic_clock_pan.png', +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/utils/DataTypeUtils.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/utils/DataTypeUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..90f063727525fcea471edce6da9e751db4ef3a56 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/utils/DataTypeUtils.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +/** + * Data type utils. + */ +export default class DataTypeUtils { + /** + * return value is number. + * + * @return boolean. + */ + static isNumber(value): boolean{ + return typeof value === 'number' && isFinite(value); + } + + /** + * return obj is null. + * + * @return boolean. + */ + static isNull(obj): boolean { + return (typeof obj === 'undefined' || obj == null || obj === ''); + } + + /** + * return new deep copy object from obj. + * + * @return type in obj. + */ + static deepCopy(obj) { + var newObj = obj.constructor === Array ? [] : {}; + if (typeof obj !== 'object') { + return obj; + } else { + for (var i in obj) { + if (typeof obj[i] === 'object') { + newObj[i] = this.deepCopy(obj[i]); + } else { + newObj[i] = obj[i]; + } + } + } + return newObj; + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/utils/DimensionUtil.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/utils/DimensionUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..82edab1d0d73cdb8c22a13ee331481510f0972fe --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/common/utils/DimensionUtil.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +var context = getContext(this); + +/** + * Design drawing width. + */ +const DESIGN_WIDTH = 360; + +/** + * Design drawing height. + */ +const DESIGN_HEIGHT = 780; + +/** + * Fits tools with different sizes and lengths. + */ +export default class DimensionUtil { + /** + * Obtains the screen horizontal adaptation value. + * + * @return number + */ + static adaptDimension(value: number): number { + let deviceDisplay = globalThis.display; + let widthScale = deviceDisplay.width / DESIGN_WIDTH; + let virtualHeight = widthScale * DESIGN_HEIGHT; + let designDim = Math.sqrt(DESIGN_WIDTH * DESIGN_WIDTH + DESIGN_HEIGHT * DESIGN_HEIGHT); + let virtualDim = Math.sqrt(deviceDisplay.width * deviceDisplay.width + virtualHeight * virtualHeight); + return virtualDim * value / designDim; // 放缩后长度 + } + + /** + * Obtains the screen horizontal adaptation px. + * + * @return number + */ + static getPx(value: Resource): number { + let beforeVp = context.resourceManager.getNumber(value.id); + return this.adaptDimension(beforeVp); + } + + /** + * Obtains the screen horizontal adaptation vp. + * + * @return number + */ + static getVp(value: Resource): number { + let beforeVp = context.resourceManager.getNumber(value.id); + return px2vp(this.adaptDimension(beforeVp)); + } + + /** + * Obtains the screen horizontal adaptation fp. + * + * @return number + */ + static getFp(value: Resource): number { + let beforeFp = context.resourceManager.getNumber(value.id); + return px2fp(this.adaptDimension(beforeFp)); + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/entryability/EntryAbility.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..238b0819020eab0db5db6a70eebc10f5b76a2010 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Huawei Device 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 display from '@ohos.display'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import PreferencesHandler from '../model/database/PreferencesHandler'; + +export default class EntryAbility extends UIAbility { + onCreate(want) { + let abilityInfo = this.context.abilityInfo; + globalThis.bundleName = abilityInfo.bundleName; + globalThis.abilityName = abilityInfo.name; + globalThis.abilityWant = want; + globalThis.preference = PreferencesHandler.getInstance(); + } + + async onWindowStageCreate(windowStage) { + globalThis.display = await display.getDefaultDisplay(); + await globalThis.preference.configure(this.context.getApplicationContext()); + windowStage.setUIContent(this.context, "pages/MainIndex", null); + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/ReminderService.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/ReminderService.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4c1078d2f416184e04364f0bae051931b08f5b1 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/ReminderService.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2022 Huawei Device 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 reminderAgent from '@ohos.reminderAgentManager'; +import notification from '@ohos.notificationManager'; +import { CommonConstants } from '../common/constants/CommonConstants'; +import ReminderItem from '../common/bean/ReminderItemBean'; + +/** + * Base on ohos reminder agent service + */ +export default class ReminderService { + /** + * open notification permission + */ + public openNotificationPermission() { + notification.requestEnableNotification().then(() => { + console.info('Enable notification success'); + }).catch((err) => { + console.error('Enable notification failed because ' + JSON.stringify(err)); + }); + } + + /** + * Adding and modifying alarm reminders + * + * @param alarmItem ReminderItem + * @param callback callback + */ + public addReminder(alarmItem: ReminderItem, callback?) { + let reminder = this.initReminder(alarmItem); + reminderAgent.publishReminder(reminder, (err, reminderId) => { + if (callback != null) { + callback(reminderId); + } + }); + } + + /** + * Adding and modifying alarm reminders + * + * @param reminderId number + */ + public deleteReminder(reminderId: number) { + reminderAgent.cancelReminder(reminderId); + } + + private initReminder(item: ReminderItem): reminderAgent.ReminderRequestAlarm{ + return { + reminderType: item.remindType, + hour: item.hour, + minute: item.minute, + daysOfWeek: item.repeatDays, + title: item.name, + ringDuration: item.duration * CommonConstants.DEFAULT_TOTAL_MINUTE, + snoozeTimes: item.intervalTimes, + timeInterval: item.intervalMinute, + actionButton: [ + { + title: '关闭', + type: reminderAgent.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE + }, + { + title: '稍后提醒', + type: reminderAgent.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE + }, + ], + wantAgent: { + pkgName: globalThis.bundleName, + abilityName: globalThis.abilityName + }, + notificationId: item.notificationId, + expiredContent: 'this reminder has expired', + snoozeContent: 'remind later', + slotType: notification.SlotType.SERVICE_INFORMATION + } + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c84d33a7d29a43e46aad1d9f62d11d59a9eaa95 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2022 Huawei Device 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 data_preferences from '@ohos.data.preferences'; +import { PREFERENCE_ID } from '../../common/constants/CommonConstants'; +import PreferencesListener from './PreferencesListener'; + +/** + * Based on lightweight databases preferences handler. + */ +export default class PreferencesHandler { + private static instance: PreferencesHandler; + private preferences; + private defaultValue = ''; + private listeners: PreferencesListener[]; + + private constructor() { + this.listeners = new Array(); + } + + /** + * Get PreferencesHandler instance. + * + * @return instance + */ + public static getInstance() { + if (this.instance == null) { + this.instance = new PreferencesHandler(); + } + return this.instance; + } + + /** + * Configure PreferencesHandler. + * + * @param context Context + */ + public async configure(context) { + this.preferences = await data_preferences.getPreferences(context, PREFERENCE_ID); + this.preferences.on('change', (key) => { + for (let preferencesListener of this.listeners) { + preferencesListener.onDataChanged(key); + } + }); + } + + /** + * Set data in PreferencesHandler. + * + * @param key string + * @param value any + */ + public async set(key: string, value) { + if (this.preferences != null) { + await this.preferences.put(key, value); + await this.preferences.flush(); + } + } + + /** + * Get data in PreferencesHandler. + * + * @param key string + * @param defValue any + * @return data about key + */ + public async get(key: string, defValue?) { + let data; + if (this.preferences != null) { + data = await this.preferences.get(key, defValue == null ? this.defaultValue : defValue); + } + return data; + } + + /** + * Clear data in PreferencesHandler. + */ + public clear() { + if (this.preferences != null) { + this.preferences.clear(); + } + } + + /** + * Get all data in PreferencesHandler. + * + * @return data + */ + public async getAll() { + let data; + if (this.preferences != null) { + data = await this.preferences.getAll(); + } + return data; + } + + /** + * Add preferences listener in PreferencesHandler. + * + * @param listener PreferencesListener + */ + public addPreferencesListener(listener: PreferencesListener) { + this.listeners.push(listener); + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesListener.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesListener.ets new file mode 100644 index 0000000000000000000000000000000000000000..d863486554de7fd15ef6c95f7f4248f7444dae77 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesListener.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Huawei Device 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. + */ + +/** + * Preferences listener interface. + */ +export default interface PreferencesListener { + /** + * Preferences on data changed listener. + * + * @param key string + */ + onDataChanged(key: string): void +} diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/DetailIndex.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/DetailIndex.ets new file mode 100644 index 0000000000000000000000000000000000000000..a7c2b8aa556b7caf785dfb3bac969e05acc2fa5c --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/DetailIndex.ets @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2022 Huawei Device 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 router from '@ohos.router'; +import { PARAM_KEY, CommonConstants } from '../common/constants/CommonConstants'; +import AlarmItem from '../common/bean/AlarmItemBean'; +import AlarmSettingBean from '../common/bean/AlarmSettingBean'; +import { AlarmSettingType } from '../common/constants/AlarmSettingType'; +import { DetailConstant } from '../common/constants/DetailConstant'; +import BackContainer from '../view/BackContainer'; +import DetailModel from '../viewmodel/DetailViewModel'; +import DatePickArea from '../view/detail/DatePickArea'; +import SettingItem from '../view/Detail/SettingItem'; +import DimensionUtil from '../common/utils/DimensionUtil'; + +@Entry +@Component +struct DetailIndex { + @Watch('onAlarmItemChange') @Provide(DetailConstant.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem = new AlarmItem(); + @State repeatSettingArr: Array = []; + @State alarmSettingInfoArr: Array = []; + private isNow: boolean = true; + private viewModel: DetailModel = DetailModel.getInstant(); + + aboutToAppear() { + if (router.getParams() != null && router.getParams().hasOwnProperty(PARAM_KEY)) { + this.isNow = false; + this.alarmItem = router.getParams()[PARAM_KEY]; + this.viewModel.setAlarmDefaultTime(this.alarmItem); + } else { + this.viewModel.setAlarmDefaultTime(); + } + this.initData(); + } + + onAlarmItemChange() { + this.initData(); + } + + initData() { + this.repeatSettingArr = [ + new AlarmSettingBean(DetailConstant.DEFAULT_STRING_REPEAT, + this.alarmItem.isRepeat ? DetailConstant.DEFAULT_STRING_REPEAT + : CommonConstants.DEFAULT_STRING_NO_REPEAT, AlarmSettingType.REPEAT) + ]; + this.alarmSettingInfoArr = [ + new AlarmSettingBean(DetailConstant.DEFAULT_STRING_ALARM_NAME, this.alarmItem.name, AlarmSettingType.ALARM_NAME), + new AlarmSettingBean(DetailConstant.DEFAULT_STRING_DURATION, + this.alarmItem.duration + DetailConstant.DEFAULT_STRING_MINUTE, AlarmSettingType.RING_DURATION), + new AlarmSettingBean(DetailConstant.DEFAULT_STRING_INTERVAL, this.alarmItem.intervalMinute + + DetailConstant.DEFAULT_STRING_MINUTE + CommonConstants.DEFAULT_STRING_COMMA + + this.alarmItem.intervalTimes + DetailConstant.DEFAULT_STRING_TIMES, AlarmSettingType.INTERVAL) + ] + } + + build() { + Column() { + BackContainer({ + header: this.isNow ? $r('app.string.new_alarm') : $r('app.string.update_alarm'), + backImgRes: $r('app.media.ic_cancel'), + }) { + Button() { + Image($r('app.media.ic_confirm')).objectFit(ImageFit.Fill) + } + .backgroundColor($r('app.color.trans_parent')) + .width(DimensionUtil.getVp($r('app.float.title_button_size'))) + .height(DimensionUtil.getVp($r('app.float.title_button_size'))) + .onClick(() => { + this.viewModel.setAlarmRemind(this.alarmItem); + router.back(); + }) + } + + DatePickArea() + + SettingItem({ + settingInfo: $repeatSettingArr + }) + SettingItem({ + settingInfo: $alarmSettingInfoArr + }) + + Blank() + + Button($r('app.string.delete')) + .visibility(this.isNow ? Visibility.None : Visibility.Visible) + .width(DimensionUtil.getVp($r('app.float.delete_button_width'))) + .height(DimensionUtil.getVp($r('app.float.delete_button_height'))) + .fontSize(DimensionUtil.getFp($r('app.float.delete_button_font_size'))) + .fontColor($r('app.color.red_light')) + .backgroundColor($r('app.color.grey_with_opacity')) + .borderRadius(DimensionUtil.getVp($r('app.float.delete_button_radius'))) + .margin({ + bottom: DimensionUtil.getVp($r('app.float.delete_button_margin_bottom')) + }) + .onClick(() => { + this.viewModel.removeAlarmRemind(this.alarmItem.id); + router.back(); + }) + } + .backgroundColor($r('app.color.grey_light')) + .width(CommonConstants.FULL_LENGTH) + .height(CommonConstants.FULL_LENGTH) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/MainIndex.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/MainIndex.ets new file mode 100644 index 0000000000000000000000000000000000000000..005c59ed6923b91ff20f3c3171b3e74547707115 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/pages/MainIndex.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device 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 router from '@ohos.router'; +import { CommonConstants } from '../common/constants/CommonConstants'; +import AlarmItem from '../common/bean/AlarmItemBean'; +import { MainConstant } from '../common/constants/MainConstant'; +import MainModel from '../viewmodel/MainViewModel'; +import ClockArea from './../view/Main/ClockArea'; +import AlarmList from './../view/Main/AlarmList'; +import DimensionUtil from '../common/utils/DimensionUtil'; + +@Entry +@Component +struct MainIndex { + private mainModel: MainModel = MainModel.getInstant(); + @State alarmItems: Array = new Array(); + @State isAuth: boolean = false; + + aboutToAppear() { + let that = this; + that.mainModel.queryAlarmsTasker((alarms: Array) => { + that.alarmItems = alarms; + }) + } + + build() { + Column() { + Text(MainConstant.DEFAULT_STRING_ALARM) + .height(DimensionUtil.getVp($r('app.float.page_title_height'))) + .textAlign(TextAlign.Start) + .fontSize(DimensionUtil.getFp($r('app.float.title_font_size'))) + .width(CommonConstants.FULL_LENGTH) + .fontColor($r('app.color.grey_divider')) + .fontWeight(FontWeight.Bold) + .margin({ bottom: DimensionUtil.getVp($r('app.float.content_margin_body')) }) + .padding({ left: DimensionUtil.getVp($r('app.float.title_horizon_margin')) }) + + ClockArea() + + AlarmList({ alarmItems: $alarmItems }) + + Blank() + + Button() { + Image($r('app.media.ic_add')).objectFit(ImageFit.Fill) + } + .backgroundColor($r('app.color.trans_parent')) + .width(DimensionUtil.getVp($r('app.float.new_alarm_button_size'))) + .height(DimensionUtil.getVp($r('app.float.new_alarm_button_size'))) + .margin({ + bottom: DimensionUtil.getVp($r('app.float.new_alarm_button_margin_vertical')), + top: DimensionUtil.getVp($r('app.float.new_alarm_button_margin_vertical')) + }) + .onClick(() => { + router.pushUrl({ url: "pages/DetailIndex" }); + }) + } + .width(CommonConstants.FULL_LENGTH) + .height(CommonConstants.FULL_LENGTH) + .backgroundColor($r('app.color.grey_light')) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/BackContainer.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/BackContainer.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f5c92ae857fafa67efa3def2c4050d0949488d2 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/BackContainer.ets @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device 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 router from '@ohos.router'; +import { CommonConstants } from '../common/constants/CommonConstants'; +import DimensionUtil from '../common/utils/DimensionUtil'; + +@Component +export default struct BackContainer { + private header: string | Resource; + private backImgRes: string | Resource; + private backFunc: () => void; + @BuilderParam closer: () => void; + + build() { + Row() { + Button() { + Image(this.backImgRes == null ? $r('app.media.ic_public_back') : this.backImgRes).objectFit(ImageFit.Fill) + } + .backgroundColor($r('app.color.trans_parent')) + .width(DimensionUtil.getVp($r('app.float.title_button_size'))) + .height(DimensionUtil.getVp($r('app.float.title_button_size'))) + .onClick(() => { + this.backFunc ? this.backFunc() : router.back(); + }) + + Text(this.header) + .fontSize(DimensionUtil.getFp($r('app.float.detail_title_font_size'))) + .lineHeight(DimensionUtil.getVp($r('app.float.title_line_height'))) + .margin({ left: DimensionUtil.getVp($r('app.float.title_margin')) }) + .fontColor($r('app.color.grey_divider')) + .fontWeight(FontWeight.Bold) + Blank() + if (this.closer) { + this.closer(); + } + } + .padding({ + left: DimensionUtil.getVp($r('app.float.title_horizon_margin')), + right: DimensionUtil.getVp($r('app.float.title_horizon_margin')) + }) + .height(DimensionUtil.getVp($r('app.float.page_title_height'))) + .width(CommonConstants.FULL_LENGTH) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/DatePickArea.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/DatePickArea.ets new file mode 100644 index 0000000000000000000000000000000000000000..27e08ffb1f0b5be46ceb2195026acd5f4016a8af --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/DatePickArea.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { DetailConstant } from '../../common/constants/DetailConstant'; +import { CommonConstants } from '../../common/constants/CommonConstants'; +import DimensionUtil from '../../common/utils/DimensionUtil'; + +@Component +export default struct DatePickArea { + build() { + Stack({ alignContent: Alignment.Center }) { + Row() { + ForEach(DetailConstant.DAY_DATA, (item) => { + TextPicker({ range: item.data, selected: item.delSelect }) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .backgroundColor($r('app.color.grey_light')) + .onChange((value: string, index: number) => { + item.delSelect = index; + }) + }, item => JSON.stringify(item)) + } + } + .height(DimensionUtil.getVp($r('app.float.date_picker_height'))) + .padding({ + left: DimensionUtil.getVp($r('app.float.date_picker_padding_horizon')), + right: DimensionUtil.getVp($r('app.float.date_picker_padding_horizon')) + }) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/SettingItem.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/SettingItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..31e639ee040d6856c4451cb5dd4e6da7e3bff023 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/SettingItem.ets @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstants'; +import { AlarmSettingType } from '../../common/constants/AlarmSettingType'; +import AlarmSettingBean from '../../common/bean/AlarmSettingBean'; +import DimensionUtil from '../../common/utils/DimensionUtil'; +import IntervalDialog from './dialog/IntervalDialog'; +import DurationDialog from './dialog/DurationDialog'; +import RenameDialog from './dialog/RenameDialog'; +import RepeatDialog from './dialog/RepeatDialog'; + +@Component +export default struct SettingItem { + @Link settingInfo: Array; + repeatDialogController: CustomDialogController = new CustomDialogController({ + builder: RepeatDialog(), + autoCancel: true + }); + reNameDialogController: CustomDialogController = new CustomDialogController({ + builder: RenameDialog(), + autoCancel: true + }); + durationDialogController: CustomDialogController = new CustomDialogController({ + builder: DurationDialog(), + autoCancel: true + }); + intervalDialogController: CustomDialogController = new CustomDialogController({ + builder: IntervalDialog(), + autoCancel: true + }); + + private showSettingDialog(sType: AlarmSettingType) { + switch (sType) { + case AlarmSettingType.REPEAT: + this.repeatDialogController.open(); + break; + case AlarmSettingType.ALARM_NAME: + this.reNameDialogController.open(); + break; + case AlarmSettingType.RING_DURATION: + this.durationDialogController.open(); + break; + case AlarmSettingType.INTERVAL: + this.intervalDialogController.open(); + break; + default: + break + } + } + + build() { + Column() { + ForEach(this.settingInfo, (item: AlarmSettingBean, index: number) => { + Divider() + .visibility(index === 0 ? Visibility.Hidden : Visibility.Visible) + .opacity($r('app.float.divider_opacity')) + .color($r('app.color.grey_divider')) + .lineCap(LineCapStyle.Round) + .margin({ + left: DimensionUtil.getVp($r('app.float.setting_item_divider_margin_horizon')), + right: DimensionUtil.getVp($r('app.float.setting_item_divider_margin_horizon')) + }) + Row() { + Text(item.title) + .fontSize(DimensionUtil.getFp($r('app.float.setting_item_name_font_size'))) + .fontWeight(FontWeight.Regular) + .fontColor($r('app.color.grey_divider')) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + Text(item.content) + .fontSize(DimensionUtil.getFp($r('app.float.setting_item_content_font_size'))) + .fontWeight(FontWeight.Normal) + .fontColor($r('app.color.grey_divider')) + .opacity($r('app.float.setting_item_content_font_opacity')) + Image($r('app.media.ic_right')) + .width(DimensionUtil.getVp($r('app.float.setting_item_image_width'))) + .height(DimensionUtil.getVp($r('app.float.setting_item_image_height'))) + .objectFit(ImageFit.Fill) + .margin({ + left: DimensionUtil.getVp($r('app.float.setting_item_image_margin_horizon')) + }) + } + .height(DimensionUtil.getVp($r('app.float.setting_item_height'))) + .alignItems(VerticalAlign.Center) + .padding({ + left: DimensionUtil.getVp($r('app.float.setting_item_interval')), + right: DimensionUtil.getVp($r('app.float.setting_item_interval')) + }) + .onClick(() => { + this.showSettingDialog(item.sType); + }) + }, (item, index) => JSON.stringify(item) + index) + } + .margin({ + bottom: DimensionUtil.getVp($r('app.float.setting_item_interval')), + left: DimensionUtil.getVp($r('app.float.setting_item_interval')), + right: DimensionUtil.getVp($r('app.float.setting_item_interval')) + }) + .borderRadius(DimensionUtil.getVp($r('app.float.setting_item_border_radius'))) + .backgroundColor(Color.White) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/CommonDialog.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/CommonDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..6061004fc5a338740f33ca8c274f6d418036b19f --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/CommonDialog.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../../common/constants/CommonConstants'; +import DimensionUtil from '../../../common/utils/DimensionUtil'; + +@Component +export default struct CommonDialog { + private title: string | Resource; + private controller: CustomDialogController; + private onConfirm: () => void; + @BuilderParam closer: () => void; + + build() { + Column() { + Text(this.title) + .fontSize(DimensionUtil.getFp($r('app.float.common_dialog_title_font_size'))) + .width(CommonConstants.FULL_LENGTH) + .fontColor($r('app.color.grey_divider')) + .margin({ + bottom: DimensionUtil.getVp($r('app.float.common_dialog_title_margin_vertical')) + }) + this.closer() + Row() { + Button($r('app.string.cancel')).actionBtnStyle().onClick(() => { + this.controller.close(); + }) + if (this.onConfirm) { + Button($r('app.string.confirm')).actionBtnStyle().onClick(() => { + this.onConfirm(); + this.controller.close(); + }) + } + } + .margin({ top: DimensionUtil.getVp($r('app.float.common_dialog_margin_vertical')) }) + } + .width(CommonConstants.FULL_LENGTH) + .padding(DimensionUtil.getVp($r('app.float.common_dialog_padding'))) + .justifyContent(FlexAlign.Center) + } +} + +@Extend(Button) function actionBtnStyle () { + .fontSize(DimensionUtil.getFp($r('app.float.common_dialog_button_font_size'))) + .height(DimensionUtil.getVp($r('app.float.common_dialog_button_height'))) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .fontColor($r('app.color.green_light')) + .backgroundColor($r('app.color.trans_parent')) +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/DurationDialog.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/DurationDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9c1d7c3ab763fbb599f3db4ae3058030aa9b901 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/DurationDialog.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../../common/constants/CommonConstants'; +import { DetailConstant } from '../../../common/constants/DetailConstant'; +import AlarmItem from '../../../common/bean/AlarmItemBean'; +import CommonDialog from './CommonDialog'; +import DimensionUtil from '../../../common/utils/DimensionUtil'; + +@CustomDialog +export default struct DurationDialog { + @Consume(DetailConstant.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem; + private durations: Array = DetailConstant.RING_DURATION; //响铃时长,分钟 + controller: CustomDialogController; + + build() { + Flex() { + CommonDialog({ + title: $r('app.string.ring_duration'), + controller: this.controller + }) { + ForEach(this.durations, item => { + Row() { + Text(item + CommonConstants.DEFAULT_STRING_SPACE + DetailConstant.DEFAULT_STRING_MINUTE) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .fontColor($r('app.color.grey_divider')) + .fontSize(DimensionUtil.getFp($r('app.float.duration_dialog_content_font_size'))) + Radio({ value: item, group: DetailConstant.DEFAULT_STRING_GROUP_NAME }) + .checked(item === this.alarmItem.duration ? true : false) + .height(DimensionUtil.getVp($r('app.float.duration_dialog_radio_size'))) + .width(DimensionUtil.getVp($r('app.float.duration_dialog_radio_size'))) + .onChange(() => { + this.controller.close(); + this.alarmItem.duration = item + }) + } + .width(CommonConstants.FULL_LENGTH) + + Divider() + .opacity($r('app.float.divider_opacity')) + .color($r('app.color.grey_divider')) + .lineCap(LineCapStyle.Round) + }) + } + } + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/IntervalDialog.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/IntervalDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..bad0e73e4d975bc965478ec98eb982b0bd6aca4a --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/IntervalDialog.ets @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../../common/constants/CommonConstants'; +import { DetailConstant } from '../../../common/constants/DetailConstant'; +import AlarmItem from '../../../common/bean/AlarmItemBean'; +import CommonDialog from './CommonDialog'; +import DimensionUtil from '../../../common/utils/DimensionUtil'; + +@CustomDialog +export default struct IntervalDialog { + @Consume(DetailConstant.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem; + @State intervalMinuteSelect: number = 0; + @State intervalTimesSelect: number = 0; + controller: CustomDialogController; + + aboutToAppear(): void{ + this.intervalMinuteSelect = this.alarmItem.intervalMinute; + this.intervalTimesSelect = this.alarmItem.intervalTimes; + } + + build() { + Flex() { + if ((this.intervalTimesSelect | this.intervalMinuteSelect) > 0) { + CommonDialog({ + title: $r('app.string.ring_interval'), + controller: this.controller, + onConfirm: () => { + this.alarmItem.intervalMinute = Number(this.intervalMinuteSelect.toFixed(0)) + this.alarmItem.intervalTimes = Number(this.intervalTimesSelect.toFixed(0)) + } + }) { + this.IntervalItem($r('app.string.ring_interval_content'), 0) + Divider() + .opacity($r('app.float.divider_opacity')) + .color($r('app.color.grey_divider')) + .lineCap(LineCapStyle.Round) + this.IntervalItem($r('app.string.ring_times_content'), CommonConstants.DEFAULT_SINGLE) + } + } + } + } + + @Builder IntervalItem(title: string | Resource, intervalType: number) { + Text(title) + .fontSize(DimensionUtil.getFp($r('app.float.interval_dialog_title_font_size'))) + .width(CommonConstants.FULL_LENGTH) + .textAlign(TextAlign.Start) + .margin({ + top: DimensionUtil.getVp($r('app.float.interval_dialog_title_margin_top')) + }) + Row() { + Slider({ + value: (intervalType === 0 ? this.intervalMinuteSelect : this.intervalTimesSelect), + min: (intervalType === 0 ? CommonConstants.DEFAULT_INTERVAL_STEP : 0), + max: (intervalType === 0 + ? CommonConstants.DEFAULT_INTERVAL_MINUTE_MAX + : CommonConstants.DEFAULT_INTERVAL_TIME_MAX), + step: (intervalType === 0 ? CommonConstants.DEFAULT_INTERVAL_STEP : CommonConstants.DEFAULT_DOUBLE), + style: SliderStyle.OutSet + }) + .blockColor(Color.Blue) + .trackColor(Color.Gray) + .selectedColor(Color.Blue) + .showSteps(true) + .showTips(false) + .onChange((value: number) => { + if (intervalType === 0) { + this.intervalMinuteSelect = value; + } else { + this.intervalTimesSelect = value; + } + }) + Text((intervalType === 0 ? this.intervalMinuteSelect : this.intervalTimesSelect).toFixed(0)) + .fontSize(DimensionUtil.getFp($r('app.float.interval_dialog_result_font_size'))) + } + .width(CommonConstants.FULL_LENGTH) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/RenameDialog.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/RenameDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..732e28790ddadc268b0a6e873efdbffa6d626fb7 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/RenameDialog.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../../common/constants/CommonConstants'; +import { DetailConstant } from '../../../common/constants/DetailConstant'; +import AlarmItem from '../../../common/bean/AlarmItemBean'; +import CommonDialog from './CommonDialog'; +import DimensionUtil from '../../../common/utils/DimensionUtil'; + +@CustomDialog +export default struct RenameDialog { + @Consume(DetailConstant.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem; + private name: string; + controller: CustomDialogController; + + build() { + Flex() { + CommonDialog({ + title: $r('app.string.alarm_name'), + controller: this.controller, + onConfirm: () => { + this.alarmItem.name = this.name; + } + }) { + TextArea({ text: this.alarmItem.name }) + .width(CommonConstants.FULL_LENGTH) + .margin({ bottom: DimensionUtil.getVp($r('app.float.rename_dialog_text_margin_bottom')) }) + .onChange((value: string) => { + this.name = value; + }) + Divider() + .opacity($r('app.float.divider_opacity')) + .color($r('app.color.grey_divider')) + .lineCap(LineCapStyle.Round) + } + } + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/RepeatDialog.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/RepeatDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..9879d3cbc1e2fa1c32ed4ccaaf76603727b2a7ac --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Detail/dialog/RepeatDialog.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../../common/constants/CommonConstants'; +import { DetailConstant } from '../../../common/constants/DetailConstant'; +import AlarmItem from '../../../common/bean/AlarmItemBean'; +import DetailModel from '../../../viewmodel/DetailViewModel'; +import CommonDialog from './CommonDialog'; +import DataTypeUtils from '../../../common/utils/DataTypeUtils'; +import DimensionUtil from '../../../common/utils/DimensionUtil'; + +@CustomDialog +export default struct RepeatDialog { + @Consume(DetailConstant.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem; + private viewModel: DetailModel = DetailModel.getInstant(); + private selects: number[] = []; + controller: CustomDialogController; + + aboutToAppear() { + this.selects = DataTypeUtils.deepCopy(this.alarmItem.repeatDays); + } + + build() { + Flex() { + CommonDialog({ + title: $r('app.string.repeat_name'), + controller: this.controller, + onConfirm: () => { + this.selects.sort(); + this.alarmItem.repeatDays = this.selects; + this.alarmItem.isRepeat = this.selects.length > 0; + } + }) { + ForEach(DetailConstant.WEEKDAY_DATA, (item) => { + Row() { + Text(this.viewModel.transAlarmRepeatDayContent(item)) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .fontColor($r('app.color.grey_divider')) + .fontSize(DimensionUtil.getFp($r('app.float.repeat_dialog_check_font_size'))) + + Checkbox({ name: item }) + .select(this.alarmItem.repeatDays.indexOf(item) !== CommonConstants.DEFAULT_NUMBER_NEGATIVE) + .width(DimensionUtil.getVp($r('app.float.repeat_dialog_check_box_size'))) + .height(DimensionUtil.getVp($r('app.float.repeat_dialog_check_box_size'))) + .onChange((value: boolean) => { + if (value) { + this.selects.push(item); + } else { + let index = this.selects.indexOf(item); + this.selects.splice(index, CommonConstants.DEFAULT_SINGLE); + } + }) + } + .width(CommonConstants.FULL_LENGTH) + + Divider() + .opacity($r('app.float.divider_opacity')) + .color($r('app.color.grey_divider')) + .lineCap(LineCapStyle.Round) + }) + } + } + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/AlarmList.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/AlarmList.ets new file mode 100644 index 0000000000000000000000000000000000000000..416d8ff19a2b8ddd75d52f45c066cf543df71a54 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/AlarmList.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022 Huawei Device 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 router from '@ohos.router'; +import { CommonConstants } from '../../common/constants/CommonConstants'; +import AlarmItem from '../../common/bean/AlarmItemBean'; +import AlarmListItem from '../Main/AlarmListItem'; +import DimensionUtil from '../../common/utils/DimensionUtil'; + +@Component +export default struct AlarmList { + @Link alarmItems: Array; + + build() { + List({ space: DimensionUtil.getVp($r('app.float.alarm_list_space')) }) { + ForEach(this.alarmItems, (item: AlarmItem) => { + ListItem() { + AlarmListItem({ alarmItem: item }) + }.onClick(() => { + router.pushUrl({ url: "pages/DetailIndex", params: { alarmItem: item } }); + }) + }, item => JSON.stringify(item)) + } + .padding({ + left: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')), + right: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')) + }) + .listDirection(Axis.Vertical) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .margin({ top: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')) }) + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/AlarmListItem.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/AlarmListItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..460ed043c95ea816373f9f4acf9529435b78d9a7 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/AlarmListItem.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 Huawei Device 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 MainModel from './../../viewmodel/MainViewModel'; +import { CommonConstants } from '../../common/constants/CommonConstants'; +import AlarmItem from '../../common/bean/AlarmItemBean'; +import DimensionUtil from '../../common/utils/DimensionUtil'; + +@Component +export default struct AlarmListItem { + private mainModel: MainModel = MainModel.getInstant(); + private alarmItem: AlarmItem; + + build() { + Row() { + Column() { + Row() { + Text(this.mainModel.getNoonContent(this.alarmItem.hour)) + .CommonTextAttr(DimensionUtil.getFp($r('app.float.alarms_item_noon_font_size')), + FontWeight.Regular) + Text(this.mainModel.getTaskTimeContent(this.alarmItem.hour, this.alarmItem.minute)) + .CommonTextAttr(DimensionUtil.getFp($r('app.float.alarms_item_time_font_size')), + FontWeight.Regular, + { left: DimensionUtil.getVp($r('app.float.alarms_item_time_margin_left')) }) + } + + Text(this.mainModel.getDescContent(this.alarmItem)) + .CommonTextAttr(DimensionUtil.getFp($r('app.float.alarms_item_dec_font_size')), + FontWeight.Normal, + { top: DimensionUtil.getVp($r('app.float.alarms_item_dec_margin_top')) }, + $r('app.float.alarms_item_desc_text_opacity')) + } + .width(CommonConstants.FULL_LENGTH) + .alignItems(HorizontalAlign.Start) + .layoutWeight(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + + Toggle({ type: ToggleType.Switch, isOn: this.alarmItem.isOpen }) + .onChange((isOn: boolean) => { + this.mainModel.openAlarm(this.alarmItem.id, isOn); + }) + .width(DimensionUtil.getVp($r('app.float.alarms_item_toggle_width'))) + .height(DimensionUtil.getVp($r('app.float.alarms_item_toggle_height'))) + } + .padding({ + left: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')), + right: DimensionUtil.getVp($r('app.float.alarm_list_content_distance')) + }) + .width(CommonConstants.FULL_LENGTH) + .height(DimensionUtil.getVp($r('app.float.alarms_item_height'))) + .backgroundColor(Color.White) + .borderRadius(DimensionUtil.getVp($r('app.float.alarms_item_radius'))) + } +} + +@Extend(Text) function CommonTextAttr (fontSize: number, fontWeight: number, margin?, opacity?) { + .fontColor($r('app.color.grey_divider')) + .fontSize(fontSize) + .fontWeight(fontWeight) + .margin(margin) + .opacity(opacity) +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/ClockArea.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/ClockArea.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3b0a7a1a8d3a114dd6f94ca0b5cd36c169b1d08 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/view/Main/ClockArea.ets @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstants'; +import MainModel from '../../viewmodel/MainViewModel'; +import { MainConstant } from '../../common/constants/MainConstant'; +import DimensionUtil from '../../common/utils/DimensionUtil'; + +@Component +export default struct ClockArea { + private mainModel: MainModel; + private drawInterval: any = CommonConstants.DEFAULT_NUMBER_NEGATIVE; + @State showClock: boolean = true; + private canvasSize: number; + private clockRadius: number; + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private renderContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + + aboutToAppear() { + this.mainModel = MainModel.getInstant(); + this.canvasSize = DimensionUtil.getVp($r('app.float.clock_size')); + this.clockRadius = this.canvasSize / CommonConstants.DEFAULT_DOUBLE - CommonConstants.DEFAULT_DOUBLE; + } + + aboutToDisappear() { + clearInterval(this.drawInterval); + } + + build() { + Canvas(this.renderContext) + .width(this.canvasSize) + .aspectRatio(CommonConstants.DEFAULT_LAYOUT_WEIGHT) + .onReady(() => { + if (this.drawInterval === CommonConstants.DEFAULT_NUMBER_NEGATIVE) { + this.startDrawTask(); + } + }) + .onClick(() => { + this.showClock = !this.showClock; + }) + } + + // 启动绘画任务 + private startDrawTask() { + let that = this; + that.renderContext.translate( + this.canvasSize / CommonConstants.DEFAULT_DOUBLE, + this.canvasSize / CommonConstants.DEFAULT_DOUBLE); + that.drawClockArea(); + this.drawInterval = setInterval(() => { + that.drawClockArea(); + }, MainConstant.DEFAULT_ONE_SECOND_MS); + } + + // 开始绘制时钟区域 + private drawClockArea(): void{ + this.renderContext.clearRect( + -this.canvasSize, + -this.canvasSize / CommonConstants.DEFAULT_DOUBLE, + this.canvasSize * CommonConstants.DEFAULT_DOUBLE, + this.canvasSize); + let date = new Date(); + let hours = date.getHours(); + let minutes = date.getMinutes(); + let seconds = date.getSeconds(); + if (this.showClock) { + this.drawPan(); + this.drawPointer( + CommonConstants.DEFAULT_INTERVAL_MINUTE_MAX * (hours > CommonConstants.DEFAULT_TOTAL_HOUR + ? hours - CommonConstants.DEFAULT_TOTAL_HOUR + : hours) + + minutes / CommonConstants.DEFAULT_TOTAL_HOUR * CommonConstants.DEFAULT_COMMON_DEGREE + , MainConstant.HOUR_POINTER_IMAGE_URL); + this.drawPointer(CommonConstants.DEFAULT_COMMON_DEGREE * minutes, MainConstant.MINUTE_POINTER_IMAGE_URL); + this.drawPointer(CommonConstants.DEFAULT_COMMON_DEGREE * seconds, MainConstant.SECOND_POINTER_IMAGE_URL); + } else { + this.drawTime(hours, minutes, seconds); + } + } + + // 绘制表盘 + private drawPan(): void{ + this.renderContext.beginPath(); + let secondImg = new ImageBitmap(MainConstant.CLOCK_PAN_IMAGE_URL); + let imgWidth = this.clockRadius * 2; + this.renderContext.drawImage(secondImg, -this.clockRadius, -this.clockRadius, imgWidth, imgWidth); + this.renderContext.restore(); + } + + // 绘制时针、分针、秒针 + private drawPointer(degree, pointerImgRes) { + this.renderContext.save(); + var theta = (degree + MainConstant.DEFAULT_HORIZONTAL_ANGLE) * Math.PI / MainConstant.DEFAULT_HORIZONTAL_ANGLE; + this.renderContext.rotate(theta); + this.renderContext.beginPath(); + let secondImg = new ImageBitmap(pointerImgRes); + let imgWidth = CommonConstants.DEFAULT_POINTER_WIDTH; + this.renderContext.drawImage( + secondImg, + -imgWidth / CommonConstants.DEFAULT_DOUBLE, + -this.clockRadius, + imgWidth, + this.clockRadius * CommonConstants.DEFAULT_DOUBLE); + this.renderContext.restore(); + } + + // 绘制完整时间回显 + private drawTime(hour: number, minute: number, second: number): void{ + let time = this.mainModel.fillZero(hour) + + MainConstant.DEFAULT_STRING_COLON + + this.mainModel.fillZero(minute) + + MainConstant.DEFAULT_STRING_COLON + + this.mainModel.fillZero(second); + this.renderContext.save(); + this.renderContext.font = DimensionUtil.getPx($r('app.float.clock_time_font_size')) + + MainConstant.CLOCK_TIME_FONT_SIZE_UNIT; + this.renderContext.beginPath(); + this.renderContext.textAlign = 'center'; + this.renderContext.fillText(time, 0, 0); + this.renderContext.restore(); + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/DetailViewModel.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/DetailViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fbf5cd42b39484b0d6dccfe34f95ddefe2ce89f --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/DetailViewModel.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { DetailConstant } from '../common/constants/DetailConstant'; +import { ALARM_KEY, CommonConstants } from '../common/constants/CommonConstants'; +import AlarmItem from '../common/bean/AlarmItemBean'; +import ReminderService from '../model/ReminderService'; +import DataTypeUtils from '../common/utils/DataTypeUtils'; + +/** + * Detail page view model description + */ +export default class DetailViewModel { + private static instant; + private reminderService: ReminderService; + private alarms: Array; + + private constructor() { + this.reminderService = new ReminderService(); + this.alarms = new Array(); + } + + /** + * Get DetailViewModel instance. + * + * @return instance + */ + public static getInstant() { + if (this.instant == null) { + this.instant = new DetailViewModel(); + } + return this.instant; + } + + /** + * Conversion alarm repeat day content + * + * @param repeatDay number + * @return repeatContent string + */ + public transAlarmRepeatDayContent(repeatDay: number): string{ + let repeatContent; + switch (repeatDay) { + case CommonConstants.DEFAULT_NUMBER_MONDAY: + repeatContent = CommonConstants.DEFAULT_STRING_MONDAY; + break; + case CommonConstants.DEFAULT_NUMBER_TUESDAY: + repeatContent = CommonConstants.DEFAULT_STRING_TUESDAY; + break; + case CommonConstants.DEFAULT_NUMBER_WEDNESDAY: + repeatContent = CommonConstants.DEFAULT_STRING_WEDNESDAY; + break; + case CommonConstants.DEFAULT_NUMBER_THURSDAY: + repeatContent = CommonConstants.DEFAULT_STRING_THURSDAY; + break; + case CommonConstants.DEFAULT_NUMBER_FRIDAY: + repeatContent = CommonConstants.DEFAULT_STRING_FRIDAY; + break; + case CommonConstants.DEFAULT_NUMBER_SATURDAY: + repeatContent = CommonConstants.DEFAULT_STRING_SATURDAY; + break; + case CommonConstants.DEFAULT_NUMBER_SUNDAY: + repeatContent = CommonConstants.DEFAULT_STRING_SUNDAY; + break; + default: + break; + } + return repeatContent; + } + + /** + * Set the initial time of the alarm. + * + * @param alarmItem AlarmItem + */ + public setAlarmDefaultTime(alarmItem?: AlarmItem) { + let hour; + let minute; + if (alarmItem == null) { + let date = new Date(); + hour = date.getHours(); + minute = date.getMinutes(); + } else { + hour = alarmItem.hour; + minute = alarmItem.minute; + } + DetailConstant.DAY_DATA[0].delSelect = (hour >= CommonConstants.DEFAULT_TOTAL_HOUR + ? CommonConstants.DEFAULT_SINGLE + : 0); + DetailConstant.DAY_DATA[CommonConstants.DEFAULT_SINGLE].delSelect = (hour === 0 + ? CommonConstants.DEFAULT_TOTAL_HOUR + : (hour > CommonConstants.DEFAULT_TOTAL_HOUR ? hour - CommonConstants.DEFAULT_TOTAL_HOUR : hour)) + - CommonConstants.DEFAULT_SINGLE; + DetailConstant.DAY_DATA[CommonConstants.DEFAULT_DATA_PICKER_HOUR_SELECTION].delSelect = + (minute === 0 ? CommonConstants.DEFAULT_TOTAL_MINUTE : minute) - CommonConstants.DEFAULT_SINGLE; + } + + /** + * Set the alarm remind. + * + * @param alarmItem AlarmItem + */ + public async setAlarmRemind(alarmItem: AlarmItem) { + alarmItem.hour = this.getAlarmTime(CommonConstants.DEFAULT_SINGLE); + alarmItem.minute = this.getAlarmTime(CommonConstants.DEFAULT_DATA_PICKER_HOUR_SELECTION); + let index = await this.findAlarmWithId(alarmItem.id); + if (index !== CommonConstants.DEFAULT_NUMBER_NEGATIVE) { // 已存在,删除原有提醒 + this.reminderService.deleteReminder(alarmItem.id); + } else { // 不存在,以数据长度为notificationId新增闹钟数据 + index = this.alarms.length; + alarmItem.notificationId = index; + this.alarms.push(alarmItem); + } + this.reminderService.addReminder(alarmItem, (newId) => { + alarmItem.id = newId; + alarmItem.isOpen = true; + this.alarms[index] = alarmItem; + globalThis.preference.set(ALARM_KEY, JSON.stringify(this.alarms)); + }) + } + + /** + * Remove the alarm remind. + * + * @param id number + */ + public async removeAlarmRemind(id: number) { + this.reminderService.deleteReminder(id); + let index = await this.findAlarmWithId(id); + if (index !== CommonConstants.DEFAULT_NUMBER_NEGATIVE) { + this.alarms.splice(index, CommonConstants.DEFAULT_SINGLE); + } + globalThis.preference.set(ALARM_KEY, JSON.stringify(this.alarms)); + } + + private getAlarmTime(aType: number): number{ + let times = DetailConstant.DAY_DATA[aType]; + let selectedIndex = times.delSelect; + let time = Number(times.data[selectedIndex]); + if (aType === CommonConstants.DEFAULT_SINGLE) { + time = (time === CommonConstants.DEFAULT_TOTAL_HOUR ? 0 : time) + + (DetailConstant.DAY_DATA[0].delSelect === CommonConstants.DEFAULT_SINGLE + ? CommonConstants.DEFAULT_TOTAL_HOUR + : 0); + } + return time; + } + + private async findAlarmWithId(id: number) { + let data = await globalThis.preference.get(ALARM_KEY); + if (!DataTypeUtils.isNull(data)) { + this.alarms = JSON.parse(data); + for (let i = 0;i < this.alarms.length; i++) { + if (this.alarms[i].id === id) { + return i; + } + } + } + return CommonConstants.DEFAULT_NUMBER_NEGATIVE; + } +} + diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..733e304e121f8c172c5a14d11729ba622a4be7ec --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2022 Huawei Device 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 { MainConstant } from '../common/constants/MainConstant'; +import ReminderService from '../model/ReminderService'; +import { ALARM_KEY, CommonConstants } from '../common/constants/CommonConstants'; +import AlarmItem from '../common/bean/AlarmItemBean'; +import DataTypeUtils from '../common/utils/DataTypeUtils'; + +/** + * Declare class of main view model. + */ +export default class MainViewModel { + private static instant; + private reminderService: ReminderService; + private alarms: Array; + private drawInterval: any = CommonConstants.DEFAULT_NUMBER_NEGATIVE; + private showClock: boolean = true; + + private constructor() { + this.alarms = new Array(); + this.reminderService = new ReminderService(); + this.reminderService.openNotificationPermission(); + } + + /** + * Get instant in MainViewModel. + */ + public static getInstant() { + if (this.instant == null) { + this.instant = new MainViewModel(); + } + return this.instant; + } + + /** + * Querying alarm task database tables. + * + * @param callback (alarms: Array) => void + */ + private queryDatabaseAlarms(callback: (alarms: Array) => void) { + globalThis.preference.get(ALARM_KEY).then((data) => { + if (!DataTypeUtils.isNull(data)) { + this.alarms = JSON.parse(data); + callback(this.alarms); + } + }) + } + + /** + * Refresh alarm task. + * + * @param callback (alarms: Array) => void + */ + public queryAlarmsTasker(callback: (alarms: Array) => void) { + let that = this; + that.queryDatabaseAlarms(callback); + globalThis.preference.addPreferencesListener({ + onDataChanged() { + that.queryDatabaseAlarms(callback); + } + }) + } + + /** + * Padding zeros for insufficient digits + * + * @param val number + * @return content string + */ + public fillZero(val: number): string{ + return (val > MainConstant.DEFAULT_SINGLE_DIGIT_MAX + ? val.toString() + : (MainConstant.DEFAULT_ZEROING + val)); + } + + /** + * Get noon content in MainViewModel. + * + * @param hour number + * @return content string + */ + public getNoonContent(hour: number): string{ + return (hour < CommonConstants.DEFAULT_TOTAL_HOUR + ? MainConstant.DEFAULT_STRING_MORNING + : MainConstant.DEFAULT_STRING_AFTERNOON); + } + + /** + * Get task time content in MainViewModel. + * + * @param hour number + * @param minute number + * @return content string + */ + public getTaskTimeContent(hour: number, minute: number): string { + return (this.fillZero(hour > CommonConstants.DEFAULT_TOTAL_HOUR ? hour - CommonConstants.DEFAULT_TOTAL_HOUR : hour) + + MainConstant.DEFAULT_STRING_COLON + + this.fillZero(minute)); + } + + /** + * Get description content in MainViewModel. + * + * @param alarmItem AlarmItem + * @return content string + */ + public getDescContent(alarmItem: AlarmItem): string{ + return (alarmItem.name + CommonConstants.DEFAULT_STRING_COMMA + + (alarmItem.isRepeat + ? this.getAlarmRepeatDayContent(alarmItem.repeatDays) + : CommonConstants.DEFAULT_STRING_NO_REPEAT)); + } + + /** + * Obtains the number of repetition days of an alarm task. + * + * @param repeatDays Array + * @return content string + */ + public getAlarmRepeatDayContent(repeatDays: Array): string{ + let content = MainConstant.DEFAULT_STRING_NULL; + for (var i = 0; i < repeatDays.length; i++) { + let repeatDay = repeatDays[i]; + let repeatContent; + switch (repeatDay) { + case CommonConstants.DEFAULT_NUMBER_MONDAY: + repeatContent = CommonConstants.DEFAULT_STRING_MONDAY; + break; + case CommonConstants.DEFAULT_NUMBER_TUESDAY: + repeatContent = CommonConstants.DEFAULT_STRING_TUESDAY; + break; + case CommonConstants.DEFAULT_NUMBER_WEDNESDAY: + repeatContent = CommonConstants.DEFAULT_STRING_WEDNESDAY; + break; + case CommonConstants.DEFAULT_NUMBER_THURSDAY: + repeatContent = CommonConstants.DEFAULT_STRING_THURSDAY; + break; + case CommonConstants.DEFAULT_NUMBER_FRIDAY: + repeatContent = CommonConstants.DEFAULT_STRING_FRIDAY; + break; + case CommonConstants.DEFAULT_NUMBER_SATURDAY: + repeatContent = CommonConstants.DEFAULT_STRING_SATURDAY; + break; + case CommonConstants.DEFAULT_NUMBER_SUNDAY: + repeatContent = CommonConstants.DEFAULT_STRING_SUNDAY; + break; + default: + break; + } + content += (repeatContent + CommonConstants.DEFAULT_STRING_SPACE); + } + return content; + } + + /** + * Enabling/Disabling alarms. + * + * @param id number + * @return isOpen boolean + */ + public openAlarm(id: number, isOpen: boolean) { + for (let i = 0; i < this.alarms.length; i++) { + if (this.alarms[i].id === id) { + this.alarms[i].isOpen = isOpen; + if (isOpen) { + this.reminderService.addReminder(this.alarms[i]); + } else { + this.reminderService.deleteReminder(this.alarms[i].id); + } + globalThis.preference.set(ALARM_KEY, JSON.stringify(this.alarms)); + break; + } + } + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/module.json5 b/CommonEventAndNotification/AlarmClock/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..38c9995fce4b992ee22a366cd1092b8b240f3082 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/module.json5 @@ -0,0 +1,42 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:entry_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:MainAbility_desc", + "icon": "$media:icon", + "label": "$string:MainAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:white", + "exported": true, + "orientation": "portrait", + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.PUBLISH_AGENT_REMINDER" + } + ] + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/color.json b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..90aa8c1a168703e5fcf54536837ab360dc96072a --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/color.json @@ -0,0 +1,36 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "grey_light", + "value": "#F1F3F5" + }, + { + "name": "grey_divider", + "value": "#182431" + }, + { + "name": "blue_light", + "value": "#007DFF" + }, + { + "name": "grey_with_opacity", + "value": "#0C182431" + }, + { + "name": "red_light", + "value": "#FA2A2D" + }, + { + "name": "trans_parent", + "value": "#00000000" + }, + { + "name": "green_light", + "value": "#17A98E" + } + ] +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/dimen.json b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/dimen.json new file mode 100644 index 0000000000000000000000000000000000000000..406dcfbf954b1f0a301bf2966487076a6ad01b39 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/dimen.json @@ -0,0 +1,228 @@ +{ + "float": [ + { + "name": "alarms_item_desc_text_opacity", + "value": "0.6" + }, + { + "name": "divider_opacity", + "value": "0.05" + }, + { + "name": "setting_item_content_font_opacity", + "value": "0.6" + }, + { + "name": "page_title_height", + "value": "56" + }, + { + "name": "content_margin_body", + "value": "16" + }, + { + "name": "title_horizon_margin", + "value": "24" + }, + { + "name": "title_font_size", + "value": "24" + }, + { + "name": "new_alarm_button_size", + "value": "48" + }, + { + "name": "new_alarm_button_margin_vertical", + "value": "24" + }, + { + "name": "title_button_size", + "value": "24" + }, + { + "name": "delete_button_width", + "value": "120" + }, + { + "name": "delete_button_height", + "value": "40" + }, + { + "name": "delete_button_font_size", + "value": "16" + }, + { + "name": "delete_button_radius", + "value": "20" + }, + { + "name": "delete_button_margin_bottom", + "value": "24" + }, + { + "name": "alarm_list_space", + "value": "12" + }, + { + "name": "alarm_list_content_distance", + "value": "12" + }, + { + "name": "alarms_item_noon_font_size", + "value": "16" + }, + { + "name": "alarms_item_time_font_size", + "value": "24" + }, + { + "name": "alarms_item_time_margin_left", + "value": "4" + }, + { + "name": "alarms_item_dec_font_size", + "value": "14" + }, + { + "name": "alarms_item_dec_margin_top", + "value": "2" + }, + { + "name": "alarms_item_toggle_width", + "value": "36" + }, + { + "name": "alarms_item_toggle_height", + "value": "20" + }, + { + "name": "alarms_item_height", + "value": "72" + }, + { + "name": "alarms_item_radius", + "value": "24" + }, + { + "name": "clock_size", + "value": "252" + }, + { + "name": "clock_time_font_size", + "value": "60" + }, + { + "name": "detail_title_font_size", + "value": "20" + }, + { + "name": "title_line_height", + "value": "28" + }, + { + "name": "title_margin", + "value": "16" + }, + { + "name": "common_dialog_title_font_size", + "value": "20" + }, + { + "name": "common_dialog_title_margin_vertical", + "value": "12" + }, + { + "name": "common_dialog_margin_vertical", + "value": "12" + }, + { + "name": "common_dialog_padding", + "value": "24" + }, + { + "name": "common_dialog_button_font_size", + "value": "15" + }, + { + "name": "common_dialog_button_height", + "value": "40" + }, + { + "name": "duration_dialog_content_font_size", + "value": "14" + }, + { + "name": "duration_dialog_radio_size", + "value": "20" + }, + { + "name": "interval_dialog_title_font_size", + "value": "10" + }, + { + "name": "interval_dialog_title_margin_top", + "value": "10" + }, + { + "name": "interval_dialog_result_font_size", + "value": "16" + }, + { + "name": "rename_dialog_text_margin_bottom", + "value": "20" + }, + { + "name": "repeat_dialog_check_font_size", + "value": "14" + }, + { + "name": "repeat_dialog_check_box_size", + "value": "20" + }, + { + "name": "date_picker_height", + "value": "200" + }, + { + "name": "date_picker_padding_horizon", + "value": "24" + }, + { + "name": "setting_item_divider_margin_horizon", + "value": "12" + }, + { + "name": "setting_item_name_font_size", + "value": "16" + }, + { + "name": "setting_item_content_font_size", + "value": "14" + }, + { + "name": "setting_item_image_width", + "value": "6.7" + }, + { + "name": "setting_item_image_height", + "value": "12.8" + }, + { + "name": "setting_item_image_margin_horizon", + "value": "7" + }, + { + "name": "setting_item_height", + "value": "56" + }, + { + "name": "setting_item_interval", + "value": "12" + }, + { + "name": "setting_item_border_radius", + "value": "24" + } + ] +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/string.json b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b3d9b333286ae69cd8a2b2e194efb9935d21b0b5 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "AlarmClock" + }, + { + "name": "confirm", + "value": "确定" + }, + { + "name": "cancel", + "value": "取消" + }, + { + "name": "ring_duration", + "value": "闹铃时长" + }, + { + "name": "ring_interval", + "value": "再响间隔" + }, + { + "name": "ring_interval_content", + "value": "响铃间隔时间(分钟)" + }, + { + "name": "ring_times_content", + "value": "重复响铃次数" + }, + { + "name": "alarm_name", + "value": "闹钟名" + }, + { + "name": "repeat_name", + "value": "重复" + }, + { + "name": "new_alarm", + "value": "新建闹钟" + }, + { + "name": "update_alarm", + "value": "修改闹钟" + }, + { + "name": "delete", + "value": "删除" + }, + { + "name": "main_page_title_font_family", + "value": "HarmonyHeiTi-Bold" + } + ] +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_add.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_add.png new file mode 100644 index 0000000000000000000000000000000000000000..53968d7c9da7182d73a2e8d3c7c3c9a3cca83b63 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_add.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_cancel.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_cancel.png new file mode 100644 index 0000000000000000000000000000000000000000..c0bece832d3b81d53ac6993e974c0296e73bad8f Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_cancel.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_clock_pan.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_clock_pan.png new file mode 100644 index 0000000000000000000000000000000000000000..ea0d3f082b3c160bd326048acf9ec79bdb9ac221 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_clock_pan.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_confirm.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_confirm.png new file mode 100644 index 0000000000000000000000000000000000000000..5d790967e67818c6fbd09788f80149a368cb98b8 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_confirm.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_hour_pointer.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_hour_pointer.png new file mode 100644 index 0000000000000000000000000000000000000000..18d556e197631be29574bd413332ddf6d5b22929 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_hour_pointer.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_minute_pointer.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_minute_pointer.png new file mode 100644 index 0000000000000000000000000000000000000000..60cd4375a30e955ad631316e963bc8ac794405ef Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_minute_pointer.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_public_back.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_public_back.png new file mode 100644 index 0000000000000000000000000000000000000000..d3a807db149dd77830017e15eb9a499e8948be25 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_public_back.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_right.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_right.png new file mode 100644 index 0000000000000000000000000000000000000000..f95236854b0e477956269cfe9fecb661e82c6c66 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_right.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_second_pointer.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_second_pointer.png new file mode 100644 index 0000000000000000000000000000000000000000..0f3d604e988165e4bf9fd5d5e42984430389977e Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/ic_second_pointer.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/icon.png b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/media/icon.png differ diff --git a/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/profile/main_pages.json b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..2ec1d513234bfb8bc4257e908322c70d4c95cf5d --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/MainIndex", + "pages/DetailIndex" + ] +} diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550422610.gif b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550422610.gif new file mode 100644 index 0000000000000000000000000000000000000000..1881ca76ae2ef1b741198e72348107fd745f6032 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550422610.gif differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550583498.gif b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550583498.gif new file mode 100644 index 0000000000000000000000000000000000000000..4ddb1cea2fed4ef78a6183a67f73095d29a1f482 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550583498.gif differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550584842.gif b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550584842.gif new file mode 100644 index 0000000000000000000000000000000000000000..cb038d4434d550ec9ebe396f26126e2e338aecf8 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550584842.gif differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550903682.png b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550903682.png new file mode 100644 index 0000000000000000000000000000000000000000..d4b3af1c5ecb32bd15d0e7a1fa75a36647ffd3ca Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001550903682.png differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001569303293.png b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001569303293.png differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601208789.gif b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601208789.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601208789.gif differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601625241.png b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601625241.png new file mode 100644 index 0000000000000000000000000000000000000000..0d1894736c4b8a5dab9468c7c2b851350499e4a1 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601625241.png differ diff --git a/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601778449.gif b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601778449.gif new file mode 100644 index 0000000000000000000000000000000000000000..02835fefc3c764c0600d34a94aa59b651e946bbe Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/figures/zh-cn_image_0000001601778449.gif differ diff --git a/CommonEventAndNotification/AlarmClock/hvigor/hvigor-config.json5 b/CommonEventAndNotification/AlarmClock/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/hvigor/hvigor-wrapper.js b/CommonEventAndNotification/AlarmClock/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/hvigorfile.ts b/CommonEventAndNotification/AlarmClock/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/CommonEventAndNotification/AlarmClock/oh-package.json5 b/CommonEventAndNotification/AlarmClock/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ea156f31623ef6883105fe0ddbc9e58878100c0b --- /dev/null +++ b/CommonEventAndNotification/AlarmClock/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "license": "ISC", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "name": "AlarmClockETS", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-caution.gif b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-caution.gif differ diff --git a/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-danger.gif b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-danger.gif differ diff --git a/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-note.gif b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-note.gif differ diff --git a/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-notice.gif b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-notice.gif differ diff --git a/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-tip.gif b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-tip.gif differ diff --git a/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-warning.gif b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/CommonEventAndNotification/AlarmClock/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/CanvasComponent/AppScope/app.json5 b/ETSUI/CanvasComponent/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d972bf2eec7993cbe37b08e3253cb7b8bd42bda8 --- /dev/null +++ b/ETSUI/CanvasComponent/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.canvascomponent", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/CanvasComponent/AppScope/resources/base/element/string.json b/ETSUI/CanvasComponent/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0ca39f64c1477ae3f9475ed461708e0abe232390 --- /dev/null +++ b/ETSUI/CanvasComponent/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "CanvasComponent" + } + ] +} diff --git a/ETSUI/CanvasComponent/AppScope/resources/base/media/app_icon.png b/ETSUI/CanvasComponent/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/CanvasComponent/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/CanvasComponent/LICENSE b/ETSUI/CanvasComponent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/CanvasComponent/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/CanvasComponent/README.md b/ETSUI/CanvasComponent/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8f3eb02dc417e4cd48326642171e5bb27bf20ffa --- /dev/null +++ b/ETSUI/CanvasComponent/README.md @@ -0,0 +1,455 @@ +# 自定义抽奖转盘(ArkTS) + +## 介绍 + +本篇Codelab是基于画布组件、显式动画,实现的一个自定义抽奖圆形转盘。包含如下功能: + +1. 通过画布组件Canvas,画出抽奖圆形转盘。 +2. 通过显式动画启动抽奖功能。 +3. 通过自定义弹窗弹出抽中的奖品。 + +![](figures/zh-cn_image_0000001563941329.gif) + +### 相关概念 + +- [Stack组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-stack.md):堆叠容器,子组件按照顺序依次入栈,后一个子组件覆盖前一个子组件。 +- [Canvas](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvas.md):画布组件,用于自定义绘制图形。 +- [CanvasRenderingContext2D对象](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md):使用RenderingContext在Canvas组件上进行绘制,绘制对象可以是矩形、文本、图片等。 +- [显式动画](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md):提供全局animateTo显式动画接口来指定由于闭包代码导致的状态变化插入过渡动效。 +- [自定义弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md): 通过CustomDialogController类显示自定义弹窗。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001554588725.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──FillArcData.ets // 绘制圆弧数据实体类 +│ │ │ └──PrizeData.ets // 中奖信息实体类 +│ │ ├──constants +│ │ │ ├──ColorConstants.ets // 颜色常量类 +│ │ │ ├──CommonConstants.ets // 公共常量类 +│ │ │ └──StyleConstants.ets // 样式常量类 +│ │ └──utils +│ │ ├──CheckEmptyUtils.ets // 数据判空工具类 +│ │ └──Logger.ets // 日志打印类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ └──CanvasPage.ets // 主界面 +│ ├──view +│ │ └──PrizeDialog.ets // 中奖信息弹窗类 +│ └──viewmodel +│ └──DrawModel.ets // 画布相关方法类 +└──entry/src/main/resources // 资源文件目录 +``` + +## 构建主界面 + +在这个章节中,我们将完成示例主界面的开发,效果如图所示: + +![](figures/zh-cn_other_0000001563981425.jpeg) + +在绘制抽奖圆形转盘前,首先需要在CanvasPage.ets的aboutToAppear()方法中获取屏幕的宽高。 + +```typescript +// CanvasPage.ets +// 获取context +let context = getContext(this); + +aboutToAppear() { + // 获取屏幕的宽高 + window.getLastWindow(context) + .then((windowClass) => { + let windowProperties = windowClass.getWindowProperties(); + this.screenWidth = px2vp(windowProperties.windowRect.width); + this.screenHeight = px2vp(windowProperties.windowRect.height); + }) + .catch((error) => { + Logger.error('Failed to obtain the window size. Cause: ' + JSON.stringify(error)); + }) +} +``` + +在CanvasPage.ets布局界面中添加Canvas组件,在onReady()方法中进行绘制。 + +```typescript +// CanvasPage.ets +private settings: RenderingContextSettings = new RenderingContextSettings(true); +private canvasContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + +Stack({ alignContent: Alignment.Center }) { + Canvas(this.canvasContext) + ... + .onReady(() => { + // 通过draw方法进行绘制 + this.drawModel.draw(this.canvasContext, this.screenWidth, this.screenHeight); + }) + + // 开始抽奖图片 + Image($r('app.media.ic_center')) + ... +} +... +``` + +在DrawModel.ets中,通过draw()方法逐步进行自定义圆形抽奖转盘的绘制。 + +```typescript +// DrawModel.ets +// 画抽奖圆形转盘 +draw(canvasContext: CanvasRenderingContext2D, screenWidth: number, screenHeight: number) { + if (CheckEmptyUtils.isEmptyObj(canvasContext)) { + Logger.error('[DrawModel][draw] canvasContext is empty.'); + return; + } + this.canvasContext= canvasContext; + this.screenWidth = screenWidth; + this.canvasContext.clearRect(0, 0, this.screenWidth, screenHeight); + // 将画布沿X、Y轴平移指定距离 + this.canvasContext.translate(this.screenWidth / CommonConstants.TWO, + screenHeight / CommonConstants.TWO); + // 画外部圆盘的花瓣 + this.drawFlower(); + // 画外部圆盘、小圈圈 + this.drawOutCircle(); + // 画内部圆盘 + this.drawInnerCircle(); + // 画内部扇形抽奖区域 + this.drawInnerArc(); + // 画内部扇形区域文字 + this.drawArcText(); + // 画内部扇形区域奖品对应的图片 + this.drawImage(); + this.canvasContext.translate(-this.screenWidth / CommonConstants.TWO, + -screenHeight / CommonConstants.TWO); +} +``` + +## 画外部圆盘 + +画外部圆盘的花瓣:通过调用rotate\(\)方法,将画布旋转指定角度。再通过调用save\(\)和restore\(\)方法,使画布保存最新的绘制状态。根据想要绘制的花瓣个数,改变旋转角度,循环画出花瓣效果。 + +```typescript +// DrawModel.ets +// 画外部圆盘的花瓣 +drawFlower() { + let beginAngle = this.startAngle + this.avgAngle; + const pointY = this.screenWidth * CommonConstants.FLOWER_POINT_Y_RATIOS; + const radius = this.screenWidth * CommonConstants.FLOWER_RADIUS_RATIOS; + const innerRadius = this.screenWidth * CommonConstants.FLOWER_INNER_RATIOS; + for (let i = 0; i < CommonConstants.COUNT; i++) { + this.canvasContext.save(); + this.canvasContext.rotate(beginAngle * Math.PI / CommonConstants.HALF_CIRCLE); + this.fillArc(new FillArcData(0, -pointY, radius, 0, Math.PI * CommonConstants.TWO), + ColorConstants.FLOWER_OUT_COLOR); + + this.fillArc(new FillArcData(0, -pointY, innerRadius, 0, Math.PI * CommonConstants.TWO), + ColorConstants.FLOWER_INNER_COLOR); + beginAngle += this.avgAngle; + this.canvasContext.restore(); + } +} + +// 画弧线方法 +fillArc(fillArcData: FillArcData, fillColor: string) { + if (CheckEmptyUtils.isEmptyObj(fillArcData) || CheckEmptyUtils.isEmptyStr(fillColor)) { + Logger.error('[DrawModel][fillArc] fillArcData or fillColor is empty.'); + return; + } + this.canvasContext.beginPath(); + this.canvasContext.fillStyle = fillColor; + this.canvasContext.arc(fillArcData.x, fillArcData.y, fillArcData.radius, + fillArcData.startAngle, fillArcData.endAngle); + this.canvasContext.fill(); +} +``` + +画外部圆盘、圆盘边上的小圈圈:在指定的X、Y(0, 0)坐标处,画一个半径为this.screenWidth \* CommonConstants.OUT\_CIRCLE\_RATIOS的圆形。接下来通过一个for循环,且角度每次递增CommonConstants.CIRCLE / CommonConstants.SMALL\_CIRCLE\_COUNT,来绘制圆环上的小圈圈。 + +```typescript +// DrawModel.ets +drawOutCircle() { + // 画外部圆盘 + this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.OUT_CIRCLE_RATIOS, 0, + Math.PI * CommonConstants.TWO), ColorConstants.OUT_CIRCLE_COLOR); + + let beginAngle = this.startAngle; + // 画小圆圈 + for (let i = 0; i < CommonConstants.SMALL_CIRCLE_COUNT; i++) { + this.canvasContext.save(); + this.canvasContext.rotate(beginAngle * Math.PI / CommonConstants.HALF_CIRCLE); + this.fillArc(new FillArcData(this.screenWidth * CommonConstants.SMALL_CIRCLE_RATIOS, 0, + CommonConstants.SMALL_CIRCLE_RADIUS, 0, Math.PI * CommonConstants.TWO), + ColorConstants.WHITE_COLOR); + beginAngle = beginAngle + CommonConstants.CIRCLE / CommonConstants.SMALL_CIRCLE_COUNT; + this.canvasContext.restore(); + } +} +``` + +## 画内部扇形抽奖区域 + +画内部圆盘、内部扇形抽奖区域:使用fillArc()方法绘制内部圆盘。通过一个for循环,角度每次递增this.avgAngle。然后不断更改弧线的起始弧度this.startAngle \* Math.PI / CommonConstants.HALF\_CIRCLE和弧线的终止弧度\(this.startAngle + this.avgAngle\) \* Math.PI / CommonConstants.HALF\_CIRCLE。最后用fill\(\)方法对路径进行填充。 + +```typescript +// DrawModel.ets +// 画内部圆盘 +drawInnerCircle() { + this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_CIRCLE_RATIOS, 0, + Math.PI * CommonConstants.TWO), ColorConstants.INNER_CIRCLE_COLOR); + this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_WHITE_CIRCLE_RATIOS, 0, + Math.PI * CommonConstants.TWO), ColorConstants.WHITE_COLOR); +} + +// 画内部扇形抽奖区域 +drawInnerArc() { + // 颜色集合 + let colors = [ + ColorConstants.ARC_PINK_COLOR, ColorConstants.ARC_YELLOW_COLOR, + ColorConstants.ARC_GREEN_COLOR, ColorConstants.ARC_PINK_COLOR, + ColorConstants.ARC_YELLOW_COLOR, ColorConstants.ARC_GREEN_COLOR + ]; + let radius = this.screenWidth * CommonConstants.INNER_ARC_RATIOS; + for (let i = 0; i < CommonConstants.COUNT; i++) { + this.fillArc(new FillArcData(0, 0, radius, this.startAngle * Math.PI / CommonConstants.HALF_CIRCLE, + (this.startAngle + this.avgAngle) * Math.PI / CommonConstants.HALF_CIRCLE), colors[i]); + this.canvasContext.lineTo(0, 0); + this.canvasContext.fill(); + this.startAngle += this.avgAngle; + } +} +``` + +画内部抽奖区域文字:用for循环,通过drawCircularText\(\)方法绘制每组文字。drawCircularText\(\)方法接收三个参数,分别是字符串,起始弧度和终止弧度。绘制文本前需要设置每个字母占的弧度angleDecrement,然后设置水平和垂直的偏移量。垂直偏移量circleText.y - Math.sin\(angle\) \* radius就是朝着圆心移动的距离;水平偏移circleText.x + Math.cos\(angle\) \* radius,是为了让文字在当前弧范围文字居中。最后使用fillText()方法绘制文本。 + +```typescript +// DrawModel.ets +// 画内部扇形区域文字 +drawArcText() { + this.canvasContext.textAlign = CommonConstants.TEXT_ALIGN; + this.canvasContext.textBaseline = CommonConstants.TEXT_BASE_LINE; + this.canvasContext.fillStyle = ColorConstants.TEXT_COLOR; + this.canvasContext.font = StyleConstants.ARC_TEXT_SIZE + CommonConstants.CANVAS_FONT; + // 需要绘制的文本数组集合 + let textArrays = [ + $r('app.string.text_smile'), + $r('app.string.text_hamburger'), + $r('app.string.text_cake'), + $r('app.string.text_smile'), + $r('app.string.text_beer'), + $r('app.string.text_watermelon') + ]; + let arcTextStartAngle = CommonConstants.ARC_START_ANGLE; + let arcTextEndAngle = CommonConstants.ARC_END_ANGLE; + for (let i = 0; i < CommonConstants.COUNT; i++) { + this.drawCircularText(this.getResourceString(textArrays[i]), + (this.startAngle + arcTextStartAngle) * Math.PI / CommonConstants.HALF_CIRCLE, + (this.startAngle + arcTextEndAngle) * Math.PI / CommonConstants.HALF_CIRCLE); + this.startAngle += this.avgAngle; + } +} + +// 绘制圆弧文本 +drawCircularText(textString: string, startAngle: number, endAngle: number) { + if (CheckEmptyUtils.isEmptyStr(textString)) { + Logger.error('[DrawModel][drawCircularText] textString is empty.'); + return; + } + let circleText = { + x: 0, + y: 0, + radius: this.screenWidth * CommonConstants.INNER_ARC_RATIOS + }; + // 圆的半径 + let radius = circleText.radius - circleText.radius / CommonConstants.COUNT; + // 每个字母占的弧度 + let angleDecrement = (startAngle - endAngle) / (textString.length - 1); + let angle = startAngle; + let index = 0; + let character; + + while (index < textString.length) { + character = textString.charAt(index); + this.canvasContext.save(); + this.canvasContext.beginPath(); + this.canvasContext.translate(circleText.x + Math.cos(angle) * radius, + circleText.y - Math.sin(angle) * radius); + this.canvasContext.rotate(Math.PI / CommonConstants.TWO - angle); + this.canvasContext.fillText(character, 0, 0); + angle -= angleDecrement; + index++; + this.canvasContext.restore(); + } +} +``` + +画内部抽奖区域文字对应图片:使用drawImage()方法绘制抽奖区域文字对应图片,该方法接收五个参数,分别是图片资源、绘制区域左上角的X和Y轴坐标、绘制区域的宽度和高度。 + +```typescript +// DrawModel.ets +// 画内部扇形区域文字对应的图片 +drawImage() { + let beginAngle = this.startAngle; + let imageSrc = [ + CommonConstants.WATERMELON_IMAGE_URL, CommonConstants.BEER_IMAGE_URL, + CommonConstants.SMILE_IMAGE_URL, CommonConstants.CAKE_IMAGE_URL, + CommonConstants.HAMBURG_IMAGE_URL, CommonConstants.SMILE_IMAGE_URL + ]; + for (let i = 0; i < CommonConstants.COUNT; i++) { + let image = new ImageBitmap(imageSrc[i]); + this.canvasContext.save(); + this.canvasContext.rotate(beginAngle * Math.PI / CommonConstants.HALF_CIRCLE); + this.canvasContext.drawImage(image, this.screenWidth * CommonConstants.IMAGE_DX_RATIOS, + this.screenWidth * CommonConstants.IMAGE_DY_RATIOS, CommonConstants.IMAGE_SIZE, + CommonConstants.IMAGE_SIZE); + beginAngle += this.avgAngle; + this.canvasContext.restore(); + } +} +``` + +## 实现抽奖功能 + +在CanvasPage.ets的Canvas组件中添加rotate属性,在Image组件中添加点击事件onClick。点击“开始抽奖”图片,圆形转盘开始转动抽奖。 + +```typescript +// CanvasPage.ets +Stack({ alignContent: Alignment.Center }) { + Canvas(this.canvasContext) + ... + .onReady(() => { + this.drawModel.draw(this.canvasContext, this.screenWidth, this.screenHeight); + }) + .rotate({ + x: 0, + y: 0, + z: 1, + angle: this.rotateDegree, + centerX: this.screenWidth / CommonConstants.TWO, + centerY: this.screenHeight / CommonConstants.TWO + }) + + // 开始抽奖图片 + Image($r('app.media.ic_center')) + ... + .enabled(this.enableFlag) + .onClick(() => { + this.enableFlag = !this.enableFlag; + // 开始抽奖 + startAnimator.call(this); + }) +} +... +``` + +圆形转盘开始转动抽奖:给转盘指定一个随机的转动角度randomAngle,保证每次转动的角度是随机的,即每次抽到的奖品也是随机的。动画结束后,转盘停止转动,抽奖结束,弹出抽中的奖品信息。 + +```typescript +// CanvasPage.ets +dialogController: CustomDialogController = new CustomDialogController({ + builder: PrizeDialog({ + prizeData: $prizeData, + enableFlag: $enableFlag + }), + autoCancel: false +}); + +// DrawModel.ets +// 开始抽奖 +startAnimator() { + let randomAngle = Math.round(Math.random() * CommonConstants.CIRCLE); + // 获取中奖信息 + this.prizeData = this.drawModel.showPrizeData(randomAngle); + + animateTo({ + duration: CommonConstants.DURATION, + curve: Curve.Ease, + delay: 0, + iterations: 1, + playMode: PlayMode.Normal, + onFinish: () => { + this.rotateDegree = CommonConstants.ANGLE - randomAngle; + // 打开自定义弹窗,弹出抽奖信息 + this.dialogController.open(); + } + }, () => { + this.rotateDegree = CommonConstants.CIRCLE * CommonConstants.FIVE + + CommonConstants.ANGLE - randomAngle; + }) +} +``` + +弹出抽中的奖品信息:抽奖结束后,弹出抽中的文本和图片信息,通过自定义弹窗实现。 + +```typescript +// PrizeDialog.ets +@CustomDialog +export default struct PrizeDialog { + @Link prizeData: PrizeData; + @Link enableFlag: boolean; + private controller: CustomDialogController; + + build() { + Column() { + Image(this.prizeData.imageSrc) + ... + + Text(this.prizeData.message) + ... + + Text($r('app.string.text_confirm')) + ... + .onClick(() => { + // 关闭自定义弹窗 + this.controller.close(); + this.enableFlag = !this.enableFlag; + }) + } + ... + } +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用画布组件Canvas,画出抽奖圆形转盘。 +2. 使用显式动画启动抽奖功能。 +3. 使用自定义弹窗弹出抽中的奖品。 + +![](figures/zh-cn_image_0000001509916136.gif) \ No newline at end of file diff --git a/ETSUI/CanvasComponent/build-profile.json5 b/ETSUI/CanvasComponent/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/CanvasComponent/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/build-profile.json5 b/ETSUI/CanvasComponent/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/hvigorfile.ts b/ETSUI/CanvasComponent/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/CanvasComponent/entry/oh-package.json5 b/ETSUI/CanvasComponent/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/bean/FillArcData.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/bean/FillArcData.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8dce43c2d2a416afbbb6f9ed4555c8799901e44 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/bean/FillArcData.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Fill arc data. + */ +export default class FillArcData { + /** + * The x-axis coordinate of the center of the arc. + */ + x: number; + + /** + * The y-axis coordinate of the center of the arc. + */ + y: number; + + /** + * Radius of the arc. + */ + radius: number; + + /** + * The start point of the arc, in radians. + */ + startAngle: number; + + /** + * The end point of the arc, in radians. + */ + endAngle: number; + + /** + * The constructor of FillArcData. + * + * @param x The x-axis coordinate of the center of the arc. + * @param y The y-axis coordinate of the center of the arc. + * @param radius Radius of the arc. + * @param startAngle The start point of the arc, in radians. + * @param endAngle The end point of the arc, in radians. + * @param fillColor The fill color of the arc. + */ + constructor(x: number, y: number, radius: number, startAngle: number, endAngle: number) { + this.x = x; + this.y = y; + this.radius = radius; + this.startAngle = startAngle; + this.endAngle = endAngle; + } +} diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/bean/PrizeData.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/bean/PrizeData.ets new file mode 100644 index 0000000000000000000000000000000000000000..7b8253dd32b804c48f86de5d6f75d47a67bc79b7 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/bean/PrizeData.ets @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Prize data. + */ +export default class PrizeData { + /** + * The prize message. + */ + message: Resource; + + /** + * Image src. + */ + imageSrc: string; +} diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/ColorConstants.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/ColorConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..93bdd5f129cb8ca9f8358cd51f17d6cfea32817b --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/ColorConstants.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Color constants for all Component. + */ +export default class ColorConstants { + /** + * Flower out color. + */ + static readonly FLOWER_OUT_COLOR: string = '#ED6E21'; + + /** + * Flower inner color. + */ + static readonly FLOWER_INNER_COLOR: string = '#F8A01E'; + + /** + * Out circle color. + */ + static readonly OUT_CIRCLE_COLOR: string = '#F7CD03'; + + /** + * White_color. + */ + static readonly WHITE_COLOR: string = '#FFFFFF'; + + /** + * Inner circle color. + */ + static readonly INNER_CIRCLE_COLOR: string = '#F8A01E'; + + /** + * Arc pink color. + */ + static readonly ARC_PINK_COLOR: string = '#FFC6BD'; + + /** + * Arc yellow color. + */ + static readonly ARC_YELLOW_COLOR: string = '#FFEC90'; + + /** + * Arc green color. + */ + static readonly ARC_GREEN_COLOR: string = '#ECF9C7' + + /** + * Text color. + */ + static readonly TEXT_COLOR: string = '#ED6E21'; +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..b47fcf5f62eac23cb6f7e1e97602b02c5ff3d839 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Common constants for all features. + */ +export default class CommonConstants { + /** + * Watermelon image url. + */ + static readonly WATERMELON_IMAGE_URL: string = '../../../resources/base/media/ic_watermelon.png'; + + /** + * Hamburg image url. + */ + static readonly HAMBURG_IMAGE_URL: string = '../../../resources/base/media/ic_hamburg.png'; + + /** + * Cake image url. + */ + static readonly CAKE_IMAGE_URL: string = '../../../resources/base/media/ic_cake.png'; + + /** + * Beer image url. + */ + static readonly BEER_IMAGE_URL: string = '../../../resources/base/media/ic_beer.png'; + + /** + * Smile image url. + */ + static readonly SMILE_IMAGE_URL: string = '../../../resources/base/media/ic_smile.png'; + + /** + * Transform angle. + */ + static readonly TRANSFORM_ANGLE: number = -120; + + /** + * 360 degrees. + */ + static readonly CIRCLE: number = 360; + + /** + * 180 degrees. + */ + static readonly HALF_CIRCLE: number = 180; + + /** + * count. + */ + static readonly COUNT: number = 6; + + /** + * Small circle count. + */ + static readonly SMALL_CIRCLE_COUNT: number = 8; + + /** + * Image size. + */ + static readonly IMAGE_SIZE: number = 40; + + /** + * Prize angle. + */ + static readonly ANGLE: number = 270; + + /** + * duration. + */ + static readonly DURATION: number = 4000; + + /** + * One. + */ + static readonly ONE: number = 1; + + /** + * Two. + */ + static readonly TWO: number = 2; + + /** + * Three. + */ + static readonly THREE: number = 3; + + /** + * Four. + */ + static readonly FOUR: number = 4; + + /** + * Five. + */ + static readonly FIVE: number = 5; + + /** + * Six. + */ + static readonly SIX: number = 6; + + /** + * Flower point y ratios. + */ + static readonly FLOWER_POINT_Y_RATIOS: number = 0.255; + + /** + * Flower radius ratios. + */ + static readonly FLOWER_RADIUS_RATIOS: number = 0.217; + + /** + * Flower inner radius ratios. + */ + static readonly FLOWER_INNER_RATIOS: number = 0.193; + + /** + * Out circle ratios. + */ + static readonly OUT_CIRCLE_RATIOS: number = 0.4; + + /** + * Small circle ratios. + */ + static readonly SMALL_CIRCLE_RATIOS: number = 0.378; + + /** + * Small circle radius. + */ + static readonly SMALL_CIRCLE_RADIUS: number = 4.1; + + /** + * Inner circle ratios. + */ + static readonly INNER_CIRCLE_RATIOS: number = 0.356; + + /** + * Inner white circle ratios. + */ + static readonly INNER_WHITE_CIRCLE_RATIOS: number = 0.339; + + /** + * Inner arc ratios. + */ + static readonly INNER_ARC_RATIOS: number = 0.336; + + /** + * Image dx ratios. + */ + static readonly IMAGE_DX_RATIOS: number = 0.114; + + /** + * Image dy ratios. + */ + static readonly IMAGE_DY_RATIOS: number = 0.052; + + /** + * Arc text start angle. + */ + static readonly ARC_START_ANGLE: number = 34; + + /** + * Arc text end angle. + */ + static readonly ARC_END_ANGLE: number = 26; + + /** + * Text align. + */ + static readonly TEXT_ALIGN: CanvasTextAlign = 'center'; + + /** + * Text base line. + */ + static readonly TEXT_BASE_LINE: CanvasTextBaseline = 'middle'; + + /** + * Canvas font. + */ + static readonly CANVAS_FONT: string = 'px sans-serif'; +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/StyleConstants.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/StyleConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..6949f2b9f74cd28e720e0c92ca0a78f0084296cb --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/StyleConstants.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Style constants for all Component. + */ +export default class StyleConstants { + /** + * Font weight. + */ + static readonly FONT_WEIGHT: number = 500; + + /** + * One hundred percent. + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * Background image size. + */ + static readonly BACKGROUND_IMAGE_SIZE: string = '38.7%'; + + /** + * Center circle image width. + */ + static readonly CENTER_IMAGE_WIDTH: string = '19.3%'; + + /** + * Center circle image height. + */ + static readonly CENTER_IMAGE_HEIGHT: string = '14%'; + + /** + * Arc text size. + */ + static readonly ARC_TEXT_SIZE: number = fp2px(14); +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/utils/CheckEmptyUtils.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/utils/CheckEmptyUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..9405ed49629183629d530af84528083fdb9e5549 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/utils/CheckEmptyUtils.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * A utility class for checking whether data is empty. + */ +class CheckEmptyUtils { + /** + * Check obj is empty. + * + * @param {object} obj + * @return {boolean} true(empty) + */ + isEmptyObj(obj) { + return (typeof obj === 'undefined' || obj === null || obj === ''); + } + + /** + * Check str is empty. + * + * @param {string} str + * @return {boolean} true(empty) + */ + isEmptyStr(str) { + return str.trim().length === 0; + } + + /** + * Check array is empty. + * + * @param {Array}arr + * @return {boolean} true(empty) + */ + isEmptyArr(arr) { + return arr.length === 0; + } +} + +export default new CheckEmptyUtils(); \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/common/utils/Logger.ets b/ETSUI/CanvasComponent/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec5bb8ad6a71e0cd1366aa41ffa520b9391b8496 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('[CanvasComponent]', 0xFF00) \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/CanvasComponent/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3f054432744aa810ce6ceca3e46616ba6e02cb9 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/CanvasPage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/pages/CanvasPage.ets b/ETSUI/CanvasComponent/entry/src/main/ets/pages/CanvasPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..b2f5eadde559b8619ef75f36c7bc852c2b0d01ef --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/pages/CanvasPage.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device 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 window from '@ohos.window'; +import Logger from '../common/utils/Logger'; +import DrawModel from '../viewmodel/DrawModel'; +import PrizeDialog from '../view/PrizeDialog'; +import PrizeData from '../common/bean/PrizeData'; +import StyleConstants from '../common/constants/StyleConstants'; +import CommonConstants from '../common/constants/CommonConstants'; +import { startAnimator } from '../viewmodel/DrawModel'; + +// Get context. +let context = getContext(this); + +@Entry +@Component +struct CanvasPage { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private canvasContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + @State drawModel: DrawModel = new DrawModel(); + @State screenWidth: number = 0; + @State screenHeight: number = 0; + @State rotateDegree: number = 0; + @State enableFlag: boolean = true; + @State prizeData: PrizeData = new PrizeData(); + dialogController: CustomDialogController = new CustomDialogController({ + builder: PrizeDialog({ + prizeData: $prizeData, + enableFlag: $enableFlag + }), + autoCancel: false + }); + + aboutToAppear() { + // Obtains the width and height of the screen, excluding the height of the navigation view. + window.getLastWindow(context) + .then((windowClass) => { + let windowProperties = windowClass.getWindowProperties(); + this.screenWidth = px2vp(windowProperties.windowRect.width); + this.screenHeight = px2vp(windowProperties.windowRect.height); + }) + .catch((error) => { + Logger.error('Failed to obtain the window size. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Stack({ alignContent: Alignment.Center }) { + Canvas(this.canvasContext) + .width(StyleConstants.FULL_PERCENT) + .height(StyleConstants.FULL_PERCENT) + .onReady(() => { + this.drawModel.draw(this.canvasContext, this.screenWidth, this.screenHeight); + }) + .rotate({ + x: 0, + y: 0, + z: 1, + angle: this.rotateDegree, + centerX: this.screenWidth / CommonConstants.TWO, + centerY: this.screenHeight / CommonConstants.TWO + }) + + Image($r('app.media.ic_center')) + .width(StyleConstants.CENTER_IMAGE_WIDTH) + .height(StyleConstants.CENTER_IMAGE_HEIGHT) + .enabled(this.enableFlag) + .onClick(() => { + this.enableFlag = !this.enableFlag; + startAnimator.call(this); + }) + } + .width(StyleConstants.FULL_PERCENT) + .height(StyleConstants.FULL_PERCENT) + .backgroundImage($r('app.media.ic_background'), ImageRepeat.NoRepeat) + .backgroundImageSize({ + width: StyleConstants.FULL_PERCENT, + height: StyleConstants.BACKGROUND_IMAGE_SIZE + }) + } +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/view/PrizeDialog.ets b/ETSUI/CanvasComponent/entry/src/main/ets/view/PrizeDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..d23fa0bc097b97a6a55f2215da5e7cf5458ddb83 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/view/PrizeDialog.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device 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 matrix4 from '@ohos.matrix4'; +import PrizeData from '../common/bean/PrizeData'; +import StyleConstants from '../common/constants/StyleConstants'; +import CommonConstants from '../common/constants/CommonConstants'; + +@CustomDialog +export default struct PrizeDialog { + @Link prizeData: PrizeData; + @Link enableFlag: boolean; + private controller: CustomDialogController; + + build() { + Column() { + Image(this.prizeData.imageSrc) + .width($r('app.float.dialog_image_size')) + .height($r('app.float.dialog_image_size')) + .margin({ + top: $r('app.float.dialog_image_top'), + bottom: $r('app.float.dialog_image_bottom') + }) + .transform(matrix4.identity().rotate({ + x: 0, + y: 0, + z: 1, + angle: CommonConstants.TRANSFORM_ANGLE + })) + + Text(this.prizeData.message) + .fontSize($r('app.float.dialog_font_size')) + .textAlign(TextAlign.Center) + .margin({ bottom: $r('app.float.dialog_message_bottom') }) + + Text($r('app.string.text_confirm')) + .fontColor($r('app.color.text_font_color')) + .fontWeight(StyleConstants.FONT_WEIGHT) + .fontSize($r('app.float.dialog_font_size')) + .textAlign(TextAlign.Center) + .onClick(() => { + this.controller.close(); + this.enableFlag = !this.enableFlag; + }) + } + .backgroundColor($r('app.color.dialog_background')) + .width(StyleConstants.FULL_PERCENT) + .height($r('app.float.dialog_height')) + } +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets b/ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4e3d7d5bafe36c05c79432599783beda76b3a87 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constants/CommonConstants'; +import ColorConstants from '../common/constants/ColorConstants'; +import StyleConstants from '../common/constants/StyleConstants'; +import PrizeData from '../common/bean/PrizeData'; +import FillArcData from '../common/bean/FillArcData'; +import Logger from '../common/utils/Logger'; +import CheckEmptyUtils from '../common/utils/CheckEmptyUtils'; + +/** + * Canvas drawing method class. + */ +export default class DrawModel { + private startAngle: number = 0; + private avgAngle: number = CommonConstants.CIRCLE / CommonConstants.COUNT; + private screenWidth: number = 0; + private canvasContext: CanvasRenderingContext2D; + + /** + * Draw the raffle round turntable. + * + * @param canvasContext canvasContext. + * @param screenWidth screenWidth. + * @param screenHeight screenHeight. + */ + draw(canvasContext: CanvasRenderingContext2D, screenWidth: number, screenHeight: number) { + if (CheckEmptyUtils.isEmptyObj(canvasContext)) { + Logger.error('[DrawModel][draw] canvasContext is empty.'); + return; + } + this.canvasContext = canvasContext; + this.screenWidth = screenWidth; + this.canvasContext.clearRect(0, 0, this.screenWidth, screenHeight); + // Translates the canvas along the X and Y axes by a specified distance. + this.canvasContext.translate(this.screenWidth / CommonConstants.TWO, + screenHeight / CommonConstants.TWO); + // Painted outer disc petal. + this.drawFlower(); + // Draw outer disc, small circle. + this.drawOutCircle(); + // Draw the inner disc. + this.drawInnerCircle(); + // Draw the interior fan-shaped raffle area. + this.drawInnerArc(); + // Draw text in the internal fan area. + this.drawArcText(); + // Draw the picture corresponding to the prize in the internal fan area. + this.drawImage(); + this.canvasContext.translate(-this.screenWidth / CommonConstants.TWO, + -screenHeight / CommonConstants.TWO); + } + + /** + * Method of drawing arcs. + * + * @param fillArcData fillArcData. + * @param fillColor fillColor. + */ + fillArc(fillArcData: FillArcData, fillColor: string) { + if (CheckEmptyUtils.isEmptyObj(fillArcData) || CheckEmptyUtils.isEmptyStr(fillColor)) { + Logger.error('[DrawModel][fillArc] fillArcData or fillColor is empty.'); + return; + } + this.canvasContext.beginPath(); + this.canvasContext.fillStyle = fillColor; + this.canvasContext.arc(fillArcData.x, fillArcData.y, fillArcData.radius, + fillArcData.startAngle, fillArcData.endAngle); + this.canvasContext.fill(); + } + + /** + * Painted outer disc petal. + */ + drawFlower() { + let beginAngle = this.startAngle + this.avgAngle; + const pointY = this.screenWidth * CommonConstants.FLOWER_POINT_Y_RATIOS; + const radius = this.screenWidth * CommonConstants.FLOWER_RADIUS_RATIOS; + const innerRadius = this.screenWidth * CommonConstants.FLOWER_INNER_RATIOS; + for (let i = 0; i < CommonConstants.COUNT; i++) { + this.canvasContext.save(); + this.canvasContext.rotate(beginAngle * Math.PI / CommonConstants.HALF_CIRCLE); + this.fillArc(new FillArcData(0, -pointY, radius, 0, Math.PI * CommonConstants.TWO), + ColorConstants.FLOWER_OUT_COLOR); + + this.fillArc(new FillArcData(0, -pointY, innerRadius, 0, Math.PI * CommonConstants.TWO), + ColorConstants.FLOWER_INNER_COLOR); + beginAngle += this.avgAngle; + this.canvasContext.restore(); + } + } + + /** + * Draw outer disc, small circle. + */ + drawOutCircle() { + // Draw outer disc. + this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.OUT_CIRCLE_RATIOS, 0, + Math.PI * CommonConstants.TWO), ColorConstants.OUT_CIRCLE_COLOR); + + let beginAngle = this.startAngle; + // Draw small circle. + for (let i = 0; i < CommonConstants.SMALL_CIRCLE_COUNT; i++) { + this.canvasContext.save(); + this.canvasContext.rotate(beginAngle * Math.PI / CommonConstants.HALF_CIRCLE); + this.fillArc(new FillArcData(this.screenWidth * CommonConstants.SMALL_CIRCLE_RATIOS, 0, + CommonConstants.SMALL_CIRCLE_RADIUS, 0, Math.PI * CommonConstants.TWO), + ColorConstants.WHITE_COLOR); + beginAngle = beginAngle + CommonConstants.CIRCLE / CommonConstants.SMALL_CIRCLE_COUNT; + this.canvasContext.restore(); + } + } + + /** + * Draw the inner disc. + */ + drawInnerCircle() { + this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_CIRCLE_RATIOS, 0, + Math.PI * CommonConstants.TWO), ColorConstants.INNER_CIRCLE_COLOR); + this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_WHITE_CIRCLE_RATIOS, 0, + Math.PI * CommonConstants.TWO), ColorConstants.WHITE_COLOR); + } + + /** + * Draw the interior fan-shaped raffle area. + */ + drawInnerArc() { + let colors = [ + ColorConstants.ARC_PINK_COLOR, ColorConstants.ARC_YELLOW_COLOR, + ColorConstants.ARC_GREEN_COLOR, ColorConstants.ARC_PINK_COLOR, + ColorConstants.ARC_YELLOW_COLOR, ColorConstants.ARC_GREEN_COLOR + ]; + let radius = this.screenWidth * CommonConstants.INNER_ARC_RATIOS; + for (let i = 0; i < CommonConstants.COUNT; i++) { + this.fillArc(new FillArcData(0, 0, radius, this.startAngle * Math.PI / CommonConstants.HALF_CIRCLE, + (this.startAngle + this.avgAngle) * Math.PI / CommonConstants.HALF_CIRCLE), colors[i]); + this.canvasContext.lineTo(0, 0); + this.canvasContext.fill(); + this.startAngle += this.avgAngle; + } + } + + /** + * Draw text in the internal fan area. + */ + drawArcText() { + this.canvasContext.textAlign = CommonConstants.TEXT_ALIGN; + this.canvasContext.textBaseline = CommonConstants.TEXT_BASE_LINE; + this.canvasContext.fillStyle = ColorConstants.TEXT_COLOR; + this.canvasContext.font = StyleConstants.ARC_TEXT_SIZE + CommonConstants.CANVAS_FONT; + let textArrays = [ + $r('app.string.text_smile'), + $r('app.string.text_hamburger'), + $r('app.string.text_cake'), + $r('app.string.text_smile'), + $r('app.string.text_beer'), + $r('app.string.text_watermelon') + ]; + let arcTextStartAngle = CommonConstants.ARC_START_ANGLE; + let arcTextEndAngle = CommonConstants.ARC_END_ANGLE; + for (let i = 0; i < CommonConstants.COUNT; i++) { + this.drawCircularText(this.getResourceString(textArrays[i]), + (this.startAngle + arcTextStartAngle) * Math.PI / CommonConstants.HALF_CIRCLE, + (this.startAngle + arcTextEndAngle) * Math.PI / CommonConstants.HALF_CIRCLE); + this.startAngle += this.avgAngle; + } + } + + /** + * Obtains the character string corresponding to the specified resource ID. + * + * @param resource resource. + */ + getResourceString(resource: Resource): string { + if (CheckEmptyUtils.isEmptyObj(resource)) { + Logger.error('[DrawModel][getResourceString] resource is empty.') + return; + } + let resourceString: string = ''; + try { + resourceString = getContext(this).resourceManager.getStringSync(resource.id); + } catch (error) { + Logger.error(`[DrawModel][getResourceString]getStringSync failed, + error code: ${error.code}, message: ${error.message}.`); + } + return resourceString; + } + + /** + * Draw Arc Text. + * + * @param textString textString. + * @param startAngle startAngle. + * @param endAngle endAngle. + */ + drawCircularText(textString: string, startAngle: number, endAngle: number) { + if (CheckEmptyUtils.isEmptyStr(textString)) { + Logger.error('[DrawModel][drawCircularText] textString is empty.') + return; + } + let circleText = { + x: 0, + y: 0, + radius: this.screenWidth * CommonConstants.INNER_ARC_RATIOS + }; + // The radius of the circle. + let radius = circleText.radius - circleText.radius / CommonConstants.COUNT; + // The radians occupied by each letter. + let angleDecrement = (startAngle - endAngle) / (textString.length - 1); + let angle = startAngle; + let index = 0; + let character; + + while (index < textString.length) { + character = textString.charAt(index); + this.canvasContext.save(); + this.canvasContext.beginPath(); + this.canvasContext.translate(circleText.x + Math.cos(angle) * radius, + circleText.y - Math.sin(angle) * radius); + this.canvasContext.rotate(Math.PI / CommonConstants.TWO - angle); + this.canvasContext.fillText(character, 0, 0); + angle -= angleDecrement; + index++; + this.canvasContext.restore(); + } + } + + /** + * Draw the picture corresponding to the prize in the internal fan area. + */ + drawImage() { + let beginAngle = this.startAngle; + let imageSrc = [ + CommonConstants.WATERMELON_IMAGE_URL, CommonConstants.BEER_IMAGE_URL, + CommonConstants.SMILE_IMAGE_URL, CommonConstants.CAKE_IMAGE_URL, + CommonConstants.HAMBURG_IMAGE_URL, CommonConstants.SMILE_IMAGE_URL + ]; + for (let i = 0; i < CommonConstants.COUNT; i++) { + let image = new ImageBitmap(imageSrc[i]); + this.canvasContext.save(); + this.canvasContext.rotate(beginAngle * Math.PI / CommonConstants.HALF_CIRCLE); + this.canvasContext.drawImage(image, this.screenWidth * CommonConstants.IMAGE_DX_RATIOS, + this.screenWidth * CommonConstants.IMAGE_DY_RATIOS, CommonConstants.IMAGE_SIZE, + CommonConstants.IMAGE_SIZE); + beginAngle += this.avgAngle; + this.canvasContext.restore(); + } + } + + /** + * Displaying information about prizes. + * + * @param randomAngle randomAngle. + */ + showPrizeData(randomAngle: number): PrizeData { + for (let i = 1; i <= CommonConstants.COUNT; i++) { + if (randomAngle <= i * this.avgAngle) { + return this.getPrizeData(i); + } + } + return new PrizeData(); + } + + /** + * Obtaining information about prizes. + * + * @param scopeNum scopeNum. + */ + getPrizeData(scopeNum: number): PrizeData { + let prizeData: PrizeData = new PrizeData(); + switch (scopeNum) { + case CommonConstants.ONE: + prizeData.message = $r('app.string.prize_text_watermelon'); + prizeData.imageSrc = CommonConstants.WATERMELON_IMAGE_URL; + break; + case CommonConstants.TWO: + prizeData.message = $r('app.string.prize_text_beer'); + prizeData.imageSrc = CommonConstants.BEER_IMAGE_URL; + break; + case CommonConstants.THREE: + prizeData.message = $r('app.string.prize_text_smile'); + prizeData.imageSrc = CommonConstants.SMILE_IMAGE_URL; + break; + case CommonConstants.FOUR: + prizeData.message = $r('app.string.prize_text_cake'); + prizeData.imageSrc = CommonConstants.CAKE_IMAGE_URL; + break; + case CommonConstants.FIVE: + prizeData.message = $r('app.string.prize_text_hamburger'); + prizeData.imageSrc = CommonConstants.HAMBURG_IMAGE_URL; + break; + case CommonConstants.SIX: + + prizeData.message = $r('app.string.prize_text_smile'); + prizeData.imageSrc = CommonConstants.SMILE_IMAGE_URL; + break; + default: + break; + } + return prizeData; + } +} + +/** + * Start animator. + */ +export function startAnimator() { + let randomAngle = Math.round(Math.random() * CommonConstants.CIRCLE); + // Obtaining prize information. + this.prizeData = this.drawModel.showPrizeData(randomAngle); + + animateTo({ + duration: CommonConstants.DURATION, + curve: Curve.Ease, + delay: 0, + iterations: 1, + playMode: PlayMode.Normal, + onFinish: () => { + this.rotateDegree = CommonConstants.ANGLE - randomAngle; + // Display prize information pop-up window. + this.dialogController.open(); + } + }, () => { + this.rotateDegree = CommonConstants.CIRCLE * CommonConstants.FIVE + + CommonConstants.ANGLE - randomAngle; + }) +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/module.json5 b/ETSUI/CanvasComponent/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4b4b749fe4bd34efd23f7e9eaed1abd3a097af50 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/element/color.json b/ETSUI/CanvasComponent/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..f7997f4d49f2670753e933779da1b0b4072d09a0 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "dialog_background", + "value": "#FFFFFF" + }, + { + "name": "text_font_color", + "value": "#007DFF" + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/element/float.json b/ETSUI/CanvasComponent/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..5fa6d88752a05a2044d3b18d5d448c173401a611 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/resources/base/element/float.json @@ -0,0 +1,28 @@ +{ + "float": [ + { + "name": "dialog_image_size", + "value": "90vp" + }, + { + "name": "dialog_image_top", + "value": "55vp" + }, + { + "name": "dialog_image_bottom", + "value": "48vp" + }, + { + "name": "dialog_font_size", + "value": "16fp" + }, + { + "name": "dialog_message_bottom", + "value": "20vp" + }, + { + "name": "dialog_height", + "value": "277vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/element/string.json b/ETSUI/CanvasComponent/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c51979bd45f7fc986449bf729b6644074c386923 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/resources/base/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "CanvasComponent" + }, + { + "name": "text_confirm", + "value": "Confirm" + }, + { + "name": "text_smile", + "value": "Thanks" + }, + { + "name": "text_hamburger", + "value": "Hamburger" + }, + { + "name": "text_cake", + "value": "Cake" + }, + { + "name": "text_beer", + "value": "Beer" + }, + { + "name": "text_watermelon", + "value": "Watermelon" + }, + { + "name": "prize_text_smile", + "value": "Sorry, you didn't win the prize" + }, + { + "name": "prize_text_hamburger", + "value": "Congratulations, you won the prize burger" + }, + { + "name": "prize_text_cake", + "value": "Congratulations, you won the prize cake" + }, + { + "name": "prize_text_beer", + "value": "Congratulations, you won the prize beer" + }, + { + "name": "prize_text_watermelon", + "value": "Congratulations, you won the prize watermelon" + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_background.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_background.png new file mode 100644 index 0000000000000000000000000000000000000000..781b482ef5eca536823d16c42c887c788e877ac7 Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_background.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_beer.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_beer.png new file mode 100644 index 0000000000000000000000000000000000000000..58c50e1b8c69303f362c5b55654591a15f9f2c1c Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_beer.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_cake.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_cake.png new file mode 100644 index 0000000000000000000000000000000000000000..af1db1fb3833af36dc07abb4d83cb6a9ce7dfd21 Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_cake.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_center.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_center.png new file mode 100644 index 0000000000000000000000000000000000000000..bce4ee2932839ccb0be0eec31830ef1bfdf1e7d8 Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_center.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_hamburg.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_hamburg.png new file mode 100644 index 0000000000000000000000000000000000000000..05510080b338388b812e11e57c197d885c20a959 Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_hamburg.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_smile.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_smile.png new file mode 100644 index 0000000000000000000000000000000000000000..2abb0ea28fd035de726ba8d13207efb52902f6be Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_smile.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_watermelon.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_watermelon.png new file mode 100644 index 0000000000000000000000000000000000000000..3fdce70870587bc47b1dd3217ac05cd299d51aef Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/ic_watermelon.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/media/icon.png b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/CanvasComponent/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/CanvasComponent/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..294fe295c9fee68df242a7854f78fdc6c0c7e284 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/CanvasPage" + ] +} diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/en_US/element/string.json b/ETSUI/CanvasComponent/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c51979bd45f7fc986449bf729b6644074c386923 --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "CanvasComponent" + }, + { + "name": "text_confirm", + "value": "Confirm" + }, + { + "name": "text_smile", + "value": "Thanks" + }, + { + "name": "text_hamburger", + "value": "Hamburger" + }, + { + "name": "text_cake", + "value": "Cake" + }, + { + "name": "text_beer", + "value": "Beer" + }, + { + "name": "text_watermelon", + "value": "Watermelon" + }, + { + "name": "prize_text_smile", + "value": "Sorry, you didn't win the prize" + }, + { + "name": "prize_text_hamburger", + "value": "Congratulations, you won the prize burger" + }, + { + "name": "prize_text_cake", + "value": "Congratulations, you won the prize cake" + }, + { + "name": "prize_text_beer", + "value": "Congratulations, you won the prize beer" + }, + { + "name": "prize_text_watermelon", + "value": "Congratulations, you won the prize watermelon" + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/CanvasComponent/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2d538054545743d845325a78b72ca270708166ea --- /dev/null +++ b/ETSUI/CanvasComponent/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "CanvasComponent" + }, + { + "name": "text_confirm", + "value": "确定" + }, + { + "name": "text_smile", + "value": "谢谢" + }, + { + "name": "text_hamburger", + "value": "汉堡" + }, + { + "name": "text_cake", + "value": "蛋糕" + }, + { + "name": "text_beer", + "value": "啤酒" + }, + { + "name": "text_watermelon", + "value": "西瓜" + }, + { + "name": "prize_text_smile", + "value": "sorry,您没有中奖" + }, + { + "name": "prize_text_hamburger", + "value": "恭喜您,抽中奖品汉堡" + }, + { + "name": "prize_text_cake", + "value": "恭喜您,抽中奖品蛋糕" + }, + { + "name": "prize_text_beer", + "value": "恭喜您,抽中奖品啤酒" + }, + { + "name": "prize_text_watermelon", + "value": "恭喜您,抽中奖品西瓜" + } + ] +} \ No newline at end of file diff --git a/ETSUI/CanvasComponent/figures/zh-cn_image_0000001509916136.gif b/ETSUI/CanvasComponent/figures/zh-cn_image_0000001509916136.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ETSUI/CanvasComponent/figures/zh-cn_image_0000001509916136.gif differ diff --git a/ETSUI/CanvasComponent/figures/zh-cn_image_0000001554588725.png b/ETSUI/CanvasComponent/figures/zh-cn_image_0000001554588725.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/CanvasComponent/figures/zh-cn_image_0000001554588725.png differ diff --git a/ETSUI/CanvasComponent/figures/zh-cn_image_0000001563941329.gif b/ETSUI/CanvasComponent/figures/zh-cn_image_0000001563941329.gif new file mode 100644 index 0000000000000000000000000000000000000000..d5a8bb62f2a388b68bffabe3c9d12576d349a948 Binary files /dev/null and b/ETSUI/CanvasComponent/figures/zh-cn_image_0000001563941329.gif differ diff --git a/ETSUI/CanvasComponent/figures/zh-cn_other_0000001563981425.jpeg b/ETSUI/CanvasComponent/figures/zh-cn_other_0000001563981425.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..5fa4af8df12f1b9ce22f9ee00bb519d3b1933fd2 Binary files /dev/null and b/ETSUI/CanvasComponent/figures/zh-cn_other_0000001563981425.jpeg differ diff --git a/ETSUI/CanvasComponent/hvigor/hvigor-config.json5 b/ETSUI/CanvasComponent/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/ETSUI/CanvasComponent/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/ETSUI/CanvasComponent/hvigor/hvigor-wrapper.js b/ETSUI/CanvasComponent/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/CanvasComponent/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/CanvasComponent/hvigorfile.ts b/ETSUI/CanvasComponent/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/CanvasComponent/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/CanvasComponent/oh-package.json5 b/ETSUI/CanvasComponent/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0b9694b7b8513a5dae78af8f5e1f04b76a0c9509 --- /dev/null +++ b/ETSUI/CanvasComponent/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "canvascomponent", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/ElectronicAlbum/AppScope/app.json5 b/ETSUI/ElectronicAlbum/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..57c443e95457942ba42c81a1d0254b0a45d0dc91 --- /dev/null +++ b/ETSUI/ElectronicAlbum/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.electronicalbum", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + } +} diff --git a/ETSUI/ElectronicAlbum/AppScope/resources/base/element/string.json b/ETSUI/ElectronicAlbum/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f0b1d753c52fd6ca2110a40249ae1ffa73cb5d32 --- /dev/null +++ b/ETSUI/ElectronicAlbum/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ElectronicAlbum" + } + ] +} diff --git a/ETSUI/ElectronicAlbum/AppScope/resources/base/media/app_icon.png b/ETSUI/ElectronicAlbum/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/ElectronicAlbum/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/ElectronicAlbum/LICENSE b/ETSUI/ElectronicAlbum/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/ElectronicAlbum/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/README.md b/ETSUI/ElectronicAlbum/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9a03e2e9c62ea891ca66131453268fd15d020ab7 --- /dev/null +++ b/ETSUI/ElectronicAlbum/README.md @@ -0,0 +1,281 @@ +# 电子相册(ArkTS) + +## 介绍 + +本篇Codelab介绍了如何实现一个简单的电子相册应用的开发,主要功能包括: + +1. 实现首页顶部的轮播效果。 +2. 实现页面跳转时共享元素的转场动画效果。 +3. 实现通过手势控制图片的放大、缩小、左右滑动查看细节等效果。 + + ![](figures/oh_all_360.gif) + +### 相关概念 + +- [Swiper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md):滑块视图容器,提供子组件滑动轮播显示的能力。 +- [Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md):网格容器,由“行”和“列”分割的单元格所组成,通过指定“项目”所在的单元格做出各种各样的布局。 +- [Navigation](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md):Navigation组件一般作为Page页面的根容器,通过属性设置来展示页面的标题、工具栏、菜单。 +- [List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md):列表包含一系列相同宽度的列表项。适合连续、多行呈现同类数据,例如图片和文本。 +- [组合手势](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-combined-gestures.md):手势识别组,多种手势组合为复合手势,支持连续识别、并行识别和互斥识别。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──constansts +│ │ │ └──Constants.ets // 常量类 +│ │ └──utils +│ │ └──Logger.ets // Logger公共类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ ├──DetailListPage.ets // 图片详情页面 +│ │ ├──DetailPage.ets // 查看大图页面 +│ │ ├──IndexPage.ets // 电子相册主页面 +│ │ └──ListPage.ets // 图片列表页面 +│ └──view +│ └──PhotoItem.ets // 首页相册Item组件 +└──entry/src/main/resources // 资源文件 +``` + +## 构建应用页面 + +### 应用首页 + +应用首页用Column组件来实现纵向布局,从上到下依次是标题组件Text、轮播图Swiper、相册列表Grid。标题和轮播图均设置固定高度,底部相册列表通过layoutWeight属性实现自适应占满剩余空间。 + +![](figures/oh_home_360.png) + +```typescript +// IndexPage.ets +Column() { + Row() { + Text($r('app.string.EntryAbility_label')) + } + + Swiper(this.swiperController) { + ForEach(Constants.BANNER_IMG_LIST, (item: Resource) => { + Row() { + Image(item) + ... + } + }, (item, index) => JSON.stringify(item) + index) + } + ... + + Grid() { + ForEach(IMG_ARR, (photoArr: Array) => { + GridItem() { + PhotoItem({ photoArr }) + } + ... + .onClick(() => { + router.pushUrl({ + url: Constants.URL_LIST_PAGE, + params: { photoArr: JSON.stringify(photoArr) } + }); + }) + }, (item, index) => JSON.stringify(item) + index) + } + ... + .layoutWeight(1) +} +``` + +### 图片列表页面 + +图片列表页是网格状展开的图片列表,主要使用Grid组件和GridItem组件,GridItem高度通过aspectRatio属性设置为跟宽度一致。 + +![](figures/oh_list_360.png) + +```typescript +// ListPage.ets +Navigation() { + Grid() { + ForEach(this.photoArr, (img: Resource, index: number) => { + GridItem() { + Image(img) + .onClick(() => { + this.selectedIndex.set(index); + router.pushUrl({ + url: Constants.URL_DETAIL_LIST_PAGE, + params: { + photoArr: JSON.stringify(this.photoArr), + } + }) + }) + } + ... + .aspectRatio(1) + }, item => JSON.stringify(item)) + } + .columnsTemplate(Constants.GRID_COLUMNS_TEMPLATE) + .layoutWeight(1) +} +``` + +### 图片详情页面 + +图片详情页由两个横向滚动的List组件完成整体布局,两个组件之间有联动的效果。滚动底部的List,上边展示的图片会随着改变,同样左右滑动上边的图片时,底部List组件也会随之改变。 + +![](figures/oh_list_360.gif) + +```typescript +// ListDetailPage.ets +Stack({ alignContent: Alignment.Bottom }) { + List({ scroller: this.bigScroller, initialIndex: this.selectedIndex.get() }) { + ForEach(this.photoArr, (img: Resource, index: number) => { + ListItem() { + Image(img) + ... + .gesture(PinchGesture({ fingers: Constants.DOUBLE_NUMBER }) + .onActionStart(this.goDetailPage.bind(this))) + .onClick(this.goDetailPage.bind(this)) + } + }, item => JSON.stringify(item)) + } + ... + .onScroll((scrollOffset, scrollState) => { + if (scrollState === ScrollState.Fling) { + this.bigScrollAction(scrollTypeEnum.SCROLL); + } + }) + .onScrollStop(() => this.bigScrollAction(scrollTypeEnum.STOP)) + + List({ scroller: this.smallScroller, space: Constants.LIST_ITEM_SPACE, initialIndex: this.selectedIndex.get() }) { + ForEach(this.smallPhotoArr, (img: Resource, index: number) => { + ListItem() { + this.SmallImgItemBuilder(img, index) + } + }, item => JSON.stringify(item)) + } + ... + .listDirection(Axis.Horizontal) + .onScroll((scrollOffset, scrollState) => { + if (scrollState === ScrollState.Fling) { + this.smallScrollAction(scrollTypeEnum.SCROLL); + } + }) + .onScrollStop(() => this.smallScrollAction(scrollTypeEnum.STOP)) +} +``` + +### 查看大图页面 + +查看大图页面由一个横向滚动的List组件来实现图片左右滑动时切换图片的功能,和一个Row组件实现图片的缩放和拖动查看细节功能。对图片进行缩放时会从List组件切换成Row组件来实现对单张图片的操作,对单张图片进行滑动操作时,也会由Row组件转换为List组件来实现图片的切换功能。 + +![](figures/oh_detail_360.gif) + +```typescript +// DetailPage.ets +Stack() { + List({ scroller: this.scroller }) { + ForEach(this.photoArr, (img: Resource, index: number) => { + ListItem() { + Image(img) + ... + .onClick(() => router.back() + ) + } + .gesture(PinchGesture({ fingers: Constants.DOUBLE_NUMBER }) + .onActionStart(() => { + this.selectedIndex.set(index); + this.resetImg(); + this.isScaling = true; + }) + ) + }, item => JSON.stringify(item)) + } + ... + .onScrollStop(() => { + let currentIndex = Math.round((this.scroller.currentOffset() + .xOffset + (this.imageWidth / Constants.DOUBLE_NUMBER)) / this.imageWidth); + this.scroller.scrollTo({ xOffset: currentIndex * this.imageWidth, yOffset: 0 }); + }) + .visibility(this.isScaling ? Visibility.Hidden : Visibility.Visible) + + Row() { + Image(this.photoArr[this.selectedIndex.get()]) + ... + } + .visibility(this.isScaling ? Visibility.Visible : Visibility.Hidden) +} +``` + +## 通过手势控制图片 + +大图浏览界面双指捏合时通过改变Image组件的scale来控制图片的缩放,单手拖动时通过改变Image的偏移量来控制图片的位置,手势操作调用组合手势GestureGroup实现。其中PinchGesture实现双指缩放手势,PanGesture实现单指拖动手势。 + +```typescript +// DetailPage.ets +Row() { + Image(this.photoArr[this.selectedIndex.get()]) + .position({ x: this.imgOffSetX, y: this.imgOffSetY }) + .scale({ x: this.imgScale, y: this.imgScale }) + } + .gesture(GestureGroup(GestureMode.Parallel, + PinchGesture({ fingers: Constants.DOUBLE_NUMBER }) + .onActionUpdate((event: GestureEvent) => { + this.imgScale = event.scale; + }) + .onActionEnd(() => { + if (this.imgScale < 1) { + this.resetImg(); + this.imgOffSetX = 0; + this.imgOffSetY = 0; + } + }), + PanGesture() + .onActionStart(() => { + this.preOffsetX = this.imgOffSetX; + this.preOffsetY = this.imgOffSetY; + }) + .onActionUpdate((event: GestureEvent) => { + this.imgOffSetX = this.preOffsetX + event.offsetX; + this.imgOffSetY = this.preOffsetY + event.offsetY; + }) + .onActionEnd(this.handlePanEnd.bind(this)) + )) +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 如何实现首页顶部的轮播效果。 +2. 如何实现页面跳转时共享元素的转场动画效果。 +3. 如何通过手势控制图片的放大、缩小、左右滑动查看细节等效果。 + +![](figures/彩带动效.gif) diff --git a/ETSUI/ElectronicAlbum/build-profile.json5 b/ETSUI/ElectronicAlbum/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/ElectronicAlbum/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/build-profile.json5 b/ETSUI/ElectronicAlbum/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/hvigorfile.ts b/ETSUI/ElectronicAlbum/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/ElectronicAlbum/entry/oh-package.json5 b/ETSUI/ElectronicAlbum/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/common/constants/Constants.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/common/constants/Constants.ets new file mode 100644 index 0000000000000000000000000000000000000000..dfb30a7cdbd723a7753163ad24324af6724e6ece --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/common/constants/Constants.ets @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export default class Constants { + + /** + * banner list + */ + static readonly BANNER_IMG_LIST: Array = [ + $r('app.media.ic_scene_1'), + $r('app.media.ic_food_0'), + $r('app.media.ic_life_0'), + $r('app.media.ic_men_0') + ]; + + /** + * scene list + */ + static readonly SCENE_LIST: Array = [ + $r('app.media.ic_scene_1'), + $r('app.media.ic_scene_2'), + $r('app.media.ic_scene_0') + ]; + + /** + * men list + */ + static readonly MEN_LIST: Array = [ + $r('app.media.ic_men_0'), + $r('app.media.ic_men_2'), + $r('app.media.ic_men_3') + ]; + + /** + * food list + */ + static readonly FOOD_LIST: Array = [ + $r('app.media.ic_food_1'), + $r('app.media.ic_food_0'), + ]; + + /** + * life list + */ + static readonly LIFE_LIST: Array = [ + $r('app.media.ic_life_1'), + $r('app.media.ic_life_0'), + $r('app.media.ic_life_2'), + $r('app.media.ic_life_3'), + $r('app.media.ic_life_4'), + $r('app.media.ic_life_5') + ]; + + /** + * index page img arr + */ + static readonly IMG_ARR: Resource[][] = [ + [...Constants.SCENE_LIST, ...Constants.LIFE_LIST, ...Constants.MEN_LIST, ...Constants.FOOD_LIST, ...Constants.BANNER_IMG_LIST], + [...Constants.MEN_LIST, ...Constants.LIFE_LIST, ...Constants.SCENE_LIST], + [...Constants.FOOD_LIST, ...Constants.SCENE_LIST, ...Constants.SCENE_LIST], + [...Constants.LIFE_LIST, ...Constants.FOOD_LIST, ...Constants.MEN_LIST] + ]; + + /** + * title font weight + */ + static readonly TITLE_FONT_WEIGHT: number = 500; + + /** + * aspect ratio + */ + static readonly BANNER_ASPECT_RATIO: number = 1.5; + + /** + * animate duration + */ + static readonly BANNER_ANIMATE_DURATION: number = 300; + + /** + * share delay + */ + static readonly SHARE_TRANSITION_DELAY: number = 100; + + /** + * aspect ratio + */ + static readonly STACK_IMG_RATIO: number = 0.7; + + /** + * item space + */ + static readonly LIST_ITEM_SPACE: number = 2; + + /** + * cache size + */ + static readonly CACHE_IMG_SIZE: number = 4; + + /** + * cache list + */ + static readonly CACHE_IMG_LIST: string[] = ['', '', '', '']; + + /** + * title + */ + static readonly PAGE_TITLE: string = '电子相册'; + + /** + * router param + */ + static readonly PARAM_PHOTO_ARR_KEY: string = 'photoArr'; + + /** + * selected index + */ + static readonly SELECTED_INDEX_KEY: string = 'selectedIndex'; + + /** + * grid column template + */ + static readonly GRID_COLUMNS_TEMPLATE: string = '1fr 1fr 1fr 1fr'; + + /** + * index page columns template + */ + static readonly INDEX_COLUMNS_TEMPLATE: string = '1fr 1fr'; + + /** + * percent + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * photo item percent + */ + static readonly PHOTO_ITEM_PERCENT: string = '90%'; + + /** + * show count + */ + static readonly SHOW_COUNT: number = 8; + + /** + * default width + */ + static readonly DEFAULT_WIDTH: number = 360; + + /** + * padding + */ + static readonly PHOTO_ITEM_PADDING: number = 8; + + /** + * offset + */ + static readonly PHOTO_ITEM_OFFSET: number = 16; + + /** + * item opacity offset + */ + static readonly ITEM_OPACITY_OFFSET: number = 0.2; + + /** + * double number + */ + static readonly DOUBLE_NUMBER: number = 2; + + /** + * list page url + */ + static readonly URL_LIST_PAGE: string = 'pages/ListPage'; + + /** + * detail list page url + */ + static readonly URL_DETAIL_LIST_PAGE: string = 'pages/DetailListPage'; + + /** + * detail page url + */ + static readonly URL_DETAIL_PAGE: string = 'pages/DetailPage'; + + /** + * index page tag + */ + static readonly TAG_INDEX_PAGE: string = 'IndexPage push error '; + + /** + * list page tag + */ + static readonly TAG_LIST_PAGE: string = 'ListPage push error '; + + /** + * detail list page tag + */ + static readonly TAG_DETAIL_PAGE: string = 'DetailListPage push error '; + +} diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/common/utils/Logger.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..695b2e6cf562ac7f3de2a9fd8c5de2dfe0cb3ca5 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +const LOGGER_PREFIX: string = 'Electronic Album'; + +class Logger { + private domain: number; + private prefix: string; + + // format Indicates the log format string. + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param prefix Identifies the log tag. + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param args Indicates the log parameters. + */ + constructor(prefix: string = '', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger(LOGGER_PREFIX); \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/ElectronicAlbum/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..e97780a0b226c10a0179b53c829581639851e1e6 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,52 @@ + +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import Window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/IndexPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/DetailListPage.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/DetailListPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d082237e88b5175261ad1bb0b2b899eedc2339d --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/DetailListPage.ets @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2023 Huawei Device 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 display from '@ohos.display'; +import router from '@ohos.router'; +import Constants from '../common/constants/Constants'; +import Logger from '../common/utils/Logger'; + +enum scrollTypeEnum { + STOP = 'onScrollStop', + SCROLL = 'onScroll' +}; + +@Entry +@Component +struct DetailListPage { + private smallScroller: Scroller = new Scroller(); + private bigScroller: Scroller = new Scroller(); + @State deviceWidth: number = Constants.DEFAULT_WIDTH; + @State smallImgWidth: number = (this.deviceWidth - Constants.LIST_ITEM_SPACE * (Constants.SHOW_COUNT - 1)) / + Constants.SHOW_COUNT; + @State imageWidth: number = this.deviceWidth + this.smallImgWidth; + private photoArr: Array = router.getParams()[`${Constants.PARAM_PHOTO_ARR_KEY}`]; + private smallPhotoArr: Array = [ + ...Constants.CACHE_IMG_LIST, + ...router.getParams()[`${Constants.PARAM_PHOTO_ARR_KEY}`], + ...Constants.CACHE_IMG_LIST + ]; + @State selectedIndex: SubscribedAbstractProperty = AppStorage.Link(`${Constants.SELECTED_INDEX_KEY}`); + + @Builder SmallImgItemBuilder(img: Resource, index: number) { + if (index > (Constants.CACHE_IMG_SIZE - 1) && index < (this.smallPhotoArr.length - Constants.CACHE_IMG_SIZE)) { + Image(img) + .onClick(() => this.smallImgClickAction(index)) + } + } + + aboutToAppear() { + let displayClass: display.Display = display.getDefaultDisplaySync(); + let width = displayClass?.width / displayClass.densityPixels ?? Constants.DEFAULT_WIDTH; + this.deviceWidth = width; + this.smallImgWidth = (width - Constants.LIST_ITEM_SPACE * (Constants.SHOW_COUNT - 1)) / Constants.SHOW_COUNT; + this.imageWidth = this.deviceWidth + this.smallImgWidth; + } + + onPageShow() { + this.smallScroller.scrollToIndex(this.selectedIndex.get()); + this.bigScroller.scrollToIndex(this.selectedIndex.get()); + } + + goDetailPage() { + router.pushUrl({ + url: Constants.URL_DETAIL_PAGE, + params: { photoArr: this.photoArr } + }).catch((error) => { + Logger.error(Constants.TAG_DETAIL_PAGE, JSON.stringify(error)); + }); + } + + smallImgClickAction(index: number) { + this.selectedIndex.set(index - Constants.CACHE_IMG_SIZE); + this.smallScroller.scrollToIndex(this.selectedIndex.get()); + this.bigScroller.scrollToIndex(this.selectedIndex.get()); + } + + smallScrollAction(type: scrollTypeEnum) { + this.selectedIndex.set(Math.round((this.smallScroller.currentOffset().xOffset + + this.smallImgWidth / Constants.DOUBLE_NUMBER) / (this.smallImgWidth + Constants.LIST_ITEM_SPACE))); + if (type === scrollTypeEnum.SCROLL) { + this.bigScroller.scrollTo({ xOffset: this.selectedIndex.get() * this.imageWidth, yOffset: 0 }); + } else { + this.smallScroller.scrollTo({ xOffset: this.selectedIndex.get() * this.smallImgWidth, yOffset: 0 }); + } + } + + bigScrollAction(type: scrollTypeEnum) { + let smallWidth = this.smallImgWidth + Constants.LIST_ITEM_SPACE; + this.selectedIndex.set(Math.round((this.bigScroller.currentOffset().xOffset + + smallWidth / Constants.DOUBLE_NUMBER) / this.imageWidth)); + if (type === scrollTypeEnum.SCROLL) { + this.smallScroller.scrollTo({ xOffset: this.selectedIndex.get() * smallWidth, yOffset: 0 }); + } else { + this.bigScroller.scrollTo({ xOffset: this.selectedIndex.get() * this.imageWidth, yOffset: 0 }); + } + } + + build() { + Navigation() { + Stack({ alignContent: Alignment.Bottom }) { + List({ scroller: this.bigScroller, initialIndex: this.selectedIndex.get() }) { + ForEach(this.photoArr, (img: Resource) => { + ListItem() { + Image(img) + .height(Constants.FULL_PERCENT) + .width(Constants.FULL_PERCENT) + .objectFit(ImageFit.Contain) + .gesture(PinchGesture({ fingers: Constants.DOUBLE_NUMBER }) + .onActionStart(this.goDetailPage.bind(this))) + .onClick(this.goDetailPage.bind(this)) + } + .padding({ + left: this.smallImgWidth / Constants.DOUBLE_NUMBER, + right: this.smallImgWidth / Constants.DOUBLE_NUMBER + }) + .width(this.imageWidth) + }, item => JSON.stringify(item)) + } + .onScroll((scrollOffset, scrollState) => { + if (scrollState === ScrollState.Fling) { + this.bigScrollAction(scrollTypeEnum.SCROLL); + } + }) + .onScrollStop(() => this.bigScrollAction(scrollTypeEnum.STOP)) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + .padding({ bottom: this.smallImgWidth * Constants.DOUBLE_NUMBER }) + .listDirection(Axis.Horizontal) + + List({ + scroller: this.smallScroller, + space: Constants.LIST_ITEM_SPACE, + initialIndex: this.selectedIndex.get() + }) { + ForEach(this.smallPhotoArr, (img: Resource, index: number) => { + ListItem() { + this.SmallImgItemBuilder(img, index) + } + .width(this.smallImgWidth) + .aspectRatio(1) + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Horizontal) + .onScroll((scrollOffset, scrollState) => { + if (scrollState === ScrollState.Fling) { + this.smallScrollAction(scrollTypeEnum.SCROLL); + } + }) + .onScrollStop(() => this.smallScrollAction(scrollTypeEnum.STOP)) + .margin({ top: $r('app.float.detail_list_margin'), bottom: $r('app.float.detail_list_margin') }) + .height(this.smallImgWidth) + .width(Constants.FULL_PERCENT) + } + .width(this.imageWidth) + .height(Constants.FULL_PERCENT) + } + .title(Constants.PAGE_TITLE) + .hideBackButton(false) + .titleMode(NavigationTitleMode.Mini) + } +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/DetailPage.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/DetailPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..788fe9b19df782ea2a41a0d01a10e7e674454208 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/DetailPage.ets @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2023 Huawei Device 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 display from '@ohos.display'; +import router from '@ohos.router'; +import Constants from '../common/constants/Constants'; + +@Entry +@Component +struct DetailPage { + scroller: Scroller = new Scroller(); + photoArr: Array = router.getParams()[`${Constants.PARAM_PHOTO_ARR_KEY}`]; + preOffsetX: number = 0; + preOffsetY: number = 0; + currentScale: number = 1; + @State deviceWidth: number = Constants.DEFAULT_WIDTH; + @State smallImgWidth: number = (Constants.DEFAULT_WIDTH - Constants.LIST_ITEM_SPACE * (Constants.SHOW_COUNT - 1)) / + Constants.SHOW_COUNT; + @State imageWidth: number = this.deviceWidth + this.smallImgWidth; + @State selectedIndex: SubscribedAbstractProperty = AppStorage.Link(`${Constants.SELECTED_INDEX_KEY}`); + @State isScaling: boolean = true; + @State imgScale: number = 1; + @State imgOffSetX: number = 0; + @State imgOffSetY: number = 0; + @State bgOpacity: number = 0; + + aboutToAppear() { + let displayClass: display.Display = display.getDefaultDisplaySync() + let width = displayClass?.width / displayClass.densityPixels ?? Constants.DEFAULT_WIDTH; + this.deviceWidth = width; + this.smallImgWidth = (width - Constants.LIST_ITEM_SPACE * (Constants.SHOW_COUNT - 1)) / Constants.SHOW_COUNT; + this.imageWidth = this.deviceWidth + this.smallImgWidth; + } + + resetImg() { + this.imgScale = 1; + this.currentScale = 1; + this.preOffsetX = 0; + this.preOffsetY = 0; + } + + handlePanEnd() { + let initOffsetX = (this.imgScale - 1) * this.imageWidth + this.smallImgWidth; + if (Math.abs(this.imgOffSetX) > initOffsetX) { + if (this.imgOffSetX > initOffsetX && this.selectedIndex.get() > 0) { + this.selectedIndex.set(this.selectedIndex.get() - 1); + } else if (this.imgOffSetX < -initOffsetX && this.selectedIndex.get() < (this.photoArr.length - 1)) { + this.selectedIndex.set(this.selectedIndex.get() + 1); + } + this.isScaling = false; + this.resetImg(); + this.scroller.scrollTo({ xOffset: this.selectedIndex.get() * this.imageWidth, yOffset: 0 }); + } + } + + build() { + Stack() { + List({ scroller: this.scroller, initialIndex: this.selectedIndex.get() }) { + ForEach(this.photoArr, (img: Resource) => { + ListItem() { + Image(img) + .objectFit(ImageFit.Contain) + .onClick(() => router.back()) + } + .gesture(PinchGesture({ fingers: Constants.DOUBLE_NUMBER }) + .onActionStart(() => { + this.resetImg(); + this.isScaling = true; + this.imgOffSetX = 0; + this.imgOffSetY = 0; + }) + .onActionUpdate((event: GestureEvent) => { + this.imgScale = this.currentScale * event.scale; + }) + .onActionEnd(() => { + if (this.imgScale < 1) { + this.resetImg(); + this.imgOffSetX = 0; + this.imgOffSetY = 0; + } else { + this.currentScale = this.imgScale; + } + }), + ) + .padding({ + left: this.smallImgWidth / Constants.DOUBLE_NUMBER, + right: this.smallImgWidth / Constants.DOUBLE_NUMBER + }) + .width(this.imageWidth) + }, item => JSON.stringify(item)) + } + .onScrollStop(() => { + let currentIndex = Math.round((this.scroller.currentOffset().xOffset + + (this.imageWidth / Constants.DOUBLE_NUMBER)) / this.imageWidth); + this.selectedIndex.set(currentIndex); + this.scroller.scrollTo({ xOffset: currentIndex * this.imageWidth, yOffset: 0 }); + }) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + .listDirection(Axis.Horizontal) + .visibility(this.isScaling ? Visibility.Hidden : Visibility.Visible) + + Row() { + Image(this.photoArr[this.selectedIndex.get()]) + .position({ x: this.imgOffSetX, y: this.imgOffSetY }) + .scale({ x: this.imgScale, y: this.imgScale }) + .objectFit(ImageFit.Contain) + .onClick(() => router.back()) + } + .gesture(GestureGroup(GestureMode.Exclusive, + PinchGesture({ fingers: Constants.DOUBLE_NUMBER }) + .onActionUpdate((event: GestureEvent) => { + this.imgScale = this.currentScale * event.scale; + }) + .onActionEnd(() => { + if (this.imgScale < 1) { + this.resetImg(); + this.imgOffSetX = 0; + this.imgOffSetY = 0; + } else { + this.currentScale = this.imgScale; + } + }), + PanGesture() + .onActionStart(() => { + this.preOffsetX = this.imgOffSetX; + this.preOffsetY = this.imgOffSetY; + }) + .onActionUpdate((event: GestureEvent) => { + this.imgOffSetX = this.preOffsetX + event.offsetX; + this.imgOffSetY = this.preOffsetY + event.offsetY; + }) + .onActionEnd(this.handlePanEnd.bind(this)) + )) + .padding({ + left: this.smallImgWidth / Constants.DOUBLE_NUMBER, + right: this.smallImgWidth / Constants.DOUBLE_NUMBER + }) + .width(this.imageWidth) + .height(Constants.FULL_PERCENT) + .visibility(this.isScaling ? Visibility.Visible : Visibility.Hidden) + } + .offset({ x: -(this.smallImgWidth / Constants.DOUBLE_NUMBER) }) + .width(this.imageWidth) + .height(Constants.FULL_PERCENT) + .backgroundColor($r('app.color.detail_background')) + } +} + + + + diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/IndexPage.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/IndexPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ff2a768bdd08581246142ec0fdcf5708f7426f5 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/IndexPage.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import Constants from '../common/constants/Constants'; +import Logger from '../common/utils/Logger'; +import PhotoItem from '../view/PhotoItem'; + +@Entry +@Component +struct IndexPage { + swiperController: SwiperController = new SwiperController(); + scroller: Scroller = new Scroller(); + @State currentIndex: number = 0; + @State angle: number = 0; + + build() { + Column() { + Row() { + Text($r('app.string.EntryAbility_label')) + .fontSize($r('app.float.title_font_size')) + .fontWeight(Constants.TITLE_FONT_WEIGHT) + } + .height($r('app.float.navi_bar_height')) + .alignItems(VerticalAlign.Center) + .justifyContent(FlexAlign.Start) + .margin({ top: $r('app.float.grid_padding') }) + .padding({ left: $r('app.float.title_padding') }) + .width(Constants.FULL_PERCENT) + + Swiper(this.swiperController) { + ForEach(Constants.BANNER_IMG_LIST, (item: Resource) => { + Row() { + Image(item) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } + .width(Constants.FULL_PERCENT) + .aspectRatio(Constants.BANNER_ASPECT_RATIO) + }, (item, index) => JSON.stringify(item) + index) + } + .autoPlay(true) + .loop(true) + .margin($r('app.float.grid_padding')) + .borderRadius($r('app.float.img_border_radius')) + .clip(true) + .duration(Constants.BANNER_ANIMATE_DURATION) + .indicator(false) + + Grid() { + ForEach(Constants.IMG_ARR, (photoArr: Array) => { + GridItem() { + PhotoItem({ photoArr }) + } + .width(Constants.FULL_PERCENT) + .aspectRatio(Constants.STACK_IMG_RATIO) + .onClick(() => { + router.pushUrl({ + url: Constants.URL_LIST_PAGE, + params: { photoArr: photoArr } + }).catch((error) => { + Logger.error(Constants.TAG_INDEX_PAGE, JSON.stringify(error)); + }); + }) + }, (item, index) => JSON.stringify(item) + index) + } + .columnsTemplate(Constants.INDEX_COLUMNS_TEMPLATE) + .columnsGap($r('app.float.grid_padding')) + .rowsGap($r('app.float.grid_padding')) + .padding({ left: $r('app.float.grid_padding'), right: $r('app.float.grid_padding') }) + .width(Constants.FULL_PERCENT) + .layoutWeight(1) + } + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/ListPage.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/ListPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..b156f8391143b43d8e308fa6cb5312fa107f76cf --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/pages/ListPage.ets @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import Constants from '../common/constants/Constants'; +import Logger from '../common/utils/Logger'; + +@Entry +@Component +struct ListPage { + photoArr: Array = router.getParams()[`${Constants.PARAM_PHOTO_ARR_KEY}`]; + @State selectedIndex: SubscribedAbstractProperty = AppStorage.SetAndLink(`${Constants.SELECTED_INDEX_KEY}`, 0); + + build() { + Navigation() { + Grid() { + ForEach(this.photoArr, (img: Resource, index: number) => { + GridItem() { + Image(img) + .height(Constants.FULL_PERCENT) + .width(Constants.FULL_PERCENT) + .objectFit(ImageFit.Cover) + .onClick(() => { + this.selectedIndex.set(index); + router.pushUrl({ + url: Constants.URL_DETAIL_LIST_PAGE, + params: { + photoArr: this.photoArr, + } + }).catch((error) => { + Logger.error(Constants.TAG_LIST_PAGE, JSON.stringify(error)); + }); + }) + } + .width(Constants.FULL_PERCENT) + .aspectRatio(1) + }, item => JSON.stringify(item)) + } + .columnsTemplate(Constants.GRID_COLUMNS_TEMPLATE) + .rowsGap(Constants.LIST_ITEM_SPACE) + .columnsGap(Constants.LIST_ITEM_SPACE) + .layoutWeight(1) + } + .title(Constants.PAGE_TITLE) + .hideBackButton(false) + .titleMode(NavigationTitleMode.Mini) + } +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/ets/view/PhotoItem.ets b/ETSUI/ElectronicAlbum/entry/src/main/ets/view/PhotoItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ee471b0498b014c8edd31faa217d913b094e90f --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/ets/view/PhotoItem.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; + +@Component +export default struct PhotoItem { + photoArr: Array; + @State currentIndex: number = 0; + private showCount: number = Constants.SHOW_COUNT / Constants.DOUBLE_NUMBER; + + @Builder albumPicBuilder(img: Resource, index: number) { + Column() { + Image(img) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + .borderRadius($r('app.float.img_border_radius')) + .opacity(1 - (this.showCount - index - 1) * Constants.ITEM_OPACITY_OFFSET) + } + .padding((this.showCount - index - 1) * Constants.PHOTO_ITEM_PADDING) + .offset({ y: (this.showCount - index - 1) * Constants.PHOTO_ITEM_OFFSET }) + .height(Constants.PHOTO_ITEM_PERCENT) + .width(Constants.FULL_PERCENT) + } + + build() { + Stack({ alignContent: Alignment.Top }) { + ForEach(Constants.CACHE_IMG_LIST, (image, index) => { + this.albumPicBuilder(this.photoArr[this.showCount - index - 1], index) + }, (item, index) => JSON.stringify(item) + index) + } + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/module.json5 b/ETSUI/ElectronicAlbum/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..96c8d698c6ac4f509613c4e167ade3711ab6b8e3 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/module.json5 @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/color.json b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..c158b5994e84ab3ce8ae4fd1e0cfe9c5f58bbbcb --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "detail_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/float.json b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..ea118ed8f3a989c50472073f673cd404a5f22681 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/float.json @@ -0,0 +1,28 @@ +{ + "float": [ + { + "name": "detail_list_margin", + "value": "20vp" + }, + { + "name": "img_border_radius", + "value": "12vp" + }, + { + "name": "grid_padding", + "value": "12vp" + }, + { + "name": "title_padding", + "value": "24vp" + }, + { + "name": "title_font_size", + "value": "30fp" + }, + { + "name": "navi_bar_height", + "value": "56vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/string.json b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b3cde113bbed626ccc674ac0514f8bc4ef50aca5 --- /dev/null +++ b/ETSUI/ElectronicAlbum/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": "Electronic Album" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_food_0.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_food_0.png new file mode 100644 index 0000000000000000000000000000000000000000..7567486adbeb2e9183defef17481876c03a4666d Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_food_0.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_food_1.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_food_1.png new file mode 100644 index 0000000000000000000000000000000000000000..2c95dd473caebc0acd592a1ee3c27dd9bbbee478 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_food_1.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_0.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_0.png new file mode 100644 index 0000000000000000000000000000000000000000..fd5fa762ab63b0cb3457944bafed7b484f9c8a00 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_0.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_1.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_1.png new file mode 100644 index 0000000000000000000000000000000000000000..6f62ad071c732d75b17a642e53bd47b606a122b2 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_1.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_2.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_2.png new file mode 100644 index 0000000000000000000000000000000000000000..834340973fe287e70b623b364e58d4e4cf700e56 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_2.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_3.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_3.png new file mode 100644 index 0000000000000000000000000000000000000000..fb11f2e49247d95300914a05fa3a14d18f345fc3 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_3.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_4.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_4.png new file mode 100644 index 0000000000000000000000000000000000000000..0a570c31bdcd4725de97e7d72384fb37c161b5c8 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_4.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_5.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_5.png new file mode 100644 index 0000000000000000000000000000000000000000..453ed1a36874b80331ebe9f42a965254fece4460 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_life_5.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_0.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_0.png new file mode 100644 index 0000000000000000000000000000000000000000..05eb392424950ad5e337e111a7d55e749d0e232f Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_0.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_2.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c537b6a69d29451ec28b2e3b1338719543735db1 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_2.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_3.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_3.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff49dbeab36fee5cbea3411edb4634562940f14 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_men_3.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_0.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_0.png new file mode 100644 index 0000000000000000000000000000000000000000..43717562a9520f65110c9236755224936b2ad96b Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_0.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_1.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_1.png new file mode 100644 index 0000000000000000000000000000000000000000..42565c4526a7425187b981ebbee791a68571b176 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_1.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_2.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_2.png new file mode 100644 index 0000000000000000000000000000000000000000..ba5f262c484fb1792c2118f5b95ef38e47019024 Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/ic_scene_2.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/icon.png b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..0f248102f42c3207258c3ed97effff47fcfd6372 --- /dev/null +++ b/ETSUI/ElectronicAlbum/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,8 @@ +{ + "src": [ + "pages/IndexPage", + "pages/DetailPage", + "pages/ListPage", + "pages/DetailListPage" + ] +} diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/en_US/element/string.json b/ETSUI/ElectronicAlbum/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b3cde113bbed626ccc674ac0514f8bc4ef50aca5 --- /dev/null +++ b/ETSUI/ElectronicAlbum/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": "Electronic Album" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/ElectronicAlbum/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..bc58b1a13e385433f856ffa5f4c3e244c14dc737 --- /dev/null +++ b/ETSUI/ElectronicAlbum/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": "电子相册" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/figures/oh_all_360.gif b/ETSUI/ElectronicAlbum/figures/oh_all_360.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d933e97459d54e9458fd7013fe5755da4b1c175 Binary files /dev/null and b/ETSUI/ElectronicAlbum/figures/oh_all_360.gif differ diff --git a/ETSUI/ElectronicAlbum/figures/oh_detail_360.gif b/ETSUI/ElectronicAlbum/figures/oh_detail_360.gif new file mode 100644 index 0000000000000000000000000000000000000000..6265f6ae7a939ae7958403598f79165c7144efcc Binary files /dev/null and b/ETSUI/ElectronicAlbum/figures/oh_detail_360.gif differ diff --git a/ETSUI/ElectronicAlbum/figures/oh_home_360.png b/ETSUI/ElectronicAlbum/figures/oh_home_360.png new file mode 100644 index 0000000000000000000000000000000000000000..dfd70eca1360ffdb7ddb4d774c95001ec7269655 Binary files /dev/null and b/ETSUI/ElectronicAlbum/figures/oh_home_360.png differ diff --git a/ETSUI/ElectronicAlbum/figures/oh_list_360.gif b/ETSUI/ElectronicAlbum/figures/oh_list_360.gif new file mode 100644 index 0000000000000000000000000000000000000000..317199753c20c6dbf8fc345fdd813435acfbc094 Binary files /dev/null and b/ETSUI/ElectronicAlbum/figures/oh_list_360.gif differ diff --git a/ETSUI/ElectronicAlbum/figures/oh_list_360.png b/ETSUI/ElectronicAlbum/figures/oh_list_360.png new file mode 100644 index 0000000000000000000000000000000000000000..d51c510531acec648623cacf03319ddf8a306c88 Binary files /dev/null and b/ETSUI/ElectronicAlbum/figures/oh_list_360.png differ diff --git a/ETSUI/ElectronicAlbum/figures/zh-cn_image_0000001569303293.png b/ETSUI/ElectronicAlbum/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/ElectronicAlbum/figures/zh-cn_image_0000001569303293.png differ diff --git "a/ETSUI/ElectronicAlbum/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" "b/ETSUI/ElectronicAlbum/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and "b/ETSUI/ElectronicAlbum/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" differ diff --git a/ETSUI/ElectronicAlbum/hvigor/hvigor-config.json5 b/ETSUI/ElectronicAlbum/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ETSUI/ElectronicAlbum/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/hvigor/hvigor-wrapper.js b/ETSUI/ElectronicAlbum/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/ElectronicAlbum/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/hvigorfile.ts b/ETSUI/ElectronicAlbum/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/ElectronicAlbum/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/oh-package.json5 b/ETSUI/ElectronicAlbum/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7439ebb7b4e4dfe392ec9fa825d015d7d77659bc --- /dev/null +++ b/ETSUI/ElectronicAlbum/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "electronicalbum", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/ETSUI/ElectronicAlbum/public_sys-resources/icon-caution.gif b/ETSUI/ElectronicAlbum/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/ElectronicAlbum/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/ElectronicAlbum/public_sys-resources/icon-danger.gif b/ETSUI/ElectronicAlbum/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/ElectronicAlbum/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/ElectronicAlbum/public_sys-resources/icon-note.gif b/ETSUI/ElectronicAlbum/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/ElectronicAlbum/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/ElectronicAlbum/public_sys-resources/icon-notice.gif b/ETSUI/ElectronicAlbum/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/ElectronicAlbum/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/ElectronicAlbum/public_sys-resources/icon-tip.gif b/ETSUI/ElectronicAlbum/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/ElectronicAlbum/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/ElectronicAlbum/public_sys-resources/icon-warning.gif b/ETSUI/ElectronicAlbum/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/ElectronicAlbum/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/FlexLayout/AppScope/app.json5 b/ETSUI/FlexLayout/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d3e2897d2d502897ed3896dbb01aa8e128d7414c --- /dev/null +++ b/ETSUI/FlexLayout/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.flexlayout", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/FlexLayout/AppScope/resources/base/element/string.json b/ETSUI/FlexLayout/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b8d4c6f0c6957920da290ee61293137eebbdef13 --- /dev/null +++ b/ETSUI/FlexLayout/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "FlexLayout" + } + ] +} diff --git a/ETSUI/FlexLayout/AppScope/resources/base/media/app_icon.png b/ETSUI/FlexLayout/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/FlexLayout/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/FlexLayout/LICENSE b/ETSUI/FlexLayout/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/FlexLayout/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/FlexLayout/README.md b/ETSUI/FlexLayout/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4e60a6bebb912bbf2acba1d46c306fa2297577bd --- /dev/null +++ b/ETSUI/FlexLayout/README.md @@ -0,0 +1,321 @@ +# 弹性布局(ArkTS) + +## 介绍 + +本篇Codelab是基于Flex容器组件,实现弹性布局效果。弹性布局的特点是页面元素的宽度按照屏幕分辨率进行适配调整,但整体布局不变。 + +![](figures/zh-cn_image_0000001512636068.gif) + +### 相关概念 + +- [Flex组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-flex.md):以弹性方式布局子组件的容器组件。 +- [Search组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md):搜索框组件,适用于浏览器的搜索内容输入框等应用场景。 +- [Text组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md):显示一段文本的组件。 +- [Image组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md):图片组件,支持本地图片和网络图片的渲染展示。 +- [Scroll组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md):可滑动的容器组件,当子组件的布局尺寸超过父组件的视口时,内容可以滑动。 +- [条件渲染](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/arkts-rendering-control-ifelse.md):条件渲染可根据应用的不同状态,使用if、else和else if渲染对应状态下的UI内容。 +- [循环渲染](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/arkts-rendering-control-foreach.md):基于数组类型数据执行循环渲染。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001554588725.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ └──constants +│ │ └──StyleConstants.ets // 样式常量类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ └──HomePage.ets // 主界面 +│ ├──view +│ │ ├──ClearSearch.ets // 清除历史记录自定义组件 +│ │ ├──FlexLayout.ets // 弹性布局自定义组件 +│ │ └──SearchInput.ets // 搜索输入框自定义组件 +│ └──viewmodel +│ └──SearchViewModel.ets // 历史搜索数据类 +└──entry/src/main/resources // 资源文件目录 +``` + +## 编写搜索框布局 + +在这个章节中,我们需要完成搜索框布局的编写,并实现文本输入和点击事件。效果如图所示: + +![](figures/flexlayout1.png) + +在ets目录下,点击鼠标右键 \> New \> Directory,新建名为view的自定义子组件目录。然后在view目录下,点击鼠标右键 \> New \> ArkTS File,新建名为SearchInput的ArkTS文件。最后在SearchInput.ets文件中,逐步完成如下操作: + +1. 使用@Component新增一个自定义组件,组件名为SearchInput。 +2. 在build\(\)中使用Flex作为容器组件,实现子组件水平排列。 +3. 使用Search组件作为搜索框布局,Text组件作为搜索文本按钮布局。 + +```typescript +// SearchInput.ets +@Component +export default struct SearchInput { + build() { + Flex({ alignItems: ItemAlign.Center }) { + // 搜索框布局 + Search() + ... + + // 搜索文本按钮布局 + Text($r('app.string.search')) + ... + } + ... + } +} +``` + +接下来我们实现Search组件的样式及输入功能,并将输入的数据添加到数组searchArr中: + +1. 使用@State定义变量searchInput,存储搜索框输入的文本内容。 +2. 在Search组件参数中,将变量searchInput赋值给参数value,参数placeholder填写提示内容,参数icon表示搜索图标路径。 +3. 设置高度height、宽度width、背景颜色backgroundColor、提示内容颜色placeholderColor等属性。 +4. 设置onChange事件,将用户输入的内容绑定到变量searchInput中。 +5. 使用@Link定义一个数组变量searchArr,点击搜索文本按钮时,将用户输入的内容即searchInput的值,通过数组的unshift\(\)方法,在数组searchArr的头部添加数据。 + +```typescript +// SearchInput.ets +@Component +export default struct SearchInput { + @State searchInput: string = ''; + @Link searchArr: Array; + + build() { + Flex({ alignItems: ItemAlign.Center }) { + // 搜索框布局 + Search({ + value: this.searchInput, + placeholder: StyleConstants.SEARCH_PLACEHOLDER, + icon: StyleConstants.SEARCH_ICON + }) + .placeholderColor($r('app.color.placeholder_color')) + .placeholderFont({ size: $r('app.float.font_size') }) + .textFont({ size: $r('app.float.font_size') }) + .height(StyleConstants.SEARCH_HEIGHT) + .width(StyleConstants.SEARCH_WIDTH) + .backgroundColor(Color.White) + ... + .onChange((value: string) => { + this.searchInput = value; + }) + + // 搜索文本按钮布局 + Text($r('app.string.search')) + ... + .onClick(() => { + if (this.searchInput !== '' && this.searchInput.trim().length > 0) { + // 使用unshift在数组头部添加数据 + this.searchArr.unshift(this.searchInput.trim()); + } + this.searchInput = ''; + }) + } + ... + } +} +``` + +然后我们在HomePage.ets首页中,引入SearchInput搜索输入框自定义组件。 + +1. 使用@State定义数组变量searchArr,存放最近搜索文本内容。 +2. 在构造参数中,使用$符号引用@State修饰的变量searchArr,将父组件的变量searchArr与子组件searchArr变量关联起来。 + +```typescript +// HomePage.ets +import SearchInput from '../view/SearchInput'; + +@Entry +@Component +struct HomePage { + @State searchArr: Array = SearchViewModel.getSearchArrData(); + + build() { + Column() { + // 搜索输入框自定义组件 + SearchInput({ searchArr: $searchArr }) + } + ... + } +} +``` + +## 编写清除记录布局 + +在这个章节中,我们需要完成清除记录布局的编写,并实现条件渲染。效果如图所示: + +![](figures/flexlayout2.png) + +在view目录下,点击鼠标右键 \> New \> ArkTS File,新建名为ClearSearch的ArkTS文件。然后在ClearSearch.ets文件中,逐步完成如下操作: + +1. 使用@Component新增一个自定义组件,组件名为ClearSearch。 +2. 在build\(\)中使用Flex作为容器组件,实现子组件水平排列。 +3. 使用if/else实现条件渲染:当有搜索内容时,显示最近搜索的文本和清除搜索内容图标;否则就显示没有搜索内容和相关图片。 +4. 使用@Link定义数组变量searchArr,当点击清除搜索内容图标时,所有最近搜索内容清空。 + +```typescript +// ClearSearch.ets +@Component +export default struct ClearSearch { + // 搜索内容数组 + @Link searchArr: Array; + + build() { + Flex({ alignItems: ItemAlign.Center }) { + if (this.searchArr.length > 0) { + Text($r('app.string.recent_searches')) + ... + + Image($r('app.media.ic_delete')) + ... + .onClick(() => { + this.searchArr.splice(0, this.searchArr.length); + this.searchArr.length = 0; + }) + } else { + Column() { + Image($r('app.media.ic_no_search')) + ... + + Text($r('app.string.no_search_content')) + ... + } + ... + } + } + } +} +``` + +然后我们在HomePage.ets首页中,引入ClearSearch搜索输入框自定义组件。 + +```typescript +// HomePage.ets +import SearchInput from '../view/SearchInput'; +import ClearSearch from '../view/ClearSearch'; + +@Entry +@Component +struct HomePage { + @State searchArr: Array = SearchViewModel.getSearchArrData(); + + build() { + Column() { + // 搜索输入框自定义组件 + SearchInput({ searchArr: $searchArr }) + // 清除搜索记录自定义组件 + ClearSearch({ searchArr: $searchArr }) + } + ... + } +} +``` + +## 编写弹性布局 + +在这个章节中,我们需要完成弹性布局的功能样式,并实现循环渲染。效果如图所示: + +![](figures/flexlayout3.png) + +在view目录下,点击鼠标右键 \> New \> ArkTS File,新建名为FlexLayout的ArkTS文件。然后在FlexLayout.ets文件中,逐步完成如下操作: + +1. 使用@Component新增一个自定义组件,组件名为FlexLayout。 +2. 在build\(\)中使用Flex作为容器,设置参数wrap为FlexWrap.Wrap时为弹性布局,实现自动换行。 +3. 使用if实现条件渲染,当有搜索内容时,显示最近搜索的所有内容。 +4. 使用@Link定义数组变量searchArr,表示子组件要显示的所有最近搜索文本内容。 +5. 使用ForEach遍历变量searchArr,实现循环渲染。 + +```typescript +// FlexLayout.ets +@Component +export default struct FlexLayout { + @Link searchArr: Array; + + build() { + Scroll() { + // Flex布局, wrap设置成FlexWrap.Wrap时为弹性布局 + Flex({ justifyContent: FlexAlign.Start, wrap: FlexWrap.Wrap }) { + if (this.searchArr.length > 0) { + // 循环渲染 + ForEach(this.searchArr, (item: string) => { + Text(`${item}`) + ... + }, item => JSON.stringify(item)) + } + } + ... + } + } +} +``` + +然后我们在HomePage.ets首页中,引入FlexLayout搜索输入框自定义组件。 + +```typescript +// HomePage.ets +import SearchInput from '../view/SearchInput'; +import ClearSearch from '../view/ClearSearch'; +import FlexLayout from '../view/FlexLayout'; + +@Entry +@Component +struct HomePage { + @State searchArr: Array = SearchViewModel.getSearchArrData(); + + build() { + Column() { + // 搜索输入框自定义组件 + SearchInput({ searchArr: $searchArr }) + // 清除搜索记录自定义组件 + ClearSearch({ searchArr: $searchArr }) + // 弹性布局自定义组件 + FlexLayout({ searchArr: $searchArr }) + } + ... + } +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用Flex容器组件,实现弹性布局效果。 +2. 使用if/else实现条件渲染。 +3. 使用ForEach实现循环渲染。 + +![](figures/zh-cn_image_0000001562165297.gif) \ No newline at end of file diff --git a/ETSUI/FlexLayout/build-profile.json5 b/ETSUI/FlexLayout/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/FlexLayout/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/build-profile.json5 b/ETSUI/FlexLayout/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/FlexLayout/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/hvigorfile.ts b/ETSUI/FlexLayout/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/FlexLayout/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/FlexLayout/entry/oh-package.json5 b/ETSUI/FlexLayout/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/ETSUI/FlexLayout/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/FlexLayout/entry/src/main/ets/common/constants/StyleConstants.ets b/ETSUI/FlexLayout/entry/src/main/ets/common/constants/StyleConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b15ac89d7c1aab35456bc63aeb7d790b7d6d247 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/common/constants/StyleConstants.ets @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Style constants for all Component. + */ +export default class StyleConstants { + /** + * Font weight. + */ + static readonly FONT_WEIGHT: number = 500; + + /** + * One hundred percent. + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * Recent text height. + */ + static readonly RECENT_TEXT_HEIGHT: string = '2.7%'; + + /** + * Recent text width. + */ + static readonly RECENT_TEXT_WIDTH: string = '48.9%'; + + /** + * Delete image height. + */ + static readonly DELETE_IMAGE_HEIGHT: string = '4%'; + + /** + * Delete image width. + */ + static readonly DELETE_IMAGE_WIDTH: string = '6.7%'; + + /** + * No search image height. + */ + static readonly NO_SEARCH_IMAGE_HEIGHT: string = '15.4%'; + + /** + * No search image width. + */ + static readonly NO_SEARCH_IMAGE_WIDTH: string = '33.3%'; + + /** + * No search text height. + */ + static readonly NO_SEARCH_TEXT_HEIGHT: string = '2.7%'; + + /** + * No search text width. + */ + static readonly NO_SEARCH_TEXT_WIDTH: string = '26.7%'; + + /** + * Flew layout padding top. + */ + static readonly FLEX_PADDING_TOP: string = '0.8%'; + + /** + * Flew layout padding bottom. + */ + static readonly FLEX_PADDING_BOTTOM: string = '0.8%'; + + /** + * Flew layout padding left. + */ + static readonly FLEX_PADDING_LEFT: string = '4.4%'; + + /** + * Flew layout padding right. + */ + static readonly FLEX_PADDING_RIGHT: string = '4.4%'; + + /** + * Search input height. + */ + static readonly SEARCH_HEIGHT: string = '5.1%'; + + /** + * Search input width. + */ + static readonly SEARCH_WIDTH: string = '81.1%'; + + /** + * Text max line. + */ + static readonly TEXT_MAX_LINE: number = 2; + + /** + * Search placeholder. + */ + static readonly SEARCH_PLACEHOLDER: string = '搜索...'; + + /** + * Layout weight. + */ + static readonly LAYOUT_WEIGHT: number = 8; + + /** + * Search icon. + */ + static readonly SEARCH_ICON: string = '/resources/base/media/ic_search.png'; +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/FlexLayout/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..89b2f96abae71dacf3564426e42a029521413ed4 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/HomePage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/FlexLayout/entry/src/main/ets/pages/HomePage.ets b/ETSUI/FlexLayout/entry/src/main/ets/pages/HomePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..9336991f125dc943c6eefe141dde6b28b4574f25 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/pages/HomePage.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Huawei Device 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 StyleConstants from '../common/constants/StyleConstants'; +import SearchInput from '../view/SearchInput'; +import ClearSearch from '../view/ClearSearch'; +import FlexLayout from '../view/FlexLayout'; +import SearchViewModel from '../viewmodel/SearchViewModel'; + +@Entry +@Component +struct HomePage { + @State searchArr: Array = SearchViewModel.getSearchArrData(); + + build() { + Column() { + // Customized component of the search text box. + SearchInput({ searchArr: $searchArr}) + // Clear Search Records Custom Component. + ClearSearch({ searchArr: $searchArr }) + // Flexible Layout Customization Component. + FlexLayout({ searchArr: $searchArr }) + } + .height(StyleConstants.FULL_PERCENT) + .width(StyleConstants.FULL_PERCENT) + .alignItems(HorizontalAlign.Center) + .backgroundColor($r('app.color.index_background')) + } +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/ets/view/ClearSearch.ets b/ETSUI/FlexLayout/entry/src/main/ets/view/ClearSearch.ets new file mode 100644 index 0000000000000000000000000000000000000000..4039286db7914c3f481c9e248014057c65e2d85d --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/view/ClearSearch.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023 Huawei Device 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 StyleConstants from '../common/constants/StyleConstants'; + +@Component +export default struct ClearSearch { + @Link searchArr: Array; + + build() { + Flex({ alignItems: ItemAlign.Center }) { + if (this.searchArr.length > 0) { + Text($r('app.string.recent_searches')) + .fontSize($r('app.float.font_size')) + .fontColor($r('app.color.recent_search_font_color')) + .fontWeight(StyleConstants.FONT_WEIGHT) + .height(StyleConstants.RECENT_TEXT_HEIGHT) + .layoutWeight(StyleConstants.LAYOUT_WEIGHT) + .margin({ + left: $r('app.float.margin_left'), + top: $r('app.float.clear_text_top'), + bottom: $r('app.float.clear_text_bottom') + }) + + Image($r('app.media.ic_delete')) + .height(StyleConstants.DELETE_IMAGE_HEIGHT) + .width(StyleConstants.DELETE_IMAGE_WIDTH) + .margin({ right: $r('app.float.clear_image_right') }) + .onClick(() => { + this.searchArr.splice(0, this.searchArr.length); + this.searchArr.length = 0; + }) + } else { + Column() { + Image($r('app.media.ic_no_search')) + .height(StyleConstants.NO_SEARCH_IMAGE_HEIGHT) + .width(StyleConstants.NO_SEARCH_IMAGE_WIDTH) + .margin({ + top: $r('app.float.clear_no_search_top'), + bottom: $r('app.float.margin_top_bottom') + }) + + Text($r('app.string.no_search_content')) + .fontSize($r('app.float.font_size')) + .fontColor($r('app.color.no_search_font_color')) + .height(StyleConstants.NO_SEARCH_TEXT_HEIGHT) + .width(StyleConstants.NO_SEARCH_TEXT_WIDTH) + } + .width(StyleConstants.FULL_PERCENT) + .justifyContent(FlexAlign.Center) + } + } + } +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/ets/view/FlexLayout.ets b/ETSUI/FlexLayout/entry/src/main/ets/view/FlexLayout.ets new file mode 100644 index 0000000000000000000000000000000000000000..a6254cef0cf0ccd38c784766526946dbf794aded --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/view/FlexLayout.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 StyleConstants from '../common/constants/StyleConstants'; + +@Component +export default struct FlexLayout { + @Link searchArr: Array; + + build() { + Scroll() { + Flex({ justifyContent: FlexAlign.Start, wrap: FlexWrap.Wrap }) { + if (this.searchArr.length > 0) { + ForEach(this.searchArr, (item: string) => { + Text(`${item}`) + .fontSize($r("app.float.flex_font_size")) + .borderStyle(BorderStyle.Solid) + .borderWidth($r('app.float.border_width')) + .borderColor($r("app.color.flex_layout_color")) + .borderRadius($r('app.float.border_radius')) + .backgroundColor($r("app.color.flex_layout_color")) + .padding({ + top: StyleConstants.FLEX_PADDING_TOP, + bottom: StyleConstants.FLEX_PADDING_BOTTOM, + left: StyleConstants.FLEX_PADDING_LEFT, + right: StyleConstants.FLEX_PADDING_RIGHT + }) + .margin({ + top: $r("app.float.flex_layout_margin"), + right: $r("app.float.flex_layout_margin") + }) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(StyleConstants.TEXT_MAX_LINE) + }, item => JSON.stringify(item)) + } + } + .margin({ + left: $r('app.float.margin_left'), + right: $r('app.float.margin_left') + }) + .padding({ bottom: $r('app.float.margin_left') }) + } + } +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/ets/view/SearchInput.ets b/ETSUI/FlexLayout/entry/src/main/ets/view/SearchInput.ets new file mode 100644 index 0000000000000000000000000000000000000000..066b3641c3c54852a862bbde0ac6d054624b3d2c --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/view/SearchInput.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device 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 StyleConstants from '../common/constants/StyleConstants'; + +@Component +export default struct SearchInput { + @State searchInput: string = ''; + @Link searchArr: Array; + + build() { + Flex({ alignItems: ItemAlign.Center }) { + // Search component. + Search({ + value: this.searchInput, + placeholder: StyleConstants.SEARCH_PLACEHOLDER, + icon: StyleConstants.SEARCH_ICON + }) + .placeholderColor($r('app.color.placeholder_color')) + .placeholderFont({ size: $r('app.float.font_size') }) + .textFont({ size: $r('app.float.font_size') }) + .height(StyleConstants.SEARCH_HEIGHT) + .width(StyleConstants.SEARCH_WIDTH) + .backgroundColor(Color.White) + .margin({ + left: $r('app.float.margin_left'), + right: $r('app.float.margin_right'), + top: $r('app.float.margin_top_bottom'), + bottom: $r('app.float.margin_top_bottom') + }) + .border({ + width: $r('app.float.border_width'), + color: $r('app.color.border_color'), + radius: $r('app.float.border_radius'), + style: BorderStyle.Solid + }) + .onChange((value: string) => { + this.searchInput = value; + }) + + // Search Text. + Text($r('app.string.search')) + .fontSize($r('app.float.font_size')) + .fontColor($r('app.color.search_font_color')) + .height(StyleConstants.SEARCH_HEIGHT) + .onClick(() => { + if (this.searchInput !== '' && this.searchInput.trim().length > 0) { + // Use unshift to add data to the array header. + this.searchArr.unshift(this.searchInput.trim()); + } + this.searchInput = ''; + }) + } + .width(StyleConstants.FULL_PERCENT) + } +} diff --git a/ETSUI/FlexLayout/entry/src/main/ets/viewmodel/SearchViewModel.ets b/ETSUI/FlexLayout/entry/src/main/ets/viewmodel/SearchViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5d74c05435533b93f52bd54d3eeb2eb001f19e5 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/ets/viewmodel/SearchViewModel.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Search view model. + */ +class SearchViewModel { + /** + * Get search arr data. + */ + getSearchArrData() { + let listItems: Array = [ + 'Text', 'Button', 'TextField', 'Image', + 'Switch', 'Checkbox', 'RadioButton', + 'ProgressBar', 'ScrollView' + ]; + return listItems; + } +} + +export default new SearchViewModel(); \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/module.json5 b/ETSUI/FlexLayout/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4b4b749fe4bd34efd23f7e9eaed1abd3a097af50 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/element/color.json b/ETSUI/FlexLayout/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..56cd79b9da60c49cd449f522a9e1adf2a54ba20a --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/resources/base/element/color.json @@ -0,0 +1,40 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "index_background", + "value": "#F1F3F5" + }, + { + "name": "recent_search_font_color", + "value": "#182431" + }, + { + "name": "no_search_font_color", + "value": "#99182431" + }, + { + "name": "placeholder_color", + "value": "#787F87" + }, + { + "name": "caret_color", + "value": "#33182431" + }, + { + "name": "border_color", + "value": "#33182431" + }, + { + "name": "search_font_color", + "value": "#007DFF" + }, + { + "name": "flex_layout_color", + "value": "#E5E8EA" + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/element/float.json b/ETSUI/FlexLayout/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..f5648032fdc4438fa6528cf56f449c07071f7154 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/resources/base/element/float.json @@ -0,0 +1,52 @@ +{ + "float": [ + { + "name": "font_size", + "value": "16fp" + }, + { + "name": "flex_font_size", + "value": "12fp" + }, + { + "name": "border_radius", + "value": "20vp" + }, + { + "name": "border_width", + "value": "1vp" + }, + { + "name": "flex_layout_margin", + "value": "10vp" + }, + { + "name": "margin_left", + "value": "12vp" + }, + { + "name": "margin_right", + "value": "15vp" + }, + { + "name": "margin_top_bottom", + "value": "8vp" + }, + { + "name": "clear_image_right", + "value": "12vp" + }, + { + "name": "clear_text_top", + "value": "12vp" + }, + { + "name": "clear_text_bottom", + "value": "4vp" + }, + { + "name": "clear_no_search_top", + "value": "172vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/element/string.json b/ETSUI/FlexLayout/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3ec82907ee367c14ec9b133d32554362036d1ea8 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "FlexLayout" + }, + { + "name": "recent_searches", + "value": "Recent Searches" + }, + { + "name": "no_search_content", + "value": "There is no search content" + }, + { + "name": "search", + "value": "Search" + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_delete.png b/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..228e35a8b9cb7024d772aef22be6a58287368700 Binary files /dev/null and b/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_delete.png differ diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_no_search.png b/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_no_search.png new file mode 100644 index 0000000000000000000000000000000000000000..ef922f171d3d27f9d94c0949dcd1756e71f24c25 Binary files /dev/null and b/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_no_search.png differ diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_search.png b/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_search.png new file mode 100644 index 0000000000000000000000000000000000000000..bc18eb58dc1ea902f1bbb8f71b529d36c31f0d0e Binary files /dev/null and b/ETSUI/FlexLayout/entry/src/main/resources/base/media/ic_search.png differ diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/media/icon.png b/ETSUI/FlexLayout/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/FlexLayout/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/FlexLayout/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/FlexLayout/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..8607be393726d65baba7d64deacc51ce1c8f143d --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/HomePage" + ] +} diff --git a/ETSUI/FlexLayout/entry/src/main/resources/en_US/element/string.json b/ETSUI/FlexLayout/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3ec82907ee367c14ec9b133d32554362036d1ea8 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "FlexLayout" + }, + { + "name": "recent_searches", + "value": "Recent Searches" + }, + { + "name": "no_search_content", + "value": "There is no search content" + }, + { + "name": "search", + "value": "Search" + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/FlexLayout/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..39fe0167bb88d6f377ab5780287eaa3609c7fc50 --- /dev/null +++ b/ETSUI/FlexLayout/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "FlexLayout" + }, + { + "name": "recent_searches", + "value": "最近搜索" + }, + { + "name": "no_search_content", + "value": "没有搜索内容" + }, + { + "name": "search", + "value": "搜索" + } + ] +} \ No newline at end of file diff --git a/ETSUI/FlexLayout/figures/flexlayout1.png b/ETSUI/FlexLayout/figures/flexlayout1.png new file mode 100644 index 0000000000000000000000000000000000000000..e5d85a7fd4bbec8c59e33f61b328e9ca035dbd47 Binary files /dev/null and b/ETSUI/FlexLayout/figures/flexlayout1.png differ diff --git a/ETSUI/FlexLayout/figures/flexlayout2.png b/ETSUI/FlexLayout/figures/flexlayout2.png new file mode 100644 index 0000000000000000000000000000000000000000..d2d944af74fdc80b0e7d78bbfc20e49573e2ffdf Binary files /dev/null and b/ETSUI/FlexLayout/figures/flexlayout2.png differ diff --git a/ETSUI/FlexLayout/figures/flexlayout3.png b/ETSUI/FlexLayout/figures/flexlayout3.png new file mode 100644 index 0000000000000000000000000000000000000000..1f8027acb91593be512e95cd414f518fae614649 Binary files /dev/null and b/ETSUI/FlexLayout/figures/flexlayout3.png differ diff --git a/ETSUI/FlexLayout/figures/zh-cn_image_0000001512636068.gif b/ETSUI/FlexLayout/figures/zh-cn_image_0000001512636068.gif new file mode 100644 index 0000000000000000000000000000000000000000..798d9186cd44f736b57b9ea01ed9e0f223c97827 Binary files /dev/null and b/ETSUI/FlexLayout/figures/zh-cn_image_0000001512636068.gif differ diff --git a/ETSUI/FlexLayout/figures/zh-cn_image_0000001554588725.png b/ETSUI/FlexLayout/figures/zh-cn_image_0000001554588725.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/FlexLayout/figures/zh-cn_image_0000001554588725.png differ diff --git a/ETSUI/FlexLayout/figures/zh-cn_image_0000001562165297.gif b/ETSUI/FlexLayout/figures/zh-cn_image_0000001562165297.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ETSUI/FlexLayout/figures/zh-cn_image_0000001562165297.gif differ diff --git a/ETSUI/FlexLayout/hvigor/hvigor-config.json5 b/ETSUI/FlexLayout/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/ETSUI/FlexLayout/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/ETSUI/FlexLayout/hvigor/hvigor-wrapper.js b/ETSUI/FlexLayout/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/FlexLayout/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/FlexLayout/hvigorfile.ts b/ETSUI/FlexLayout/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/FlexLayout/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/FlexLayout/oh-package.json5 b/ETSUI/FlexLayout/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e711697979967dd8ed083e3983353ab2477ad7fd --- /dev/null +++ b/ETSUI/FlexLayout/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "flexlayout", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/MultipleDialog/AppScope/app.json5 b/ETSUI/MultipleDialog/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e3fe9f4520ad39c9a4aeb36a733abba967e50afc --- /dev/null +++ b/ETSUI/MultipleDialog/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.multipledialog", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/MultipleDialog/AppScope/resources/base/element/string.json b/ETSUI/MultipleDialog/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..34137ae25a0980eab33f188e93a269de039fddd2 --- /dev/null +++ b/ETSUI/MultipleDialog/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MultipleDialog" + } + ] +} diff --git a/ETSUI/MultipleDialog/AppScope/resources/base/media/app_icon.png b/ETSUI/MultipleDialog/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/MultipleDialog/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/MultipleDialog/LICENSE b/ETSUI/MultipleDialog/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/MultipleDialog/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/MultipleDialog/README.md b/ETSUI/MultipleDialog/README.md new file mode 100644 index 0000000000000000000000000000000000000000..da9981241e571fab8b02d20886a313a2e2f441f1 --- /dev/null +++ b/ETSUI/MultipleDialog/README.md @@ -0,0 +1,462 @@ +# 构建多种样式弹窗(ArkTS) + +## 介绍 + +本篇Codelab将介绍如何使用弹窗功能,实现四种类型弹窗。分别是:警告弹窗、自定义弹窗、日期滑动选择器弹窗、文本滑动选择器弹窗。需要完成以下功能: + +1. 点击左上角返回按钮展示警告弹窗。 +2. 点击出生日期展示日期滑动选择器弹窗。 +3. 点击性别展示文本滑动选择器弹窗。 +4. 点击兴趣爱好(多选)展示自定义弹窗。 + +![](figures/MultipeDialog.gif) + +### 相关概念 +- [警告弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-alert-dialog-box.md):显示警告弹窗组件,可设置文本内容与响应回调。 +- [自定义弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md): 通过CustomDialogController类显示自定义弹窗。 +- [日期滑动选择器弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-datepicker-dialog.md):根据指定范围的Date创建可以选择日期的滑动选择器,展示在弹窗上。 +- [文本滑动选择器弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-textpicker-dialog.md):根据指定的选择范围创建文本选择器,展示在弹窗上。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + + + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ └──HobbyBean.ets // 兴趣爱好bean类 +│ │ ├──constants +│ │ │ └──CommonConstants.ets // 常量类 +│ │ └──utils +│ │ ├──CommonUtils.ets // 弹窗操作工具类 +│ │ └──Logger.ets // 日志打印工具类 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──pages +│ │ └──HomePage.ets // 主页面 +│ └──view +│ ├──CustomDialogWidget.ets // 自定义弹窗组件 +│ ├──TextCommonWidget.ets // 自定义Text组件 +│ └──TextInputWidget.ets // 自定义TextInput组件 +└──entry/src/main/resources // 资源文件目录 +``` + +## 构建主页面 + +应用主页面采用Column容器嵌套自定义组件形式完成页面整体布局,效果如图所示: + +![](figures/MainPage.png) + +从上面效果图可以看出,主界面由2个相同样式的文本输入框和3个相同样式的文本布局组成。我们可以将文本输入框抽取成TextInputWidget子组件。再将文本布局抽取成TextCommonWidget子组件。 + +1. 在ets目录下,点击鼠标右键 > New > Directory,新建名为view的自定义子组件目录。然后在view目录下,点击鼠标右键 > New > ArkTS File,新建两个ArkTS文件,分别为TextInputWidget子组件、TextCommonWidget子组件。 + +2. 文本输入框抽取成TextInputWidget子组件,效果如图所示: + + ![](figures/TextInputWidget.png) + + ```typescript + // TextInputWidget.ets + @Component + export default struct TextInputWidget { + // 文本框左侧图片 + private inputImage: Resource; + // 文本框提示 + private hintText: Resource; + + build() { + Row() { + Image(this.inputImage) + ... + TextInput({ placeholder: this.hintText }) + ... + } + ... + } + } + ``` + +3. 文本布局抽取成TextCommonWidget子组件,效果如图所示: + + ![](figures/TextCommonWidget.png) + + ```typescript + // TextCommonWidget.ets + @Component + export default struct TextCommonWidget { + // 显示内容 + @Link content: string; + // 文字标题左侧图片 + private textImage: Resource; + // 文本标题 + private title: Resource; + // 点击事件回调 + onItemClick: () => void; + + build() { + Row() { + Image(this.textImage) + ... + Text(this.title) + ... + Text(this.content) + ... + Image($r('app.media.ic_arrow')) + .... + } + .onClick(this.onItemClick) + ... + } + } + ``` + +4. 在HomePage主界面引用TextInputWidget和TextCommonWidget子组件,然后初始化出生日期、性别、兴趣爱好默认数据。 + + ```typescript + // HomePage.ets + @Entry + @Component + struct HomePage { + @State birthdate: string = ''; + @State sex: string = ''; + @State hobbies: string = ''; + + build() { + Column() { + ... + TextInputWeight({ + inputImage: $r("app.media.ic_nickname"), + hintText: $r("app.string.text_input_hint") + }) + TextCommonWeight({ + textImage: $r("app.media.ic_birthdate"), + title: $r("app.string.title_birthdate"), + content: $birthdate, + onItemClick: () => { + CommonUtils.datePickerDialog((birthValue: string) => { + this.birthdate = birthValue; + }); + } + }) + TextCommonWeight({ + textImage: $r("app.media.ic_sex"), + title: $r("app.string.title_sex"), + content: $sex, + onItemClick: () => { + CommonUtils.textPickerDialog(this.sexArray, (sexValue: string) => { + this.sex = sexValue; + }); + } + }) + TextInputWeight({ + inputImage: $r("app.media.ic_signature"), + hintText: $r("app.string.text_input_signature") + }) + TextCommonWeight({ + textImage: $r("app.media.ic_hobbies"), + title: $r("app.string.title_hobbies"), + content: $hobbies, + onItemClick: () => { + this.customDialogController.open(); + } + }) + } + ... + } + } + ``` + +## 警告弹窗 + +点击主页面左上角返回按钮,通过CommonUtils.alertDialog方法弹出警告弹窗,提醒用户是否进行当前操作,效果如图所示: + +![](figures/AlertDialog.gif) + +```typescript +// CommonUtils.ets +alertDialog(context: Context.UIAbilityContext) { + AlertDialog.show({ + // 提示信息 + message: $r('app.string.alert_dialog_message'), + // 弹窗显示位置 + alignment: DialogAlignment.Bottom, + // 弹窗偏移位置 + offset: { + dx: 0, + dy: CommonConstants.DY_OFFSET + }, + primaryButton: { + ... + }, + secondaryButton: { + // 退出应用 + context.terminateSelf(); + ... + } + }); +} +``` + +## 日期滑动选择器弹窗 + +点击出生日期选项,通过CommonUtils.datePickerDialog方法弹出日期选择器弹窗,根据需要选择相应时间,效果如图所示: + +![](figures/DatePickerDialog.gif) + +```typescript +// CommonUtils.ets +datePickerDialog(dateCallback) { + DatePickerDialog.show({ + // 开始时间 + start: new Date(CommonConstants.START_TIME), + // 结束时间 + end: new Date(CommonConstants.END_TIME), + // 当前选中时间 + selected: new Date(), + // 是否显示农历 + lunar: false, + onAccept: (value: DatePickerResult) => { + let year = value.year; + let month = value.month + CommonConstants.PLUS_ONE; + let day = value.day; + let birthdate: string = this.getBirthDateValue(year, month, day); + dateCallback(birthdate); + } + }); +} + +// 获取出生日期值 +getBirthDateValue(year: number, month: number, day: number): string { + let birthdate: string = `${year}${CommonConstants.DATE_YEAR}${month}` + + `${CommonConstants.DATE_MONTH}${day}${CommonConstants.DATE_DAY}`; + return birthdate; +} + +// HomePage.ets +build() { + Column() { + ... + TextCommonWeight({ + textImage: $r('app.media.ic_birthdate'), + title: $r("app.string.title_birthdate"), + content: $birthdate, + onItemClick: () => { + CommonUtils.datePickerDialog((birthValue: string) => { + this.birthdate = birthValue; + }); + } + }) + ... + } + ... +} +``` + +## 文本滑动选择器弹窗 + +点击性别选项,通过CommonUtils.textPickerDialog方法弹出性别选择器弹窗,根据需要选择相应性别,效果如图所示: + +![](figures/TextPickerDialog.gif) + +```typescript +// CommonUtils.ets +textPickerDialog(sexArray: Resource, sexCallback) { + TextPickerDialog.show({ + range: sexArray, + selected: 0, + onAccept: (result: TextPickerResult) => { + sexCallback(result.value); + }, + onCancel: () => { + ... + } + }); +} + +// HomePage.ets +build() { + Column() { + ... + TextCommonWeight({ + textImage: $r('app.media.ic_sex'), + title: $r("app.string.title_sex"), + content: $sex, + onItemClick: () => { + CommonUtils.textPickerDialog(this.sexArray, (sexValue: string) => { + this.sex= sexValue; + }); + } + }) + ... + } + ... +} +``` + +## 自定义弹窗 + +点击兴趣爱好选项,通过customDialogController.open方法弹出自定义弹窗,根据需要选择相应的兴趣爱好,效果如图所示: + +![](figures/CustomDialog.gif) + +自定义弹窗实现分为以下步骤: + +1. 在view目录下,点击鼠标右键 > New > ArkTS File,新建一个ArkTS文件,然后命名为CustomDialogWeight子组件。 + +2. 在CustomDialogWeight的aboutToAppear方法,通过manager.getStringArrayValue方法获取本地资源数据进行初始化。 + + ```typescript + // CustomDialogWeight.ets + @State hobbyBeans: hobbyBean[] = []; + + aboutToAppear() { + let context: Context = getContext(this); + if (CommonUtils.isEmpty(context) || CommonUtils.isEmpty(context.resourceManager)) { + Logger.error(CommonConstants.TAG_CUSTOM, 'context or resourceManager is null'); + return; + } + let manager = context.resourceManager; + manager.getStringArrayValue($r("app.strarray.hobbies_data").id, (error, hobbyArray) => { + if (!CommonUtils.isEmpty(error)) { + Logger.error(CommonConstants.TAG_CUSTOM, 'error = ' + JSON.stringify(error)); + } else { + hobbyArray.forEach((hobbyItem: string) => { + let hobbyBean = new HobbyBean(); + hobbyBean.label = hobbyItem; + hobbyBean.isChecked = false; + this.hobbyBeans.push(hobbyBean); + }); + } + }); + } + ``` + +3. 当用户点击确定按钮时,通过setHobbiesValue方法处理自定义弹窗选项结果。 + + ```typescript + // CustomDialogWeight.ets + @State hobbyBeans: hobbyBean[] = []; + @Link hobbies: string; + + // 处理自定义弹窗选项结果 + setHobbiesValue(hobbyBeans: HobbyBean[]) { + if (CommonUtils.isEmptyArr(hobbyBeans)) { + Logger.error(CommonConstants.TAG_CUSTOM, 'hobbyBeans length is 0'); + return; + } + let hobbiesText: string = ''; + hobbiesText = hobbyBeans.filter((isCheckItem: HobbyBean) => isCheckItem?.isChecked) + .map((checkedItem: HobbyBean) => { + return checkedItem.label; + }) + .join(CommonConstants.COMMA); + if (hobbiesText.length > 0) { + this.hobbies = hobbiesText; + } + } + + build() { + Column() { + ... + Row() { + Button($r('app.string.cancel_button')) + .dialogButtonStyle() + .onClick(() => { + this.controller.close(); + }) + Blank() + ... + Button($r('app.string.definite_button')) + .dialogButtonStyle() + .onClick(() => { + this.setHobbiesValue(this.hobbyBeans); + this.controller.close(); + }) + } + } + ... + } + + @Extend(Button) function dialogButtonStyle() { + .... + } + ``` + +4. 通过@Link修饰的hobbies把值赋给HomePage的hobbies,然后hobbies刷新显示内容。 + + ```typescript + // HomePage.ets + @State hobbies: string = ''; + customDialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogComponent({ + hobbies: $hobbies + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + offset: { + dx: 0, + dy: CommonConstants.DY_OFFSET + } + }); + + build() { + Column() { + ... + TextCommonWeight({ + textImage: $r('app.media.ic_hobbies'), + title: $r("app.string.title_hobbies"), + content: $hobbies, + onItemClick: () => { + // 打开自定义弹窗 + this.customDialogController.open(); + } + }) + } + ... + } + ``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用CustomDialogController实现自定义弹窗。 +2. 使用AlertDialog实现警告弹窗。 +3. 使用DatePickerDialog实现日期滑动选择弹窗。 +4. 使用TextPickerDialog实现文本滑动选择弹窗。 + +![](figures/congratulations.gif) diff --git a/ETSUI/MultipleDialog/build-profile.json5 b/ETSUI/MultipleDialog/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7e443c9990df03928f4c23604aba62b3b5323ec1 --- /dev/null +++ b/ETSUI/MultipleDialog/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/build-profile.json5 b/ETSUI/MultipleDialog/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/hvigorfile.ts b/ETSUI/MultipleDialog/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/MultipleDialog/entry/oh-package.json5 b/ETSUI/MultipleDialog/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/common/bean/HobbyBean.ets b/ETSUI/MultipleDialog/entry/src/main/ets/common/bean/HobbyBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..1bb82dfd6d99483d9705ecc197380f1769cb48ed --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/common/bean/HobbyBean.ets @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Hobby info bean. + */ +export default class HobbyBean { + /** + * Hobby title + */ + label: string; + + /** + * Hobby check status + */ + isChecked: boolean; +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/MultipleDialog/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..4dc496b195d27c12caad07bbee7f3db54482600b --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Common constants for all features. + */ +export default class CommonConstants { + /** + * The entry ability tag. + */ + static readonly TAG_ABILITY: string = 'EntryAbility'; + + /** + * The home page tag. + */ + static readonly TAG_HOME: string = 'HomePage'; + + /** + * The Common utils tag. + */ + static readonly TAG_COMMON_UTILS: string = 'CommonUtils'; + + /** + * Custom dialog widget tag. + */ + static readonly TAG_CUSTOM: string = 'CustomDialogWidget'; + + /** + * Width the percentage of the 100. + */ + static readonly FULL_WIDTH: string = '100%'; + + /** + * Height the percentage of the 100. + */ + static readonly FULL_HEIGHT: string = '100%'; + + /** + * Date year + */ + static readonly DATE_YEAR: string = '年'; + + /** + * Date month + */ + static readonly DATE_MONTH: string = '月'; + + /** + * Date day + */ + static readonly DATE_DAY: string = '日'; + + /** + * Date dialog start time. + */ + static readonly START_TIME: string = '1900-1-1'; + + /** + * Date dialog select time. + */ + static readonly SELECT_TIME: string = '1990-1-1'; + + /** + * Image back margin left of the 7.2. + */ + static readonly BACK_MARGIN_LEFT: string = '7.2%'; + + /** + * Image avatar margin top of the 5.5. + */ + static readonly AVATAR_MARGIN_TOP: string = '5.5%'; + + /** + * Text personal margin top of the 2.1. + */ + static readonly PERSONAL_MARGIN_TOP: string = '2.1%'; + + /** + * Common dialog width of the 93.3. + */ + static readonly COMMON_DIALOG_WIDTH: string = '93.3%'; + + /** + * Join comma + */ + static readonly COMMA: string = ','; + + /** + * Image back margin top of the 19. + */ + static readonly BACK_MARGIN_TOP: number = 19; + + /** + * Font weight of the 500. + */ + static readonly BIGGER: number = 500; + + /** + * Dialog y-axis offset distance of the 20. + */ + static readonly DY_OFFSET: number = -20; + + /** + * Current month plus one. + */ + static readonly PLUS_ONE: number = 1; + + /** + * Layout weight size of the 1. + */ + static readonly WEIGHT_ONE: number = 1; + + /** + * Text common max lines of the 1. + */ + static readonly ONE_LINES: number = 1; +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/CommonUtils.ets b/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/CommonUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..25e4051af7c1d475eb6430fdf97462e794889f4f --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/CommonUtils.ets @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Context from '@ohos.app.ability.common'; +import Logger from './Logger'; +import CommonConstants from '../constants/CommonConstants'; + +/** + * This is a pop-up window tool class, which is used to encapsulate dialog code. + * Developers can directly invoke the methods in. + */ +export class CommonUtils { + /** + * Alert dialog dialog + */ + alertDialog(context: Context.UIAbilityContext) { + AlertDialog.show({ + message: $r('app.string.alert_dialog_message'), + alignment: DialogAlignment.Bottom, + offset: { + dx: 0, + dy: CommonConstants.DY_OFFSET + }, + primaryButton: { + value: $r('app.string.cancel_button'), + action: () => { + Logger.info(CommonConstants.TAG_COMMON_UTILS, 'Callback cancel button is clicked'); + } + }, + secondaryButton: { + value: $r('app.string.definite_button'), + action: () => { + // Exiting the app. + context.terminateSelf(); + Logger.info(CommonConstants.TAG_COMMON_UTILS, 'Callback definite button is clicked'); + } + } + }); + } + + + /** + * Date dialog dialog + */ + datePickerDialog(dateCallback) { + DatePickerDialog.show({ + start: new Date(CommonConstants.START_TIME), + end: new Date(), + selected: new Date(CommonConstants.SELECT_TIME), + lunar: false, + onAccept: (value: DatePickerResult) => { + let year = value.year; + let month = value.month + CommonConstants.PLUS_ONE; + let day = value.day; + let birthdate: string = this.getBirthDateValue(year, month, day); + dateCallback(birthdate); + } + }); + } + + /** + * Text dialog dialog + */ + textPickerDialog(sexArray: Resource, sexCallback) { + if (this.isEmptyArr(sexArray)) { + Logger.error(CommonConstants.TAG_COMMON_UTILS, 'sex is null'); + return; + } + TextPickerDialog.show({ + range: sexArray, + selected: 0, + onAccept: (result: TextPickerResult) => { + sexCallback(result.value); + }, + onCancel: () => { + Logger.info(CommonConstants.TAG_COMMON_UTILS, 'TextPickerDialog onCancel'); + } + }); + } + + /** + * Get default birth date + * + * @param {number} year year + * @param {number} month month + * @param {number} day day + * @returns {string} return birth date + */ + getBirthDateValue(year: number, month: number, day: number): string { + let birthdate: string = `${year}${CommonConstants.DATE_YEAR}${month}` + + `${CommonConstants.DATE_MONTH}${day}${CommonConstants.DATE_DAY}`; + return birthdate; + } + + /** + * Check obj is empty + * + * @param {object} obj + * @return {boolean} true(empty) + */ + isEmpty(obj): boolean { + return obj === undefined || obj === null || obj === ''; + } + + /** + * Check array is empty + * + * @param {Array}array + * @return {boolean} true(empty) + */ + isEmptyArr(array): boolean { + return this.isEmpty(array) || array.length === 0; + } +} + +export default new CommonUtils(); \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/Logger.ets b/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..7701200f06ff6737c0e813c674f989b695c4ab55 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('MultipleDialog', 0xFF00) \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/entryability/EntryAbility.ets b/ETSUI/MultipleDialog/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..37700711adce65e5b739a146b96fcb9b6671837e --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; +import Logger from '../common/utils/Logger'; +import CommonConstants from '../common/constants/CommonConstants'; + +/** + * Lift cycle management of Ability. + */ +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability. + windowStage.loadContent('pages/HomePage', (err, data) => { + if (err.code) { + Logger.error(CommonConstants.TAG_ABILITY, 'Failed to load the content. Cause:' + JSON.stringify(err)); + return; + } + Logger.info(CommonConstants.TAG_ABILITY, 'Succeeded to load the content. Data: ' + JSON.stringify(data)); + }); + } +} diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/pages/HomePage.ets b/ETSUI/MultipleDialog/entry/src/main/ets/pages/HomePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e2b19f684423c63d4a0b8b2eda2d6c05bcf2024 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/pages/HomePage.ets @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Context from '@ohos.app.ability.common'; +import CommonUtils from '../common/utils/CommonUtils'; +import CommonConstants from '../common/constants/CommonConstants'; +import TextInputWidget from '../view/TextInputWidget'; +import TextCommonWidget from '../view/TextCommonWidget'; +import CustomDialogWidget from '../view/CustomDialogWidget'; +import Logger from '../common/utils/Logger'; + +/** + * There are four dialog modes on the personal information page. + * Date pop-up window, text pop-up window, warning pop-up window, and custom pop-up window. + * Developers can modify the content displayed in the pop-up window. + */ +@Entry +@Component +struct HomePage { + @State birthdate: string = ''; + @State sex: string = ''; + @State hobbies: string = ''; + private sexArray: Resource = $r('app.strarray.sex_array'); + customDialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogWidget({ + hobbies: $hobbies, + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + offset: { + dx: 0, + dy: CommonConstants.DY_OFFSET + } + }); + + aboutToAppear() { + let date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + CommonConstants.PLUS_ONE; + let day = date.getDate(); + this.birthdate = CommonUtils.getBirthDateValue(year, month, day); + let context = getContext(this); + if ((CommonUtils.isEmpty(context)) || (CommonUtils.isEmpty(context.resourceManager))) { + Logger.error(CommonConstants.TAG_HOME, 'context or resourceManager is null'); + return; + } + let manager = context.resourceManager; + manager.getStringValue($r('app.string.default_sex').id, (error, sexValue) => { + if (!CommonUtils.isEmpty(error)) { + Logger.error(CommonConstants.TAG_HOME, 'error = ' + JSON.stringify(error)); + } else { + this.sex = sexValue; + } + }); + } + + build() { + Column() { + Image($r('app.media.ic_back')) + .width($r('app.float.image_back_size')) + .height($r('app.float.image_back_size')) + .alignSelf(ItemAlign.Start) + .margin({ + left: CommonConstants.BACK_MARGIN_LEFT, + top: CommonConstants.BACK_MARGIN_TOP + }) + .onClick(() => { + let context = getContext(this) as Context.UIAbilityContext; + CommonUtils.alertDialog(context); + }) + Image($r('app.media.ic_avatar')) + .width($r('app.float.avatar_size')) + .height($r('app.float.avatar_size')) + .alignSelf(ItemAlign.Center) + .margin({ top: CommonConstants.AVATAR_MARGIN_TOP }) + Text($r('app.string.text_personal_title')) + .fontColor(Color.Black) + .fontSize($r('app.float.personal_font_size')) + .margin({ top: CommonConstants.PERSONAL_MARGIN_TOP }) + .alignSelf(ItemAlign.Center) + TextInputWidget({ + inputImage: $r('app.media.ic_nickname'), + hintText: $r('app.string.text_input_hint') + }) + TextCommonWidget({ + textImage: $r('app.media.ic_birthdate'), + title: $r('app.string.title_birthdate'), + content: $birthdate, + onItemClick: () => { + CommonUtils.datePickerDialog((birthValue: string) => { + this.birthdate = birthValue; + }); + } + }) + TextCommonWidget({ + textImage: $r('app.media.ic_sex'), + title: $r('app.string.title_sex'), + content: $sex, + onItemClick: () => { + CommonUtils.textPickerDialog(this.sexArray, (sexValue: string) => { + this.sex = sexValue; + }); + } + }) + TextInputWidget({ + inputImage: $r('app.media.ic_signature'), + hintText: $r('app.string.text_input_signature') + }) + TextCommonWidget({ + textImage: $r('app.media.ic_hobbies'), + title: $r('app.string.title_hobbies'), + content: $hobbies, + onItemClick: () => { + this.customDialogController.open(); + } + }) + } + .backgroundColor($r('app.color.column_background_color')) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/view/CustomDialogWidget.ets b/ETSUI/MultipleDialog/entry/src/main/ets/view/CustomDialogWidget.ets new file mode 100644 index 0000000000000000000000000000000000000000..97502fc315c3a2260d7b58f226750daada3bba0b --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/view/CustomDialogWidget.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Logger from '../common/utils/Logger'; +import HobbyBean from '../common/bean/HobbyBean'; +import CommonUtils from '../common/utils/CommonUtils'; +import CommonConstants from '../common/constants/CommonConstants'; + +@CustomDialog +export default struct CustomDialogWidget { + @State hobbyBeans: HobbyBean[] = []; + @Link hobbies: string; + private controller: CustomDialogController; + + aboutToAppear() { + let context: Context = getContext(this); + if (CommonUtils.isEmpty(context) || CommonUtils.isEmpty(context.resourceManager)) { + Logger.error(CommonConstants.TAG_CUSTOM, 'context or resourceManager is null'); + return; + } + let manager = context.resourceManager; + manager.getStringArrayValue($r('app.strarray.hobbies_data').id, (error, hobbyArray) => { + if (!CommonUtils.isEmpty(error)) { + Logger.error(CommonConstants.TAG_CUSTOM, 'error = ' + JSON.stringify(error)); + } else { + hobbyArray.forEach((hobbyItem: string) => { + let hobbyBean = new HobbyBean(); + hobbyBean.label = hobbyItem; + hobbyBean.isChecked = false; + this.hobbyBeans.push(hobbyBean); + }); + } + }); + } + + /** + * Set hobbies value + * + * @param {HobbyBean[]} hobby bean array + */ + setHobbiesValue(hobbyBeans: HobbyBean[]) { + if (CommonUtils.isEmptyArr(hobbyBeans)) { + Logger.error(CommonConstants.TAG_HOME, 'hobbyBeans length is 0'); + return; + } + let hobbiesText: string = ''; + hobbiesText = hobbyBeans.filter((isCheckItem: HobbyBean) => isCheckItem?.isChecked) + .map((checkedItem: HobbyBean) => { + return checkedItem.label; + }) + .join(CommonConstants.COMMA); + if (hobbiesText.length > 0) { + this.hobbies = hobbiesText; + } + } + + build() { + Column() { + Text($r('app.string.text_title_hobbies')) + .fontColor($r('app.color.custom_color')) + .fontSize($r('app.float.title_hobbies_size')) + .lineHeight($r('app.float.title_line_height')) + .fontWeight(CommonConstants.BIGGER) + .alignSelf(ItemAlign.Start) + .margin({ left: $r('app.float.title_left_distance') }) + List() { + ForEach(this.hobbyBeans, (itemHobby: HobbyBean) => { + ListItem() { + Row() { + Text(itemHobby.label) + .fontSize($r('app.float.label_size')) + .fontColor($r('app.color.custom_color')) + .layoutWeight(CommonConstants.WEIGHT_ONE) + .textAlign(TextAlign.Start) + .fontWeight(CommonConstants.BIGGER) + .margin({ left: $r('app.float.label_left_distance') }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .onChange((isCheck) => { + itemHobby.isChecked = isCheck; + }) + .width($r('app.float.toggle_size')) + .height($r('app.float.toggle_size')) + .margin({ right: $r('app.float.toggle_right_distance') }) + } + .height($r('app.float.options_height')) + .margin({ + top: $r('app.float.options_top_distance'), + bottom: $r('app.float.options_bottom_distance') + }) + } + }, itemHobby => itemHobby.label) + } + .margin({ + top: $r('app.float.list_top_distance'), + bottom: $r('app.float.list_bottom_distance') + }) + .divider({ + strokeWidth: $r('app.float.divider_height'), + color: $r('app.color.divider_color') + }) + .listDirection(Axis.Vertical) + .edgeEffect(EdgeEffect.None) + .width(CommonConstants.FULL_WIDTH) + .height($r('app.float.options_list_height')) + + Row() { + Button($r('app.string.cancel_button')) + .dialogButtonStyle() + .onClick(() => { + this.controller.close(); + }) + Blank() + .backgroundColor($r('app.color.custom_blank_color')) + .width($r('app.float.blank_width')) + .opacity($r('app.float.blank_opacity')) + .height($r('app.float.blank_height')) + Button($r('app.string.definite_button')) + .dialogButtonStyle() + .onClick(() => { + this.setHobbiesValue(this.hobbyBeans); + this.controller.close(); + }) + } + } + .width(CommonConstants.COMMON_DIALOG_WIDTH) + .padding({ + top: $r('app.float.dialog_top_distance'), + bottom: $r('app.float.dialog_bottom_distance') + }) + .borderRadius($r('app.float.dialog_radius')) + .backgroundColor(Color.White) + } +} + +@Extend(Button) function dialogButtonStyle() { + .fontSize($r('app.float.button_text_size')) + .fontColor($r('app.color.custom_button_color')) + .layoutWeight(CommonConstants.WEIGHT_ONE) + .backgroundColor(Color.White) + .width(CommonConstants.FULL_WIDTH) + .height($r('app.float.button_height')) +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/view/TextCommonWidget.ets b/ETSUI/MultipleDialog/entry/src/main/ets/view/TextCommonWidget.ets new file mode 100644 index 0000000000000000000000000000000000000000..a436ce0fb9119b5852fb178fe062d939bfe3254f --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/view/TextCommonWidget.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constants/CommonConstants'; + +@Component +export default struct TextCommonWidget { + @Link content: string; + private textImage: Resource; + private title: Resource; + onItemClick: () => void; + + build() { + Row() { + Image(this.textImage) + .width($r('app.float.text_image_size')) + .height($r('app.float.text_image_size')) + .margin({ left: $r('app.float.image_left_distance') }) + Text(this.title) + .fontSize($r('app.float.text_size')) + .margin({ left: $r('app.float.image_left_distance') }) + .height(CommonConstants.FULL_HEIGHT) + Text(this.content) + .fontSize($r('app.float.text_size')) + .textAlign(TextAlign.End) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .maxLines(CommonConstants.ONE_LINES) + .margin({ + left: $r('app.float.content_left_distance'), + right: $r('app.float.content_right_distance') + }) + .layoutWeight(CommonConstants.WEIGHT_ONE) + .width(CommonConstants.FULL_WIDTH) + Image($r('app.media.ic_arrow')) + .width($r('app.float.arrow_image_width')) + .height($r('app.float.arrow_image_height')) + .margin({ right: $r('app.float.arrow_right_distance') }) + } + .margin({ top: $r('app.float.row_top_distance') }) + .borderRadius($r('app.float.row_radius')) + .backgroundColor(Color.White) + .width(CommonConstants.COMMON_DIALOG_WIDTH) + .height($r('app.float.row_height')) + .onClick(this.onItemClick) + } +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/ets/view/TextInputWidget.ets b/ETSUI/MultipleDialog/entry/src/main/ets/view/TextInputWidget.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d4f824bb280c4dd17cb9261dd8dd9f549e7ede0 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/ets/view/TextInputWidget.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constants/CommonConstants'; + +@Component +export default struct TextInputWidget { + private inputImage: Resource; + private hintText: Resource; + + build() { + Row() { + Image(this.inputImage) + .width($r('app.float.input_image_size')) + .height($r('app.float.input_image_size')) + .margin({ left: $r('app.float.input_image_left') }) + TextInput({ placeholder: this.hintText }) + .fontSize($r('app.float.input_text_size')) + .padding({ left: $r('app.float.input_left_inside') }) + .placeholderColor($r('app.color.place_color')) + .backgroundColor(Color.White) + .fontWeight(FontWeight.Normal) + .fontStyle(FontStyle.Normal) + .fontColor(Color.Black) + .margin({ right: $r('app.float.input_right_inside') }) + .layoutWeight(CommonConstants.WEIGHT_ONE) + .height($r('app.float.text_input_height')) + } + .margin({ top: $r('app.float.input_row_top') }) + .borderRadius($r('app.float.input_row_radius')) + .backgroundColor(Color.White) + .width(CommonConstants.COMMON_DIALOG_WIDTH) + .height($r('app.float.input_row_height')) + } +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/module.json5 b/ETSUI/MultipleDialog/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..033282e362d2ebc95cdc3dbe59276ffe226cff4a --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "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", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/element/color.json b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..8a31531e1fd375f3e9d854bdd65543c66e3f8dd2 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/color.json @@ -0,0 +1,32 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "column_background_color", + "value": "#F5F5F5" + }, + { + "name": "custom_color", + "value": "#182431" + }, + { + "name": "custom_button_color", + "value": "#007DFF" + }, + { + "name": "custom_blank_color", + "value": "#F2F2F2" + }, + { + "name": "place_color", + "value": "#99000000" + }, + { + "name": "divider_color", + "value": "#0D182431" + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/element/float.json b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..e4140f7cac4a0f591364a6af618cfbea4acc6ed5 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/float.json @@ -0,0 +1,188 @@ +{ + "float": [ + { + "name": "image_back_size", + "value": "26vp" + }, + { + "name": "avatar_size", + "value": "56vp" + }, + { + "name": "personal_font_size", + "value": "16fp" + }, + { + "name": "title_hobbies_size", + "value": "20fp" + }, + { + "name": "title_line_height", + "value": "28vp" + }, + { + "name": "label_size", + "value": "16fp" + }, + { + "name": "options_height", + "value": "22vp" + }, + { + "name": "toggle_size", + "value": "20vp" + }, + { + "name": "options_top_distance", + "value": "13vp" + }, + { + "name": "options_bottom_distance", + "value": "13vp" + }, + { + "name": "divider_height", + "value": "0.5vp" + }, + { + "name": "list_top_distance", + "value": "14vp" + }, + { + "name": "list_bottom_distance", + "value": "8vp" + }, + { + "name": "options_list_height", + "value": "242vp" + }, + { + "name": "blank_width", + "value": "1vp" + }, + { + "name": "blank_opacity", + "value": "1vp" + }, + { + "name": "blank_height", + "value": "25vp" + }, + { + "name": "dialog_radius", + "value": "32vp" + }, + { + "name": "title_left_distance", + "value": "24vp" + }, + { + "name": "label_left_distance", + "value": "24vp" + }, + { + "name": "dialog_left_distance", + "value": "24vp" + }, + { + "name": "dialog_top_distance", + "value": "14vp" + }, + { + "name": "toggle_right_distance", + "value": "24vp" + }, + { + "name": "dialog_bottom_distance", + "value": "16vp" + }, + { + "name": "button_text_size", + "value": "16fp" + }, + { + "name": "button_height", + "value": "40vp" + }, + { + "name": "text_image_size", + "value": "24vp" + }, + { + "name": "image_left_distance", + "value": "12vp" + }, + { + "name": "text_size", + "value": "16vp" + }, + { + "name": "content_left_distance", + "value": "16vp" + }, + { + "name": "content_right_distance", + "value": "7vp" + }, + { + "name": "arrow_image_width", + "value": "12vp" + }, + { + "name": "arrow_image_height", + "value": "24vp" + }, + { + "name": "arrow_right_distance", + "value": "14vp" + }, + { + "name": "row_top_distance", + "value": "24vp" + }, + { + "name": "row_radius", + "value": "24vp" + }, + { + "name": "row_height", + "value": "64vp" + }, + { + "name": "input_image_size", + "value": "24vp" + }, + { + "name": "input_image_left", + "value": "12vp" + }, + { + "name": "input_text_size", + "value": "16fp" + }, + { + "name": "input_left_inside", + "value": "12vp" + }, + { + "name": "input_right_inside", + "value": "32vp" + }, + { + "name": "text_input_height", + "value": "48vp" + }, + { + "name": "input_row_top", + "value": "24vp" + }, + { + "name": "input_row_radius", + "value": "24vp" + }, + { + "name": "input_row_height", + "value": "64vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/element/string.json b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..bb3d71378ccf7cdb40749b47cf64caf31e1f0365 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "Main program entry" + }, + { + "name": "EntryAbility_label", + "value": "MultipleWindow" + }, + { + "name": "text_input_hint", + "value": "Nickname" + }, + { + "name": "text_input_signature", + "value": "Personalized signature" + }, + { + "name": "title_birthdate", + "value": "Date of birth" + }, + { + "name": "title_sex", + "value": "Sex" + }, + { + "name": "default_sex", + "value": "Male" + }, + { + "name": "title_hobbies", + "value": "Hobbies (multiple choices)" + }, + { + "name": "alert_dialog_message", + "value": "The current data is not saved. Are you sure you want to leave?" + }, + { + "name": "cancel_button", + "value": "Cancel" + }, + { + "name": "definite_button", + "value": "Definite" + }, + { + "name": "text_personal_title", + "value": "Personal information" + }, + { + "name": "text_title_hobbies", + "value": "Hobbies" + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/element/stringarray.json b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/stringarray.json new file mode 100644 index 0000000000000000000000000000000000000000..d94f89c6f464adcd79c103aae619e78a5300ca9c --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/base/element/stringarray.json @@ -0,0 +1,35 @@ +{ + "strarray": [ + { + "name": "sex_array", + "value": [ + { + "value": "male" + }, + { + "value": "female" + } + ] + }, + { + "name": "hobbies_data", + "value": [ + { + "value": "Soccer" + }, + { + "value": "Badminton" + }, + { + "value": "Travelling" + }, + { + "value": "Playing games" + }, + { + "value": "Reading books" + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_arrow.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..2109908544b8b585f45e349ccec6d84161a82b84 Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_arrow.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_avatar.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..95b571be71669c537ef6ecaa86bd0be52c0ade69 Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_avatar.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_back.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_back.png new file mode 100644 index 0000000000000000000000000000000000000000..6cbe911b6b33e467fe20c4fbe305f2bc7022d29d Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_back.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_birthdate.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_birthdate.png new file mode 100644 index 0000000000000000000000000000000000000000..664ba6c8dae8b144fef1a43ee628cd601f85b993 Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_birthdate.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_hobbies.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_hobbies.png new file mode 100644 index 0000000000000000000000000000000000000000..20a25eca4401f051ae951cc17f70503b1b3fbc39 Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_hobbies.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_nickname.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_nickname.png new file mode 100644 index 0000000000000000000000000000000000000000..3e6b9b8916e2cd68fa80c3f3ebca5f400844f9ef Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_nickname.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_sex.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_sex.png new file mode 100644 index 0000000000000000000000000000000000000000..d8e71360c12499631ac37fbd4f71a7264a6f7cc8 Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_sex.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_signature.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_signature.png new file mode 100644 index 0000000000000000000000000000000000000000..39ab5f2f30283d52bc3688e585f59570bc2a8467 Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/ic_signature.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/media/icon.png b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/MultipleDialog/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/MultipleDialog/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..8607be393726d65baba7d64deacc51ce1c8f143d --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/HomePage" + ] +} diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/en_US/element/string.json b/ETSUI/MultipleDialog/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..bb3d71378ccf7cdb40749b47cf64caf31e1f0365 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "Main program entry" + }, + { + "name": "EntryAbility_label", + "value": "MultipleWindow" + }, + { + "name": "text_input_hint", + "value": "Nickname" + }, + { + "name": "text_input_signature", + "value": "Personalized signature" + }, + { + "name": "title_birthdate", + "value": "Date of birth" + }, + { + "name": "title_sex", + "value": "Sex" + }, + { + "name": "default_sex", + "value": "Male" + }, + { + "name": "title_hobbies", + "value": "Hobbies (multiple choices)" + }, + { + "name": "alert_dialog_message", + "value": "The current data is not saved. Are you sure you want to leave?" + }, + { + "name": "cancel_button", + "value": "Cancel" + }, + { + "name": "definite_button", + "value": "Definite" + }, + { + "name": "text_personal_title", + "value": "Personal information" + }, + { + "name": "text_title_hobbies", + "value": "Hobbies" + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/en_US/element/stringarray.json b/ETSUI/MultipleDialog/entry/src/main/resources/en_US/element/stringarray.json new file mode 100644 index 0000000000000000000000000000000000000000..d94f89c6f464adcd79c103aae619e78a5300ca9c --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/en_US/element/stringarray.json @@ -0,0 +1,35 @@ +{ + "strarray": [ + { + "name": "sex_array", + "value": [ + { + "value": "male" + }, + { + "value": "female" + } + ] + }, + { + "name": "hobbies_data", + "value": [ + { + "value": "Soccer" + }, + { + "value": "Badminton" + }, + { + "value": "Travelling" + }, + { + "value": "Playing games" + }, + { + "value": "Reading books" + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/MultipleDialog/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2a1a5708d85e8bc78cdf05b07e6e3fce30880baa --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "主程序入口" + }, + { + "name": "EntryAbility_label", + "value": "构建多种样式弹窗" + }, + { + "name": "text_input_hint", + "value": "昵称" + }, + { + "name": "text_input_signature", + "value": "个性签名" + }, + { + "name": "title_birthdate", + "value": "出生日期" + }, + { + "name": "title_sex", + "value": "性别" + }, + { + "name": "default_sex", + "value": "男" + }, + { + "name": "title_hobbies", + "value": "兴趣爱好(多选)" + }, + { + "name": "alert_dialog_message", + "value": "当前数据未保存,是否离开?" + }, + { + "name": "cancel_button", + "value": "取消" + }, + { + "name": "definite_button", + "value": "确定" + }, + { + "name": "text_personal_title", + "value": "个人信息" + }, + { + "name": "text_title_hobbies", + "value": "兴趣爱好" + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/entry/src/main/resources/zh_CN/element/stringarray.json b/ETSUI/MultipleDialog/entry/src/main/resources/zh_CN/element/stringarray.json new file mode 100644 index 0000000000000000000000000000000000000000..cc5c607bb8312989d6e923408192d7f21c44a6b6 --- /dev/null +++ b/ETSUI/MultipleDialog/entry/src/main/resources/zh_CN/element/stringarray.json @@ -0,0 +1,35 @@ +{ + "strarray": [ + { + "name": "sex_array", + "value": [ + { + "value": "男" + }, + { + "value": "女" + } + ] + }, + { + "name": "hobbies_data", + "value": [ + { + "value": "足球" + }, + { + "value": "羽毛球" + }, + { + "value": "旅游" + }, + { + "value": "打游戏" + }, + { + "value": "看书" + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/MultipleDialog/figures/AlertDialog.gif b/ETSUI/MultipleDialog/figures/AlertDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..73b744e4a336c9b48deda3d63cacf1f9972c307b Binary files /dev/null and b/ETSUI/MultipleDialog/figures/AlertDialog.gif differ diff --git a/ETSUI/MultipleDialog/figures/CustomDialog.gif b/ETSUI/MultipleDialog/figures/CustomDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..974a3a2190a56b71d6cf93a21d298080ae6c4612 Binary files /dev/null and b/ETSUI/MultipleDialog/figures/CustomDialog.gif differ diff --git a/ETSUI/MultipleDialog/figures/DatePickerDialog.gif b/ETSUI/MultipleDialog/figures/DatePickerDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..14fd2329ab2f46c91b7864c0cd52c87ad461e67e Binary files /dev/null and b/ETSUI/MultipleDialog/figures/DatePickerDialog.gif differ diff --git a/ETSUI/MultipleDialog/figures/MainPage.png b/ETSUI/MultipleDialog/figures/MainPage.png new file mode 100644 index 0000000000000000000000000000000000000000..d1a165761abd95483fc08d3f524f7e3ca64229dd Binary files /dev/null and b/ETSUI/MultipleDialog/figures/MainPage.png differ diff --git a/ETSUI/MultipleDialog/figures/MultipeDialog.gif b/ETSUI/MultipleDialog/figures/MultipeDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..edf253fb11c37a082eeeccc9477554e76b3332e9 Binary files /dev/null and b/ETSUI/MultipleDialog/figures/MultipeDialog.gif differ diff --git a/ETSUI/MultipleDialog/figures/TextCommonWidget.png b/ETSUI/MultipleDialog/figures/TextCommonWidget.png new file mode 100644 index 0000000000000000000000000000000000000000..8874642480f10ac39a44c0d6cabc0ea025411670 Binary files /dev/null and b/ETSUI/MultipleDialog/figures/TextCommonWidget.png differ diff --git a/ETSUI/MultipleDialog/figures/TextInputWidget.png b/ETSUI/MultipleDialog/figures/TextInputWidget.png new file mode 100644 index 0000000000000000000000000000000000000000..d31a5a6fc6efdafbb1aafe8e66ac1cc9c5958d60 Binary files /dev/null and b/ETSUI/MultipleDialog/figures/TextInputWidget.png differ diff --git a/ETSUI/MultipleDialog/figures/TextPickerDialog.gif b/ETSUI/MultipleDialog/figures/TextPickerDialog.gif new file mode 100644 index 0000000000000000000000000000000000000000..3c6366dbe0dc0ca41d497f808112416d253ead62 Binary files /dev/null and b/ETSUI/MultipleDialog/figures/TextPickerDialog.gif differ diff --git a/ETSUI/MultipleDialog/figures/congratulations.gif b/ETSUI/MultipleDialog/figures/congratulations.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ETSUI/MultipleDialog/figures/congratulations.gif differ diff --git a/ETSUI/MultipleDialog/figures/zh-cn_image_0000001569303293.png b/ETSUI/MultipleDialog/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/MultipleDialog/figures/zh-cn_image_0000001569303293.png differ diff --git a/ETSUI/MultipleDialog/hvigor/hvigor-config.json5 b/ETSUI/MultipleDialog/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/ETSUI/MultipleDialog/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/ETSUI/MultipleDialog/hvigor/hvigor-wrapper.js b/ETSUI/MultipleDialog/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/MultipleDialog/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/MultipleDialog/hvigorfile.ts b/ETSUI/MultipleDialog/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/MultipleDialog/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/MultipleDialog/oh-package.json5 b/ETSUI/MultipleDialog/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..a3d33276a872a7b57f41ceb6368b698ef96533ec --- /dev/null +++ b/ETSUI/MultipleDialog/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "multipledialog", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/MultipleDialog/public_sys-resources/icon-caution.gif b/ETSUI/MultipleDialog/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/MultipleDialog/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/MultipleDialog/public_sys-resources/icon-danger.gif b/ETSUI/MultipleDialog/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/MultipleDialog/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/MultipleDialog/public_sys-resources/icon-note.gif b/ETSUI/MultipleDialog/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/MultipleDialog/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/MultipleDialog/public_sys-resources/icon-notice.gif b/ETSUI/MultipleDialog/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/MultipleDialog/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/MultipleDialog/public_sys-resources/icon-tip.gif b/ETSUI/MultipleDialog/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/MultipleDialog/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/MultipleDialog/public_sys-resources/icon-warning.gif b/ETSUI/MultipleDialog/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/MultipleDialog/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/PixelConversion/AppScope/app.json5 b/ETSUI/PixelConversion/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..122f697e11b03cbf276064de0486afa43f197cd5 --- /dev/null +++ b/ETSUI/PixelConversion/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.pixelconversion", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/PixelConversion/AppScope/resources/base/element/string.json b/ETSUI/PixelConversion/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2bb051789de1be41b83fbcd369066e3fb286dde0 --- /dev/null +++ b/ETSUI/PixelConversion/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PixelConversion" + } + ] +} diff --git a/ETSUI/PixelConversion/AppScope/resources/base/media/app_icon.png b/ETSUI/PixelConversion/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/PixelConversion/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/PixelConversion/LICENSE b/ETSUI/PixelConversion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/PixelConversion/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/PixelConversion/README.md b/ETSUI/PixelConversion/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7a9a5c2cee6c1b783c5932a857a701251431d967 --- /dev/null +++ b/ETSUI/PixelConversion/README.md @@ -0,0 +1,157 @@ +# 像素转换(ArkTS) + +## 介绍 +本篇Codelab介绍像素单位的基本知识与像素单位转换API的使用。通过像素转换案例,向开发者讲解了如何使用像素单位设置组件的尺寸、字体的大小以及不同像素单位之间的转换方法。主要功能包括: +1. 展示了不同像素单位的使用。 +2. 展示了像素单位转换相关API的使用。 + +![](figures/conversion_all_360.gif) + +### 相关概念 +- [像素单位](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-pixel-units.md):为开发者提供4种像素单位,框架采用vp为基准数据单位。 +- [List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md):列表包含一系列相同宽度的列表项。适合连续、多行呈现同类数据,例如图片和文本。 +- [Column](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md):沿垂直方向布局的容器。 +- [Text](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md):显示一段文本的组件。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001554588725.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──ConversionItem.ets // 像素转换bean +│ │ │ └──IntroductionItem.ets // 像素介绍bean +│ │ ├──constants +│ │ │ └──Constants.ets // 常量类 +│ │ └──utils +│ │ └──Logger.ets // 日志打印工具类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ ├──ConversionPage.ets // 像素转换页面 +│ │ ├──IndexPage.ets // 应用主页面 +│ │ └──IntroductionPage.ets // 像素介绍页面 +│ ├──view +│ │ ├──ConversionItemComponment.ets // 像素转换Item +│ │ └──IntroductionItemComponment.ets // 像素介绍Item +│ └──viewmodel +│ ├──ConversionViewModel.ets // 像素转换ViewModel +│ └──IntroductionViewModel.ets // 像素介绍ViewModel +└──entry/src/main/resources // 资源文件 +``` + +## 像素单位介绍页面 + +在像素单位介绍页面,介绍了系统像素单位的概念,并在页面中为Text组件的宽度属性设置不同的像素单位,fp像素单位则设置为Text组件的字体大小。 + +![](figures/oh_intro_360.png) + +```typescript +// IntroductionPage.ets +// 设置Text组件的宽度为200px +Text('200px') + .textAlign(TextAlign.Center) + .backgroundColor($r('app.color.blue_background')) + .height($r('app.float.value_height')) + .width('200px') +... +// 设置Text组件的宽度为200vp +Text('200vp') + .textAlign(TextAlign.Center) + .backgroundColor($r('app.color.blue_background')) + .height($r('app.float.value_height')) + .width('200vp') +... +// 设置Text组件的宽度为200lpx +Text('200lpx') + .textAlign(TextAlign.Center) + .backgroundColor($r('app.color.blue_background')) + .height($r('app.float.value_height')) + .width('200lpx') +... +// 分别设置Text的字体大小为14fp, 24fp +Column() { + Text('这是一段为14fp的文字') + .fontSize('14fp') + ... + Text('这是一段为24fp的文字') + .fontSize('24fp') + ... +} +// ... +``` + +>![](public_sys-resources/icon-note.gif) **说明:** +>- 为组件设置具体的宽高时,可以不加“vp”\(系统默认单位为vp)。 +>- 为文字设置字体大小时可以不加“fp”(系统默认为fp)。 + +## 像素转换页面 +在像素转换页面,通过使用像素转换API,实现不同像素单位之间的相互转换功能。 + +![](figures/oh_conversion_360.png) + +```typescript +// ConversionPage.ets +// vp转换为px +Row() + .blueStyle() + .width(vp2px(60)) +// px转换为vp +Row() + .blueStyle() + .width(px2vp(60)) +// fp转换为px +Row() + .blueStyle() + .width(fp2px(60)) +// px转换为fp +Row() + .blueStyle() + .width(px2fp(60)) +// lpx转换为px +Row() + .blueStyle() + .width(lpx2px(60)) +// px转换为lpx +Row() + .blueStyle() + .width(px2lpx(60)) +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 不同像素单位的使用。 +2. 像素单位转换相关API的使用。 + +![](figures/彩带动效.gif) \ No newline at end of file diff --git a/ETSUI/PixelConversion/build-profile.json5 b/ETSUI/PixelConversion/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7e443c9990df03928f4c23604aba62b3b5323ec1 --- /dev/null +++ b/ETSUI/PixelConversion/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/build-profile.json5 b/ETSUI/PixelConversion/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/PixelConversion/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/hvigorfile.ts b/ETSUI/PixelConversion/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/PixelConversion/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/PixelConversion/entry/oh-package.json5 b/ETSUI/PixelConversion/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/ETSUI/PixelConversion/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/PixelConversion/entry/src/main/ets/common/bean/ConversionItem.ets b/ETSUI/PixelConversion/entry/src/main/ets/common/bean/ConversionItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..1e800db1f7309c8a664240fd3c9fec00b41286f9 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/common/bean/ConversionItem.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export default class ConversionItem { + title: string; + subTitle: string; + value: number; + conversionTitle: string; + conversionSubTitle: string; + conversionValue: number; + notice: Resource; +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/common/bean/IntroductionItem.ets b/ETSUI/PixelConversion/entry/src/main/ets/common/bean/IntroductionItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb02eb5cccd5c5fd5acf514f3be9018739235421 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/common/bean/IntroductionItem.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export default class IntroductionItem { + name: string; + title: Resource; + subTitle: Resource; + value: string; + smallFontSize: number; + largeFontSize: number; +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/common/constants/Constants.ets b/ETSUI/PixelConversion/entry/src/main/ets/common/constants/Constants.ets new file mode 100644 index 0000000000000000000000000000000000000000..119748ce3a18230ca76246e56bf414a745837764 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/common/constants/Constants.ets @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export default class Constants { + + /** + * 100 percent + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * pixel conversion + */ + static readonly PIXEL_CONVERSION: string = '像素转换'; + + /** + * pixel introduction + */ + static readonly PIXEL_INTRODUCTION: string = '像素介绍'; + + /** + * IntroductionPage URL + */ + static readonly INTRODUCTION_PAGE_URL: string = 'pages/IntroductionPage'; + + /** + * ConversionPage URL + */ + static readonly CONVERSION_PAGE_URL: string = 'pages/ConversionPage'; + + /** + * vp size + */ + static readonly INDEX_PAGE_TAG: string = 'IndexPage push error '; + + /** + * font weight 500 + */ + static readonly TITLE_FONT_WEIGHT: number = 500; + + /** + * font weight 400 + */ + static readonly LABEL_FONT_WEIGHT: number = 400; + + /** + * column space + */ + static readonly COLUMN_SPACE: number = 24; + + /** + * item space + */ + static readonly ITEM_PADDING: number = 12; + + /** + * large font size + */ + static readonly LARGE_FONT_SIZE: number = 24; + + /** + * small font size + */ + static readonly SMALL_FONT_SIZE: number = 14; + + /** + * vp size + */ + static readonly VP_SIZE: number = 60; + + /** + * pixel width + */ + static readonly PIXEL_WIDTH: number = 200; +} diff --git a/ETSUI/PixelConversion/entry/src/main/ets/common/utils/Logger.ets b/ETSUI/PixelConversion/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..f983817752de699e5e10c8a4478012da2d67aff1 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +const LOGGER_PREFIX: string = 'Pixel Conversion'; + +class Logger { + private domain: number; + private prefix: string; + + // format Indicates the log format string. + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param prefix Identifies the log tag. + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param args Indicates the log parameters. + */ + constructor(prefix: string = '', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger(LOGGER_PREFIX); \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/PixelConversion/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..77ffa1b54c0f0f42d7a6059d6284889f5c8b35c4 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,41 @@ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/IndexPage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/PixelConversion/entry/src/main/ets/pages/ConversionPage.ets b/ETSUI/PixelConversion/entry/src/main/ets/pages/ConversionPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..cff61963200ec26dd79c881a207cac2d7dcb343a --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/pages/ConversionPage.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import ConversionItemComponent from '../view/ConversionItemComponent'; +import ConversionItem from '../common/bean/ConversionItem'; +import ConversionViewModel from '../viewmodel/ConversionViewModel'; + +@Entry +@Component +struct ConversionPage { + build() { + Column() { + Navigation() { + List({ space: Constants.ITEM_PADDING }) { + ForEach(ConversionViewModel.getConversionList(), (item: ConversionItem) => { + ListItem() { + ConversionItemComponent({ model: item }) + } + .padding({ + left: $r('app.float.item_padding'), + right: $r('app.float.item_padding') + }) + }) + } + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } + .titleMode(NavigationTitleMode.Mini) + .title(Constants.PIXEL_CONVERSION) + } + .backgroundColor($r('app.color.page_background')) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/pages/IndexPage.ets b/ETSUI/PixelConversion/entry/src/main/ets/pages/IndexPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..22f4622a516fe0046295e9854f7294bd1edcdc9d --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/pages/IndexPage.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import Constants from '../common/constants/Constants'; +import Logger from '../common/utils/Logger'; + +@Entry +@Component +struct IndexPage { + jumpPage(url: string) { + router.pushUrl({ url }) + .catch((error) => { + Logger.error(Constants.INDEX_PAGE_TAG, error); + }); + } + + build() { + Column({ space: Constants.COLUMN_SPACE }) { + Button($r('app.string.pixel_introduce')) + .height($r('app.float.btn_height')) + .width(Constants.FULL_PERCENT) + .backgroundColor($r('app.color.blue_background')) + .onClick(() => this.jumpPage(Constants.INTRODUCTION_PAGE_URL)) + Button($r('app.string.pixel_conversion')) + .height($r('app.float.btn_height')) + .width(Constants.FULL_PERCENT) + .backgroundColor($r('app.color.blue_background')) + .onClick(() => this.jumpPage(Constants.CONVERSION_PAGE_URL)) + } + .backgroundColor($r('app.color.page_background')) + .justifyContent(FlexAlign.Center) + .padding(Constants.COLUMN_SPACE) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/pages/IntroductionPage.ets b/ETSUI/PixelConversion/entry/src/main/ets/pages/IntroductionPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..b757b7bb12cba0deb69180b870847e07820cf4b7 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/pages/IntroductionPage.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import IntroductionItem from '../common/bean/IntroductionItem'; +import IntroduceItemComponent from '../view/IntroduceItemComponent'; +import IntroductionViewModel from '../viewmodel/IntroductionViewModel'; + +@Entry +@Component +struct IntroductionPage { + build() { + Column() { + Navigation() { + List({ space: Constants.ITEM_PADDING }) { + ForEach(IntroductionViewModel.getIntroductionList(), (item: IntroductionItem) => { + ListItem() { + IntroduceItemComponent({ model: item }) + } + .padding({ + left: $r('app.float.item_padding'), + right: $r('app.float.item_padding') + }) + }) + } + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } + .titleMode(NavigationTitleMode.Mini) + .title(Constants.PIXEL_INTRODUCTION) + } + .backgroundColor($r('app.color.page_background')) + .width(Constants.FULL_PERCENT) + .height(Constants.FULL_PERCENT) + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/view/ConversionItemComponent.ets b/ETSUI/PixelConversion/entry/src/main/ets/view/ConversionItemComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..c45b27532d8178dd2684bf2004b0e8f30e08c40c --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/view/ConversionItemComponent.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import ConversionItem from '../common/bean/ConversionItem'; + +@Extend(Text) function descTextStyle() { + .fontColor($r('app.color.title_font')) + .fontSize($r('app.float.title_font_size')) + .fontFamily($r('app.string.HarmonyHeiTi')) + .lineHeight($r('app.float.desc_line_height')) + .fontWeight(Constants.LABEL_FONT_WEIGHT) + .margin({ top: $r('app.float.desc_margin_top') }) +} + +@Extend(Text) function titleTextStyle() { + .fontColor($r('app.color.title_font')) + .fontSize($r('app.float.name_font_size')) + .fontFamily($r('app.string.HarmonyHeiTi_Medium')) + .fontWeight(Constants.TITLE_FONT_WEIGHT) +} + +@Styles function blueStyle() { + .backgroundColor($r('app.color.blue_background')) + .height($r('app.float.value_height')) + .borderRadius($r('app.float.value_border_radius')) + .margin({ top: $r('app.float.blue_margin_top') }) +} + +@Component +export default struct ConversionItemComponent { + model: ConversionItem; + + build() { + Column() { + Text(this.model.title) + .titleTextStyle() + .margin({ top: $r('app.float.title_margin_top') }) + Text(this.model.subTitle) + .descTextStyle() + .opacity($r('app.float.label_opacity')) + Row() + .blueStyle() + .width(this.model.value) + Text(this.model.conversionTitle) + .titleTextStyle() + .margin({ top: $r('app.float.item_margin_top') }) + Text(this.model.conversionSubTitle) + .descTextStyle() + .opacity($r('app.float.label_opacity')) + Row() + .blueStyle() + .width(this.model.conversionValue) + if (this.model.notice) { + Text(this.model.notice) + .descTextStyle() + .fontColor($r('app.color.notice_font')) + } + } + .alignItems(HorizontalAlign.Start) + .width(Constants.FULL_PERCENT) + .padding($r('app.float.item_padding')) + .borderRadius($r('app.float.item_border_radius')) + .backgroundColor($r('app.color.item_background')) + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/view/IntroduceItemComponent.ets b/ETSUI/PixelConversion/entry/src/main/ets/view/IntroduceItemComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..e6a53a1dcaf83d8ea0b7b53179d090db9ba48a3c --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/view/IntroduceItemComponent.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import IntroductionItem from '../common/bean/IntroductionItem'; + +@Extend(Text) function titleTextStyle() { + .fontColor($r('app.color.title_font')) + .fontFamily($r('app.string.HarmonyHeiTi_Medium')) + .fontWeight(Constants.TITLE_FONT_WEIGHT) +} + +@Component +export default struct IntroduceItemComponent { + model: IntroductionItem; + + build() { + Column() { + Text(this.model.name) + .titleTextStyle() + .fontSize($r('app.float.name_font_size')) + Text(this.model.title) + .titleTextStyle() + .fontSize($r('app.float.title_font_size')) + .fontFamily($r('app.string.HarmonyHeiTi')) + .lineHeight($r('app.float.desc_line_height')) + .margin({ top: $r('app.float.desc_margin_top') }) + .fontWeight(Constants.LABEL_FONT_WEIGHT) + if (this.model.subTitle) { + Text(this.model.subTitle) + .titleTextStyle() + .opacity($r('app.float.label_opacity')) + .lineHeight($r('app.float.subtitle_line_height')) + .fontSize($r('app.float.subtitle_font_size')) + .fontFamily($r('app.string.HarmonyHeiTi')) + .margin({ top: $r('app.float.subtitle_margin_top') }) + .fontWeight(Constants.LABEL_FONT_WEIGHT) + } + if (this.model.value.length > 0) { + Text(this.model.value) + .titleTextStyle() + .fontColor($r('app.color.item_background')) + .fontSize($r('app.float.name_font_size')) + .textAlign(TextAlign.Center) + .backgroundColor($r('app.color.blue_background')) + .height($r('app.float.value_height')) + .width(this.model.value) + .borderRadius($r('app.float.value_border_radius')) + .margin({ top: $r('app.float.item_padding') }) + } else { + Column() { + Text($r('app.string.font_desc', this.model.smallFontSize)) + .titleTextStyle() + .fontSize(this.model.smallFontSize) + Text($r('app.string.font_desc', this.model.largeFontSize)) + .titleTextStyle() + .fontSize(this.model.largeFontSize) + .margin({ top: $r('app.float.title_margin_top') }) + } + .alignItems(HorizontalAlign.Start) + .backgroundColor($r('app.color.font_background')) + .width(Constants.FULL_PERCENT) + .borderRadius($r('app.float.notice_border_radius')) + .padding($r('app.float.item_padding')) + .margin({ top: $r('app.float.item_padding') }) + } + } + .alignItems(HorizontalAlign.Start) + .width(Constants.FULL_PERCENT) + .padding($r('app.float.item_padding')) + .borderRadius($r('app.float.item_border_radius')) + .backgroundColor($r('app.color.item_background')) + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/viewmodel/ConversionViewModel.ets b/ETSUI/PixelConversion/entry/src/main/ets/viewmodel/ConversionViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..80838cae4987d3a5db31b2f08fb3d643d7babcd8 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/viewmodel/ConversionViewModel.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import ConversionItem from '../common/bean/ConversionItem'; + +class ConversionViewModel { + /** + * Get conversion list data on the left. + * + * @return {Array} conversionItems + */ + getConversionList() { + let conversionItems = CONVERSION_LIST; + return conversionItems; + } +} + +export const CONVERSION_LIST: ConversionItem[] = [ + { + title: 'vp > px', + subTitle: `vp2px(${Constants.VP_SIZE})`, + value: vp2px(Constants.VP_SIZE), + conversionTitle: 'px > vp', + conversionSubTitle: `px2vp(${Constants.VP_SIZE})`, + conversionValue: px2vp(Constants.VP_SIZE), + notice: null + }, + { + title: 'fp > px', + subTitle: `fp2px(${Constants.VP_SIZE})`, + value: fp2px(Constants.VP_SIZE), + conversionTitle: 'px > fp', + conversionSubTitle: `px2fp(${Constants.VP_SIZE})`, + conversionValue: px2fp(Constants.VP_SIZE), + notice: null + }, + { + title: 'lpx > px', + subTitle: `lpx2px(${Constants.VP_SIZE})`, + value: lpx2px(Constants.VP_SIZE), + conversionTitle: 'px > lpx', + conversionSubTitle: `px2lpx(${Constants.VP_SIZE})`, + conversionValue: px2lpx(Constants.VP_SIZE), + notice: $r('app.string.notice') + } +]; + +let conversionViewModel = new ConversionViewModel(); + +export default conversionViewModel as ConversionViewModel; \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/ets/viewmodel/IntroductionViewModel.ets b/ETSUI/PixelConversion/entry/src/main/ets/viewmodel/IntroductionViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..05a5e74a3e40e547a29f0e17034dad38f4b25d06 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/ets/viewmodel/IntroductionViewModel.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import IntroductionItem from '../common/bean/IntroductionItem'; + +class IntroductionViewModel { + /** + * Get introduction list data on the left. + * + * @return {Array} introductionItems + */ + getIntroductionList() { + let introductionItems = INTRODUCE_LIST; + return introductionItems; + } +} + +const INTRODUCE_LIST: IntroductionItem[] = [ + { + name: 'px', + title: $r('app.string.px_unit'), + subTitle: null, + value: Constants.PIXEL_WIDTH + 'px', + smallFontSize: 0, + largeFontSize: 0 + }, + { + name: 'vp', + title: $r('app.string.vp_unit'), + subTitle: $r('app.string.vp_desc'), + value: Constants.PIXEL_WIDTH + 'vp', + smallFontSize: 0, + largeFontSize: 0 + }, + { + name: 'lpx', + title: $r('app.string.lpx_unit'), + subTitle: null, + value: Constants.PIXEL_WIDTH + 'lpx', + smallFontSize: 0, + largeFontSize: 0 + }, + { + name: 'fp', + title: $r('app.string.fp_unit'), + subTitle: $r('app.string.fp_desc'), + value: '', + smallFontSize: Constants.SMALL_FONT_SIZE, + largeFontSize: Constants.LARGE_FONT_SIZE + } +]; + +let introductionViewModel = new IntroductionViewModel(); + +export default introductionViewModel as IntroductionViewModel; \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/module.json5 b/ETSUI/PixelConversion/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..96c8d698c6ac4f509613c4e167ade3711ab6b8e3 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/module.json5 @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/resources/base/element/color.json b/ETSUI/PixelConversion/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..ecdd10d73613b9acb28b3e948b93f8234fe051e0 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/resources/base/element/color.json @@ -0,0 +1,32 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "page_background", + "value": "#F1F3F5" + }, + { + "name": "item_background", + "value": "#FFFFFF" + }, + { + "name": "blue_background", + "value": "#007DFF" + }, + { + "name": "title_font", + "value": "#182431" + }, + { + "name": "font_background", + "value": "#FAFAFA" + }, + { + "name": "notice_font", + "value": "#FF7500" + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/resources/base/element/float.json b/ETSUI/PixelConversion/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..29e40166ab6eed01e1259489cb597358aaad961d --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/resources/base/element/float.json @@ -0,0 +1,76 @@ +{ + "float": [ + { + "name": "btn_height", + "value": "40vp" + }, + { + "name": "value_height", + "value": "28vp" + }, + { + "name": "item_padding", + "value": "12vp" + }, + { + "name": "subtitle_margin_top", + "value": "2vp" + }, + { + "name": "blue_margin_top", + "value": "4vp" + }, + { + "name": "title_margin_top", + "value": "6vp" + }, + { + "name": "desc_margin_top", + "value": "8vp" + }, + { + "name": "item_margin_top", + "value": "18vp" + }, + { + "name": "desc_line_height", + "value": "20fp" + }, + { + "name": "subtitle_line_height", + "value": "16fp" + }, + { + "name": "name_font_size", + "value": "16fp" + }, + { + "name": "title_font_size", + "value": "14fp" + }, + { + "name": "subtitle_font_size", + "value": "12fp" + }, + { + "name": "large_font_size", + "value": "24fp" + }, + { + "name": "item_border_radius", + "value": "24vp" + }, + { + "name": "notice_border_radius", + "value": "12vp" + }, + { + "name": "value_border_radius", + "value": "4vp" + }, + { + "name": "label_opacity", + "value": "0.6" + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/resources/base/element/string.json b/ETSUI/PixelConversion/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..767f2ceb0dd3c03040df703a9b809682a9b1d361 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + }, + { + "name": "pixel_introduce", + "value": "Pixel Introduce" + }, + { + "name": "pixel_conversion", + "value": "Pixel Conversion" + }, + { + "name": "HarmonyHeiTi", + "value": "HarmonyHeiTi" + }, + { + "name": "HarmonyHeiTi_Medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "font_desc", + "value": "This is a text for %dfp" + }, + { + "name": "notice", + "value": "For the conversion between lpx and px, set designWidth based on the site requirements." + }, + { + "name": "px_unit", + "value": "Physical pixel unit of the screen." + }, + { + "name": "vp_unit", + "value": "Screen density-related pixels, which are converted to screen physical pixels based on the screen pixel density." + }, + { + "name": "lpx_unit", + "value": "Logical pixel unit of the window. The unit of lpx is the ratio of the actual screen width to the logical width (configured by designWidth)." + }, + { + "name": "fp_unit", + "value": "Font pixel, similar to vp, varies with the system font size setting." + }, + { + "name": "vp_desc", + "value": "On a device with a pixel density of 160 dpi, 1vp = 1px, corresponding physical screen pixels = (Screen pixel density/160) px." + }, + { + "name": "fp_desc", + "value": "By default, the value is the same as that of vp, that is, 1vp=1fp. If the system font is manually adjusted, scale indicates the scaling ratio. The font size after setting (unit: fp) equals the font size before setting x scale." + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/resources/base/media/icon.png b/ETSUI/PixelConversion/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/PixelConversion/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/PixelConversion/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/PixelConversion/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..07e0108118dfd5ba449af262029c30312b713278 --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,7 @@ +{ + "src": [ + "pages/IndexPage", + "pages/IntroductionPage", + "pages/ConversionPage" + ] +} diff --git a/ETSUI/PixelConversion/entry/src/main/resources/en_US/element/string.json b/ETSUI/PixelConversion/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0081c51b11ea8079167e13893401af4a3334ad9a --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Pixel Conversion" + }, + { + "name": "pixel_introduce", + "value": "Pixel Introduce" + }, + { + "name": "pixel_conversion", + "value": "Pixel Conversion" + }, + { + "name": "HarmonyHeiTi", + "value": "HarmonyHeiTi" + }, + { + "name": "HarmonyHeiTi_Medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "font_desc", + "value": "This is a text for %dfp" + }, + { + "name": "notice", + "value": "For the conversion between lpx and px, set designWidth based on the site requirements." + }, + { + "name": "px_unit", + "value": "Physical pixel unit of the screen." + }, + { + "name": "vp_unit", + "value": "Screen density-related pixels, which are converted to screen physical pixels based on the screen pixel density." + }, + { + "name": "lpx_unit", + "value": "Logical pixel unit of the window. The unit of lpx is the ratio of the actual screen width to the logical width (configured by designWidth)." + }, + { + "name": "fp_unit", + "value": "Font pixel, similar to vp, varies with the system font size setting." + }, + { + "name": "vp_desc", + "value": "On a device with a pixel density of 160 dpi, 1vp = 1px, corresponding physical screen pixels = (Screen pixel density/160) px." + }, + { + "name": "fp_desc", + "value": "By default, the value is the same as that of vp, that is, 1vp=1fp. If the system font is manually adjusted, scale indicates the scaling ratio. The font size after setting (unit: fp) equals the font size before setting x scale." + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/PixelConversion/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d3d136a9fd01e76f6dd4168f4419f824d871de8a --- /dev/null +++ b/ETSUI/PixelConversion/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "像素转换" + }, + { + "name": "pixel_introduce", + "value": "像素介绍" + }, + { + "name": "pixel_conversion", + "value": "像素转换" + }, + { + "name": "HarmonyHeiTi", + "value": "HarmonyHeiTi" + }, + { + "name": "HarmonyHeiTi_Medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "font_desc", + "value": "这是一段为%dfp的文字" + }, + { + "name": "notice", + "value": "lpx与px之间的转换,需要根据实际情况设置designWidth" + }, + { + "name": "px_unit", + "value": "屏幕物理像素单位。" + }, + { + "name": "vp_unit", + "value": "屏幕密度相关像素,根据屏幕像素密度转换为屏幕物理像素。" + }, + { + "name": "lpx_unit", + "value": "视窗逻辑像素单位,lpx单位为实际屏幕宽度与逻辑宽度(通过designWidth配置)的比值。" + }, + { + "name": "fp_unit", + "value": "字体像素,与vp类似,随系统字体大小设置变化。" + }, + { + "name": "vp_desc", + "value": "像素密度为160dpi的设备上1vp=1px,1vp对应的物理屏幕像素=(屏幕像素密度/160)px " + }, + { + "name": "fp_desc", + "value": "默认情况下与vp相同,即1vp=1fp,如果用户手动调整了系统字体,scale为缩放比例,设置后的字体大小(单位fp) = 设置前的字体大小 * scale" + } + ] +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/figures/conversion_all_360.gif b/ETSUI/PixelConversion/figures/conversion_all_360.gif new file mode 100644 index 0000000000000000000000000000000000000000..820eafc7041bea448e37910d87b660360dcdc282 Binary files /dev/null and b/ETSUI/PixelConversion/figures/conversion_all_360.gif differ diff --git a/ETSUI/PixelConversion/figures/oh_conversion_360.png b/ETSUI/PixelConversion/figures/oh_conversion_360.png new file mode 100644 index 0000000000000000000000000000000000000000..120df00a0723e0578bd1b62841bcf294fcd45b33 Binary files /dev/null and b/ETSUI/PixelConversion/figures/oh_conversion_360.png differ diff --git a/ETSUI/PixelConversion/figures/oh_intro_360.png b/ETSUI/PixelConversion/figures/oh_intro_360.png new file mode 100644 index 0000000000000000000000000000000000000000..a9adbf166d50961360310922bee254b869d9b987 Binary files /dev/null and b/ETSUI/PixelConversion/figures/oh_intro_360.png differ diff --git a/ETSUI/PixelConversion/figures/zh-cn_image_0000001554588725.png b/ETSUI/PixelConversion/figures/zh-cn_image_0000001554588725.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/PixelConversion/figures/zh-cn_image_0000001554588725.png differ diff --git "a/ETSUI/PixelConversion/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" "b/ETSUI/PixelConversion/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and "b/ETSUI/PixelConversion/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" differ diff --git a/ETSUI/PixelConversion/hvigor/hvigor-config.json5 b/ETSUI/PixelConversion/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ETSUI/PixelConversion/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ETSUI/PixelConversion/hvigor/hvigor-wrapper.js b/ETSUI/PixelConversion/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/PixelConversion/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/PixelConversion/hvigorfile.ts b/ETSUI/PixelConversion/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/PixelConversion/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/PixelConversion/oh-package.json5 b/ETSUI/PixelConversion/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b9dfff5e084fb2de99f70ae9ed65706e47898143 --- /dev/null +++ b/ETSUI/PixelConversion/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "pixelconversion", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/PixelConversion/public_sys-resources/icon-caution.gif b/ETSUI/PixelConversion/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/PixelConversion/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/PixelConversion/public_sys-resources/icon-danger.gif b/ETSUI/PixelConversion/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/PixelConversion/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/PixelConversion/public_sys-resources/icon-note.gif b/ETSUI/PixelConversion/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/PixelConversion/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/PixelConversion/public_sys-resources/icon-notice.gif b/ETSUI/PixelConversion/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/PixelConversion/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/PixelConversion/public_sys-resources/icon-tip.gif b/ETSUI/PixelConversion/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/PixelConversion/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/PixelConversion/public_sys-resources/icon-warning.gif b/ETSUI/PixelConversion/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/PixelConversion/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/SecondLevelLinkage/AppScope/app.json5 b/ETSUI/SecondLevelLinkage/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..8d638fd8dc85ec452fd1ba91194d0263f22b50f7 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.SecondLevelLinkage", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/SecondLevelLinkage/AppScope/resources/base/element/string.json b/ETSUI/SecondLevelLinkage/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2816785b1e17a98cd946cf96efb957090b02634a --- /dev/null +++ b/ETSUI/SecondLevelLinkage/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "TwoLevelLink" + } + ] +} diff --git a/ETSUI/SecondLevelLinkage/AppScope/resources/base/media/app_icon.png b/ETSUI/SecondLevelLinkage/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/SecondLevelLinkage/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/SecondLevelLinkage/LICENSE b/ETSUI/SecondLevelLinkage/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/README.md b/ETSUI/SecondLevelLinkage/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4b2ae0fa1fce4bc9dfd54a3e93d50032d1d3d3f6 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/README.md @@ -0,0 +1,134 @@ +# 二级联动(ArkTS) + +## 介绍 +本篇Codelab主要介绍如何基于List组件实现一个导航和内容的二级联动效果。样例主要包含以下功能: + +1. 切换左侧导航,右侧滚动到对应的内容。 +2. 滚动右侧的内容,左侧会切换对应的导航。 + +![](figures/oh_level_360.gif) + +### 相关概念 +- [List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md):列表包含一系列相同宽度的列表项。适合连续、多行呈现同类数据,例如图片和文本。 +- [ListItemGroup](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-listitemgroup.md): 该组件用来展示列表item分组,宽度默认充满List组件,必须配合List组件来使用。 + + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001554588725.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──ClassifyModel.ets // 导航bean +│ │ │ ├──CourseModel.ets // 课程内容bean +│ │ │ └──LinkDataModel.ets // 数据源bean +│ │ └──constants +│ │ └──Constants.ets // 常量类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ └──IndexPage.ets // 二级联动页面入口 +│ ├──view +│ │ ├──ClassifyItem.ets // 课程分类组件 +│ │ └──CourseItem.ets // 课程信息组件 +│ └──viewmodel +│ └──ClassifyViewModel.ets // 导航ViewModel +└──entry/src/main/resources // 资源文件 +``` + +## 二级联动实现 +界面整体使用Row组件实现横向布局,分为左右两部分。均使用List组件实现对导航和内容的数据展示,导航部分固定宽度,内容部分自适应屏幕剩余宽度并用ListItemGroup完成每个导航下的内容布局。 + +![](figures/oh_level_360.png) + +```typescript +Row() { + List({ scroller: this.classifyScroller }) { + ForEach(this.classifyList, (item: ClassifyModel, index: number) => { + ListItem() { + ClassifyItem({ + classifyName: item.classifyName, + isSelected: this.currentClassify === index, + onClickAction: this.classifyChangeAction.bind(this, index, true) + }) + } + }, (item: ClassifyModel) => item.classifyName) + } + + List({ scroller: this.scroller }) { + ForEach(this.classifyList, (classifyItem: ClassifyModel) => { + ListItemGroup({ + header: this.ClassifyHeader(classifyItem.classifyName), + space: Constants.COURSE_ITEM_PADDING + }) { + ForEach(classifyItem.courseList, (courseItem: CourseModel) => { + ListItem() { + CourseItem({ itemStr: JSON.stringify(courseItem) }) + } + }, courseItem => courseItem.courseId) + } + }, item => item.classifyId) + } + .sticky(StickyStyle.Header) + .layoutWeight(1) + .edgeEffect(EdgeEffect.None) + .onScrollIndex((start: number) => this.classifyChangeAction(start, false)) +} +``` + +点击左侧导航时,右侧内容区域通过scrollToIndex方法跳转到对应的内容页面,并改变导航的选中状态。同理在滚动右侧内容的过程中,如果当前展示的ListItemGroup发生改变时,修改左侧导航的选中状态,并滚到到对应的导航item。 + +```typescript +classifyChangeAction(index: number, isClassify: boolean) { + if (this.currentClassify !== index) { + // change the classify status + this.currentClassify = index; + if (isClassify) { + // scroll the course scroll + this.scroller.scrollToIndex(index); + } else { + // scroll the classify scroll + this.classifyScroller.scrollToIndex(index); + } + } +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用List组件实现导航与内容联动的效果。 +2. ListItemGroup组件的使用方法。 + +![](figures/彩带动效.gif) \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/build-profile.json5 b/ETSUI/SecondLevelLinkage/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/build-profile.json5 b/ETSUI/SecondLevelLinkage/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/hvigorfile.ts b/ETSUI/SecondLevelLinkage/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/SecondLevelLinkage/entry/oh-package.json5 b/ETSUI/SecondLevelLinkage/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/ClassifyModel.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/ClassifyModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..871056e1b4990da173808fdcdc0972ddfb88c393 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/ClassifyModel.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CourseModel from './CourseModel'; + +/** + * course classity model + */ +export default class ClassifyModel { + /** + * classify id + */ + classifyId: number; + /** + * classify name + */ + classifyName: string; + /** + * course list of the classify. + */ + courseList: Array; +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/CourseModel.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/CourseModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..d86284324237031a0f855958826e849e089132f7 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/CourseModel.ets @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Course Model + */ +export default class CourseModel { + classifyId: number; + courseId: number; + courseName: string; + imageUrl: Resource; + price: number; +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/LinkDataModel.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/LinkDataModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..347e46503f5b2b0342c1403bdb21643cfda3bc4c --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/bean/LinkDataModel.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * initial data model. + */ +export default class LinkDataModel { + /** + * parentId + */ + superId: number; + /** + * ParentName + */ + superName: string; + id: number; + courseName: string; + price: number; + imageUrl: Resource; +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/constants/Constants.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/constants/Constants.ets new file mode 100644 index 0000000000000000000000000000000000000000..c478075b104f608fd1b6036c6a5fc1dd41141caa --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/common/constants/Constants.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export default class Constants { + /** + * label font weight 400. + */ + static readonly LABEL_FONT_WEIGHT: number = 400; + + /** + * title font weight 500. + */ + static readonly TITLE_FONT_WEIGHT: number = 500; + + /** + * course item padding 12. + */ + static readonly COURSE_ITEM_PADDING: number = 12; + + /** + * loading duration 2000. + */ + static readonly LOADING_DURATION: number = 2000; + + /** + * title line number 2. + */ + static readonly TITLE_LINE_NUMBER: number = 2; + + /** + * 100 percent. + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * classify title percent. + */ + static readonly CLASSIFY_TITLE_PERCENT: string = '55%'; +} diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/SecondLevelLinkage/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..833d588b66566de2992d78bba443eb4de2249a21 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,51 @@ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import Window from '@ohos.window' + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/IndexPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/pages/IndexPage.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/pages/IndexPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..10230b4a7c3038c1a806c672c42f45febb9b4702 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/pages/IndexPage.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import ClassifyModel from '../common/bean/ClassifyModel'; +import CourseModel from '../common/bean/CourseModel'; +import CourseItem from '../view/CourseItem'; +import ClassifyItem from '../view/ClassityItem'; +import ClassifyViewModel from '../viewmodel/ClassifyViewModel'; + +@Entry +@Component +struct IndexPage { + @State currentClassify: number = 0; // selected classify index. + @State requestSuccess: boolean = false; // is loading data. + private classifyList: Array = []; + private classifyScroller: Scroller = new Scroller(); + private scroller: Scroller = new Scroller(); + + aboutToAppear() { + // loading data. + setTimeout(() => { + this.classifyList = ClassifyViewModel.getLinkData(); + this.requestSuccess = true; + }, Constants.LOADING_DURATION); + } + + @Builder ClassifyHeader(classifyName: string) { + Row() { + Text(classifyName) + .fontSize($r('app.float.header_font_size')) + .fontColor($r('app.color.base_font_color')) + .fontFamily($r('app.string.hei_ti_medium')) + .fontWeight(Constants.TITLE_FONT_WEIGHT) + } + .padding({ left: $r('app.float.item_padding_left') }) + .height($r('app.float.classify_item_height')) + .width(Constants.FULL_PERCENT) + .backgroundColor($r('app.color.base_background')) + } + + classifyChangeAction(index: number, isClassify: boolean) { + if (this.currentClassify !== index) { + // change the classify status. + this.currentClassify = index; + if (isClassify) { + // scroll the course scroll. + this.scroller.scrollToIndex(index); + } else { + // scroll the classify scroll. + this.classifyScroller.scrollToIndex(index); + } + } + } + + build() { + Row() { + if (this.requestSuccess) { + List({ scroller: this.classifyScroller }) { + ForEach(this.classifyList, (item: ClassifyModel, index: number) => { + ListItem() { + ClassifyItem({ + classifyName: item.classifyName, + isSelected: this.currentClassify === index, + onClickAction: this.classifyChangeAction.bind(this, index, true) + }) + } + }, (item: ClassifyModel) => item.classifyName + this.currentClassify) + } + .height(Constants.FULL_PERCENT) + .width($r('app.float.classify_item_width')) + .backgroundColor($r('app.color.classify_background')) + .scrollBar(BarState.Off) + + List({ scroller: this.scroller }) { + ForEach(this.classifyList, (classifyItem: ClassifyModel) => { + ListItemGroup({ + header: this.ClassifyHeader(classifyItem.classifyName), + space: Constants.COURSE_ITEM_PADDING + }) { + ForEach(classifyItem.courseList, (courseItem: CourseModel) => { + ListItem() { + CourseItem({ itemStr: JSON.stringify(courseItem) }) + } + }, (courseItem: CourseModel) => `${courseItem.courseId}`) + } + }, (item: ClassifyModel) => `${item.classifyId}`) + } + .padding({ left: $r('app.float.item_padding_left'), right: $r('app.float.course_item_padding') }) + .sticky(StickyStyle.Header) + .layoutWeight(1) + .edgeEffect(EdgeEffect.None) + .onScrollIndex((start: number) => this.classifyChangeAction(start, false)) + } else { + Text($r('app.string.loading')) + .fontFamily($r('app.string.hei_ti_medium')) + .textAlign(TextAlign.Center) + .height(Constants.FULL_PERCENT) + .width(Constants.FULL_PERCENT) + } + } + .backgroundColor($r('app.color.base_background')) + } +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/view/ClassityItem.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/view/ClassityItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..891fc338d9cff263e72ec5849d74be62cdcfa4b6 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/view/ClassityItem.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; + +@Component +export default struct ClassifyItem { + classifyName: string; + @Prop isSelected: boolean; + onClickAction: () => void; + + build() { + Text(this.classifyName) + .fontSize($r('app.float.normal_font_size')) + .fontColor(this.isSelected ? $r('app.color.base_font_color') : $r('app.color.normal_font_color')) + .fontFamily(this.isSelected ? $r('app.string.hei_ti_medium') : $r('app.string.hei_ti')) + .fontWeight(this.isSelected ? Constants.TITLE_FONT_WEIGHT : Constants.LABEL_FONT_WEIGHT) + .textAlign(TextAlign.Center) + .backgroundColor(this.isSelected ? $r('app.color.base_background') : null) + .width(Constants.FULL_PERCENT) + .height($r('app.float.classify_item_height')) + .onClick(this.onClickAction) + } +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/view/CourseItem.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/view/CourseItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd4707873e1a358e87dd2ac8438c401f73129bf0 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/view/CourseItem.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Huawei Device 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 Constants from '../common/constants/Constants'; +import CourseModel from '../common/bean/CourseModel'; + +@Component +export default struct CourseItem { + @Prop itemStr: string; + item: CourseModel; + + aboutToAppear() { + this.item = JSON.parse(this.itemStr); + } + + build() { + Row() { + Image(this.item.imageUrl) + .height(Constants.FULL_PERCENT) + .aspectRatio(1) + Column() { + Text(this.item.courseName) + .fontSize($r('app.float.normal_font_size')) + .fontColor($r('app.color.base_font_color')) + .fontFamily($r('app.string.hei_ti_medium')) + .maxLines(Constants.TITLE_LINE_NUMBER) + .textOverflow({ overflow: TextOverflow.Clip }) + .lineHeight($r('app.float.title_line_height')) + .width(Constants.FULL_PERCENT) + Text(this.item.price === 0 ? $r('app.string.free_price') : $r('app.string.price_str', this.item.price)) + .fontSize($r('app.float.header_font_size')) + .fontColor($r('app.color.price_color')) + .fontFamily($r('app.string.hei_ti_medium')) + } + .padding($r('app.float.course_item_padding')) + .layoutWeight(1) + .alignItems(HorizontalAlign.Start) + .justifyContent(FlexAlign.SpaceBetween) + .height(Constants.FULL_PERCENT) + } + .clip(true) + .borderRadius($r('app.float.normal_border_radius')) + .backgroundColor($r('app.color.start_window_background')) + .width('100%') + .height($r('app.float.course_item_height')) + } +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/ets/viewmodel/ClassifyViewModel.ets b/ETSUI/SecondLevelLinkage/entry/src/main/ets/viewmodel/ClassifyViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..106a233f4ed676d20ffc2cfdac9aeefd487bea28 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/ets/viewmodel/ClassifyViewModel.ets @@ -0,0 +1,498 @@ +/* + * Copyright (c) 2023 Huawei Device 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 ClassifyModel from '../common/bean/ClassifyModel'; +import CourseModel from '../common/bean/CourseModel'; +import LinkDataModel from '../common/bean/LinkDataModel'; + +class ClassifyViewModel { + /** + * Get Classify list data + * + * @returns Array linkDataList + */ + getLinkData(): Array { + let linkDataList: Array = []; + let superId: number = 0; + LINK_DATA.forEach((item: LinkDataModel) => { + if (superId !== item.superId) { + // add the course classify model. + let classifyItem: ClassifyModel = { + classifyId: item.superId, + classifyName: item.superName, + courseList: [] + }; + linkDataList.push(classifyItem); + } + // add the course model. + let courseItem: CourseModel = { + classifyId: superId, + courseId: item.id, + courseName: item.courseName, + imageUrl: item.imageUrl, + price: item.price + }; + linkDataList[linkDataList.length-1].courseList.push(courseItem); + superId = item.superId; + }); + return linkDataList; + } +} + +let classifyViewModel = new ClassifyViewModel(); +export default classifyViewModel as ClassifyViewModel; + +const LINK_DATA: LinkDataModel[] = [ + { + 'superId': 1, + 'superName': '热门课程', + 'id': 1, + 'courseName': '应用市场介绍', + 'imageUrl': $r('app.media.ic_img_1'), + 'price': 0 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 2, + 'courseName': '上架流程', + 'imageUrl': $r('app.media.ic_img_2'), + 'price': 100 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 3, + 'courseName': '应用出海', + 'imageUrl': $r('app.media.ic_img_3'), + 'price': 50 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 4, + 'courseName': '审核政策', + 'imageUrl': $r('app.media.ic_img_4'), + 'price': 222 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 5, + 'courseName': 'CaaS Kit - HMS Core精品实战课', + 'imageUrl': $r('app.media.ic_img_5'), + 'price': 256 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 6, + 'courseName': '机器学习在图像分割场景中的应用', + 'imageUrl': $r('app.media.ic_img_6'), + 'price': 0 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 7, + 'courseName': '一分钟了解华为应用内支付服务', + 'imageUrl': $r('app.media.ic_img_7'), + 'price': 0 + }, + { + 'superId': 1, + 'superName': '热门课程', + 'id': 8, + 'courseName': '一分钟了解华为位置服务', + 'imageUrl': $r('app.media.ic_img_8'), + 'price': 400 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 9, + 'courseName': 'Excel函数在商业中的应用', + 'imageUrl': $r('app.media.ic_img_9'), + 'price': 65 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 10, + 'courseName': '“震动”手机锁屏制作', + 'imageUrl': $r('app.media.ic_img_10'), + 'price': 0 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 11, + 'courseName': '“流体动效”手机锁屏制作', + 'imageUrl': $r('app.media.ic_img_11'), + 'price': 50 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 12, + 'courseName': 'HUAWEI GT自定义表盘制作', + 'imageUrl': $r('app.media.ic_img_12'), + 'price': 70 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 13, + 'courseName': '商务表盘制作', + 'imageUrl': $r('app.media.ic_img_13'), + 'price': 0 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 14, + 'courseName': '5分钟了解跨应用、跨形态无缝登录', + 'imageUrl': $r('app.media.ic_img_14'), + 'price': 80 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 15, + 'courseName': 'oCPC进阶功能及最新政策解读', + 'imageUrl': $r('app.media.ic_img_15'), + 'price': 120 + }, + { + 'superId': 2, + 'superName': '最新课程', + 'id': 16, + 'courseName': 'HUAWEI Ads 游戏行业投放指南', + 'imageUrl': $r('app.media.ic_img_16'), + 'price': 160 + }, + { + 'superId': 3, + 'superName': 'HarmonyOS', + 'id': 17, + 'courseName': 'HarmonyOS物联网开发课程', + 'imageUrl': $r('app.media.ic_img_17'), + 'price': 1020 + }, + { + 'superId': 3, + 'superName': 'HarmonyOS', + 'id': 18, + 'courseName': '【Hello系列直播课】第1期:手把手教你搭建开发环境', + 'imageUrl': $r('app.media.ic_img_18'), + 'price': 0 + }, + { + 'superId': 3, + 'superName': 'HarmonyOS', + 'id': 19, + 'courseName': 'HarmonyOS技术训练营-10分钟快速体验HarmonyOS分布式应用', + 'imageUrl': $r('app.media.ic_img_9'), + 'price': 0 + }, + { + 'superId': 3, + 'superName': 'HarmonyOS', + 'id': 20, + 'courseName': '应用开发基础:JS FA开发基础(第一期)', + 'imageUrl': $r('app.media.ic_img_10'), + 'price': 0 + }, + { + 'superId': 3, + 'superName': 'HarmonyOS', + 'id': 21, + 'courseName': 'HarmonyOS Connect设备开发基础:OpenHarmony基础', + 'imageUrl': $r('app.media.ic_img_1'), + 'price': 60 + }, + { + 'superId': 3, + 'superName': 'HarmonyOS', + 'id': 22, + 'courseName': '组件开发和集成:SDK集成指南(第五期)', + 'imageUrl': $r('app.media.ic_img_2'), + 'price': 120 + }, + { + 'superId': 4, + 'superName': '精彩活动', + 'id': 23, + 'courseName': 'HUAWEI Developer Day•2018北京精彩回顾', + 'imageUrl': $r('app.media.ic_img_3'), + 'price': 0 + }, + { + 'superId': 4, + 'superName': '精彩活动', + 'id': 24, + 'courseName': '华为AR帮你轻松打造酷炫应用', + 'imageUrl': $r('app.media.ic_img_4'), + 'price': 99 + }, + { + 'superId': 4, + 'superName': '精彩活动', + 'id': 25, + 'courseName': 'AR VR应用创新大赛获奖作品', + 'imageUrl': $r('app.media.ic_img_5'), + 'price': 30 + }, + { + 'superId': 4, + 'superName': '精彩活动', + 'id': 26, + 'courseName': '华为HiLink智能家居生态介绍', + 'imageUrl': $r('app.media.ic_img_6'), + 'price': 80 + }, + { + 'superId': 4, + 'superName': '精彩活动', + 'id': 27, + 'courseName': '华为校园千帆行丨武汉站', + 'imageUrl': $r('app.media.ic_img_7'), + 'price': 160 + }, + { + 'superId': 4, + 'superName': '精彩活动', + 'id': 28, + 'courseName': 'HUAWEI Developer Day•杭州站精彩回顾', + 'imageUrl': $r('app.media.ic_img_8'), + 'price': 0 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 29, + 'courseName': '优秀实践分享 - 掌阅科技', + 'imageUrl': $r('app.media.ic_img_9'), + 'price': 0 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 30, + 'courseName': '极限试驾', + 'imageUrl': $r('app.media.ic_img_10'), + 'price': 130 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 31, + 'courseName': 'AR狙击手', + 'imageUrl': $r('app.media.ic_img_11'), + 'price': 100 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 32, + 'courseName': '宇宙解码', + 'imageUrl': $r('app.media.ic_img_12'), + 'price': 100 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 33, + 'courseName': 'Wars of Stone', + 'imageUrl': $r('app.media.ic_img_13'), + 'price': 1200 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 34, + 'courseName': 'ROCK ME', + 'imageUrl': $r('app.media.ic_img_14'), + 'price': 156 + }, + { + 'superId': 5, + 'superName': '开发者说', + 'id': 35, + 'courseName': '神奇AR智能宝宝', + 'imageUrl': $r('app.media.ic_img_15'), + 'price': 130 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 36, + 'courseName': '从零开始学架构', + 'imageUrl': $r('app.media.ic_img_16'), + 'price': 120 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 37, + 'courseName': '架构设计之异步化技术', + 'imageUrl': $r('app.media.ic_img_17'), + 'price': 0 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 38, + 'courseName': '架构设计之页面静态化技术', + 'imageUrl': $r('app.media.ic_img_18'), + 'price': 0 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 39, + 'courseName': 'Python极简入门', + 'imageUrl': $r('app.media.ic_img_9'), + 'price': 0 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 40, + 'courseName': 'Python实践指南', + 'imageUrl': $r('app.media.ic_img_10'), + 'price': 2001 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 41, + 'courseName': 'Java高级特性', + 'imageUrl': $r('app.media.ic_img_1'), + 'price': 30 + }, + { + 'superId': 6, + 'superName': '后端开发', + 'id': 42, + 'courseName': 'C++核心编程', + 'imageUrl': $r('app.media.ic_img_2'), + 'price': 50 + }, + { + 'superId': 7, + 'superName': '移动开发', + 'id': 43, + 'courseName': 'EMUI 9.1主题转10.0主题适配指导', + 'imageUrl': $r('app.media.ic_img_3'), + 'price': 0 + }, + { + 'superId': 7, + 'superName': '移动开发', + 'id': 44, + 'courseName': '“流体动效”手机锁屏制作', + 'imageUrl': $r('app.media.ic_img_4'), + 'price': 0 + }, + { + 'superId': 7, + 'superName': '移动开发', + 'id': 45, + 'courseName': '“震动”手机锁屏制作', + 'imageUrl': $r('app.media.ic_img_5'), + 'price': 0 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 46, + 'courseName': 'DevOps新技术入门', + 'imageUrl': $r('app.media.ic_img_6'), + 'price': 50 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 47, + 'courseName': 'Vue.js 框架开发系列课程', + 'imageUrl': $r('app.media.ic_img_7'), + 'price': 60 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 48, + 'courseName': 'jQuery实例精讲', + 'imageUrl': $r('app.media.ic_img_8'), + 'price': 80 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 49, + 'courseName': 'JavaScript 编程技巧与实战', + 'imageUrl': $r('app.media.ic_img_9'), + 'price': 300 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 50, + 'courseName': '基于 Bootstrap 框架开发技巧实战', + 'imageUrl': $r('app.media.ic_img_10'), + 'price': 150 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 51, + 'courseName': 'Java Web开发课程', + 'imageUrl': $r('app.media.ic_img_11'), + 'price': 200 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 52, + 'courseName': 'JavaScript 设计模式', + 'imageUrl': $r('app.media.ic_img_12'), + 'price': 0 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 53, + 'courseName': 'HTML入门基础系列课程', + 'imageUrl': $r('app.media.ic_img_13'), + 'price': 0 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 54, + 'courseName': '前端系列第7期-微前端–架构介绍篇', + 'imageUrl': $r('app.media.ic_img_14'), + 'price': 100 + }, + { + 'superId': 8, + 'superName': '前端开发', + 'id': 55, + 'courseName': 'Web安全系列课程', + 'imageUrl': $r('app.media.ic_img_15'), + 'price': 0 + } +] \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/module.json5 b/ETSUI/SecondLevelLinkage/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..dc7297022e1450d45d4ba7e4cd650ae3d7f31859 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/module.json5 @@ -0,0 +1,36 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/color.json b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..bbd12ba2934d32fd8d3b490925b937f9eba88627 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/color.json @@ -0,0 +1,28 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "classify_background", + "value": "#0D182431" + }, + { + "name": "base_background", + "value": "#F1F3F5" + }, + { + "name": "base_font_color", + "value": "#182431" + }, + { + "name": "normal_font_color", + "value": "#99182431" + }, + { + "name": "price_color", + "value": "#FA2A2D" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/float.json b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..8b641c72c33bab93b6fae81cbcbd0610d5fa002c --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/float.json @@ -0,0 +1,40 @@ +{ + "float": [ + { + "name": "classify_item_width", + "value": "100vp" + }, + { + "name": "course_item_height", + "value": "96vp" + }, + { + "name": "classify_item_height", + "value": "56vp" + }, + { + "name": "title_line_height", + "value": "20vp" + }, + { + "name": "course_item_padding", + "value": "12vp" + }, + { + "name": "item_padding_left", + "value": "8vp" + }, + { + "name": "normal_border_radius", + "value": "18vp" + }, + { + "name": "header_font_size", + "value": "18fp" + }, + { + "name": "normal_font_size", + "value": "14fp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/string.json b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..083356a580d93f7d7649dbd6d53d563086e18cf8 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Two Level Link" + }, + { + "name": "loading", + "value": "loading..." + }, + { + "name": "free_price", + "value": "Free" + }, + { + "name": "price_str", + "value": "¥%d" + }, + { + "name": "hei_ti_medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "hei_ti", + "value": "HarmonyHeiTi" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_1.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_1.png new file mode 100644 index 0000000000000000000000000000000000000000..50dc1b8a99a787cc33ca57ad51eed845a81c8406 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_1.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_10.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_10.png new file mode 100644 index 0000000000000000000000000000000000000000..9a15ed7efce5af8843be0dfd094de873c3a4a632 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_10.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_11.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_11.png new file mode 100644 index 0000000000000000000000000000000000000000..505595f1996a1ea00966ba3f26b9f783daeda2ac Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_11.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_12.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_12.png new file mode 100644 index 0000000000000000000000000000000000000000..b3676633bd290ee944d489a8aa86e80cffabc5bc Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_12.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_13.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_13.png new file mode 100644 index 0000000000000000000000000000000000000000..46d093f4bf15d47250511aa2abbdbf43c3725ba4 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_13.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_14.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_14.png new file mode 100644 index 0000000000000000000000000000000000000000..a67a14fa164e4a6d27780c8bd22e094962633ea1 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_14.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_15.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_15.png new file mode 100644 index 0000000000000000000000000000000000000000..90e44a5a3aecfd5e1dc3ef224ea1c364e134c02c Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_15.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_16.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_16.png new file mode 100644 index 0000000000000000000000000000000000000000..15e5162c0c80905667dfd23e765f508d0b4d4194 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_16.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_17.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_17.png new file mode 100644 index 0000000000000000000000000000000000000000..bf86a41d2ad4b848cf1e9ec79cb716a18e7532e2 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_17.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_18.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_18.png new file mode 100644 index 0000000000000000000000000000000000000000..47d7f782f8039a48a4a676b8ff760303717b4b56 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_18.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_2.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_2.png new file mode 100644 index 0000000000000000000000000000000000000000..2492120e02e83aa622ca53ec059a701a0a1a3dd7 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_2.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_3.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_3.png new file mode 100644 index 0000000000000000000000000000000000000000..cc1364d62edbfb0f1a31ddbb811869b969c87b10 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_3.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_4.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_4.png new file mode 100644 index 0000000000000000000000000000000000000000..9d45893ee6a7082b16322f8fca5ed97bc87d5b9c Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_4.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_5.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_5.png new file mode 100644 index 0000000000000000000000000000000000000000..eaffacb3a385ad13f4efb38c8a33b057cc386687 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_5.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_6.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_6.png new file mode 100644 index 0000000000000000000000000000000000000000..f032a158d4cf40e19e2f3543645974083f9a59cf Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_6.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_7.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_7.png new file mode 100644 index 0000000000000000000000000000000000000000..694a7fc60e9576f85c1eab029ffab53e9a08a63e Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_7.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_8.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_8.png new file mode 100644 index 0000000000000000000000000000000000000000..b57b2d9a3b4ceb2f2b565902e673e63bdca3252e Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_8.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_9.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_9.png new file mode 100644 index 0000000000000000000000000000000000000000..813b3a72cca8564a44f5dd9b3f019d2789bcacfc Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/ic_img_9.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/icon.png b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..941d56283f91d0c50173d67c61bd397d493ed21e --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/IndexPage" + ] +} diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/en_US/element/string.json b/ETSUI/SecondLevelLinkage/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..083356a580d93f7d7649dbd6d53d563086e18cf8 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Two Level Link" + }, + { + "name": "loading", + "value": "loading..." + }, + { + "name": "free_price", + "value": "Free" + }, + { + "name": "price_str", + "value": "¥%d" + }, + { + "name": "hei_ti_medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "hei_ti", + "value": "HarmonyHeiTi" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/SecondLevelLinkage/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c01a61e27f37eb59c6014ac9fac670ad6fc827e6 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "二级联动" + }, + { + "name": "loading", + "value": "加载数据中..." + }, + { + "name": "free_price", + "value": "免费" + }, + { + "name": "price_str", + "value": "¥%d" + }, + { + "name": "hei_ti_medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "hei_ti", + "value": "HarmonyHeiTi" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/figures/oh_level_360.gif b/ETSUI/SecondLevelLinkage/figures/oh_level_360.gif new file mode 100644 index 0000000000000000000000000000000000000000..3c6839560a00fc8069f1f24908e5e4b39f78e3f1 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/figures/oh_level_360.gif differ diff --git a/ETSUI/SecondLevelLinkage/figures/oh_level_360.png b/ETSUI/SecondLevelLinkage/figures/oh_level_360.png new file mode 100644 index 0000000000000000000000000000000000000000..7225883931047652da4a2de360d757b74afe63be Binary files /dev/null and b/ETSUI/SecondLevelLinkage/figures/oh_level_360.png differ diff --git a/ETSUI/SecondLevelLinkage/figures/zh-cn_image_0000001554588725.png b/ETSUI/SecondLevelLinkage/figures/zh-cn_image_0000001554588725.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/SecondLevelLinkage/figures/zh-cn_image_0000001554588725.png differ diff --git "a/ETSUI/SecondLevelLinkage/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" "b/ETSUI/SecondLevelLinkage/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and "b/ETSUI/SecondLevelLinkage/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" differ diff --git a/ETSUI/SecondLevelLinkage/hvigor/hvigor-config.json5 b/ETSUI/SecondLevelLinkage/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/hvigor/hvigor-wrapper.js b/ETSUI/SecondLevelLinkage/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/hvigorfile.ts b/ETSUI/SecondLevelLinkage/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/SecondLevelLinkage/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/SecondLevelLinkage/oh-package.json5 b/ETSUI/SecondLevelLinkage/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ec676fb5bc878684ffa81caf3df16fbb115ca72c --- /dev/null +++ b/ETSUI/SecondLevelLinkage/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "secondlevellinkage", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/SecondLevelLinkage/public_sys-resources/icon-caution.gif b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/SecondLevelLinkage/public_sys-resources/icon-danger.gif b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/SecondLevelLinkage/public_sys-resources/icon-note.gif b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/SecondLevelLinkage/public_sys-resources/icon-notice.gif b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/SecondLevelLinkage/public_sys-resources/icon-tip.gif b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/SecondLevelLinkage/public_sys-resources/icon-warning.gif b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SecondLevelLinkage/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/SimpleCalculator/AppScope/app.json5 b/ETSUI/SimpleCalculator/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..26064b0476fe1a76671da40eb25f1454a7e49854 --- /dev/null +++ b/ETSUI/SimpleCalculator/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.simplecalculator", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/SimpleCalculator/AppScope/resources/base/element/string.json b/ETSUI/SimpleCalculator/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..94d3c532725d617beeaa20b057c5735190dd1b2c --- /dev/null +++ b/ETSUI/SimpleCalculator/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "SimpleCalculator" + } + ] +} diff --git a/ETSUI/SimpleCalculator/AppScope/resources/base/media/app_icon.png b/ETSUI/SimpleCalculator/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/SimpleCalculator/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/SimpleCalculator/LICENSE b/ETSUI/SimpleCalculator/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/ETSUI/SimpleCalculator/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/README.md b/ETSUI/SimpleCalculator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..25db8030c2a2dfcdc8cfd2c2203c509261ee0df1 --- /dev/null +++ b/ETSUI/SimpleCalculator/README.md @@ -0,0 +1,466 @@ +# 简易计算器(ArkTS) + +## 介绍 + +本篇Codelab基于基础组件、容器组件,实现一个支持加减乘除混合运算的计算器。 + +![](figures/1.gif) + +>![](public_sys-resources/icon-note.gif) **说明:** +>由于数字都是双精度浮点数,在计算机中是二进制存储数据的,因此小数和非安全整数(超过整数的安全范围[-Math.pow(2, 53),Math.pow(2, 53)]的数据)在计算过程中会存在精度丢失的情况。 +> +>1、小数运算时:“0.2 + 2.22 = 2.4200000000000004”,当前示例的解决方法是将小数扩展到整数进行计算,计算完成之后再将结果缩小,计算过程为“(0.2 * 100 + 2.22 * 100) / 100 = 2.42”。 +> +>2、非安全整数运算时:“9007199254740992 + 1 = 9.007199254740992”,当前示例中将长度超过15位的数字转换成科学计数法,计算结果为“9007199254740992 + 1 = 9.007199254740993e15”。 + +### 相关概念 + +- [ForEach](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/arkts-rendering-control-foreach.md)组件:循环渲染组件**,**迭代数组并为每个数组项创建相应的组件。 +- [TextInput](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md)组件:单行文本输入框组件。 +- [Image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md)组件:图片组件,支持本地图片和网络图片的渲染展示。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001405854998.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ └──PressKeysBean.ets // 按键bean类 +│ │ ├──constants +│ │ │ └──CommonConstants.ets // 公共常量类 +│ │ └──util +│ │ ├──CalculateUtil.ets // 计算工具类 +│ │ ├──CheckEmptyUtil.ets // 非空判断工具类 +│ │ └──Logger.ets // 日志管理工具类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──model +│ │ └──CalculateModel.ets // 计算器页面数据处理类 +│ ├──pages +│ │ └──HomePage.ets // 计算器页面 +│ └──viewmodel +│ └──PresskeysBeanViewModel.ets // 计算器页面键盘数据 +└──entry/src/main/resource // 应用静态资源目录 +``` + +## 页面设计 + +页面由表达式输入框、结果输出框、键盘输入区域三部分组成,效果图如图: + +![](figures/2.png) + +表达式输入框位于页面最上方,使用TextInput组件实时显示键盘输入的数据,默认字体大小为“64fp”,当表达式输入框中数据长度大于9时,字体大小为“32fp”。 + +```typescript +// HomePage.ets +Column() { + TextInput({ text: this.model.resultFormat(this.inputValue) }) + .height(CommonConstants.FULL_PERCENT) + .fontSize( + (this.inputValue.length > CommonConstants.INPUT_LENGTH_MAX ? + $r('app.float.font_size_text')) : $r('app.float.font_size_input') + ) + .enabled(false) + .fontColor(Color.Black) + .textAlign(TextAlign.End) + .backgroundColor($r('app.color.input_back_color')) +} +.... +.margin({ + right: $r('app.float.input_margin_right'), + top: $r('app.float.input_margin_top') +}) +``` + +结果输出框位于表达式输入框下方,使用Text组件实时显示计算结果和“错误”提示,当表达式输入框最后一位为运算符时结果输出框中值不变。 + +```typescript +// HomePage.ets +Column() { + Text(this.model.resultFormat(this.calValue)) + .fontSize($r('app.float.font_size_text')) + .fontColor($r('app.color.text_color')) +} +.width(CommonConstants.FULL_PERCENT) +.height($r('app.float.text_height')) +.alignItems(HorizontalAlign.End) +.margin({ + right: $r('app.float.text_margin_right'), + bottom: $r('app.float.text_margin_bottom')}) +``` + +用ForEach组件渲染键盘输入区域,其中0~9、“.”、“%”用Text组件渲染;“+-×÷=”、清零、删除用Image组件渲染。 + +```typescript +// HomePage.ets +ForEach(columnItem, (keyItem: PressKeysBean, keyItemIndex: number) => { + Column() { + Column() { + if (keyItem.flag === 0) { + Image(keyItem.source) + .width(keyItem.width) + .height(keyItem.height) + } else { + Text(keyItem.value) + .fontSize( + (keyItem.value === CommonConstants.DOTS) ? + $r('app.float.font_size_dot') : $r('app.float.font_size_text') + ) + .width(keyItem.width) + .height(keyItem.height) + } + } + .width($r('app.float.key_width')) + .height( + ((columnItemIndex === (keysModel.getPressKeys().length - 1)) && + (keyItemIndex === (columnItem.length - 1))) ? + $r('app.float.equals_height') : $r('app.float.key_height') + ) + ... + .backgroundColor( + ((columnItemIndex === (keysModel.getPressKeys().length - 1)) && + (keyItemIndex === (columnItem.length - 1))) ? + $r('app.color.equals_back_color') : Color.White + ) + ... + } + .layoutWeight( + ((columnItemIndex === (keysModel.getPressKeys().length - 1)) && + (keyItemIndex === (columnItem.length - 1))) ? CommonConstants.TWO : 1 + ) + ... +}, keyItem => JSON.stringify(keyItem)) +``` + +## 组装计算表达式 + +页面中数字输入和运算符输入分别调用inputNumber方法和inputSymbol方法。 + +```typescript +// HomePage.ets +ForEach(columnItem, (keyItem: PressKeysBean, keyItemIndex: number) => { + Column() { + Column() { + ... + } + ... + .onClick(() => { + if (keyItem.flag === 0) { + this.model.inputSymbol(keyItem.value); + } else { + this.model.inputNumber(keyItem.value); + } + }) + } + ... + ) + ... +}, keyItem => JSON.stringify(keyItem)) +``` + +>![](public_sys-resources/icon-note.gif) **说明:** +>输入的数字和运算符保存在数组中,数组通过“+-×÷”运算符将数字分开。 +>例如表达式为“10×8.2+40%÷2×-5-1”在数组中为\["10", "×", "8.2", "+", "40%", "÷", "2", "×", "-5", "-", "1"\]。 +>表达式中“%”为百分比,例如“40%”为“0.4”。 + +当为数字输入时,首先根据表达式数组中最后一个元素判断当前输入是否匹配,再判断表达式数组中最后一个元素为是否为负数。 + +```typescript +// CalculateModel.ets +inputNumber(value: string) { + ... + let len = this.expressions.length; + let last = len > 0 ? this.expressions[len - 1] : ''; + let secondLast = len > 1 ? this.expressions[len - CommonConstants.TWO] : undefined; + if (!this.validateEnter(last, value)) { + return; + } + if (!last) { + this.expressions.push(value); + } else if (!secondLast) { + this.expressions[len - 1] += value; + } + if (secondLast && CalculateUtil.isSymbol(secondLast)) { + this.expressions[len -1] += value; + } + if (secondLast && !CalculateUtil.isSymbol(secondLast)) { + this.expressions.push(value); + } + ... +} + +// CalculateModel.ets +validateEnter(last: string, value: string) { + if (!last && value === CommonConstants.PERCENT_SIGN) { + return false; + } + if ((last === CommonConstants.MIN) && (value === CommonConstants.PERCENT_SIGN)) { + return false; + } + if (last.endsWith(CommonConstants.PERCENT_SIGN)) { + return false; + } + if ((last.indexOf(CommonConstants.DOTS) !== -1) && (value === CommonConstants.DOTS)) { + return false; + } + if ((last === '0') && (value != CommonConstants.DOTS) && + (value !== CommonConstants.PERCENT_SIGN)) { + return false; + } + return true; +} +``` + +当输入为“=”运算符时,将结果输入出框中的值显示到表达式输入框中,并清空结果输出框。当输入为“清零”运算符时,将页面和表达式数组清空。 + +```typescript +// CalculateModel.ets +inputSymbol(value: string) { + ... + switch (value) { + case Symbol.CLEAN: + this.expressions = []; + this.context.calValue = ''; + break; + ... + case Symbol.EQU: + if (len === 0) { + return; + } + this.getResult().then(result => { + if (!result) { + return; + } + this.context.inputValue = this.context.calValue; + this.context.calValue = ''; + this.expressions = []; + this.expressions.push(this.context.inputValue); + }) + break; + ... + } + ... +} +``` + +当输入为“删除”运算符时,若表达式数组中最后一位元素为运算符则删除,为数字则删除数字最后一位,重新计算表达式的值(表达式数组中最后一位为运算符则不参与计算),删除之后若表达式长度为0则清空页面。 + +```typescript +// CalculateModel.ets +inputSymbol(value: string) { + ... + switch (value) { + ... + case CommonConstants.SYMBOL.DEL: + this.inputDelete(len); + break; + ... + } + ... +} + +// CalculateModel.ets +inputDelete(len: number) { + if (len === 0) { + return; + } + let last = this.expressions[len - 1]; + let lastLen = last.length; + if (lastLen === 1) { + this.expressions.pop(); + len = this.expressions.length; + } else { + this.expressions[len - 1] = last.slice(0, last.length - 1); + } + if (len === 0) { + this.context.inputValue = ''; + this.context.calValue = ''; + return; + } + if (!CalculateUtil.isSymbol(this.expressions[len - 1])) { + this.getResult(); + } +} +``` + +当输入为“+-×÷”四则运算符时,由于可输入负数,故优先级高的运算符“×÷”后可输入“-”,其它场景则替换原有运算符。 + +```typescript +// CalculateModel.ets +inputSymbol(value: string) { + ... + switch (value) { + ... + default: + this.inputOperators(len, value); + break; + } + ... +} + +// CalculateModel.ets +inputOperators(len: number, value: string) { + let last = len > 0 ? this.expressions[len - 1] : undefined; + let secondLast = len > 1 ? this.expressions[len - CommonConstants.TWO] : undefined; + if (!last && (value === Symbol.MIN)) { + this.expressions.push(this.getSymbol(value)); + return; + } + if (!last) { + return; + } + if (!CalculateUtil.isSymbol(last)) { + this.expressions.push(this.getSymbol(value)); + return; + } + if ((value === Symbol.MIN) && + (last === CommonConstants.MIN || last === CommonConstants.ADD)) { + this.expressions.pop(); + this.expressions.push(this.getSymbol(value)); + return; + } + if (!secondLast) { + return; + } + if (value !== Symbol.MIN) { + this.expressions.pop(); + } + if (CalculateUtil.isSymbol(secondLast)) { + this.expressions.pop(); + } + this.expressions.push(this.getSymbol(value)); +} +``` + +## 解析计算表达式 + +将表达式数组中带“%”的元素转换成小数,若表达式数组中最后一位为“+-×÷”则删除。 + +```typescript +// CalculateUtil.ets +parseExpression(expressions: Array) { + ... + let len = expressions.length; + ... + expressions.forEach((item: string, index: number) => { + // 处理表达式中的% + if (item.indexOf(CommonConstants.PERCENT_SIGN) !== -1) { + expressions[index] = (this.mulOrDiv(item.slice(0, item.length - 1), + CommonConstants.ONE_HUNDRED, CommonConstants.DIV)).toString(); + } + // 最后一位是否为运算符 + if ((index === len - 1) && this.isSymbol(item)) { + expressions.pop(); + } + }); + ... +} +``` + +先初始化队列和栈,再从表达式数组左边取出元素,进行如下操作: + +- 当取出的元素为数字时则放入队列中。 +- 当取出的元素为运算符时,先判断栈中元素是否为空,是则将运算符放入栈中,否则判断此运算符与栈中最后一个元素的优先级,若此运算符优先级小则将栈中最后一个元素弹出并放入队列中,再将此运算符放入栈中,否则将此运算符放入栈中。 +- 最后将栈中的元素依次弹出放入队列中。 + +```typescript +// CalculateUtil.ets +parseExpression(expressions: Array) { + ... + while (expressions.length > 0) { + let current = expressions.shift(); + if (this.isSymbol(current)) { + while (outputStack.length > 0 && + this.comparePriority(current, outputStack[outputStack.length - 1])) { + outputQueue.push(outputStack.pop()); + } + outputStack.push(current); + } else { + outputQueue.push(current); + } + } + while (outputStack.length > 0) { + outputQueue.push(outputStack.pop()); + } + ... +} +``` + +以表达式“3×5+4÷2”为例,用原理图讲解上面代码,原理图如图: + +![](figures/3.png) + +遍历队列中的元素,当为数字时将元素压入栈,当为运算符时将数字弹出栈,并结合当前运算符进行计算,再将计算的结果压栈,最终栈底元素为表达式结果。 + +```typescript +// CalculateUtil.ets +dealQueue(queue: Array) { + ... + let outputStack = []; + while (queue.length > 0) { + let current = queue.shift(); + if (!this.isSymbol(current)) { + outputStack.push(current); + } else { + let second = outputStack.pop(); + let first = outputStack.pop(); + outputStack.push(this.calResult(first, second, current)); + } + } + if (outputStack.length !== 1) { + return NaN; + } else { + let end = outputStack[0].endsWith(CommonConstants.DOTS) ? + outputStack[0].substring(0, outputStack[0].length - 1) : outputStack[0]; + return end; + } +} +``` + +获取表达式“3×5+4÷2”组装后的表达式,用原理图讲解上面代码,原理图如图: + +![](figures/4.png) + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. ForEach组件的使用。 +2. TextInput组件的使用。 +3. Image组件的使用。 + + +![](figures/彩带动效.gif) diff --git a/ETSUI/SimpleCalculator/build-profile.json5 b/ETSUI/SimpleCalculator/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/SimpleCalculator/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/build-profile.json5 b/ETSUI/SimpleCalculator/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/hvigorfile.ts b/ETSUI/SimpleCalculator/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/SimpleCalculator/entry/oh-package.json5 b/ETSUI/SimpleCalculator/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/common/bean/PressKeysBean.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/common/bean/PressKeysBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..8485d4c16b6501e3112ce3fa8a92105e1982a5f3 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/common/bean/PressKeysBean.ets @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export class PressKeysBean { + flag: number; + width: string; + height: string; + value: string; + source?: Resource; + + constructor(flag, width, height, value, source) { + this.flag = flag; + this.width = width; + this.height = height; + this.value = value; + this.source = source; + } +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..c29e6dfb190aba363d9aa4446bc889b62e035524 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Common constants for all features. + */ +export class CommonConstants { + /** + * Full percent. + */ + static readonly FULL_PERCENT: string = '100%'; + + /** + * Operator Collection. + */ + static readonly OPERATORS: string = '+-×÷'; + + /** + * Operators with high precedence. + */ + static readonly OPERATORS_PRIORITY: string = '×÷'; + + /** + * Addition. + */ + static readonly ADD: string = '+'; + + /** + * Minus. + */ + static readonly MIN: string = '-'; + + /** + * Multiplication. + */ + static readonly MUL: string = '×'; + + /** + * Division. + */ + static readonly DIV: string = '÷'; + + /** + * Percent sign. + */ + static readonly PERCENT_SIGN: string = '%'; + + /** + * Decimal point. + */ + static readonly DOTS: string = '.'; + + /** + * Number two. + */ + static readonly TWO: number = 2; + + /** + * Digit ten. + */ + static readonly TEN: number = 10; + + /** + * One hundred. + */ + static readonly ONE_HUNDRED: string = '100'; + + /** + * Display Maximum Length of Large Fonts. + */ + static readonly INPUT_LENGTH_MAX: number = 9; + + /** + * Subscript is two. + */ + static readonly INDEX_TWO: number = 2; + + /** + * Maximum length of a single digit. + */ + static readonly NUM_MAX_LEN: number = 16; + + /** + * Letter e. + */ + static readonly E: string = 'e'; + + /** + * String Zero. + */ + static readonly ZERO: string = '0' + + /** + * zero point. + */ + static readonly ZERO_DOTS: string = '0.' +} + +/** + * Symbol value. + */ +export enum Symbol { + ADD = 'add', + MIN = 'min', + MUL = 'mul', + DIV = 'div', + CLEAN = 'clean', + DEL = 'del', + EQU = 'equ' +} + +/** + * Operator Precedence Enumeration. + */ +export enum Priority { + HIGH = 2, + MEDIUM = 1, + LOW = 0 +} diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ef8acaa23e1530c33454d7cb76e8329951fe6a6 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants, Priority } from '../constants/CommonConstants'; +import CheckEmptyUtil from './CheckEmptyUtil'; + +class CalculateUtil { + /** + * Determines whether it is an operator. + * + * @param value The symbol. + * @return Is Operator. + */ + isSymbol(value: string) { + if (CheckEmptyUtil.isEmpty(value)) { + return ; + } + return (CommonConstants.OPERATORS.indexOf(value) !== -1); + } + + /** + * Get Operator Precedence. + * + * @param value The symbol. + * @return Priority. + */ + getPriority(value: string): number { + if (CheckEmptyUtil.isEmpty(value)) { + return Priority.LOW; + } + let result = 0; + switch (value) { + case CommonConstants.ADD: + case CommonConstants.MIN: + result = Priority.MEDIUM; + break; + case CommonConstants.MUL: + case CommonConstants.DIV: + result = Priority.HIGH; + break; + default: + result = Priority.LOW; + break; + } + return result; + } + + /** + * Determine the priority of addition, subtraction, multiplication, and division. + * + * @param arg1 Parameter 1. + * @param arg2 Parameter 2. + * @return Compare Priority Results. + */ + comparePriority(arg1: string, arg2: string): boolean { + if (CheckEmptyUtil.isEmpty(arg1) || CheckEmptyUtil.isEmpty(arg2)) { + return; + } + return (this.getPriority(arg1) <= this.getPriority(arg2)); + } + + /** + * Expression Processing. + * + * @param expressions Expressions. + */ + parseExpression(expressions: Array) { + if (CheckEmptyUtil.isEmpty(expressions)) { + return NaN; + } + let len = expressions.length; + let outputStack = []; + let outputQueue = []; + expressions.forEach((item: string, index: number) => { + // Handle % in the expression + if (item.indexOf(CommonConstants.PERCENT_SIGN) !== -1) { + expressions[index] = (this.mulOrDiv(item.slice(0, item.length - 1), + CommonConstants.ONE_HUNDRED, CommonConstants.DIV)).toString(); + } + // Whether the last digit is an operator. + if ((index === len - 1) && this.isSymbol(item)) { + expressions.pop(); + } + }); + while (expressions.length > 0) { + let current = expressions.shift(); + if (this.isSymbol(current)) { + // Processing addition, subtraction, multiplication and division. + while (outputStack.length > 0 && + this.comparePriority(current, outputStack[outputStack.length - 1])) { + outputQueue.push(outputStack.pop()); + } + outputStack.push(current); + } else { + // Processing the numbers. + outputQueue.push(current); + } + } + while (outputStack.length > 0) { + outputQueue.push(outputStack.pop()); + } + return this.dealQueue(outputQueue); + } + + /** + * Processing expressions in queues. + * + * @param queue Expression Queue. + * @return The end result. + */ + dealQueue(queue: Array) { + if (CheckEmptyUtil.isEmpty(queue)) { + return NaN; + } + let outputStack = []; + while (queue.length > 0) { + let current = queue.shift(); + if (!this.isSymbol(current)) { + outputStack.push(current); + } else { + let second = outputStack.pop(); + let first = outputStack.pop(); + outputStack.push(this.calResult(first, second, current)); + } + } + if (outputStack.length !== 1) { + return NaN; + } else { + let end = outputStack[0].endsWith(CommonConstants.DOTS) ? + outputStack[0].substring(0, outputStack[0].length - 1) : outputStack[0]; + return end; + } + } + + /** + * Calculation result. + * + * @param arg1 Number 1. + * @param arg2 Number 2. + * @param symbol Operators. + * @return Calculation result. + */ + calResult(arg1: string, arg2: string, symbol: string) { + if (CheckEmptyUtil.isEmpty(arg1) || CheckEmptyUtil.isEmpty(arg2), CheckEmptyUtil.isEmpty(symbol)) { + return NaN; + } + let result = 0; + switch (symbol) { + case CommonConstants.ADD: + result = this.add(arg1, arg2, CommonConstants.ADD); + break; + case CommonConstants.MIN: + result = this.add(arg1, arg2, CommonConstants.MIN); + break; + case CommonConstants.MUL: + result = this.mulOrDiv(arg1, arg2, CommonConstants.MUL); + break; + case CommonConstants.DIV: + result = this.mulOrDiv(arg1, arg2, CommonConstants.DIV); + break; + default: + break; + } + return this.numberToScientificNotation(result); + } + + /** + * Addition and subtraction operation. + * + * @param arg1 Number 1. + * @param arg2 Number 2. + * @param symbol Operators. + * @return Addition and subtraction results. + */ + add(arg1: string, arg2: string, symbol: string): number { + let addFlag = (symbol === CommonConstants.ADD); + if (this.containScientificNotation(arg1) || this.containScientificNotation(arg2)) { + if (addFlag) { + return Number(arg1) + Number(arg2); + } + return Number(arg1) - Number(arg2); + } + arg1 = (arg1 === CommonConstants.ZERO_DOTS) ? '0' : arg1; + arg2 = (arg2 === CommonConstants.ZERO_DOTS) ? '0' : arg2; + let leftArr = arg1.split(CommonConstants.DOTS); + let rightArr = arg2.split(CommonConstants.DOTS); + let leftLen = leftArr.length > 1 ? leftArr[1] : ''; + let rightLen = rightArr.length > 1 ? rightArr[1] : ''; + let maxLen = Math.max(leftLen.length, rightLen.length); + let multiples = Math.pow(CommonConstants.TEN, maxLen); + if (addFlag) { + return Number(((Number(arg1) * multiples + Number(arg2) * multiples) / multiples).toFixed(maxLen)); + } + return Number(((Number(arg1) * multiples - Number(arg2) * multiples) / multiples).toFixed(maxLen)); + } + + /** + * multiplication and division operation. + * + * @param arg1 Number 1. + * @param arg2 Number 2. + * @param symbol Operators. + * @return Multiply and divide result. + */ + mulOrDiv(arg1: string, arg2: string, symbol: string): number { + let mulFlag = (symbol === CommonConstants.MUL); + if (this.containScientificNotation(arg1) || this.containScientificNotation(arg2)) { + if (mulFlag) { + return Number(arg1) * Number(arg2); + } + return Number(arg1) / Number(arg2); + } + let leftLen = arg1.split(CommonConstants.DOTS)[1] ? arg1.split(CommonConstants.DOTS)[1].length : 0; + let rightLen = arg2.split(CommonConstants.DOTS)[1] ? arg2.split(CommonConstants.DOTS)[1].length : 0; + if (mulFlag) { + return Number(arg1.replace(CommonConstants.DOTS, '')) * + Number(arg2.replace(CommonConstants.DOTS, '')) / Math.pow(CommonConstants.TEN, leftLen + rightLen); + } + return Number(arg1.replace(CommonConstants.DOTS, '')) / + (Number(arg2.replace(CommonConstants.DOTS, '')) / Math.pow(CommonConstants.TEN, rightLen - leftLen)); + } + + /** + * Whether the operand contains scientific notation + * + * @param arg Number. + * @return Whether scientific notation is included + */ + containScientificNotation(arg: string) { + return (arg.indexOf(CommonConstants.E) !== -1); + } + + /** + * Results converted to scientific notation. + * + * @param result Digital Results. + */ + numberToScientificNotation(result: number) { + if (result === Infinity) { + return NaN; + } + let resultStr = JSON.stringify(result); + if ( this.containScientificNotation(resultStr)) { + return resultStr; + } + let prefixNumber = (resultStr.indexOf(CommonConstants.MIN) === -1) ? 1 : -1; + result *= prefixNumber; + if (resultStr.replace(CommonConstants.DOTS, '').replace(CommonConstants.MIN, '').length < + CommonConstants.NUM_MAX_LEN) { + return resultStr; + } + let suffix = (Math.floor(Math.log(result) / Math.LN10)); + let prefix = (result * Math.pow(CommonConstants.TEN, -suffix) * prefixNumber); + return (prefix + CommonConstants.E + suffix); + } +} + +export default new CalculateUtil(); + diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CheckEmptyUtil.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CheckEmptyUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..9443c1e2aa631795adb7bd933bd50b9e28842948 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CheckEmptyUtil.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + + +class CheckEmptyUtil { + + /** + * Check obj is empty. + * + * @param {object} obj + * @return {boolean} true(empty) + */ + isEmpty(obj) { + return (typeof obj === 'undefined' || obj === null || obj === ''); + } + + /** + * Check str is empty. + * + * @param {string} str + * @return {boolean} true(empty) + */ + checkStrIsEmpty(str) { + return str.trim().length === 0; + } + + /** + * Check array is empty. + * + * @param {Array}arr + * @return {boolean} true(empty) + */ + isEmptyArr(arr) { + return arr.length === 0; + } +} + +export default new CheckEmptyUtil(); + diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/Logger.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..059fd16db7bcc9578568affba99578f6fbb216f4 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('SimpleCalculator', 0xFF00) \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/SimpleCalculator/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..649863d424be226266bb7e2c485506b3044c5bf8 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,41 @@ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/HomePage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/model/CalculateModel.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/model/CalculateModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..fce0e8ef711cef91efa83dcc004b3c34617827f0 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/model/CalculateModel.ets @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants, Symbol } from '../common/constants/CommonConstants'; +import CalculateUtil from '../common/util/CalculateUtil'; +import CheckEmptyUtil from '../common/util/CheckEmptyUtil'; +import Logger from '../common/util/Logger'; + +export class CalculateModel { + private expressions: Array = []; + private context; + + constructor(context) { + this.context = context; + } + + /** + * Input Symbols. + * + * @param value Input Operators. + */ + inputSymbol(value: string) { + if (CheckEmptyUtil.isEmpty(value)) { + return; + } + let len = this.expressions.length; + switch (value) { + case Symbol.CLEAN: + this.expressions = []; + this.context.calValue = ''; + break; + case Symbol.DEL: + this.inputDelete(len); + break; + case Symbol.EQU: + if (len === 0) { + return; + } + this.getResult().then(result => { + if (!result) { + return; + } + this.context.inputValue = this.context.calValue; + this.context.calValue = ''; + this.expressions = []; + this.expressions.push(this.context.inputValue); + }) + break; + default: + this.inputOperators(len, value); + break; + } + this.formatInputValue(); + } + + /** + * Enter numbers. + * + * @param value Enter numbers. + */ + inputNumber(value: string) { + if (CheckEmptyUtil.isEmpty(value)) { + return; + } + let len = this.expressions.length; + let last = len > 0 ? this.expressions[len - 1] : ''; + let secondLast = len > 1 ? this.expressions[len - CommonConstants.TWO] : undefined; + if (!this.validateEnter(last, value)) { + return; + } + if (!last) { + this.expressions.push(value); + } else if (!secondLast) { + this.expressions[len - 1] += value; + } + if (secondLast && CalculateUtil.isSymbol(secondLast)) { + this.expressions[len -1] += value; + } + if (secondLast && !CalculateUtil.isSymbol(secondLast)) { + this.expressions.push(value); + } + this.formatInputValue(); + if (value !== CommonConstants.DOTS) { + this.getResult(); + } + } + + /** + * Verify that you can enter. + * + * @param last Value of the last element. + * @param value Current input value. + * return Indicates whether to allow input. + */ + validateEnter(last: string, value: string) { + if (!last && value === CommonConstants.PERCENT_SIGN) { + return false; + } + if ((last === CommonConstants.MIN) && (value === CommonConstants.PERCENT_SIGN)) { + return false; + } + if (last.endsWith(CommonConstants.PERCENT_SIGN)) { + return false; + } + if ((last.indexOf(CommonConstants.DOTS) !== -1) && (value === CommonConstants.DOTS)) { + return false; + } + if ((last === '0') && (value !== CommonConstants.DOTS) && + (value !== CommonConstants.PERCENT_SIGN)) { + return false; + } + return true; + } + + /** + * Delete Key Trigger. + * + * @param len Expression Length. + */ + inputDelete(len: number) { + if (len === 0) { + return; + } + let last = this.expressions[len - 1]; + let lastLen = last.length; + if (lastLen === 1) { + this.expressions.pop(); + len = this.expressions.length; + } else { + this.expressions[len - 1] = last.slice(0, last.length - 1); + } + if (len === 0) { + this.context.inputValue = ''; + this.context.calValue = ''; + return; + } + if (!CalculateUtil.isSymbol(this.expressions[len - 1])) { + this.getResult(); + } + } + + /** + * Triggered when input is added, subtracted, multiplied, and divided. + * + * @param len Expression Length. + * @param value Current Input Value. + */ + inputOperators(len: number, value: string) { + let last = len > 0 ? this.expressions[len - 1] : undefined; + let secondLast = len > 1 ? this.expressions[len - CommonConstants.TWO] : undefined; + if (!last && (value === Symbol.MIN)) { + this.expressions.push(this.getSymbol(value)); + return; + } + if (!last) { + return; + } + if (!CalculateUtil.isSymbol(last)) { + this.expressions.push(this.getSymbol(value)); + return; + } + if ((value === Symbol.MIN) && + (last === CommonConstants.MIN || last === CommonConstants.ADD)) { + this.expressions.pop(); + this.expressions.push(this.getSymbol(value)); + return; + } + if (!secondLast) { + return; + } + if (value !== Symbol.MIN) { + this.expressions.pop(); + } + if (CalculateUtil.isSymbol(secondLast)) { + this.expressions.pop(); + } + this.expressions.push(this.getSymbol(value)); + } + + /** + * Get Operator. + * + * @param value. + * @return Operators. + */ + getSymbol(value: string) { + if (CheckEmptyUtil.isEmpty(value)) { + return ''; + } + let symbol = ''; + switch (value) { + case Symbol.ADD: + symbol = CommonConstants.ADD; + break; + case Symbol.MIN: + symbol = CommonConstants.MIN; + break; + case Symbol.MUL: + symbol = CommonConstants.MUL; + break; + case Symbol.DIV: + symbol = CommonConstants.DIV; + break; + default: + break; + } + return symbol; + } + + /** + * Make a deep copy of an expression. + * + * @return deep copy expression. + */ + deepCopy(): Array { + let that = this; + let copyExpressions = Object.create(Object.getPrototypeOf(this.expressions)); + Object.getOwnPropertyNames(this.expressions).forEach((items: string) => { + let item = Object.getOwnPropertyDescriptor(that.expressions, items); + Object.defineProperty(copyExpressions, items, item); + }) + return copyExpressions; + } + + /** + * Obtaining Results. + * + * @return Whether the result is incorrect. + */ + async getResult() { + let calResult = CalculateUtil.parseExpression(this.deepCopy()); + if (isNaN(calResult)) { + this.context.calValue = this.resourceToString($r('app.string.error')); + return false; + } + this.context.calValue = calResult; + return true; + } + + /** + * Number Formatting. + * + * @param value Formatting parameters. + * @return Thousand percentile data. + */ + resultFormat(value: string) { + let reg = (value.indexOf('.') > -1) ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g; + return value.replace(reg, '$1,'); + } + + /** + * Convert a resource file to a string. + * + * @param resource Resource file. + * @return Character string converted from the resource file. + */ + resourceToString(resource: Resource): string { + if (CheckEmptyUtil.isEmpty(resource)) { + return ''; + } + let result = ''; + try { + result = getContext(this).resourceManager.getStringSync(resource.id); + } catch(error) { + Logger.error('[CalculateModel] getResourceString fail: '+ JSON.stringify(error)) + } + return result; + } + + /** + * Thousands in the formatting result. + */ + formatInputValue() { + let deepExpressions = []; + this.deepCopy().forEach((item: string, index: number) => { + deepExpressions[index] = this.resultFormat(item); + }); + this.context.inputValue = deepExpressions.join(''); + } +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/pages/HomePage.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/pages/HomePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..e766e9b83d11a74ebe32b141ab778131d581d7cb --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/pages/HomePage.ets @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constants/CommonConstants'; +import { CalculateModel } from '../model/CalculateModel'; +import { PressKeysBean } from '../common/bean/PressKeysBean'; +import keysModel from '../viewmodel/PresskeysBeanViewModel'; + +@Entry +@Component +struct HomePage { + private model: CalculateModel = new CalculateModel(this); + @State inputValue: string = ''; + @State calValue: string = ''; + + build() { + Column() { + Column() { + TextInput({ text: this.model.resultFormat(this.inputValue) }) + .height(CommonConstants.FULL_PERCENT) + .fontSize( + (this.inputValue.length > CommonConstants.INPUT_LENGTH_MAX) ? + $r('app.float.font_size_text') : $r('app.float.font_size_input') + ) + .enabled(false) + .fontColor(Color.Black) + .textAlign(TextAlign.End) + .backgroundColor($r('app.color.input_back_color')) + } + .width(CommonConstants.FULL_PERCENT) + .height($r('app.float.input_height')) + .alignItems(HorizontalAlign.End) + .margin({ + right: $r('app.float.input_margin_right'), + top: $r('app.float.input_margin_top') + }) + + Column() { + Text(this.model.resultFormat(this.calValue)) + .fontSize($r('app.float.font_size_text')) + .fontColor($r('app.color.text_color')) + } + .width(CommonConstants.FULL_PERCENT) + .height($r('app.float.text_height')) + .alignItems(HorizontalAlign.End) + .margin({ + right: $r('app.float.text_margin_right'), + bottom: $r('app.float.text_margin_bottom') + }) + + Column() { + Row() { + ForEach(keysModel.getPressKeys(), (columnItem: Array, columnItemIndex: number) => { + Column() { + ForEach(columnItem, (keyItem: PressKeysBean, keyItemIndex: number) => { + Column() { + Column() { + if (keyItem.flag === 0) { + Image(keyItem.source) + .width(keyItem.width) + .height(keyItem.height) + } else { + Text(keyItem.value) + .fontSize( + (keyItem.value === CommonConstants.DOTS) ? + $r('app.float.font_size_dot') : $r('app.float.font_size_text') + ) + .width(keyItem.width) + .height(keyItem.height) + } + } + .width($r('app.float.key_width')) + .height( + ((columnItemIndex === (keysModel.getPressKeys().length - 1)) && + (keyItemIndex === (columnItem.length - 1))) ? + $r('app.float.equals_height') : $r('app.float.key_height') + ) + .borderWidth(1) + .borderColor($r('app.color.border_color')) + .borderRadius($r('app.float.border_radius')) + .backgroundColor( + ((columnItemIndex === (keysModel.getPressKeys().length - 1)) && + (keyItemIndex === (columnItem.length - 1))) ? + $r('app.color.equals_back_color') : Color.White + ) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .onClick(() => { + if (keyItem.flag === 0) { + this.model.inputSymbol(keyItem.value); + } else { + this.model.inputNumber(keyItem.value); + } + }) + } + .layoutWeight( + ((columnItemIndex === (keysModel.getPressKeys().length - 1)) && + (keyItemIndex === (columnItem.length - 1))) ? CommonConstants.TWO : 1 + ) + .width(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.Center) + }, keyItem => JSON.stringify(keyItem)) + } + .layoutWeight(1) + }, item => JSON.stringify(item)) + } + .height(CommonConstants.FULL_PERCENT) + .alignItems(VerticalAlign.Top) + .margin({ + left: $r('app.float.margin_left'), + right: $r('app.float.margin_right') + }) + } + .layoutWeight(1) + .width(CommonConstants.FULL_PERCENT) + .backgroundColor($r('app.color.row_back_color')) + } + .height(CommonConstants.FULL_PERCENT) + .backgroundColor($r('app.color.column_back_color')) + } +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/ets/viewmodel/PresskeysBeanViewModel.ets b/ETSUI/SimpleCalculator/entry/src/main/ets/viewmodel/PresskeysBeanViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c5dc0d27659f41b0c561adb6b193193b49cf9695 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/ets/viewmodel/PresskeysBeanViewModel.ets @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { PressKeysBean } from '../common/bean/PressKeysBean'; + +export class PressKeysBeanViewModel { + + /** + * Key array data. + */ + getPressKeys(): Array>{ + return [ + [ + { + flag: 0, + width: '32vp', + height: '32vp', + value: 'clean', + source: $r('app.media.ic_clean') + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '7' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '4' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '1' + }, + { + flag: 1, + width: '25vp', + height: '43vp', + value: '%' + } + ], + [ + { + flag: 0, + width: '32vp', + height: '32vp', + value: 'div', + source: $r('app.media.ic_div') + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '8' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '5' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '2' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '0' + } + ], + [ + { + flag: 0, + width: '32vp', + height: '32vp', + value: 'mul', + source: $r('app.media.ic_mul') + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '9' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '6' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '3' + }, + { + flag: 1, + width: '19vp', + height: '43vp', + value: '.' + } + ], + [ + { + flag: 0, + width: '30.48vp', + height: '20vp', + value: 'del', + source: $r('app.media.ic_del') + }, + { + flag: 0, + width: '24vp', + height: '24vp', + value: 'min', + source: $r('app.media.ic_min') + }, + { + flag: 0, + width: '32vp', + height: '32vp', + value: 'add', + source: $r('app.media.ic_add') + }, + { + flag: 0, + width: '32vp', + height: '32vp', + value: 'equ', + source: $r('app.media.ic_equ') + } + ] + ]; + } +} + +let keysModel = new PressKeysBeanViewModel(); +export default keysModel as PressKeysBeanViewModel; \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/module.json5 b/ETSUI/SimpleCalculator/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9b07af70a189c0165e30b9f4bedc3bfd22b53cda --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/color.json b/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..ea07df432d5f496a72a2f63cc389bb3e262fcd79 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/color.json @@ -0,0 +1,32 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "input_back_color", + "value": "#F5F5F5" + }, + { + "name": "text_color", + "value": "#182431" + }, + { + "name": "border_color", + "value": "#F5F5F5" + }, + { + "name": "equals_back_color", + "value": "#007DFF" + }, + { + "name": "row_back_color", + "value": "#F8F8FF" + }, + { + "name": "column_back_color", + "value": "#F5F5F5" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/float.json b/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..ecfcfa14960d8a61092d615e0a27d90dd09672c7 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/float.json @@ -0,0 +1,68 @@ +{ + "float": [ + { + "name": "float_1", + "value": "30.6" + }, + { + "name": "font_size_input", + "value": "64fp" + }, + { + "name": "font_size_text", + "value": "32fp" + }, + { + "name": "font_size_dot", + "value": "42fp" + }, + { + "name": "input_height", + "value": "86vp" + }, + { + "name": "input_margin_right", + "value": "22vp" + }, + { + "name": "input_margin_top", + "value": "121.96vp" + }, + { + "name": "text_height", + "value": "43vp" + }, + { + "name": "text_margin_right", + "value": "21vp" + }, + { + "name": "text_margin_bottom", + "value": "64vp" + }, + { + "name": "key_width", + "value": "70vp" + }, + { + "name": "key_height", + "value": "70vp" + }, + { + "name": "equals_height", + "value": "154.62vp" + }, + { + "name": "border_radius", + "value": "36vp" + }, + { + "name": "margin_left", + "value": "19vp" + }, + { + "name": "margin_right", + "value": "19vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/string.json b/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4f14c0a8540f4787889f5ebc0c894cd67c2289a4 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/resources/base/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SimpleCalculator" + }, + { + "name": "error", + "value": "error" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_add.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_add.png new file mode 100644 index 0000000000000000000000000000000000000000..57bbda301c98603f102169d41e6b97ddec986ff7 Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_add.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_clean.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_clean.png new file mode 100644 index 0000000000000000000000000000000000000000..1c2c3060b36045b53a1658c2946f62a7e631f124 Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_clean.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_del.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_del.png new file mode 100644 index 0000000000000000000000000000000000000000..9066040d6418cb5ef8ed88e0c6c53ae8778edec9 Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_del.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_div.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_div.png new file mode 100644 index 0000000000000000000000000000000000000000..23c426256bd2af63f80b1af462ac5b988471bb4f Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_div.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_equ.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_equ.png new file mode 100644 index 0000000000000000000000000000000000000000..277fb25276cd4dff076db3cf754637fc3be6f3de Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_equ.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_min.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_min.png new file mode 100644 index 0000000000000000000000000000000000000000..009ccc97de177ba248daf66070e16e3843f26246 Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_min.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_mul.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_mul.png new file mode 100644 index 0000000000000000000000000000000000000000..c25289786e16ec08c1158c6263724be3e39d9ca9 Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/ic_mul.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/icon.png b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/SimpleCalculator/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/SimpleCalculator/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..8607be393726d65baba7d64deacc51ce1c8f143d --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/HomePage" + ] +} diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/en_US/element/string.json b/ETSUI/SimpleCalculator/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4f14c0a8540f4787889f5ebc0c894cd67c2289a4 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SimpleCalculator" + }, + { + "name": "error", + "value": "error" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/SimpleCalculator/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9c4019d36fd60e4d4d199d1f9ab53e7544e52131 --- /dev/null +++ b/ETSUI/SimpleCalculator/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "描述" + }, + { + "name": "EntryAbility_label", + "value": "简易计算器" + }, + { + "name": "error", + "value": "错误" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/figures/1.gif b/ETSUI/SimpleCalculator/figures/1.gif new file mode 100644 index 0000000000000000000000000000000000000000..5122b393c0fa83cc2fb3cd8b80638479a49d109f Binary files /dev/null and b/ETSUI/SimpleCalculator/figures/1.gif differ diff --git a/ETSUI/SimpleCalculator/figures/2.png b/ETSUI/SimpleCalculator/figures/2.png new file mode 100644 index 0000000000000000000000000000000000000000..ac60e2dd5c60ace0118c67bb61ab738af2127299 Binary files /dev/null and b/ETSUI/SimpleCalculator/figures/2.png differ diff --git a/ETSUI/SimpleCalculator/figures/3.png b/ETSUI/SimpleCalculator/figures/3.png new file mode 100644 index 0000000000000000000000000000000000000000..cf70e707fc1c0b713b2ddb71c1862ae62ebe7193 Binary files /dev/null and b/ETSUI/SimpleCalculator/figures/3.png differ diff --git a/ETSUI/SimpleCalculator/figures/4.png b/ETSUI/SimpleCalculator/figures/4.png new file mode 100644 index 0000000000000000000000000000000000000000..07f441348b64bd5f282ba8e4196f3591917c3cad Binary files /dev/null and b/ETSUI/SimpleCalculator/figures/4.png differ diff --git a/ETSUI/SimpleCalculator/figures/zh-cn_image_0000001405854998.png b/ETSUI/SimpleCalculator/figures/zh-cn_image_0000001405854998.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/SimpleCalculator/figures/zh-cn_image_0000001405854998.png differ diff --git "a/ETSUI/SimpleCalculator/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" "b/ETSUI/SimpleCalculator/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and "b/ETSUI/SimpleCalculator/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" differ diff --git a/ETSUI/SimpleCalculator/hvigor/hvigor-config.json5 b/ETSUI/SimpleCalculator/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/ETSUI/SimpleCalculator/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/ETSUI/SimpleCalculator/hvigor/hvigor-wrapper.js b/ETSUI/SimpleCalculator/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..994f22987bd0739b9faa07c966b066c2d9218602 --- /dev/null +++ b/ETSUI/SimpleCalculator/hvigor/hvigor-wrapper.js @@ -0,0 +1,2 @@ +"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__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]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__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)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__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]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__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]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__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)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__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]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.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]/,ee.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(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.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&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.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||te.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 ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.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,ue.O_WRONLY|ue.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){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.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,ue.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"===se&&(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(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}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 c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.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);le.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 de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,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):be([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):be([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):be([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):be([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)):be([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=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;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.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;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.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?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.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):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),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.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(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 at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,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();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=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"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=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}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),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()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);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()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("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){Bt(e),Bt(t),Bt("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=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);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(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.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=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=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 wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&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 c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.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 Rr(){if(_r)return br;return _r=1,br=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{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||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=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return 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","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;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:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();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=Rr()(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)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=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=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=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]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]: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]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]: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,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,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,a).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)}}],c=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:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.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"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={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 cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;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(iu.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||""}};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.substr(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.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{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 Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.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"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ +const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(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:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.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 co={};co.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 ao={};ao.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;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`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)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={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})}};!function(e){const t=yo.fromCallback,n=we,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))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(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||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.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 _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.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 No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.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()&&Ko(e,t)?r(new Error(qo(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=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.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()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.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(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(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 Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=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}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(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 Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.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){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.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 Si(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();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=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"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(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()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(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()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("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){Pi(e),Pi(t),Pi("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=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(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(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){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 $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.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=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(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 Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(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||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(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||Os,o="";try{o=_s(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||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(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,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("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];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("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}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({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 bc(`_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((()=>{bc(`_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())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_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--){bc(`_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 Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_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 _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().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 _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.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;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{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 $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{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 Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.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}Eo.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){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.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))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.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)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.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,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("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(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.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){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`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){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();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)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.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.substring(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 c=e=>{o.clear();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})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.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=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(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;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__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]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__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)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(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 tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__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]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__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)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__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]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__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)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/hvigorfile.ts b/ETSUI/SimpleCalculator/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/SimpleCalculator/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/SimpleCalculator/oh-package.json5 b/ETSUI/SimpleCalculator/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c51179566389ff566eb2b1ad299c583f43a0e931 --- /dev/null +++ b/ETSUI/SimpleCalculator/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "simplecalculator", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/SimpleCalculator/public_sys-resources/icon-caution.gif b/ETSUI/SimpleCalculator/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SimpleCalculator/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/SimpleCalculator/public_sys-resources/icon-danger.gif b/ETSUI/SimpleCalculator/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SimpleCalculator/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/SimpleCalculator/public_sys-resources/icon-note.gif b/ETSUI/SimpleCalculator/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/SimpleCalculator/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/SimpleCalculator/public_sys-resources/icon-notice.gif b/ETSUI/SimpleCalculator/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/SimpleCalculator/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/SimpleCalculator/public_sys-resources/icon-tip.gif b/ETSUI/SimpleCalculator/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/SimpleCalculator/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/SimpleCalculator/public_sys-resources/icon-warning.gif b/ETSUI/SimpleCalculator/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SimpleCalculator/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/SwiperArkTS/AppScope/app.json5 b/ETSUI/SwiperArkTS/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f3c59c107f7041504af2360857bc4604da397cbf --- /dev/null +++ b/ETSUI/SwiperArkTS/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.swiperarkts", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/SwiperArkTS/AppScope/resources/base/element/string.json b/ETSUI/SwiperArkTS/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..42f2eed78ede10f8b51f9b78d7021c8f5bd3a768 --- /dev/null +++ b/ETSUI/SwiperArkTS/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "SwiperArkTS" + } + ] +} diff --git a/ETSUI/SwiperArkTS/AppScope/resources/base/media/app_icon.png b/ETSUI/SwiperArkTS/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/SwiperArkTS/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/SwiperArkTS/LICENSE b/ETSUI/SwiperArkTS/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/SwiperArkTS/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/README.md b/ETSUI/SwiperArkTS/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d31e5abb647307ae50ec78d019bb00a46c81dbd0 --- /dev/null +++ b/ETSUI/SwiperArkTS/README.md @@ -0,0 +1,303 @@ +# Swiper的使用(ArkTS) + +# 介绍 + +本篇Codelab主要介绍了滑动容器组件Swiper的几种常见的应用场景,包括顶部导航、轮播图以及视频滑动播放。 + +![](/figures/swiper.gif) + +## 相关概念 + +- [Swiper](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md):滑动容器,提供子组件切换滑动的能力。 +- [Stack](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/reference/arkui-ts/ts-container-stack.md):堆叠容器,子组件按照顺序依次入栈,后入栈组件在先入栈组件上方显示。 +- [Video](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/reference/arkui-ts/ts-media-components-video.md):视频播放组件。 +- [Observed和ObjectLink数据管理](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/quick-start/arkts-observed-and-objectlink.md): + - @Observed应用于类,表示该类中的数据变更被UI页面管理,例如:@Observed class ClassA \{\}。 + - @ObjectLink应用于被@Observed所装饰类的对象,例如:@ObjectLink a: ClassA。 + +# 环境搭建 + +## 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +## 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +## 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +# 代码结构解读 + +本篇Codelab只对核心代码进行讲解,完整代码可以直接从gitee获取。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──PictureItem.ets // 图片bean +│ │ │ ├──TopBarItem.ets // 顶部导航bean +│ │ │ └──VideoItem.ets // 视频bean +│ │ └──constants +│ │ ├──CommonConstant.ets // 公共常量 +│ │ ├──PictureConstants.ets // 图片所使用的常量 +│ │ ├──TopBarConstants.ets // TopBar使用的常量 +│ │ └──VideoConstants.ets // Video使用的常量 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ ├──PageVideo.ets // 视频播放页 +│ │ └──SwiperIndex.ets // 应用首页 +│ ├──view +│ │ ├──all +│ │ │ └──PictureSort.ets // “全部”tab页图片类别组件 +│ │ ├──common +│ │ │ ├──Banner.ets // 轮播图组件 +│ │ │ ├──PictureView.ets // 图片组件 +│ │ │ └──TopBar.ets // 顶部导航组件 +│ │ ├──movie +│ │ │ └──MovieSort.ets // “电影”tab页图片类别组件 +│ │ ├──play // 视频播放组件目录 +│ │ │ ├──CommentView.ets // 评论模块组件 +│ │ │ ├──DescriptionView.ets // 视频描述信息组件 +│ │ │ ├──NavigationView.ets // 顶部返回导航组件 +│ │ │ └──PlayView.ets // 视频滑动播放组件 +│ │ └──tabcontent // tab内容组件 +│ │ ├──PageAll.ets // 全部tab页 +│ │ ├──PageEntertainment.ets // 娱乐tab页 +│ │ ├──PageGame.ets // 游戏tab页 +│ │ ├──PageLive.ets // 直播tab页 +│ │ ├──PageMovie.ets // 电影tab页 +│ │ └──PageTV.ets // 电视tab页 +│ └──viewmodel +│ ├──PictureViewModel.ets // 图片model +│ ├──TopBarViewModel.ets // 顶部导航model +│ └──VideoViewModel.ets // 视频model +└──entry/src/main/resources // 应用资源目录 +``` + +# 顶部导航场景 + +应用首页首页使用Swiper组件实现了顶部导航的应用场景。用户点击不同的分类标题,会切换展示不同的界面内容。同时也支持用户左右滑动界面,对应导航标题联动变化的效果。 + +![](figures/index.png) + +实现这种效果,我们只需将界面划分为两部分:导航栏与内容区。导航栏使用自定义组件TopBar实现,内容区使用Swiper组件实现。 + +@State和@Link装饰符配合使用,实现TopBar组件标题与Swiper组件索引的双向绑定。内容区内容滑动时,会触发Swiper的onChange事件,并改变索引index的值。前面已经通过特定修饰符实现了索引的双向绑定。因此该索引值的变化会使TopBar的索引值同步变化,实现TopBar和Swiper的联动效果。 + +```typescript +// SwiperIndex.ets +@Entry +@Component +struct SwiperIndex { + // 索引值双向绑定 实现联动效果. + @State index: number = 0; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { + TopBar({ index: $index }) + Swiper() { + PageAll() + PageMovie() + PageTV() + PageEntertainment() + PageLive() + PageGame() + } + .index(this.index) + .indicator(false) + .loop(false) + .onChange((index: number) => { + this.index = index; + }) + } + .backgroundColor($r('app.color.start_window_background')) + } +} +``` + +点击导航栏中的不同标题时,会触发TopBar中的onClick事件,并改变对应的索引值。同理,该索引的变化会使Swiper的索引值同步变化,实现Swiper和TopBar的联动效果。 + +```typescript +// TopBar.ets +@Component +export struct TopBar { + // 索引值双向绑定 实现联动效果 + @Link index: number; + private tabArray: Array = initializeOnStartup(); + + build() { + Row({ space: CommonConstants.SPACE_TOP_BAR }) { + ForEach(this.tabArray, + (item: TopBarItem) => { + Text(item.name) + .fontSize(this.index === item.id ? $r('app.float.font_size_checked') : $r('app.float.font_size_unchecked')) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontWeight(this.index === item.id ? FontWeight.Bold : FontWeight.Regular) + .onClick(() => { + this.index = item.id; + }) + }, item => JSON.stringify(item)) + } + .margin({ left: CommonConstants.ADS_LEFT }) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.TOP_BAR_HEIGHT) + } +} +``` + +最终实现导航栏与内容区的双向联动效果。 + +# 轮播图场景 + +轮播图常见于各种应用首页,用于各类信息、资讯的轮番展示。本应用使用Swiper组件,同样实现了这一能力。“全部”页签的“电影精选”部分,即为一个电影内容的轮播模块。它可以切换展示不同电影内容。 + +![](figures/banner.png) + +我们将轮播图模块定义为一个自定义组件Banner。在Banner组件创建新实例时,会初始化轮播内容并开启定时任务。定时任务通过调用swiperController.showNext\(\)方法,控制Swiper组件切换内容展示。 + +```typescript +// Banner.ets +aboutToAppear() { + // 内容数据初始化 + this.imageArray = initializePictures(PictureType.BANNER); + // 开启定时轮播 + startPlay(this.swiperController); +} + +// PictureViewModel.ets +export function startPlay(swiperController: SwiperController) { + let timerId = setInterval(() => { + swiperController.showNext(); + }, CommonConstants.SWIPER_TIME); + timerIds.push(timerId); +} +``` + +在Swiper组件内,将初始化数据进行循环渲染。配合开启的定时任务,循环播放。 + +```typescript +// Banner.ets +build() { + Swiper(this.swiperController) { + ForEach(this.imageArray, item => { + Stack({ alignContent: Alignment.TopStart }) { + Image(item.image) + ... + Column() { + Text($r('app.string.movie_classic')) + .textStyle($r('app.float.font_size_description'), CommonConstants.FONT_WEIGHT_LIGHT) + ... + Text(item.name) + .textStyle($r('app.float.font_size_title'), CommonConstants.FONT_WEIGHT_BOLD) + } + ... + } + .height(CommonConstants.FULL_HEIGHT) + .width(CommonConstants.FULL_WIDTH) + }, item => JSON.stringify(item)) + } + ... +} +``` + +# 视频滑动播放场景 + +视频滑动播放是Swiper组件的另一个常见应用场景。点击应用首页中的视频图片,会跳转至视频播放界面。我们可以通过上下滑动,切换播放的视频内容。 + +![](figures/video.png) + +视频播放界面通过函数initializeOnStartup初始化视频内容。在Swiper组件内通过循环渲染的方式,将各个视频内容渲染成自定义组件PlayView。这样每一个视频内容就是一个Swiper的子组件,就可以通过滑动的方式切换播放内容。 + +```typescript +// PageVideo.ets +build() { + Column() { + Swiper() { + ForEach(this.videoArray, (item: VideoItem, index: number) => { + PlayView({ + index: $index, + pageShow: $pageShow, + item: item, + barPosition: index + }); + }, item => JSON.stringify(item)) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + .indicator(false) + .loop(false) + .vertical(true) + .onChange((index: number) => { + this.index = index; + }) + } +} +``` + +在自定义组件PlayView中,通过Video来控制视频播放。另外,结合Stack容器组件,在视频内容上叠加点赞、评论、转发等内容。 + +```typescript +// PlayView.ets +build() { + Stack({ alignContent: Alignment.End }) { + Video({ + src: this.item.src, + controller: this.videoController + }) + .controls(false) + .autoPlay(this.playState === PlayState.START ? true : false) // 首次可见状态自动播放 + .objectFit(ImageFit.Fill) + .loop(true) + .height(CommonConstants.WIDTH_VIDEO) + .width(CommonConstants.FULL_WIDTH) + .onClick(() => { + if (this.playState === PlayState.START) { + this.playState = PlayState.PAUSE; + this.videoController.pause(); + } else if (this.playState === PlayState.PAUSE) { + this.playState = PlayState.START; + this.videoController.start(); + } + }) + + NavigationView() + CommentView({ item: this.item }) + DescriptionView() + } + .backgroundColor(Color.Black) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) +} +``` + +# 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用Swiper组件实现顶部导航、轮播图、视频滑动播放等场景。 +2. 使用Stack组件实现堆叠布局。 +3. 使用@Extend快速定义并复用组件的自定义样式。 + +![](figures/zh-cn_image_0000001457975569.gif) diff --git a/ETSUI/SwiperArkTS/build-profile.json5 b/ETSUI/SwiperArkTS/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/SwiperArkTS/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/build-profile.json5 b/ETSUI/SwiperArkTS/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/hvigorfile.ts b/ETSUI/SwiperArkTS/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/SwiperArkTS/entry/oh-package.json5 b/ETSUI/SwiperArkTS/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/PictureItem.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/PictureItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..d004af0429c31afdf4c0de0decf25d4e3fc73784 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/PictureItem.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Picture entity class. + */ +export class PictureItem { + id: string; + name: string; + description: string; + image: Resource; + + constructor(id: string, name: string, description: string, image: Resource) { + this.id = id; + this.name = name; + this.description = description; + this.image = image; + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/TopBarItem.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/TopBarItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ff22048027a448c774bb8e203e2848aaa038c84 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/TopBarItem.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * TopBar entity class. + */ +export class TopBarItem { + id: number; + name: string; + + constructor(id: number, name: string) { + this.id = id; + this.name = name; + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/VideoItem.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/VideoItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e9493c03dbd4126e1cf1275fb28fd485b14a959 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/bean/VideoItem.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Video entity class. + */ +@Observed export class VideoItem { + id: string; + src: Resource; + likesCount: number; + isLikes: boolean; + comment: number; + shareTimes: number; + + constructor(id: string, src: Resource, likesCount: number, isLikes: boolean, comment: number, shareTimes: number) { + this.id = id; + this.src = src; + this.likesCount = likesCount; + this.isLikes = isLikes; + this.comment = comment; + this.shareTimes = shareTimes; + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/CommonConstant.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/CommonConstant.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cea07e0153a96516e34a04d74254c9e4e378d6e --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/CommonConstant.ets @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Common constants for all features. + */ +export class CommonConstants { + /** + * animation duration of content switching. + */ + static readonly DURATION_ADS = 200; + + /** + * Height of head portrait. + */ + static readonly HEIGHT_HEAD = 40; + + /** + * Height of carousel title. + */ + static readonly HEIGHT_CAROUSEL_TITLE = 90; + + /** + * Font size of tab page which content has only tab name. + */ + static readonly FONT_SIZE_PAGE_CONTENT = 28; + + /** + * Thinner font. + */ + static readonly FONT_WEIGHT_LIGHT = 400; + + /** + * Normal font. + */ + static readonly FONT_WEIGHT_NORMAL = 500; + + /** + * Bold font. + */ + static readonly FONT_WEIGHT_BOLD = 700; + + /** + * Page layout weight. + */ + static readonly LAYOUT_WEIGHT = 1; + + /** + * Border angle. + */ + static readonly BORDER_RADIUS = 12; + + /** + * Line height for more. + */ + static readonly LINE_HEIGHT_MORE = 19; + + /** + * Line height for navigation. + */ + static readonly LINE_HEIGHT_NAVIGATION = 28; + + /** + * Space of topBar. + */ + static readonly SPACE_TOP_BAR = 16; + + /** + * Space of navigation. + */ + static readonly SPACE_NAVIGATION = 8; + + /** + * Border width of head portrait. + */ + static readonly WIDTH_HEAD_BORDER = 2; + + /** + * Width of head portrait. + */ + static readonly WIDTH_HEAD = 40; + + /** + * Radius of head portrait. + */ + static readonly RADIUS_HEAD = 20; + + /** + * Rolling duration. + */ + static readonly SWIPER_TIME = 1500; + + /** + * Margin of play page. + */ + static readonly MARGIN_PLAY_PAGE = 10; + + /** + * Margin of text bottom. + */ + static readonly BOTTOM_TEXT = 4; + + /** + * Margin of banner top. + */ + static readonly TOP_ADS = 12; + + /** + * Margin of navigation left. + */ + static readonly LEFT_NAVIGATION = 20; + + /** + * Margin of banner left. + */ + static readonly ADS_LEFT = 12; + + /** + * Top margin of picture name. + */ + static readonly TOP_NAME = 8; + + /** + * Top margin of picture description. + */ + static readonly TOP_DESCRIPTION = 4; + + /** + * Top margin of vote icon. + */ + static readonly TOP_IMAGE_VOTE = 20; + + /** + * Top margin of head portrait. + */ + static readonly TOP_HEAD = 40; + + /** + * Maximum width. + */ + static readonly FULL_WIDTH = '100%'; + + /** + * Maximum height. + */ + static readonly FULL_HEIGHT = '100%'; + + /** + * Width of play model. + */ + static readonly WIDTH_PLAY = '95%'; + + /** + * Width of tab page. + */ + static readonly PAGE_WIDTH = '94.4%'; + + /** + * Width of sort name. + */ + static readonly WIDTH_SORT_NAME = '62.2%'; + + /** + * Sort content width of all. + */ + static readonly WIDTH_SORT = '92%'; + + /** + * Sort content width of movie. + */ + static readonly WIDTH_MOVIE_SORT = '90%'; + + /** + * Width of picture. + */ + static readonly WIDTH_PICTURE = '72%'; + + /** + * Height of banner. + */ + static readonly HEIGHT_BANNER = '27%'; + + /** + * Width of vote icon. + */ + static readonly WIDTH_VOTE = '8.9%'; + + /** + * Width of back icon. + */ + static readonly WIDTH_BACK_ICON = '6.7%'; + + /** + * Top margin of sort. + */ + static readonly MARGIN_TOP_SORT = '3.2%'; + + /** + * Bottom margin of sort. + */ + static readonly MARGIN_BOTTOM_SORT = '1.7%'; + + /** + * Bottom margin of grid. + */ + static readonly MARGIN_BOTTOM_GRID = '4.2%'; + + /** + * Height of video. + */ + static readonly WIDTH_VIDEO = '26.2%'; + + /** + * Number of columns. + */ + static readonly TWO_COLUMNS = '1fr 1fr'; + + /** + * Number of rows. + */ + static readonly TWO_ROWS = '1fr 1fr'; + + /** + * Number of columns. + */ + static readonly THREE_COLUMNS = '1fr 1fr 1fr'; + + /** + * Number of rows. + */ + static readonly THREE_ROWS = '1fr 1fr 1fr'; + + /** + * Gap of columns. + */ + static readonly GAP_COLUMNS = '2.2%'; + + /** + * Height of grid. + */ + static readonly HEIGHT_GRID = '45%'; + + /** + * Height of movie description. + */ + static readonly HEIGHT_DESCRIPTION = '12.3%'; + + /** + * Height of top bar. + */ + static readonly TOP_BAR_HEIGHT = '7.2%'; + + /** + * Height of comment icon. + */ + static readonly HEIGHT_COMMENT = '4.1%'; + + /** + * Height of back icon. + */ + static readonly HEIGHT_BACK_ICON = '3.1%'; + + /** + * Horizontal position of comment. + */ + static readonly OFFSET_COMMENT_X = '-5%'; + + /** + * Vertical position of comment. + */ + static readonly OFFSET_COMMENT_Y = '10%'; + + /** + * Vertical position of description. + */ + static readonly OFFSET_DESCRIPTION_Y = '45%'; + + /** + * Start position. + */ + static readonly START_POSITION = '0%'; + + /** + * Video play page. + */ + static readonly PLAY_PAGE = 'pages/PageVideo'; + + /** + * Home page. + */ + static readonly HOME_PAGE = 'pages/SwiperIndex'; +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/PictureConstants.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/PictureConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..e5c48896f81692e1dd0a96805f422a6c26dddc77 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/PictureConstants.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { PictureItem } from '../bean/PictureItem'; + +/** + * Pictures of banner. + */ +export const PICTURE_BANNER: PictureItem[] = [ + { 'id': '1', 'name': '怒海', 'description': '怒海波涛', 'image': $r("app.media.ic_image1") }, + { 'id': '2', 'name': '大山深处', 'description': '大山深处感人的亲情之歌', 'image': $r("app.media.ic_image2") }, + { 'id': '3', 'name': '荒漠', 'description': '荒漠的亲情之歌', 'image': $r("app.media.ic_image3") } +]; + +/** + * pictures of recently play. + */ +export const PICTURE_RECENTLY: PictureItem[] = [ + { 'id': '1', 'name': '背影', 'description': '感人的亲情之歌', 'image': $r("app.media.ic_recently1") }, + { 'id': '2', 'name': '废墟之上', 'description': '勇闯无人之境', 'image': $r("app.media.ic_recently2") }, + { 'id': '3', 'name': '无根之人', 'description': '悬疑国产力作', 'image': $r("app.media.ic_recently3") }, + { 'id': '4', 'name': '摩天轮', 'description': '每个人心中都有一个童话', 'image': $r("app.media.ic_recently4") } +]; + +/** + * pictures of photo. + */ +export const PICTURE_PHOTO: PictureItem[] = [ + { 'id': '1', 'name': '蓝·静', 'description': '用放大镜看世界', 'image': $r("app.media.ic_photo1") }, + { 'id': '2', 'name': '花', 'description': '每个人心中都有一个童话', 'image': $r("app.media.ic_photo2") }, + { 'id': '3', 'name': '无根之人', 'description': '悬疑国产力作', 'image': $r("app.media.ic_recently3") }, + { 'id': '4', 'name': '摩天轮', 'description': '每个人心中都有一个童话', 'image': $r("app.media.ic_recently4") } +]; + +/** + * pictures of newest. + */ +export const PICTURE_LATEST: PictureItem[] = [ + { 'id': '1', 'name': '潮·设计大会', 'description': '国际设计大师分...', 'image': $r('app.media.ic_movie1') }, + { 'id': '2', 'name': '食客', 'description': '味蕾爆炸', 'image': $r('app.media.ic_movie2') }, + { 'id': '3', 'name': '绿野仙踪', 'description': '热带雨林的故事', 'image': $r('app.media.ic_movie3') }, + { 'id': '4', 'name': '塔', 'description': '2021最期待的电...', 'image': $r('app.media.ic_movie4') }, + { 'id': '5', 'name': '微缩世界', 'description': '用放大镜看世界', 'image': $r('app.media.ic_movie5') }, + { 'id': '6', 'name': '非常规接触', 'description': '少年的奇妙之旅', 'image': $r('app.media.ic_movie6') }, + { 'id': '7', 'name': '绿野仙踪', 'description': '热带雨林的故事', 'image': $r('app.media.ic_movie7') }, + { 'id': '8', 'name': '塔', 'description': '用放大镜看世界', 'image': $r('app.media.ic_movie8') }, + { 'id': '9', 'name': '食客', 'description': '热带雨林的故事', 'image': $r('app.media.ic_movie9') } +]; + +/** + * type of pictures. + */ +export enum PictureType { + RECENTLY = 'recently', + PHOTO = 'photo', + LATEST = 'latest', + BANNER = 'banner' +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/TopBarConstants.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/TopBarConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..6a0195d71509a3ad30d70d2229ce231522e7d73e --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/TopBarConstants.ets @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { TopBarItem } from '../bean/TopBarItem'; + +/** + * Data of top bar. + */ +export const TOP_BAR_DATA: TopBarItem[] = [ + { 'id': 0, 'name': '全部' }, + { 'id': 1, 'name': '电影' }, + { 'id': 2, 'name': '电视剧' }, + { 'id': 3, 'name': '综艺' }, + { 'id': 4, 'name': '直播' }, + { 'id': 5, 'name': '游戏' } +] \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/VideoConstants.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/VideoConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..16313f0eab3580216986a419f855f1f04b96fed7 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/VideoConstants.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { VideoItem } from '../bean/VideoItem'; + +/** + * Data of video. + */ +export const VIDEO_DATA: VideoItem[] = [ + { + 'id': '1', + 'src': $rawfile('video1.mp4'), + 'likesCount': 0, + 'isLikes': false, + 'comment': 102, + 'shareTimes': 666 + }, + { + 'id': '2', + 'src': $rawfile('video2.mp4'), + 'likesCount': 8654, + 'isLikes': true, + 'comment': 0, + 'shareTimes': 0 + } +]; + +/** + * State of video play. + */ +export enum PlayState { + STOP = 0, + START = 1, + PAUSE = 2 +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/SwiperArkTS/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..e73c4766bd6946abc87f34224cd80cb6940bf409 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/SwiperIndex', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/pages/PageVideo.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/pages/PageVideo.ets new file mode 100644 index 0000000000000000000000000000000000000000..0cd08512d6b147763096bd7824b10dc5f9c7f8bb --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/pages/PageVideo.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { VideoItem } from '../common/bean/VideoItem'; +import { initializeOnStartup } from '../viewmodel/VideoViewModel'; +import { PlayView } from '../view/play/PlayView'; +import { CommonConstants } from '../common/constants/CommonConstant'; + +/** + * Video playing page. + */ +@Entry +@Component +struct PageVideo { + @State videoArray: Array = initializeOnStartup(); + @State index: number = 0; + @State pageShow: boolean = false; + + build() { + Column() { + Swiper() { + ForEach(this.videoArray, (item: VideoItem, index: number) => { + PlayView({ + index: $index, + pageShow: $pageShow, + item: item, + barPosition: index + }); + }, item => JSON.stringify(item)) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + .indicator(false) + .loop(false) + .vertical(true) + .onChange((index: number) => { + this.index = index; + }) + } + } + + onPageShow(): void { + this.pageShow = true; + } + + onPageHide(): void { + this.pageShow = false; + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/pages/SwiperIndex.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/pages/SwiperIndex.ets new file mode 100644 index 0000000000000000000000000000000000000000..99f3041830e262873bf4ba45d927b830b3760070 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/pages/SwiperIndex.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { TopBar } from '../view/common/TopBar'; +import { PageAll } from '../view/tabcontent/PageAll'; +import { CommonConstants } from '../common/constants/CommonConstant'; +import { PageLive } from '../view/tabcontent/PageLive'; +import { PageGame } from '../view/tabcontent/PageGame'; +import { PageEntertainment } from '../view/tabcontent/PageEntertainment'; +import { PageTV } from '../view/tabcontent/PageTV'; +import { PageMovie } from '../view/tabcontent/PageMovie'; + +/** + * Application home page. + */ +@Entry +@Component +struct SwiperIndex { + // Double binding of index values to achieve linkage effect. + @State index: number = 0; + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { + TopBar({ index: $index }) + Swiper() { + PageAll() + PageMovie() + PageTV() + PageEntertainment() + PageLive() + PageGame() + } + .index(this.index) + .indicator(false) + .loop(false) + .onChange((index: number) => { + this.index = index; + }) + } + .backgroundColor($r('app.color.start_window_background')) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/all/PictureSort.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/all/PictureSort.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2a17a642b62f168e4f9292d338a2051db9faccf --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/all/PictureSort.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { PictureItem } from '../../common/bean/PictureItem'; +import { initializePictures } from '../../viewmodel/PictureViewModel'; +import { PictureView } from '../common/PictureView'; +import { PictureType } from '../../common/constants/PictureConstants'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * text style. + * + * @param fontSize Font size. + * @param fontWeight Font weight. + */ +@Extend(Text) function textStyle(fontSize: Resource, fontWeight: number) { + .fontSize(fontSize) + .fontWeight(fontWeight) + .fontColor($r('app.color.font_black')) +} + +/** + * Picture sort. + */ +@Component +export struct PictureSort { + @State photos: Array = []; + @State private sortName: Resource = $r('app.string.recently'); + private initType: string = ''; + + aboutToAppear() { + if (PictureType.RECENTLY === this.initType) { + this.sortName = $r('app.string.recently'); + this.photos = initializePictures(PictureType.RECENTLY); + } else { + this.sortName = $r('app.string.photo'); + this.photos = initializePictures(PictureType.PHOTO); + } + } + + build() { + Column() { + Row() { + Text(this.sortName) + .width(CommonConstants.WIDTH_SORT_NAME) + .textStyle($r('app.float.font_size_sort_title'), CommonConstants.FONT_WEIGHT_NORMAL) + Text($r('app.string.more')) + .layoutWeight(CommonConstants.LAYOUT_WEIGHT) + .textAlign(TextAlign.End) + .textStyle($r('app.float.font_size_photo_name'), CommonConstants.FONT_WEIGHT_LIGHT) + .lineHeight(CommonConstants.LINE_HEIGHT_MORE) + .opacity($r('app.float.opacity_light')) + } + .width(CommonConstants.WIDTH_SORT) + .margin({ top: CommonConstants.MARGIN_TOP_SORT, bottom: CommonConstants.MARGIN_BOTTOM_SORT }) + + Grid() { + ForEach(this.photos, (item: PictureItem) => { + GridItem() { + PictureView({ photos: item }); + } + }, item => JSON.stringify(item)) + } + .columnsTemplate(CommonConstants.TWO_COLUMNS) + .rowsTemplate(CommonConstants.TWO_ROWS) + .columnsGap(CommonConstants.GAP_COLUMNS) + .rowsGap(CommonConstants.GAP_COLUMNS) + .width(CommonConstants.PAGE_WIDTH) + .height(CommonConstants.HEIGHT_GRID) + .margin({ bottom: CommonConstants.MARGIN_BOTTOM_GRID }) + } + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/Banner.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/Banner.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b6cb83569b31c3de3f6525c8c1f0b99d7872324 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/Banner.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import { PictureItem } from '../../common/bean/PictureItem'; +import { PictureType } from '../../common/constants/PictureConstants'; +import { initializePictures, startPlay, stopPlay } from '../../viewmodel/PictureViewModel'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Text style. + * + * @param fontSize Font size. + * @param fontWeight Font weight. + */ +@Extend(Text) function textStyle(fontSize: Resource, fontWeight: number) { + .fontSize(fontSize) + .fontColor($r('app.color.start_window_background')) + .fontWeight(fontWeight) +} + +/** + * Carousel banner. + */ +@Component +export struct Banner { + // Change the index value through a scheduled task to perform a round robin. + @State index: number = 0; + private imageArray: Array = []; + private swiperController: SwiperController = new SwiperController(); + + aboutToAppear() { + // Data Initialization. + this.imageArray = initializePictures(PictureType.BANNER); + // Turn on scheduled task. + startPlay(this.swiperController); + } + + aboutToDisappear() { + stopPlay(); + } + + build() { + Swiper(this.swiperController) { + ForEach(this.imageArray, item => { + Stack({ alignContent: Alignment.TopStart }) { + Image(item.image) + .objectFit(ImageFit.Fill) + .height(CommonConstants.FULL_HEIGHT) + .width(CommonConstants.FULL_WIDTH) + .borderRadius(CommonConstants.BORDER_RADIUS) + .align(Alignment.Center) + .onClick(() => { + router.pushUrl({ url: CommonConstants.PLAY_PAGE }); + }) + Column() { + Text($r('app.string.movie_classic')) + .textStyle($r('app.float.font_size_description'), CommonConstants.FONT_WEIGHT_LIGHT) + .opacity($r('app.float.opacity_deep')) + .margin({ bottom: CommonConstants.BOTTOM_TEXT }) + Text(item.name) + .textStyle($r('app.float.font_size_title'), CommonConstants.FONT_WEIGHT_BOLD) + } + .alignItems(HorizontalAlign.Start) + .height(CommonConstants.HEIGHT_CAROUSEL_TITLE) + .margin({ + top: CommonConstants.TOP_ADS, + left: CommonConstants.ADS_LEFT + }) + } + .height(CommonConstants.FULL_HEIGHT) + .width(CommonConstants.FULL_WIDTH) + }, item => JSON.stringify(item)) + } + .width(CommonConstants.PAGE_WIDTH) + .height(CommonConstants.HEIGHT_BANNER) + .index(this.index) + .indicatorStyle({ selectedColor: $r('app.color.start_window_background') }) + .indicator(true) + .duration(CommonConstants.DURATION_ADS) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/PictureView.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/PictureView.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c5f652f461b381700dcd3f745c4351f58946eda --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/PictureView.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import { PictureItem } from '../../common/bean/PictureItem'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Picture component. + */ +@Component +export struct PictureView { + private photos: PictureItem; + + build() { + Column() { + Image(this.photos.image) + .borderRadius(CommonConstants.BORDER_RADIUS) + .width(CommonConstants.PAGE_WIDTH) + .height(CommonConstants.WIDTH_PICTURE) + .onClick(() => { + router.pushUrl({ url: CommonConstants.PLAY_PAGE }); + }) + + Text(this.photos.name) + .width(CommonConstants.PAGE_WIDTH) + .fontSize($r('app.float.font_size_photo_name')) + .fontWeight(CommonConstants.FONT_WEIGHT_NORMAL) + .margin({ top: CommonConstants.TOP_NAME }) + + Text(this.photos.description) + .width(CommonConstants.PAGE_WIDTH) + .fontSize($r('app.float.font_size_description')) + .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) + .opacity($r('app.float.opacity_light')) + .margin({ + top: CommonConstants.TOP_DESCRIPTION, + bottom: CommonConstants.BOTTOM_TEXT + }) + } + .height(CommonConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/TopBar.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/TopBar.ets new file mode 100644 index 0000000000000000000000000000000000000000..54ebbcfc0ab4ca692fc664941315e829357b2a5c --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/TopBar.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { TopBarItem } from '../../common/bean/TopBarItem'; +import { initializeOnStartup } from '../../viewmodel/TopBarViewModel'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * TopBar component. + */ +@Component +export struct TopBar { + // Double binding of index values to achieve linkage effect. + @Link index: number; + private tabArray: Array = initializeOnStartup(); + + build() { + Row({ space: CommonConstants.SPACE_TOP_BAR }) { + ForEach(this.tabArray, + (item: TopBarItem) => { + Text(item.name) + .fontSize(this.index === item.id ? $r('app.float.font_size_checked') : $r('app.float.font_size_unchecked')) + .fontColor(Color.Black) + .textAlign(TextAlign.Center) + .fontWeight(this.index === item.id ? FontWeight.Bold : FontWeight.Regular) + .onClick(() => { + this.index = item.id; + }) + }, item => JSON.stringify(item)) + } + .margin({ left: CommonConstants.ADS_LEFT }) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.TOP_BAR_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/movie/MovieSort.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/movie/MovieSort.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd00e38b546b14f877a1fe849b65f2e5b018abf5 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/movie/MovieSort.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { PictureItem } from '../../common/bean/PictureItem'; +import { initializePictures } from '../../viewmodel/PictureViewModel'; +import { PictureType } from '../../common/constants/PictureConstants'; +import { PictureView } from '../common/PictureView'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Movie sort. + */ +@Component +export struct MovieSort { + @State photos: Array = initializePictures(PictureType.LATEST); + + build() { + Column() { + Text($r('app.string.lately')) + .width(CommonConstants.WIDTH_SORT) + .margin({ top: CommonConstants.MARGIN_TOP_SORT, bottom: CommonConstants.MARGIN_BOTTOM_SORT }) + .fontSize($r('app.float.font_size_sort_title')) + .fontWeight(CommonConstants.FONT_WEIGHT_NORMAL) + .fontColor($r('app.color.font_black')) + + Grid() { + ForEach(this.photos, (item: PictureItem) => { + GridItem() { + PictureView({ photos: item }) + } + }, item => JSON.stringify(item)) + } + .columnsTemplate(CommonConstants.THREE_COLUMNS) + .rowsTemplate(CommonConstants.THREE_ROWS) + .columnsGap(CommonConstants.GAP_COLUMNS) + .rowsGap(CommonConstants.GAP_COLUMNS) + .width(CommonConstants.PAGE_WIDTH) + .height(CommonConstants.WIDTH_MOVIE_SORT) + .margin({ bottom: CommonConstants.MARGIN_BOTTOM_GRID }) + } + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/CommentView.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/CommentView.ets new file mode 100644 index 0000000000000000000000000000000000000000..512a01e544d190e2bfad20957398169c8813af89 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/CommentView.ets @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { VideoItem } from '../../common/bean/VideoItem'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Text style. + * + * @param fontSize Font size. + * @param fonWeight Font weight. + */ +@Extend(Text) function textStyle(fontSize: Resource, fonWeight: number) { + .fontSize(fontSize) + .fontWeight(fonWeight) + .fontColor($r('app.color.start_window_background')) + .textAlign(TextAlign.Center) +} + +/** + * Comment component. + */ +@Component +export struct CommentView { + @ObjectLink private item: VideoItem; + + build() { + Column() { + Image($r("app.media.ic_head")) + .width(CommonConstants.WIDTH_HEAD) + .height(CommonConstants.HEIGHT_HEAD) + .margin({ top: CommonConstants.TOP_HEAD }) + .objectFit(ImageFit.Contain) + .border({ + width: CommonConstants.WIDTH_HEAD_BORDER, + color: Color.White, + radius: CommonConstants.RADIUS_HEAD + }) + + Image(this.item.isLikes ? $r("app.media.ic_unlike") : $r("app.media.ic_like")) + .width(CommonConstants.WIDTH_VOTE) + .height(CommonConstants.HEIGHT_COMMENT) + .onClick(() => { + if (this.item.isLikes) { + this.item.likesCount--; + } else { + this.item.likesCount++; + } + this.item.isLikes = !this.item.isLikes; + }) + .margin({ top: CommonConstants.TOP_IMAGE_VOTE }) + Text(this.item.likesCount === 0 ? $r('app.string.like') : (this.item.likesCount.toString())) + .textStyle($r('app.float.font_size_description'), CommonConstants.FONT_WEIGHT_LIGHT) + Image($r("app.media.ic_comment")) + .width(CommonConstants.WIDTH_VOTE) + .height(CommonConstants.HEIGHT_COMMENT) + .margin({ top: CommonConstants.TOP_IMAGE_VOTE }) + Text(this.item.comment === 0 ? $r('app.string.comment') : (this.item.comment.toString())) + .textStyle($r('app.float.font_size_description'), CommonConstants.FONT_WEIGHT_LIGHT) + Image($r("app.media.ic_share")) + .width(CommonConstants.WIDTH_VOTE) + .height(CommonConstants.HEIGHT_COMMENT) + .margin({ top: CommonConstants.TOP_IMAGE_VOTE }) + Text(this.item.shareTimes === 0 ? $r('app.string.share') : (this.item.shareTimes.toString())) + .textStyle($r('app.float.font_size_description'), CommonConstants.FONT_WEIGHT_LIGHT) + } + .offset({ + x: CommonConstants.OFFSET_COMMENT_X, + y: CommonConstants.OFFSET_COMMENT_Y + }) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/DescriptionView.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/DescriptionView.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c284c51467ec88eba47acba48452a473e67ec9c --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/DescriptionView.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * text style. + * @param fontSize Font size. + * @param fonWeight Font weight. + */ +@Extend(Text) function textStyle(fontSize: Resource, fonWeight: number) { + .fontSize(fontSize) + .fontWeight(fonWeight) + .fontColor($r('app.color.start_window_background')) + .textAlign(TextAlign.Center) + .margin(CommonConstants.MARGIN_PLAY_PAGE) +} + +/** + * Description component. + */ +@Component +export struct DescriptionView { + build() { + Column() { + Text($r('app.string.movie_description_1')) + .textStyle($r('app.float.font_size_sort_title'), CommonConstants.FONT_WEIGHT_NORMAL) + Text($r('app.string.movie_description_2')) + .textStyle($r('app.float.font_size_photo_name'), CommonConstants.FONT_WEIGHT_LIGHT) + .opacity($r('app.float.opacity_deep')) + } + .height(CommonConstants.HEIGHT_DESCRIPTION) + .width(CommonConstants.WIDTH_PLAY) + .alignItems(HorizontalAlign.Start) + .offset({ y: CommonConstants.OFFSET_DESCRIPTION_Y }) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/NavigationView.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/NavigationView.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3e177ffcc4b4a37f6650add924cc97686da9eae --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/NavigationView.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Navigation component. + */ +@Component +export struct NavigationView { + build() { + Navigator({ target: CommonConstants.HOME_PAGE, type: NavigationType.Back }) { + Row({ space: CommonConstants.SPACE_NAVIGATION }) { + Image($r('app.media.ic_back')) + .width(CommonConstants.WIDTH_BACK_ICON) + .height(CommonConstants.HEIGHT_BACK_ICON) + .objectFit(ImageFit.Contain) + + Text($r('app.string.movie')) + .fontSize($r('app.float.font_size_title')) + .fontWeight(CommonConstants.FONT_WEIGHT_BOLD) + .fontColor($r('app.color.start_window_background')) + .textAlign(TextAlign.Center) + .margin(CommonConstants.MARGIN_PLAY_PAGE) + .lineHeight(CommonConstants.LINE_HEIGHT_NAVIGATION) + } + } + .position({ x: CommonConstants.START_POSITION, y: CommonConstants.START_POSITION }) + .margin({ left: CommonConstants.LEFT_NAVIGATION, top: CommonConstants.TOP_IMAGE_VOTE }) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/PlayView.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/PlayView.ets new file mode 100644 index 0000000000000000000000000000000000000000..0acc1c64d3ebc6538bbd4dff14111e671a4ef99e --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/play/PlayView.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { VideoItem } from '../../common/bean/VideoItem'; +import { needPageShow } from '../../viewmodel/VideoViewModel'; +import { CommonConstants } from '../../common/constants/CommonConstant'; +import { PlayState } from '../../common/constants/VideoConstants'; +import { NavigationView } from './NavigationView'; +import { CommentView } from './CommentView'; +import { DescriptionView } from './DescriptionView'; + +/** + * Video play view. + */ +@Component +export struct PlayView { + private isShow: boolean = false; + // Change the video playing state according to the index and pageShow changes. + @Link @Watch("needPageShow") index: number; + @Link @Watch("needPageShow") pageShow: boolean; + private barPosition: number; + @State item: VideoItem = null; + @State private playState: number = PlayState.STOP; + private videoController: VideoController = new VideoController(); + + build() { + Stack({ alignContent: Alignment.End }) { + Video({ + src: this.item.src, + controller: this.videoController + }) + .controls(false) + .autoPlay(this.playState === PlayState.START ? true : false) // Auto play in the first visible state. + .objectFit(ImageFit.Fill) + .loop(true) + .height(CommonConstants.WIDTH_VIDEO) + .width(CommonConstants.FULL_WIDTH) + .onClick(() => { + if (this.playState === PlayState.START) { + this.playState = PlayState.PAUSE; + this.videoController.pause(); + } else if (this.playState === PlayState.PAUSE) { + this.playState = PlayState.START; + this.videoController.start(); + } + }) + + NavigationView() + CommentView({ item: this.item }) + DescriptionView() + } + .backgroundColor(Color.Black) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } + + needPageShow() { + let needPlay = needPageShow.bind(this); + needPlay(); + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageAll.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageAll.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc3de305b1a04b9e60659932f99ee8f7713c31c1 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageAll.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { Banner } from '../common/Banner'; +import { PictureSort } from '../all/PictureSort'; +import { CommonConstants } from '../../common/constants/CommonConstant'; +import { PictureType } from '../../common/constants/PictureConstants'; + +/** + * Tab content of all. + */ +@Component +export struct PageAll { + build() { + Scroll() { + Column() { + Banner() + PictureSort({ initType: PictureType.RECENTLY }) + PictureSort({ initType: PictureType.PHOTO }) + } + .width(CommonConstants.FULL_WIDTH) + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.Off) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageEntertainment.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageEntertainment.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f376add804c57c6d1e26b089e9cfbe5bc7a7f34 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageEntertainment.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Tab content of entertainment. + */ +@Component +export struct PageEntertainment { + build() { + Column() { + Text($r('app.string.entertainment')) + .height(CommonConstants.FULL_HEIGHT) + .fontSize(CommonConstants.FONT_SIZE_PAGE_CONTENT) + .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageGame.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageGame.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8414ea1fe474c91f0a6d91031a08a5c973bcc49 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageGame.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Tab content of game. + */ +@Component +export struct PageGame { + build() { + Column() { + Text($r('app.string.game')) + .height(CommonConstants.FULL_HEIGHT) + .fontSize(CommonConstants.FONT_SIZE_PAGE_CONTENT) + .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageLive.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageLive.ets new file mode 100644 index 0000000000000000000000000000000000000000..89d9b7fc7a859cf88750d390965aa7f9af487975 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageLive.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Tab content of live. + */ +@Component +export struct PageLive { + build() { + Column() { + Text($r('app.string.live')) + .height(CommonConstants.FULL_HEIGHT) + .fontSize(CommonConstants.FONT_SIZE_PAGE_CONTENT) + .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageMovie.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageMovie.ets new file mode 100644 index 0000000000000000000000000000000000000000..5fef0eb42a87d4c0e5f614b8b73b6905a1b4ef18 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageMovie.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { Banner } from '../common/Banner'; +import { MovieSort } from '../movie/MovieSort'; +import { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Tab content of movie. + */ +@Component +export struct PageMovie { + build() { + Scroll() { + Column() { + Banner() + MovieSort() + } + .width(CommonConstants.FULL_WIDTH) + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.Off) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageTV.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageTV.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6f1bb6715a2f928e4ec365cfccbb9aed0d8497d --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageTV.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../../common/constants/CommonConstant'; + +/** + * Tab content of TV. + */ +@Component +export struct PageTV { + build() { + Column() { + Text($r('app.string.TV')) + .height(CommonConstants.FULL_HEIGHT) + .fontSize(CommonConstants.FONT_SIZE_PAGE_CONTENT) + .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/PictureViewModel.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/PictureViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..932a6cf967eb876b651ae0ff77f7a7ffeac8b495 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/PictureViewModel.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { PictureItem } from '../common/bean/PictureItem'; +import { PICTURE_RECENTLY, PICTURE_PHOTO, PICTURE_LATEST, PICTURE_BANNER } from '../common/constants/PictureConstants'; +import { PictureType } from '../common/constants/PictureConstants'; +import { CommonConstants } from '../common/constants/CommonConstant'; + +/** + * Initialize picture data according to type. + * + * @param initType Init type. + */ +export function initializePictures(initType: string): Array { + let imageDataArray: Array = []; + switch (initType) { + case PictureType.BANNER: + PICTURE_BANNER.forEach((item) => { + imageDataArray.push(new PictureItem(item.id, item.name, item.description, item.image)); + }) + break; + case PictureType.RECENTLY: + PICTURE_RECENTLY.forEach((item) => { + imageDataArray.push(new PictureItem(item.id, item.name, item.description, item.image)); + }) + break; + case PictureType.PHOTO: + PICTURE_PHOTO.forEach((item) => { + imageDataArray.push(new PictureItem(item.id, item.name, item.description, item.image)); + }) + break; + case PictureType.LATEST: + PICTURE_LATEST.forEach((item) => { + imageDataArray.push(new PictureItem(item.id, item.name, item.description, item.image)); + }) + break; + default: + break; + } + return imageDataArray; +} + +let timerIds: number[] = []; + +/** + * start scheduled task. + * + * @param swiperController Controller. + */ +export function startPlay(swiperController: SwiperController) { + let timerId = setInterval(() => { + swiperController.showNext(); + }, CommonConstants.SWIPER_TIME); + timerIds.push(timerId); +} + +/** + * stop scheduled task. + */ +export function stopPlay() { + timerIds.forEach((item) => { + clearTimeout(item); + }) +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/TopBarViewModel.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/TopBarViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0da709c9223e4758f162531a5c994e5865800d7 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/TopBarViewModel.ets @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { TopBarItem } from '../common/bean/TopBarItem'; +import { TOP_BAR_DATA } from '../common/constants/TopBarConstants'; + +/** + * Init topBar data. + */ +export function initializeOnStartup(): Array { + let tabDataArray: Array = [] + TOP_BAR_DATA.forEach(item => { + tabDataArray.push(new TopBarItem(item.id, item.name)); + }) + return tabDataArray; +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/VideoViewModel.ets b/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/VideoViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..f20e025dca0675bc6d2e9d707d5c4ba09470645c --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/ets/viewmodel/VideoViewModel.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { VideoItem } from '../common/bean/VideoItem'; +import { VIDEO_DATA, PlayState } from '../common/constants/VideoConstants'; + +/** + * Init video data. + */ +export function initializeOnStartup(): Array { + let videoDataArray: Array = [] + VIDEO_DATA.forEach(item => { + videoDataArray.push(new VideoItem(item.id, item.src, item.likesCount, item.isLikes, item.comment, item.shareTimes)); + }) + return videoDataArray; +} + +/** + * video show. + */ +export function onPageSwiperShow() { + if (this.playState != PlayState.START) { + this.playState = PlayState.START; + this.videoController.start(); + } +} + +/** + * video hide. + */ +export function onPageSwiperHide() { + if (this.playState != PlayState.STOP) { + this.playState = PlayState.STOP; + this.videoController.stop(); + } +} + +/** + * play page show. + */ +export function needPageShow() { + if (this.pageShow) { + if (this.barPosition === this.index) { // Judge whether the index is the same as the current location. + this.isShow = true; + onPageSwiperShow.call(this); + } else { + if (this.isShow) { // The already visible status is changed to invisible, and the invisible method callback is triggered. + this.isShow = false; + onPageSwiperHide.call(this); + } + } + } else { // Stop when the page goes back to the background. + this.isShow = false; + onPageSwiperHide.call(this); + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/module.json5 b/ETSUI/SwiperArkTS/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9b07af70a189c0165e30b9f4bedc3bfd22b53cda --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/color.json b/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3b14eeef84f2a1c9e1f14e9d1d6898885178a399 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "font_black", + "value": "#182431" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/float.json b/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..d748e93ef3013b1c0ff6078d1ce9b3822f2a05f2 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/float.json @@ -0,0 +1,36 @@ +{ + "float": [ + { + "name": "opacity_light", + "value": "0.6" + }, + { + "name": "opacity_deep", + "value": "0.9" + }, + { + "name": "font_size_description", + "value": "12fp" + }, + { + "name": "font_size_photo_name", + "value": "14fp" + }, + { + "name": "font_size_sort_title", + "value": "16fp" + }, + { + "name": "font_size_unchecked", + "value": "18fp" + }, + { + "name": "font_size_title", + "value": "20fp" + }, + { + "name": "font_size_checked", + "value": "24fp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/string.json b/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf40d830ea3c7817b50b3a3c998ce93ea05dffd --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/resources/base/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Use of Swiper" + }, + { + "name": "recently", + "value": "Recent Plays" + }, + { + "name": "photo", + "value": "camera" + }, + { + "name": "more", + "value": "more >" + }, + { + "name": "movie_classic", + "value": "Selected Films" + }, + { + "name": "lately", + "value": "latest" + }, + { + "name": "like", + "value": "like" + }, + { + "name": "comment", + "value": "comment" + }, + { + "name": "share", + "value": "share" + }, + { + "name": "movie", + "value": "movie" + }, + { + "name": "movie_description_1", + "value": "@HarmonyOS Official website" + }, + { + "name": "movie_description_2", + "value": "#HarmonyOS Huawei Developer Conference" + }, + { + "name": "TV", + "value": "TV" + }, + { + "name": "game", + "value": "Game" + }, + { + "name": "live", + "value": "Live" + }, + { + "name": "entertainment", + "value": "Entertainment" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_back.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_back.png new file mode 100644 index 0000000000000000000000000000000000000000..6b9ca2aea8584524588e50b572b5f02af18c08f2 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_back.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_comment.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_comment.png new file mode 100644 index 0000000000000000000000000000000000000000..c8b37f31d17a7d512cefa871c80923e449b4f7ef Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_comment.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_head.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_head.png new file mode 100644 index 0000000000000000000000000000000000000000..517567f901de61422d25ad53a223fa5012d24930 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_head.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image1.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image1.png new file mode 100644 index 0000000000000000000000000000000000000000..ab02b4527277ec9889855b6391da3729e7210030 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image1.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image2.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image2.png new file mode 100644 index 0000000000000000000000000000000000000000..26a00379b5fc563285050a6377b55400f6197c03 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image2.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image3.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image3.png new file mode 100644 index 0000000000000000000000000000000000000000..2bd1da26539a9ce4d452fbe16ee538e2af4a03a1 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_image3.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_like.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_like.png new file mode 100644 index 0000000000000000000000000000000000000000..3e6db5cf5609489dbabcad561cdbf137d906fc9d Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_like.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie1.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie1.png new file mode 100644 index 0000000000000000000000000000000000000000..fbe8f06cbe9c256119079e54aa57fdc8ff6a9398 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie1.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie2.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie2.png new file mode 100644 index 0000000000000000000000000000000000000000..45417e8139ad57e8e47c43d913573deb6f5363c7 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie2.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie3.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie3.png new file mode 100644 index 0000000000000000000000000000000000000000..55d75c8edd4b5b737bdf40be9e58f33d3112cf17 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie3.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie4.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie4.png new file mode 100644 index 0000000000000000000000000000000000000000..2e41fd31a6dec754417a5a9e525ad4842a6e46f4 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie4.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie5.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie5.png new file mode 100644 index 0000000000000000000000000000000000000000..cdd2d52c382b1094adf77a992aee70627129dc7d Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie5.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie6.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie6.png new file mode 100644 index 0000000000000000000000000000000000000000..1a7b2ccbbf37d3af57233ba587e5e1684d437388 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie6.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie7.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie7.png new file mode 100644 index 0000000000000000000000000000000000000000..a4debbf4476053da0d25898e2f08b386722bf06e Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie7.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie8.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie8.png new file mode 100644 index 0000000000000000000000000000000000000000..9229b03286ac6c4ff70753671f9eedd8121a6ee3 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie8.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie9.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie9.png new file mode 100644 index 0000000000000000000000000000000000000000..5011fac01f0bbf89eced028e13dd5f77ae8c8149 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_movie9.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_photo1.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_photo1.png new file mode 100644 index 0000000000000000000000000000000000000000..f9b7d0c6f39d5efe855c8bdc1d5f2fbb661ee648 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_photo1.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_photo2.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_photo2.png new file mode 100644 index 0000000000000000000000000000000000000000..da059a7a6cffaf4b36141ca26ee7019379bd6ff1 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_photo2.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently1.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently1.png new file mode 100644 index 0000000000000000000000000000000000000000..81f3d9d7567c64b550c3ef53c94b04b25eaef7f1 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently1.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently2.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently2.png new file mode 100644 index 0000000000000000000000000000000000000000..4d74291db4548d5f83591a69ba054b799860a5c5 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently2.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently3.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently3.png new file mode 100644 index 0000000000000000000000000000000000000000..6e0c11dcd5a6b928a5a24b6246609081fa3646d1 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently3.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently4.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently4.png new file mode 100644 index 0000000000000000000000000000000000000000..dd92907c1ddc40958b237d433ce19f575b32e1cc Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_recently4.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_share.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_share.png new file mode 100644 index 0000000000000000000000000000000000000000..18ba3ed6a3b625af020ec4c928cc9d9eeffa46c6 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_share.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_unlike.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_unlike.png new file mode 100644 index 0000000000000000000000000000000000000000..5840d80d83d8fb62672593007263c3e87af97be1 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/ic_unlike.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/icon.png b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/base/media/icon.png differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/SwiperArkTS/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1813bfc32c2deabd508e09f977238fa9a3d42b98 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/SwiperIndex", + "pages/PageVideo" + ] +} diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/en_US/element/string.json b/ETSUI/SwiperArkTS/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..fcf40d830ea3c7817b50b3a3c998ce93ea05dffd --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Use of Swiper" + }, + { + "name": "recently", + "value": "Recent Plays" + }, + { + "name": "photo", + "value": "camera" + }, + { + "name": "more", + "value": "more >" + }, + { + "name": "movie_classic", + "value": "Selected Films" + }, + { + "name": "lately", + "value": "latest" + }, + { + "name": "like", + "value": "like" + }, + { + "name": "comment", + "value": "comment" + }, + { + "name": "share", + "value": "share" + }, + { + "name": "movie", + "value": "movie" + }, + { + "name": "movie_description_1", + "value": "@HarmonyOS Official website" + }, + { + "name": "movie_description_2", + "value": "#HarmonyOS Huawei Developer Conference" + }, + { + "name": "TV", + "value": "TV" + }, + { + "name": "game", + "value": "Game" + }, + { + "name": "live", + "value": "Live" + }, + { + "name": "entertainment", + "value": "Entertainment" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/rawfile/video1.mp4 b/ETSUI/SwiperArkTS/entry/src/main/resources/rawfile/video1.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..f62f5800838e8b4fef7ccdf31910801c6df8db93 Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/rawfile/video1.mp4 differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/rawfile/video2.mp4 b/ETSUI/SwiperArkTS/entry/src/main/resources/rawfile/video2.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..793eb2d6b72e491b087bb5944c3ca12d8d55cb9b Binary files /dev/null and b/ETSUI/SwiperArkTS/entry/src/main/resources/rawfile/video2.mp4 differ diff --git a/ETSUI/SwiperArkTS/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/SwiperArkTS/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..a59d0c11dd57bbed26d1a4b6d4f1c9e737cc8156 --- /dev/null +++ b/ETSUI/SwiperArkTS/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Swiper的使用" + }, + { + "name": "recently", + "value": "最近播放" + }, + { + "name": "photo", + "value": "相机" + }, + { + "name": "more", + "value": "更多 >" + }, + { + "name": "movie_classic", + "value": "电影精选" + }, + { + "name": "lately", + "value": "最新" + }, + { + "name": "like", + "value": "点赞" + }, + { + "name": "comment", + "value": "评论" + }, + { + "name": "share", + "value": "转发" + }, + { + "name": "movie", + "value": "视频" + }, + { + "name": "movie_description_1", + "value": "@HarmonyOS 官网" + }, + { + "name": "movie_description_2", + "value": "#HarmonyOS HDC大会" + }, + { + "name": "TV", + "value": "电视剧" + }, + { + "name": "game", + "value": "游戏" + }, + { + "name": "live", + "value": "直播" + }, + { + "name": "entertainment", + "value": "综艺" + } + ] +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/figures/banner.png b/ETSUI/SwiperArkTS/figures/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..b3adce4a5379d7a1bfb7ac74e6ff1f0a7c143879 Binary files /dev/null and b/ETSUI/SwiperArkTS/figures/banner.png differ diff --git a/ETSUI/SwiperArkTS/figures/index.png b/ETSUI/SwiperArkTS/figures/index.png new file mode 100644 index 0000000000000000000000000000000000000000..e868310877beef516448ba5c0612ce7bfa376968 Binary files /dev/null and b/ETSUI/SwiperArkTS/figures/index.png differ diff --git a/ETSUI/SwiperArkTS/figures/swiper.gif b/ETSUI/SwiperArkTS/figures/swiper.gif new file mode 100644 index 0000000000000000000000000000000000000000..8465777eb5f755782bab5af62650c67a96d120fd Binary files /dev/null and b/ETSUI/SwiperArkTS/figures/swiper.gif differ diff --git a/ETSUI/SwiperArkTS/figures/video.png b/ETSUI/SwiperArkTS/figures/video.png new file mode 100644 index 0000000000000000000000000000000000000000..af9d9fc78ad0bd3598eb6727c9b0c34c86e0dfeb Binary files /dev/null and b/ETSUI/SwiperArkTS/figures/video.png differ diff --git a/ETSUI/SwiperArkTS/figures/zh-cn_image_0000001457975569.gif b/ETSUI/SwiperArkTS/figures/zh-cn_image_0000001457975569.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ETSUI/SwiperArkTS/figures/zh-cn_image_0000001457975569.gif differ diff --git a/ETSUI/SwiperArkTS/figures/zh-cn_image_0000001569303293.png b/ETSUI/SwiperArkTS/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/SwiperArkTS/figures/zh-cn_image_0000001569303293.png differ diff --git a/ETSUI/SwiperArkTS/hvigor/hvigor-config.json5 b/ETSUI/SwiperArkTS/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ETSUI/SwiperArkTS/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/hvigor/hvigor-wrapper.js b/ETSUI/SwiperArkTS/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..994f22987bd0739b9faa07c966b066c2d9218602 --- /dev/null +++ b/ETSUI/SwiperArkTS/hvigor/hvigor-wrapper.js @@ -0,0 +1,2 @@ +"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__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]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__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)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__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]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__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]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__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)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__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]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.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]/,ee.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(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.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&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.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||te.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 ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.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,ue.O_WRONLY|ue.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){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.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,ue.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"===se&&(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(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}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 c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.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);le.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 de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,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):be([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):be([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):be([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):be([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)):be([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=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;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.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;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.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?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.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):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),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.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(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 at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,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();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=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"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=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}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),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()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);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()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("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){Bt(e),Bt(t),Bt("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=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);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(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.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=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=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 wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&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 c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.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 Rr(){if(_r)return br;return _r=1,br=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{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||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=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return 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","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;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:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();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=Rr()(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)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=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=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=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]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]: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]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]: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,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,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,a).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)}}],c=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:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.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"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={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 cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;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(iu.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||""}};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.substr(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.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{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 Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.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"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ +const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(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:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.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 co={};co.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 ao={};ao.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;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`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)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={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})}};!function(e){const t=yo.fromCallback,n=we,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))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(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||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.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 _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.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 No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.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()&&Ko(e,t)?r(new Error(qo(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=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.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()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.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(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(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 Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=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}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(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 Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.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){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.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 Si(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();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=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"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(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()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(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()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("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){Pi(e),Pi(t),Pi("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=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(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(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){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 $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.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=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(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 Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(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||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(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||Os,o="";try{o=_s(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||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(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,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("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];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("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}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({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 bc(`_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((()=>{bc(`_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())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_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--){bc(`_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 Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_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 _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().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 _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.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;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{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 $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{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 Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.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}Eo.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){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.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))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.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)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.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,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("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(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.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){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`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){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();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)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.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.substring(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 c=e=>{o.clear();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})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.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=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(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;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__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]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__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)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(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 tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__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]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__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)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__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]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__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)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/hvigorfile.ts b/ETSUI/SwiperArkTS/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/SwiperArkTS/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/SwiperArkTS/oh-package.json5 b/ETSUI/SwiperArkTS/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..faf5c6c4cc19ffa83f1462209a27d24c672e148e --- /dev/null +++ b/ETSUI/SwiperArkTS/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "swiperarkts", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/SwiperArkTS/public_sys-resources/icon-caution.gif b/ETSUI/SwiperArkTS/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SwiperArkTS/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/SwiperArkTS/public_sys-resources/icon-danger.gif b/ETSUI/SwiperArkTS/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SwiperArkTS/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/SwiperArkTS/public_sys-resources/icon-note.gif b/ETSUI/SwiperArkTS/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/SwiperArkTS/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/SwiperArkTS/public_sys-resources/icon-notice.gif b/ETSUI/SwiperArkTS/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/SwiperArkTS/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/SwiperArkTS/public_sys-resources/icon-tip.gif b/ETSUI/SwiperArkTS/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/SwiperArkTS/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/SwiperArkTS/public_sys-resources/icon-warning.gif b/ETSUI/SwiperArkTS/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/SwiperArkTS/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/TargetManagement/AppScope/app.json5 b/ETSUI/TargetManagement/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..879fbac6967753d0fb4818d1880d64b4b28e1012 --- /dev/null +++ b/ETSUI/TargetManagement/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.targetmanagement", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/TargetManagement/AppScope/resources/base/element/string.json b/ETSUI/TargetManagement/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2c7f0b4689cdbe528a80bf2c2ff53bbb80aae769 --- /dev/null +++ b/ETSUI/TargetManagement/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "TargetManagement" + } + ] +} diff --git a/ETSUI/TargetManagement/AppScope/resources/base/media/app_icon.png b/ETSUI/TargetManagement/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/TargetManagement/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/TargetManagement/LICENSE b/ETSUI/TargetManagement/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/TargetManagement/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/TargetManagement/README.md b/ETSUI/TargetManagement/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9cbb520b9e17a7ec17aa59fd46efb9e3d6140472 --- /dev/null +++ b/ETSUI/TargetManagement/README.md @@ -0,0 +1,504 @@ +# 目标管理(ArkTS) +## 介绍 +本篇Codelab将介绍如何使用@State、@Prop、@Link、@Watch、@Provide、@Consume管理页面级变量的状态,实现对页面数据的增加、删除、修改。要求完成以下功能: + +1. 实现一个自定义弹窗,完成添加子目标的功能。 +2. 实现一个可编辑列表,可点击指定行展开调节工作目标进度,可多选、全选删除指定行。 + +![](figures/zh-cn_image_0000001546091404.gif) +### 相关概念 + +- [页面状态管理](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/arkts-state-management-overview.md):用于管理页面级变量的状态。 +- [自定义弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md): 通过CustomDialogController类显示自定义弹窗。 +- [List列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md):列表包含一系列相同宽度的列表项。 + +## 环境搭建 +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // ArkTS代码区 +│ ├──common +│ │ ├──bean +│ │ │ └──TaskItemBean.ets // 任务进展实体类 +│ │ ├──constants +│ │ │ └──CommonConstants.ets // 公共常量类 +│ │ └──utils +│ │ ├──DateUtil.ets // 获取格式化日期工具 +│ │ └──Logger.ts // 日志打印工具类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ └──MainPage.ets // 主页面 +│ ├──view +│ │ ├──TargetInformation.ets // 整体目标详情自定义组件 +│ │ ├──AddTargetDialog.ets // 自定义弹窗 +│ │ ├──ProgressEditPanel.ets // 进展调节自定义组件 +│ │ ├──TargetList.ets // 工作目标列表 +│ │ └──TargetListItem.ets // 工作目标列表子项 +│ └──viewmodel +│ ├──DataModel.ets // 工作目标数据操作类 +│ ├──MainPageModel.ets // 主页面业务处理文件 +│ ├──TaskListItemModel // 工作目标列表子项业务处理文件 +│ └──TaskListViewModel.ets // 工作目标列表业务处理文件 +└──entry/src/main/resources // 资源文件目录 +``` +## 构建主界面 + +MainPage作为本应用的主界面,从上至下由三个自定义组件组成。 + +1. 标题titleBar。 +2. 目标整体进展详情TargetInformation。 +3. 子目标列表TargetList。 + +![](figures/zh-cn_image_0000001596850885.png) + +MainPage主要维护五个参数:子目标数组targetData、子目标总数totalTasksNumber、已完成子目标数completedTasksNumber、最近更新时间latestUpdateDate、监听数据变化的参数overAllProgressChanged。具体作用有以下三个方面: + +1. 子组件TargetInformation接收三个参数totalTasksNumber、completedTasksNumber、latestUpdateDate,渲染整体目标详情。 +2. 子组件TargetList接收参数targetData渲染列表。 +3. 使用@Watch监听overAllProgressChanged的变化。当overAllProgressChanged改变时,回调onProgressChanged方法,刷新整体进展TargetInformation。 + +```typescript +// MainPage.ets +@Entry +@Component +struct MainPage { + // 子目标数组 + @State targetData: Array = DataModel.getData(); + // 子目标总数 + @State totalTasksNumber: number = 0; + // 已完成子目标数 + @State completedTasksNumber: number = 0; + // 最近更新时间 + @State latestUpdateDate: string = CommonConstants.DEFAULT_PROGRESS_VALUE; + // 监听数据变化的参数 + @Provide @Watch('onProgressChanged') overAllProgressChanged: boolean = false; + ... + + /** + * overAllProgressChanged改变时的回调 + */ + onProgressChanged() { + this.totalTasksNumber = this.targetData.length; + this.completedTasksNumber = this.targetData.filter((item) => { + return item.progressValue === CommonConstants.SLIDER_MAX_VALUE; + }).length; + this.latestUpdateDate = getCurrentTime(); + } + + build() { + Column() { + // 标题 + this.titleBar() + // 目标整体进展详情 + TargetInformation({ + latestUpdateDate: this.latestUpdateDate, + totalTasksNumber: this.totalTasksNumber, + completedTasksNumber: this.completedTasksNumber + }) + // 子目标列表 + TargetList({ + targetData: $targetData, + onAddClick: () => this.dialogController.open() + }) + ... + } + ... + } + + @Builder + titleBar() { + Text($r('app.string.title')) + ... + } +} +``` +## 添加任务子目标 + +本章节主要介绍如何实现一个自定义弹窗,完成添加子目标的功能。效果如图所示: + +![](figures/zh-cn_image_0000001596731141.png) + +在MainPage.ets中,创建dialogController对象控制弹窗隐显,传入自定义组件AddTargetDialog和点击确定的回调方法saveTask。 + +```typescript +// MainPage.ets +@Entry +@Component +struct MainPage { + dialogController: CustomDialogController = new CustomDialogController({ + builder: AddTargetDialog({ + onClickOk: saveTask.bind(this) + }), + alignment: DialogAlignment.Bottom, + offset: { + dx: CommonConstants.DIALOG_OFFSET_X, + dy: $r('app.float.dialog_offset_y') + }, + customStyle: true, + autoCancel: false + }); +} +``` + +在AddTargetDialog.ets中,参数onClickOk为function类型,接收MainPage传入的saveTask方法。点击确定,调用onClickOk执行saveTask方法,关闭弹窗。 + +```typescript +// AddTargetDialog .ets +@CustomDialog +export default struct AddTargetDialog { + ... + private controller: CustomDialogController; + onClickOk: (value: string) => void; + + build() { + Column() { + ... + TextArea({ placeholder: $r('app.string.input_target_name')}) + ... + .onChange((value: string) => { + this.subtaskName = value; + }) + Blank() + Row() { + ... + Button($r('app.string.confirm_button')) + .dialogButtonStyle() + .onClick(() => { + this.onClickOk(this.subtaskName); + }) + } + ... + } + ... + } +} +``` + +在MainPageModel.ets中,实现saveTask方法:保存数据至DataModel中,并更新targetData的值,完成添加子目标功能。 + +```typescript +// MainPageModel.ets +export function saveTask(taskName: string) { + if (taskName === '') { + promptAction.showToast({ + message: $r('app.string.cannot_input_empty'), + duration: CommonConstants.TOAST_TIME, + bottom: CommonConstants.TOAST_MARGIN_BOTTOM + }); + return; + } + // 保存数据 + DataModel.addData(new TaskItemBean(taskName, 0, getCurrentTime())); + // 更新targetData刷新页面 + this.targetData = DataModel.getData(); + this.dialogController.close(); +} +``` +## 实现可编辑列表 + +本章节主要介绍子目标列表TargetList的实现,包括以下功能: + +- 列表项展开。 +- 列表子项点击下拉,滑动滑块更新进展。 +- 列表进入编辑状态,单选、多选、全选、删除子项。 + +![](figures/zh-cn_image_0000001546411104.gif) + + +### 实现列表项展开 + +实现以下步骤完成点击列表项展开功能: + +1. 使用@State 管理参数isExpanded,表示当前项是否展开,具体表现为自定义组件ProgressEditPanel的显示或隐藏。 +2. 使用@Link和@Watch管理参数clickIndex,表示当前点击ListItem的Index索引。clickIndex值的改变将会传递至所有的ListItem。 +3. 完成onClick点击事件,将isExpanded 值置反,修改clickIndex值为当前点击的索引。 + +```typescript +// TargetListItem.ets +@Component +export default struct TargetListItem { + @State latestProgress: number = 0; + @Watch('onClickIndexChanged') @Link clickIndex: number; + @State isExpanded: boolean = false; + ... + // clickIndex改变的回调方法 + onClickIndexChanged() { + if (this.clickIndex !== this.index) { + this.isExpanded = false; + } + } + + build() { + ... + Column() { + this.TargetItem() + if (this.isExpanded) { + Blank() + // 自定义组件:编辑面板 + ProgressEditPanel({ + slidingProgress: this.latestProgress, + onCancel: () => this.isExpanded = false, + onClickOK: changeProgress.bind(this), + sliderMode: $sliderMode + }) + ... + } + } + ... + .onClick(() => { + ... + if (!this.isEditMode) { + animateTo({ duration: CommonConstants.DURATION }, () => { + this.isExpanded = !this.isExpanded; + }) + this.clickIndex = this.index; + } + }) + } + ... +} +``` +### 实现更新进展 + +列表某项被展开后,实现以下步骤完成更新进展功能: + +1. Slider实现滑动条,滑动滑块调节进展,使用slidingProgress保存滑动值。 +2. 点击确定调用onClickOK方法,将数据slidingProgress回调至TargetListItem。 +3. 在TargetListItem中获取回调的数据并刷新页面。 + +```typescript +// ProgressEditPanel.ets +@Component +export default struct ProgressEditPanel { + @Prop slidingProgress: number; + onCancel: () => void; + onClickOK: (progress: number) => void; + + build() { + Column() { + Slider({...}) + Row() { + CustomButton({ + buttonText: $r('app.string.cancel_button') + }) + .onClick(() => this.onCancel()) + CustomButton({ + buttonText: $r('app.string.confirm_button') + }) + .onClick(() => this.onClickOK(this.slidingProgress)) + } + } + } +} +``` + +在TaskListItemModel.ets中,编写changeProgress方法。此方法是onClickOK方法的实现,将依次完成以下步骤: + +1. 重新渲染TargetListItem的进度值和最近更新时间。 +2. 更新缓存的数据。 +3. 修改overAllProgressChanged的值,通知主页刷新整体进展详情TargetInformation。 + +```typescript +// TaskListItemModel.ets +export function changeProgress(progress: number) { + // 更新TargetListItem的进度值 + this.latestProgress = progress; + // 更新TargetListItem的最近更新时间 + this.updateDate = getCurrentTime(); + // 更新缓存的数据 + let result = DataModel.updateProgress(this.index, this.latestProgress, this.updateDate); + if (result) { + this.overAllProgressChanged = !this.overAllProgressChanged; + } + this.isExpanded = false; +} +``` +### 实现列表多选 + +列表进入编辑模式才可单选、多选。实现以下步骤完成列表多选功能: + +1. 维护一个boolean类型的数组selectArray,其长度始终与数据列表的长度相等,且初始值均为false。表示进入编辑状态时列表均未选中。 +2. 定义一个boolean类型的值isEditMode,表示是否进入了编辑模式。 +3. TargetListItem选中状态的初始化和点击Checkbox改变TargetListItem的选中状态。 + +```typescript +// TargetList.ets +export default struct TargetList { + ... + @State isEditMode: boolean = false; + @State selectArray: Array = []; + ... + + build() { + Column() { + ... + if (this.isEditMode) { + // 取消按钮 + Text($r('app.string.cancel_button')) + ... + .onClick(() => { + ... + this.isEditMode = false; + selectAllOrCancel.call(this, false); + }) + ... + // 全选按钮 + Checkbox() + ... + .onClick(() => { + ... + selectAllOrCancel.call(this, this.selectAll); + }) + } else { + // 编辑按钮 + Text($r('app.string.edit_button')) + ... + .onClick(() => { + this.isEditMode = true; + selectAllOrCancel.call(this, false); + }) + } + ... + } + } +} +``` + +点击全选Checkbox,将selectArray数组的值全赋值true或false,重新渲染列表为全选或者取消全选状态。 + +```typescript +// TaskListViewModel.ets +export function selectAllOrCancel(selectStatus: boolean) { + let newSelectArray = []; + this.targetData.forEach(() => { + newSelectArray.push(selectStatus); + }); + this.selectArray = newSelectArray; +} +``` + +在TargetListItem中,实现以下步骤改变ListItem的选中状态: + +1. 使用@Link定义selectArr数组接收TargetList传入的selectArray。 +2. 在TargetListItem渲染时,使用this.selectArr\[this.index\]获取初始选中状态。 +3. 点击Checkbox时,按照当前ListItem的索引,将选中状态保存至selectArr,重新渲染列表完成单选和多选功能。 + +```typescript +// TargetListItem.ets +export default struct TargetListItem { + + ... + @Link selectArr: Array; + private index: number; + + build() { + Stack({ alignContent: Alignment.Start }) { + ... + this.TargetItem() + ... + Checkbox() + // 获取初始选中状态 + .select(this.selectArr[this.index]) + ... + .onChange((isCheck: boolean) => { + // 改变被点击项的选中状态 + this.selectArr[this.index] = isCheck; + }) + ... + ... + } + } +} +``` +### 实现删除选中列表项 + +当点击“删除”时,调用TaskListViewModel.ets的deleteSelected方法,实现以下步骤完成列表项删除功能: + +1. 调用DataModel的deleteData方法删除数据。 +2. 更新targetData的数据重新渲染列表。 +3. 修改overAllProgressChanged的值,通知主页刷新整体进展详情TargetInformation。 + +```typescript +// TaskListViewModel.ets +export function deleteSelected() { + // 删除数据 + DataModel.deleteData(this.selectArray); + // 更新targetData + this.targetData = DataModel.getData(); + // 刷新整体进展详情 + this.overAllProgressChanged = !this.overAllProgressChanged; + // 退出编辑模式 + this.isEditMode = false; +} +``` + +在DataModel.ets中,遍历数据列表,删除被选中的数据项。 + +```typescript +// DataModel.ets +export class DataModel { + ... + deleteData(selectArr: Array) { + if (!selectArr) { + Logger.error(TAG, 'Failed to delete data because selectArr is ' + selectArr); + } + for (let i = this.recordData.length - CommonConstants.TWO_RECORD; i >= 0; i--) { + if (selectArr[i]) { + this.recordData.splice(i, CommonConstants.ONE_RECORD); + } + } + } + getData(): Array { + return this.targetData; + } + ... +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. @State、@Prop、@Link、@Watch、@Provide、@Consume的使用。 +2. List组件的使用。 +3. 自定义弹窗的使用。 +4. Slider组件的使用。 + +![](figures/zh-cn_image_0000001546251148.gif) + + + + + + + diff --git a/ETSUI/TargetManagement/build-profile.json5 b/ETSUI/TargetManagement/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..baffec5c5a4b40ae0c03892d0624a0332f3ab9a7 --- /dev/null +++ b/ETSUI/TargetManagement/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ], + "signingConfigs": [] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/build-profile.json5 b/ETSUI/TargetManagement/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/TargetManagement/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/hvigorfile.ts b/ETSUI/TargetManagement/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/TargetManagement/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/TargetManagement/entry/oh-package.json5 b/ETSUI/TargetManagement/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bb53a3dbc95d69001a611f7b8d2cb919ec099bf4 --- /dev/null +++ b/ETSUI/TargetManagement/entry/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/common/bean/TaskItemBean.ets b/ETSUI/TargetManagement/entry/src/main/ets/common/bean/TaskItemBean.ets new file mode 100644 index 0000000000000000000000000000000000000000..a40a0df93a272696f0267ba671d27541deff9518 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/common/bean/TaskItemBean.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Task item entity class. + */ +export default class TaskItemBean { + /** + * Progress value of task item. + */ + taskName: string; + + /** + * Update time of task item. + */ + updateDate: string; + + /** + * progress value of task item. + */ + progressValue: number; + + + /** + * Construction method. + * + * @param progressValue progress value. + * @param updateDate update time. + */ + constructor(taskName: string, progressValue: number, updateDate: string) { + this.taskName = taskName; + this.progressValue = progressValue; + this.updateDate = updateDate; + } +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/common/constant/CommonConstant.ets b/ETSUI/TargetManagement/entry/src/main/ets/common/constant/CommonConstant.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3a46b497c7b9deadaaac1b3c7c6107bb7f5cf92 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/common/constant/CommonConstant.ets @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Style constants that can be used by all modules + */ +export class CommonConstants { + + /** + * Full width. + */ + static readonly FULL_WIDTH: string = '100%'; + + /** + * Full height. + */ + static readonly FULL_HEIGHT: string = '100%'; + + /** + * Normal font weight. + */ + static readonly FONT_WEIGHT: number = 500; + + /** + * Larger font weight. + */ + static readonly FONT_WEIGHT_LARGE: number = 700; + + /** + * Width of the content area. + */ + static readonly MAIN_BOARD_WIDTH: string = '93.3%'; + + /** + * Opacity of text. + */ + static readonly OPACITY: number = 0.4; + + /** + * Opacity of not. + */ + static readonly NO_OPACITY: number = 1; + + /** + * Toast Duration. + */ + static readonly TOAST_TIME: number = 3000; + + /** + * Bottom toast. + */ + static readonly TOAST_MARGIN_BOTTOM: number = 64; + + /** + * Width of title. + */ + static readonly TITLE_WIDTH: string = '86.7%'; + + /** + * Radius of bookInfo area. + */ + static readonly TARGET_BORDER_RADIUS: number = 24; + + /** + * Radius of bookInfo area. + */ + static readonly IMAGE_BORDER_RADIUS: number = 12; + + /** + * Margin left of book item. + */ + static readonly TARGET_MARGIN_LEFT: string = '5%'; + + /** + * Width of slider. + */ + static readonly STROKE_WIDTH: number = 4.8; + + /** + * Width of dialog. + */ + static readonly DIALOG_WIDTH: string = '90.3%'; + + /** + * Radius of dialog. + */ + static readonly DIALOG_BORDER_RADIUS: number = 32; + + /** + * Button width of dialog. + */ + static readonly DIALOG_OPERATION_WIDTH: string = '70%'; + + /** + * Button height of dialog. + */ + static readonly DIALOG_OPERATION_HEIGHT: string = '10%'; + + /** + * Button height of dialog. + */ + static readonly DIALOG_INPUT_HEIGHT: string = '40%'; + + /** + * Input margin of dialog. + */ + static readonly DIALOG_INPUT_MARGIN: string = '6%'; + + /** + * Horizontal offset of dialog. + */ + static readonly DIALOG_OFFSET_X: number = 0; + + /** + * The smallest value of slider. + */ + static readonly SLIDER_MIN_VALUE: number = 0; + + /** + * The maximum value of slider. + */ + static readonly SLIDER_MAX_VALUE: number = 100; + + /** + * Step of slider. + */ + static readonly SLIDER_STEP: number = 1; + + /** + * Width of slider. + */ + static readonly SLIDER_WIDTH: string = '90%'; + + /** + * Height of slider. + */ + static readonly SLIDER_HEIGHT: string = '20%'; + + /** + * Height of slider button. + */ + static readonly SLIDER_BUTTON_HEIGHT: string = '21%'; + + /** + * Margin top of slider button. + */ + static readonly SLIDER_BUTTON_MARGIN: string = '4%'; + + /** + * Margin top of slider button. + */ + static readonly SLIDER_INNER_WIDTH: string = '90%'; + + /** + * Width of checkbox. + */ + static readonly CHECKBOX_WIDTH: number = 20; + + /** + * Max of line. + */ + static readonly MAX_LINES: number = 2; + + /** + * Height of list. + */ + static readonly LIST_HEIGHT: string = '80%'; + + /** + * Height of list board. + */ + static readonly LIST_BOARD_HEIGHT: string = '67%'; + + /** + * list space. + */ + static readonly LIST_SPACE: number = 12; + + /** + * Width of task item. + */ + static readonly TASK_NAME_WIDTH: string = '30%'; + + /** + * Radius of list. + */ + static readonly LIST_RADIUS: number = 24; + + /** + * Default progress value. + */ + static readonly DEFAULT_PROGRESS_VALUE: string = '-'; + + /** + * Current month plus one. + */ + static readonly PLUS_ONE: number = 1; + + /** + * The fraction or number of seconds is less than 10. + */ + static readonly TEN: number = 10; + + /** + * One task of data. + */ + static readonly ONE_TASK: number = 1; + + /** + * animation duration. + */ + static readonly DURATION: number = 300; + + /** + * default click index. + */ + static readonly DEFAULT_CLICK_INDEX: number = -1; + + /** + * default SliderChangeMode. + */ + static readonly DEFAULT_SLIDER_MODE: number = -1; + + /** + * click SliderChangeMode. + */ + static readonly CLICK_SLIDER_MODE: number = 3; + + /** + * x-axis transition animation. + */ + static readonly TRANSITION_ANIMATION_X: number = 1; + + /** + * y-axis transition animation. + */ + static readonly TRANSITION_ANIMATION_Y: number = 0; +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/common/utils/DateUtil.ets b/ETSUI/TargetManagement/entry/src/main/ets/common/utils/DateUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..062d6e6dfabb088cbbd237f0a77ea73669076067 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/common/utils/DateUtil.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../constant/CommonConstant'; + +/** + * Obtaining and formatting the current system time. + */ +export default function getCurrentTime(): string { + let date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + CommonConstants.PLUS_ONE; + let day = date.getDate(); + let hours = date.getHours(); + let minutes = date.getMinutes().toString(); + if (parseInt(minutes) < CommonConstants.TEN) { + minutes = `0${minutes}`; + } + let second = date.getSeconds().toString(); + if (parseInt(second) < CommonConstants.TEN) { + second = `0${second}`; + } + return `${year}/${month}/${day} ${hours}:${minutes}:${second}`; +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/common/utils/Logger.ets b/ETSUI/TargetManagement/entry/src/main/ets/common/utils/Logger.ets new file mode 100644 index 0000000000000000000000000000000000000000..3f639f0b4416eb149fae575b110caaa2ded20f82 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/common/utils/Logger.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('TargetManagement', 0xFF00); \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/TargetManagement/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..92e6fccf8d291f5b962dc387c6a172a86f3a5d97 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/MainPage', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/pages/MainPage.ets b/ETSUI/TargetManagement/entry/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..66bfb70841567169cf7bfc4322aeddffc32b7d2c --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/pages/MainPage.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023 Huawei Device 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 TargetInformation from '../view/TargetInformation'; +import AddTargetDialog from '../view/AddTargetDialog'; +import TargetList from '../view/TargetList'; +import TaskItemBean from '../common/bean/TaskItemBean'; +import DataModel from '../viewmodel/DataModel'; +import { saveTask } from '../viewmodel/MainPageModel'; +import { CommonConstants } from '../common/constant/CommonConstant'; +import getCurrentTime from '../common/utils/DateUtil'; + +@Entry +@Component +struct MainPage { + @State targetData: Array = DataModel.getData(); + @State totalTasksNumber: number = 0; + @State completedTasksNumber: number = 0; + @State latestUpdateDate: string = CommonConstants.DEFAULT_PROGRESS_VALUE; + @Provide @Watch('onProgressChanged') overAllProgressChanged: boolean = false; + dialogController: CustomDialogController = new CustomDialogController({ + builder: AddTargetDialog({ + onClickOk: saveTask.bind(this) + }), + alignment: DialogAlignment.Bottom, + offset: { + dx: CommonConstants.DIALOG_OFFSET_X, + dy: $r('app.float.dialog_offset_y') + }, + customStyle: true, + autoCancel: false + }); + + /** + * Listening targetData. + */ + onProgressChanged() { + this.totalTasksNumber = this.targetData.length; + this.completedTasksNumber = this.targetData.filter((item) => { + return item.progressValue === CommonConstants.SLIDER_MAX_VALUE; + }).length; + this.latestUpdateDate = getCurrentTime(); + } + + build() { + Column() { + this.titleBar() + TargetInformation({ + latestUpdateDate: this.latestUpdateDate, + totalTasksNumber: this.totalTasksNumber, + completedTasksNumber: this.completedTasksNumber + }) + TargetList({ + targetData: $targetData, + onAddClick: () => this.dialogController.open() + }) + .height(CommonConstants.LIST_BOARD_HEIGHT) + } + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + .backgroundColor($r('app.color.index_background')) + } + + @Builder + titleBar() { + Text($r('app.string.title')) + .width(CommonConstants.TITLE_WIDTH) + .height($r('app.float.title_height')) + .fontSize($r('app.float.title_font')) + .fontWeight(CommonConstants.FONT_WEIGHT_LARGE) + .textAlign(TextAlign.Start) + .margin({ + top: $r('app.float.title_margin'), + bottom: $r('app.float.title_margin') + }) + } +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/view/AddTargetDialog.ets b/ETSUI/TargetManagement/entry/src/main/ets/view/AddTargetDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..f16446f5183483a82b9a09ad0af1ba923b4a2b2d --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/view/AddTargetDialog.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constant/CommonConstant'; + +@CustomDialog +export default struct AddTargetDialog { + @State subtaskName: string = ''; + private controller: CustomDialogController; + onClickOk: (value: string) => void; + + build() { + Column() { + Text($r('app.string.add_task_dialog')) + .width(CommonConstants.FULL_WIDTH) + .fontSize($r('app.float.secondary_title')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .fontColor($r('app.color.title_black_color')) + .textAlign(TextAlign.Start) + TextInput({ placeholder: $r('app.string.input_target_name')}) + .placeholderColor(Color.Grey) + .placeholderFont({ size: $r('app.float.list_font')}) + .caretColor(Color.Blue) + .backgroundColor($r('app.color.input_background')) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.DIALOG_INPUT_HEIGHT) + .margin({ top: CommonConstants.DIALOG_INPUT_MARGIN }) + .fontSize($r('app.float.list_font')) + .fontColor($r('app.color.title_black_color')) + .onChange((value: string) => { + this.subtaskName = value; + }) + Blank() + Row() { + Button($r('app.string.cancel_button')) + .dialogButtonStyle() + .onClick(() => { + this.controller.close(); + }) + Divider() + .vertical(true) + Button($r('app.string.confirm_button')) + .dialogButtonStyle() + .onClick(() => { + this.onClickOk(this.subtaskName); + }) + } + .width(CommonConstants.DIALOG_OPERATION_WIDTH) + .height(CommonConstants.DIALOG_OPERATION_HEIGHT) + .justifyContent(FlexAlign.SpaceBetween) + } + .padding($r('app.float.dialog_padding')) + .height($r('app.float.dialog_height')) + .width(CommonConstants.DIALOG_WIDTH) + .borderRadius(CommonConstants.DIALOG_BORDER_RADIUS) + .backgroundColor(Color.White) + } +} + +/** + * Custom button style. + */ +@Extend(Button) function dialogButtonStyle() { + .fontSize($r('app.float.button_font')) + .height($r('app.float.dialog_btn_height')) + .width($r('app.float.dialog_btn_width')) + .backgroundColor(Color.White) + .fontColor($r('app.color.main_blue')) +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/view/ProgressEditPanel.ets b/ETSUI/TargetManagement/entry/src/main/ets/view/ProgressEditPanel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c130e8891d7efeb3bc9fa96ca5e2b79a34a5c9fb --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/view/ProgressEditPanel.ets @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constant/CommonConstant'; + +@Component +export default struct ProgressEditPanel { + @Link sliderMode: number; + @Prop slidingProgress: number; + onCancel: () => void; + onClickOK: (progress: number) => void; + + build() { + Column() { + Row() { + Slider({ + value: this.slidingProgress, + min: CommonConstants.SLIDER_MIN_VALUE, + max: CommonConstants.SLIDER_MAX_VALUE, + style: SliderStyle.InSet, + step: CommonConstants.SLIDER_STEP + }) + .width(CommonConstants.SLIDER_INNER_WIDTH) + .onChange((value: number, mode: SliderChangeMode) => { + this.slidingProgress = Math.floor(value); + this.sliderMode = mode; + }) + Text(`${this.slidingProgress}%`) + .fontSize($r('app.float.progress_font')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .fontColor($r('app.color.dialog_progress')) + .textAlign(TextAlign.Center) + .margin({ left: $r('app.float.slider_margin_left') }) + } + .width(CommonConstants.SLIDER_WIDTH) + .height(CommonConstants.SLIDER_HEIGHT) + + Row() { + CustomButton({ + buttonText: $r('app.string.cancel_button') + }) + .onClick(() => this.onCancel()) + CustomButton({ + buttonText: $r('app.string.confirm_button') + }) + .onClick(() => this.onClickOK(this.slidingProgress)) + } + .margin({ top: CommonConstants.SLIDER_BUTTON_MARGIN }) + .width(CommonConstants.DIALOG_OPERATION_WIDTH) + .justifyContent(FlexAlign.SpaceBetween) + } + .height($r('app.float.edit_panel_height')) + .width(CommonConstants.FULL_WIDTH) + .justifyContent(FlexAlign.End) + } +} + +@Component +struct CustomButton { + @State buttonColor: Resource = $r('app.color.start_window_background'); + buttonText: Resource; + + build() { + Text(this.buttonText) + .dialogButtonStyle() + .backgroundColor(this.buttonColor) + .borderRadius(CommonConstants.LIST_RADIUS) + .textAlign(TextAlign.Center) + .onTouch((event: TouchEvent) => { + if (event.type === TouchType.Down) { + this.buttonColor = $r('app.color.custom_button_color'); + } + if (event.type === TouchType.Up) { + this.buttonColor = $r('app.color.start_window_background'); + } + }) + } +} + +/** + * Custom button style. + */ +@Extend(Text) function dialogButtonStyle() { + .fontSize($r('app.float.button_font')) + .height($r('app.float.dialog_btn_height')) + .width($r('app.float.dialog_btn_width')) + .fontColor($r('app.color.main_blue')) +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/view/TargetInformation.ets b/ETSUI/TargetManagement/entry/src/main/ets/view/TargetInformation.ets new file mode 100644 index 0000000000000000000000000000000000000000..23596f65bfe96be871c9e6519094de70822bb86a --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/view/TargetInformation.ets @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constant/CommonConstant'; + +@Component +export default struct TargetInformation { + @Prop latestUpdateDate: string; + @Prop totalTasksNumber: number; + @Prop completedTasksNumber: number; + + build() { + Column() { + this.TargetItem() + this.OverallProgress() + } + .padding($r('app.float.target_padding')) + .width(CommonConstants.MAIN_BOARD_WIDTH) + .height($r('app.float.target_info_height')) + .backgroundColor(Color.White) + .borderRadius(CommonConstants.TARGET_BORDER_RADIUS) + } + + @Builder + TargetItem() { + Row() { + Image($r("app.media.ic_main")) + .width($r('app.float.target_image_length')) + .height($r('app.float.target_image_length')) + .objectFit(ImageFit.Fill) + .borderRadius(CommonConstants.IMAGE_BORDER_RADIUS) + Column() { + Text($r('app.string.target_name')) + .fontSize($r('app.float.target_name_font')) + .fontWeight(CommonConstants.FONT_WEIGHT_LARGE) + .width(CommonConstants.TITLE_WIDTH) + Text($r('app.string.target_info')) + .opacityTextStyle() + .fontSize($r('app.float.target_desc_font')) + .margin({ top: $r('app.float.title_margin') }) + } + .margin({ left: CommonConstants.TARGET_MARGIN_LEFT }) + .alignItems(HorizontalAlign.Start) + } + .width(CommonConstants.FULL_WIDTH) + } + + @Builder + OverallProgress() { + Row() { + Column() { + Text($r('app.string.overall_progress')) + .fontSize($r('app.float.button_font')) + .fontColor($r('app.color.title_black_color')) + .fontWeight(CommonConstants.FONT_WEIGHT) + Row() { + Text($r('app.string.latest_updateTime')) + .opacityTextStyle() + Text(this.latestUpdateDate) + .opacityTextStyle() + } + .margin({ top: $r('app.float.text_margin') }) + } + .alignItems(HorizontalAlign.Start) + + Blank() + Stack() { + Row() { + Text(this.completedTasksNumber.toString()) + .fontSize($r('app.float.progress_font')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .fontColor($r('app.color.main_blue')) + Text(`/${this.totalTasksNumber}`) + .fontSize($r('app.float.progress_font')) + .fontWeight(CommonConstants.FONT_WEIGHT) + } + + Progress({ + value: this.completedTasksNumber, + total: this.totalTasksNumber, + type: ProgressType.Ring + }) + .color($r('app.color.main_blue')) + .style({ + strokeWidth: CommonConstants.STROKE_WIDTH + }) + .width($r('app.float.progress_length')) + .height($r('app.float.progress_length')) + } + } + .width(CommonConstants.FULL_WIDTH) + .height($r('app.float.progress_length')) + .margin({ top: $r('app.float.progress_margin_top') }) + } +} + +/** + * Custom Transparent Text Styles + */ +@Extend(Text) function opacityTextStyle() { + .fontSize($r('app.float.text_font')) + .fontColor($r('app.color.title_black_color')) + .opacity(CommonConstants.OPACITY) + .fontWeight(CommonConstants.FONT_WEIGHT) +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/view/TargetList.ets b/ETSUI/TargetManagement/entry/src/main/ets/view/TargetList.ets new file mode 100644 index 0000000000000000000000000000000000000000..a3b8f1794a38e7339e3150a3f7ec3b6c0edc4d98 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/view/TargetList.ets @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2023 Huawei Device 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 TaskItemBean from '../common/bean/TaskItemBean'; +import TargetListItem from './TargetListItem'; +import { selectAllOrCancel, deleteSelected, isSelectAll, isSelectRows } from '../viewmodel/TaskListViewModel'; +import { CommonConstants } from '../common/constant/CommonConstant'; + +@Component +export default struct TargetList { + @Consume overAllProgressChanged: boolean; + @State isEditMode: boolean = false; + @State selectArray: Array = []; + @State clickIndex: number = CommonConstants.DEFAULT_CLICK_INDEX; + @State selectAll: boolean = false; + @Link targetData: Array; + onAddClick: () => void; + + build() { + Column() { + Row() { + Text($r('app.string.sub_goals')) + .fontSize($r('app.float.secondary_title')) + .fontWeight(CommonConstants.FONT_WEIGHT_LARGE) + .fontColor($r('app.color.title_black_color')) + Blank() + if (this.targetData.length > 0) { + if (this.isEditMode) { + Text($r('app.string.cancel_button')) + .operateTextStyle($r('app.color.main_blue')) + .margin({ left: $r('app.float.operate_button_margin') }) + .onClick(() => { + this.selectAll = false; + this.isEditMode = false; + selectAllOrCancel.call(this, false); + }) + Text($r('app.string.select_all_button')) + .operateTextStyle($r('app.color.main_blue')) + .margin({ + left: $r('app.float.operate_button_margin') + }) + Checkbox() + .select(isSelectAll.call(this)) + .selectedColor($r('app.color.main_blue')) + .width(CommonConstants.CHECKBOX_WIDTH) + .onClick(() => { + this.selectAll = !this.selectAll; + selectAllOrCancel.call(this, this.selectAll); + }) + } else { + Text($r('app.string.edit_button')) + .operateTextStyle($r('app.color.main_blue')) + .onClick(() => { + this.isEditMode = true; + selectAllOrCancel.call(this, false); + }) + } + } + } + .width(CommonConstants.FULL_WIDTH) + .height($r('app.float.history_line_height')) + .padding({ + left: $r('app.float.list_padding'), + right: $r('app.float.list_padding_right') + }) + + List({ space: CommonConstants.LIST_SPACE }) { + ForEach(this.targetData, (item: TaskItemBean, index: number) => { + ListItem() { + TargetListItem({ + taskItem: item, + index: index, + selectArr: $selectArray, + isEditMode: this.isEditMode, + clickIndex: $clickIndex + }) + } + }, (item, index) => JSON.stringify(item) + index) + } + .edgeEffect(EdgeEffect.None) + .margin({ top: $r('app.float.list_margin_top') }) + .width(CommonConstants.FULL_WIDTH) + .height(CommonConstants.LIST_HEIGHT) + + Blank() + if (this.isEditMode) { + Button($r('app.string.delete_button')) + .opacity(isSelectRows.call(this) ? CommonConstants.NO_OPACITY : CommonConstants.OPACITY) + .enabled(isSelectRows.call(this) ? true : false) + .operateButtonStyle($r('app.color.main_red')) + .onClick(() => { + deleteSelected.call(this); + selectAllOrCancel.call(this, false); + this.selectAll = false; + }) + } else { + Button($r('app.string.add_task')) + .operateButtonStyle($r('app.color.main_blue')) + .onClick(() => this.onAddClick()) + } + } + .width(CommonConstants.MAIN_BOARD_WIDTH) + .height(CommonConstants.FULL_HEIGHT) + .padding({ top: $r('app.float.operate_row_margin') }) + } +} + +/** + * Custom text button style. + */ +@Extend(Text) function operateTextStyle(color: Resource) { + .fontSize($r('app.float.text_button_font')) + .fontColor(color) + .lineHeight($r('app.float.text_line_height')) + .fontWeight(CommonConstants.FONT_WEIGHT) +} + +/** + * Custom button style. + */ +@Extend(Button) function operateButtonStyle(color: Resource) { + .width($r('app.float.button_width')) + .height($r('app.float.button_height')) + .fontSize($r('app.float.button_font')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .fontColor(color) + .backgroundColor($r('app.color.button_background')) +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/view/TargetListItem.ets b/ETSUI/TargetManagement/entry/src/main/ets/view/TargetListItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f227a66d2f182b91eb68bc6ceb954996bf8b170 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/view/TargetListItem.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2023 Huawei Device 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 TaskItemBean from '../common/bean/TaskItemBean'; +import { CommonConstants } from '../common/constant/CommonConstant'; +import { changeProgress } from '../viewmodel/TaskListItemModel'; +import ProgressEditPanel from './ProgressEditPanel'; + +@Component +export default struct TargetListItem { + private taskItem: TaskItemBean; + @State latestProgress: number = 0; + @State updateDate: string = ''; + @Link selectArr: Array; + @Prop isEditMode: boolean; + @Link @Watch('onClickIndexChanged') clickIndex: number; + @State isExpanded: boolean = false; + @Consume overAllProgressChanged: boolean; + @State sliderMode: number = CommonConstants.DEFAULT_SLIDER_MODE; + private index: number; + + aboutToAppear() { + this.latestProgress = this.taskItem.progressValue; + this.updateDate = this.taskItem.updateDate; + } + + /** + * Listening click index. + */ + onClickIndexChanged() { + if (this.clickIndex !== this.index) { + this.isExpanded = false; + } + } + + build() { + Stack({ alignContent: Alignment.Start }) { + Column() { + this.TargetItem() + if (this.isExpanded) { + Blank() + ProgressEditPanel({ + slidingProgress: this.latestProgress, + onCancel: () => this.isExpanded = false, + onClickOK: changeProgress.bind(this), + sliderMode: $sliderMode + }) + .transition({ + scale: { + x: CommonConstants.TRANSITION_ANIMATION_X, + y: CommonConstants.TRANSITION_ANIMATION_Y + } + }) + } + } + .padding({ + left: $r('app.float.list_padding'), + top: $r('app.float.list_padding_top'), + bottom: $r('app.float.list_padding_bottom'), + right: this.isEditMode ? $r('app.float.list_edit_padding') : $r('app.float.list_padding') + }) + .height(this.isExpanded ? $r('app.float.expanded_item_height') : $r('app.float.list_item_height')) + .width(CommonConstants.FULL_WIDTH) + .opacity( + this.latestProgress === CommonConstants.SLIDER_MAX_VALUE ? + CommonConstants.OPACITY : CommonConstants.NO_OPACITY + ) + .borderRadius(CommonConstants.LIST_RADIUS) + .animation({ duration: CommonConstants.DURATION }) + .backgroundColor(this.selectArr[this.index] ? $r('app.color.edit_blue') : Color.White) + .onClick(() => { + if (this.sliderMode === CommonConstants.CLICK_SLIDER_MODE) { + this.sliderMode = CommonConstants.DEFAULT_SLIDER_MODE; + return; + } + if (!this.isEditMode) { + animateTo({ duration: CommonConstants.DURATION }, () => { + this.isExpanded = !this.isExpanded; + }) + this.clickIndex = this.index; + } + }) + + if (this.isEditMode) { + Row() { + Checkbox() + .select(this.selectArr[this.index]) + .selectedColor($r('app.color.main_blue')) + .width(CommonConstants.CHECKBOX_WIDTH) + .margin({ right: $r('app.float.list_padding') }) + .onChange((isCheck: boolean) => { + this.selectArr[this.index] = isCheck; + }) + } + .width(CommonConstants.FULL_WIDTH) + .justifyContent(FlexAlign.End) + } + } + .width(CommonConstants.FULL_WIDTH) + } + + @Builder TargetItem() { + Row() { + Text(this.taskItem.taskName) + .fontSize($r('app.float.list_font')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .fontColor($r('app.color.title_black_color')) + .width(CommonConstants.TASK_NAME_WIDTH) + .textAlign(TextAlign.Start) + .maxLines(CommonConstants.MAX_LINES) + Blank() + Column() { + Text(`${this.latestProgress}%`) + .fontSize($r('app.float.list_font')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .fontColor($r('app.color.title_black_color')) + Row() { + Text($r('app.string.latest_updateTime')) + .opacityTextStyle() + Text(this.updateDate) + .opacityTextStyle() + } + .margin({ top: $r('app.float.text_margin') }) + } + .alignItems(HorizontalAlign.End) + } + .width(CommonConstants.FULL_WIDTH) + } +} + +/** + * Custom transparent text styles. + */ +@Extend(Text) function opacityTextStyle() { + .fontSize($r('app.float.text_font')) + .fontColor($r('app.color.title_black_color')) + .opacity(CommonConstants.OPACITY) + .fontWeight(CommonConstants.FONT_WEIGHT) +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/DataModel.ets b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/DataModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4c8b4d57176a99976db54efbfe88be27e154e73 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/DataModel.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constant/CommonConstant'; +import Logger from '../common/utils/Logger'; +import TaskItemBean from '../common/bean/TaskItemBean'; + +const TAG = '[DataModel]'; + +/** + * Saving and manipulating data displayed on the page. + */ +export class DataModel { + + /** + * Saved data. + */ + private targetData: Array = []; + + /** + * Get the latest data. + */ + getData(): Array { + return this.targetData; + } + + /** + * Delete the selected data. + * + * @param selectArr: An array indicating whether historical data is selected. + */ + deleteData(selectArr: Array) { + if (!selectArr) { + Logger.error(TAG, 'Failed to delete data because selectArr is ' + selectArr); + } + let dataLen = this.targetData.length - CommonConstants.ONE_TASK; + for (let i = dataLen; i >= 0; i--) { + if (selectArr[i]) { + this.targetData.splice(i, CommonConstants.ONE_TASK); + } + } + } + + /** + * Add data to targetData. + * + * @param Data of the RecordItemBean type to be added. + */ + addData(data: TaskItemBean) { + if (!data) { + Logger.error(TAG, 'addData error because data is: ' + data); + return; + } + this.targetData.push(data); + } + + /** + * Get the latest progress. + */ + getLatestProgressValue(): number { + if (this.targetData.length === 0) { + return 0; + } + return this.targetData[this.targetData.length - CommonConstants.ONE_TASK].progressValue; + } + + /** + * Update data based on index and progress values and update date. + * + * @param index of update item. + * @param updateValue of update item. + * @param updateDate of update item. + */ + updateProgress(index: number, updateValue: number, updateDate: string): boolean { + if (!this.targetData[index]) { + return false; + } + this.targetData[index].progressValue = updateValue; + this.targetData[index].updateDate = updateDate; + return true; + } +} + +export default new DataModel(); \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/MainPageModel.ets b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/MainPageModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..effbdc802a2c09efe37f61e418c60375477797e0 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/MainPageModel.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Huawei Device 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 promptAction from '@ohos.promptAction'; +import DataModel from './DataModel'; +import getCurrentTime from '../common/utils/DateUtil'; +import TaskItemBean from '../common/bean/TaskItemBean'; +import { CommonConstants } from '../common/constant/CommonConstant'; + +/** + * Save the progress value and update time after you click OK in the dialog box. + * + * @param context context from view. + * @param value Latest Progress Value. + */ +export function saveTask(taskName: string) { + if (taskName === '') { + promptAction.showToast({ + message: $r('app.string.cannot_input_empty'), + duration: CommonConstants.TOAST_TIME, + bottom: CommonConstants.TOAST_MARGIN_BOTTOM + }); + return; + } + DataModel.addData(new TaskItemBean(taskName, 0, getCurrentTime())); + this.targetData = DataModel.getData(); + this.overAllProgressChanged = !this.overAllProgressChanged; + this.dialogController.close(); +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/TaskListItemModel.ets b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/TaskListItemModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..6027799c70a1c5d2b24457dbf8044e5f586ad9e0 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/TaskListItemModel.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Huawei Device 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 getCurrentTime from '../common/utils/DateUtil'; +import DataModel from '../viewmodel/DataModel'; + +/** + * Save the adjustment progress. + * + * @param progress progress value saved. + */ +export function changeProgress(progress: number) { + this.latestProgress = progress; + this.updateDate = getCurrentTime(); + let result = DataModel.updateProgress(this.index, this.latestProgress, this.updateDate); + if (result) { + this.overAllProgressChanged = !this.overAllProgressChanged; + } + this.isExpanded = false; +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/TaskListViewModel.ets b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/TaskListViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..de9aaaa6f993a39bab80fa865157af0aafd7cd9e --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/TaskListViewModel.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device 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 DataModel from '../viewmodel/DataModel'; + +/** + * Delete the selected item and exit the editing mode. + */ +export function deleteSelected() { + DataModel.deleteData(this.selectArray); + this.targetData = DataModel.getData(); + this.overAllProgressChanged = !this.overAllProgressChanged; + this.isEditMode = false; +} + +/** + * Select or deselect all. + * + * @param selectStatus true: Select all. Otherwise, deselect all. + */ +export function selectAllOrCancel(selectStatus: boolean) { + let newSelectArray = []; + this.targetData.forEach(() => { + newSelectArray.push(selectStatus); + }); + this.selectArray = newSelectArray; +} + +/** + * Whether to select all. + */ +export function isSelectAll(): boolean { + if (this.selectArray.length === 0) { + return false; + } + let deSelectCount = this.selectArray.filter(selected => selected === false).length; + if (deSelectCount === 0) { + this.selectAll = true; + return true; + } + this.selectAll = false; + return false; +} + +/** + * Check whether there are selected rows. + */ +export function isSelectRows(): boolean { + return this.selectArray.filter((selected) => selected === true).length !== 0; +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/module.json5 b/ETSUI/TargetManagement/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bbd0e651b40247025034b68e1b7bcdda1f445e4d --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:ic_icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:ic_icon", + "startWindowBackground": "$color:start_window_background", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/element/color.json b/ETSUI/TargetManagement/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..01378917f4ceae0438bb010e67d9487b235a33da --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/base/element/color.json @@ -0,0 +1,44 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "index_background", + "value": "#F1F3F5" + }, + { + "name": "main_blue", + "value": "#007DFF" + }, + { + "name": "main_red", + "value": "#E84026" + }, + { + "name": "custom_button_color", + "value": "#E8E7EB" + }, + { + "name": "edit_blue", + "value": "#1A007DFF" + }, + { + "name": "button_background", + "value": "#0D182431" + }, + { + "name": "title_black_color", + "value": "#182431" + }, + { + "name": "dialog_progress", + "value": "#4D4D4D" + }, + { + "name": "input_background", + "value": "#0D182431" + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/element/float.json b/ETSUI/TargetManagement/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..fc9cea471221c0be3aff933bc3f2b5c1333cab62 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/base/element/float.json @@ -0,0 +1,172 @@ +{ + "float": [ + { + "name": "title_font", + "value": "24fp" + }, + { + "name": "button_font", + "value": "16fp" + }, + { + "name": "list_font", + "value": "16fp" + }, + { + "name": "text_font", + "value": "12fp" + }, + { + "name": "target_name_font", + "value": "18fp" + }, + { + "name": "target_desc_font", + "value": "15fp" + }, + { + "name": "progress_font", + "value": "14fp" + }, + { + "name": "secondary_title", + "value": "20fp" + }, + { + "name": "text_button_font", + "value": "16fp" + }, + { + "name": "text_line_height", + "value": "19vp" + }, + { + "name": "text_margin", + "value": "2vp" + }, + { + "name": "checkbox_width", + "value": "20" + }, + { + "name": "button_width", + "value": "156vp" + }, + { + "name": "button_height", + "value": "40vp" + }, + { + "name": "dialog_height", + "value": "168vp" + }, + { + "name": "title_margin", + "value": "12vp" + }, + { + "name": "title_height", + "value": "32vp" + }, + { + "name": "progress_length", + "value": "48vp" + }, + { + "name": "dialog_btn_width", + "value": "96vp" + }, + { + "name": "dialog_btn_height", + "value": "32vp" + }, + { + "name": "dialog_divider_height", + "value": "18vp" + }, + { + "name": "dialog_padding", + "value": "24vp" + }, + { + "name": "edit_padding", + "value": "12vp" + }, + { + "name": "dialog_offset_y", + "value": "-16vp" + }, + { + "name": "slider_height", + "value": "22vp" + }, + { + "name": "slider_margin_left", + "value": "8vp" + }, + { + "name": "operate_button_margin", + "value": "16vp" + }, + { + "name": "operate_row_margin", + "value": "16vp" + }, + { + "name": "list_margin_top", + "value": "12vp" + }, + { + "name": "list_item_height", + "value": "64vp" + }, + { + "name": "edit_panel_height", + "value": "84vp" + }, + { + "name": "expanded_item_height", + "value": "148vp" + }, + { + "name": "history_line_height", + "value": "30vp" + }, + { + "name": "target_padding", + "value": "16vp" + }, + { + "name": "target_image_length", + "value": "96vp" + }, + { + "name": "progress_margin_top", + "value": "15vp" + }, + { + "name": "list_padding_top", + "value": "14vp" + }, + { + "name": "list_padding_bottom", + "value": "12vp" + }, + { + "name": "list_padding", + "value": "16vp" + }, + { + "name": "list_edit_padding", + "value": "54vp" + }, + { + "name": "list_padding_right", + "value": "11vp" + }, + { + "name": "target_info_height", + "value": "187vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/element/string.json b/ETSUI/TargetManagement/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..29395ccb97ee56ed838e1589bd8ed84d50c2a609 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/base/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "目标管理" + }, + { + "name": "title", + "value": "工作目标" + }, + { + "name": "add_task", + "value": "添加子目标" + }, + { + "name": "target_name", + "value": "第一季度运营目标" + }, + { + "name": "target_info", + "value": "实现用户量与用户活跃度提升。" + }, + { + "name": "overall_progress", + "value": "整体进度" + }, + { + "name": "add_task_dialog", + "value": "添加子目标" + }, + { + "name": "latest_updateTime", + "value": "更新时间: " + }, + { + "name": "sub_goals", + "value": "子目标" + }, + { + "name": "cancel_button", + "value": "取消" + }, + { + "name": "confirm_button", + "value": "确定" + }, + { + "name": "delete_button", + "value": "删除" + }, + { + "name": "edit_button", + "value": "编辑" + }, + { + "name": "select_all_button", + "value": "全选" + }, + { + "name": "cannot_input_empty", + "value": "任务名称不能为空!" + }, + { + "name": "input_target_name", + "value": "请输入子目标名称" + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_down.svg b/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_down.svg new file mode 100644 index 0000000000000000000000000000000000000000..26ffd1d517e69893a30bcc7d2c1f2a19ceef1e58 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_down.svg @@ -0,0 +1 @@ +下展 \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_icon.png b/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_icon.png differ diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_main.png b/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_main.png new file mode 100644 index 0000000000000000000000000000000000000000..aae47b0164db8051d68dfc5f342c8331f698a0db Binary files /dev/null and b/ETSUI/TargetManagement/entry/src/main/resources/base/media/ic_main.png differ diff --git a/ETSUI/TargetManagement/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/TargetManagement/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..f4241ef2f72e78047b4c449d92bd1a92accc39fb --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/MainPage" + ] +} diff --git a/ETSUI/TargetManagement/entry/src/main/resources/en_US/element/string.json b/ETSUI/TargetManagement/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..755b7dd263d6f3b168496d6358bf8a35a3a12cf9 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Target Management" + }, + { + "name": "title", + "value": "Work Objectives" + }, + { + "name": "add_task", + "value": "Add Sub-Targets" + }, + { + "name": "target_name", + "value": "Q1 Operation Targets" + }, + { + "name": "target_info", + "value": "Increase the number of users and user activeness." + }, + { + "name": "overall_progress", + "value": "Overall Progress" + }, + { + "name": "add_task_dialog", + "value": "Add Sub-Targets" + }, + { + "name": "latest_updateTime", + "value": "Update Time: " + }, + { + "name": "sub_goals", + "value": "Sub-goals" + }, + { + "name": "cancel_button", + "value": "Cancel" + }, + { + "name": "confirm_button", + "value": "OK" + }, + { + "name": "delete_button", + "value": "Delete" + }, + { + "name": "edit_button", + "value": "Edit" + }, + { + "name": "select_all_button", + "value": "Select All" + }, + { + "name": "cannot_input_empty", + "value": "The task name cannot be null." + }, + { + "name": "input_target_name", + "value": "Please enter a sub-target name." + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/TargetManagement/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..29395ccb97ee56ed838e1589bd8ed84d50c2a609 --- /dev/null +++ b/ETSUI/TargetManagement/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,76 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "目标管理" + }, + { + "name": "title", + "value": "工作目标" + }, + { + "name": "add_task", + "value": "添加子目标" + }, + { + "name": "target_name", + "value": "第一季度运营目标" + }, + { + "name": "target_info", + "value": "实现用户量与用户活跃度提升。" + }, + { + "name": "overall_progress", + "value": "整体进度" + }, + { + "name": "add_task_dialog", + "value": "添加子目标" + }, + { + "name": "latest_updateTime", + "value": "更新时间: " + }, + { + "name": "sub_goals", + "value": "子目标" + }, + { + "name": "cancel_button", + "value": "取消" + }, + { + "name": "confirm_button", + "value": "确定" + }, + { + "name": "delete_button", + "value": "删除" + }, + { + "name": "edit_button", + "value": "编辑" + }, + { + "name": "select_all_button", + "value": "全选" + }, + { + "name": "cannot_input_empty", + "value": "任务名称不能为空!" + }, + { + "name": "input_target_name", + "value": "请输入子目标名称" + } + ] +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/figures/zh-cn_image_0000001546091404.gif b/ETSUI/TargetManagement/figures/zh-cn_image_0000001546091404.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d93a0b9e9a7d15c946116a110b0deceea4c482e Binary files /dev/null and b/ETSUI/TargetManagement/figures/zh-cn_image_0000001546091404.gif differ diff --git a/ETSUI/TargetManagement/figures/zh-cn_image_0000001546251148.gif b/ETSUI/TargetManagement/figures/zh-cn_image_0000001546251148.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ETSUI/TargetManagement/figures/zh-cn_image_0000001546251148.gif differ diff --git a/ETSUI/TargetManagement/figures/zh-cn_image_0000001546411104.gif b/ETSUI/TargetManagement/figures/zh-cn_image_0000001546411104.gif new file mode 100644 index 0000000000000000000000000000000000000000..8170b357b4fe2e46d38a1d28b1fdae7c12063a72 Binary files /dev/null and b/ETSUI/TargetManagement/figures/zh-cn_image_0000001546411104.gif differ diff --git a/ETSUI/TargetManagement/figures/zh-cn_image_0000001569303293.png b/ETSUI/TargetManagement/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/TargetManagement/figures/zh-cn_image_0000001569303293.png differ diff --git a/ETSUI/TargetManagement/figures/zh-cn_image_0000001596731141.png b/ETSUI/TargetManagement/figures/zh-cn_image_0000001596731141.png new file mode 100644 index 0000000000000000000000000000000000000000..d832315464ce009c06a5156ef6d9d1fc814e29ea Binary files /dev/null and b/ETSUI/TargetManagement/figures/zh-cn_image_0000001596731141.png differ diff --git a/ETSUI/TargetManagement/figures/zh-cn_image_0000001596850885.png b/ETSUI/TargetManagement/figures/zh-cn_image_0000001596850885.png new file mode 100644 index 0000000000000000000000000000000000000000..0bf63c53460ef09da810b69beda4085e1e962c85 Binary files /dev/null and b/ETSUI/TargetManagement/figures/zh-cn_image_0000001596850885.png differ diff --git a/ETSUI/TargetManagement/hvigor/hvigor-config.json5 b/ETSUI/TargetManagement/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ETSUI/TargetManagement/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ETSUI/TargetManagement/hvigor/hvigor-wrapper.js b/ETSUI/TargetManagement/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/TargetManagement/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/TargetManagement/hvigorfile.ts b/ETSUI/TargetManagement/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/TargetManagement/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/TargetManagement/oh-package.json5 b/ETSUI/TargetManagement/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..85f0f67745060f9848621aa7f0314e990d928bc6 --- /dev/null +++ b/ETSUI/TargetManagement/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "license": "ISC", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "name": "readingrecorder", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/TargetManagement/public_sys-resources/icon-caution.gif b/ETSUI/TargetManagement/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/TargetManagement/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/TargetManagement/public_sys-resources/icon-danger.gif b/ETSUI/TargetManagement/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/TargetManagement/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/TargetManagement/public_sys-resources/icon-note.gif b/ETSUI/TargetManagement/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/TargetManagement/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/TargetManagement/public_sys-resources/icon-notice.gif b/ETSUI/TargetManagement/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/TargetManagement/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/TargetManagement/public_sys-resources/icon-tip.gif b/ETSUI/TargetManagement/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/TargetManagement/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/TargetManagement/public_sys-resources/icon-warning.gif b/ETSUI/TargetManagement/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/TargetManagement/public_sys-resources/icon-warning.gif differ diff --git a/ETSUI/ToDoListArkTS/AppScope/app.json5 b/ETSUI/ToDoListArkTS/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..391cb03827a90823b27e62ee3c4b9088d5a1d0a8 --- /dev/null +++ b/ETSUI/ToDoListArkTS/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.todolist", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ETSUI/ToDoListArkTS/AppScope/resources/base/element/string.json b/ETSUI/ToDoListArkTS/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..174665b48d3b62f79ade7eb1a6c87cd42c0f716a --- /dev/null +++ b/ETSUI/ToDoListArkTS/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ToDoList" + } + ] +} diff --git a/ETSUI/ToDoListArkTS/AppScope/resources/base/media/app_icon.png b/ETSUI/ToDoListArkTS/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/ToDoListArkTS/AppScope/resources/base/media/app_icon.png differ diff --git a/ETSUI/ToDoListArkTS/LICENSE b/ETSUI/ToDoListArkTS/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ETSUI/ToDoListArkTS/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/README.md b/ETSUI/ToDoListArkTS/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bac5151b51aff0fc094a75db0da5dd3a95e2df8b --- /dev/null +++ b/ETSUI/ToDoListArkTS/README.md @@ -0,0 +1,162 @@ +# 待办列表(ArkTS) +## 介绍 + +本篇Codelab将介绍如何使用ArkTS声明式语法和基础组件,实现简易待办列表。效果为点击某一事项,替换标签图片、虚化文字。效果如图所示: + +![](figures/zh-cn_image_0000001546095170.gif) + +### 相关概念 + +- [ArkTS语法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/arkts-get-started.md):ArkTS是HarmonyOS的主要应用开发语言。ArkTS基于TypeScript(简称TS)语言扩展而来,是TS的超集。 +- [Text组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-text.md):显示一段文本的组件。 +- [Column组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-column.md):沿垂直方向布局的容器。 +- [Row组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md):沿水平方向布局的容器。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // ArkTS代码区 +│ ├──common +│ │ └──constants +│ │ └──CommonConstants.ets // 公共常量类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──pages +│ │ └──ToDoListPage.ets // 主页面 +│ ├──view +│ │ └──ToDoItem.ets // 自定义单项待办组件 +│ └──viewmodel +│ └──DataModel.ets // 列表数据获取文件 +└──entry/src/main/resources // 资源文件目录 +``` +## 构建主界面 + +本章节将介绍应用主页面的实现,采用Column容器嵌套ForEach完成页面整体布局,页面分为两个部分: + +- 标题区:使用Text组件显示“待办”标题。 +- 数据列表:使用ForEach循环渲染自定义组件ToDoItem。 + +效果如图所示: + +![](figures/zh-cn_image_0000001546254914.png) + +在工程pages目录中,选中Index.ets,点击鼠标右键 \> Refactor \> Rename,改名为ToDoListPage.ets。改名后,在工程entryability目录下,把EntryAbility.ts文件中windowStage.loadContent方法的第一个参数修改为pages/ToDoListPage。 + +```typescript +// EntryAbility.ts +onWindowStageCreate(windowStage: Window.WindowStage) { + ... + windowStage.loadContent('pages/ToDoListPage', (err, data) => { + ... + }); +} +``` + +选中工程的ets目录,点击鼠标右键 \> new \> Directory,新建view文件夹。选中新建的view文件夹,点击鼠标右键 \> new \> ArkTS File,新建ToDoItem.ets文件。后续在此文件中封装自定义组件。在ToDoListPage.ets中导入封装的自定义组件ToDoItem,在aboutToAppear生命周期中初始化待办数据totalTasks,在build方法中编写主页面布局,使用Text文本组件显示标题,使用ForEach循环渲染自定义组件ToDoItem。 + +```typescript +// ToDoListPage.ets +import ToDoItem'../view/ToDoItem'; +... +@Entry +@Component +struct ToDoListPage { + private totalTasks: Array = []; + + aboutToAppear() { + this.totalTasks = DataModel.getData(); + } + + build() { + Column({ space: CommonConstants.COLUMN_SPACE }) { + Text($r('app.string.page_title')) + ... + ForEach(this.totalTasks, (item) => { + ToDoItem({ content: item }) + }, item => JSON.stringify(item)) + } + ... + } +} +``` +## 自定义子组件 + +在ToDoItem.ets文件中,显示的文本内容为入参content,使用@State修饰参数isComplete来管理当前事项的完成状态。当点击当前ToDoItem时,触发Row组件的onClick事件,更新isComplete的值,isComplete的改变将会刷新使用该状态变量的UI组件。具体表现为:当前点击的ToDoItem中,labelIcon图片的替换、文本透明度opacity属性的变化、文本装饰线decoration的显隐。 + +```typescript +// ToDoItem.ets +... +@Component +export default struct ToDoItem { + private content: string; + @State isComplete: boolean = false; + + @Builder labelIcon(icon) { + Image(icon) + ... + } + + build() { + Row() { + if (this.isComplete) { + this.labelIcon($r('app.media.ic_ok')); + } else { + this.labelIcon($r('app.media.ic_default')); + } + Text(this.content) + ... + .opacity(this.isComplete ? CommonConstants.OPACITY_COMPLETED : CommonConstants.OPACITY_DEFAULT) + .decoration({ type: this.isComplete ? TextDecorationType.LineThrough : TextDecorationType.None }) + } + ... + .onClick(() => { + this.isComplete = !this.isComplete; + }) + } +} +``` +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. ArkTS声明式语法。 +2. Image、Text、Column、Row等基础组件的使用。 + + ![](figures/zh-cn_image_0000001596934629.gif) + + + + + + diff --git a/ETSUI/ToDoListArkTS/build-profile.json5 b/ETSUI/ToDoListArkTS/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/ETSUI/ToDoListArkTS/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/build-profile.json5 b/ETSUI/ToDoListArkTS/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/hvigorfile.ts b/ETSUI/ToDoListArkTS/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ETSUI/ToDoListArkTS/entry/oh-package.json5 b/ETSUI/ToDoListArkTS/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bb53a3dbc95d69001a611f7b8d2cb919ec099bf4 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/ets/common/constant/CommonConstant.ets b/ETSUI/ToDoListArkTS/entry/src/main/ets/common/constant/CommonConstant.ets new file mode 100644 index 0000000000000000000000000000000000000000..50dd0cdbd4015f390caa241e8a06a6d5d8486f0b --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/ets/common/constant/CommonConstant.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Style constants that can be used by all modules + */ +export default class CommonConstants { + /** + * Full width or height. + */ + static readonly FULL_LENGTH: string = '100%'; + + /** + * Title height. + */ + static readonly TITLE_WIDTH: string = '80%'; + + /** + * List default width. + */ + static readonly LIST_DEFAULT_WIDTH: string = '93.3%'; + + /** + * Opacity of default. + */ + static readonly OPACITY_DEFAULT: number = 1; + + /** + * Opacity of default. + */ + static readonly OPACITY_COMPLETED: number = 0.4; + + /** + * BorderRadius of list item. + */ + static readonly BORDER_RADIUS: number = 24; + + /** + * BorderRadius of list item. + */ + static readonly FONT_WEIGHT: number = 500; + + /** + * Space of column. + */ + static readonly COLUMN_SPACE: number = 16; + + /** + * agents data. + */ + static readonly TODO_DATA: Array = [ + "早起晨练", + "准备早餐", + "阅读名著", + "学习ArkTS", + "看剧放松" + ]; +} + diff --git a/ETSUI/ToDoListArkTS/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/ToDoListArkTS/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..763d8e7389fe4a1e088f516ab7de7af02d041124 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/ToDoListPage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } +} diff --git a/ETSUI/ToDoListArkTS/entry/src/main/ets/pages/ToDoListPage.ets b/ETSUI/ToDoListArkTS/entry/src/main/ets/pages/ToDoListPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..675a52a86c35100702a73b53a2b317afed8ce842 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/ets/pages/ToDoListPage.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Huawei Device 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 DataModel from '../viewmodel/DataModel'; +import CommonConstants from '../common/constant/CommonConstant'; +import ToDoItem from '../view/ToDoItem'; + +@Entry +@Component +struct ToDoListPage { + private totalTasks: Array = []; + + aboutToAppear() { + this.totalTasks = DataModel.getData(); + } + + build() { + Column({ space: CommonConstants.COLUMN_SPACE }) { + Text($r('app.string.page_title')) + .fontSize($r('app.float.title_font_size')) + .fontWeight(FontWeight.Bold) + .lineHeight($r('app.float.title_font_height')) + .width(CommonConstants.TITLE_WIDTH) + .margin({ + top: $r('app.float.title_margin_top'), + bottom: $r('app.float.title_margin_bottom') + }) + .textAlign(TextAlign.Start) + + ForEach(this.totalTasks, (item) => { + ToDoItem({ content: item }) + }, item => JSON.stringify(item)) + } + .width(CommonConstants.FULL_LENGTH) + .height(CommonConstants.FULL_LENGTH) + .backgroundColor($r('app.color.page_background')) + } +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/ets/view/ToDoItem.ets b/ETSUI/ToDoListArkTS/entry/src/main/ets/view/ToDoItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..434553dde99382c76e2127a6fae9e506eb10c551 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/ets/view/ToDoItem.ets @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constant/CommonConstant'; + +@Component +export default struct ToDoItem { + private content: string; + @State isComplete: boolean = false; + + @Builder labelIcon(icon) { + Image(icon) + .objectFit(ImageFit.Contain) + .width($r('app.float.checkbox_width')) + .height($r('app.float.checkbox_width')) + .margin($r('app.float.checkbox_margin')) + } + + build() { + Row() { + if (this.isComplete) { + this.labelIcon($r('app.media.ic_ok')); + } else { + this.labelIcon($r('app.media.ic_default')); + } + + Text(this.content) + .fontSize($r('app.float.item_font_size')) + .fontWeight(CommonConstants.FONT_WEIGHT) + .opacity(this.isComplete ? CommonConstants.OPACITY_COMPLETED : CommonConstants.OPACITY_DEFAULT) + .decoration({ type: this.isComplete ? TextDecorationType.LineThrough : TextDecorationType.None }) + } + .borderRadius(CommonConstants.BORDER_RADIUS) + .backgroundColor($r('app.color.start_window_background')) + .width(CommonConstants.LIST_DEFAULT_WIDTH) + .height($r('app.float.list_item_height')) + .onClick(() => { + this.isComplete = !this.isComplete; + }) + } +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/ets/viewmodel/DataModel.ets b/ETSUI/ToDoListArkTS/entry/src/main/ets/viewmodel/DataModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..381503c09e846e5470dbf529d6f6ee1f63313fbb --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/ets/viewmodel/DataModel.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device 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 CommonConstants from '../common/constant/CommonConstant'; + +/** + * Saving and manipulating data displayed on the page. + */ +export class DataModel { + /** + * Saved Data. + */ + private tasks: Array = CommonConstants.TODO_DATA; + + /** + * Get the data. + */ + getData(): Array { + return this.tasks; + } +} + +export default new DataModel(); \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/module.json5 b/ETSUI/ToDoListArkTS/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bbd0e651b40247025034b68e1b7bcdda1f445e4d --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:ic_icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:ic_icon", + "startWindowBackground": "$color:start_window_background", + "orientation": "portrait", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/color.json b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..63025e187064f7b0d75fbf09b139dfd8983469aa --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/color.json @@ -0,0 +1,12 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "page_background", + "value": "#F1F3F5" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/float.json b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..9a007eebd55a3c297701292d18b5bdcba652b5e7 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/float.json @@ -0,0 +1,36 @@ +{ + "float": [ + { + "name": "checkbox_width", + "value": "28vp" + }, + { + "name": "checkbox_margin", + "value": "20vp" + }, + { + "name": "item_font_size", + "value": "20fp" + }, + { + "name": "title_font_size", + "value": "28fp" + }, + { + "name": "title_font_height", + "value": "33vp" + }, + { + "name": "title_margin_top", + "value": "24vp" + }, + { + "name": "title_margin_bottom", + "value": "12vp" + }, + { + "name": "list_item_height", + "value": "64vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/string.json b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9d4c23bec1fd8219a4aeb2502d6d0be9a0b6b4b7 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "待办列表" + }, + { + "name": "page_title", + "value": "待办" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_default.png b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_default.png new file mode 100644 index 0000000000000000000000000000000000000000..04b20f2e2bb924ed835f3076015517f73742895f Binary files /dev/null and b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_default.png differ diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_icon.png b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_icon.png differ diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_ok.png b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_ok.png new file mode 100644 index 0000000000000000000000000000000000000000..c5db6d88480a41b2d0795b4f3f00ae2215449ce9 Binary files /dev/null and b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/media/ic_ok.png differ diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/base/profile/main_pages.json b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..d2b13b40b8ee50345ba789b5cf169b959a5fdf50 --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/ToDoListPage" + ] +} diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/en_US/element/string.json b/ETSUI/ToDoListArkTS/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d28650e927a9ea7722166e236a2b9af65ebe0e5e --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ToDoList" + }, + { + "name": "page_title", + "value": "ToDo" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/ToDoListArkTS/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..abe870adc685f84e249a7d382754e3579f18711f --- /dev/null +++ b/ETSUI/ToDoListArkTS/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "待办列表" + }, + { + "name": "page_title", + "value": "待办" + } + ] +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001546095170.gif b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001546095170.gif new file mode 100644 index 0000000000000000000000000000000000000000..a50b58f220c1084e1c5dc2450897199186bfa320 Binary files /dev/null and b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001546095170.gif differ diff --git a/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001546254914.png b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001546254914.png new file mode 100644 index 0000000000000000000000000000000000000000..1fbd94652f45c1482112439fda46c4908a649895 Binary files /dev/null and b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001546254914.png differ diff --git a/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001569303293.png b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001569303293.png differ diff --git a/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001596934629.gif b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001596934629.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ETSUI/ToDoListArkTS/figures/zh-cn_image_0000001596934629.gif differ diff --git a/ETSUI/ToDoListArkTS/hvigor/hvigor-config.json5 b/ETSUI/ToDoListArkTS/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ETSUI/ToDoListArkTS/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/hvigor/hvigor-wrapper.js b/ETSUI/ToDoListArkTS/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ETSUI/ToDoListArkTS/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/hvigorfile.ts b/ETSUI/ToDoListArkTS/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ETSUI/ToDoListArkTS/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ETSUI/ToDoListArkTS/oh-package.json5 b/ETSUI/ToDoListArkTS/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..15d7dbd314ef6d2712d08a4648e8ea598b0373ef --- /dev/null +++ b/ETSUI/ToDoListArkTS/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "license": "ISC", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "name": "agentsarkts", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/ETSUI/ToDoListArkTS/public_sys-resources/icon-caution.gif b/ETSUI/ToDoListArkTS/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/ToDoListArkTS/public_sys-resources/icon-caution.gif differ diff --git a/ETSUI/ToDoListArkTS/public_sys-resources/icon-danger.gif b/ETSUI/ToDoListArkTS/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/ToDoListArkTS/public_sys-resources/icon-danger.gif differ diff --git a/ETSUI/ToDoListArkTS/public_sys-resources/icon-note.gif b/ETSUI/ToDoListArkTS/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ETSUI/ToDoListArkTS/public_sys-resources/icon-note.gif differ diff --git a/ETSUI/ToDoListArkTS/public_sys-resources/icon-notice.gif b/ETSUI/ToDoListArkTS/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ETSUI/ToDoListArkTS/public_sys-resources/icon-notice.gif differ diff --git a/ETSUI/ToDoListArkTS/public_sys-resources/icon-tip.gif b/ETSUI/ToDoListArkTS/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ETSUI/ToDoListArkTS/public_sys-resources/icon-tip.gif differ diff --git a/ETSUI/ToDoListArkTS/public_sys-resources/icon-warning.gif b/ETSUI/ToDoListArkTS/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ETSUI/ToDoListArkTS/public_sys-resources/icon-warning.gif differ diff --git a/ExcellentCase/MultiDeviceMusic/AppScope/app.json5 b/ExcellentCase/MultiDeviceMusic/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0b20238c6531b9263e5f7a7fab238a7376c4d142 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.huawei.multidevice", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ExcellentCase/MultiDeviceMusic/AppScope/resources/base/element/string.json b/ExcellentCase/MultiDeviceMusic/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d1997be09abfef1331fa6a4efcf8f149bbc7b2fc --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MultiDevice" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/AppScope/resources/base/media/app_icon.png b/ExcellentCase/MultiDeviceMusic/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/AppScope/resources/base/media/app_icon.png differ diff --git a/ExcellentCase/MultiDeviceMusic/LICENSE b/ExcellentCase/MultiDeviceMusic/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/README.md b/ExcellentCase/MultiDeviceMusic/README.md new file mode 100644 index 0000000000000000000000000000000000000000..41f79dc9c5b99b1e30460b03785858d6a78cc881 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/README.md @@ -0,0 +1,439 @@ +# 一次开发,多端部署-音乐专辑(ArkTS) + +## 简介 +基于自适应和响应式布局,实现一次开发、多端部署音乐专辑页面。 + +![](figures/AlbumSM.png) + +### 相关概念 +- [一次开发,多端部署](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/introduction.md):一套代码工程,一次开发上架,多端按需部署。支撑开发者快速高效的开发支持多种终端设备形态的应用,实现对不同设备兼容的同时,提供跨设备的流转、迁移和协同的分布式体验。 +- [自适应布局](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/adaptive-layout.md):当外部容器大小发生变化时,元素可以根据相对关系自动变化以适应外部容器变化的布局能力。相对关系如占比、固定宽高比、显示优先级等。当前自适应布局能力有7种:拉伸能力、均分能力、占比能力、缩放能力、延伸能力、隐藏能力、折行能力。自适应布局能力可以实现界面显示随外部容器大小连续变化。 +- [响应式布局](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/responsive-layout.md):当外部容器大小发生变化时,元素可以根据断点、栅格或特定的特征(如屏幕方向、窗口宽高等)自动变化以适应外部容器变化的布局能力。当前响应式布局能力有3种:断点、媒体查询、栅格布局。 +- [GridRow](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md):栅格容器组件,仅可以和栅格子组件(GridCol)在栅格布局场景中使用。 +- [GridCol](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridcol.md):栅格子组件,必须作为栅格容器组件(GridRow)的子组件使用。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/Version.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + + + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──common/src/main/ets // 公共能力层 +│ ├──bean +│ │ └──MenuData.ets // 菜单数据实体类 +│ ├──constants +│ │ ├──BreakpointConstants.ets // 断点常量类 +│ │ ├──GridConstants.ets // 栅格常量类 +│ │ └──StyleConstants.ets // 样式常量类 +│ └──utils +│ └──BreakpointSystem.ets // 断点工具类 +├──features // 基础特性层 +│ ├──content/src/main/ets // 专辑封面和歌曲列表内容区 +│ │ ├──components +│ │ │ ├──AlbumComponent.ets // 自定义专辑封面组件 +│ │ │ ├──AlbumCover.ets // 支持多设备的自定义专辑封面组件 +│ │ │ ├──Content.ets // 自定义专辑封面和歌曲列表组件 +│ │ │ └──PlayList.ets // 自定义歌曲列表组件 +│ │ ├──constants +│ │ │ └──ContentConstants.ets // 内容区常量类 +│ │ └──viewmodel +│ │ ├──SongDataSource.ets // 懒加载数据源 +│ │ └──SongListData.ets // 歌曲列表数据类 +│ ├──content/src/main/resources // 资源文件目录 +│ ├──header/src/main/ets // 顶部标题栏 +│ │ ├──components +│ │ │ └──Header.ets // 自定义标题栏组件 +│ │ └──constants +│ │ └──HeaderConstants.ets // 标题栏常量类 +│ ├──header/src/main/resources // 资源文件目录 +│ └──player/src/main/ets // 底部播放控制区 +│ │ ├──components +│ │ │ └──Player.ets // 自定义底部播放控制区组件 +│ │ └──constants +│ │ └──PlayerConstants.ets // 播放控制区常量类 +│ └──player/src/main/resources // 资源文件目录 +└──products // 产品定制层 + ├──phone/src/main/ets // 支持手机、平板 + │ ├──entryability + │ │ └──EntryAbility.ts // 程序入口类 + │ └──pages + │ └──MainPage.ets // 主界面 + └──phone/src/main/resources // 资源文件目录 +``` + +## 工程结构管理 + +在这个章节中,我们需要完成模块划分、梳理模块间依赖关系并设计代码结构,从而便于后续复杂项目的维护。参考上一章节页面设计,我们可以将页面分拆为多个组成部分: + +1. 标题栏 +2. 专辑封面 +3. 歌曲列表 +4. 播放控制区 + +![](figures/AlbumSMTag.PNG) + +工程结构建议如下: + +- 定义common层(公共能力层): + 用于存放项目的工具类、公共常量等。需编译成一个HAR包,只可以被products和features依赖,不可以反向依赖。 + +- 定义features层(基础特性层): + 用于存放相对独立的各个功能单元、自定义UI组件或业务实现逻辑,供产品灵活部署。不需要单独部署的feature通常编译为HAR包,供products或其它features使用。需要单独部署的feature通常编译为Feature类型的HAP包,和products下Entry类型的HAP包进行组合部署。features层可以横向调用及依赖common层,同时可以被products层不同设备形态的HAP所依赖,但是不能反向依赖products层。 + +- 定义products层(产品定制层): + 用于针对不同设备形态进行功能和特性集成。products层各个子目录分别编译为一个Entry类型的HAP包,作为应用的主入口,products层不可以横向调用。 + +本篇Codelab通过common层管理媒体查询工具类、栅格常量、公共常量等;按照页面分组,将标题栏定义为header基础特性,将专辑封面和歌曲列表定义为content基础特性,将播放控制区定义为player基础特性;定义phone产品目录支持手机、平板等设备,集成基础特性层的能力。products依赖features和common,features依赖common但不互相依赖,工程结构清晰且便于维护。 + +``` +├──common // 公共能力层 +├──features // 基础特性层 +│ ├──content // 专辑封面和歌曲列表内容区 +│ ├──header // 顶部标题栏 +│ └──player // 底部播放控制区 +└──products // 产品定制层 + └──phone // 支持手机、平板 +``` + + + +## 一次开发,多端部署实现方案 + +### 多标题栏 + +在这个章节中,我们需完成顶部标题栏的实现方案。不同设备的标题栏始终只显示“返回按钮”、“歌单”以及“更多按钮”,中间空白区域通过Blank组件填充,可实现自适应拉伸能力。效果如图所示: + +![](figures/AlbumSM-biaoti.PNG) + +```typescript +// Header.ets +@Component +export struct Header { + @StorageProp('fontSize') fontSize: number = 0; + + build() { + Row() { + Image($r('app.media.ic_back')) + .width($r('app.float.icon_width')) + .height($r('app.float.icon_height')) + .margin({ left: $r('app.float.icon_margin') }) + Text($r('app.string.play_list')) + .fontSize(this.fontSize + HeaderConstants.TITLE_FONT_SIZE_PLUS) + .fontWeight(HeaderConstants.TITLE_FONT_WEIGHT) + .fontColor($r('app.color.title_color')) + .opacity($r('app.float.title_opacity')) + .letterSpacing(HeaderConstants.LETTER_SPACING) + .padding({ left: $r('app.float.title_padding_left') }) + + Blank() + + Image($r('app.media.ic_more')) + .width($r('app.float.icon_width')) + .height($r('app.float.icon_height')) + .margin({ right: $r('app.float.icon_margin') }) + .bindMenu(this.getMenu()) + } + .width(StyleConstants.FULL_WIDTH) + .height($r('app.float.title_bar_height')) + .zIndex(HeaderConstants.Z_INDEX) + } +} +``` + +### 专辑封面 + +在这个章节中,我们需完成专辑封面的实现方案。专辑封面由图片、歌单介绍及常用操作(“收藏”“下载”“评论”“分享”)三部分组成,这三部分的布局可以用栅格实现。 + +- 在sm断点下,图片占4个栅格,歌单介绍占8个栅格,常用操作占12个栅格。 +- 在md断点下,图片、歌单介绍和常用操作分别占12个栅格。 +- 在lg断点下,图片、歌单介绍和常用操作分别占12个栅格。 + +![](figures/AlbumSM-fengmian.PNG) + +```typescript +// AlbumComponent.ets +@Component +export struct AlbumComponent { + @StorageProp('coverMargin') coverMargin: number = 0; + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm'; + + ... + build() { + Column() { + GridRow() { + GridCol({ + span: { sm: GridConstants.SPAN_FOUR, md: GridConstants.SPAN_TWELVE, lg: GridConstants.SPAN_TWELVE } + }) { + this.CoverImage() + } + + GridCol({ + span: { sm: GridConstants.SPAN_EIGHT, md: GridConstants.SPAN_TWELVE, lg: GridConstants.SPAN_TWELVE } + }) { + this.CoverIntroduction() + } + + GridCol({ + span: { sm: GridConstants.SPAN_TWELVE, md: GridConstants.SPAN_TWELVE, lg: GridConstants.SPAN_TWELVE } + }) { + this.CoverOptions() + } + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.option_margin') : 0, + bottom: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.option_margin') : 0 + }) + } + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + $r('app.float.cover_padding_top_sm') : $r('app.float.cover_padding_top_other') + }) + } + .margin({ + left: this.coverMargin, + right: this.coverMargin + }) + } +} +``` + +对于“收藏”、“下载”、“评论”、“分享”常用操作,通过设置容器组件的justifyContent属性为FlexAlign.SpaceEvenly,实现自适应均分能力。对于专辑图片,设置aspectRatio属性为1,Image组件宽高比固定为1:1,实现自适应缩放能力。 + +```typescript +// AlbumComponent.ets +@Component +export struct AlbumComponent { + ... + + @Builder + CoverImage() { + Stack({ alignContent: Alignment.BottomStart }) { + ... + } + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + .aspectRatio(ContentConstants.ASPECT_RATIO_ALBUM_COVER) + } + + ... + @Builder + CoverOptions() { + Row() { + ForEach(optionList, item => { + Column({ space: ContentConstants.COVER_OPTION_SPACE }) { + Image(item.image) + .height($r('app.float.option_image_size')) + .width($r('app.float.option_image_size')) + Text(item.text) + .fontColor($r('app.color.album_name_introduction')) + .fontSize(this.fontSize - 1) + } + }) + } + .height($r('app.float.option_area_height')) + .width(StyleConstants.FULL_WIDTH) + .justifyContent(FlexAlign.SpaceEvenly) + } +} +``` + +### 歌曲列表 + +在这个章节中,我们需完成歌曲列表的实现方案。对于不同屏幕尺寸的设备,歌单列表的样式基本一致,但sm和md断点下的歌曲列表是单列显示,lg断点下的歌曲列表是双列显示。可以通过List组件的lanes属性实现这一效果。效果如图所示: + +![](figures/AlbumSM-liebiao.PNG) + +```typescript +// PlayList.ets +@Component +export struct PlayList { + @Consume coverHeight: number; + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm'; + @StorageProp('fontSize') fontSize: number = 0; + + ... + build() { + Column() { + this.PlayAll() + List() { + LazyForEach(new SongDataSource(songList), (item: SongItem) => { + ListItem() { + Column() { + this.SongItem(item.title, item.label, item.singer) + Divider() + .strokeWidth(ContentConstants.DIVIDER_STROKE_WIDTH) + .color($r('app.color.black')) + .opacity($r('app.float.divider_opacity')) + } + .padding({ + left: $r('app.float.list_item_padding'), + right: $r('app.float.list_item_padding') + }) + } + }, (item, index) => JSON.stringify(item) + index) + } + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + .backgroundColor($r('app.color.white')) + .margin({ top: $r('app.float.list_area_margin_top') }) + .lanes(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + ContentConstants.COL_TWO : ContentConstants.COL_ONE) + } + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? 0 : $r('app.float.list_area_padding_top'), + bottom: $r('app.float.list_area_padding_bottom') + }) + } + ... + } +} +``` + +### 播放控制区 + +在这个章节中,我们需完成底部播放控制区的实现方案。对于不同屏幕尺寸的设备,播放控制区显示的内容有差异,sm断点仅显示播放按钮,md断点显示上一首、播放和下一首按钮,lg断点显示收藏、上一首、播放、下一首、列表按钮,可以分别设置按钮的displayPriority属性,通过自适应隐藏能力实现。同时,歌曲信息与播放控制按钮之间通过Blank组件自动填充,实现自适应拉伸能力。效果如图所示: + +![](figures/AlbumSM-kongzhiqu.PNG) + +```typescript +// Player.ets +@Component +export struct Player { + ... + + build() { + Row() { + ... + + Blank() + + Row() { + Image($r('app.media.ic_favorite')) + ... + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_ONE) + Image($r('app.media.ic_previous')) + ... + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_TWO) + Image($r('app.media.ic_pause')) + ... + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_THREE) + Image($r('app.media.ic_next')) + ... + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_TWO) + Image($r('app.media.ic_music_list')) + ... + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_ONE) + } + .layoutWeight(PlayerConstants.LAYOUT_WEIGHT_PLAYER_CONTROL) + .justifyContent(FlexAlign.End) + } + ... + } +} +``` + +### 特性集成 + +在这个章节中,我们将标题栏(header基础特性)、专辑内容(content基础特性)、播放控制区(player基础特性)集成到一起,作为应用的主入口。同时,后续项目如果新增更多的产品例如穿戴设备、智慧屏等,可定义新的products产品、自由集成不同的features基础特性,从而达成代码尽量复用、产品自由定制的目标。 + +```typescript +// MainPage.ets +@Component +struct MainPage { + ... + + build() { + Stack({ alignContent: Alignment.Top }) { + Header() + Content() + Player() + } + ... +} +``` + +## 解决系统能力差异的兼容性问题 + +前面章节主要介绍了如何解决页面适配、工程管理的问题,本章节主要介绍应用如何解决设备系统能力差异的兼容问题。 + +我们以一个简单例子说明:一个具有音频设备管理功能的应用,如何兼容地运行在有音频设备管理和无音频设备管理系统能力的设备上。 + +从开发到用户安装、运行,一般要经历几个阶段:应用分发和下载->应用安装->应用运行,要解决上面提到的兼容问题,一般有如下几种解决思路: + +1. 分发和下载:有音频设备管理设备的用户才能在应用市场可见该应用,供用户下载。 +2. 安装:有音频设备管理能力的设备才允许安装该应用。 +3. 运行:在运行阶段通过动态判断方式,在有音频设备管理设备上功能运行正常,在无音频设备管理设备上运行不发生Crash。 + +所以,对应的解决方案就有: + +1. 在分发阶段,上架的应用使用的系统能力是设备系统能力的子集。满足这个条件,用户才能在应用市场看到该应用。 +2. 在安装阶段,安装的应用调用的系统能力是设备系统能力的子集。满足这个条件,用户才能安装该应用。 +3. 通过canIUse接口判断是否支持某个系统能力。 + +本篇Codelab以音频设备管理为例,仅介绍canIUse接口判断的方式。点击右上角更多,如果当前系统支持音频设备管理能力,则显示“音频设备管理”菜单选项,否则不显示。 + +```typescript +// Header.ets +@Component +export struct Header { + ... + + getMenu(): MenuData[] { + let menuItem: MenuData = new MenuData(); + let menuDatas: MenuData[] = []; + if (canIUse(HeaderConstants.SYSCAP_ETHERNET)) { + menuItem.value = HeaderConstants.AUDIO_DEVICE_SERVICE; + menuItem.action = () => { + promptAction.showToast({ + message: HeaderConstants.AUDIO_DEVICE_SERVICE, + duration: HeaderConstants.TOAST_DURATION + }); + }; + menuDatas.push(menuItem); + } + return menuDatas; + } +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 如何针对不同屏幕尺寸的设备完成一次开发,多端部署的方案设计。 +2. 如何按照合理的工程结构划分模块、组织代码。 +3. 通过自适应布局和响应式布局方案实现一次开发,多端部署。 +4. 通过运行时判断解决系统能力差异的兼容性问题。 + +![](figures/Finish.gif) \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/build-profile.json5 b/ExcellentCase/MultiDeviceMusic/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9f1ed2b983cca76812508af4e546a0147114af56 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/build-profile.json5 @@ -0,0 +1,42 @@ +{ + "app": { + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "phone", + "srcPath": "./products/phone", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "common", + "srcPath": "./common" + }, + { + "name": "content", + "srcPath": "./features/content" + }, + { + "name": "player", + "srcPath": "./features/player" + }, + { + "name": "header", + "srcPath": "./features/header" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/build-profile.json5 b/ExcellentCase/MultiDeviceMusic/common/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..79961f96a6fe0507354b7952a378c3be2ae4bfab --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/common/hvigorfile.ts b/ExcellentCase/MultiDeviceMusic/common/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/MultiDeviceMusic/common/index.ets b/ExcellentCase/MultiDeviceMusic/common/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6466dbafb1d41cfdd58d051aa207161db26a686 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/index.ets @@ -0,0 +1,5 @@ +export { BreakpointSystem } from './src/main/ets/utils/BreakpointSystem'; +export { MenuData } from './src/main/ets/bean/MenuData'; +export { BreakpointConstants } from './src/main/ets/constants/BreakpointConstants'; +export { StyleConstants } from './src/main/ets/constants/StyleConstants'; +export { GridConstants } from './src/main/ets/constants/GridConstants'; \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/oh-package.json5 b/ExcellentCase/MultiDeviceMusic/common/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0e5843c1d90e2ff6abd207d7f42d5aac15a18880 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "ISC", + "types": "", + "devDependencies": {}, + "name": "@ohos/common", + "description": "a npm package which contains arkUI2.0 page", + "main": "index.ets", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ExcellentCase/MultiDeviceMusic/common/src/main/ets/bean/MenuData.ets b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/bean/MenuData.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0c01bee5465b229403aba5b3d3f1b9ca38c691e --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/bean/MenuData.ets @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Menu item info. + */ +export class MenuData { + + /** + * Indicates menu title. + */ + value: string; + + /** + * Indicates menu action. + */ + action: () => void; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/BreakpointConstants.ets b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/BreakpointConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..0da3611ee0bd28c8fa4ed114c9b86a73ebbb22f6 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/BreakpointConstants.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for breakpoint. + */ +export class BreakpointConstants { + /** + * Breakpoints that represent small device types. + */ + static readonly BREAKPOINT_SM: string = 'sm'; + + /** + * Breakpoints that represent middle device types. + */ + static readonly BREAKPOINT_MD: string = 'md'; + + /** + * Breakpoints that represent large device types. + */ + static readonly BREAKPOINT_LG: string = 'lg'; + + /** + * Current breakpoints that to query the device types. + */ + static readonly CURRENT_BREAKPOINT: string = 'currentBreakpoint'; + + /** + * Font size of the current device types. + */ + static readonly FONT_SIZE: string = 'fontSize'; + + /** + * Album cover margin for the current device type. + */ + static readonly COVER_MARGIN: string = 'coverMargin'; + + /** + * Font size of the small device type. + */ + static readonly FONT_SIZE_SM: number = 14; + + /** + * Font size of the middle device type. + */ + static readonly FONT_SIZE_MD: number = 16; + + /** + * Font size of the large device type. + */ + static readonly FONT_SIZE_LG: number = 18; + + /** + * Cover margin of the small device type. + */ + static readonly COVER_MARGIN_SM: number = 10; + + /** + * Cover margin of the middle device type. + */ + static readonly COVER_MARGIN_MD: number = 30; + + /** + * Cover margin of the large device type. + */ + static readonly COVER_MARGIN_LG: number = 40; + + /** + * Range of the small device width. + */ + static readonly RANGE_SM: string = '(320vp<=width<600vp)'; + + /** + * Range of the middle device width. + */ + static readonly RANGE_MD: string = '(600vp<=width<840vp)'; + + /** + * Range of the large device width. + */ + static readonly RANGE_LG: string = '(840vp<=width)'; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/GridConstants.ets b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/GridConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..c68608c75cbaa23f170d1359c2674e23a3828b65 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/GridConstants.ets @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for Grid components. + */ +export class GridConstants { + /** + * Current component width: 4 grids. + */ + static readonly SPAN_FOUR: number = 4; + + /** + * Current component width: 6 grids. + */ + static readonly SPAN_SIX: number = 6; + + /** + * Current component width: 8 grids. + */ + static readonly SPAN_EIGHT: number = 8; + + /** + * Current component width: 12 grids. + */ + static readonly SPAN_TWELVE: number = 12; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/StyleConstants.ets b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/StyleConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..f526374892f1f2bc8ee56dd1ca6592817e6d74b5 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/constants/StyleConstants.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for common style. + */ +export class StyleConstants { + /** + * Component width percentage: 100%. + */ + static readonly FULL_WIDTH: string = '100%'; + + /** + * Component height percentage: 100%. + */ + static readonly FULL_HEIGHT: string = '100%'; + + /** + * Translate value of the collection text. + */ + static readonly TRANSLATE_X: number = 10; + + /** + * Translate value of the number of playbacks. + */ + static readonly TRANSLATE_Y: string = '-100%'; + + /** + * Translate value of the player area on the bottom. + */ + static readonly TRANSLATE_PLAYER_Y: string = '-48vp'; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/src/main/ets/utils/BreakpointSystem.ets b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/utils/BreakpointSystem.ets new file mode 100644 index 0000000000000000000000000000000000000000..23acc4eb369ca5942210c22ef2e6256f861576ed --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/src/main/ets/utils/BreakpointSystem.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device 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 mediaQuery from '@ohos.mediaquery'; +import { BreakpointConstants } from '../constants/BreakpointConstants'; + +export class BreakpointSystem { + private currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + private smListener: mediaQuery.MediaQueryListener; + private mdListener: mediaQuery.MediaQueryListener; + private lgListener: mediaQuery.MediaQueryListener; + + private updateCurrentBreakpoint(breakpoint: string): void { + if (this.currentBreakpoint !== breakpoint) { + this.currentBreakpoint = breakpoint; + AppStorage.Set(BreakpointConstants.CURRENT_BREAKPOINT, this.currentBreakpoint); + } + } + + private isBreakpointSM = (mediaQueryResult: mediaQuery.MediaQueryResult): void => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(BreakpointConstants.BREAKPOINT_SM); + AppStorage.Set(BreakpointConstants.FONT_SIZE, BreakpointConstants.FONT_SIZE_SM); + AppStorage.Set(BreakpointConstants.COVER_MARGIN, BreakpointConstants.COVER_MARGIN_SM); + } + } + private isBreakpointMD = (mediaQueryResult: mediaQuery.MediaQueryResult): void => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(BreakpointConstants.BREAKPOINT_MD); + AppStorage.Set(BreakpointConstants.FONT_SIZE, BreakpointConstants.FONT_SIZE_MD); + AppStorage.Set(BreakpointConstants.COVER_MARGIN, BreakpointConstants.COVER_MARGIN_MD); + } + } + private isBreakpointLG = (mediaQueryResult: mediaQuery.MediaQueryResult): void => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(BreakpointConstants.BREAKPOINT_LG); + AppStorage.Set(BreakpointConstants.FONT_SIZE, BreakpointConstants.FONT_SIZE_LG); + AppStorage.Set(BreakpointConstants.COVER_MARGIN, BreakpointConstants.COVER_MARGIN_LG); + } + } + + public register(): void { + this.smListener = mediaQuery.matchMediaSync(BreakpointConstants.RANGE_SM); + this.smListener.on('change', this.isBreakpointSM); + this.mdListener = mediaQuery.matchMediaSync(BreakpointConstants.RANGE_MD); + this.mdListener.on('change', this.isBreakpointMD); + this.lgListener = mediaQuery.matchMediaSync(BreakpointConstants.RANGE_LG); + this.lgListener.on('change', this.isBreakpointLG); + } + + public unregister(): void { + this.smListener.off('change', this.isBreakpointSM); + this.mdListener.off('change', this.isBreakpointMD); + this.lgListener.off('change', this.isBreakpointLG); + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/common/src/main/module.json5 b/ExcellentCase/MultiDeviceMusic/common/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3a26ade95efbe0e73d8a7223935b9538cb70684e --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/common/src/main/module.json5 @@ -0,0 +1,10 @@ +{ + "module": { + "name": "common", + "type": "har", + "deviceTypes": [ + "default", + "tablet" + ] + } +} diff --git a/ExcellentCase/MultiDeviceMusic/features/content/build-profile.json5 b/ExcellentCase/MultiDeviceMusic/features/content/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..79961f96a6fe0507354b7952a378c3be2ae4bfab --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/content/hvigorfile.ts b/ExcellentCase/MultiDeviceMusic/features/content/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/MultiDeviceMusic/features/content/index.ets b/ExcellentCase/MultiDeviceMusic/features/content/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f840ca4a31509e846a48f977c90c01b552962a23 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/index.ets @@ -0,0 +1 @@ +export { Content } from './src/main/ets/components/Content'; \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/oh-package.json5 b/ExcellentCase/MultiDeviceMusic/features/content/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..847bd8b2ecb8255da0b48655d6030d23301c250d --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "ISC", + "types": "", + "devDependencies": {}, + "name": "@ohos/content", + "description": "a npm package which contains arkUI2.0 page", + "main": "index.ets", + "version": "1.0.0", + "dependencies": { + "@ohos/common": "../../common" + } +} diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/AlbumComponent.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/AlbumComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..adc1c7fc734a7d46301c2891eda09d2cfe2dda1a --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/AlbumComponent.ets @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { StyleConstants } from '@ohos/common'; +import { BreakpointConstants } from '@ohos/common'; +import { GridConstants } from '@ohos/common'; +import { optionList } from '../viewmodel/SongListData'; +import type { OptionItem } from '../viewmodel/SongListData'; +import { ContentConstants } from '../constants/ContentConstants'; + +@Component +export struct AlbumComponent { + @State imgHeight: number = 0; + @StorageProp('coverMargin') coverMargin: number = 0; + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm'; + @StorageProp('fontSize') fontSize: number = 0; + + @Builder + CoverImage() { + Stack({ alignContent: Alignment.BottomStart }) { + Image($r('app.media.ic_album')) + .width(StyleConstants.FULL_WIDTH) + .aspectRatio(ContentConstants.ASPECT_RATIO_ALBUM_COVER) + .borderRadius($r('app.float.album_cover_border_radius')) + .onAreaChange((oldArea: Area, newArea: Area) => { + this.imgHeight = newArea.height as number; + }) + Text($r('app.string.collection_num')) + .letterSpacing(ContentConstants.LETTER_SPACING) + .fontColor($r('app.color.white')) + .fontSize(this.fontSize - ContentConstants.SINGER_FONT_REDUCE) + .translate({ + x: StyleConstants.TRANSLATE_X, + y: StyleConstants.TRANSLATE_Y + }) + } + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + .aspectRatio(ContentConstants.ASPECT_RATIO_ALBUM_COVER) + } + + @Builder + CoverIntroduction() { + Column() { + Text($r('app.string.list_name')) + .opacity($r('app.float.album_name_opacity')) + .fontWeight(ContentConstants.ALBUM_FONT_WEIGHT) + .fontColor($r('app.color.album_name_introduction')) + .fontSize(this.fontSize + ContentConstants.ALBUM_FONT_PLUS) + .margin({ bottom: $r('app.float.album_name_margin') }) + + Text($r('app.string.playlist_Introduction')) + .opacity($r('app.float.introduction_opacity')) + .width(StyleConstants.FULL_WIDTH) + .fontWeight(ContentConstants.INTRODUCTION_FONT_WEIGHT) + .fontColor($r('app.color.album_name_introduction')) + .fontSize(this.fontSize - ContentConstants.INTRODUCTION_FONT_REDUCE) + } + .width(StyleConstants.FULL_WIDTH) + .height(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + this.imgHeight : $r('app.float.introduction_height')) + .alignItems(HorizontalAlign.Start) + .justifyContent(FlexAlign.Center) + .padding({ + left: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.introduction_padding') : 0 + }) + .margin({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? 0 : $r('app.float.introduction_margin_top'), + bottom: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + 0 : $r('app.float.introduction_margin_bottom') + }) + } + + @Builder + CoverOptions() { + Row() { + ForEach(optionList, (item: OptionItem) => { + Column({ space: ContentConstants.COVER_OPTION_SPACE }) { + Image(item.image) + .height($r('app.float.option_image_size')) + .width($r('app.float.option_image_size')) + Text(item.text) + .fontColor($r('app.color.album_name_introduction')) + .fontSize(this.fontSize - 1) + } + }) + } + .height($r('app.float.option_area_height')) + .width(StyleConstants.FULL_WIDTH) + .justifyContent(FlexAlign.SpaceEvenly) + } + + build() { + Column() { + GridRow() { + GridCol({ + span: { sm: GridConstants.SPAN_FOUR, md: GridConstants.SPAN_TWELVE, lg: GridConstants.SPAN_TWELVE } + }) { + this.CoverImage() + } + + GridCol({ + span: { sm: GridConstants.SPAN_EIGHT, md: GridConstants.SPAN_TWELVE, lg: GridConstants.SPAN_TWELVE } + }) { + this.CoverIntroduction() + } + + GridCol({ + span: { sm: GridConstants.SPAN_TWELVE, md: GridConstants.SPAN_TWELVE, lg: GridConstants.SPAN_TWELVE } + }) { + this.CoverOptions() + } + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.option_margin') : 0, + bottom: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.option_margin') : 0 + }) + } + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + $r('app.float.cover_padding_top_sm') : $r('app.float.cover_padding_top_other') + }) + } + .margin({ + left: this.coverMargin, + right: this.coverMargin + }) + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/AlbumCover.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/AlbumCover.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e86a56b8ed138b3185fdb6f89f904c2f2d3b7ee --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/AlbumCover.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { StyleConstants } from '@ohos/common'; +import { BreakpointConstants } from '@ohos/common'; +import { AlbumComponent } from './AlbumComponent'; + +@Component +export struct AlbumCover { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm'; + + build() { + if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM) { + AlbumComponent() + } else { + AlbumComponent() + .height(StyleConstants.FULL_HEIGHT) + } + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/Content.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/Content.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a4f7a3d57d7d5dd95493d9ee5a3cead3e98baf4 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/Content.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { GridConstants } from '@ohos/common'; +import { StyleConstants } from '@ohos/common'; +import { AlbumCover } from './AlbumCover'; +import { PlayList } from './PlayList'; + +@Component +export struct Content { + + build() { + GridRow() { + GridCol({ span: { sm: GridConstants.SPAN_TWELVE, md: GridConstants.SPAN_SIX, lg: GridConstants.SPAN_FOUR } }) { + AlbumCover() + } + .backgroundColor($r('app.color.album_background')) + + GridCol({ span: { sm: GridConstants.SPAN_TWELVE, md: GridConstants.SPAN_SIX, lg: GridConstants.SPAN_EIGHT } }) { + PlayList() + } + .borderRadius($r('app.float.playlist_border_radius')) + } + .height(StyleConstants.FULL_HEIGHT) + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/PlayList.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/PlayList.ets new file mode 100644 index 0000000000000000000000000000000000000000..8e689c90dd1304fc22e2a57c9127e881305b50fd --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/components/PlayList.ets @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { StyleConstants } from '@ohos/common'; +import { BreakpointConstants } from '@ohos/common'; +import { songList } from '../viewmodel/SongListData'; +import { SongDataSource, SongItem } from '../viewmodel/SongDataSource'; +import { ContentConstants } from '../constants/ContentConstants'; + +@Component +export struct PlayList { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm'; + @StorageProp('fontSize') fontSize: number = 0; + + @Builder + PlayAll() { + Row() { + Image($r("app.media.ic_play_all")) + .height($r('app.float.play_all_icon_size')) + .width($r('app.float.play_all_icon_size')) + Text($r('app.string.play_all')) + .maxLines(ContentConstants.PLAY_ALL_MAX_LINES) + .padding({ left: $r('app.float.play_all_text_padding') }) + .fontColor($r('app.color.black')) + .fontSize(this.fontSize) + Blank() + Image($r('app.media.ic_order_play')) + .width($r('app.float.order_icon_size')) + .height($r('app.float.order_icon_size')) + .margin({ right: $r('app.float.order_icon_margin') }) + Image($r('app.media.ic_sort_list')) + .height($r('app.float.order_icon_size')) + .width($r('app.float.order_icon_size')) + } + .height($r('app.float.play_all_area_height')) + .width(StyleConstants.FULL_WIDTH) + .backgroundColor($r('app.color.white')) + .padding({ + left: $r('app.float.play_all_area_padding'), + right: $r('app.float.play_all_area_padding') + }) + .borderRadius({ + topRight: $r('app.float.play_all_border_radius'), + topLeft: $r('app.float.play_all_border_radius') + }) + .position({ x: 0, y: 0 }) + } + + @Builder + SongItem(title: string, label: Resource, singer: string) { + Row() { + Column() { + Text(title) + .fontColor($r('app.color.black')) + .fontSize(this.fontSize) + .margin({ bottom: $r('app.float.list_item_title_margin') }) + Row() { + Image(label) + .width($r('app.float.list_item_image_size')) + .height($r('app.float.list_item_image_size')) + .margin({ right: $r('app.float.list_item_image_margin') }) + Text(singer) + .opacity($r('app.float.singer_opacity')) + .fontColor($r('app.color.black')) + .fontSize(this.fontSize - ContentConstants.SINGER_FONT_REDUCE) + } + } + .alignItems(HorizontalAlign.Start) + + Blank() + Image($r('app.media.ic_list_more')) + .height($r('app.float.order_icon_size')) + .width($r('app.float.order_icon_size')) + } + .height($r('app.float.list_item_height')) + .width(StyleConstants.FULL_WIDTH) + } + + build() { + Column() { + this.PlayAll() + List() { + LazyForEach(new SongDataSource(songList), (item: SongItem) => { + ListItem() { + Column() { + this.SongItem(item.title, item.label, item.singer) + Divider() + .strokeWidth(ContentConstants.DIVIDER_STROKE_WIDTH) + .color($r('app.color.black')) + .opacity($r('app.float.divider_opacity')) + } + .padding({ + left: $r('app.float.list_item_padding'), + right: $r('app.float.list_item_padding') + }) + } + }, (item, index) => JSON.stringify(item) + index) + } + .width(StyleConstants.FULL_WIDTH) + .height(StyleConstants.FULL_HEIGHT) + .backgroundColor($r('app.color.white')) + .margin({ top: $r('app.float.list_area_margin_top') }) + .lanes(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + ContentConstants.COL_TWO : ContentConstants.COL_ONE) + .layoutWeight(1) + } + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? 0 : $r('app.float.list_area_padding_top'), + bottom: $r('app.float.list_area_padding_bottom') + }) + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/constants/ContentConstants.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/constants/ContentConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4175d1f62a7519b34fe6ccd91ac68004f66f991 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/constants/ContentConstants.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for main content area. + */ +export class ContentConstants { + /** + * The max lines of play all area is 1. + */ + static readonly PLAY_ALL_MAX_LINES: number = 1; + + /** + * The font size of the singer is smaller. + */ + static readonly SINGER_FONT_REDUCE: number = 4; + + /** + * The font size of the album name is larger. + */ + static readonly ALBUM_FONT_PLUS: number = 2; + + /** + * The font size of the introduction is smaller. + */ + static readonly INTRODUCTION_FONT_REDUCE: number = 2; + + /** + * Width of the list item divider. + */ + static readonly DIVIDER_STROKE_WIDTH: number = 0.5; + + /** + * Aspect ratio of the album cover image. + */ + static readonly ASPECT_RATIO_ALBUM_COVER: number = 1; + + /** + * Letter spacing. + */ + static readonly LETTER_SPACING: number = 1; + + /** + * Font weight of the album title. + */ + static readonly ALBUM_FONT_WEIGHT: number = 500; + + /** + * Font weight of the album introduction. + */ + static readonly INTRODUCTION_FONT_WEIGHT: number = 400; + + /** + * Space between cover options. + */ + static readonly COVER_OPTION_SPACE: number = 4; + + /** + * Value of lanes is 2. + */ + static readonly COL_TWO: number = 2; + + /** + * Value of lanes is 1. + */ + static readonly COL_ONE: number = 1; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/viewmodel/SongDataSource.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/viewmodel/SongDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..4fc3ffab0bb33045ebbb0d6766069f36fe0fed52 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/viewmodel/SongDataSource.ets @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export type SongItem = { + id: number, + title: string, + singer: string, + label: Resource +} + +export class SongDataSource implements IDataSource { + private dataArray: SongItem[] = []; + private listeners: DataChangeListener[] = []; + + constructor(element: SongItem[]) { + for (let index = 0; index < element.length; index++) { + this.dataArray.push(element[index]); + } + } + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): SongItem { + return this.dataArray[index]; + } + + public addData(index: number, data: SongItem): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: SongItem): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }); + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/viewmodel/SongListData.ets b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/viewmodel/SongListData.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1505272d92ca6888bca4f92da6f8cca3bbef3b5 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/viewmodel/SongListData.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +const songList = [ + { id: 1, title: '不知道', singer: '小碗你好', label: $r('app.media.ic_vip') }, + { id: 2, title: '歌名你好', singer: '张三-你好我好都好', label: $r('app.media.ic_SQ') }, + { id: 3, title: '还是歌名', singer: '不知道你是谁', label: $r('app.media.ic_SQ') }, + { id: 4, title: 'AIUHGVNHK', singer: 'Gwyu-Hjjiyabn', label: $r('app.media.ic_SQ') }, + { id: 5, title: '可可不喜欢', singer: '名佚', label: $r('app.media.ic_SQ') }, + { id: 6, title: '我是UOUYGBJ', singer: '我是小树', label: $r('app.media.ic_SQ') }, + { id: 7, title: '好好学习', singer: '全村最帅', label: $r('app.media.ic_SQ') }, + { id: 8, title: '安心安心', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 9, title: 'HBNJGHJHB', singer: '我是小树', label: $r('app.media.ic_SQ') }, + { id: 10, title: '安心安心', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 11, title: 'Notebook', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 12, title: '不知道', singer: '小碗你好', label: $r('app.media.ic_vip') }, + { id: 13, title: '歌名你好', singer: '张三-你好我好都好', label: $r('app.media.ic_SQ') }, + { id: 14, title: '还是歌名', singer: '不知道你是谁', label: $r('app.media.ic_SQ') }, + { id: 15, title: 'AIUHGVNHK', singer: 'Gwyu-Hjjiyabn', label: $r('app.media.ic_SQ') }, + { id: 16, title: '可可不喜欢', singer: '名佚', label: $r('app.media.ic_SQ') }, + { id: 17, title: '我是UOUYGBJ', singer: '我是小树', label: $r('app.media.ic_SQ') }, + { id: 18, title: '好好学习', singer: '全村最帅', label: $r('app.media.ic_SQ') }, + { id: 19, title: '安心安心', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 20, title: 'HBNJGHJHB', singer: '我是小树', label: $r('app.media.ic_SQ') }, + { id: 21, title: '安心安心', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 23, title: 'Notebook', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 24, title: '安心安心', singer: '小安安', label: $r('app.media.ic_SQ') }, + { id: 25, title: 'Notebook', singer: '小安安', label: $r('app.media.ic_SQ') } +] + +const optionList : OptionItem[] = [ + { image: $r('app.media.ic_collect'), text: $r('app.string.collect') }, + { image: $r('app.media.ic_download'), text: $r('app.string.download') }, + { image: $r("app.media.ic_comments"), text: $r('app.string.comment') }, + { image: $r("app.media.ic_share"), text: $r('app.string.share') } +] + +type OptionItem = { + image: Resource; + text: Resource; +} + +export { songList, optionList, OptionItem } \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/module.json5 b/ExcellentCase/MultiDeviceMusic/features/content/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..061af57f4fe1e96901df6174b4eb27a30659c7d2 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/module.json5 @@ -0,0 +1,10 @@ +{ + "module": { + "name": "content", + "type": "har", + "deviceTypes": [ + "default", + "tablet" + ] + } +} diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/color.json b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..31e30cb4b63c32fc7c4f68c71fc0141751d6d2c1 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/color.json @@ -0,0 +1,20 @@ +{ + "color": [ + { + "name": "album_background", + "value": "#e4ecf7" + }, + { + "name": "black", + "value": "#000000" + }, + { + "name": "white", + "value": "#fff" + }, + { + "name": "album_name_introduction", + "value": "#556B89" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/float.json b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..a47bd731d3ae98f6f4aab1aa2afdfb616bc41afa --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/float.json @@ -0,0 +1,128 @@ +{ + "float": [ + { + "name": "playlist_border_radius", + "value": "40vp" + }, + { + "name": "play_all_icon_size", + "value": "23vp" + }, + { + "name": "play_all_text_padding", + "value": "10vp" + }, + { + "name": "order_icon_size", + "value": "24vp" + }, + { + "name": "order_icon_margin", + "value": "16vp" + }, + { + "name": "play_all_area_height", + "value": "60vp" + }, + { + "name": "play_all_area_padding", + "value": "12vp" + }, + { + "name": "play_all_border_radius", + "value": "20vp" + }, + { + "name": "list_item_title_margin", + "value": "4vp" + }, + { + "name": "list_item_image_size", + "value": "16vp" + }, + { + "name": "list_item_image_margin", + "value": "4vp" + }, + { + "name": "list_item_height", + "value": "60vp" + }, + { + "name": "list_item_padding", + "value": "14vp" + }, + { + "name": "list_area_margin_top", + "value": "60vp" + }, + { + "name": "singer_opacity", + "value": "0.38" + }, + { + "name": "divider_opacity", + "value": "0.1" + }, + { + "name": "list_area_padding_top", + "value": "50vp" + }, + { + "name": "list_area_padding_bottom", + "value": "48vp" + }, + { + "name": "album_cover_border_radius", + "value": "8vp" + }, + { + "name": "album_name_opacity", + "value": "0.9" + }, + { + "name": "album_name_margin", + "value": "10vp" + }, + { + "name": "introduction_opacity", + "value": "0.6" + }, + { + "name": "introduction_height", + "value": "70vp" + }, + { + "name": "introduction_padding", + "value": "20vp" + }, + { + "name": "introduction_margin_top", + "value": "30vp" + }, + { + "name": "introduction_margin_bottom", + "value": "20vp" + }, + { + "name": "option_image_size", + "value": "30vp" + }, + { + "name": "option_area_height", + "value": "70vp" + }, + { + "name": "option_margin", + "value": "15vp" + }, + { + "name": "cover_padding_top_sm", + "value": "50vp" + }, + { + "name": "cover_padding_top_other", + "value": "70vp" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/string.json b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..847b4473a87f51b72d0d8a68b9daa79dae8625a2 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "collection_num", + "value": "125000" + }, + { + "name": "list_name", + "value": "Independent folk" + }, + { + "name": "playlist_Introduction", + "value": "The set list is a selection of popular folk songs." + }, + { + "name": "play_all", + "value": "Play all(104)" + }, + { + "name": "collect", + "value": "999+" + }, + { + "name": "download", + "value": "download" + }, + { + "name": "comment", + "value": "comment" + }, + { + "name": "share", + "value": "share" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_SQ.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_SQ.svg new file mode 100644 index 0000000000000000000000000000000000000000..1ca33803efecffa4e3b20ecfde7dfc6829872cf3 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_SQ.svg @@ -0,0 +1,7 @@ + + + icon_SQ + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_album.png b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_album.png new file mode 100644 index 0000000000000000000000000000000000000000..a7e68c33bd077f429174cec25b030c805fdeb55c Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_album.png differ diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_collect.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_collect.svg new file mode 100644 index 0000000000000000000000000000000000000000..a3f144a24d14402d314ad9df9ceba0620904f423 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_collect.svg @@ -0,0 +1,7 @@ + + + icon_collect + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_comments.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_comments.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d2fc29d42f43082d07233a84910b8b95b8adcef --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_comments.svg @@ -0,0 +1,13 @@ + + + icon_review + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_download.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_download.svg new file mode 100644 index 0000000000000000000000000000000000000000..4ac6c0232ac12f30d1fa4e1e3ae98196f28134fd --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_download.svg @@ -0,0 +1,7 @@ + + + icon_download + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_list_more.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_list_more.svg new file mode 100644 index 0000000000000000000000000000000000000000..15d942cc933b31a7a94e0655a7f00d7d258d4173 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_list_more.svg @@ -0,0 +1,13 @@ + + + ic_list_more + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_order_play.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_order_play.svg new file mode 100644 index 0000000000000000000000000000000000000000..17086c1e537b6e79ea3600e552d2f5b5b2dbac10 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_order_play.svg @@ -0,0 +1,7 @@ + + + ic_order_play + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_play_all.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_play_all.svg new file mode 100644 index 0000000000000000000000000000000000000000..23e09ccf3aae3480238d6364e0a741a98678d7e9 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_play_all.svg @@ -0,0 +1,10 @@ + + + ic_detail_play_all + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_share.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_share.svg new file mode 100644 index 0000000000000000000000000000000000000000..aaa05519d375a0170cc18faf6b05aff12b70ec56 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_share.svg @@ -0,0 +1,13 @@ + + + icon_share + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_sort_list.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_sort_list.svg new file mode 100644 index 0000000000000000000000000000000000000000..77cd7de67701e5e8b8b6630a0d6827fe3a15a069 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_sort_list.svg @@ -0,0 +1,7 @@ + + + ic_sort_list + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_vip.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_vip.svg new file mode 100644 index 0000000000000000000000000000000000000000..1b0561309697f7045a8f05e6f986e23848111f97 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/base/media/ic_vip.svg @@ -0,0 +1,7 @@ + + + icon_vip + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/en_US/element/string.json b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..847b4473a87f51b72d0d8a68b9daa79dae8625a2 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/en_US/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "collection_num", + "value": "125000" + }, + { + "name": "list_name", + "value": "Independent folk" + }, + { + "name": "playlist_Introduction", + "value": "The set list is a selection of popular folk songs." + }, + { + "name": "play_all", + "value": "Play all(104)" + }, + { + "name": "collect", + "value": "999+" + }, + { + "name": "download", + "value": "download" + }, + { + "name": "comment", + "value": "comment" + }, + { + "name": "share", + "value": "share" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/phone/media/ic_play_all.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/phone/media/ic_play_all.svg new file mode 100644 index 0000000000000000000000000000000000000000..23e09ccf3aae3480238d6364e0a741a98678d7e9 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/phone/media/ic_play_all.svg @@ -0,0 +1,10 @@ + + + ic_detail_play_all + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/tablet/media/ic_play_all.svg b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/tablet/media/ic_play_all.svg new file mode 100644 index 0000000000000000000000000000000000000000..78b90aeb5c232d2ac66a5b1076f30a1a3b948319 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/tablet/media/ic_play_all.svg @@ -0,0 +1,10 @@ + + + ic_detail_play_all + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/zh_CN/element/string.json b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4a361d1af3f164ccda38d337f781766477711121 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/content/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,36 @@ +{ + "string": [ + { + "name": "collection_num", + "value": "12.5万" + }, + { + "name": "list_name", + "value": "独立民谣" + }, + { + "name": "playlist_Introduction", + "value": "歌单选取了一些比较受关注的民谣歌曲。" + }, + { + "name": "play_all", + "value": "播放全部(104)" + }, + { + "name": "collect", + "value": "999+" + }, + { + "name": "download", + "value": "下载" + }, + { + "name": "comment", + "value": "评论" + }, + { + "name": "share", + "value": "分享" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/header/build-profile.json5 b/ExcellentCase/MultiDeviceMusic/features/header/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..79961f96a6fe0507354b7952a378c3be2ae4bfab --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/header/hvigorfile.ts b/ExcellentCase/MultiDeviceMusic/features/header/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/MultiDeviceMusic/features/header/index.ets b/ExcellentCase/MultiDeviceMusic/features/header/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..128aaed33cd987abbc42ef2b026a465350b472cf --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/index.ets @@ -0,0 +1 @@ +export { Header } from './src/main/ets/components/Header'; \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/oh-package.json5 b/ExcellentCase/MultiDeviceMusic/features/header/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..a3be8f663193c3778284e105c902469520b6897d --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "ISC", + "types": "", + "devDependencies": {}, + "name": "header", + "description": "a npm package which contains arkUI2.0 page", + "main": "index.ets", + "version": "1.0.0", + "dependencies": { + "@ohos/common": "../../common" + } +} diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/ets/components/Header.ets b/ExcellentCase/MultiDeviceMusic/features/header/src/main/ets/components/Header.ets new file mode 100644 index 0000000000000000000000000000000000000000..9834b9b15c9c7e2fa104eb324783845ee98d592e --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/ets/components/Header.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device 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 promptAction from '@ohos.promptAction'; +import { MenuData } from '@ohos/common'; +import { StyleConstants } from '@ohos/common'; +import { HeaderConstants } from '../constants/HeaderConstants'; + +@Component +export struct Header { + @StorageProp('fontSize') fontSize: number = 0; + + build() { + Row() { + Image($r('app.media.ic_back')) + .width($r('app.float.icon_width')) + .height($r('app.float.icon_height')) + .margin({ left: $r('app.float.icon_margin') }) + Text($r('app.string.play_list')) + .fontSize(this.fontSize + HeaderConstants.TITLE_FONT_SIZE_PLUS) + .fontWeight(HeaderConstants.TITLE_FONT_WEIGHT) + .fontColor($r('app.color.title_color')) + .opacity($r('app.float.title_opacity')) + .letterSpacing(HeaderConstants.LETTER_SPACING) + .padding({ left: $r('app.float.title_padding_left') }) + + Blank() + + Image($r('app.media.ic_more')) + .width($r('app.float.icon_width')) + .height($r('app.float.icon_height')) + .margin({ right: $r('app.float.icon_margin') }) + .bindMenu(this.getMenu()) + } + .width(StyleConstants.FULL_WIDTH) + .height($r('app.float.title_bar_height')) + .zIndex(HeaderConstants.Z_INDEX) + } + + getMenu(): MenuData[] { + let menuItem: MenuData = new MenuData(); + let menuDatas: MenuData[] = []; + if (canIUse(HeaderConstants.SYSCAP_ETHERNET)) { + menuItem.value = HeaderConstants.AUDIO_DEVICE_SERVICE; + menuItem.action = (): void => { + promptAction.showToast({ + message: HeaderConstants.AUDIO_DEVICE_SERVICE, + duration: HeaderConstants.TOAST_DURATION + }); + }; + menuDatas.push(menuItem); + } + return menuDatas; + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/ets/constants/HeaderConstants.ets b/ExcellentCase/MultiDeviceMusic/features/header/src/main/ets/constants/HeaderConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f15c491104af86bbf351a7e9775b8654846714f --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/ets/constants/HeaderConstants.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for header area. + */ +export class HeaderConstants { + /** + * The font size of the title is larger. + */ + static readonly TITLE_FONT_SIZE_PLUS: number = 4; + + /** + * The font weight of the title. + */ + static readonly TITLE_FONT_WEIGHT: number = 500; + + /** + * Letter spacing of the title. + */ + static readonly LETTER_SPACING: number = 2; + + /** + * Title bar z-index. + */ + static readonly Z_INDEX: number = 2; + + /** + * SystemCapability that indicates audio device management capability. + */ + static readonly SYSCAP_ETHERNET: string = 'SystemCapability.Multimedia.Audio.Device'; + + /** + * SystemCapability name: audio device service. + */ + static readonly AUDIO_DEVICE_SERVICE: string = '音频设备管理'; + + /** + * Toast duration is 2000ms. + */ + static readonly TOAST_DURATION: number = 2000; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/module.json5 b/ExcellentCase/MultiDeviceMusic/features/header/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..99c54f5b290a3bd6ce88d9ec33a7e0065a6c1e65 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/module.json5 @@ -0,0 +1,10 @@ +{ + "module": { + "name": "header", + "type": "har", + "deviceTypes": [ + "default", + "tablet" + ] + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/color.json b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..bec724102e295a8893becdf8c1a23ad34bd13969 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "title_color", + "value": "#556B89" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/float.json b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..4e3f6d18cce00ae8cca6dbd2e37a5b5084e291f2 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/float.json @@ -0,0 +1,28 @@ +{ + "float": [ + { + "name": "icon_width", + "value": "20vp" + }, + { + "name": "icon_height", + "value": "20vp" + }, + { + "name": "icon_margin", + "value": "16vp" + }, + { + "name": "title_opacity", + "value": "0.9" + }, + { + "name": "title_padding_left", + "value": "10vp" + }, + { + "name": "title_bar_height", + "value": "50vp" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/string.json b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..dcce3bb7db21c605e4662e22bdaba379a6c9be9f --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "play_list", + "value": "play list" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/media/ic_back.svg b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/media/ic_back.svg new file mode 100644 index 0000000000000000000000000000000000000000..f142f2dd05ec50aca35584bfd3c3cca86963cfba --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/media/ic_back.svg @@ -0,0 +1,15 @@ + + + icon_morebackup + + + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/media/ic_more.svg b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/media/ic_more.svg new file mode 100644 index 0000000000000000000000000000000000000000..a17e3d6870f72df9831e7c07fd169f6b3f493573 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/base/media/ic_more.svg @@ -0,0 +1,13 @@ + + + icon_add + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/en_US/element/string.json b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..dcce3bb7db21c605e4662e22bdaba379a6c9be9f --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "play_list", + "value": "play list" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/zh_CN/element/string.json b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8b4403c9494fa07243e298a2bc8d44212e7291a5 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/header/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "play_list", + "value": "歌单" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/player/build-profile.json5 b/ExcellentCase/MultiDeviceMusic/features/player/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..79961f96a6fe0507354b7952a378c3be2ae4bfab --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/player/hvigorfile.ts b/ExcellentCase/MultiDeviceMusic/features/player/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/MultiDeviceMusic/features/player/index.ets b/ExcellentCase/MultiDeviceMusic/features/player/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..a70db78d1bb4be79aec6c0e0ca8c3a1d00b4e8ae --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/index.ets @@ -0,0 +1 @@ +export { Player } from './src/main/ets/components/Player'; \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/oh-package.json5 b/ExcellentCase/MultiDeviceMusic/features/player/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ec34a1ce6a1019597cb81bf07872f6136582a46f --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "ISC", + "types": "", + "devDependencies": {}, + "name": "@ohos/player", + "description": "a npm package which contains arkUI2.0 page", + "main": "index.ets", + "version": "1.0.0", + "dependencies": { + "@ohos/common": "../../common" + } +} diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/ets/components/Player.ets b/ExcellentCase/MultiDeviceMusic/features/player/src/main/ets/components/Player.ets new file mode 100644 index 0000000000000000000000000000000000000000..08196db3cbe252eca9258b5f96f2270b093c7660 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/ets/components/Player.ets @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { PlayerConstants } from '../constants/PlayerConstants'; +import { StyleConstants } from '@ohos/common'; + +@Component +export struct Player { + @StorageProp('fontSize') fontSize: number = 0; + + build() { + Row() { + Row() { + Image($r('app.media.ic_music_cover')) + .height($r('app.float.cover_height')) + .width($r('app.float.cover_width')) + .borderRadius($r('app.float.cover_border_radius')) + .margin({ right: $r('app.float.cover_margin') }) + Column() { + Text($r('app.string.song_name')) + .fontColor($r('app.color.song_name')) + .fontSize(this.fontSize) + Row() { + Image($r('app.media.ic_vip')) + .height($r('app.float.vip_icon_height')) + .width($r('app.float.vip_icon_width')) + .margin({ right: $r('app.float.vip_icon_margin') }) + Text($r('app.string.singer')) + .fontColor($r('app.color.singer')) + .fontSize(this.fontSize - PlayerConstants.FONT_REDUCE) + .opacity($r('app.float.singer_opacity')) + } + } + .alignItems(HorizontalAlign.Start) + } + .layoutWeight(PlayerConstants.LAYOUT_WEIGHT_PLAYER_INFO) + + Blank() + + Row() { + Image($r('app.media.ic_favorite')) + .height($r('app.float.control_icon_height')) + .width($r('app.float.control_icon_width')) + .margin({ right: $r('app.float.control_icon_margin') }) + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_ONE) + Image($r('app.media.ic_previous')) + .height($r('app.float.control_icon_height')) + .width($r('app.float.control_icon_width')) + .margin({ right: $r('app.float.control_icon_margin') }) + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_TWO) + Image($r('app.media.ic_pause')) + .height($r('app.float.control_icon_height')) + .width($r('app.float.control_icon_width')) + .margin({ right: $r('app.float.control_icon_margin') }) + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_THREE) + Image($r('app.media.ic_next')) + .height($r('app.float.control_icon_height')) + .width($r('app.float.control_icon_width')) + .margin({ right: $r('app.float.control_icon_margin') }) + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_TWO) + Image($r('app.media.ic_music_list')) + .height($r('app.float.control_icon_height')) + .width($r('app.float.control_icon_width')) + .displayPriority(PlayerConstants.DISPLAY_PRIORITY_ONE) + } + .layoutWeight(PlayerConstants.LAYOUT_WEIGHT_PLAYER_CONTROL) + .justifyContent(FlexAlign.End) + } + .width(StyleConstants.FULL_WIDTH) + .height($r('app.float.player_area_height')) + .backgroundColor($r('app.color.player_background')) + .padding({ + left: $r('app.float.player_padding'), + right: $r('app.float.player_padding') + }) + .position({ + x: 0, + y: StyleConstants.FULL_HEIGHT + }) + .translate({ + x: 0, + y: StyleConstants.TRANSLATE_PLAYER_Y + }) + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/ets/constants/PlayerConstants.ets b/ExcellentCase/MultiDeviceMusic/features/player/src/main/ets/constants/PlayerConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..dae2a9e609321a40ea9eafab0a722837ed16e004 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/ets/constants/PlayerConstants.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for player area. + */ +export class PlayerConstants { + /** + * The font size of the singer is smaller. + */ + static readonly FONT_REDUCE: number = 4; + + /** + * The layout weight of player info. + */ + static readonly LAYOUT_WEIGHT_PLAYER_INFO: number = 3; + + /** + * The layout weight of player control. + */ + static readonly LAYOUT_WEIGHT_PLAYER_CONTROL: number = 1; + + /** + * The display priority is 1. + */ + static readonly DISPLAY_PRIORITY_ONE: number = 1; + + /** + * The display priority is 2. + */ + static readonly DISPLAY_PRIORITY_TWO: number = 2; + + /** + * The display priority is 3. + */ + static readonly DISPLAY_PRIORITY_THREE: number = 3; +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/module.json5 b/ExcellentCase/MultiDeviceMusic/features/player/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5c58dd6e3c218fe12872a58868e11f419680e94a --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/module.json5 @@ -0,0 +1,10 @@ +{ + "module": { + "name": "player", + "type": "har", + "deviceTypes": [ + "default", + "tablet" + ] + } +} diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/color.json b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee9c2e969f60b2d8163cf1fb59b168db0f17d3b --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "singer", + "value": "#000000" + }, + { + "name": "song_name", + "value": "#000000" + }, + { + "name": "player_background", + "value": "#F6F9FC" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/float.json b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..3cb2acd90679a9431133f926812b088479c87ac6 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/float.json @@ -0,0 +1,56 @@ +{ + "float": [ + { + "name": "cover_width", + "value": "32vp" + }, + { + "name": "cover_height", + "value": "32vp" + }, + { + "name": "cover_border_radius", + "value": "5vp" + }, + { + "name": "cover_margin", + "value": "12vp" + }, + { + "name": "vip_icon_width", + "value": "16vp" + }, + { + "name": "vip_icon_height", + "value": "16vp" + }, + { + "name": "vip_icon_margin", + "value": "4vp" + }, + { + "name": "singer_opacity", + "value": "0.38" + }, + { + "name": "control_icon_width", + "value": "24vp" + }, + { + "name": "control_icon_height", + "value": "24vp" + }, + { + "name": "control_icon_margin", + "value": "16vp" + }, + { + "name": "player_area_height", + "value": "48vp" + }, + { + "name": "player_padding", + "value": "16vp" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/string.json b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2c948c3a13a38f883681040200516a3ab1160f79 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "song_name", + "value": "I don't know" + }, + { + "name": "singer", + "value": "Hello xiao wan" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_favorite.svg b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_favorite.svg new file mode 100644 index 0000000000000000000000000000000000000000..696166660053a45821ad90240ae0335a3d56c528 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_favorite.svg @@ -0,0 +1,7 @@ + + + icon_collect + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_music_cover.png b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_music_cover.png new file mode 100644 index 0000000000000000000000000000000000000000..bf4580c99075e1a721c13661884b0210f9994086 Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_music_cover.png differ diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_music_list.svg b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_music_list.svg new file mode 100644 index 0000000000000000000000000000000000000000..6f89a64c5ad30aa7b0576570b6fdc8672c4412d6 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_music_list.svg @@ -0,0 +1,7 @@ + + + ic_Music_list + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_next.svg b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_next.svg new file mode 100644 index 0000000000000000000000000000000000000000..63f5683d5ebc0c868d900f905b3db08bd25d76ad --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_next.svg @@ -0,0 +1,15 @@ + + + ic_next + + + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_pause.svg b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_pause.svg new file mode 100644 index 0000000000000000000000000000000000000000..fe7e3c89a6676a664acf4055a4ac7187861de8b2 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_pause.svg @@ -0,0 +1,15 @@ + + + icon_pause + + + + + + + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_previous.svg b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_previous.svg new file mode 100644 index 0000000000000000000000000000000000000000..697ec959c31976712a8b5c2de37f55ed0d085ace --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_previous.svg @@ -0,0 +1,9 @@ + + + icon_last + + + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_vip.svg b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_vip.svg new file mode 100644 index 0000000000000000000000000000000000000000..1b0561309697f7045a8f05e6f986e23848111f97 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/base/media/ic_vip.svg @@ -0,0 +1,7 @@ + + + icon_vip + + + + \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/en_US/element/string.json b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..2c948c3a13a38f883681040200516a3ab1160f79 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/en_US/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "song_name", + "value": "I don't know" + }, + { + "name": "singer", + "value": "Hello xiao wan" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/zh_CN/element/string.json b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..5ec078976961f6acd5616c30f84508639cb0a12b --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/features/player/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "song_name", + "value": "不知道" + }, + { + "name": "singer", + "value": "小碗你好" + } + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-biaoti.png b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-biaoti.png new file mode 100644 index 0000000000000000000000000000000000000000..48b156e456788f1f8ab7a4ddb2fa4c2d0f5a1acc Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-biaoti.png differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-fengmian.png b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-fengmian.png new file mode 100644 index 0000000000000000000000000000000000000000..8fb496fe1e81ac72a519e16d3903db0f6d5594aa Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-fengmian.png differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-kongzhiqu.png b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-kongzhiqu.png new file mode 100644 index 0000000000000000000000000000000000000000..2bf51529cdbe5b95b1488d66fb87810dfec9c336 Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-kongzhiqu.png differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-liebiao.png b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-liebiao.png new file mode 100644 index 0000000000000000000000000000000000000000..6ea093b1d5000eb219999c331de1fc1fd627af7d Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM-liebiao.png differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/AlbumSM.PNG b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM.PNG new file mode 100644 index 0000000000000000000000000000000000000000..09db75699a9e60bcedb4cf7b9843fff4d98e7ccc Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/AlbumSM.PNG differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/AlbumSMTag.PNG b/ExcellentCase/MultiDeviceMusic/figures/AlbumSMTag.PNG new file mode 100644 index 0000000000000000000000000000000000000000..67c4ddcb340e7c586c3b1ade96ed44ed3879b1ff Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/AlbumSMTag.PNG differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/Finish.gif b/ExcellentCase/MultiDeviceMusic/figures/Finish.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/Finish.gif differ diff --git a/ExcellentCase/MultiDeviceMusic/figures/Version.png b/ExcellentCase/MultiDeviceMusic/figures/Version.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/figures/Version.png differ diff --git a/ExcellentCase/MultiDeviceMusic/hvigor/hvigor-config.json5 b/ExcellentCase/MultiDeviceMusic/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..5d9bed6108611f15d956e823594d7824ce7cfd74 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/hvigor/hvigor-wrapper.js b/ExcellentCase/MultiDeviceMusic/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/hvigorfile.ts b/ExcellentCase/MultiDeviceMusic/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/oh-package.json5 b/ExcellentCase/MultiDeviceMusic/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..88298d15320de0e25e0dab871c0b899cdd0eb60e --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "license": "ISC", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "name": "multidevice", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/build-profile.json5 b/ExcellentCase/MultiDeviceMusic/products/phone/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2c53bb59beda0250e90c1e054f04edbaa4d8eb12 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/hvigorfile.ts b/ExcellentCase/MultiDeviceMusic/products/phone/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/MultiDeviceMusic/products/phone/oh-package.json5 b/ExcellentCase/MultiDeviceMusic/products/phone/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ce4a084d299cb70d26a9f12860e58943b1e2d2b4 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/oh-package.json5 @@ -0,0 +1,14 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "phone", + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/content": "../../features/content", + "@ohos/header": "../../features/header", + "@ohos/player": "../../features/player", + "@ohos/common": "../../common" + } +} diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/ets/entryability/EntryAbility.ts b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a323a76bf7126dde184f2db016a8652ef1fb2ec --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; +import Want from '@ohos.app.ability.Want'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/MainPage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/ets/pages/MainPage.ets b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c4dde6cc25114e82a986a20a40a09c8923b3f2e --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/ets/pages/MainPage.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device 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 go + verning permissions and + * limitations under the License. + */ + +import { Header } from '@ohos/header'; +import { Player } from '@ohos/player'; +import { Content } from '@ohos/content'; +import { BreakpointSystem } from '@ohos/common'; +import { StyleConstants } from '@ohos/common'; +import { BreakpointConstants } from '@ohos/common'; + +@Entry +@Component +struct MainPage { + private breakpointSystem: BreakpointSystem = new BreakpointSystem(); + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm'; + + aboutToAppear() { + this.breakpointSystem.register(); + } + + aboutToDisappear() { + this.breakpointSystem.unregister(); + } + + build() { + Stack({ alignContent: Alignment.Top }) { + Header() + Content() + Player() + } + .width(StyleConstants.FULL_WIDTH) + .backgroundColor(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? + $r('app.color.page_background_sm') : $r('app.color.page_background_other')) + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/module.json5 b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1a64476cf3be7e9ac29176da1969293d653af75a --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "phone", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/element/color.json b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..1a1cf8fa25da88b8f9a9aaa1883a6e1f7f64a075 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "page_background_sm", + "value": "#e4ecf7" + }, + { + "name": "page_background_other", + "value": "#f6f9fc" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/element/string.json b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..26c4aa0c120c4aa72cebbdea003224786aab4198 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/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": "multi device" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/media/icon.png b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/media/icon.png differ diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/profile/main_pages.json b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..f4241ef2f72e78047b4c449d92bd1a92accc39fb --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/MainPage" + ] +} diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/en_US/element/string.json b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..26c4aa0c120c4aa72cebbdea003224786aab4198 --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/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": "multi device" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/zh_CN/element/string.json b/ExcellentCase/MultiDeviceMusic/products/phone/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1fa04fd5bfd80f283de677d9d54bd5deef82fa4c --- /dev/null +++ b/ExcellentCase/MultiDeviceMusic/products/phone/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": "multi device" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/AppScope/app.json5 b/ExcellentCase/Multi_device_V2/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..fd455712d2bb4cf2b8c835f55f222332b189b040 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.multi_device_v2", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ExcellentCase/Multi_device_V2/AppScope/resources/base/element/string.json b/ExcellentCase/Multi_device_V2/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..18dc41cc0ece3a25b595ba276fed5e321f2ab84d --- /dev/null +++ b/ExcellentCase/Multi_device_V2/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "Multi_device_V2" + } + ] +} diff --git a/ExcellentCase/Multi_device_V2/AppScope/resources/base/media/app_icon.png b/ExcellentCase/Multi_device_V2/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/AppScope/resources/base/media/app_icon.png differ diff --git a/ExcellentCase/Multi_device_V2/LICENSE b/ExcellentCase/Multi_device_V2/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/README.md b/ExcellentCase/Multi_device_V2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..43da80f8a0cb8a6c400739d96295b7e56bd29b04 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/README.md @@ -0,0 +1,325 @@ +# 一次开发,多端部署-视频应用(ArkTS) + +## 介绍 + +随着智能设备类型的不断丰富,用户可以在不同的设备上享受同样的服务,但由于设备形态不尽相同,开发者往往需要针对具体设备修改或重构代码,以实现功能完整性和界面美观性的统一。OpenHarmony为开发者提供了“一次开发,多端部署”的系统能力,让开发者可以基于一次开发,快速构建不同类型终端上的应用,降低开发成本,提高开发效率。 + +本篇Codelab基于“一次开发,多端部署”提供的自适应布局和响应式布局能力,实现了常见的视频播放应用的主界面。通过三层工程结构尽可能复用了部分代码,并根据设备尺寸的区别设计了对应的页面以兼顾美观和易用。应用被打开时会根据具体的设备形态显示对应的UI界面,其中RK3568开发板的首页效果如图所示: + +![](figures/2023051170913.jpg) + +### 相关概念 + +- [一次开发,多端部署](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/Readme-CN.md#/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/introduction.md):指一套代码工程,一次开发上架,多端按需部署,目标是支撑开发者高效地开发支持多种终端设备形态的应用。 +- [自适应布局](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/adaptive-layout.md):当外部容器大小发生变化时,元素可以根据相对关系自动变化以适应外部容器变化的布局能力。相对关系如占比、固定宽高比、显示优先级等。当前自适应布局能力有7种:拉伸能力、均分能力、占比能力、缩放能力、延伸能力、隐藏能力、折行能力。自适应布局能力可以实现界面显示随外部容器大小连续变化。 +- [响应式布局](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/responsive-layout.md):当外部容器大小发生变化时,元素可以根据断点、栅格或特定的特征(如屏幕方向、窗口宽高等)自动变化以适应外部容器变化的布局能力。当前响应式布局能力有3种:断点、媒体查询、栅格布局。 +- [GridRow](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md):栅格容器组件,仅可以和栅格子组件(GridCol)在栅格布局场景中使用。 +- [GridCol](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridcol.md):栅格子组件,必须作为栅格容器组件(GridRow)的子组件使用。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +“一次开发,多端部署”推荐使用三层目录的工程结构来管理工程,上层目录包括common、features和product,common为公共特性目录,存放不同形态设备公用的类和常量,features为功能模块目录,存放应用的各个功能模块,product为产品层目录,存放不同形态设备范类代码。本Codelab不涉及功能特性,因此只存在common、product两个分层。 + +``` +├──common // 公共能力层 +│ ├──src/main/ets +│ │ ├──bean // 资源类接口 +│ │ │ ├──BottomTabsItem.ets +│ │ │ ├──DriveTabsItem.ets +│ │ │ ├──FindTabsItem.ets +│ │ │ ├──HomeTabsItem.ets +│ │ │ └──MineTabsItem.ets +│ │ ├──constants +│ │ │ └──CommonConstants.ets // 公共常量类 +│ │ └──utils +│ │ └──BreakpointSystem.ets // 断点工具类 +│ └──src/main/resources // 资源文件夹 +└──product // 产品定制层 + ├──default/src/main/ets // 支持手机(含折叠屏)、平板 + │ ├──entryability + │ │ └──EntryAbility.ts // 程序入口类 + │ ├──pages + │ │ └──MainPage.ets // 主页面 + │ ├──view + │ │ ├──BottomTabsComponent.ets // 底部页签组件 + │ │ ├──DriveTabsComponent.ets // 云盘页组件 + │ │ ├──FindTabsComponent.ets // 发现页组件 + │ │ ├──HomeTabsComponent.ets // 首页组件 + │ │ ├──LeftTabsComponent.ets // 侧边栏组件 + │ │ ├──MineTabsComponent.ets // 个人页组件 + │ │ ├──RecentlyPlayedComponent.ets // “最近播放”列表 + │ │ └──RecommendComponent.ets // “为你推荐”列表 + │ └──viewmodel + │ ├──BottomTabsModel.ets // 底部页签model + │ ├──DriveTabsModel.ets // 云盘页model + │ ├──FindTabsModel.ets // 发现页model + │ ├──HomeTabsModel.ets // 首页model + │ └──MineTabsModel.ets // 个人页model + └──default/src/main/resources // 资源文件夹 +``` + +## 主页面框架设计 + +为了操作便捷和充分利用不同形态设备的屏幕空间,按屏幕宽度的大小将设备划分为3类: + +- sm:320vp<=width<520vp,典型设备为手机。 +- md:520vp<=width<840vp,典型设备为折叠屏。 +- lg:840vp<=width,典型设备为平板或PC。 + +根据用户使用场景,当操作设备尺寸为sm或md时,一般为竖向使用,此时用于切换应用页面的页签栏适合置于底部。当操作设备尺寸为lg时,一般为横向使用,此时页签栏适合置于左侧。 + +```typescript +// MainPage.ets +@Entry +@Component +struct MainPage { + ... + build() { + SideBarContainer(SideBarContainerType.Embed) { + LeftTabs({ bottomTabIndex: $bottomTabIndex }); // 侧边栏 + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.End, justifyContent: FlexAlign.End }) { + Tabs({ barPosition: BarPosition.End, index: 0, controller: this.controller }) { + ... // 页面内容 + } + if (this.currentBreakpoint !== Const.LG) { + BottomTabs({ bottomTabIndex: $bottomTabIndex }) // 底部栏,当屏幕尺寸不为"lg"时显示 + } + } + .width(Const.FULL_SIZE) + .backgroundColor($r('app.color.background_color')) + } + .showSideBar(this.currentBreakpoint === Const.LG) // 当屏幕尺寸为"lg"时显示侧边栏 + .showControlButton(false) + .sideBarWidth(Const.SIDEBAR_WIDTH) + .maxSideBarWidth(Const.SIDEBAR_WIDTH_MAX) + .minSideBarWidth(Const.SIDEBAR_WIDTH_MIN) + } +} +``` + +## 各页面代码实现 + +### 首页 + +首页显示轮播图和“最近播放”、“为你推荐”两个列表,轮播图根据屏幕尺寸的区别,有显示数量的不同(sm为1,md为2,lg为3),列表使用具备自适应布局能力的List组件。 + +```typescript +// HomeTabsComponent.ets +@Component +export struct HomeTabs { + @Link currentBreakpoint: string; + private scroller: Scroller = new Scroller(); + build() { + Scroll(this.scroller) { + GridRow({ + // 设置sm、md和lg的布局列数分别为4、8、12 + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x: $r('app.float.gutter_home') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + ... // 标题 + } + .height($r('app.float.title_height')) + .margin({ bottom: $r('app.float.home_margin1') }) + + // 搜索栏在sm、md下占满全部列,在lg下占8列 + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_8 } }) { + ... // 搜索栏 + } + .height($r('app.float.home_grid_height1')) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + Swiper() { + ... + } + .height($r('app.float.home_swiper_height')) + .itemSpace(Const.ITEM_SPACE) + // 根据屏幕尺寸大小选择不同的轮播图数量 + .displayCount(this.currentBreakpoint === Const.LG ? + Const.NUM_3 : (this.currentBreakpoint === Const.MD ? Const.NUM_2 : Const.NUM_1)) + } + .height($r('app.float.home_grid_height2')) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + ... // ”最近播放”列表 + } + .height($r('app.float.home_grid_height3')) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + ... // ”为你推荐”列表 + } + .height($r('app.float.home_column_height')) + } + .height(Const.FULL_SIZE) + } + ... + } +} +``` + +### 发现页 + +发现页使用栅格布局实现“一次开发,多端部署”能力,把sm设置为4列,md设置为8列,lg设置为12列。热播榜单在不同设备尺寸上分别占据4列、6列和8列。 + +```typescript +// FindTabsComponent.ets +@Component +export struct FindTabs { + private scroller: Scroller = new Scroller(); + build() { + Scroll(this.scroller) { + GridRow({ + // 设置sm、md和lg的布局列数分别为4、8、12 + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x: $r('app.float.gutter_find') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + ... // 标题 + } + .height($r('app.float.title_height')) + + LazyForEach(new FindDataSource(FindTabsList), (item: FindTabsItem) => { + // 设置热播榜单在sm、md和lg上分别占据4、6、8列,并且设置offset属性保证在不同设备形态上都能保持居中 + GridCol({ + span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_6, lg: Const.GRID_8 }, + offset: { + md: FindTabsList.indexOf(item) === Const.OFFSET_0 ? Const.OFFSET_1 : Const.OFFSET_2, + lg: FindTabsList.indexOf(item) === Const.OFFSET_0 ? Const.OFFSET_2 : Const.OFFSET_4 + } + }) { + ... // 榜单内容 + } + }, item => JSON.stringify(item)) + } + } + ... + } +} +``` + +RK3568开发板上发现页的实际效果如图所示: + +![](figures/2023051170929.jpg) + +### 云盘页 + +云盘页的栅格划分和发现页相同,但是每个子组件在所有屏幕尺寸上都只占据2列。 + +```typescript +// DriveTabsComponent.ets +@Component +export struct DriveTabs { + private scroller: Scroller = new Scroller(); + build() { + Scroll(this.scroller) { + GridRow({ + // 设置sm、md和lg的布局列数分别为4、8、12 + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x : $r('app.float.gutter_drive') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + ... // 标题 + } + .height($r('app.float.title_height')) + + ForEach(DriveList, (item: DriveTabsItem) => { + // 设置云盘内容在sm、md和lg上均占据2列 + GridCol({ span: { xs: Const.NUM_2, sm: Const.NUM_2, md: Const.NUM_2, lg: Const.NUM_2 } }) { + ... // 云盘内容 + } + }, item => JSON.stringify(item)) + } + } + ... + } +} +``` + +RK3568开发板上云盘页的实际效果如图所示: + +![](figures/2023051170938.jpg) + +### 个人页 + +个人页的栅格划分仍然和发现页相同,但子组件在sm、md形态下占满全部列,在lg形态下只占据8列。 + +```typescript +// MineTabsComponent.ets +@Component +export struct MineTabs { + private scroller: Scroller = new Scroller(); + build() { + Scroll(this.scroller) { + GridRow({ + // 设置sm、md和lg的布局列数分别为4、8、12 + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x: $r('app.float.gutter_mine') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + // 设置个人页在sm和md上占满全部列,在lg上占8列,为保证居中在lg上设置offset为2列 + GridCol({ + span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_8 }, + offset: { lg: Const.OFFSET_2 } + }) { + ... // 个人页内容 + } + } + .height(Const.FULL_SIZE) + .backgroundColor($r('app.color.mine_background_color')) + } + ... + } +} +``` + +RK3568开发板上个人页的实际效果如图所示: + +![](figures/2023051170946.jpg) + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 根据设备尺寸形态设计不同的页面布局。 +2. 使用栅格布局实现“一次开发,多端部署”能力。 + +![](figures/zh-cn_image_0000001543429324.gif) + + + + diff --git a/ExcellentCase/Multi_device_V2/build-profile.json5 b/ExcellentCase/Multi_device_V2/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6d81440d9629acd0ebbfee1f25fede9bcdca2303 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/build-profile.json5 @@ -0,0 +1,32 @@ +{ + "app": { + "signingConfigs": [ + ], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./product/default", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "common", + "srcPath": "./common" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/build-profile.json5 b/ExcellentCase/Multi_device_V2/common/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..79961f96a6fe0507354b7952a378c3be2ae4bfab --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} diff --git a/ExcellentCase/Multi_device_V2/common/hvigorfile.ts b/ExcellentCase/Multi_device_V2/common/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/Multi_device_V2/common/index.ets b/ExcellentCase/Multi_device_V2/common/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..46a5f34105a73b3ce0df146bee708149f168a1c7 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/index.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export type { BottomTabsItem } from './src/main/ets/bean/BottomTabsItem'; +export type { HomeTabsItem } from './src/main/ets/bean/HomeTabsItem'; +export type { FindTabsItem } from './src/main/ets/bean/FindTabsItem'; +export type { DriveTabsItem } from './src/main/ets/bean/DriveTabsItem'; +export type { MineTabsItem } from './src/main/ets/bean/MineTabsItem'; +export { CommonConstants } from './src/main/ets/constants/CommonConstants'; +export { BreakpointSystem } from './src/main/ets/utils/BreakpointSystem'; diff --git a/ExcellentCase/Multi_device_V2/common/oh-package.json5 b/ExcellentCase/Multi_device_V2/common/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..615b3ef9baf005875b7c528d7c8dce12af8fd9af --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "Apache-2.0", + "devDependencies": {}, + "author": "", + "name": "common", + "description": "Please describe the basic information.", + "main": "index.ets", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/BottomTabsItem.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/BottomTabsItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..1e094d45e34680852c37742c2edf2c0b91a9d8f0 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/BottomTabsItem.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Interface of bottom tab item. + */ +export interface BottomTabsItem { + icon: Resource; + iconSelected: Resource; + text: Resource; +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/DriveTabsItem.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/DriveTabsItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ae13a8aff82e94443004c8033860413cda75af2 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/DriveTabsItem.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Interface of drive tab item. + */ +export interface DriveTabsItem { + img: Resource; + title: Resource; + intro: Resource; +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/FindTabsItem.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/FindTabsItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..73b8ecc0985aff73836e28d02d6df909dbdf6055 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/FindTabsItem.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Interface of find tab item. + */ +export interface FindTabsItem { + img: Resource; + title: Resource; + category: Resource; + barrage: Resource; + visits: Resource; + intro: Resource; +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/HomeTabsItem.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/HomeTabsItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..552ff595bace0f1e94928f6b039d9729dcef33f9 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/HomeTabsItem.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Interface of home tab item. + */ +export interface HomeTabsItem { + img: Resource; + title: Resource; + intro: Resource; +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/MineTabsItem.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/MineTabsItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..45b1d9d57aca8cde82bef7a4e92fd991ea98565b --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/bean/MineTabsItem.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Interface of mine tab item. + */ +export interface MineTabsItem { + icon: Resource; + title: Resource; + more: Resource; +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/constants/CommonConstants.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7dc1ddf0817a3d46efe0f4ffb9cf4f14b717d68 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/constants/CommonConstants.ets @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Constants for components. + */ +export class CommonConstants { + /** + * Numeric constant: 1. + */ + static readonly NUM_1: number = 1; + + /** + * Numeric constant: 2. + */ + static readonly NUM_2: number = 2; + + /** + * Numeric constant: 3. + */ + static readonly NUM_3: number = 3; + + /** + * Numeric constant: 4. + */ + static readonly NUM_4: number = 4; + + /** + * Current component width: 4 grids. + */ + static readonly GRID_4: number = 4; + + /** + * Current component width: 6 grids. + */ + static readonly GRID_6: number = 6; + + /** + * Current component width: 8 grids. + */ + static readonly GRID_8: number = 8; + + /** + * Current component width: 12 grids. + */ + static readonly GRID_12: number = 12; + + /** + * Current component offset 0 grid. + */ + static readonly OFFSET_0: number = 0; + + /** + * Current component offset 1 grid. + */ + static readonly OFFSET_1: number = 1; + + /** + * Current component offset 2 grid. + */ + static readonly OFFSET_2: number = 2; + + /** + * Current component offset 4 grid. + */ + static readonly OFFSET_4: number = 4; + + /** + * Breakpoints that represent small device types. + */ + static readonly SM: string = 'sm'; + + /** + * Breakpoints that represent middle device types. + */ + static readonly MD: string = 'md'; + + /** + * Breakpoints that represent large device types. + */ + static readonly LG: string = 'lg'; + + /** + * Dividing line of the small device width. + */ + static readonly BREAKPOINTS_SM: string = '320vp'; + + /** + * Dividing line of the middle device width. + */ + static readonly BREAKPOINTS_MD: string = '520vp'; + + /** + * Dividing line of the large device width. + */ + static readonly BREAKPOINTS_LG: string = '840vp'; + + /** + * Range of the small device width. + */ + static readonly BREAKPOINTS_SCOPE_1: string = '(320vp<=width<520vp)'; + + /** + * Range of the middle device width. + */ + static readonly BREAKPOINTS_SCOPE_2: string = '(520vp<=width<840vp)'; + + /** + * Range of the large device width. + */ + static readonly BREAKPOINTS_SCOPE_3: string = '(840vp<=width)'; + + /** + * Constant for search text + */ + static readonly SEARCH_TEXT: string = '搜索...'; + + /** + * Constant for font weight + */ + static readonly FONT_WEIGHT: number = 500; + + /** + * Constant for item space + */ + static readonly ITEM_SPACE: number = 12; + + /** + * Constant for opacity + */ + static readonly OPACITY: number = 0.6; + + /** + * Component size percentage: 100%. + */ + static readonly FULL_SIZE: string = '100%'; + + /** + * Bottom image size percentage: 40%. + */ + static readonly BOTTOM_IMAGE_SIZE: string = '40%'; + + /** + * Bottom tab width percentage: 25%. + */ + static readonly BOTTOM_TAB_WIDTH: string = '25%'; + + /** + * Bottom tab height percentage: 10%. + */ + static readonly BOTTOM_TAB_HEIGHT: string = '10%'; + + /** + * Sidebar width percentage: 10%. + */ + static readonly SIDEBAR_WIDTH: string = '10%'; + + /** + * Sidebar max width percentage: 15%. + */ + static readonly SIDEBAR_WIDTH_MAX: string = '15%'; + + /** + * Sidebar min width percentage: 8%. + */ + static readonly SIDEBAR_WIDTH_MIN: string = '8%'; + + /** + * Row width percentage: 25%. + */ + static readonly ROW_WIDTH: string = '25%'; + + /** + * Left image size percentage: 30%. + */ + static readonly LEFT_IMAGE_SIZE: string = '30%'; + + /** + * Left tab width percentage: 10%. + */ + static readonly LEFT_TAB_WIDTH: string = '10%'; + + /** + * Left tab height percentage: 12.5%. + */ + static readonly LEFT_TAB_HEIGHT: string = '12.5%'; + + /** + * Mine column height percentage: 60%. + */ + static readonly MINE_COLUMN_HEIGHT: string = '60%'; + + /** + * Mine image location of x-axis percentage: 50%. + */ + static readonly MINE_IMAGE_X: string = '50%'; + + /** + * Mine image location of y-axis percentage: 40%. + */ + static readonly MINE_IMAGE_Y: string = '40%'; +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/ets/utils/BreakpointSystem.ets b/ExcellentCase/Multi_device_V2/common/src/main/ets/utils/BreakpointSystem.ets new file mode 100644 index 0000000000000000000000000000000000000000..f4fd02119cdd67e13226e5b6d07244e184050d72 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/ets/utils/BreakpointSystem.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023 Huawei Device 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 mediaQuery from '@ohos.mediaquery'; +import { CommonConstants as Const } from '../constants/CommonConstants'; + +export class BreakpointSystem { + private currentBreakpoint: string = Const.MD; + private smListener: mediaQuery.MediaQueryListener; + private mdListener: mediaQuery.MediaQueryListener; + private lgListener: mediaQuery.MediaQueryListener; + + private updateCurrentBreakpoint(breakpoint: string) { + if (this.currentBreakpoint !== breakpoint) { + this.currentBreakpoint = breakpoint; + AppStorage.Set('currentBreakpoint', this.currentBreakpoint); + } + } + + private isBreakpointSM = (mediaQueryResult) => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(Const.SM); + } + } + + private isBreakpointMD = (mediaQueryResult) => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(Const.MD); + } + } + + private isBreakpointLG = (mediaQueryResult) => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(Const.LG); + } + } + + public register() { + this.smListener = mediaQuery.matchMediaSync(Const.BREAKPOINTS_SCOPE_1); + this.smListener.on('change', this.isBreakpointSM); + this.mdListener = mediaQuery.matchMediaSync(Const.BREAKPOINTS_SCOPE_2); + this.mdListener.on('change', this.isBreakpointMD); + this.lgListener = mediaQuery.matchMediaSync(Const.BREAKPOINTS_SCOPE_3); + this.lgListener.on('change', this.isBreakpointLG); + } + + public unregister() { + this.smListener.off('change', this.isBreakpointSM); + this.mdListener.off('change', this.isBreakpointMD); + this.lgListener.off('change', this.isBreakpointLG); + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/common/src/main/module.json5 b/ExcellentCase/Multi_device_V2/common/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3a26ade95efbe0e73d8a7223935b9538cb70684e --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/module.json5 @@ -0,0 +1,10 @@ +{ + "module": { + "name": "common", + "type": "har", + "deviceTypes": [ + "default", + "tablet" + ] + } +} diff --git a/ExcellentCase/Multi_device_V2/common/src/main/resources/base/element/string.json b/ExcellentCase/Multi_device_V2/common/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/ExcellentCase/Multi_device_V2/common/src/main/resources/en_US/element/string.json b/ExcellentCase/Multi_device_V2/common/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/ExcellentCase/Multi_device_V2/common/src/main/resources/zh_CN/element/string.json b/ExcellentCase/Multi_device_V2/common/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/ExcellentCase/Multi_device_V2/common/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/ExcellentCase/Multi_device_V2/figures/2023051170913.jpg b/ExcellentCase/Multi_device_V2/figures/2023051170913.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2ff3c48346e3284215e6399cab973ca9652d9119 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/figures/2023051170913.jpg differ diff --git a/ExcellentCase/Multi_device_V2/figures/2023051170929.jpg b/ExcellentCase/Multi_device_V2/figures/2023051170929.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6c8c86d09f35161fac03f78266e75006767aa3f4 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/figures/2023051170929.jpg differ diff --git a/ExcellentCase/Multi_device_V2/figures/2023051170938.jpg b/ExcellentCase/Multi_device_V2/figures/2023051170938.jpg new file mode 100644 index 0000000000000000000000000000000000000000..707a1ac4591adac65bcb0054d4b99e2a15ba7b5f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/figures/2023051170938.jpg differ diff --git a/ExcellentCase/Multi_device_V2/figures/2023051170946.jpg b/ExcellentCase/Multi_device_V2/figures/2023051170946.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d399666f5729bb0179c0b5c744b8648c5d5c4bb7 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/figures/2023051170946.jpg differ diff --git a/ExcellentCase/Multi_device_V2/figures/zh-cn_image_0000001543429324.gif b/ExcellentCase/Multi_device_V2/figures/zh-cn_image_0000001543429324.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/figures/zh-cn_image_0000001543429324.gif differ diff --git a/ExcellentCase/Multi_device_V2/figures/zh-cn_image_0000001569303293.png b/ExcellentCase/Multi_device_V2/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/ExcellentCase/Multi_device_V2/figures/zh-cn_image_0000001569303293.png differ diff --git a/ExcellentCase/Multi_device_V2/hvigor/hvigor-config.json5 b/ExcellentCase/Multi_device_V2/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/ExcellentCase/Multi_device_V2/hvigor/hvigor-wrapper.js b/ExcellentCase/Multi_device_V2/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..ed520df42d9190418c6ade156daa022ec8f43e21 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),f=a(e),E=a(t),l=a(r),F=a(n),C=a(i),A=a(o),d=a(D),y=a(c),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},v=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const S=v(E.default),_="Windows_NT",O="Linux",w="Darwin";B.isWindows=function(){return S.default.type()===_},B.isLinux=function(){return S.default.type()===O},B.isMac=function(){return S.default.type()===w};var P={},b=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),g=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&b(e,u,t);return g(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(f.default),i=r(E.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON)}(m);var I={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.logErrorAndExit=void 0,k.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var T=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),x=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),M=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&T(e,u,t);return x(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const H=F.default,j=M(f.default),J=m,L=k;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),J.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,H.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} execute failed.See above for details.`)};var G=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),V=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),$=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&G(e,u,t);return V(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var U=h.executeInstallPnpm=Z=h.isPnpmAvailable=void 0;const W=$(s.default),q=m,K=I,Y=$(f.default),z=k;var Z=h.isPnpmAvailable=function(){return!!W.existsSync(q.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,K.hasNpmPackInPaths)("pnpm",[q.HVIGOR_WRAPPER_TOOLS_HOME])};U=h.executeInstallPnpm=function(){const u=(0,K.getNpmPath)();!function(){const u=Y.resolve(q.HVIGOR_WRAPPER_TOOLS_HOME,q.DEFAULT_PACKAGE_JSON);try{W.existsSync(q.HVIGOR_WRAPPER_TOOLS_HOME)||W.mkdirSync(q.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};W.writeFileSync(u,JSON.stringify(e))}catch(e){(0,z.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,K.executeCommand)(u,["install","pnpm"],{cwd:q.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var X={},Q={},uu={},eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.Unicode=void 0;class tu{}eu.Unicode=tu,tu.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,tu.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]/,tu.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(uu,"__esModule",{value:!0}),uu.JudgeUtil=void 0;const ru=eu;uu.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&ru.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||ru.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||ru.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var nu={},iu={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},ou=C.default,Du=process.cwd,cu=null,au=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cu||(cu=Du.call(process)),cu};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var su=process.chdir;process.chdir=function(u){cu=null,su.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,su)}var fu=function(u){ou.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,ou.O_WRONLY|ou.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,ou.O_WRONLY|ou.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){ou.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,ou.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,ou.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===au&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,f,E){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var Eu=A.default.Stream,lu=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);Eu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Fu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:Cu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},Cu=Object.getPrototypeOf||function(u){return u.__proto__};var Au,du,yu=s.default,pu=fu,hu=lu,mu=Fu,Bu=d.default;function vu(u,e){Object.defineProperty(u,Au,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Au=Symbol.for("graceful-fs.queue"),du=Symbol.for("graceful-fs.previous")):(Au="___graceful-fs.queue",du="___graceful-fs.previous");var Su=function(){};if(Bu.debuglog?Su=Bu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Su=function(){var u=Bu.format.apply(Bu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!yu[Au]){var _u=p[Au]||[];vu(yu,_u),yu.close=function(u){function e(e,t){return u.call(yu,e,(function(u){u||gu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,du,{value:u}),e}(yu.close),yu.closeSync=function(u){function e(e){u.apply(yu,arguments),gu()}return Object.defineProperty(e,du,{value:u}),e}(yu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Su(yu[Au]),y.default.equal(yu[Au].length,0)}))}p[Au]||vu(p,yu[Au]);var Ou,wu=Pu(mu(yu));function Pu(u){pu(u),u.gracefulify=Pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):bu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):bu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=hu(u);E=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(E.prototype=Object.create(c.prototype),E.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;C(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=E;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var f=l;function E(u,e){return this instanceof E?(c.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0});var F=u.open;function C(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return F(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):bu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=C,u}function bu(u){Su("ENQUEUE",u[0].name,u[1]),yu[Au].push(u),Nu()}function gu(){for(var u=Date.now(),e=0;e2&&(yu[Au][e][3]=u,yu[Au][e][4]=u);Nu()}function Nu(){if(clearTimeout(Ou),Ou=void 0,0!==yu[Au].length){var u=yu[Au].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Su("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Su("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Su("RETRY",e.name,t),e.apply(null,t.concat([n]))):yu[Au].push(u)}void 0===Ou&&(Ou=setTimeout(Nu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!yu.__patched&&(wu=Pu(yu),yu.__patched=!0),function(u){const e=iu.fromCallback,t=wu,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(nu);var Ru={},Iu={};const ku=f.default;Iu.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(ku.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Tu=nu,{checkPath:xu}=Iu,Mu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Ru.makeDir=async(u,e)=>(xu(u),Tu.mkdir(u,{mode:Mu(e),recursive:!0})),Ru.makeDirSync=(u,e)=>(xu(u),Tu.mkdirSync(u,{mode:Mu(e),recursive:!0}));const Hu=iu.fromPromise,{makeDir:ju,makeDirSync:Ju}=Ru,Lu=Hu(ju);var Gu={mkdirs:Lu,mkdirsSync:Ju,mkdirp:Lu,mkdirpSync:Ju,ensureDir:Lu,ensureDirSync:Ju};const Vu=iu.fromPromise,$u=nu;var Uu={pathExists:Vu((function(u){return $u.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:$u.existsSync};const Wu=wu;var qu=function(u,e,t,r){Wu.open(u,"r+",((u,n)=>{if(u)return r(u);Wu.futimes(n,e,t,(u=>{Wu.close(n,(e=>{r&&r(u||e)}))}))}))},Ku=function(u,e,t){const r=Wu.openSync(u,"r+");return Wu.futimesSync(r,e,t),Wu.closeSync(r)};const Yu=nu,zu=f.default,Zu=d.default;function Xu(u,e,t){const r=t.dereference?u=>Yu.stat(u,{bigint:!0}):u=>Yu.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Qu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function ue(u,e){const t=zu.resolve(u).split(zu.sep).filter((u=>u)),r=zu.resolve(e).split(zu.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function ee(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var te={checkPaths:function(u,e,t,r,n){Zu.callbackify(Xu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Qu(o,D)){const r=zu.basename(u),i=zu.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&ue(u,e)?n(new Error(ee(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Yu.statSync(u,{bigint:!0}):u=>Yu.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Qu(n,i)){const r=zu.basename(u),o=zu.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&ue(u,e))throw new Error(ee(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=zu.resolve(zu.dirname(e)),D=zu.resolve(zu.dirname(r));if(D===o||D===zu.parse(D).root)return i();Yu.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Qu(t,c)?i(new Error(ee(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=zu.resolve(zu.dirname(e)),o=zu.resolve(zu.dirname(r));if(o===i||o===zu.parse(o).root)return;let D;try{D=Yu.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Qu(t,D))throw new Error(ee(e,r,n));return u(e,t,o,n)},isSrcSubdir:ue,areIdentical:Qu};const re=wu,ne=f.default,ie=Gu.mkdirs,oe=Uu.pathExists,De=qu,ce=te;function ae(u,e,t,r,n){const i=ne.dirname(t);oe(i,((o,D)=>o?n(o):D?fe(u,e,t,r,n):void ie(i,(i=>i?n(i):fe(u,e,t,r,n)))))}function se(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function fe(u,e,t,r,n){(r.dereference?re.stat:re.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?Ce(t,r,n,i):function(u,e,t,r,n){re.mkdir(t,(i=>{if(i)return n(i);Ce(e,t,r,(e=>e?n(e):Fe(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();re.unlink(t,(i=>i?n(i):Ee(u,e,t,r,n)))}(u,t,r,n,i):Ee(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){re.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=ne.resolve(process.cwd(),i)),u?void re.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?re.symlink(i,t,n):n(e):(r.dereference&&(o=ne.resolve(process.cwd(),o)),ce.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&ce.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){re.unlink(e,(r=>r?t(r):re.symlink(u,e,t)))}(i,t,n)))):re.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function Ee(u,e,t,r,n){re.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return Fe(u,128|e,t)}(t,u,(n=>n?r(n):le(u,e,t,r)));return le(u,e,t,r)}(u.mode,e,t,n):Fe(t,u.mode,n)))}function le(u,e,t,r){!function(u,e,t){re.stat(u,((u,r)=>u?t(u):De(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):Fe(t,u,r)))}function Fe(u,e,t){return re.chmod(u,e,t)}function Ce(u,e,t,r){re.readdir(u,((n,i)=>n?r(n):Ae(i,u,e,t,r)))}function Ae(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=ne.join(t,e),D=ne.join(r,e);ce.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?se(fe,u,e,t,r,n):fe(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):Ae(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var de=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),ce.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;ce.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?se(ae,D,u,e,t,r):ae(D,u,e,t,r)))}))};const ye=wu,pe=f.default,he=Gu.mkdirsSync,me=Ku,Be=te;function ve(u,e,t,r){const n=(r.dereference?ye.statSync:ye.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?Oe(t,r,n):function(u,e,t,r){return ye.mkdirSync(t),Oe(e,t,r),_e(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ye.unlinkSync(t),Se(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Se(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ye.readlinkSync(e);r.dereference&&(n=pe.resolve(process.cwd(),n));if(u){let u;try{u=ye.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ye.symlinkSync(n,t);throw u}if(r.dereference&&(u=pe.resolve(process.cwd(),u)),Be.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ye.statSync(t).isDirectory()&&Be.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ye.unlinkSync(e),ye.symlinkSync(u,e)}(n,t)}return ye.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Se(u,e,t,r){return ye.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){_e(u,128|e)}(t,u);(function(u,e){const t=ye.statSync(u);me(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),_e(t,u.mode)}function _e(u,e){return ye.chmodSync(u,e)}function Oe(u,e,t){ye.readdirSync(u).forEach((r=>function(u,e,t,r){const n=pe.join(e,u),i=pe.join(t,u),{destStat:o}=Be.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return ve(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var we=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=Be.checkPathsSync(u,e,"copy",t);return Be.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=pe.dirname(t);ye.existsSync(n)||he(n);return ve(u,e,t,r)}(n,u,e,t)};var Pe={copy:(0,iu.fromCallback)(de),copySync:we};const be=wu,ge=f.default,Ne=y.default,Re="win32"===process.platform;function Ie(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||be[e],u[e+="Sync"]=u[e]||be[e]})),u.maxBusyTries=u.maxBusyTries||3}function ke(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne.strictEqual(typeof t,"function","rimraf: callback function required"),Ne(e,"rimraf: invalid options argument provided"),Ne.strictEqual(typeof e,"object","rimraf: options should be object"),Ie(e),Te(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rTe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Te(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Re?xe(u,e,r,t):n&&n.isDirectory()?He(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Re?xe(u,e,r,t):He(u,e,r,t);if("EISDIR"===r.code)return He(u,e,r,t)}return t(r)}))))}function xe(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?He(u,e,t,r):e.unlink(u,r)}))}))}function Me(u,e,t){let r;Ne(u),Ne(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?Je(u,e,t):e.unlinkSync(u)}function He(u,e,t,r){Ne(u),Ne(e),Ne("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){Ne(u),Ne(e),Ne("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{ke(ge.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function je(u,e){let t;Ie(e=e||{}),Ne(u,"rimraf: missing path"),Ne.strictEqual(typeof u,"string","rimraf: path should be a string"),Ne(e,"rimraf: missing options"),Ne.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Re&&Me(u,e,t)}try{t&&t.isDirectory()?Je(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Re?Me(u,e,t):Je(u,e,t);if("EISDIR"!==t.code)throw t;Je(u,e,t)}}function Je(u,e,t){Ne(u),Ne(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(Ne(u),Ne(e),e.readdirSync(u).forEach((t=>je(ge.join(u,t),e))),!Re){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Le=ke;ke.sync=je;const Ge=wu,Ve=iu.fromCallback,$e=Le;var Ue={remove:Ve((function(u,e){if(Ge.rm)return Ge.rm(u,{recursive:!0,force:!0},e);$e(u,e)})),removeSync:function(u){if(Ge.rmSync)return Ge.rmSync(u,{recursive:!0,force:!0});$e.sync(u)}};const We=iu.fromPromise,qe=nu,Ke=f.default,Ye=Gu,ze=Ue,Ze=We((async function(u){let e;try{e=await qe.readdir(u)}catch{return Ye.mkdirs(u)}return Promise.all(e.map((e=>ze.remove(Ke.join(u,e)))))}));function Xe(u){let e;try{e=qe.readdirSync(u)}catch{return Ye.mkdirsSync(u)}e.forEach((e=>{e=Ke.join(u,e),ze.removeSync(e)}))}var Qe={emptyDirSync:Xe,emptydirSync:Xe,emptyDir:Ze,emptydir:Ze};const ut=iu.fromCallback,et=f.default,tt=wu,rt=Gu;var nt={createFile:ut((function(u,e){function t(){tt.writeFile(u,"",(u=>{if(u)return e(u);e()}))}tt.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=et.dirname(u);tt.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?rt.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():tt.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=tt.statSync(u)}catch{}if(e&&e.isFile())return;const t=et.dirname(u);try{tt.statSync(t).isDirectory()||tt.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;rt.mkdirsSync(t)}tt.writeFileSync(u,"")}};const it=iu.fromCallback,ot=f.default,Dt=wu,ct=Gu,at=Uu.pathExists,{areIdentical:st}=te;var ft={createLink:it((function(u,e,t){function r(u,e){Dt.link(u,e,(u=>{if(u)return t(u);t(null)}))}Dt.lstat(e,((n,i)=>{Dt.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&st(o,i))return t(null);const D=ot.dirname(e);at(D,((n,i)=>n?t(n):i?r(u,e):void ct.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Dt.lstatSync(e)}catch{}try{const e=Dt.lstatSync(u);if(t&&st(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ot.dirname(e);return Dt.existsSync(r)||ct.mkdirsSync(r),Dt.linkSync(u,e)}};const Et=f.default,lt=wu,Ft=Uu.pathExists;var Ct={symlinkPaths:function(u,e,t){if(Et.isAbsolute(u))return lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=Et.dirname(e),n=Et.join(r,u);return Ft(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):lt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:Et.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(Et.isAbsolute(u)){if(t=lt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=Et.dirname(e),n=Et.join(r,u);if(t=lt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=lt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:Et.relative(r,u)}}}};const At=wu;var dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);At.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=At.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const yt=iu.fromCallback,pt=f.default,ht=nu,mt=Gu.mkdirs,Bt=Gu.mkdirsSync,vt=Ct.symlinkPaths,St=Ct.symlinkPathsSync,_t=dt.symlinkType,Ot=dt.symlinkTypeSync,wt=Uu.pathExists,{areIdentical:Pt}=te;function bt(u,e,t,r){vt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,_t(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=pt.dirname(e);wt(i,((t,o)=>t?r(t):o?ht.symlink(u,e,n,r):void mt(i,(t=>{if(t)return r(t);ht.symlink(u,e,n,r)}))))}))}))}var gt={createSymlink:yt((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,ht.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([ht.stat(u),ht.stat(e)]).then((([n,i])=>{if(Pt(n,i))return r(null);bt(u,e,t,r)})):bt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=ht.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=ht.statSync(u),r=ht.statSync(e);if(Pt(t,r))return}const n=St(u,e);u=n.toDst,t=Ot(n.toCwd,t);const i=pt.dirname(e);return ht.existsSync(i)||Bt(i),ht.symlinkSync(u,e,t)}};const{createFile:Nt,createFileSync:Rt}=nt,{createLink:It,createLinkSync:kt}=ft,{createSymlink:Tt,createSymlinkSync:xt}=gt;var Mt={createFile:Nt,createFileSync:Rt,ensureFile:Nt,ensureFileSync:Rt,createLink:It,createLinkSync:kt,ensureLink:It,ensureLinkSync:kt,createSymlink:Tt,createSymlinkSync:xt,ensureSymlink:Tt,ensureSymlinkSync:xt};var Ht={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let jt;try{jt=wu}catch(u){jt=s.default}const Jt=iu,{stringify:Lt,stripBom:Gt}=Ht;const Vt=Jt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;let n,i=await Jt.fromCallback(t.readFile)(u,e);i=Gt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const $t=Jt.fromPromise((async function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);await Jt.fromCallback(r.writeFile)(u,n,t)}));const Ut={readFile:Vt,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||jt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Gt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:$t,writeFileSync:function(u,e,t={}){const r=t.fs||jt,n=Lt(e,t);return r.writeFileSync(u,n,t)}};var Wt={readJson:Ut.readFile,readJsonSync:Ut.readFileSync,writeJson:Ut.writeFile,writeJsonSync:Ut.writeFileSync};const qt=iu.fromCallback,Kt=wu,Yt=f.default,zt=Gu,Zt=Uu.pathExists;var Xt={outputFile:qt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Yt.dirname(u);Zt(n,((i,o)=>i?r(i):o?Kt.writeFile(u,e,t,r):void zt.mkdirs(n,(n=>{if(n)return r(n);Kt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Yt.dirname(u);if(Kt.existsSync(t))return Kt.writeFileSync(u,...e);zt.mkdirsSync(t),Kt.writeFileSync(u,...e)}};const{stringify:Qt}=Ht,{outputFile:ur}=Xt;var er=async function(u,e,t={}){const r=Qt(e,t);await ur(u,r,t)};const{stringify:tr}=Ht,{outputFileSync:rr}=Xt;var nr=function(u,e,t){const r=tr(e,t);rr(u,r,t)};const ir=iu.fromPromise,or=Wt;or.outputJson=ir(er),or.outputJsonSync=nr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var Dr=or;const cr=wu,ar=f.default,sr=Pe.copy,fr=Ue.remove,Er=Gu.mkdirp,lr=Uu.pathExists,Fr=te;function Cr(u,e,t,r,n){return r?Ar(u,e,t,n):t?fr(e,(r=>r?n(r):Ar(u,e,t,n))):void lr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):Ar(u,e,t,n)))}function Ar(u,e,t,r){cr.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};sr(u,e,n,(e=>e?r(e):fr(u,r)))}(u,e,t,r):r()))}var dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;Fr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;Fr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)?Cr(u,e,n,D,r):void Er(ar.dirname(e),(t=>t?r(t):Cr(u,e,n,D,r)))))}))};const yr=wu,pr=f.default,hr=Pe.copySync,mr=Ue.removeSync,Br=Gu.mkdirpSync,vr=te;function Sr(u,e,t){try{yr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return hr(u,e,r),mr(u)}(u,e,t)}}var _r=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=vr.checkPathsSync(u,e,"move",t);return vr.checkParentPathsSync(u,n,e,"move"),function(u){const e=pr.dirname(u);return pr.parse(e).root===e}(e)||Br(pr.dirname(e)),function(u,e,t,r){if(r)return Sr(u,e,t);if(t)return mr(e),Sr(u,e,t);if(yr.existsSync(e))throw new Error("dest already exists.");return Sr(u,e,t)}(u,e,r,i)};var Or={move:(0,iu.fromCallback)(dr),moveSync:_r},wr={...nu,...Pe,...Qe,...Mt,...Dr,...Gu,...Or,...Xt,...Uu,...Ue},Pr=p&&p.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.parseJsonText=Q.parseJsonFile=void 0;const br=uu,gr=Pr(wr),Nr=Pr(f.default),Rr=Pr(E.default),Ir=k;var kr;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(kr||(kr={}));let Tr,xr,Mr,Hr,jr,Jr,Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Wr=!1,qr="default",Kr="'",Yr=1;function zr(u,e=!1){xr=String(u),Lr="start",Gr=[],Vr=0,$r=1,Ur=0,Hr=void 0,Wr=e;do{Tr=Zr(),nn[Lr]()}while("eof"!==Tr.type);return Hr}function Zr(){for(qr="default",jr="",Kr="'",Yr=1;;){Jr=Xr();const u=un[qr]();if(u)return u}}function Xr(){if(xr[Vr])return String.fromCodePoint(xr.codePointAt(Vr))}function Qr(){const u=Xr();return"\n"===u?($r++,Ur=0):u?Ur+=u.length:Ur++,u&&(Vr+=u.length),u}Q.parseJsonFile=function(u,e=!1,t="utf-8"){const r=gr.default.readFileSync(Nr.default.resolve(u),{encoding:t});try{return zr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,Ir.logErrorAndExit)(`${t[0].trim()}${Rr.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,Ir.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},Q.parseJsonText=zr;const un={default(){switch(Jr){case"/":return Qr(),void(qr="comment");case void 0:return Qr(),en("eof")}if(!br.JudgeUtil.isIgnoreChar(Jr)&&!br.JudgeUtil.isSpaceSeparator(Jr))return un[Lr]();Qr()},start(){qr="value"},beforePropertyName(){switch(Jr){case"$":case"_":return jr=Qr(),void(qr="identifierName");case"\\":return Qr(),void(qr="identifierNameStartEscape");case"}":return en("punctuator",Qr());case'"':case"'":return Kr=Jr,Qr(),void(qr="string")}if(br.JudgeUtil.isIdStartChar(Jr))return jr+=Qr(),void(qr="identifierName");throw an(kr.Char,Qr())},afterPropertyName(){if(":"===Jr)return en("punctuator",Qr());throw an(kr.Char,Qr())},beforePropertyValue(){qr="value"},afterPropertyValue(){switch(Jr){case",":case"}":return en("punctuator",Qr())}throw an(kr.Char,Qr())},beforeArrayValue(){if("]"===Jr)return en("punctuator",Qr());qr="value"},afterArrayValue(){switch(Jr){case",":case"]":return en("punctuator",Qr())}throw an(kr.Char,Qr())},end(){throw an(kr.Char,Qr())},comment(){switch(Jr){case"*":return Qr(),void(qr="multiLineComment");case"/":return Qr(),void(qr="singleLineComment")}throw an(kr.Char,Qr())},multiLineComment(){switch(Jr){case"*":return Qr(),void(qr="multiLineCommentAsterisk");case void 0:throw an(kr.Char,Qr())}Qr()},multiLineCommentAsterisk(){switch(Jr){case"*":return void Qr();case"/":return Qr(),void(qr="default");case void 0:throw an(kr.Char,Qr())}Qr(),qr="multiLineComment"},singleLineComment(){switch(Jr){case"\n":case"\r":case"\u2028":case"\u2029":return Qr(),void(qr="default");case void 0:return Qr(),en("eof")}Qr()},value(){switch(Jr){case"{":case"[":return en("punctuator",Qr());case"n":return Qr(),tn("ull"),en("null",null);case"t":return Qr(),tn("rue"),en("boolean",!0);case"f":return Qr(),tn("alse"),en("boolean",!1);case"-":case"+":return"-"===Qr()&&(Yr=-1),void(qr="numerical");case".":case"0":case"I":case"N":return void(qr="numerical");case'"':case"'":return Kr=Jr,Qr(),jr="",void(qr="string")}if(void 0===Jr||!br.JudgeUtil.isDigitWithoutZero(Jr))throw an(kr.Char,Qr());qr="numerical"},numerical(){switch(Jr){case".":return jr=Qr(),void(qr="decimalPointLeading");case"0":return jr=Qr(),void(qr="zero");case"I":return Qr(),tn("nfinity"),en("numeric",Yr*(1/0));case"N":return Qr(),tn("aN"),en("numeric",NaN)}if(void 0!==Jr&&br.JudgeUtil.isDigitWithoutZero(Jr))return jr=Qr(),void(qr="decimalInteger");throw an(kr.Char,Qr())},zero(){switch(Jr){case".":case"e":case"E":return void(qr="decimal");case"x":case"X":return jr+=Qr(),void(qr="hexadecimal")}return en("numeric",0)},decimalInteger(){switch(Jr){case".":case"e":case"E":return void(qr="decimal")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimal(){switch(Jr){case".":jr+=Qr(),qr="decimalFraction";break;case"e":case"E":jr+=Qr(),qr="decimalExponent"}},decimalPointLeading(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalFraction");throw an(kr.Char,Qr())},decimalFraction(){switch(Jr){case"e":case"E":return jr+=Qr(),void(qr="decimalExponent")}if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},decimalExponent(){switch(Jr){case"+":case"-":return jr+=Qr(),void(qr="decimalExponentSign")}if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentSign(){if(br.JudgeUtil.isDigit(Jr))return jr+=Qr(),void(qr="decimalExponentInteger");throw an(kr.Char,Qr())},decimalExponentInteger(){if(!br.JudgeUtil.isDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},hexadecimal(){if(br.JudgeUtil.isHexDigit(Jr))return jr+=Qr(),void(qr="hexadecimalInteger");throw an(kr.Char,Qr())},hexadecimalInteger(){if(!br.JudgeUtil.isHexDigit(Jr))return en("numeric",Yr*Number(jr));jr+=Qr()},identifierNameStartEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":break;default:if(!br.JudgeUtil.isIdStartChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},identifierName(){switch(Jr){case"$":case"_":case"‌":case"‍":return void(jr+=Qr());case"\\":return Qr(),void(qr="identifierNameEscape")}if(!br.JudgeUtil.isIdContinueChar(Jr))return en("identifier",jr);jr+=Qr()},identifierNameEscape(){if("u"!==Jr)throw an(kr.Char,Qr());Qr();const u=rn();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!br.JudgeUtil.isIdContinueChar(u))throw an(kr.Identifier)}jr+=u,qr="identifierName"},string(){switch(Jr){case"\\":return Qr(),void(jr+=function(){const u=Xr(),e=function(){switch(Xr()){case"b":return Qr(),"\b";case"f":return Qr(),"\f";case"n":return Qr(),"\n";case"r":return Qr(),"\r";case"t":return Qr(),"\t";case"v":return Qr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Qr(),br.JudgeUtil.isDigit(Xr()))throw an(kr.Char,Qr());return"\0";case"x":return Qr(),function(){let u="",e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());if(u+=Qr(),e=Xr(),!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());return u+=Qr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Qr(),rn();case"\n":case"\u2028":case"\u2029":return Qr(),"";case"\r":return Qr(),"\n"===Xr()&&Qr(),""}if(void 0===u||br.JudgeUtil.isDigitWithoutZero(u))throw an(kr.Char,Qr());return Qr()}());case'"':case"'":if(Jr===Kr){const u=en("string",jr);return Qr(),u}return void(jr+=Qr());case"\n":case"\r":case void 0:throw an(kr.Char,Qr());case"\u2028":case"\u2029":!function(u){(0,Ir.logErrorAndExit)(`JSON5: '${cn(u)}' in strings is not valid ECMAScript; consider escaping.`)}(Jr)}jr+=Qr()}};function en(u,e){return{type:u,value:e,line:$r,column:Ur}}function tn(u){for(const e of u){if(Xr()!==e)throw an(kr.Char,Qr());Qr()}}function rn(){let u="",e=4;for(;e-- >0;){const e=Xr();if(!br.JudgeUtil.isHexDigit(e))throw an(kr.Char,Qr());u+=Qr()}return String.fromCodePoint(parseInt(u,16))}const nn={start(){if("eof"===Tr.type)throw an(kr.EOF);on()},beforePropertyName(){switch(Tr.type){case"identifier":case"string":return Mr=Tr.value,void(Lr="afterPropertyName");case"punctuator":return void Dn();case"eof":throw an(kr.EOF)}},afterPropertyName(){if("eof"===Tr.type)throw an(kr.EOF);Lr="beforePropertyValue"},beforePropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);on()},afterPropertyValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforePropertyName");case"}":Dn()}},beforeArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);"punctuator"!==Tr.type||"]"!==Tr.value?on():Dn()},afterArrayValue(){if("eof"===Tr.type)throw an(kr.EOF);switch(Tr.value){case",":return void(Lr="beforeArrayValue");case"]":Dn()}},end(){}};function on(){const u=function(){let u;switch(Tr.type){case"punctuator":switch(Tr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Tr.value}return u}();if(Wr&&"object"==typeof u&&(u._line=$r,u._column=Ur),void 0===Hr)Hr=u;else{const e=Gr[Gr.length-1];Array.isArray(e)?Wr&&"object"!=typeof u?e.push({value:u,_line:$r,_column:Ur}):e.push(u):e[Mr]=Wr&&"object"!=typeof u?{value:u,_line:$r,_column:Ur}:u}!function(u){if(u&&"object"==typeof u)Gr.push(u),Lr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function Dn(){Gr.pop();const u=Gr[Gr.length-1];Lr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function cn(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function an(u,e){let t="";switch(u){case kr.Char:t=void 0===e?`JSON5: invalid end of input at ${$r}:${Ur}`:`JSON5: invalid character '${cn(e)}' at ${$r}:${Ur}`;break;case kr.EOF:t=`JSON5: invalid end of input at ${$r}:${Ur}`;break;case kr.Identifier:Ur-=5,t=`JSON5: invalid identifier character at ${$r}:${Ur}`}const r=new sn(t);return r.lineNumber=$r,r.columnNumber=Ur,r}class sn extends SyntaxError{}var fn=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),En=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),ln=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&fn(e,u,t);return En(e,u),e};Object.defineProperty(X,"__esModule",{value:!0});var Fn=X.executeInstallHvigor=vn=X.isHvigorInstalled=void 0;const Cn=ln(s.default),An=ln(f.default),dn=m,yn=I,pn=k,hn=Q;let mn,Bn;var vn=X.isHvigorInstalled=function(){return mn=function(){const u=An.resolve(dn.HVIGOR_PROJECT_WRAPPER_HOME,dn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(!Cn.existsSync(u))throw new Error(`Error: Hvigor config file ${u} does not exist.`);return(0,hn.parseJsonFile)(u)}(),Bn=Cn.existsSync(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,hn.parseJsonFile)(dn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}},!(!(0,yn.hasNpmPackInPaths)(dn.HVIGOR_ENGINE_PACKAGE_NAME,[dn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||mn.hvigorVersion!==Bn.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const Sn={cwd:dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};Fn=X.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[dn.HVIGOR_ENGINE_PACKAGE_NAME]=mn.hvigorVersion;try{Cn.mkdirSync(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=An.resolve(dn.HVIGOR_PROJECT_DEPENDENCIES_HOME,dn.DEFAULT_PACKAGE_JSON);Cn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,pn.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",dn.HVIGOR_PNPM_STORE_PATH];(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,Sn)}(),(0,yn.executeCommand)(dn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Sn)};var _n={},On=p&&p.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),wn=p&&p.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),Pn=p&&p.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&On(e,u,t);return wn(e,u),e};Object.defineProperty(_n,"__esModule",{value:!0});var bn=_n.executeBuild=void 0;const gn=m,Nn=Pn(s.default),Rn=Pn(f.default),In=k;bn=_n.executeBuild=function(){const u=Rn.resolve(gn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=Nn.realpathSync(u);require(e)}catch(e){(0,In.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${gn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},Z()||U(),vn()||Fn(),bn(); \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/hvigorfile.ts b/ExcellentCase/Multi_device_V2/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/oh-package.json5 b/ExcellentCase/Multi_device_V2/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d23825ce8b609411dfc41f26589562e4acbb0cfe --- /dev/null +++ b/ExcellentCase/Multi_device_V2/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "multi_device_v2", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/ExcellentCase/Multi_device_V2/product/default/build-profile.json5 b/ExcellentCase/Multi_device_V2/product/default/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/hvigorfile.ts b/ExcellentCase/Multi_device_V2/product/default/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/ExcellentCase/Multi_device_V2/product/default/oh-package.json5 b/ExcellentCase/Multi_device_V2/product/default/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..232067c07f7b5266c750076cd17a597614b5ef30 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": { + "@ohos/common": "file:../../common" + } +} diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/entryability/EntryAbility.ts b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4779e165c2b5c00081b0b7180d4d4ef9eeec7aa1 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/MainPage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/pages/MainPage.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/pages/MainPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..05be220817d26ef374dc9a7ef4d36a602b73a4cf --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/pages/MainPage.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { BreakpointSystem, CommonConstants as Const } from '@ohos/common'; +import { BottomTabs } from '../view/BottomTabsComponent'; +import { LeftTabs } from '../view/LeftTabsComponent'; +import { HomeTabs } from '../view/HomeTabsComponent'; +import { FindTabs } from '../view/FindTabsComponent'; +import { DriveTabs } from '../view/DriveTabsComponent'; +import { MineTabs } from '../view/MineTabsComponent'; + +@Entry +@Component +struct MainPage { + @State @Watch('onIndexChange') bottomTabIndex: number = 0; + @StorageProp('currentBreakpoint') currentBreakpoint: string = Const.MD; + private breakpointSystem: BreakpointSystem = new BreakpointSystem(); + private controller: TabsController = new TabsController(); + + aboutToAppear(){ + this.breakpointSystem.register(); + } + + aboutToDisappear() { + this.breakpointSystem.unregister(); + } + + onIndexChange() { + this.controller.changeIndex(this.bottomTabIndex); + } + + build() { + SideBarContainer(SideBarContainerType.Embed) { + LeftTabs({ bottomTabIndex: $bottomTabIndex }); + + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.End, justifyContent: FlexAlign.End }) { + Tabs({ barPosition: BarPosition.End, index: 0, controller: this.controller }) { + TabContent() { + HomeTabs({ currentBreakpoint: $currentBreakpoint }) + } + .padding({ + left: this.currentBreakpoint === Const.SM ? $r('app.float.main_page_padding1') : (this.currentBreakpoint === Const.MD ? $r('app.float.main_page_padding3') : 0), + right: this.currentBreakpoint === Const.SM ? $r('app.float.main_page_padding1') : $r('app.float.main_page_padding3') + }) + + TabContent() { + FindTabs() + } + .padding({ + left: this.currentBreakpoint === Const.SM ? $r('app.float.main_page_padding2') : (this.currentBreakpoint === Const.MD ? $r('app.float.main_page_padding3') : 0), + right: this.currentBreakpoint === Const.SM ? $r('app.float.main_page_padding2') : $r('app.float.main_page_padding3') + }) + + TabContent() { + DriveTabs() + } + .padding({ + left: this.currentBreakpoint === Const.SM ? $r('app.float.main_page_padding1') : (this.currentBreakpoint === Const.MD ? $r('app.float.main_page_padding3') : 0), + right: this.currentBreakpoint === Const.SM ? $r('app.float.main_page_padding1') : $r('app.float.main_page_padding3') + }) + + TabContent() { + MineTabs() + } + } + .onChange((index: number) => { + this.bottomTabIndex = index; + }) + .width(Const.FULL_SIZE) + .vertical(false) + .barHeight(0) + + if (this.currentBreakpoint !== Const.LG) { + BottomTabs({ bottomTabIndex: $bottomTabIndex }) + } + } + .width(Const.FULL_SIZE) + .backgroundColor($r('app.color.background_color')) + } + .showSideBar(this.currentBreakpoint === Const.LG) + .showControlButton(false) + .sideBarWidth(Const.SIDEBAR_WIDTH) + .maxSideBarWidth(Const.SIDEBAR_WIDTH_MAX) + .minSideBarWidth(Const.SIDEBAR_WIDTH_MIN) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/BottomTabsComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/BottomTabsComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..56adfd1ca97ab13ea2d96a299b3ceaf7f28e7b4e --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/BottomTabsComponent.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { BottomTabsItem, CommonConstants as Const } from '@ohos/common'; +import { BottomTabsList } from '../viewmodel/BottomTabsModel'; + +function getTabImgSrc(item: BottomTabsItem, index: number) { + let imgSrc = item.icon; + if (BottomTabsList.indexOf(item) === index) { + imgSrc = item.iconSelected; + } + return imgSrc; +} + +function getTabTextColor(item: BottomTabsItem, index: number) { + let color = $r('app.color.bottom_tabs_font_color'); + if (BottomTabsList.indexOf(item) === index) { + color = $r('app.color.bottom_tabs_font_color_selected'); + } + return color; +} + +@Component +export struct BottomTabs { + @Link bottomTabIndex: number; + + build() { + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Center }) { + ForEach(BottomTabsList, (item: BottomTabsItem) => { + Column() { + Image(getTabImgSrc(item, this.bottomTabIndex)) + .width(Const.BOTTOM_IMAGE_SIZE) + .height(Const.BOTTOM_IMAGE_SIZE) + .objectFit(ImageFit.Contain) + .margin({ bottom: $r('app.float.bottom_margin') }) + + Text(item.text) + .fontSize($r('app.float.bottom_font_size')) + .opacity(Const.OPACITY) + .fontColor(getTabTextColor(item, this.bottomTabIndex)) + } + .width(Const.BOTTOM_TAB_WIDTH) + .onClick(() => { + this.bottomTabIndex = BottomTabsList.indexOf(item); + }) + }, item => JSON.stringify(item)) + } + .width(Const.FULL_SIZE) + .height(Const.BOTTOM_TAB_HEIGHT) + .backgroundColor($r('app.color.bottom_tabs_background_color')) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/DriveTabsComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/DriveTabsComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..b92dbc2f2008e409265ce4c1f8a118366f75b3e6 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/DriveTabsComponent.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { DriveTabsItem, CommonConstants as Const } from '@ohos/common'; +import { DriveList } from '../viewmodel/DriveTabsModel'; + +@Component +export struct DriveTabs { + private scroller: Scroller = new Scroller(); + + build() { + Scroll(this.scroller) { + GridRow({ + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x : $r('app.float.gutter_drive') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + Row() { + Text($r('app.string.title_drive')) + .fontSize($r('app.float.title_font_size')) + .fontWeight(Const.FONT_WEIGHT) + .width(Const.FULL_SIZE) + .margin({ + top: $r('app.float.drive_title_margin'), + bottom: $r('app.float.drive_title_margin'), + left: $r('app.float.drive_title_margin') + }) + } + } + .height($r('app.float.title_height')) + + ForEach(DriveList, (item: DriveTabsItem) => { + GridCol({ span: { xs: Const.NUM_2, sm: Const.NUM_2, md: Const.NUM_2, lg: Const.NUM_2 } }) { + Column() { + Image(item.img) + .aspectRatio(1) + .margin({ bottom: $r('app.float.drive_image_margin') }) + + Text(item.title) + .fontSize($r('app.float.drive_text_font_size1')) + .fontWeight(Const.FONT_WEIGHT) + .width(Const.FULL_SIZE) + .height($r('app.float.drive_text_height1')) + + Text(item.intro) + .fontSize($r('app.float.drive_text_font_size2')) + .opacity(Const.OPACITY) + .width(Const.FULL_SIZE) + .height($r('app.float.drive_text_height2')) + .margin({ bottom: $r('app.float.drive_text_margin') }) + } + } + }, item => JSON.stringify(item)) + } + } + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } +} + diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/FindTabsComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/FindTabsComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..567d03152ec1eff359c38f1c95fff6999f86b092 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/FindTabsComponent.ets @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { FindTabsItem, CommonConstants as Const } from '@ohos/common'; +import { FindTabsList, FindDataSource } from '../viewmodel/FindTabsModel'; + +@Component +export struct FindTabs { + private scroller: Scroller = new Scroller(); + + build() { + Scroll(this.scroller) { + GridRow({ + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x: $r('app.float.gutter_find') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + Row() { + Text($r('app.string.title_find')) + .fontSize($r('app.float.title_font_size')) + .fontWeight(Const.FONT_WEIGHT) + .width(Const.FULL_SIZE) + .margin({ + top: $r('app.float.find_margin5'), + bottom: $r('app.float.find_margin5'), + left: $r('app.float.find_margin6') + }) + } + } + .height($r('app.float.title_height')) + + LazyForEach(new FindDataSource(FindTabsList), (item: FindTabsItem) => { + GridCol({ + span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_6, lg: Const.GRID_8 }, + offset: { + md: FindTabsList.indexOf(item) === Const.OFFSET_0 ? Const.OFFSET_1 : Const.OFFSET_2, + lg: FindTabsList.indexOf(item) === Const.OFFSET_0 ? Const.OFFSET_2 : Const.OFFSET_4 + } + }) { + Row() { + Image(item.img) + .width($r('app.float.find_image_size')) + .objectFit(ImageFit.Contain) + + Column() { + Text(item.title) + .fontSize($r('app.float.find_title_size')) + .fontWeight(Const.FONT_WEIGHT) + .margin({ bottom: $r('app.float.find_title_margin') }) + + Row() { + Column() { + Text(item.category) + .fontSize($r('app.float.find_category_size')) + .fontColor($r('app.color.find_text_font_color')) + } + .borderRadius($r('app.float.find_radius')) + .padding({ + top: $r('app.float.find_margin1'), + bottom: $r('app.float.find_margin1'), + left: $r('app.float.find_margin2'), + right: $r('app.float.find_margin2') + }) + .margin({ right: $r('app.float.find_margin3') }) + .backgroundColor($r('app.color.find_text_background_color')) + + Column() { + Text(item.barrage) + .fontSize($r('app.float.find_category_size')) + .fontColor($r('app.color.find_text_font_color')) + } + .borderRadius($r('app.float.find_radius')) + .padding({ + top: $r('app.float.find_margin1'), + bottom: $r('app.float.find_margin1'), + left: $r('app.float.find_margin2'), + right: $r('app.float.find_margin2') + }) + .backgroundColor($r('app.color.find_text_background_color')) + } + .margin({ bottom: $r('app.float.find_margin4') }) + + Text(item.intro) + .fontSize($r('app.float.find_intro_size')) + .fontWeight(Const.FONT_WEIGHT) + .opacity(Const.OPACITY) + + } + .width($r('app.float.find_column_width')) + .margin({ left: $r('app.float.find_margin5') }) + .alignItems(HorizontalAlign.Start) + + Blank() + + Row() { + Text(item.visits) + .fontSize($r('app.float.find_title_size')) + .fontWeight(Const.FONT_WEIGHT) + .width($r('app.float.find_text_width')) + .margin({ right: $r('app.float.find_margin3') }) + + Image($r('app.media.ic_visits')) + .width($r('app.float.find_row_height')) + .height($r('app.float.find_row_height')) + } + .width($r('app.float.find_row_width')) + } + .width(Const.FULL_SIZE) + .margin({ bottom: $r('app.float.find_margin5') }) + } + }, item => JSON.stringify(item)) + } + } + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } +} diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/HomeTabsComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/HomeTabsComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..afd8114750499d07072cd482887f23764e1fedf2 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/HomeTabsComponent.ets @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { HomeTabsItem, CommonConstants as Const } from '@ohos/common'; +import { SwiperList } from '../viewmodel/HomeTabsModel'; +import { RecentlyPlayed } from './RecentlyPlayedComponent'; +import { Recommended } from './RecommendedComponent'; + +@Component +export struct HomeTabs { + @Link currentBreakpoint: string; + private scroller: Scroller = new Scroller(); + + build() { + Scroll(this.scroller) { + GridRow({ + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x: $r('app.float.gutter_home') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + Row() { + Text($r('app.string.title_home')) + .fontSize($r('app.float.title_font_size')) + .fontWeight(Const.FONT_WEIGHT) + .width(Const.FULL_SIZE) + .margin({ + top: $r('app.float.home_title_margin'), + bottom: $r('app.float.home_title_margin'), + left: $r('app.float.home_title_margin') + }) + } + } + .height($r('app.float.title_height')) + .margin({ bottom: $r('app.float.home_margin1') }) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_8 } }) { + Search({ placeholder: Const.SEARCH_TEXT }) + .width(Const.FULL_SIZE) + .height($r('app.float.home_search_height')) + .margin({ bottom: $r('app.float.home_margin1') }) + .placeholderFont({ size: $r('app.float.home_search_size') }) + } + .height($r('app.float.home_grid_height1')) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + Swiper() { + ForEach(SwiperList, (item: HomeTabsItem) => { + Stack({ alignContent: Alignment.TopStart }) { + Image(item.img) + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + .borderRadius($r('app.float.home_swiper_radius')) + .objectFit(ImageFit.Cover) + + Column() { + Text(item.title) + .fontSize($r('app.float.home_text_size1')) + .fontColor(Color.White) + .margin({ bottom: $r('app.float.home_text_margin_1') }) + Text(item.intro) + .fontSize($r('app.float.home_text_size3')) + .fontColor(Color.White) + .opacity(Const.OPACITY) + } + .alignItems(HorizontalAlign.Start) + .margin({ top: $r('app.float.home_text_margin_3'), left: $r('app.float.home_text_margin_2') }) + } + }, item => JSON.stringify(item)) + } + .height($r('app.float.home_swiper_height')) + .itemSpace(Const.ITEM_SPACE) + .autoPlay(true) + .displayCount(this.currentBreakpoint === Const.LG ? + Const.NUM_3 : (this.currentBreakpoint === Const.MD ? Const.NUM_2 : Const.NUM_1)) + } + .height($r('app.float.home_grid_height2')) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + RecentlyPlayed() + } + .height($r('app.float.home_grid_height3')) + + GridCol({ span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 } }) { + Recommended() + } + .height($r('app.float.home_column_height')) + } + .height(Const.FULL_SIZE) + } + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + .align(Alignment.TopStart) + .scrollBar(BarState.Off) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/LeftTabsComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/LeftTabsComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..35da456551ff4fc2071b5643b6b3985cccbd0544 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/LeftTabsComponent.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { BottomTabsItem, CommonConstants as Const } from '@ohos/common'; +import { BottomTabsList } from '../viewmodel/BottomTabsModel'; + +function getTabImgSrc(item: BottomTabsItem, index: number) { + let imgSrc = item.icon; + if (BottomTabsList.indexOf(item) === index) { + imgSrc = item.iconSelected; + } + return imgSrc; +} + +function getTabTextColor(item: BottomTabsItem, index: number) { + let color = $r('app.color.bottom_tabs_font_color'); + if (BottomTabsList.indexOf(item) === index) { + color = $r('app.color.bottom_tabs_font_color_selected'); + } + return color; +} + +@Component +export struct LeftTabs { + @Link bottomTabIndex: number; + + build() { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Row() + .width(Const.FULL_SIZE) + .height(Const.ROW_WIDTH) + + ForEach(BottomTabsList, (item: BottomTabsItem) => { + Column() { + Image(getTabImgSrc(item, this.bottomTabIndex)) + .width(Const.LEFT_IMAGE_SIZE) + .height(Const.LEFT_IMAGE_SIZE) + .objectFit(ImageFit.Contain) + .margin({ bottom: $r('app.float.left_margin') }) + + Text(item.text) + .fontSize($r('app.float.left_font_size')) + .opacity(Const.OPACITY) + .fontColor(getTabTextColor(item, this.bottomTabIndex)) + } + .width(Const.FULL_SIZE) + .height(Const.LEFT_TAB_HEIGHT) + .onClick(() => { + this.bottomTabIndex = BottomTabsList.indexOf(item); + }) + }, item => JSON.stringify(item)) + + Row() + .width(Const.FULL_SIZE) + .height(Const.ROW_WIDTH) + } + .width(Const.LEFT_TAB_WIDTH) + .height(Const.FULL_SIZE) + .backgroundColor($r('app.color.bottom_tabs_background_color')) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/MineTabsComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/MineTabsComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..a32bf3888312971f75b55630e032f50143692cdd --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/MineTabsComponent.ets @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { MineTabsItem, CommonConstants as Const } from '@ohos/common'; +import { MineTabsList } from '../viewmodel/MineTabsModel'; + +@Component +export struct MineTabs { + private scroller: Scroller = new Scroller(); + + build() { + Scroll(this.scroller) { + GridRow({ + columns: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_12 }, + gutter: { x: $r('app.float.gutter_mine') }, + breakpoints: { value: [Const.BREAKPOINTS_SM, Const.BREAKPOINTS_MD, Const.BREAKPOINTS_LG] } + }) { + GridCol({ + span: { xs: Const.GRID_4, sm: Const.GRID_4, md: Const.GRID_8, lg: Const.GRID_8 }, + offset: { lg: Const.OFFSET_2 } + }) { + Stack () { + Column() { + Text($r('app.string.title_mine')) + .height($r('app.float.mine_text_height')) + .fontSize($r('app.float.mine_text_font_size1')) + .margin({ bottom: $r('app.float.mine_text_margin') }) + + List() { + ForEach(MineTabsList, (item: MineTabsItem) => { + ListItem() { + Row() { + Image(item.icon) + .width($r('app.float.mine_image_size1')) + .height($r('app.float.mine_image_size1')) + .margin({ right: $r('app.float.mine_image_margin') }) + + Row() { + Text(item.title) + .fontSize($r('app.float.mine_text_font_size2')) + .fontWeight(Const.FONT_WEIGHT) + + Image(item.more) + .width($r('app.float.mine_image_size2')) + .objectFit(ImageFit.Contain) + } + .height(Const.FULL_SIZE) + .layoutWeight(1) + .justifyContent(FlexAlign.SpaceBetween) + .borderWidth({ bottom: MineTabsList.indexOf(item) !== Const.NUM_4 ? $r('app.float.mine_row_border_width') : 0 }) + .borderColor($r('app.color.background_color')) + } + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + } + .width(Const.FULL_SIZE) + .height($r('app.float.mine_list_height')) + }, item => JSON.stringify(item)) + } + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + .layoutWeight(1) + } + .width(Const.FULL_SIZE) + .height(Const.MINE_COLUMN_HEIGHT) + .borderRadius({ topLeft: $r('app.float.mine_list_border_radius'), topRight: $r('app.float.mine_list_border_radius') }) + .backgroundColor(Color.White) + .position({ y: Const.MINE_IMAGE_Y }) + .padding({ top: $r('app.float.mine_list_padding1'), left: $r('app.float.mine_list_padding2'), right: $r('app.float.mine_list_padding2') }) + + Image($r('app.media.ic_profile_photo')) + .width($r('app.float.mine_image_size3')) + .height($r('app.float.mine_image_size3')) + .objectFit(ImageFit.Contain) + .markAnchor({ x: $r('app.float.mine_image_anchor'), y: $r('app.float.mine_image_anchor') }) + .position({ x: Const.MINE_IMAGE_X, y: Const.MINE_IMAGE_Y }) + } + .width(Const.FULL_SIZE) + .height(Const.FULL_SIZE) + .backgroundColor($r('app.color.mine_background_color')) + } + } + .height(Const.FULL_SIZE) + .backgroundColor($r('app.color.mine_background_color')) + } + .width(Const.FULL_SIZE) + .scrollBar(BarState.Off) + .layoutWeight(1) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/RecentlyPlayedComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/RecentlyPlayedComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..937d34856848e96960a3bbf72f751a3a8028f544 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/RecentlyPlayedComponent.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { HomeTabsItem, CommonConstants as Const } from '@ohos/common'; +import { RecentlyPlayList } from '../viewmodel/HomeTabsModel'; + +@Component +export struct RecentlyPlayed { + build() { + Column() { + Row() { + Text($r('app.string.title_home_recently')) + .fontSize($r('app.float.home_text_size1')) + .fontWeight(Const.FONT_WEIGHT) + Blank() + Text($r('app.string.title_home_more')) + .fontSize($r('app.float.home_text_size2')) + .opacity(Const.OPACITY) + Image($r('app.media.ic_more')) + .width($r('app.float.home_image_size')) + } + .width(Const.FULL_SIZE) + .height($r('app.float.home_row_width1')) + .padding({ + top: $r('app.float.home_margin3'), + left: $r('app.float.home_margin2'), + right: $r('app.float.home_margin2') + }) + + Row() { + List({ space: Const.ITEM_SPACE }) { + ForEach(RecentlyPlayList, (item: HomeTabsItem) => { + ListItem() { + Column() { + Image(item.img) + .height($r('app.float.home_image_height')) + .margin({ bottom: $r('app.float.home_margin1') }) + Text(item.title) + .width($r('app.float.home_text_width')) + .height($r('app.float.home_text_height1')) + .fontSize($r('app.float.home_text_size2')) + .fontWeight(Const.FONT_WEIGHT) + Text(item.intro) + .width($r('app.float.home_text_width')) + .height($r('app.float.home_text_height2')) + .fontSize($r('app.float.home_text_size3')) + .opacity(Const.OPACITY) + } + } + }, item => JSON.stringify(item)) + } + .width(Const.FULL_SIZE) + .height($r('app.float.home_row_height1')) + .listDirection(Axis.Horizontal) + } + .width(Const.FULL_SIZE) + .height($r('app.float.home_row_height1')) + } + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/RecommendedComponent.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/RecommendedComponent.ets new file mode 100644 index 0000000000000000000000000000000000000000..c888bbd31fc74611c3785cca0459a33b6538020b --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/view/RecommendedComponent.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { HomeTabsItem, CommonConstants as Const } from '@ohos/common'; +import { RecommendList } from '../viewmodel/HomeTabsModel'; + +@Component +export struct Recommended { + build() { + Column() { + Row() { + Text($r('app.string.title_home_recommend')) + .fontSize($r('app.float.home_text_size1')) + .fontWeight(Const.FONT_WEIGHT) + Blank() + Text($r('app.string.title_home_more')) + .fontSize($r('app.float.home_text_size2')) + .opacity(Const.OPACITY) + Image($r('app.media.ic_more')) + .width($r('app.float.home_image_size')) + } + .width(Const.FULL_SIZE) + .height($r('app.float.home_row_width1')) + .padding({ + top: $r('app.float.home_margin3'), + left: $r('app.float.home_margin2'), + right: $r('app.float.home_margin2') + }) + + Row() { + List({ space: Const.ITEM_SPACE }) { + ForEach(RecommendList, (item: HomeTabsItem) => { + ListItem() { + Column() { + Image(item.img) + .height($r('app.float.home_image_height2')) + .margin({ bottom: $r('app.float.home_margin1') }) + } + } + }, item => JSON.stringify(item)) + } + .width(Const.FULL_SIZE) + .height($r('app.float.home_list_height2')) + .listDirection(Axis.Horizontal) + } + .width(Const.FULL_SIZE) + } + .height($r('app.float.home_column_height')) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/BottomTabsModel.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/BottomTabsModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..8514ac91ae6a84788a5dc9c97aa90a3899eee6c2 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/BottomTabsModel.ets @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { BottomTabsItem } from '@ohos/common'; + +export const BottomTabsList: Array = [ + { + icon: $r('app.media.ic_home'), + iconSelected: $r('app.media.ic_home_selected'), + text: $r('app.string.bottom_text_home') + }, + { + icon: $r('app.media.ic_find'), + iconSelected: $r('app.media.ic_find_selected'), + text: $r('app.string.bottom_text_find') + }, + { + icon: $r('app.media.ic_drive'), + iconSelected: $r('app.media.ic_drive_selected'), + text: $r('app.string.bottom_text_drive') + }, + { + icon: $r('app.media.ic_mine'), + iconSelected: $r('app.media.ic_mine_selected'), + text: $r('app.string.bottom_text_mine') + } +] \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/DriveTabsModel.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/DriveTabsModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..22c34a4622c4851d3d97fe76b30a68e91775ba18 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/DriveTabsModel.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { DriveTabsItem } from '@ohos/common'; + +export const DriveList: Array = [ + { + img: $r('app.media.ic_drive_1'), + title: $r('app.string.recently_play1_title'), + intro: $r('app.string.recently_play1_intro') + }, + { + img: $r('app.media.ic_drive_2'), + title: $r('app.string.recently_play2_title'), + intro: $r('app.string.recently_play2_intro') + }, + { + img: $r('app.media.ic_drive_3'), + title: $r('app.string.recently_play3_title'), + intro: $r('app.string.recently_play3_intro') + }, + { + img: $r('app.media.ic_drive_4'), + title: $r('app.string.recently_play4_title'), + intro: $r('app.string.recently_play4_intro') + }, + { + img: $r('app.media.ic_drive_5'), + title: $r('app.string.recently_play5_title'), + intro: $r('app.string.recently_play5_intro') + }, + { + img: $r('app.media.ic_drive_6'), + title: $r('app.string.recently_play6_title'), + intro: $r('app.string.recently_play6_intro') + }, + { + img: $r('app.media.ic_drive_7'), + title: $r('app.string.recently_play7_title'), + intro: $r('app.string.recently_play7_intro') + } +] \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/FindTabsModel.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/FindTabsModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..721dd5b8a8d59d8f185e672f1db470e9b8a1157f --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/FindTabsModel.ets @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { FindTabsItem } from '@ohos/common'; + +export const FindTabsList: Array = [ + { + img: $r('app.media.ic_find_1'), + title: $r('app.string.find_item1_title'), + category: $r('app.string.find_item1_category'), + barrage: $r('app.string.find_item1_barrage'), + visits: $r('app.string.find_item1_visits'), + intro: $r('app.string.find_item1_intro') + }, + { + img: $r('app.media.ic_find_2'), + title: $r('app.string.find_item2_title'), + category: $r('app.string.find_item2_category'), + barrage: $r('app.string.find_item2_barrage'), + visits: $r('app.string.find_item2_visits'), + intro: $r('app.string.find_item2_intro') + }, + { + img: $r('app.media.ic_find_3'), + title: $r('app.string.find_item3_title'), + category: $r('app.string.find_item3_category'), + barrage: $r('app.string.find_item3_barrage'), + visits: $r('app.string.find_item3_visits'), + intro: $r('app.string.find_item3_intro') + }, + { + img: $r('app.media.ic_find_4'), + title: $r('app.string.find_item4_title'), + category: $r('app.string.find_item4_category'), + barrage: $r('app.string.find_item4_barrage'), + visits: $r('app.string.find_item4_visits'), + intro: $r('app.string.find_item4_intro') + }, + { + img: $r('app.media.ic_find_5'), + title: $r('app.string.find_item5_title'), + category: $r('app.string.find_item5_category'), + barrage: $r('app.string.find_item5_barrage'), + visits: $r('app.string.find_item5_visits'), + intro: $r('app.string.find_item5_intro') + }, + { + img: $r('app.media.ic_find_6'), + title: $r('app.string.find_item6_title'), + category: $r('app.string.find_item6_category'), + barrage: $r('app.string.find_item6_barrage'), + visits: $r('app.string.find_item6_visits'), + intro: $r('app.string.find_item6_intro') + } +] + +export class FindDataSource implements IDataSource { + private dataArray: FindTabsItem[] = []; + private listeners: DataChangeListener[] = []; + + constructor(element: FindTabsItem[]) { + for (let index = 0; index < element.length; index++) { + this.dataArray.push(element[index]); + } + } + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): FindTabsItem { + return this.dataArray[index]; + } + + public addData(index: number, data: FindTabsItem): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: FindTabsItem): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/HomeTabsModel.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/HomeTabsModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ff77348711e85c3f3de9971ae039746d141813d --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/HomeTabsModel.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { HomeTabsItem } from '@ohos/common'; + +export const SwiperList: Array = [ + { + img: $r('app.media.ic_swiper_1'), + title: $r('app.string.swiper1_title'), + intro: $r('app.string.swiper1_intro') + }, + { + img: $r('app.media.ic_swiper_2'), + title: $r('app.string.swiper2_title'), + intro: $r('app.string.swiper2_intro') + }, + { + img: $r('app.media.ic_swiper_3'), + title: $r('app.string.swiper3_title'), + intro: $r('app.string.swiper3_intro') + } +] + +export const RecentlyPlayList: Array = [ + { + img: $r('app.media.ic_drive_1'), + title: $r('app.string.recently_play1_title'), + intro: $r('app.string.recently_play1_intro') + }, + { + img: $r('app.media.ic_drive_2'), + title: $r('app.string.recently_play2_title'), + intro: $r('app.string.recently_play2_intro') + }, + { + img: $r('app.media.ic_drive_3'), + title: $r('app.string.recently_play3_title'), + intro: $r('app.string.recently_play3_intro') + }, + { + img: $r('app.media.ic_drive_4'), + title: $r('app.string.recently_play4_title'), + intro: $r('app.string.recently_play4_intro') + }, + { + img: $r('app.media.ic_drive_5'), + title: $r('app.string.recently_play5_title'), + intro: $r('app.string.recently_play5_intro') + }, + { + img: $r('app.media.ic_drive_6'), + title: $r('app.string.recently_play6_title'), + intro: $r('app.string.recently_play6_intro') + }, + { + img: $r('app.media.ic_drive_7'), + title: $r('app.string.recently_play7_title'), + intro: $r('app.string.recently_play7_intro') + } +] + +export const RecommendList: Array = [ + { + img: $r('app.media.ic_recommend_1'), + title: $r('app.string.recommend1_title'), + intro: $r('app.string.recommend1_intro') + }, + { + img: $r('app.media.ic_recommend_2'), + title: $r('app.string.recommend2_title'), + intro: $r('app.string.recommend2_intro') + }, + { + img: $r('app.media.ic_recommend_3'), + title: $r('app.string.recommend3_title'), + intro: $r('app.string.recommend3_intro') + } +] diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/MineTabsModel.ets b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/MineTabsModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..c140e1ff588a5403128c64e7dd381f4a38e86add --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/ets/viewmodel/MineTabsModel.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { MineTabsItem } from '@ohos/common'; + +export const MineTabsList: Array = [ + { + icon: $r('app.media.ic_history'), + title: $r('app.string.mine_history'), + more: $r('app.media.ic_more') + }, + { + icon: $r('app.media.ic_collection'), + title: $r('app.string.mine_collection'), + more: $r('app.media.ic_more') + }, + { + icon: $r('app.media.ic_settings'), + title: $r('app.string.mine_settings'), + more: $r('app.media.ic_more') + }, + { + icon: $r('app.media.ic_help'), + title: $r('app.string.mine_help'), + more: $r('app.media.ic_more') + }, + { + icon: $r('app.media.ic_about'), + title: $r('app.string.mine_about'), + more: $r('app.media.ic_more') + } +] \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/module.json5 b/ExcellentCase/Multi_device_V2/product/default/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0c004dd2e1351441d4e578e3a5517d70a582aed2 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/module.json5 @@ -0,0 +1,38 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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" + ] + } + ], + "orientation": "locked" + } + ] + } +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/color.json b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..c62126afde484985b777091d1c47494ff748031d --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/color.json @@ -0,0 +1,36 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "background_color", + "value": "#F1F3F5" + }, + { + "name": "find_text_font_color", + "value": "#E84026" + }, + { + "name": "find_text_background_color", + "value": "#1AE84026" + }, + { + "name": "mine_background_color", + "value": "#E4E4E4" + }, + { + "name": "bottom_tabs_font_color", + "value": "#000000" + }, + { + "name": "bottom_tabs_font_color_selected", + "value": "#007DFF" + }, + { + "name": "bottom_tabs_background_color", + "value": "#F1F3F5" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/float.json b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..1597a16857184dc8c26aebc131ff2810a9e1dd90 --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/float.json @@ -0,0 +1,326 @@ +{ + "float": [ + { + "name": "main_page_padding1", + "value": "12vp" + }, + { + "name": "main_page_padding2", + "value": "11vp" + }, + { + "name": "main_page_padding3", + "value": "24vp" + }, + { + "name": "gutter_home", + "value": "24vp" + }, + { + "name": "gutter_find", + "value": "24vp" + }, + { + "name": "gutter_drive", + "value": "8vp" + }, + { + "name": "gutter_mine", + "value": "24vp" + }, + { + "name": "title_font_size", + "value": "24fp" + }, + { + "name": "title_height", + "value": "56vp" + }, + { + "name": "home_title_margin", + "value": "12vp" + }, + { + "name": "home_margin1", + "value": "8vp" + }, + { + "name": "home_margin2", + "value": "12vp" + }, + { + "name": "home_margin3", + "value": "18vp" + }, + { + "name": "home_grid_height1", + "value": "48vp" + }, + { + "name": "home_grid_height2", + "value": "144vp" + }, + { + "name": "home_grid_height3", + "value": "247vp" + }, + { + "name": "home_search_height", + "value": "40vp" + }, + { + "name": "home_search_size", + "value": "16vp" + }, + { + "name": "home_swiper_height", + "value": "144vp" + }, + { + "name": "home_swiper_item_space", + "value": "12vp" + }, + { + "name": "home_swiper_radius", + "value": "16vp" + }, + { + "name": "home_text_size1", + "value": "16fp" + }, + { + "name": "home_text_size2", + "value": "14fp" + }, + { + "name": "home_text_size3", + "value": "12fp" + }, + { + "name": "home_text_width", + "value": "156vp" + }, + { + "name": "home_text_height1", + "value": "19vp" + }, + { + "name": "home_text_height2", + "value": "16vp" + }, + { + "name": "home_image_size", + "value": "12vp" + }, + { + "name": "home_image_height", + "value": "156vp" + }, + { + "name": "home_image_height2", + "value": "205vp" + }, + { + "name": "home_row_width1", + "value": "48vp" + }, + { + "name": "home_row_height1", + "value": "199vp" + }, + { + "name": "home_list_space", + "value": "12vp" + }, + { + "name": "home_list_height1", + "value": "12vp" + }, + { + "name": "home_list_height2", + "value": "213vp" + }, + { + "name": "home_column_height", + "value": "280vp" + }, + { + "name": "home_text_margin_1", + "value": "4vp" + }, + { + "name": "home_text_margin_2", + "value": "14vp" + }, + { + "name": "home_text_margin_3", + "value": "20vp" + }, + + { + "name": "find_image_size", + "value": "72vp" + }, + { + "name": "find_title_size", + "value": "16fp" + }, + { + "name": "find_title_margin", + "value": "4vp" + }, + { + "name": "find_category_size", + "value": "10fp" + }, + { + "name": "find_radius", + "value": "8vp" + }, + { + "name": "find_margin1", + "value": "1vp" + }, + { + "name": "find_margin2", + "value": "8vp" + }, + { + "name": "find_margin3", + "value": "4vp" + }, + { + "name": "find_margin4", + "value": "6vp" + }, + { + "name": "find_margin5", + "value": "12vp" + }, + { + "name": "find_margin6", + "value": "13vp" + }, + { + "name": "find_intro_size", + "value": "12fp" + }, + { + "name": "find_column_width", + "value": "150vp" + }, + { + "name": "find_text_width", + "value": "38vp" + }, + { + "name": "find_row_width", + "value": "66vp" + }, + { + "name": "find_row_height", + "value": "24vp" + }, + + { + "name": "drive_title_margin", + "value": "12vp" + }, + { + "name": "drive_image_margin", + "value": "8vp" + }, + { + "name": "drive_text_font_size1", + "value": "14fp" + }, + { + "name": "drive_text_height1", + "value": "19vp" + }, + { + "name": "drive_text_font_size2", + "value": "12fp" + }, + { + "name": "drive_text_height2", + "value": "16vp" + }, + { + "name": "drive_text_margin", + "value": "12vp" + }, + { + "name": "mine_text_height", + "value": "32vp" + }, + { + "name": "mine_text_font_size1", + "value": "24fp" + }, + { + "name": "mine_text_margin", + "value": "4vp" + }, + { + "name": "mine_image_size1", + "value": "22vp" + }, + { + "name": "mine_image_margin", + "value": "17vp" + }, + { + "name": "mine_text_font_size2", + "value": "16fp" + }, + { + "name": "mine_image_size2", + "value": "12vp" + }, + { + "name": "mine_row_border_width", + "value": "1vp" + }, + { + "name": "mine_list_height", + "value": "56vp" + }, + { + "name": "mine_list_border_radius", + "value": "24vp" + }, + { + "name": "mine_list_padding1", + "value": "66vp" + }, + { + "name": "mine_list_padding2", + "value": "24vp" + }, + { + "name": "mine_image_size3", + "value": "108vp" + }, + { + "name": "mine_image_anchor", + "value": "54vp" + }, + { + "name": "bottom_font_size", + "value": "10fp" + }, + { + "name": "bottom_margin", + "value": "4vp" + }, + { + "name": "left_margin", + "value": "8vp" + }, + { + "name": "left_font_size", + "value": "14fp" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/string.json b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8e710848c2440d33586652f9854ce4cc67c17efd --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/element/string.json @@ -0,0 +1,303 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Multi Device" + }, + { + "name": "title_home", + "value": "Home" + }, + { + "name": "title_home_recently", + "value": "Recently Played" + }, + { + "name": "title_home_more", + "value": "More" + }, + { + "name": "title_home_recommend", + "value": "Recommended" + }, + { + "name": "title_find", + "value": "Hot List" + }, + { + "name": "title_drive", + "value": "Drive" + }, + { + "name": "title_mine", + "value": "Hanmeimei" + }, + { + "name": "bottom_text_home", + "value": "Home" + }, + { + "name": "bottom_text_find", + "value": "Find" + }, + { + "name": "bottom_text_drive", + "value": "Drive" + }, + { + "name": "bottom_text_mine", + "value": "Mine" + }, + { + "name": "swiper1_title", + "value": "Enjoy a new life" + }, + { + "name": "swiper1_intro", + "value": "Receive up to 500 yuan large coupon" + }, + { + "name": "swiper2_title", + "value": "Turn on the highlight moment" + }, + { + "name": "swiper2_intro", + "value": "Be a strong person in the new semester" + }, + { + "name": "swiper3_title", + "value": "The ultimate mystery is opened" + }, + { + "name": "swiper3_intro", + "value": "Hiding some useful baby" + }, + { + "name": "recently_play1_title", + "value": "Cobalt Blue" + }, + { + "name": "recently_play1_intro", + "value": "Elegant and mysterious" + }, + { + "name": "recently_play2_title", + "value": "Fandai" + }, + { + "name": "recently_play2_intro", + "value": "Youthful and lively" + }, + { + "name": "recently_play3_title", + "value": "Sapphire" + }, + { + "name": "recently_play3_intro", + "value": "Persevere" + }, + { + "name": "recently_play4_title", + "value": "Pure White" + }, + { + "name": "recently_play4_intro", + "value": "Loyalty" + }, + { + "name": "recently_play5_title", + "value": "Joaquin" + }, + { + "name": "recently_play5_intro", + "value": "Extraordinary" + }, + { + "name": "recently_play6_title", + "value": "Crystal Purple" + }, + { + "name": "recently_play6_intro", + "value": "Elegant and swift" + }, + { + "name": "recently_play7_title", + "value": "Rainbow" + }, + { + "name": "recently_play7_intro", + "value": "Vientiane" + }, + { + "name": "recommend1_title", + "value": "Busy Day" + }, + { + "name": "recommend1_intro", + "value": "Don't forget to say good night" + }, + { + "name": "recommend2_title", + "value": "Make a Wish" + }, + { + "name": "recommend2_intro", + "value": "I am the chosen one" + }, + { + "name": "recommend3_title", + "value": "Looking at the Stars" + }, + { + "name": "recommend3_intro", + "value": "What is the end of the universe" + }, + { + "name": "find_item1_title", + "value": "Ferris Wheel Love" + }, + { + "name": "find_item1_category", + "value": "Love" + }, + { + "name": "find_item1_barrage", + "value": "9.99m barrage" + }, + { + "name": "find_item1_visits", + "value": "9421" + }, + { + "name": "find_item1_intro", + "value": "He turned" + }, + { + "name": "find_item2_title", + "value": "Life Blue" + }, + { + "name": "find_item2_category", + "value": "Art" + }, + { + "name": "find_item2_barrage", + "value": "9.92m barrage" + }, + { + "name": "find_item2_visits", + "value": "8700" + }, + { + "name": "find_item2_intro", + "value": "This is the charm of blue" + }, + { + "name": "find_item3_title", + "value": "Past Events in the Northeast" + }, + { + "name": "find_item3_category", + "value": "Record" + }, + { + "name": "find_item3_barrage", + "value": "6.66m barrage" + }, + { + "name": "find_item3_visits", + "value": "7452" + }, + { + "name": "find_item3_intro", + "value": "Hard life is unkillable" + }, + { + "name": "find_item4_title", + "value": "Parallel World" + }, + { + "name": "find_item4_category", + "value": "Science Fiction" + }, + { + "name": "find_item4_barrage", + "value": "5.43m barrage" + }, + { + "name": "find_item4_visits", + "value": "6162" + }, + { + "name": "find_item4_intro", + "value": "Another me in the world" + }, + { + "name": "find_item5_title", + "value": "Rainbow" + }, + { + "name": "find_item5_category", + "value": "Life" + }, + { + "name": "find_item5_barrage", + "value": "4.78m barrage" + }, + { + "name": "find_item5_visits", + "value": "5555" + }, + { + "name": "find_item5_intro", + "value": "Where is the rainbow" + }, + { + "name": "find_item6_title", + "value": "Warder" + }, + { + "name": "find_item6_category", + "value": "Plot" + }, + { + "name": "find_item6_barrage", + "value": "3.21m barrage" + }, + { + "name": "find_item6_visits", + "value": "4396" + }, + { + "name": "find_item6_intro", + "value": "That's all for the story" + }, + { + "name": "mine_history", + "value": "History" + }, + { + "name": "mine_collection", + "value": "Collection" + },{ + "name": "mine_settings", + "value": "Settings" + }, + { + "name": "mine_help", + "value": "Help" + }, + { + "name": "mine_about", + "value": "About" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_about.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_about.png new file mode 100644 index 0000000000000000000000000000000000000000..81bd822b2c45e3590d0ab5a84a540524ffc72380 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_about.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_collection.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_collection.png new file mode 100644 index 0000000000000000000000000000000000000000..abf1e45ede571d1f5fc48fbd5eb45f2bacd1722c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_collection.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive.png new file mode 100644 index 0000000000000000000000000000000000000000..0fa9ee64bf872a6e762e7d9eb175c853937f3f88 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_1.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_1.png new file mode 100644 index 0000000000000000000000000000000000000000..30ff629f113378c63051871eee389f52750ee04c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_1.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_2.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_2.png new file mode 100644 index 0000000000000000000000000000000000000000..1a93773191a63313f5cb41872634d20c926b16aa Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_2.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_3.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_3.png new file mode 100644 index 0000000000000000000000000000000000000000..ea8b70e5ae7269a6000192592df74700058bb51f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_3.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_4.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_4.png new file mode 100644 index 0000000000000000000000000000000000000000..318b16f5d65156dc3380ef691371630ce27a5fa0 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_4.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_5.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_5.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a6ac785db1ea97e7b7e84b725175134cd5dc76 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_5.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_6.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_6.png new file mode 100644 index 0000000000000000000000000000000000000000..12e74549c35241a1b482f493bb8c73b91c4a792a Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_6.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_7.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_7.png new file mode 100644 index 0000000000000000000000000000000000000000..ea8b70e5ae7269a6000192592df74700058bb51f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_7.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_8.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_8.png new file mode 100644 index 0000000000000000000000000000000000000000..30ff629f113378c63051871eee389f52750ee04c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_8.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_selected.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..0a5ed3df2aa3d5ab5521a536002a42db231de78c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_drive_selected.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find.png new file mode 100644 index 0000000000000000000000000000000000000000..afa6fba3bef00520548cc7eefe66514ad79ca154 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_1.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_1.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d0eff53a963fb5c328ad8c56dae622af5d6cc6 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_1.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_2.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c3e34569abea9e43f5aaefbbb82aec39c31535ae Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_2.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_3.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_3.png new file mode 100644 index 0000000000000000000000000000000000000000..4f8596297ca395a793be033f3346e4a49e2b3df4 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_3.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_4.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_4.png new file mode 100644 index 0000000000000000000000000000000000000000..5c388001f4691a7df292efdeaed2e6967235227a Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_4.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_5.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_5.png new file mode 100644 index 0000000000000000000000000000000000000000..0ed8d16f706a0765db0340dff14dc61c74b65e5a Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_5.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_6.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_6.png new file mode 100644 index 0000000000000000000000000000000000000000..2d03f57a88aaa0aa19bfbd71fee7ed76f966747f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_6.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_selected.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..1fed316cba60d71a47a0948973132e2c0c31986e Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_find_selected.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_help.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_help.png new file mode 100644 index 0000000000000000000000000000000000000000..3c3f39b92e5bc03df9a8eeba658ba3fb82a70698 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_help.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_history.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_history.png new file mode 100644 index 0000000000000000000000000000000000000000..e2d629934255ef2aea2e9e24dc4b48611c45329d Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_history.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_home.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_home.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2d1140c1bdaf26ba44d22db178b0286a043ae6 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_home.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_home_selected.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_home_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..5bcb7b96720d3c793f784cad6bd4142b67e389f3 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_home_selected.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_mine.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_mine.png new file mode 100644 index 0000000000000000000000000000000000000000..1376f095845432493506211d067e5154e6723789 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_mine.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_mine_selected.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_mine_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..d6bd95220e449d3aa543f459adaf6459f4020a70 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_mine_selected.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_more.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_more.png new file mode 100644 index 0000000000000000000000000000000000000000..82396101458d101f19789c1ea05d786511222ec7 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_more.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_profile_photo.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_profile_photo.png new file mode 100644 index 0000000000000000000000000000000000000000..4e3ed1458ebf53bbecca1f12ba0549e532729a83 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_profile_photo.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_1.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ee8c8f37f923c7e1e4a3305183f051d93cd5d9f0 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_1.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_2.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e5746aa6ae0416689b87e3e6118e07ed399f518 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_2.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_3.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_3.png new file mode 100644 index 0000000000000000000000000000000000000000..266d70514bf9dcd39f30d4ddc1f2432a50c9bc75 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_recommend_3.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_settings.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_settings.png new file mode 100644 index 0000000000000000000000000000000000000000..717a38ff81dda056eb0468a251ea7901c07caa70 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_settings.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_1.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_1.png new file mode 100644 index 0000000000000000000000000000000000000000..63efc2efff3bd8630b0118c317b0a91ee2c893c4 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_1.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_2.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_2.png new file mode 100644 index 0000000000000000000000000000000000000000..87b449bb440d7969b8e725b9ec3d1f7e1e1a9a80 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_2.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_3.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_3.png new file mode 100644 index 0000000000000000000000000000000000000000..dcd23a4288a35c16488273a72db679f8f60fd4ad Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_swiper_3.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_visits.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_visits.png new file mode 100644 index 0000000000000000000000000000000000000000..48ff9b33b54dc30e46ab85fa0fba9aa1317b7633 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/ic_visits.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/icon.png b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/media/icon.png differ diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/profile/main_pages.json b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..f4241ef2f72e78047b4c449d92bd1a92accc39fb --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/MainPage" + ] +} diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/en_US/element/string.json b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8e710848c2440d33586652f9854ce4cc67c17efd --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/en_US/element/string.json @@ -0,0 +1,303 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "Multi Device" + }, + { + "name": "title_home", + "value": "Home" + }, + { + "name": "title_home_recently", + "value": "Recently Played" + }, + { + "name": "title_home_more", + "value": "More" + }, + { + "name": "title_home_recommend", + "value": "Recommended" + }, + { + "name": "title_find", + "value": "Hot List" + }, + { + "name": "title_drive", + "value": "Drive" + }, + { + "name": "title_mine", + "value": "Hanmeimei" + }, + { + "name": "bottom_text_home", + "value": "Home" + }, + { + "name": "bottom_text_find", + "value": "Find" + }, + { + "name": "bottom_text_drive", + "value": "Drive" + }, + { + "name": "bottom_text_mine", + "value": "Mine" + }, + { + "name": "swiper1_title", + "value": "Enjoy a new life" + }, + { + "name": "swiper1_intro", + "value": "Receive up to 500 yuan large coupon" + }, + { + "name": "swiper2_title", + "value": "Turn on the highlight moment" + }, + { + "name": "swiper2_intro", + "value": "Be a strong person in the new semester" + }, + { + "name": "swiper3_title", + "value": "The ultimate mystery is opened" + }, + { + "name": "swiper3_intro", + "value": "Hiding some useful baby" + }, + { + "name": "recently_play1_title", + "value": "Cobalt Blue" + }, + { + "name": "recently_play1_intro", + "value": "Elegant and mysterious" + }, + { + "name": "recently_play2_title", + "value": "Fandai" + }, + { + "name": "recently_play2_intro", + "value": "Youthful and lively" + }, + { + "name": "recently_play3_title", + "value": "Sapphire" + }, + { + "name": "recently_play3_intro", + "value": "Persevere" + }, + { + "name": "recently_play4_title", + "value": "Pure White" + }, + { + "name": "recently_play4_intro", + "value": "Loyalty" + }, + { + "name": "recently_play5_title", + "value": "Joaquin" + }, + { + "name": "recently_play5_intro", + "value": "Extraordinary" + }, + { + "name": "recently_play6_title", + "value": "Crystal Purple" + }, + { + "name": "recently_play6_intro", + "value": "Elegant and swift" + }, + { + "name": "recently_play7_title", + "value": "Rainbow" + }, + { + "name": "recently_play7_intro", + "value": "Vientiane" + }, + { + "name": "recommend1_title", + "value": "Busy Day" + }, + { + "name": "recommend1_intro", + "value": "Don't forget to say good night" + }, + { + "name": "recommend2_title", + "value": "Make a Wish" + }, + { + "name": "recommend2_intro", + "value": "I am the chosen one" + }, + { + "name": "recommend3_title", + "value": "Looking at the Stars" + }, + { + "name": "recommend3_intro", + "value": "What is the end of the universe" + }, + { + "name": "find_item1_title", + "value": "Ferris Wheel Love" + }, + { + "name": "find_item1_category", + "value": "Love" + }, + { + "name": "find_item1_barrage", + "value": "9.99m barrage" + }, + { + "name": "find_item1_visits", + "value": "9421" + }, + { + "name": "find_item1_intro", + "value": "He turned" + }, + { + "name": "find_item2_title", + "value": "Life Blue" + }, + { + "name": "find_item2_category", + "value": "Art" + }, + { + "name": "find_item2_barrage", + "value": "9.92m barrage" + }, + { + "name": "find_item2_visits", + "value": "8700" + }, + { + "name": "find_item2_intro", + "value": "This is the charm of blue" + }, + { + "name": "find_item3_title", + "value": "Past Events in the Northeast" + }, + { + "name": "find_item3_category", + "value": "Record" + }, + { + "name": "find_item3_barrage", + "value": "6.66m barrage" + }, + { + "name": "find_item3_visits", + "value": "7452" + }, + { + "name": "find_item3_intro", + "value": "Hard life is unkillable" + }, + { + "name": "find_item4_title", + "value": "Parallel World" + }, + { + "name": "find_item4_category", + "value": "Science Fiction" + }, + { + "name": "find_item4_barrage", + "value": "5.43m barrage" + }, + { + "name": "find_item4_visits", + "value": "6162" + }, + { + "name": "find_item4_intro", + "value": "Another me in the world" + }, + { + "name": "find_item5_title", + "value": "Rainbow" + }, + { + "name": "find_item5_category", + "value": "Life" + }, + { + "name": "find_item5_barrage", + "value": "4.78m barrage" + }, + { + "name": "find_item5_visits", + "value": "5555" + }, + { + "name": "find_item5_intro", + "value": "Where is the rainbow" + }, + { + "name": "find_item6_title", + "value": "Warder" + }, + { + "name": "find_item6_category", + "value": "Plot" + }, + { + "name": "find_item6_barrage", + "value": "3.21m barrage" + }, + { + "name": "find_item6_visits", + "value": "4396" + }, + { + "name": "find_item6_intro", + "value": "That's all for the story" + }, + { + "name": "mine_history", + "value": "History" + }, + { + "name": "mine_collection", + "value": "Collection" + },{ + "name": "mine_settings", + "value": "Settings" + }, + { + "name": "mine_help", + "value": "Help" + }, + { + "name": "mine_about", + "value": "About" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/product/default/src/main/resources/zh_CN/element/string.json b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..075ca3dfb74ff976a7b63cce25b7e8609f34593c --- /dev/null +++ b/ExcellentCase/Multi_device_V2/product/default/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,303 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "描述" + }, + { + "name": "EntryAbility_label", + "value": "一次开发多端部署" + }, + { + "name": "title_home", + "value": "首页" + }, + { + "name": "title_home_recently", + "value": "最近播放" + }, + { + "name": "title_home_more", + "value": "更多" + }, + { + "name": "title_home_recommend", + "value": "为你推荐" + }, + { + "name": "title_find", + "value": "热播总榜" + }, + { + "name": "title_drive", + "value": "云盘" + }, + { + "name": "title_mine", + "value": "韩梅梅" + }, + { + "name": "bottom_text_home", + "value": "主页" + }, + { + "name": "bottom_text_find", + "value": "发现" + }, + { + "name": "bottom_text_drive", + "value": "云盘" + }, + { + "name": "bottom_text_mine", + "value": "我的" + }, + { + "name": "swiper1_title", + "value": "畅享新生活" + }, + { + "name": "swiper1_intro", + "value": "最高领500元大额券" + }, + { + "name": "swiper2_title", + "value": "开启高光时刻" + }, + { + "name": "swiper2_intro", + "value": "新学期做个实力派" + }, + { + "name": "swiper3_title", + "value": "极限秘境开启" + }, + { + "name": "swiper3_intro", + "value": "藏着什么好用的宝贝" + }, + { + "name": "recently_play1_title", + "value": "钴蓝" + }, + { + "name": "recently_play1_intro", + "value": "高雅神秘" + }, + { + "name": "recently_play2_title", + "value": "粉黛" + }, + { + "name": "recently_play2_intro", + "value": "青春活泼" + }, + { + "name": "recently_play3_title", + "value": "青玉" + }, + { + "name": "recently_play3_intro", + "value": "坚持不懈" + }, + { + "name": "recently_play4_title", + "value": "臻白" + }, + { + "name": "recently_play4_intro", + "value": "忠贞不渝" + }, + { + "name": "recently_play5_title", + "value": "华金" + }, + { + "name": "recently_play5_intro", + "value": "非凡尊贵" + }, + { + "name": "recently_play6_title", + "value": "晶紫" + }, + { + "name": "recently_play6_intro", + "value": "优雅迅捷" + }, + { + "name": "recently_play7_title", + "value": "流虹" + }, + { + "name": "recently_play7_intro", + "value": "万象天成" + }, + { + "name": "recommend1_title", + "value": "忙碌一天" + }, + { + "name": "recommend1_intro", + "value": "不要忘了道晚安" + }, + { + "name": "recommend2_title", + "value": "许个心愿" + }, + { + "name": "recommend2_intro", + "value": "我就是天选之子" + }, + { + "name": "recommend3_title", + "value": "遥望星空" + }, + { + "name": "recommend3_intro", + "value": "宇宙尽头是什么" + }, + { + "name": "find_item1_title", + "value": "摩天轮之恋" + }, + { + "name": "find_item1_category", + "value": "爱情" + }, + { + "name": "find_item1_barrage", + "value": "999万条弹幕" + }, + { + "name": "find_item1_visits", + "value": "9421" + }, + { + "name": "find_item1_intro", + "value": "他转起来了" + }, + { + "name": "find_item2_title", + "value": "生命之蓝" + }, + { + "name": "find_item2_category", + "value": "艺术" + }, + { + "name": "find_item2_barrage", + "value": "992万条弹幕" + }, + { + "name": "find_item2_visits", + "value": "8700" + }, + { + "name": "find_item2_intro", + "value": "这就是蓝的魅力" + }, + { + "name": "find_item3_title", + "value": "东北往事" + }, + { + "name": "find_item3_category", + "value": "纪录" + }, + { + "name": "find_item3_barrage", + "value": "666万条弹幕" + }, + { + "name": "find_item3_visits", + "value": "7452" + }, + { + "name": "find_item3_intro", + "value": "狠活是杀不死的" + }, + { + "name": "find_item4_title", + "value": "平行世界" + }, + { + "name": "find_item4_category", + "value": "科幻" + }, + { + "name": "find_item4_barrage", + "value": "543万条弹幕" + }, + { + "name": "find_item4_visits", + "value": "6162" + }, + { + "name": "find_item4_intro", + "value": "世界上的另一个我" + }, + { + "name": "find_item5_title", + "value": "彩虹" + }, + { + "name": "find_item5_category", + "value": "生活" + }, + { + "name": "find_item5_barrage", + "value": "478万条弹幕" + }, + { + "name": "find_item5_visits", + "value": "5555" + }, + { + "name": "find_item5_intro", + "value": "哪里会有彩虹" + }, + { + "name": "find_item6_title", + "value": "守望者" + }, + { + "name": "find_item6_category", + "value": "剧情" + }, + { + "name": "find_item6_barrage", + "value": "321万条弹幕" + }, + { + "name": "find_item6_visits", + "value": "4396" + }, + { + "name": "find_item6_intro", + "value": "故事就到这里吧" + }, + { + "name": "mine_history", + "value": "观看历史" + }, + { + "name": "mine_collection", + "value": "收藏" + },{ + "name": "mine_settings", + "value": "设置" + }, + { + "name": "mine_help", + "value": "帮助与反馈" + }, + { + "name": "mine_about", + "value": "关于我们" + } + ] +} \ No newline at end of file diff --git a/ExcellentCase/Multi_device_V2/public_sys-resources/icon-caution.gif b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-caution.gif differ diff --git a/ExcellentCase/Multi_device_V2/public_sys-resources/icon-danger.gif b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-danger.gif differ diff --git a/ExcellentCase/Multi_device_V2/public_sys-resources/icon-note.gif b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-note.gif differ diff --git a/ExcellentCase/Multi_device_V2/public_sys-resources/icon-notice.gif b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-notice.gif differ diff --git a/ExcellentCase/Multi_device_V2/public_sys-resources/icon-tip.gif b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-tip.gif differ diff --git a/ExcellentCase/Multi_device_V2/public_sys-resources/icon-warning.gif b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/ExcellentCase/Multi_device_V2/public_sys-resources/icon-warning.gif differ diff --git a/Media/ImageEdit/AppScope/app.json5 b/Media/ImageEdit/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d835af8bcb5ed37242286222c9aab43b7f59e6e2 --- /dev/null +++ b/Media/ImageEdit/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.imagetestharmony", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/Media/ImageEdit/AppScope/resources/base/element/string.json b/Media/ImageEdit/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..19a70509aaa075ded61c0be088edcb14ee045211 --- /dev/null +++ b/Media/ImageEdit/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ImageTestHarmony" + } + ] +} diff --git a/Media/ImageEdit/AppScope/resources/base/media/app_icon.png b/Media/ImageEdit/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Media/ImageEdit/AppScope/resources/base/media/app_icon.png differ diff --git a/Media/ImageEdit/LICENSE b/Media/ImageEdit/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0210352ae2ade0dd7b4c841cb6e8ba08b4780038 --- /dev/null +++ b/Media/ImageEdit/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Media/ImageEdit/README.md b/Media/ImageEdit/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ea5e9fd09cd8a00d404cfa24c5e360ce2917a35c --- /dev/null +++ b/Media/ImageEdit/README.md @@ -0,0 +1,537 @@ +# 图片编辑(ArkTS) + +## 介绍 + +本篇Codelab是基于ArkTS的声明式开发范式的样例,主要介绍了图片编辑实现过程。样例主要包含以下功能: + +1. 图片的解码。 +2. 使用PixelMap进行图片编辑,如裁剪、旋转、亮度、透明度、饱和度等。 +3. 图片的编码。 + +![](figures/zh-cn_image_0000001542204198.gif) + +### 相关概念 + +- [图片解码](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/media/image-decoding.md):读取不同格式的图片文件,无压缩的解码为位图格式。 +- [PixelMap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/media/image-overview.md):图片解码后的状态,用于对图片像素进行处理。 +- [图片编码](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/media/image-encoding.md):图片经过像素处理完成之后,需要重新进行编码打包,生成需要的图片格式。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001569303293.png) + +2. 搭建烧录环境。 + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ ├──bean +│ │ │ ├──CropType.ets // 按比例选取图片 +│ │ │ ├──ImageSizeItem.ets // 图片尺寸 +│ │ │ ├──Line.ets // 线封装类 +│ │ │ ├──MessageItem.ets // 多线程封装消息 +│ │ │ ├──PixelMapWrapper.ets // PixelMap封装类 +│ │ │ ├──Point.ets // 点封装类 +│ │ │ ├──Ratio.ets // 比例封装类 +│ │ │ ├──Rect.ets // 矩形封装类 +│ │ │ └──RegionItem.ets // 区域封装类 +│ │ └──constant +│ │ └──CommonConstant.ets // 常量类 +│ ├──entryability +│ │ └──EntryAbility.ts // 本地启动ability +│ ├──pages +│ │ └──HomePage.ets // 本地主页面 +│ ├──utils +│ │ ├──AdjustUtil.ets // 调节工具类 +│ │ ├──CropUtil.ets // 裁剪工具类 +│ │ ├──DecodeUtil.ets // 解码工具类 +│ │ ├──DrawingUtils.ets // Canvas画图工具类 +│ │ ├──EncodeUtil.ets // 编码工具类 +│ │ ├──LoggerUtil.ets // 日志工具类 +│ │ ├──MathUtils.ets // 坐标转换工具类 +│ │ └──OpacityUtil.ets // 透明度调节工具类 +│ ├──view +│ │ ├──AdjustContentView.ets // 色域调整视图 +│ │ └──ImageSelect.ets // Canvas选择框实现类 +│ │──viewmodel +│ │ ├──CropShow.ets // 选择框显示控制类 +│ │ ├──IconListViewModel.ets // icon数据 +│ │ ├──ImageEditCrop.ets // 图片编辑操作类 +│ │ ├──ImageFilterCrop.ets // 图片操作收集类 +│ │ ├──OptionViewModel.ets // 图片处理封装类 +│ │ └──ScreenManager.ts // 屏幕尺寸计算工具类 +│ └──workers +│ ├──AdjustBrightnessWork.ts // 亮度异步调节 +│ └──AdjustSaturationWork.ts // 饱和度异步调节 +└──entry/src/main/resources // 资源文件目录 +``` + +## 图片解码 + +在这个章节中,需要完成图片解码的操作,并将解码后的图片展示。效果如图所示: + +![](figures/zh-cn_image_0000001592803785.png) + +在进行图片编辑前需要先加载图片,当前文档是在生命周期aboutToAppear开始加载。具体实现步骤。 + +1. 读取资源文件。 +2. 将获取的fd创建成图片实例,通过实例获取其pixelMap。 +3. 将解析好的pixelMap通过Image组件加载显示。 + +```typescript +// HomePage.ets +aboutToAppear() { + this.pixelInit(); +} + +// DecodeUtil.ets +async function getResourceFd(filename: string) { + const resourceMgr = getContext(this).resourceManager; + const context = getContext(this); + if (filename === CommonConstants.RAW_FILE_NAME) { + let imageBuffer = await resourceMgr.getMediaContent($r('app.media.ic_low')); + let filePath = context.cacheDir + '/' + filename; + let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + let writeLen = fs.writeSync(file.fd, imageBuffer.buffer); + fs.copyFileSync(filePath, context.cacheDir + '/' + CommonConstants.RAW_FILE_NAME_TEST); + return file.fd; + } else { + let filePath = context.cacheDir + '/' + filename; + let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + return file.fd; + } +} + +//DecodeUtil.ets +export async function getPixelMap(fileName: string) { + const fd = await getResourceFd(fileName); + const imageSourceApi = image.createImageSource(fd); + if (!imageSourceApi) { + Logger.error(TAG, 'imageSourceAPI created failed!'); + return; + } + const pixelMap = await imageSourceApi.createPixelMap({ + editable: true + }); + return pixelMap; +} + +// HomePage.ets +build() { + Column() { + ... + Column() { + if (this.isCrop && this.showCanvas && this.statusBar > 0) { + ImageSelect({ + statusBar: this.statusBar + }) + } else { + Image(this.pixelMap) + .scale({ x: this.imageScale, y: this.imageScale, z: 1 }) + .objectFit(ImageFit.None) + } + } + ... + } + ... +} +``` + +## 图片处理 + +当前章节需要完成图片的裁剪、旋转、色域调节(本章只介绍亮度、透明度、饱和度)等功能。 + +- 裁剪:选取图片中的部分进行裁剪生成新的图片。 +- 旋转:将图片按照不同的角度进行旋转,生成新的图片。 +- 色域调节:当前Codelab色域调节的亮度、透明度和饱和度,使用色域模型RGB-HSV来实现的。 + - RGB:是我们接触最多的颜色空间,分别为红色\(R\),绿色\(G\)和蓝色\(B\)。 + - HSV:是用色相H,饱和度S,明亮度V来描述颜色的变化。 + - H:色相H取值范围为0°~360°,从红色开始按逆时针方向计算,红色为0°,绿色为120°,蓝色为240°。 + - S:饱和度S越高,颜色则深而艳。光谱色的白光成分为0,饱和度达到最高。通常取值范围为0%~100%,值越大,颜色越饱和。 + - V:明度V表示颜色明亮的程度,对于光源色,明度值与发光体的光亮度有关;对于物体色,此值和物体的透射比或反射比有关。通常取值范围为0%(黑)到100%(白)。 + +```typescript +// AdjustUtil.ets +// rgb转hsv +function rgb2hsv(red: number, green: number, blue: number) { + let hsvH: number = 0, hsvS: number = 0, hsvV: number = 0; + const rgbR: number = colorTransform(red); + const rgbG: number = colorTransform(green); + const rgbB: number = colorTransform(blue); + const maxValue = Math.max(rgbR, Math.max(rgbG, rgbB)); + const minValue = Math.min(rgbR, Math.min(rgbG, rgbB)); + hsvV = maxValue * CommonConstants.CONVERT_INT; + if (maxValue === 0) { + hsvS = 0; + } else { + hsvS = Number((1 - minValue / maxValue).toFixed(CommonConstants.DECIMAL_TWO)) * CommonConstants.CONVERT_INT; + } + if (maxValue === minValue) { + hsvH = 0; + } + if (maxValue === rgbR && rgbG >= rgbB) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbG - rgbB) / (maxValue - minValue))); + } + if (maxValue === rgbR && rgbG < rgbB) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbG - rgbB) / (maxValue - minValue)) + CommonConstants.ANGLE_360); + } + if (maxValue === rgbG) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbB - rgbR) / (maxValue - minValue)) + CommonConstants.ANGLE_120); + } + if (maxValue === rgbB) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbR - rgbG) / (maxValue - minValue)) + CommonConstants.ANGLE_240); + } + return [hsvH, hsvS, hsvV]; +} +// hsv转rgb +function hsv2rgb(hue: number, saturation: number, value: number) { + let rgbR: number = 0, rgbG: number = 0, rgbB: number = 0; + if (saturation === 0) { + rgbR = rgbG = rgbB = Math.round((value * CommonConstants.COLOR_LEVEL_MAX) / CommonConstants.CONVERT_INT); + return { rgbR, rgbG, rgbB }; + } + const cxmC = (value * saturation) / (CommonConstants.CONVERT_INT * CommonConstants.CONVERT_INT); + const cxmX = cxmC * (1 - Math.abs((hue / CommonConstants.ANGLE_60) % CommonConstants.MOD_2 - 1)); + const cxmM = (value - cxmC * CommonConstants.CONVERT_INT) / CommonConstants.CONVERT_INT; + const hsvHRange = Math.floor(hue / CommonConstants.ANGLE_60); + switch (hsvHRange) { + case AngelRange.ANGEL_0_60: + rgbR = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_60_120: + rgbR = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_120_180: + rgbR = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_180_240: + rgbR = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_240_300: + rgbR = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_300_360: + rgbR = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + default: + break; + } + return [ + Math.round(rgbR), + Math.round(rgbG), + Math.round(rgbB) + ]; +} +``` + +### 图片裁剪 + +1. 通过pixelMap获取图片尺寸,为后续裁剪做准备。 +2. 确定裁剪的方式,当前裁剪默认有自由选取、1:1选取、4:3选取、16:9选取。 +3. 通过pixelMap调用接口crop\(\)进行裁剪操作。 + +>![](/public_sys-resources/icon-note.gif) **说明:** +>当前裁剪功能采用pixelMap裁剪能力直接做切割,会有叠加效果,后续会通过增加选取框对当前功能进行优化。 + +![](figures/zh-cn_image_0000001542044862.gif) + +```typescript +// HomePage.ets +cropImage(index: CropType) { + this.currentCropIndex = index; + switch (this.currentCropIndex) { + case CropType.ORIGINAL_IMAGE: + this.cropRatio = CropRatioType.RATIO_TYPE_FREE; + break; + case CropType.SQUARE: + this.cropRatio = CropRatioType.RATIO_TYPE_1_1; + break; + case CropType.BANNER: + this.cropRatio = CropRatioType.RATIO_TYPE_4_3; + break; + case CropType.RECTANGLE: + this.cropRatio = CropRatioType.RATIO_TYPE_16_9; + default: + this.cropRatio = CropRatioType.RATIO_TYPE_FREE; + break; + } +} + +// ImageFilterCrop.ets +cropImage(pixelMap: PixelMapWrapper, realCropRect: RectF, callback) { + let offWidth = realCropRect.getWidth(); + let offHeight = realCropRect.getHeight(); + pixelMap.pixelMap.crop({ + size:{ height: vp2px(offHeight), width: vp2px(offWidth) }, + x: vp2px(realCropRect.left), + y: vp2px(realCropRect.top) + }, callback); +} +``` + +### 图片旋转 + +1. 确定旋转方向,当前支持顺时针和逆时针旋转。 +2. 通过pixelMap调用接口rotate\(\)进行旋转操作。 + +![](figures/zh-cn_image_0000001592803857.gif) + +```typescript +// HomePage.ets +rotateImage(rotateType: RotateType) { + if (rotateType === RotateType.ClockWise) { + try { + this.pixelMap.rotate(commonConstant.CLOCK_WISE) + .then(() => { + this.flushPixelMap(); + }) + } catch (error) { + Logger.error(TAG, `there is a error in rotate process with ${error?.code}`); + } + } + if (rotateType === RotateType.Anti_clock) { + try { + this.pixelMap.rotate(commonConstant.ANTI_CLOCK) + .then(() => { + this.flushPixelMap(); + }) + } catch (error) { + Logger.error(TAG, `there is a error in rotate process with ${error?.code}`); + } + } +} +``` + +### 亮度调节 + +1. 将pixelMap转换成ArrayBuffer。 +2. 将生成好的ArrayBuffer发送到worker线程。 +3. 对每一个像素点的亮度值按倍率计算。 +4. 将计算好的ArrayBuffer发送回主线程。 +5. 将ArrayBuffer写入pixelMap,刷新UI。 + +>![](/public_sys-resources/icon-note.gif) **说明:** +>当前亮度调节是在UI层面实现的,未实现细节优化算法,只做简单示例。调节后的图片会有色彩上的失真。 + +![](figures/zh-cn_image_0000001542044962.gif) + +```typescript +// AdjustContentView.ets +// 转化成pixelMap及发送buffer到worker,返回数据刷新UI +postToWorker(type: AdjustId, value: number, workerName: string) { + let sliderValue = type === AdjustId.BRIGHTNESS ? this.brightnessLastSlider : this.saturationLastSlider; + let workerInstance = new worker.ThreadWorker(workerName); + const bufferArray = new ArrayBuffer(this.pixelMap.getPixelBytesNumber()); + this.pixelMap.readPixelsToBuffer(bufferArray).then(() => { + let message = new MessageItem(bufferArray, sliderValue, value); + workerInstance.postMessage(message); + if (this.postState) { + this.deviceListDialogController.open(); + } + this.postState = false; + workerInstance.onmessage = this.updatePixelMap.bind(this); + if (type === AdjustId.BRIGHTNESS) { + this.brightnessLastSlider = Math.round(value); + } else { + this.saturationLastSlider = Math.round(value); + } + workerInstance.onexit = () => { + if (workerInstance !== undefined) { + workerInstance.terminate(); + } + } + }); +} + +// AdjustBrightnessWork.ts +// worker线程处理部分 +workerPort.onmessage = function(event : MessageEvents) { + let bufferArray = event.data.buf; + let last = event.data.last; + let cur = event.data.cur; + let buffer = adjustImageValue(bufferArray, last, cur); + workerPort.postMessage(buffer); + workerPort.close(); +} + +// AdjustUtil.ets +// 倍率计算部分 +export function adjustImageValue(bufferArray: ArrayBuffer, last: number, cur: number) { + return execColorInfo(bufferArray, last, cur, HSVIndex.VALUE); +} +``` + +### 透明度调节 + +1. 获取pixelMap。 +2. 调用接口opacity\(\)进行透明度调节。 + +![](figures/zh-cn_image_0000001542204870.gif) + +```typescript +// OpacityUtil.ets +export async function adjustOpacity(pixelMap: PixelMap, value: number) { + if (!pixelMap) { + return; + } + const newPixelMap = pixelMap; + newPixelMap.opacity(value / CommonConstants.SLIDER_MAX, err => { + if (err) { + Logger.error(TAG, `Failed adjust opacity with ${err}`); + } + }) + return newPixelMap; +} +``` + +### 饱和度调节 + +1. 将pixelMap转换成ArrayBuffer。 +2. 将生成好的ArrayBuffer发送到worker线程。 +3. 对每一个像素点的饱和度按倍率计算。 +4. 将计算好的ArrayBuffer发送回主线程。 +5. 将ArrayBuffer写入pixelMap,刷新UI。 + +>![](/public_sys-resources/icon-note.gif) **说明:** +> 当前饱和度调节是在UI层面实现的,未实现细节优化算法,只做简单示例。调节后的图片会有色彩上的失真。 + +![](figures/zh-cn_image_0000001592604569.gif) + +```typescript +// AdjustContentView.ets +// 转化成pixelMap及发送buffer到worker,返回数据刷新UI +postToWorker(type: AdjustId, value: number, workerName: string) { + let sliderValue = type === AdjustId.BRIGHTNESS ? this.brightnessLastSlider : this.saturationLastSlider; + let workerInstance = new worker.ThreadWorker(workerName); + const bufferArray = new ArrayBuffer(this.pixelMap.getPixelBytesNumber()); + this.pixelMap.readPixelsToBuffer(bufferArray).then(() => { + let message = new MessageItem(bufferArray, sliderValue, value); + workerInstance.postMessage(message); + if (this.postState) { + this.deviceListDialogController.open(); + } + this.postState = false; + workerInstance.onmessage = this.updatePixelMap.bind(this); + if (type === AdjustId.BRIGHTNESS) { + this.brightnessLastSlider = Math.round(value); + } else { + this.saturationLastSlider = Math.round(value); + } + workerInstance.onexit = () => { + if (workerInstance !== undefined) { + workerInstance.terminate(); + } + } + }); +} + +// AdjustBrightnessWork.ts +// worker线程处理部分 +workerPort.onmessage = function(event : MessageEvents) { + let bufferArray = event.data.buf; + let last = event.data.last; + let cur = event.data.cur; + let buffer = adjustImageValue(bufferArray, last, cur); + workerPort.postMessage(buffer); + workerPort.close(); +} + +// AdjustUtil.ets +// 倍率计算部分 +export function adjustSaturation(bufferArray: ArrayBuffer, last: number, cur: number) { + return execColorInfo(bufferArray, last, cur, HSVIndex.SATURATION); +} +``` + +## 图片编码 + +图片位图经过处理之后,还是属于解码的状态,还需要进行打包编码成对应的格式,本章讲解编码的具体过程。 + +1. 通过image组件创建打包工具packer。 +2. 使用PackingOption进行打包参数设定,比如格式、压缩质量等。 +3. 打包成图片信息数据imageData。 +4. 创建媒体库media,获取公共路径。 +5. 创建媒体文件asset,获取其fd。 +6. 使用fs将打包好的图片数据写入到媒体文件asset中。 + +```typescript +// EncodeUtil.ets +export async function encode(pixelMap: PixelMap) { + const newPixelMap = pixelMap; + // packing image. + const imagePackerApi = image.createImagePacker(); + const packOptions: image.PackingOption = { + format: CommonConstants.ENCODE_FORMAT, + quality: CommonConstants.ENCODE_QUALITY + } + const imageData = await imagePackerApi.packing(newPixelMap, packOptions); + Logger.info(TAG, `imageData's length is ${imageData.byteLength}`); + // get album's path. + const context = getContext(this); + const media = mediaLibrary.getMediaLibrary(context); + const publicPath = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_IMAGE); + const currentTime = new Date().getTime(); + // create image asset. + const imageAssetInfo = await media.createAsset( + mediaLibrary.MediaType.IMAGE, + `${CommonConstants.IMAGE_PREFIX}_${currentTime}${CommonConstants.IMAGE_FORMAT}`, + publicPath + ); + const imageFd = await imageAssetInfo.open(CommonConstants.ENCODE_FILE_PERMISSION); + await fs.write(imageFd, imageData); + // image resource release. + await imageAssetInfo.close(imageFd); + imagePackerApi.release(); + await media.release(); +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. 使用image库进行图片的解码。 +2. 使用pixelMap进行图片处理(旋转、裁剪、亮度、透明度、饱和度等)。 +3. 使用image库进行图片的编码。 + +![](figures/congratulations.gif) diff --git a/Media/ImageEdit/build-profile.json5 b/Media/ImageEdit/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..baffec5c5a4b40ae0c03892d0624a0332f3ab9a7 --- /dev/null +++ b/Media/ImageEdit/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default" + } + ], + "signingConfigs": [] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/build-profile.json5 b/Media/ImageEdit/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e05e52bb94d6dda8578d133c546621599a479f72 --- /dev/null +++ b/Media/ImageEdit/entry/build-profile.json5 @@ -0,0 +1,17 @@ +{ + "apiType": 'stageMode', + "buildOption": { + "sourceOption": { + "workers": [ + "./src/main/ets/workers/AdjustSaturationWork.ts", + "./src/main/ets/workers/AdjustBrightnessWork.ts" + ] + } + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/hvigorfile.ts b/Media/ImageEdit/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/Media/ImageEdit/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/Media/ImageEdit/entry/oh-package.json5 b/Media/ImageEdit/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b9234a98d43a4711a0fc32cef604159228d3cd --- /dev/null +++ b/Media/ImageEdit/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/CropType.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/CropType.ets new file mode 100644 index 0000000000000000000000000000000000000000..77498ac463d5a2089cd53608304dc4ac75df19d7 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/CropType.ets @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export enum CropTouchState { + /** + * Crop state. + */ + NONE, + + /** + * Move cropping frame. + */ + CROP_MOVE, + + /** + * Move image. + */ + IMAGE_DRAG, + + /** + * Scale image. + */ + IMAGE_SCALE +} + +export enum CropRatioType { + /** + * Free choice. + */ + RATIO_TYPE_FREE, + + /** + * Horizontal frame. + */ + RATIO_TYPE_HORIZONTAL, + + /** + * Vertical frame. + */ + RATIO_TYPE_VERTICAL, + + /** + * 1:1 frame. + */ + RATIO_TYPE_1_1, + + /** + * 16:9 frame. + */ + RATIO_TYPE_16_9, + + /** + * 9:16 frame. + */ + RATIO_TYPE_9_16, + + /** + * 4:3 frame. + */ + RATIO_TYPE_4_3, + + /** + * 3:4 frame. + */ + RATIO_TYPE_3_4, + + /** + * 3:2 frame. + */ + RATIO_TYPE_3_2, + + /** + * 2:3 frame. + */ + RATIO_TYPE_2_3 +} + +export enum CropAngle { + /** + * Crop angle 90. + */ + ONE_QUARTER_CIRCLE_ANGLE = 90, + + /** + * Crop angle 180. + */ + HALF_CIRCLE_ANGLE = 180, + + /** + * Crop angle 270. + */ + THREE_QUARTER_CIRCLE_ANGLE = 270, + + /** + * Crop angle 360. + */ + CIRCLE_ANGLE = 360 +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/ImageSizeItem.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/ImageSizeItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca66b1cfacae8000b74275939d3a56a288286764 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/ImageSizeItem.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export interface ImageSizeItem { + /** + * Image width. + */ + width: number; + + /** + * Image height. + */ + height: number; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/Line.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/Line.ets new file mode 100644 index 0000000000000000000000000000000000000000..b538d5dc76174c4bb5be7b73e4552952c60e98e3 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/Line.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { Point } from './Point'; + +export class LineSegment { + /** + * Line segment start point. + */ + start: Point; + + /** + * Line segment end point. + */ + end: Point; + + /** + * Constructor. + * @param start + * @param end + */ + constructor(start: Point, end: Point) { + this.start = start; + this.end = end; + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/MessageItem.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/MessageItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..b18f3783c412c10a2fc536f0d83c2c8f10203d68 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/MessageItem.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Multithreading transmission message. + */ +export class MessageItem { + constructor(buf, last, cur) { + this.buf = buf; + this.last = last; + this.cur = cur; + } + + /** + * Send buffers. + */ + buf: ArrayBuffer; + + /** + * Last slider value. + */ + last: number; + + /** + * Current slider value. + */ + cur: number; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/PixelMapWrapper.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/PixelMapWrapper.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f22195519aa16f1b3081d581a56a5a42adb1231 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/PixelMapWrapper.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + + +export class PixelMapWrapper { + pixelMap: PixelMap = undefined; + width: number = 0; + height: number = 0; + + constructor(pixelMap: PixelMap, width: number, height: number) { + this.pixelMap = pixelMap; + this.width = width; + this.height = height; + } + + release() { + if (this.pixelMap != null && this.pixelMap != undefined) { + this.pixelMap.release(); + } + this.width = 0; + this.height = 0; + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/Point.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/Point.ets new file mode 100644 index 0000000000000000000000000000000000000000..1885d2825339de9b97c2b83bb0550260c0d2846f --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/Point.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export class Point { + /** + * X-coordinate. + */ + x: number; + + /** + * Y-coordinate. + */ + y: number; + + /** + * Constructor. + * @param x + * @param y + */ + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + + /** + * Set value. + * @param x + * @param y + */ + set(x: number, y: number): void { + this.x = x; + this.y = y; + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/Ratio.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/Ratio.ets new file mode 100644 index 0000000000000000000000000000000000000000..30eaa054426ba89505b07c27dabce3797066090e --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/Ratio.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export class Ratio { + /** + * Rect width. + */ + private w: number; + + /** + * Rect height. + */ + private h: number; + + /** + * Constructor. + * @param w + * @param h + */ + constructor(w: number, h: number) { + this.w = w; + this.h = h; + } + + /** + * Set value. + * @param w + * @param h + */ + set(w: number, h: number): void { + this.w = w; + this.h = h; + } + + /** + * Get width. + * @returns + */ + getW(): number { + return this.w; + } + + /** + * Get height. + * @returns + */ + getH(): number { + return this.h; + } + + /** + * Get rate. + * @returns + */ + getRate(): number { + return (this.w / this.h); + } + + /** + * Determine whether the current ratio is valid. + * @returns + */ + isValid(): boolean { + return (this.w > 0 && this.h > 0); + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/Rect.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/Rect.ets new file mode 100644 index 0000000000000000000000000000000000000000..39b33122393e00154dccd66c97f11d1357e7cfef --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/Rect.ets @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + + +export class RectF { + /** + * Rect left edge. + */ + left: number; + + /** + * Rect top edge. + */ + top: number; + + /** + * Rect right edge. + */ + right: number; + + /** + * Rect bottom edge. + */ + bottom: number; + + /** + * Constructor. + */ + constructor() { + this.left = 0; + this.top = 0; + this.right = 0; + this.bottom = 0; + } + + /** + * Set value. + * @param left + * @param top + * @param right + * @param bottom + */ + set(left: number, top: number, right: number, bottom: number): void { + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + } + + /** + * Get width. + * @returns + */ + getWidth(): number { + return (this.right - this.left); + } + + /** + * Get height. + * @returns + */ + getHeight(): number { + return (this.bottom - this.top); + } + + /** + * Get diagonal. + * @returns + */ + getDiagonal(): number { + return Math.hypot(this.getWidth(), this.getHeight()); + } + + /** + * Get the center point of x. + * @returns + */ + getCenterX(): number { + return (this.left + this.getWidth() / 2); + } + + /** + * Get the center point of y. + * @returns + */ + getCenterY(): number { + return (this.top + this.getHeight() / 2); + } + + /** + * Determine whether it is within the rectangle. + * @param x + * @param y + * @returns + */ + isInRect(x: number, y: number): boolean { + return (x >= this.left && x <= this.right && y >= this.top && y <= this.bottom); + } + + /** + * Set zoom factor. + * @param scale + */ + scale(scale: number): void { + this.left *= scale; + this.right *= scale; + this.top *= scale; + this.bottom *= scale; + } + + /** + * Move by current offset. + * @param offsetX + * @param offsetY + */ + move(offsetX: number, offsetY: number): void { + this.left += offsetX; + this.right += offsetX; + this.top += offsetY; + this.bottom += offsetY; + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/bean/RegionItem.ets b/Media/ImageEdit/entry/src/main/ets/common/bean/RegionItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c893713b685b8b1dde0f20967c46104301f677c --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/bean/RegionItem.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export interface RegionItem { + /** + * width coordinate. + */ + x: number; + + /** + * height coordinate. + */ + y: number; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/common/constant/CommonConstants.ts b/Media/ImageEdit/entry/src/main/ets/common/constant/CommonConstants.ts new file mode 100644 index 0000000000000000000000000000000000000000..558614cc0cc94bb0912c5b7a3e3d86a1dd9264af --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/common/constant/CommonConstants.ts @@ -0,0 +1,390 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export class CommonConstants { + /** + * Title row width. + */ + static readonly TITLE_ROW_WEIGHT: string = '50%'; + + /** + * Layout full screen. + */ + static readonly LAYOUT_FULL_SCREEN: string = '100%'; + + /** + * Edit page height. + */ + static readonly EDIT_PAGE_HEIGHT: string = '26%'; + + /** + * Image show height. + */ + static readonly IMAGE_SHOW_HEIGHT: string = '68%'; + + /** + * Slider width. + */ + static readonly SLIDER_WIDTH: string = '80%'; + + /** + * Loading width and height. + */ + static readonly LOADING_WH: string = '30%'; + + /** + * Clock wise. + */ + static readonly CLOCK_WISE: number = 90; + + /** + * Anti clock. + */ + static readonly ANTI_CLOCK: number = -90; + + /** + * Tab menu width. + */ + static readonly TAB_MENU_WIDTH: number = 18; + + /** + * Navigation height. + */ + static readonly NAVIGATION_HEIGHT: number = 56; + + /** + * Adjust slider value. + */ + static readonly ADJUST_SLIDER_VALUE: number[] = [100, 100, 100]; + + /** + * Slider min. + */ + static readonly SLIDER_MIN: number = 1; + + /** + * Slider step. + */ + static readonly SLIDER_MAX: number = 100; + + /** + * Slider step. + */ + static readonly SLIDER_STEP: number = 1; + + /** + * Pixel step. + */ + static readonly PIXEL_STEP: number = 4; + + /** + * Decimal two. + */ + static readonly DECIMAL_TWO: number = 2; + + /** + * Color level max. + */ + static readonly COLOR_LEVEL_MAX: number = 255; + + /** + * Convert int. + */ + static readonly CONVERT_INT: number = 100; + + /** + * Angle 60. + */ + static readonly ANGLE_60: number = 60; + + /** + * Angle 120. + */ + static readonly ANGLE_120: number = 120; + + /** + * Angle 240. + */ + static readonly ANGLE_240: number = 240; + + /** + * Angle 300. + */ + static readonly ANGLE_360: number = 360; + + /** + * Angle 360. + */ + static readonly MOD_2: number = 2; + + /** + * Average height and width. + */ + static readonly AVERAGE_WEIGHT_WIDTH: number = 2; + + /** + * Crop rate 4:3. + */ + static readonly CROP_RATE_4_3: number = 0.75; + + /** + * Crop rate 16:9. + */ + static readonly CROP_RATE_9_16: number = 9 / 16; + + /** + * Encode quality. + */ + static readonly ENCODE_QUALITY: number = 100; + + /** + * Title space. + */ + static readonly TITLE_SPACE: number = 0; + + /** + * Slider mode click. + */ + static readonly SLIDER_CLICK_MODE: number = 3; + + /** + * Encode format. + */ + static readonly ENCODE_FORMAT: string = 'image/jpeg'; + + /** + * Encode file permission. + */ + static readonly ENCODE_FILE_PERMISSION: string = 'rw'; + + /** + * Brightness worker file. + */ + static readonly BRIGHTNESS_WORKER_FILE = 'entry/ets/workers/AdjustBrightnessWork.ts'; + + /** + * Brightness worker file. + */ + static readonly SATURATION_WORKER_FILE = 'entry/ets/workers/AdjustSaturationWork.ts'; + + /** + * Image name. + */ + static readonly IMAGE_PREFIX = 'image'; + + /** + * Image format. + */ + static readonly IMAGE_FORMAT = '.jpg'; + + /** + * Rawfile name. + */ + static readonly RAW_FILE_NAME = 'low.jpg'; + + /** + * Cache dir file name. + */ + static readonly RAW_FILE_NAME_TEST = 'low_test.jpg'; + + /** + * Free ratio. + */ + static readonly DEFAULT_RATIO: number = -1; + + /** + * Ratio 1:1. + */ + static readonly RATIO_1_1: number = 1; + + /** + * Ratio 16:9. + */ + static readonly RATIO_16_9: number[] = [16, 9]; + + /** + * Ratio 9:16. + */ + static readonly RATIO_9_16: number[] = [9, 16]; + + /** + * Ratio 4:3. + */ + static readonly RATIO_4_3: number[] = [4, 3]; + + /** + * Ratio 3:4. + */ + static readonly RATIO_3_4: number[] = [3, 4]; + + /** + * Ratio 3:2. + */ + static readonly RATIO_3_2: number[] = [3, 2]; + + /** + * Ratio 2:3. + */ + static readonly RATIO_2_3: number[] = [2, 3]; + + /** + * Screen display margin. + */ + static readonly SCREEN_DISPLAY_MARGIN: number = 15; + + /** + * Double. + */ + static readonly DOUBLE: number = 2; + + /** + * Edit screen can use scope. + */ + static readonly EDIT_SCREEN_USAGE: number = 0.68; + + /** + * Title height. + */ + static readonly TITLE_HEIGHT: number = 56; + + /** + * Screen manager key. + */ + static readonly APP_KEY_SCREEN_MANAGER: string = 'app_key_screen_manager'; + + /** + * Whether full screen. + */ + static readonly IS_FULL_SCREEN_KEY: string = 'isFullScreen'; + + /** + * Device type. + */ + static readonly DEFAULT_DEVICE_TYPE: string = 'phone'; + + /** + * Status bar color. + */ + static readonly STATUS_BAR_BACKGROUND_COLOR: string = '#F1F3F5'; + + /** + * Status bar text color. + */ + static readonly STATUS_BAR_CONTENT_COLOR: string = '#000000'; + + /** + * Navigation height. + */ + static readonly TOP_BAR_SIZE: number = 56; + + /** + * Tool bar size. + */ + static readonly TOOL_BAR_SIZE: number = 72; + + /** + * Time out. + */ + static readonly TIMEOUT: number = 50; + + /** + * Rect line width inner. + */ + static readonly DEFAULT_LINE_WIDTH: number = 0.4; + + /** + * Rect line width outer. + */ + static readonly DEFAULT_LINE_RECT_WIDTH: number = 0.8; + + /** + * Rect Button line width. + */ + static readonly DEFAULT_BUTTON_WIDTH: number = 2.3; + /** + * Rect Button line padding. + */ + static readonly DEFAULT_BUTTON_PADDING: number = 1; + + /** + * Rect Button line length. + */ + static readonly DEFAULT_BUTTON_LENGTH: number = 20; + + /** + * Rect line color. + */ + static readonly DEFAULT_LINE_COLOR: string = '#80FFFFFF'; + + /** + * Rect Button line color outer. + */ + static readonly DEFAULT_RECT_LINE_COLOR: string = '#FFFFFFFF'; + + /** + * Rect Button line color. + */ + static readonly DEFAULT_BUTTON_COLOR: string = 'white'; + + /** + * Mask style. + */ + static readonly DEFAULT_MASK_STYLE: string = 'rgba(0, 0, 0, 0.3)'; + + /** + * Equality threshold. + */ + static readonly EQUALITY_THRESHOLD = 0.0001; + + /** + * Min side length. + */ + static readonly DEFAULT_MIN_SIDE_LENGTH: number = 90; + + /** + * Touch move identification range. + */ + static readonly DEFAULT_TOUCH_BOUND: number = 20; + + /** + * Base scale value. + */ + static readonly BASE_SCALE_VALUE: number = 1.0; + + /** + * Default image ratio. + */ + static readonly DEFAULT_IMAGE_RATIO: number = 1.0; + + /** + * Rect min side length. + */ + static readonly DEFAULT_MIN_SIDE_LENGTH_EDIT: number = 32; + + /** + * Default margin length. + */ + static readonly DEFAULT_MARGIN_LENGTH: number = 20; + + /** + * Time out. + */ + static readonly DEFAULT_TIMEOUT_MILLISECOND_1000: number = 1000; + + /** + * Default split fraction. + */ + static readonly DEFAULT_SPLIT_FRACTION: number = 3; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/entryability/EntryAbility.ts b/Media/ImageEdit/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e1973c76da6f57bfbf24a7a77f7ee660b48e0a8 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device 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 UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; +import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; +import { ScreenManager } from '../viewModel/ScreenManager'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + const permissions: Array = [ + 'ohos.permission.READ_MEDIA', + 'ohos.permission.WRITE_MEDIA', + 'ohos.permission.MEDIA_LOCATION' + ]; + const atManager = abilityAccessCtrl.createAtManager(); + atManager.requestPermissionsFromUser(this.context, permissions, (err, data) => { + if (!err) { + hilog.error(0x0000, 'testTag', 'Failed to requestPermission. Cause: %{public}s', + JSON.stringify(err) ?? ''); + } else { + hilog.info(0x0000, 'testTag', 'Succeeded in requestPermission. Data: %{public}s', + JSON.stringify(data) ?? ''); + } + }) + + windowStage.getMainWindow().then((win) => { + AppStorage.SetOrCreate('mainWindow', win); + ScreenManager.getInstance().getAvoidArea(); + ScreenManager.getInstance().initializationSize(win).then(() => { + ScreenManager.getInstance().initWindowMode(); + }).catch(() => { + hilog.error(0x0000,'testTag', `get device screen info failed.`); + }); + }); + + windowStage.loadContent('pages/HomePage', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', + JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets new file mode 100644 index 0000000000000000000000000000000000000000..068cd118f5f39ae8e2687633df511b9efbed1737 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2023 Huawei Device 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 image from '@ohos.multimedia.image'; +import window from '@ohos.window'; +import { IconStatus } from '../viewModel/IconListViewModel'; +import AdjustContentView from '../view/AdjustContentView'; +import { cropIconChangeList, menuIconList } from '../viewModel/IconListViewModel'; +import Logger from '../utils/LoggerUtil'; +import { RotateType, CropType, MainTabId } from '../viewModel/OptionViewModel'; +import { encode } from '../utils/EncodeUtil'; +import { getPixelMap } from '../utils/DecodeUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; +import { ImageSelect } from '../view/ImageSelect'; +import { ImageSizeItem } from '../common/bean/ImageSizeItem'; +import { CropRatioType } from '../common/bean/CropType'; + +const TAG: string = 'imageEdit'; + +@Entry +@Component +struct HomePage { + @State @Watch('listenCropChange') currentIndex: number = 0; + @State currentCropIndex: number = 0; + @Provide pixelMap: image.PixelMap = undefined; + @Provide imageInfo: image.ImageInfo = undefined; + @Provide currentAdjustData: Array = CommonConstants.ADJUST_SLIDER_VALUE.map((item) => item); + @Provide resetShow: boolean = true; + @Provide showCanvas: boolean = false; + @Provide imageWidth: number = 0; + @Provide imageHeight: number = 0; + @Provide cropRatio: CropRatioType = CropRatioType.RATIO_TYPE_FREE; + @Provide isCrop: boolean = this.currentIndex === 0; + @Provide screenWidth: number = 0; + @Provide screenHeight: number = 0; + @State imageSize: ImageSizeItem = { width: 0, height: 0 }; + @Provide imageOldSize: ImageSizeItem = { width: 0, height: 0 }; + @Provide imageScale: number = 1; + private menuIconChangeList = menuIconList; + private cropIconChange = cropIconChangeList; + private statusBar: number = 0; + + aboutToAppear() { + this.pixelInit(); + window.getLastWindow(getContext(this), (err, window) => { + if (err) { + Logger.error(`window loading has error: ${JSON.stringify(err)}`); + } + this.statusBar = window.getWindowProperties().windowRect?.top; + }); + } + + build() { + Column() { + Row() { + Row() { + Text($r('app.string.image_edit')) + .fontColor(Color.White) + .fontSize($r('app.float.title_font_size')) + .margin({ left: $r('app.float.home_page_title_margin') }) + } + + Blank() + + Row({ space: CommonConstants.TITLE_SPACE }) { + Button() { + Image($r("app.media.ic_reset")) + .width($r('app.float.title_image_width')) + .height($r('app.float.title_image_height')) + } + .visibility(this.resetShow ? Visibility.Visible : Visibility.Hidden) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + .type(ButtonType.Normal) + .aspectRatio(1) + .backgroundColor(Color.Transparent) + .onClick(() => { + this.pixelInit(); + }) + .margin({ right: $r('app.float.home_page_title_margin') }) + + Button() { + Image($r("app.media.ic_save")) + .width($r('app.float.title_image_width')) + .height($r('app.float.title_image_height')) + } + .visibility(this.resetShow ? Visibility.Visible : Visibility.Hidden) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + .type(ButtonType.Normal) + .aspectRatio(1) + .backgroundColor(Color.Transparent) + .onClick(() => { + AlertDialog.show({ + title: $r('app.string.save_image'), + message: $r('app.string.confirm_save'), + alignment: DialogAlignment.Center, + primaryButton: { + value: $r('app.string.save'), + action: () => { + encode(this.pixelMap); + } + }, + secondaryButton: { + value: $r('app.string.cancel'), + action: () => { + Logger.info(TAG, `cancel`); + } + } + }) + }) + .margin({ right: $r('app.float.home_page_title_margin') }) + } + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height($r('app.float.home_page_title_height')) + .margin({ top: $r('app.float.home_page_title_margin') }) + + Column() { + if (this.isCrop && this.showCanvas && this.statusBar > 0) { + ImageSelect({ + statusBar: this.statusBar + }) + } else { + Image(this.pixelMap) + .scale({ x: this.imageScale, y: this.imageScale, z: 1 }) + .objectFit(ImageFit.None) + } + } + .clip(true) + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.IMAGE_SHOW_HEIGHT) + + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Row() { + ForEach(this.cropIconChange, (item: IconStatus, index: number) => { + Image(this.currentCropIndex === index ? item?.chosen : item?.normal) + .width($r('app.float.crop_image_width')) + .height($r('app.float.crop_image_height')) + .onClick(() => { + this.cropImage(index); + }) + }, index => index) + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + .justifyContent(FlexAlign.SpaceAround) + } + .tabBar(this.TabBuilderMenu(MainTabId.CROP, $r('app.string.crop'))) + + TabContent() { + Row() { + Image($r('app.media.ic_clockwise')) + .width($r('app.float.rotate_image_width')) + .height($r('app.float.rotate_image_height')) + .margin({ right: CommonConstants.EDIT_PAGE_HEIGHT }) + .onClick(() => { + this.rotateImage(RotateType.CLOCKWISE); + }) + Image($r('app.media.ic_anti_clockwise')) + .width($r('app.float.rotate_image_width')) + .height($r('app.float.rotate_image_height')) + .onClick(async () => { + this.rotateImage(RotateType.ANTI_CLOCK); + }) + } + .justifyContent(FlexAlign.Center) + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + } + .tabBar(this.TabBuilderMenu(MainTabId.ROTATE, $r('app.string.rotate'))) + + TabContent() { + AdjustContentView() + } + .tabBar(this.TabBuilderMenu(MainTabId.ADJUST, $r('app.string.adjust'))) + } + .scrollable(false) + .onChange((index: number) => { + this.currentIndex = index; + }) + } + .align(Alignment.End) + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.EDIT_PAGE_HEIGHT) + .backgroundColor(Color.Black) + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + .backgroundColor(Color.Black) + } + + @Builder TabBuilderMenu(index: number, name: string | Resource) { + Column() { + Image(this.currentIndex === index ? this.menuIconChangeList[index]?.chosen : + this.menuIconChangeList[index]?.normal) + .width(CommonConstants.TAB_MENU_WIDTH) + .height(CommonConstants.TAB_MENU_WIDTH) + + Text(name) + .fontColor(this.currentIndex === index ? Color.Blue : Color.White) + .fontSize($r('app.float.category_font_size')) + .margin({ top: $r('app.float.category_margin_top') }) + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + } + + cropImage(index: CropType) { + this.currentCropIndex = index; + switch (this.currentCropIndex) { + case CropType.ORIGINAL_IMAGE: + this.cropRatio = CropRatioType.RATIO_TYPE_FREE; + break; + case CropType.SQUARE: + this.cropRatio = CropRatioType.RATIO_TYPE_1_1; + break; + case CropType.BANNER: + this.cropRatio = CropRatioType.RATIO_TYPE_4_3; + break; + case CropType.RECTANGLE: + this.cropRatio = CropRatioType.RATIO_TYPE_16_9; + default: + this.cropRatio = CropRatioType.RATIO_TYPE_FREE; + break; + } + } + + rotateImage(rotateType: RotateType) { + if (rotateType === RotateType.CLOCKWISE) { + try { + this.pixelMap.rotate(CommonConstants.CLOCK_WISE) + .then(() => { + this.flushPixelMap(); + }) + } catch (error) { + Logger.error(TAG, `there is a error in rotate process with ${error?.code}`); + } + } + if (rotateType === RotateType.ANTI_CLOCK) { + try { + this.pixelMap.rotate(CommonConstants.ANTI_CLOCK) + .then(() => { + this.flushPixelMap(); + }) + } catch (error) { + Logger.error(TAG, `there is a error in rotate process with ${error?.code}`); + } + } + } + + flushPixelMap() { + const temp = this.pixelMap; + this.pixelMap = undefined; + this.pixelMap = temp; + this.updateImageInfo(); + } + + updateImageInfo() { + this.pixelMap.getImageInfo().then((imageInfo) => { + this.imageInfo = imageInfo; + this.imageWidth = px2vp(this.imageInfo.size.width); + this.imageHeight = px2vp(this.imageInfo.size.height); + this.imageOldSize = { + width: this.imageWidth, + height: this.imageHeight + } + this.showCanvas = true; + }); + } + + pixelInit() { + this.showCanvas = false; + getPixelMap(CommonConstants.RAW_FILE_NAME).then(pixelMap => { + this.pixelMap = pixelMap; + this.currentCropIndex = 0; + this.currentAdjustData = CommonConstants.ADJUST_SLIDER_VALUE.map((item) => item); + this.updateImageInfo(); + this.cropRatio = CropRatioType.RATIO_TYPE_FREE; + }); + } + + listenCropChange() { + this.isCrop = this.currentIndex === 0; + if (this.isCrop) { + this.resetShow = true; + } else { + this.resetShow = false; + } + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/utils/AdjustUtil.ts b/Media/ImageEdit/entry/src/main/ets/utils/AdjustUtil.ts new file mode 100644 index 0000000000000000000000000000000000000000..29df3ff8de3a01ca8cd224fe7a290666c0c9ba67 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/AdjustUtil.ts @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constant/CommonConstants'; +import { RGBIndex, HSVIndex, AngelRange } from '../viewModel/OptionViewModel'; + +/** + * Saturation adjust. + * + * @param pixelMap. + * @param value saturation's value. + * @return arrayBuffer. + */ +export function adjustSaturation(bufferArray: ArrayBuffer, last: number, cur: number) { + return execColorInfo(bufferArray, last, cur, HSVIndex.SATURATION); +} + +/** + * Image brightness adjust. + * + * @param pixelMap. + * @param value image's brigtness. + * @return arrayBuffer. + */ +export function adjustImageValue(bufferArray: ArrayBuffer, last: number, cur: number) { + return execColorInfo(bufferArray, last, cur, HSVIndex.VALUE); +} + +/** + * Exec color transform. + * + * @param bufferArray. + * @param last. + * @param cur. + * @param hsvIndex. + * @return arrayBuffer. + */ +export function execColorInfo(bufferArray: ArrayBuffer, last: number, cur: number, hsvIndex: number) { + if (!bufferArray) { + return; + } + const newBufferArr = bufferArray; + let colorInfo = new Uint8Array(newBufferArr); + for (let i = 0; i < colorInfo?.length; i += CommonConstants.PIXEL_STEP) { + const hsv = rgb2hsv(colorInfo[i + RGBIndex.RED], colorInfo[i + RGBIndex.GREEN], colorInfo[i + RGBIndex.BLUE]); + let rate = cur / last; + hsv[hsvIndex] *= rate; + const rgb = hsv2rgb(hsv[HSVIndex.HUE], hsv[HSVIndex.SATURATION], hsv[HSVIndex.VALUE]); + colorInfo[i + RGBIndex.RED] = rgb[RGBIndex.RED]; + colorInfo[i + RGBIndex.GREEN] = rgb[RGBIndex.GREEN]; + colorInfo[i + RGBIndex.BLUE] = rgb[RGBIndex.BLUE]; + } + return newBufferArr; +} + +/** + * Color transform. + * + * @param rgbValue 0 - 255. + * @return 0 - 1. + */ +function colorTransform(rgbValue: number) { + return Number((rgbValue / CommonConstants.COLOR_LEVEL_MAX).toFixed(CommonConstants.DECIMAL_TWO)); +} + +/** + * RGB transform to HSV. + * + * @param red 0- 255. + * @param green 0- 255. + * @param blue 0- 255. + * @return h (0 - 360) s(0 - 100) v (0 - 100). + */ +function rgb2hsv(red: number, green: number, blue: number) { + let hsvH: number = 0, hsvS: number = 0, hsvV: number = 0; + const rgbR: number = colorTransform(red); + const rgbG: number = colorTransform(green); + const rgbB: number = colorTransform(blue); + const maxValue = Math.max(rgbR, Math.max(rgbG, rgbB)); + const minValue = Math.min(rgbR, Math.min(rgbG, rgbB)); + hsvV = maxValue * CommonConstants.CONVERT_INT; + if (maxValue === 0) { + hsvS = 0; + } else { + hsvS = Number((1 - minValue / maxValue).toFixed(CommonConstants.DECIMAL_TWO)) * CommonConstants.CONVERT_INT; + } + if (maxValue === minValue) { + hsvH = 0; + } + if (maxValue === rgbR && rgbG >= rgbB) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbG - rgbB) / (maxValue - minValue))); + } + if (maxValue === rgbR && rgbG < rgbB) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbG - rgbB) / (maxValue - minValue)) + CommonConstants.ANGLE_360); + } + if (maxValue === rgbG) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbB - rgbR) / (maxValue - minValue)) + CommonConstants.ANGLE_120); + } + if (maxValue === rgbB) { + hsvH = Math.floor(CommonConstants.ANGLE_60 * ((rgbR - rgbG) / (maxValue - minValue)) + CommonConstants.ANGLE_240); + } + return [hsvH, hsvS, hsvV]; +} + +/** + * HSV to RGB conversion formula: + * When 0 <= H <= 360, 0 <= S <= 1 and 0 <= V <= 1: + * C = V * S + * X = C * (1 - Math.abs((H / 60) mod 2 - 1)) + * m = V - C + * | (C, X ,0), 0 <= H < 60 + * | (X, C, 0), 60 <= H < 120 + * | (0, C, X), 120 <= H < 180 + * (R', G', B') = | (0, X, C), 180 <= H < 240 + * | (X, 0, C), 240 <= H < 300 + * | (C, 0, X), 300 <= H < 360 + * + * (R, G, B) = ((R' + m) * 255, (G' + m) * 255, (B' + m) * 255) + * + * @param h hue 0 ~ 360. + * @param s saturation 0 ~ 100. + * @param v value 0 ~ 100. + * @return rgb value. + */ +function hsv2rgb(hue: number, saturation: number, value: number) { + let rgbR: number = 0, rgbG: number = 0, rgbB: number = 0; + if (saturation === 0) { + rgbR = rgbG = rgbB = Math.round((value * CommonConstants.COLOR_LEVEL_MAX) / CommonConstants.CONVERT_INT); + return { rgbR, rgbG, rgbB }; + } + const cxmC = (value * saturation) / (CommonConstants.CONVERT_INT * CommonConstants.CONVERT_INT); + const cxmX = cxmC * (1 - Math.abs((hue / CommonConstants.ANGLE_60) % CommonConstants.MOD_2 - 1)); + const cxmM = (value - cxmC * CommonConstants.CONVERT_INT) / CommonConstants.CONVERT_INT; + const hsvHRange = Math.floor(hue / CommonConstants.ANGLE_60); + switch (hsvHRange) { + case AngelRange.ANGEL_0_60: + rgbR = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_60_120: + rgbR = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_120_180: + rgbR = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_180_240: + rgbR = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_240_300: + rgbR = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + case AngelRange.ANGEL_300_360: + rgbR = (cxmC + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbG = (0 + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + rgbB = (cxmX + cxmM) * CommonConstants.COLOR_LEVEL_MAX; + break; + default: + break; + } + return [ + Math.round(rgbR), + Math.round(rgbG), + Math.round(rgbB) + ]; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets b/Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b247296412a005b9aa06350e9d5dea54fb6ac0d --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { RegionItem } from '../common/bean/RegionItem'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +/** + * Crop 1:1. + * + * @param pixelMap. + * @param width. + * @param height. + */ +export async function square(pixelMap: PixelMap, width: number, height: number) { + if (width < height) { + pixelMap.crop({ + size: { + width: width, + height: width + }, + x: 0, + y: Math.round((height - width) / CommonConstants.AVERAGE_WEIGHT_WIDTH) + }); + } else { + pixelMap.crop({ + size: { + width: height, + height: height + }, + x: Math.round((width - height) / CommonConstants.AVERAGE_WEIGHT_WIDTH), + y: 0 + }); + } +} + +/** + * Common crop function. + * + * @param pixelMap. + * @param cropWidth. + * @param cropHeight. + * @param cropPosition. + */ +export async function cropCommon(pixelMap: PixelMap, cropWidth: number, cropHeight: number, cropPosition: RegionItem) { + pixelMap.crop({ + size: { + width: cropWidth, + height: cropHeight + }, + ...cropPosition + }); +} + +/** + * Crop 4:3. + * + * @param pixelMap. + * @param width. + * @param height. + */ +export async function banner(pixelMap: PixelMap, width: number, height: number) { + if (width <= height) { + const cropWidth = width; + const cropHeight = Math.floor(width * CommonConstants.CROP_RATE_4_3); + const cropPosition = { + x: 0, + y: Math.floor((height - cropHeight) / CommonConstants.AVERAGE_WEIGHT_WIDTH) + }; + cropCommon(pixelMap, cropWidth, cropHeight, cropPosition); + return; + } + if (width * CommonConstants.CROP_RATE_4_3 >= height) { + const cropWidth = Math.floor(height / CommonConstants.CROP_RATE_4_3); + const cropHeight = height; + const cropPosition = { + x: Math.floor((width - cropWidth) / CommonConstants.AVERAGE_WEIGHT_WIDTH), + y: 0 + }; + cropCommon(pixelMap, cropWidth, cropHeight, cropPosition); + return; + } + + const cropWidth = width; + const cropHeight = Math.floor(width * CommonConstants.CROP_RATE_4_3); + const cropPosition = { + x: 0, + y: Math.floor((height - cropHeight) / CommonConstants.AVERAGE_WEIGHT_WIDTH) + } + cropCommon(pixelMap, cropWidth, cropHeight, cropPosition); +} + +/** + * Crop 16:9. + * + * @param pixelMap. + * @param width. + * @param height. + */ +export async function rectangle(pixelMap: PixelMap, width: number, height: number) { + if (width <= height) { + const cropWidth = width; + const cropHeight = Math.floor(width * (CommonConstants.CROP_RATE_9_16)); + const cropPosition = { + x: 0, + y: Math.floor((height - cropHeight) / CommonConstants.AVERAGE_WEIGHT_WIDTH) + }; + cropCommon(pixelMap, cropWidth, cropHeight, cropPosition); + return; + } + if (width * (CommonConstants.CROP_RATE_9_16) >= height) { + const cropWidth = Math.floor(height / (CommonConstants.CROP_RATE_9_16)); + const cropHeight = height; + const cropPosition = { + x: Math.floor((width - cropWidth) / CommonConstants.AVERAGE_WEIGHT_WIDTH), + y: 0 + }; + cropCommon(pixelMap, cropWidth, cropHeight, cropPosition); + return; + } + + const cropWidth = width; + const cropHeight = Math.floor(width * (CommonConstants.CROP_RATE_9_16)); + const cropPosition = { + x: 0, + y: Math.floor((height - cropHeight) / CommonConstants.AVERAGE_WEIGHT_WIDTH) + }; + cropCommon(pixelMap, cropWidth, cropHeight, cropPosition); +} + + diff --git a/Media/ImageEdit/entry/src/main/ets/utils/DecodeUtil.ets b/Media/ImageEdit/entry/src/main/ets/utils/DecodeUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0d9c2fda453b099159c14879ae12409f05fa092 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/DecodeUtil.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device 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 fs from '@ohos.file.fs'; +import image from '@ohos.multimedia.image'; +import Logger from './LoggerUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +const TAG: string = 'imageEdit_Decode'; + +/** + * Async get resource fd. + * + * @return file fd. + */ +async function getResourceFd(filename: string) { + const resourceMgr = getContext(this).resourceManager; + const context = getContext(this); + if (filename === CommonConstants.RAW_FILE_NAME) { + let imageBuffer = await resourceMgr.getMediaContent($r("app.media.ic_low")) + let filePath = context.cacheDir + '/' + filename; + let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + let writeLen = fs.writeSync(file.fd, imageBuffer.buffer); + fs.copyFileSync(filePath, context.cacheDir + '/' + CommonConstants.RAW_FILE_NAME_TEST); + return file.fd; + } else { + let filePath = context.cacheDir + '/' + filename; + let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + return file.fd; + } +} + +/** + * Async create pixel map. + * + * @return pixelMa. + */ +export async function getPixelMap(fileName: string) { + const fd = await getResourceFd(fileName); + const imageSourceApi = image.createImageSource(fd); + if (!imageSourceApi) { + Logger.error(TAG, 'imageSourceAPI created failed!'); + return; + } + const pixelMap = await imageSourceApi.createPixelMap({ + editable: true + }); + return pixelMap; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/utils/DrawingUtils.ets b/Media/ImageEdit/entry/src/main/ets/utils/DrawingUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..a4d8b85f60441b234034342f14d598ef553c32bc --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/DrawingUtils.ets @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { RectF } from '../common/bean/Rect'; +import { MathUtils } from './MathUtils'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +export abstract class DrawingUtils { + /** + * Draw mask. + * @param ctx + * @param outer + * @param inner + * @param isShow + */ + static drawMask(ctx: CanvasRenderingContext2D, outer: RectF, inner: RectF, isShow: boolean) { + // ctx.fillStyle = DrawingUtils.DEFAULT_MASK_STYLE; + if (isShow) { + ctx.fillStyle = CommonConstants.DEFAULT_MASK_STYLE; + } else { + ctx.fillStyle = `rgba(0, 0, 0, 1)`; + } + ctx.fillRect(outer.left, outer.top, outer.getWidth(), inner.top - outer.top); + ctx.fillRect(outer.left, inner.top, inner.left - outer.left, inner.getHeight()); + ctx.fillRect(inner.right, inner.top, outer.right - inner.right, inner.getHeight()); + ctx.fillRect(outer.left, inner.bottom, outer.getWidth(), outer.bottom - inner.bottom); + } + + /** + * Draw crop thick line. + * @param ctx + * @param crop + */ + static drawCropButton(ctx: CanvasRenderingContext2D, crop: RectF) { + let vp3 = CommonConstants.DEFAULT_BUTTON_WIDTH; + let padding = CommonConstants.DEFAULT_BUTTON_PADDING; + ctx.lineWidth = vp3; + ctx.strokeStyle = CommonConstants.DEFAULT_BUTTON_COLOR; + let cornerLength = CommonConstants.DEFAULT_BUTTON_LENGTH; + DrawingUtils.drawCornerButton(ctx, crop, vp3, padding, cornerLength); + DrawingUtils.drawLineButton(ctx, crop, vp3, padding, cornerLength); + } + + /** + * Draw rect. + * @param ctx + * @param crop + */ + static drawRect(ctx: CanvasRenderingContext2D, crop: RectF) { + // ctx.lineWidth = DrawingUtils.DEFAULT_LINE_WIDTH; + ctx.lineWidth = CommonConstants.DEFAULT_LINE_RECT_WIDTH; + ctx.strokeStyle = CommonConstants.DEFAULT_RECT_LINE_COLOR; + let points = MathUtils.rectToPoints(crop); + for (let i = 0; i < points.length; i++) { + let j = (i + 1) % points.length; + DrawingUtils.drawLine(ctx, points[i].x, points[i].y, points[j].x, points[j].y); + } + } + + /** + * Draw split line. + * @param ctx + * @param crop + * @param split + * @param isShow + */ + static drawSplitLine(ctx: CanvasRenderingContext2D, crop: RectF, split, isShow: boolean) { + if (!isShow) { + return; + } + ctx.lineWidth = CommonConstants.DEFAULT_LINE_WIDTH; + ctx.strokeStyle = CommonConstants.DEFAULT_LINE_COLOR; + let w = Math.ceil(crop.getWidth() / split); + let h = Math.ceil(crop.getHeight() / split); + for (let i = 1; i < split; i++) { + let x = crop.left + w * i; + let y = crop.top + h * i; + DrawingUtils.drawLine(ctx, x, crop.top, x, crop.bottom); + DrawingUtils.drawLine(ctx, crop.left, y, crop.right, y); + } + } + + /** + * Draw line. + * @param ctx + * @param srcX + * @param srcY + * @param dstX + * @param dstY + */ + static drawLine(ctx: CanvasRenderingContext2D, srcX: number, srcY: number, dstX: number, dstY: number) { + ctx.beginPath(); + ctx.moveTo(srcX, srcY); + ctx.lineTo(dstX, dstY); + ctx.stroke(); + } + + /** + * Draw corner line. + * @param ctx + * @param crop + * @param vp3 + * @param padding + * @param cornerLength + */ + private static drawCornerButton(ctx: CanvasRenderingContext2D, crop: RectF, + vp3: number, padding: number, cornerLength: number) { + // left top conner button + vp3 = vp3 / 2; + let startX = crop.left - vp3 - padding; + let startY = crop.top - vp3; + let stopX = startX + cornerLength; + let stopY = startY; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + startX = crop.left - vp3; + startY = crop.top - vp3 - padding; + stopX = startX; + stopY = startY + cornerLength; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + + // right top conner button + startX = crop.right + vp3 + padding; + startY = crop.top - vp3; + stopX = startX - cornerLength; + stopY = startY; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + startX = crop.right + vp3; + startY = crop.top - vp3 - padding; + stopX = startX; + stopY = startY + cornerLength; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + + // left bottom conner button + startX = crop.left - vp3; + startY = crop.bottom + vp3 + padding; + stopX = startX; + stopY = startY - cornerLength; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + startX = crop.left - vp3 - padding; + startY = crop.bottom + vp3; + stopX = startX + cornerLength; + stopY = startY; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + + // right bottom conner button + startX = crop.right + vp3 + padding; + startY = crop.bottom + vp3; + stopX = startX - cornerLength; + stopY = startY; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + startX = crop.right + vp3; + startY = crop.bottom + vp3 + padding; + stopX = startX; + stopY = startY - cornerLength; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + } + + /** + * Draw line. + * @param ctx + * @param crop + * @param vp3 + * @param padding + * @param cornerLength + */ + private static drawLineButton(ctx: CanvasRenderingContext2D, crop: RectF, + vp3: number, padding: number, cornerLength: number) { + vp3 = vp3 / 2; + // top button + let startX = crop.getCenterX() - cornerLength / 2; + let startY = crop.top - vp3; + let stopX = startX + cornerLength; + let stopY = startY; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + + // bottom button + startX = crop.getCenterX() - cornerLength / 2; + startY = crop.bottom + vp3; + stopX = startX + cornerLength; + stopY = startY; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + + // left button + startX = crop.left - vp3; + startY = crop.getCenterY() - cornerLength / 2; + stopX = startX; + stopY = startY + cornerLength; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + + // right button + startX = crop.right + vp3; + startY = crop.getCenterY() - cornerLength / 2; + stopX = startX; + stopY = startY + cornerLength; + DrawingUtils.drawLine(ctx, startX, startY, stopX, stopY); + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/utils/EncodeUtil.ets b/Media/ImageEdit/entry/src/main/ets/utils/EncodeUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8e193a2a34960008a7e617750e5e3458893e23e --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/EncodeUtil.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Huawei Device 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 mediaLibrary from '@ohos.multimedia.mediaLibrary'; +import fs from '@ohos.file.fs'; +import image from '@ohos.multimedia.image'; +import Logger from './LoggerUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +const TAG: string = 'imageEdit_Encode'; + +/** + * Pack the image. + * + * @param pixelMap. + */ +export async function encode(pixelMap: PixelMap) { + const newPixelMap = pixelMap; + // Packing image. + const imagePackerApi = image.createImagePacker(); + const packOptions: image.PackingOption = { + format: CommonConstants.ENCODE_FORMAT, + quality: CommonConstants.ENCODE_QUALITY + } + const imageData = await imagePackerApi.packing(newPixelMap, packOptions); + Logger.info(TAG, `imageData's length is ${imageData.byteLength}`); + // Get album's path. + const context = getContext(this); + const media = mediaLibrary.getMediaLibrary(context); + const publicPath = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_IMAGE); + const currentTime = new Date().getTime(); + // Create image asset. + const imageAssetInfo = await media.createAsset( + mediaLibrary.MediaType.IMAGE, + `${CommonConstants.IMAGE_PREFIX}_${currentTime}${CommonConstants.IMAGE_FORMAT}`, + publicPath + ); + const imageFd = await imageAssetInfo.open(CommonConstants.ENCODE_FILE_PERMISSION); + await fs.write(imageFd, imageData); + // Image resource release. + await imageAssetInfo.close(imageFd); + imagePackerApi.release(); + await media.release(); +} + + diff --git a/Media/ImageEdit/entry/src/main/ets/utils/LoggerUtil.ts b/Media/ImageEdit/entry/src/main/ets/utils/LoggerUtil.ts new file mode 100644 index 0000000000000000000000000000000000000000..41e5807517df3c7a42fb0fb2740967cf0a15b779 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/LoggerUtil.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; + +/** + * Log printing tool class. + */ +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * Constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { + this.prefix = prefix; + this.domain = domain; + } + + debug(...args: any[]) { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]) { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]) { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]) { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('[ImageEdit]') \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets b/Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ae50ca224d2a37aad13be06c1fcbc779d940ac4 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { LineSegment } from '../common/bean/Line'; +import { Point } from '../common/bean/Point'; +import { RectF } from '../common/bean/Rect'; +import { CropAngle } from '../common/bean/CropType'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +export abstract class MathUtils { + /** + * Round out rect. + * @param rect + */ + static roundOutRect(rect: RectF): void { + let copy = { ...rect }; + rect.set(Math.round(copy.left), Math.round(copy.top), Math.round(copy.right), Math.round(copy.bottom)); + } + + /** + * Normalized rectangle. + * @param rect + * @param width + * @param height + */ + static normalizeRect(rect: RectF, width: number, height: number): void { + rect.left /= width; + rect.right /= width; + rect.top /= height; + rect.bottom /= height; + } + + /** + * Restore rectangle. + * @param rect + * @param width + * @param height + */ + static revertRect(rect: RectF, width: number, height: number): void { + rect.left *= width; + rect.right *= width; + rect.top *= height; + rect.bottom *= height; + } + + /** + * Get rectangle endpoints. + * @param rect + * @returns + */ + static rectToPoints(rect: RectF): Array { + let points = []; + points.push(new Point(rect.left, rect.top)); + points.push(new Point(rect.right, rect.top)); + points.push(new Point(rect.right, rect.bottom)); + points.push(new Point(rect.left, rect.bottom)); + return points; + } + + /** + * Convert width and height. + * @param rect + */ + static swapWidthHeight(rect: RectF): void { + let centerX = rect.getCenterX(); + let centerY = rect.getCenterY(); + let halfWidth = rect.getWidth() / 2; + let halfHeight = rect.getHeight() / 2; + rect.left = centerX - halfHeight; + rect.right = centerX + halfHeight; + rect.top = centerY - halfWidth; + rect.bottom = centerY + halfWidth; + } + + /** + * Rotate by point. + * @param inputs + * @param angle + * @param origin + * @returns + */ + static rotatePoints(inputs: Array, angle: number, origin: Point): Array { + let alpha = MathUtils.formulaAngle(-angle); + let outputs = []; + for (let input of inputs) { + let dx = input.x - origin.x; + let dy = input.y - origin.y; + let output = new Point(origin.x, origin.y); + output.x += Math.cos(alpha) * dx + Math.sin(alpha) * dy; + output.y += -Math.sin(alpha) * dx + Math.cos(alpha) * dy; + outputs.push(output); + } + return outputs; + } + + /** + * Calculate the largest marquee. + * @param rect + * @param limit + * @param rate + */ + static computeMaxRectWithinLimit(rect: RectF, limit: RectF, rate: number): void { + let limitWidth = limit.getWidth(); + let limitHeight = limit.getHeight(); + let width = limitWidth; + let height = limitHeight; + if (rate > (limitWidth / limitHeight)) { + height = width / rate; + rect.left = limit.left; + rect.top = limit.top + (limitHeight - height) / 2; + } else { + width = height * rate; + rect.left = limit.left + (limitWidth - width) / 2; + rect.top = limit.top; + } + rect.right = rect.left + width; + rect.bottom = rect.top + height; + } + + /** + * Scale rectangle by points. + * @param rect + * @param p + * @param scale + */ + static scaleRectBasedOnPoint(rect: RectF, p: Point, scale: number): void { + let operate = { ...rect }; + operate.left = (rect.left - p.x) * scale + p.x; + operate.right = (rect.right - p.x) * scale + p.x; + operate.top = (rect.top - p.y) * scale + p.y; + operate.bottom = (rect.bottom - p.y) * scale + p.y; + rect.set(operate.left, operate.top, operate.right, operate.bottom); + } + + /** + * Determine if two lines intersect. + * @param line1 + * @param line2 + * @returns true means intersect, false means not intersect. + */ + static hasIntersection(line1: LineSegment, line2: LineSegment): boolean { + let p1 = line1.start; + let p2 = line1.end; + let p3 = line2.start; + let p4 = line2.end; + if (Math.max(p1.x, p2.x) < Math.min(p3.x, p4.x) || Math.max(p1.y, p2.y) < Math.min(p3.y, p4.y) + || Math.max(p3.x, p4.x) < Math.min(p1.x, p2.x) || Math.max(p3.y, p4.y) < Math.min(p1.y, p2.y)) { + return false; + } + + if ((((p1.x - p3.x) * (p4.y - p3.y) - (p1.y - p3.y) * (p4.x - p3.x)) + * ((p2.x - p3.x) * (p4.y - p3.y) - (p2.y - p3.y) * (p4.x - p3.x))) >= 0 + || (((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) + * ((p4.x - p1.x) * (p2.y - p1.y) - (p4.y - p1.y) * (p2.x - p1.x))) >= 0) { + return false; + } + return true; + } + + /** + * Get the intersection point of two lines. + * @param line1 + * @param line2 + * @returns Intersection coordinates. + */ + static getIntersection(line1: LineSegment, line2: LineSegment): Point { + let yStartSpacing1 = line1.start.y - line1.end.y; + let yEndSpacing1 = line1.end.x - line1.start.x; + let resultLine1 = yStartSpacing1 * line1.start.x + yEndSpacing1 * line1.start.y; + + let yStartSpacing2 = line2.start.y - line2.end.y; + let yEndSpacing2 = line2.end.x - line2.start.x; + let resultLine2 = yStartSpacing2 * line2.start.x + yEndSpacing2 * line2.start.y; + + let kRate = yStartSpacing1 * yEndSpacing2 - yStartSpacing2 * yEndSpacing1; + if (Math.abs(kRate) < CommonConstants.EQUALITY_THRESHOLD) { + return undefined; + } + + let intersectionX1 = yEndSpacing2 / kRate; + let intersectionX2 = -yEndSpacing1 / kRate; + let intersectionY1 = -yStartSpacing2 / kRate; + let intersectionY2 = yStartSpacing1 / kRate; + + let xIntersection = intersectionX1 * resultLine1 + intersectionX2 * resultLine2; + let yIntersection = intersectionY1 * resultLine1 + intersectionY2 * resultLine2; + return new Point(xIntersection, yIntersection); + } + + /** + * Find suitable scale. + * @param points + * @param rect + * @param origin + * @returns scale. + */ + static findSuitableScale(points: Array, rect: RectF, origin: Point): number { + let scale = 1; + let temp = 1; + for (let point of points) { + if (point.x < rect.left) { + temp = (origin.x - point.x) / (origin.x - rect.left); + scale = Math.max(scale, temp); + } + if (point.x > rect.right) { + temp = (point.x - origin.x) / (rect.right - origin.x); + scale = Math.max(scale, temp); + } + if (point.y < rect.top) { + temp = (origin.y - point.y) / (origin.y - rect.top); + scale = Math.max(scale, temp); + } + if (point.y > rect.bottom) { + temp = (point.y - origin.y) / (rect.bottom - origin.y); + scale = Math.max(scale, temp); + } + } + return scale; + } + + /** + * Image move fix. + * @param rotated + * @param flipImage + * @returns offset. + */ + static fixImageMove(rotated: Array, flipImage: RectF): Array { + let offsetX = 0; + let offsetY = 0; + for (let point of rotated) { + if (point.x < flipImage.left) { + offsetX = Math.min(offsetX, point.x - flipImage.left); + } else if (point.x > flipImage.right) { + offsetX = Math.max(offsetX, point.x - flipImage.right); + } + if (point.y < flipImage.top) { + offsetY = Math.min(offsetY, point.y - flipImage.top); + } else if (point.y > flipImage.bottom) { + offsetY = Math.max(offsetY, point.y - flipImage.bottom); + } + } + return [offsetX, offsetY]; + } + + /** + * Confirm whether it is an odd rotation. + * @param angle + * @returns true means is odd, false means is not odd. + */ + static isOddRotation(angle: number): boolean { + if (angle == -CropAngle.ONE_QUARTER_CIRCLE_ANGLE || angle == -CropAngle.THREE_QUARTER_CIRCLE_ANGLE) { + return true; + } + return false; + } + + /** + * If line intersect, limit. + * @param outerLine + * @param diagonal + * @param rect + */ + static limitCornerIfLineIntersect(outerLine: LineSegment, diagonal: LineSegment, rect: RectF): void { + let origin = new Point(rect.getCenterX(), rect.getCenterY()); + if (MathUtils.hasIntersection(outerLine, diagonal)) { + let intersection = MathUtils.getIntersection(outerLine, diagonal); + if (intersection == undefined) { + return; + } + if (intersection.x < origin.x) { + rect.left = intersection.x; + } else { + rect.right = intersection.x; + } + if (intersection.y < origin.y) { + rect.top = intersection.y; + } else { + rect.bottom = intersection.y; + } + } + } + + /** + * Rotating, limit in rect. + * @param rect + * @param outerLines + */ + static limitRectInRotated(rect: RectF, outerLines: Array): void { + let copy = new RectF(); + copy.set(rect.left, rect.top, rect.right, rect.bottom); + let diagonal1 = new LineSegment(new Point(copy.left, copy.top), new Point(copy.right, copy.bottom)); + for (let line of outerLines) { + MathUtils.limitCornerIfLineIntersect(line, diagonal1, copy); + } + + let diagonal2 = new LineSegment(new Point(copy.left, copy.bottom), new Point(copy.right, copy.top)); + for (let line of outerLines) { + MathUtils.limitCornerIfLineIntersect(line, diagonal2, copy); + } + rect.set(copy.left, copy.top, copy.right, copy.bottom); + } + + /** + * Based on point rotating, limit rect. + * @param baseIndex + * @param rect + * @param rotatedLines + */ + static limitRectInRotatedBasedOnPoint(baseIndex: number, rect: RectF, rotatedLines: Array): void { + let points = MathUtils.rectToPoints(rect); + let base = points[baseIndex]; + points.splice(baseIndex, 1); + let scale = 1; + for (let point of points) { + let line = new LineSegment(base, point); + for (let rotatedLine of rotatedLines) { + if (MathUtils.hasIntersection(line, rotatedLine)) { + let p = MathUtils.getIntersection(line, rotatedLine); + if (p == undefined) { + continue; + } + let tempScale + = Math.hypot(p.x - base.x, p.y - base.y) / Math.hypot(point.x - base.x, point.y - base.y); + scale = Math.min(scale, (tempScale > CommonConstants.EQUALITY_THRESHOLD) ? tempScale : 1); + } + } + } + MathUtils.scaleRectBasedOnPoint(rect, base, scale); + } + + /** + * Get max fixed rect size. + * @param rate + * @param maxWidth + * @param maxHeight + * @returns rect width and height. + */ + static getMaxFixedRectSize(rate: number, maxWidth: number, maxHeight: number): Array { + let width = 0; + let height = 0; + if (rate > (maxWidth / maxHeight)) { + width = maxWidth; + height = width / rate; + } else { + height = maxHeight; + width = height * rate; + } + return [width, height]; + } + + /** + * Get min fixed rect size. + * @param rate + * @param minLength + * @returns rect width and height. + */ + static getMinFixedRectSize(rate: number, minLength: number): Array { + let width = minLength; + let height = minLength; + if (rate > 1) { + width = height * rate; + } else { + height = width / rate; + } + return [width, height]; + } + + /** + * Determine whether it is the same rectangle. + * @param rect1 + * @param rect2 + * @returns true means same, false means not same. + */ + static areRectsSame(rect1: RectF, rect2: RectF): boolean { + if (rect1.left == rect2.left && rect1.top == rect2.top + && rect1.right == rect2.right && rect1.bottom == rect2.bottom) { + return true; + } + return false; + } + + /** + * Calculate radian value. + * @param angle + * @returns + */ + static formulaAngle(angle: number): number { + return angle * Math.PI / CropAngle.HALF_CIRCLE_ANGLE; + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/utils/OpacityUtil.ets b/Media/ImageEdit/entry/src/main/ets/utils/OpacityUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..b87b581907bd75c1690de022c7c533d8ebef85a4 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/utils/OpacityUtil.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { CommonConstants } from '../common/constant/CommonConstants'; +import Logger from './LoggerUtil'; + +const TAG = 'Opacity'; + +/** + * Opacity adjust. + * + * @param pixelMap. + * @param value. + * @return pixelMap. + */ +export async function adjustOpacity(pixelMap: PixelMap, value: number) { + if (!pixelMap) { + return; + } + const newPixelMap = pixelMap; + await newPixelMap.opacity(value / CommonConstants.SLIDER_MAX); + return newPixelMap; +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/view/AdjustContentView.ets b/Media/ImageEdit/entry/src/main/ets/view/AdjustContentView.ets new file mode 100644 index 0000000000000000000000000000000000000000..a268c52b0c6b1dccf22da53108e4ce366ecc7151 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/view/AdjustContentView.ets @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2023 Huawei Device 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 worker, { MessageEvents} from '@ohos.worker'; +import { adjustIconList, IconStatus } from '../viewModel/IconListViewModel'; +import { adjustOpacity } from '../utils/OpacityUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; +import { AdjustId } from '../viewModel/OptionViewModel'; +import { MessageItem } from '../common/bean/MessageItem' +import Logger from '../utils/LoggerUtil'; + +@Component +export default struct AdjustContentView { + @Builder TabBuilder(index: number, name: string | Resource) { + Column() { + Image(this.currentAdjustIndex === index ? this.AdjustIconList[index]?.chosen : this.AdjustIconList[index]?.normal) + .width($r('app.float.adjust_icon_width')) + .height($r('app.float.adjust_icon_height')) + + Text(name) + .fontColor(this.currentAdjustIndex === index ? Color.Blue : Color.White) + .fontSize($r('app.float.adjust_font_size')) + .margin({ top: $r('app.float.adjust_margin_top') }) + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + } + + @State currentAdjustIndex: number = 0; + @Consume currentAdjustData: Array; + AdjustIconList: Array = adjustIconList; + + build() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + SliderCustom({ + currentIndex: AdjustId.BRIGHTNESS.valueOf(), + min: CommonConstants.SLIDER_MIN.valueOf(), + max: CommonConstants.SLIDER_MAX.valueOf(), + currentAdjustData: $currentAdjustData + }) + } + .tabBar(this.TabBuilder(AdjustId.BRIGHTNESS, $r('app.string.brightness'))) + + TabContent() { + SliderCustom({ + currentIndex: AdjustId.TRANSPARENCY.valueOf(), + min: CommonConstants.SLIDER_MIN.valueOf(), + max: CommonConstants.SLIDER_MAX.valueOf(), + currentAdjustData: $currentAdjustData + }) + } + .tabBar(this.TabBuilder(AdjustId.TRANSPARENCY, $r('app.string.transparency'))) + + TabContent() { + SliderCustom({ + currentIndex: AdjustId.SATURATION.valueOf(), + min: CommonConstants.SLIDER_MIN.valueOf(), + max: CommonConstants.SLIDER_MAX.valueOf(), + currentAdjustData: $currentAdjustData + }) + } + .tabBar(this.TabBuilder(AdjustId.SATURATION, $r('app.string.saturation'))) + } + .margin({ bottom: $r('app.float.adjust_margin_bottom') }) + .onChange((index: number) => { + this.currentAdjustIndex = index; + }) + } +} + +@Component +struct SliderCustom { + @Prop currentIndex: number; + @Link currentAdjustData: number[]; + @Prop min: number; + @Prop max: number; + @Consume pixelMap: PixelMap; + private postState: boolean = true; + workerInstance: worker.ThreadWorker = undefined; + saturationLastSlider: number = CommonConstants.SLIDER_MAX; + brightnessLastSlider: number = CommonConstants.SLIDER_MAX; + deviceListDialogController: CustomDialogController = new CustomDialogController({ + builder: Dialog(), + alignment: DialogAlignment.Center, + autoCancel: false, + customStyle: true + }); + + build() { + Column() { + Text(`${this.currentAdjustData[this.currentIndex]}`) + .fontColor(Color.White) + .margin({ top: $r('app.float.slider_margin_top') }) + .fontSize($r('app.float.slider_font_size')) + Row() { + Slider({ + value: this.currentAdjustData[this.currentIndex], + step: CommonConstants.SLIDER_STEP, + min: this.min, + max: this.max + }) + .trackColor(Color.White) + .width(CommonConstants.SLIDER_WIDTH) + .showSteps(true) + .onChange(this.sliderChange.bind(this)) + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .justifyContent(FlexAlign.Center) + } + } + + sliderChange(value: number, mode: SliderChangeMode) { + if (mode === SliderChangeMode.End || mode === CommonConstants.SLIDER_CLICK_MODE) { + this.currentAdjustData[this.currentIndex] = Math.round(value); + switch (this.currentIndex) { + case AdjustId.BRIGHTNESS: + this.postToWorker(AdjustId.BRIGHTNESS, value, CommonConstants.BRIGHTNESS_WORKER_FILE); + break; + case AdjustId.TRANSPARENCY: + adjustOpacity(this.pixelMap, Math.round(value)) + .then(pixelMap => { + this.pixelMap = undefined; + this.pixelMap = pixelMap; + }); + break; + case AdjustId.SATURATION: + this.postToWorker(AdjustId.SATURATION, value, CommonConstants.SATURATION_WORKER_FILE); + break; + default: + break; + } + } + } + + postToWorker(type: AdjustId, value: number, workerName: string) { + let sliderValue = type === AdjustId.BRIGHTNESS ? this.brightnessLastSlider : this.saturationLastSlider; + try { + let workerInstance = new worker.ThreadWorker(workerName); + const bufferArray = new ArrayBuffer(this.pixelMap.getPixelBytesNumber()); + this.pixelMap.readPixelsToBuffer(bufferArray).then(() => { + let message = new MessageItem(bufferArray, sliderValue, value); + workerInstance.postMessage(message); + if (this.postState) { + this.deviceListDialogController.open(); + } + this.postState = false; + workerInstance.onmessage = this.updatePixelMap.bind(this); + if (type === AdjustId.BRIGHTNESS) { + this.brightnessLastSlider = Math.round(value); + } else { + this.saturationLastSlider = Math.round(value); + } + workerInstance.onexit = () => { + if (workerInstance !== undefined) { + workerInstance.terminate(); + } + } + }); + } catch (error) { + Logger.error(`Create work instance fail, error message: ${JSON.stringify(error)}`) + } + } + + updatePixelMap(event: MessageEvents) { + const newPixel = this.pixelMap; + newPixel.writeBufferToPixels(event.data); + this.pixelMap = undefined; + this.pixelMap = newPixel; + this.deviceListDialogController.close(); + this.postState = true; + } +} + +@CustomDialog +export struct Dialog { + controller: CustomDialogController; + + build() { + Column() { + LoadingProgress() + .color(Color.White) + .width(CommonConstants.LOADING_WH) + .height(CommonConstants.LOADING_WH) + } + } +} diff --git a/Media/ImageEdit/entry/src/main/ets/view/ImageSelect.ets b/Media/ImageEdit/entry/src/main/ets/view/ImageSelect.ets new file mode 100644 index 0000000000000000000000000000000000000000..99d9df3894c6e9f0044d4c12c538bd0bc57e360d --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/view/ImageSelect.ets @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2023 Huawei Device 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 display from '@ohos.display'; +import image from '@ohos.multimedia.image'; +import Logger from '../utils/LoggerUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; +import { ImageSizeItem } from '../common/bean/ImageSizeItem'; +import { ImageEditCrop } from '../viewModel/ImageEditCrop'; +import { PixelMapWrapper } from '../common/bean/PixelMapWrapper'; +import Log from '../utils/LoggerUtil'; +import { ScreenManager } from '../viewModel/ScreenManager'; +import { CropRatioType } from '../common/bean/CropType'; + +const TAG = 'ImageSelect'; + +@Component +export struct ImageSelect { + @State cropEdit: ImageEditCrop = undefined; + @State pinchValue: number = 1; + @State isVerticalScreen: boolean = true; + + @Consume imageInfo: image.ImageInfo; + @Consume imageWidth: number; + @Consume imageHeight: number; + @Consume pixelMap: image.PixelMap; + @Consume showCanvas: boolean; + @Consume imageOldSize: ImageSizeItem; + @Consume @Watch('listenCrop') isCrop: boolean; + @Consume imageScale: number; + @Consume @Watch('listenRatio') cropRatio: CropRatioType; + @Consume screenWidth: number; + @Consume screenHeight: number; + @Consume resetShow: boolean; + + private statusBar: number = 0; + private titleHeight: number = CommonConstants.TITLE_HEIGHT; + private prePinch: number = 0; + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + private stateMenuSize: number = ScreenManager.getInstance().getStatusBarHeight(); + private defaultDisplay: display.Display = undefined; + + aboutToAppear() { + this.initImageSize(); + } + + build() { + Column() { + Canvas(this.context) + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + .onReady(() => { + this.cropEdit.setCanvasReady(true); + this.cropEdit.setCanvasContext(this.context); + }) + } + .width(CommonConstants.LAYOUT_FULL_SCREEN) + .height(CommonConstants.LAYOUT_FULL_SCREEN) + .onTouch((event) => { + this.onTouchStart(event); + }) + .gesture( + PinchGesture() + .onActionStart((event: GestureEvent) => { + this.onPinchGestureStart(event); + }) + .onActionUpdate((event: GestureEvent) => { + this.onPinchGestureUpdate(event); + }) + .onActionEnd(() => { + this.onPinchGestureEnd(); + }) + ) + } + + async listenCrop() { + if (!this.isCrop) { + let filter = this.cropEdit.exit(); + if (filter === undefined) { + return; + } + filter.readerNew(new PixelMapWrapper(this.pixelMap, this.imageOldSize.width, this.imageOldSize.height), () => { + let temp = this.pixelMap; + this.pixelMap = undefined; + this.pixelMap = temp; + this.updateImageInfo(); + }); + } + } + + updateImageInfo() { + this.pixelMap.getImageInfo().then((imageInfo) => { + this.imageInfo = imageInfo; + this.imageWidth = px2vp(this.imageInfo.size.width); + this.imageHeight = px2vp(this.imageInfo.size.height); + this.imageOldSize = { + width: this.imageWidth, + height: this.imageHeight + }; + this.showCanvas = true; + this.calcScale(); + Logger.info('update image width height: ' + this.imageWidth + " " + this.imageHeight); + }); + } + + listenRatio() { + this.cropEdit.onFixedRatioChange(this.cropRatio); + } + + calcScale() { + let imageWidthScale = (this.screenWidth - CommonConstants.DOUBLE * CommonConstants.SCREEN_DISPLAY_MARGIN) / + this.imageOldSize.width; + let imageHeightScale = (this.screenHeight - CommonConstants.DOUBLE * CommonConstants.SCREEN_DISPLAY_MARGIN) / + this.imageOldSize.height; + this.imageScale = imageWidthScale > imageHeightScale ? imageHeightScale : imageWidthScale; + } + + initImageSize() { + try { + this.defaultDisplay = display.getDefaultDisplaySync(); + this.screenWidth = px2vp(this.defaultDisplay.width); + this.screenHeight = px2vp((this.defaultDisplay.height - this.statusBar * 2) * + CommonConstants.EDIT_SCREEN_USAGE); + this.calcScale(); + this.cropEdit = new ImageEditCrop(); + this.cropEdit.entry(new PixelMapWrapper(this.pixelMap, this.imageOldSize.width, this.imageOldSize.height)); + this.cropEdit.setCanvasSize(this.screenWidth, this.screenHeight); + } catch (exception) { + Logger.error(`Failed to obtain the default display object. Code: ${JSON.stringify(this.defaultDisplay)}`); + } + } + + onTouchStart(event: TouchEvent): void { + let x = event.touches[0].x; + let y = event.touches[0].y; + if (event.type === TouchType.Down) { + this.cropEdit.onTouchStart(x, y); + } else if (event.type === TouchType.Move) { + this.cropEdit.onTouchMove(x, y); + } else if (event.type === TouchType.Up || event.type === TouchType.Cancel) { + this.cropEdit.onTouchEnd(); + } else { + Logger.info('touch other event'); + } + } + + onPinchGestureStart(event: GestureEvent): void { + Log.debug(TAG, 'cropMode onPinchGestureStart called'); + this.prePinch = new Date().getTime(); + let x = 0; + let y = 0; + if (this.isVerticalScreen) { + x = event.pinchCenterX; + y = event.pinchCenterY - CommonConstants.TOP_BAR_SIZE - this.stateMenuSize; + } else { + x = event.pinchCenterX - CommonConstants.TOOL_BAR_SIZE; + y = event.pinchCenterY - CommonConstants.TOP_BAR_SIZE - this.stateMenuSize; + } + this.cropEdit.onPinchStart(x, y, event.scale); + } + + onPinchGestureUpdate(event: GestureEvent): void { + let now = new Date().getTime(); + if (now - this.prePinch >= CommonConstants.TIMEOUT) { + this.prePinch = now; + this.cropEdit.onPinchUpdate(event.scale); + } + } + + onPinchGestureEnd(): void { + Log.debug(TAG, 'cropMode onPinchGestureEnd called'); + this.cropEdit.onPinchEnd(); + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets b/Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets new file mode 100644 index 0000000000000000000000000000000000000000..8486a1cd4f372b036270b43c9303097a9a058ebb --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets @@ -0,0 +1,761 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { LineSegment } from '../common/bean/Line'; +import { Point } from '../common/bean/Point'; +import { RectF } from '../common/bean/Rect'; +import { Ratio } from '../common/bean/Ratio'; +import { CropAngle, CropRatioType } from '../common/bean/CropType'; +import { MathUtils } from '../utils/MathUtils'; +import Log from '../utils/LoggerUtil'; +import { ScreenManager } from './ScreenManager'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +const TAG: string = 'editor_CropShow'; + +export class CropShow { + private limitRect: RectF = undefined; + private cropRect: RectF = undefined; + private imageRect: RectF = undefined; + private ratio: Ratio = undefined; + private screenMaxSide: number = 0; + private screenMinSide: number = 0; + private minSideLength: number = CommonConstants.DEFAULT_MIN_SIDE_LENGTH; + private touchBound: number = CommonConstants.DEFAULT_TOUCH_BOUND; + private rotationAngle: number = 0; + private horizontalAngle: number = 0; + private maxScaleFactorW: number = CommonConstants.BASE_SCALE_VALUE; + private maxScaleFactorH: number = CommonConstants.BASE_SCALE_VALUE; + private isFlipHorizontal: boolean = false; + private isFlipVertically: boolean = false; + private isLeft: boolean = false; + private isRight: boolean = false; + private isTop: boolean = false; + private isBottom: boolean = false; + private isHorizontalSide: boolean = false; + private isVerticalSide: boolean = false; + + /** + * Constructor. + */ + constructor() { + this.limitRect = new RectF(); + this.imageRect = new RectF(); + this.cropRect = new RectF(); + this.ratio = new Ratio(CommonConstants.DEFAULT_RATIO, CommonConstants.DEFAULT_RATIO); + + let screenWidth = Math.ceil(ScreenManager.getInstance().getWinWidth()); + let screenHeight = Math.ceil(ScreenManager.getInstance().getWinHeight()); + this.screenMaxSide = Math.max(screenWidth, screenHeight); + this.screenMinSide = Math.min(screenWidth, screenHeight); + } + + /** + * Init cropShow. + * @param limit + * @param imageRatio + */ + init(limit: RectF, imageRatio: number) { + this.limitRect.set(limit.left, limit.top, limit.right, limit.bottom); + MathUtils.computeMaxRectWithinLimit(this.imageRect, limit, imageRatio); + this.cropRect.set(this.imageRect.left, this.imageRect.top, this.imageRect.right, this.imageRect.bottom); + this.ratio.set(CommonConstants.DEFAULT_RATIO, CommonConstants.DEFAULT_RATIO); + this.rotationAngle = 0; + this.horizontalAngle = 0; + this.isFlipHorizontal = false; + this.isFlipVertically = false; + } + + /** + * Whether crop rect change, sync limit rect size. + * @param limit + */ + syncLimitRect(limit: RectF) { + this.limitRect.set(limit.left, limit.top, limit.right, limit.bottom); + this.enlargeCropArea(); + } + + /** + * Get crop rect. + * @returns + */ + getCropRect(): RectF { + let crop = new RectF(); + crop.set(this.cropRect.left, this.cropRect.top, this.cropRect.right, this.cropRect.bottom); + return crop; + } + + /** + * Get image rect. + * @returns + */ + getImageRect(): RectF { + let image = new RectF(); + image.set(this.imageRect.left, this.imageRect.top, this.imageRect.right, this.imageRect.bottom); + return image; + } + + /** + * Set image rect. + * @param image + */ + setImageRect(image: RectF) { + this.imageRect.set(image.left, image.top, image.right, image.bottom); + } + + /** + * Sync rotate angle. + * @param angle + */ + syncRotationAngle(angle: number) { + this.rotationAngle = angle; + MathUtils.swapWidthHeight(this.cropRect); + this.swapCurrentRatio(); + this.enlargeCropArea(); + } + + /** + * Sync horizontal angle. + * @param angle + */ + syncHorizontalAngle(angle: number) { + this.horizontalAngle = angle; + + let points = MathUtils.rectToPoints(this.cropRect); + let origin = this.getDisplayCenter(); + let totalAngle = -(this.rotationAngle + this.horizontalAngle); + let rotated = MathUtils.rotatePoints(points, totalAngle, origin); + let scale = MathUtils.findSuitableScale(rotated, this.imageRect, origin); + MathUtils.scaleRectBasedOnPoint(this.imageRect, origin, scale); + } + + /** + * Set flip. + * @param isFlipHorizontal + * @param isFlipVertically + */ + setFlip(isFlipHorizontal: boolean, isFlipVertically: boolean) { + this.isFlipHorizontal = isFlipHorizontal; + this.isFlipVertically = isFlipVertically; + } + + /** + * Set ratio. + * @param ratio + */ + setRatio(ratio: CropRatioType) { + switch (ratio) { + case CropRatioType.RATIO_TYPE_FREE: + this.ratio.set(CommonConstants.DEFAULT_RATIO, CommonConstants.DEFAULT_RATIO); + break; + case CropRatioType.RATIO_TYPE_HORIZONTAL: + this.ratio.set(this.screenMaxSide, this.screenMinSide); + break; + case CropRatioType.RATIO_TYPE_VERTICAL: + this.ratio.set(this.screenMinSide, this.screenMaxSide); + break; + case CropRatioType.RATIO_TYPE_1_1: + this.ratio.set(CommonConstants.RATIO_1_1, CommonConstants.RATIO_1_1); + break; + case CropRatioType.RATIO_TYPE_16_9: + this.ratio.set(CommonConstants.RATIO_16_9[0], CommonConstants.RATIO_16_9[1]); + break; + case CropRatioType.RATIO_TYPE_9_16: + this.ratio.set(CommonConstants.RATIO_9_16[0], CommonConstants.RATIO_9_16[1]); + break; + case CropRatioType.RATIO_TYPE_4_3: + this.ratio.set(CommonConstants.RATIO_4_3[0], CommonConstants.RATIO_4_3[1]); + break; + case CropRatioType.RATIO_TYPE_3_4: + this.ratio.set(CommonConstants.RATIO_3_4[0], CommonConstants.RATIO_3_4[1]); + break; + case CropRatioType.RATIO_TYPE_3_2: + this.ratio.set(CommonConstants.RATIO_3_2[0], CommonConstants.RATIO_3_2[1]); + break; + case CropRatioType.RATIO_TYPE_2_3: + this.ratio.set(CommonConstants.RATIO_2_3[0], CommonConstants.RATIO_2_3[1]); + break; + default: + Log.warn(TAG, 'setRatio: unknown ratio'); + break; + } + if (this.ratio.isValid()) { + MathUtils.computeMaxRectWithinLimit(this.cropRect, this.limitRect, this.ratio.getRate()); + let imageLines = this.getCurrentImageLines(); + MathUtils.limitRectInRotated(this.cropRect, imageLines); + this.imageCropCompare(); + this.enlargeCropArea(); + } + } + + /** + * Set max scale factor. + * @param factorW + * @param factorH + */ + setMaxScaleFactor(factorW: number, factorH: number) { + this.maxScaleFactorW = factorW; + this.maxScaleFactorH = factorH; + } + + /** + * Whether image can enlarge. + * @returns + */ + couldEnlargeImage(): boolean { + return (this.couldEnlargeImageW() && this.couldEnlargeImageH()); + } + + /** + * Enlarge crop area. + */ + enlargeCropArea() { + let newCrop = new RectF(); + let cropRatio = this.cropRect.getWidth() / this.cropRect.getHeight(); + MathUtils.computeMaxRectWithinLimit(newCrop, this.limitRect, cropRatio); + let scale = newCrop.getWidth() / this.cropRect.getWidth(); + + let tX = this.isFlipHorizontal ? -1 : 1; + let tY = this.isFlipVertically ? -1 : 1; + let origin = this.getDisplayCenter(); + let preCenterX = this.cropRect.getCenterX() * tX + (this.isFlipHorizontal ? 2 * origin.x : 0); + let preCenterY = this.cropRect.getCenterY() * tY + (this.isFlipVertically ? 2 * origin.y : 0); + let preCenter = new Point(preCenterX, preCenterY); + let angle = this.rotationAngle * tX * tY + this.horizontalAngle; + let rotated = MathUtils.rotatePoints([preCenter], -angle, origin); + + MathUtils.scaleRectBasedOnPoint(this.imageRect, rotated[0], scale); + + let offsetX = newCrop.getCenterX() - preCenter.x; + let offsetY = newCrop.getCenterY() - preCenter.y; + let alpha = MathUtils.formulaAngle(angle); + let x = Math.cos(alpha) * offsetX + Math.sin(alpha) * offsetY; + let y = -Math.sin(alpha) * offsetX + Math.cos(alpha) * offsetY; + this.imageRect.move(x, y); + + this.cropRect.set(newCrop.left, newCrop.top, newCrop.right, newCrop.bottom); + } + + /** + * Image crop compare. + */ + imageCropCompare(): void { + let imageRect = this.getImageRect(); + let cropRect = this.getCropRect(); + let imageRectWidth = imageRect.getWidth(); + let imageRectHeight = imageRect.getHeight(); + let cropRectWidth = cropRect.getWidth(); + let cropRectHeight = cropRect.getHeight(); + if (imageRectWidth < cropRectWidth) { + let scaleRatio = cropRectWidth / imageRectWidth; + this.imageRect.scale(scaleRatio); + } + if (imageRectHeight < cropRectHeight) { + let scaleRatio = cropRectHeight / imageRectHeight; + this.imageRect.scale(scaleRatio); + } + + } + + /** + * Get touch rect area. + * @param x + * @param y + * @returns + */ + isCropRectTouch(x: number, y: number): boolean { + let w = this.touchBound; + let h = this.touchBound; + let crop = { ...this.cropRect }; + let outer = new RectF(); + outer.set(crop.left - w, crop.top - h, crop.right + w, crop.bottom + h); + let inner = new RectF(); + inner.set(crop.left + w, crop.top + h, crop.right - w, crop.bottom - h); + if (outer.isInRect(x, y) && !inner.isInRect(x, y)) { + if (x <= inner.left) { + this.isLeft = true; + } else if (x >= inner.right) { + this.isRight = true; + } + + if (y <= inner.top) { + this.isTop = true; + } else if (y >= inner.bottom) { + this.isBottom = true; + } + + // convert side to conner, when fixed crop ratio + if (this.ratio.isValid()) { + this.fixSideToConner(x, y); + } + Log.debug(TAG, `isCropTouch: l[${this.isLeft}] r[${this.isRight}] t[${this.isTop}] b[${this.isBottom}]`); + } + return this.isLeft || this.isRight || this.isTop || this.isBottom; + } + + /** + * Get flip image. + * @returns + */ + getCurrentFlipImage(): RectF { + let center = this.getDisplayCenter(); + let image = { ...this.imageRect }; + let flipImage = new RectF(); + flipImage.left = this.isFlipHorizontal ? (2 * center.x - image.right) : image.left; + flipImage.top = this.isFlipVertically ? (2 * center.y - image.bottom) : image.top; + flipImage.right = this.isFlipHorizontal ? (2 * center.x - image.left) : image.right; + flipImage.bottom = this.isFlipVertically ? (2 * center.y - image.top) : image.bottom; + return flipImage; + } + + /** + * move crop rect. + * @param offsetX + * @param offsetY + */ + moveCropRect(offsetX: number, offsetY: number) { + // crop rect in fixed mode + if (this.ratio.isValid()) { + this.moveInFixedMode(offsetX, offsetY); + } else { + this.moveInFreeMode(offsetX, offsetY); + } + } + + /** + * End crop rect move. + */ + endCropRectMove() { + this.isLeft = false; + this.isRight = false; + this.isTop = false; + this.isBottom = false; + this.isHorizontalSide = false; + this.isVerticalSide = false; + } + + /** + * Swap ratio. + */ + private swapCurrentRatio() { + let W = this.ratio.getW(); + let H = this.ratio.getH(); + this.ratio.set(H, W); + } + + /** + * Get display center. + * @returns + */ + private getDisplayCenter(): Point { + return new Point(this.limitRect.getCenterX(), this.limitRect.getCenterY()); + } + + /** + * Whether can enlarge image width. + * @returns + */ + private couldEnlargeImageW(): boolean { + let scaleFactorW = this.imageRect.getWidth() / this.cropRect.getWidth(); + return (scaleFactorW >= this.maxScaleFactorW ? false : true); + } + + /** + * Whether can enlarge image height. + * @returns + */ + private couldEnlargeImageH(): boolean { + let scaleFactorH = this.imageRect.getHeight() / this.cropRect.getHeight(); + return (scaleFactorH >= this.maxScaleFactorH ? false : true); + } + + /** + * Fix side conner. + * @param x + * @param y + */ + private fixSideToConner(x: number, y: number) { + if ((this.isLeft || this.isRight) && !this.isTop && !this.isBottom) { + if (y < this.cropRect.getCenterY()) { + this.isTop = true; + } else { + this.isBottom = true; + } + this.isVerticalSide = true; + } else if ((this.isTop || this.isBottom) && !this.isLeft && !this.isRight) { + if (x < this.cropRect.getCenterX()) { + this.isLeft = true; + } else { + this.isRight = true; + } + this.isHorizontalSide = true; + } + } + + /** + * Get rotate image. + * @returns + */ + private getCurrentRotatedImage(): RectF { + let flipImage = this.getCurrentFlipImage(); + let points = MathUtils.rectToPoints(flipImage); + let origin = this.getDisplayCenter(); + let rotated = MathUtils.rotatePoints(points, this.rotationAngle, origin); + let i = Math.abs(this.rotationAngle / CropAngle.ONE_QUARTER_CIRCLE_ANGLE); + let j = (i + 2) % rotated.length; + let image = new RectF(); + image.set(rotated[i].x, rotated[i].y, rotated[j].x, rotated[j].y); + return image; + } + + /** + * Get image lines. + * @returns + */ + private getCurrentImageLines(): Array { + let flipImage = this.getCurrentFlipImage(); + let imagePoints = MathUtils.rectToPoints(flipImage); + let origin = this.getDisplayCenter(); + let tX = this.isFlipHorizontal ? -1 : 1; + let tY = this.isFlipVertically ? -1 : 1; + let angle = this.rotationAngle * tX * tY + this.horizontalAngle; + let rotated = MathUtils.rotatePoints(imagePoints, angle, origin); + + let imageLines = []; + for (let i = 0; i < rotated.length; i++) { + let j = (i + 1) % rotated.length; + imageLines.push( + new LineSegment(new Point(rotated[i].x, rotated[i].y), new Point(rotated[j].x, rotated[j].y))); + } + return imageLines; + } + + /** + * Moving in fixed mode. + * @param offsetX + * @param offsetY + */ + private moveInFixedMode(offsetX: number, offsetY: number) { + let x = offsetX; + let y = offsetY; + if (this.isHorizontalSide) { + x = 0; + } else if (this.isVerticalSide) { + y = 0; + } + let offsetHypot = Math.hypot(x, y); + + if (this.isLeft && this.isTop) { + // left top conner move + let isEnlarge = offsetX < 0 || offsetY < 0; + if (isEnlarge || this.couldEnlargeImage()) { + this.fixLeftTopInFixedMode(offsetHypot, isEnlarge); + } + } else if (this.isLeft && this.isBottom) { + // left bottom conner move + let isEnlarge = offsetX < 0 || offsetY > 0; + if (isEnlarge || this.couldEnlargeImage()) { + this.fixLeftBottomInFixedMode(offsetHypot, isEnlarge); + } + } else if (this.isRight && this.isTop) { + // right top conner move + let isEnlarge = offsetX > 0 || offsetY < 0; + if (isEnlarge || this.couldEnlargeImage()) { + this.fixRightTopInFixedMode(offsetHypot, isEnlarge); + } + } else if (this.isRight && this.isBottom) { + // right bottom conner move + let isEnlarge = offsetX > 0 || offsetY > 0; + if (isEnlarge || this.couldEnlargeImage()) { + this.fixRightBottomInFixedMode(offsetHypot, isEnlarge); + } + } + } + + /** + * In fixed mode, fix left top conner. + * @param offsetHypot + * @param isEnlarge + */ + private fixLeftTopInFixedMode(offsetHypot: number, isEnlarge: boolean) { + let crop = this.getCropRect(); + let rate = this.ratio.getRate(); + let rect = new RectF(); + if (isEnlarge) { + let limit = { ...this.limitRect }; + let size = MathUtils.getMaxFixedRectSize(rate, crop.right - limit.left, crop.bottom - limit.top); + rect.set(crop.right - size[0], crop.bottom - size[1], crop.right, crop.bottom); + let imageLines = this.getCurrentImageLines(); + MathUtils.limitRectInRotatedBasedOnPoint(2, rect, imageLines); + } else { + let size = MathUtils.getMinFixedRectSize(rate, this.minSideLength); + rect.set(crop.right - size[0], crop.bottom - size[1], crop.right, crop.bottom); + } + let rectHypot = Math.hypot(rect.getWidth(), rect.getHeight()); + let cropHypot = Math.hypot(crop.getWidth(), crop.getHeight()); + let limitHypot = (rectHypot - cropHypot) * (isEnlarge ? 1 : -1); + let finalOffsetHypot = Math.min(offsetHypot, Math.max(limitHypot, 0)); + let tX = isEnlarge ? -1 : 1; + let tY = isEnlarge ? -1 : 1; + let ratioHypot = Math.hypot(this.ratio.getW(), this.ratio.getH()); + this.cropRect.left += finalOffsetHypot * tX * this.ratio.getW() / ratioHypot; + this.cropRect.top += finalOffsetHypot * tY * this.ratio.getH() / ratioHypot; + } + + /** + * In fixed mode, fix left bottom conner. + * @param offsetHypot + * @param isEnlarge + */ + private fixLeftBottomInFixedMode(offsetHypot: number, isEnlarge: boolean) { + let crop = this.getCropRect(); + let rate = this.ratio.getRate(); + let rect = new RectF(); + if (isEnlarge) { + let limit = { ...this.limitRect }; + let size = MathUtils.getMaxFixedRectSize(rate, crop.right - limit.left, limit.bottom - crop.top); + rect.set(crop.right - size[0], crop.top, crop.right, crop.top + size[1]); + let imageLines = this.getCurrentImageLines(); + MathUtils.limitRectInRotatedBasedOnPoint(1, rect, imageLines); + } else { + let size = MathUtils.getMinFixedRectSize(rate, this.minSideLength); + rect.set(crop.right - size[0], crop.top, crop.right, crop.top + size[1]); + } + let rectHypot = Math.hypot(rect.getWidth(), rect.getHeight()); + let cropHypot = Math.hypot(crop.getWidth(), crop.getHeight()); + let limitHypot = (rectHypot - cropHypot) * (isEnlarge ? 1 : -1); + let finalOffsetHypot = Math.min(offsetHypot, Math.max(limitHypot, 0)); + let tX = isEnlarge ? -1 : 1; + let tY = isEnlarge ? 1 : -1; + let ratioHypot = Math.hypot(this.ratio.getW(), this.ratio.getH()); + this.cropRect.left += finalOffsetHypot * tX * this.ratio.getW() / ratioHypot; + this.cropRect.bottom += finalOffsetHypot * tY * this.ratio.getH() / ratioHypot; + } + + /** + * In fixed mode, fix right top conner. + * @param offsetHypot + * @param isEnlarge + */ + private fixRightTopInFixedMode(offsetHypot: number, isEnlarge: boolean) { + let crop = this.getCropRect(); + let rate = this.ratio.getRate(); + let rect = new RectF(); + if (isEnlarge) { + let limit = { ...this.limitRect }; + let size = MathUtils.getMaxFixedRectSize(rate, limit.right - crop.left, crop.bottom - limit.top); + rect.set(crop.left, crop.bottom - size[1], crop.left + size[0], crop.bottom); + let imageLines = this.getCurrentImageLines(); + MathUtils.limitRectInRotatedBasedOnPoint(3, rect, imageLines); + } else { + let size = MathUtils.getMinFixedRectSize(rate, this.minSideLength); + rect.set(crop.left, crop.bottom - size[1], crop.left + size[0], crop.bottom); + } + let rectHypot = Math.hypot(rect.getWidth(), rect.getHeight()); + let cropHypot = Math.hypot(crop.getWidth(), crop.getHeight()); + let limitHypot = (rectHypot - cropHypot) * (isEnlarge ? 1 : -1); + let finalOffsetHypot = Math.min(offsetHypot, Math.max(limitHypot, 0)); + let tX = isEnlarge ? 1 : -1; + let tY = isEnlarge ? -1 : 1; + let ratioHypot = Math.hypot(this.ratio.getW(), this.ratio.getH()); + this.cropRect.right += finalOffsetHypot * tX * this.ratio.getW() / ratioHypot; + this.cropRect.top += finalOffsetHypot * tY * this.ratio.getH() / ratioHypot; + } + + /** + * In fixed mode, fix right bottom conner. + * @param offsetHypot + * @param isEnlarge + */ + private fixRightBottomInFixedMode(offsetHypot: number, isEnlarge: boolean) { + let crop = this.getCropRect(); + let rate = this.ratio.getRate(); + let rect = new RectF(); + if (isEnlarge) { + let limit = { ...this.limitRect }; + let size = MathUtils.getMaxFixedRectSize(rate, limit.right - crop.left, limit.bottom - crop.top); + rect.set(crop.left, crop.top, crop.left + size[0], crop.top + size[1]); + let imageLines = this.getCurrentImageLines(); + MathUtils.limitRectInRotatedBasedOnPoint(0, rect, imageLines); + } else { + let size = MathUtils.getMinFixedRectSize(rate, this.minSideLength); + rect.set(crop.left, crop.top, crop.left + size[0], crop.top + size[1]); + } + let rectHypot = Math.hypot(rect.getWidth(), rect.getHeight()); + let cropHypot = Math.hypot(crop.getWidth(), crop.getHeight()); + let limitHypot = (rectHypot - cropHypot) * (isEnlarge ? 1 : -1); + let finalOffsetHypot = Math.min(offsetHypot, Math.max(limitHypot, 0)); + let tX = isEnlarge ? 1 : -1; + let tY = isEnlarge ? 1 : -1; + let ratioHypot = Math.hypot(this.ratio.getW(), this.ratio.getH()); + this.cropRect.right += finalOffsetHypot * tX * this.ratio.getW() / ratioHypot; + this.cropRect.bottom += finalOffsetHypot * tY * this.ratio.getH() / ratioHypot; + } + + /** + * Moving in free mode. + * @param offsetX + * @param offsetY + */ + private moveInFreeMode(offsetX: number, offsetY: number) { + let crop = this.getCropRect(); + let limit = { ...this.limitRect }; + let image = this.getCurrentRotatedImage(); + let minLength = this.minSideLength; + let imageLines = this.getCurrentImageLines(); + if (this.isLeft) { + if (offsetX < 0 || this.couldEnlargeImageW()) { + let left = Math.min(crop.left + offsetX, crop.right - minLength); + left = Math.max(left, image.left, limit.left); + this.cropRect.left = this.fixLeftInFreeMode(left, crop, imageLines); + crop.left = this.cropRect.left; + } + } else if (this.isRight) { + if (offsetX > 0 || this.couldEnlargeImageW()) { + let right = Math.max(crop.right + offsetX, crop.left + minLength); + right = Math.min(right, image.right, limit.right); + this.cropRect.right = this.fixRightInFreeMode(right, crop, imageLines); + crop.right = this.cropRect.right; + } + } + if (this.isTop) { + if (offsetY < 0 || this.couldEnlargeImageH()) { + let top = Math.min(crop.top + offsetY, crop.bottom - minLength); + top = Math.max(top, image.top, limit.top); + this.cropRect.top = this.fixTopInFreeMode(top, crop, imageLines); + } + } else if (this.isBottom) { + if (offsetY > 0 || this.couldEnlargeImageH()) { + let bottom = Math.max(crop.bottom + offsetY, crop.top + minLength); + bottom = Math.min(bottom, image.bottom, limit.bottom); + this.cropRect.bottom = this.fixBottomInFreeMode(bottom, crop, imageLines); + } + } + } + + /** + * In free mode fix left edge. + * @param left + * @param crop + * @param imageLines + * @returns fixedLeft. + */ + private fixLeftInFreeMode(left: number, crop: RectF, imageLines: Array): number { + let leftLine = new LineSegment(new Point(left, crop.top), new Point(left, crop.bottom)); + let adjacentLines = []; + adjacentLines.push(new LineSegment(new Point(left, crop.top), new Point(crop.right, crop.top))); + adjacentLines.push(new LineSegment(new Point(left, crop.bottom), new Point(crop.right, crop.bottom))); + let fixedLeft = left; + for (let imageLine of imageLines) { + if (MathUtils.hasIntersection(imageLine, leftLine)) { + let result = this.tryToFindFixedSide(adjacentLines, imageLine, left, true, true); + fixedLeft = Math.max(fixedLeft, result); + } + } + return fixedLeft; + } + + /** + * In free mode fix right edge. + * @param left + * @param crop + * @param imageLines + * @returns fixedRight. + */ + private fixRightInFreeMode(right: number, crop: RectF, imageLines: Array): number { + let rightLine = new LineSegment(new Point(right, crop.top), new Point(right, crop.bottom)); + let adjacentLines = []; + adjacentLines.push(new LineSegment(new Point(crop.left, crop.top), new Point(right, crop.top))); + adjacentLines.push(new LineSegment(new Point(crop.left, crop.bottom), new Point(right, crop.bottom))); + let fixedRight = right; + for (let imageLine of imageLines) { + if (MathUtils.hasIntersection(imageLine, rightLine)) { + let result = this.tryToFindFixedSide(adjacentLines, imageLine, right, true, false); + fixedRight = Math.min(fixedRight, result); + } + } + return fixedRight; + } + + /** + * In free mode fix top edge. + * @param left + * @param crop + * @param imageLines + * @returns fixedTop. + */ + private fixTopInFreeMode(top: number, crop: RectF, imageLines: Array): number { + let topLine = new LineSegment(new Point(crop.left, top), new Point(crop.right, top)); + let adjacentLines = []; + adjacentLines.push(new LineSegment(new Point(crop.left, top), new Point(crop.left, crop.bottom))); + adjacentLines.push(new LineSegment(new Point(crop.right, top), new Point(crop.right, crop.bottom))); + let fixedTop = top; + for (let imageLine of imageLines) { + if (MathUtils.hasIntersection(imageLine, topLine)) { + let result = this.tryToFindFixedSide(adjacentLines, imageLine, top, false, true); + fixedTop = Math.max(fixedTop, result); + } + } + return fixedTop; + } + + /** + * In free mode fix bottom edge. + * @param left + * @param crop + * @param imageLines + * @returns fixedBottom. + */ + private fixBottomInFreeMode(bottom: number, crop: RectF, imageLines: Array): number { + let bottomLine = new LineSegment(new Point(crop.left, bottom), new Point(crop.right, bottom)); + let adjacentLines = []; + adjacentLines.push(new LineSegment(new Point(crop.left, crop.top), new Point(crop.left, bottom))); + adjacentLines.push(new LineSegment(new Point(crop.right, crop.top), new Point(crop.right, bottom))); + let fixedBottom = bottom; + for (let imageLine of imageLines) { + if (MathUtils.hasIntersection(imageLine, bottomLine)) { + let result = this.tryToFindFixedSide(adjacentLines, imageLine, bottom, false, false); + fixedBottom = Math.min(fixedBottom, result); + } + } + return fixedBottom; + } + + /** + * Find fixed edge. + * @param adjacentLines + * @param imageLine + * @param side + * @param isCompareX + * @param isCompareMax + * @returns + */ + private tryToFindFixedSide(adjacentLines: Array, imageLine: LineSegment, + side: number, isCompareX: boolean, isCompareMax: boolean): number { + let fixedSide = side; + let compareFunc = isCompareMax ? Math.max : Math.min; + for (let adjacentLine of adjacentLines) { + if (MathUtils.hasIntersection(imageLine, adjacentLine)) { + let intersection = MathUtils.getIntersection(imageLine, adjacentLine); + if (intersection == undefined) { + continue; + } + let compare = isCompareX ? intersection.x : intersection.y; + fixedSide = compareFunc(side, compare); + } + } + return fixedSide; + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/viewModel/IconListViewModel.ets b/Media/ImageEdit/entry/src/main/ets/viewModel/IconListViewModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ed4c5608c0a57c8a3712f12783cf252280bbdc5 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/viewModel/IconListViewModel.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Icon status. + */ +export interface IconStatus { + normal: Resource, + chosen: Resource +} + +/** + * Bottom menu icon. + */ +export const menuIconList: Array = [ + { + normal: $r('app.media.ic_crop'), + chosen: $r('app.media.ic_crop_filled') + }, + { + normal: $r('app.media.ic_rotate'), + chosen: $r('app.media.ic_rotate_filled') + }, + { + normal: $r('app.media.ic_adjust'), + chosen: $r('app.media.ic_adjust_filled') + } +] + +/** + * Crop icon. + */ +export const cropIconChangeList: Array = [ + { + normal: $r('app.media.ic_original'), + chosen: $r('app.media.ic_original_filled'), + }, + { + normal: $r('app.media.ic_one2one'), + chosen: $r('app.media.ic_one2one_filled') + }, + { + normal: $r('app.media.ic_four2three'), + chosen: $r('app.media.ic_four2three_filled') + }, + { + normal: $r('app.media.ic_sixteen2nine'), + chosen: $r('app.media.ic_sixteen2nine_filled') + } +] + +/** + * Adjust icon. + */ +export const adjustIconList: Array = [ + { + normal: $r('app.media.ic_brightness'), + chosen: $r('app.media.ic_brightness_filled') + }, + { + normal: $r('app.media.ic_transparency'), + chosen: $r('app.media.ic_transparency_filled') + }, + { + normal: $r('app.media.ic_saturation'), + chosen: $r('app.media.ic_saturation_filled') + } +] + diff --git a/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets b/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets new file mode 100644 index 0000000000000000000000000000000000000000..9dec4f449a09e799c8a17744de35258eec8abb70 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets @@ -0,0 +1,529 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { Point } from '../common/bean/Point'; +import { RectF } from '../common/bean/Rect'; +import { CropAngle, CropRatioType, CropTouchState } from '../common/bean/CropType'; +import { ImageFilterCrop } from './ImageFilterCrop'; +import { CropShow } from './CropShow'; +import { MathUtils } from '../utils/MathUtils'; +import { DrawingUtils } from '../utils/DrawingUtils'; +import type { PixelMapWrapper } from '../common/bean/PixelMapWrapper'; +import Logger from '../utils/LoggerUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +const TAG: string = 'editor_ImageEditCrop'; + +export class ImageEditCrop { + private filter: ImageFilterCrop = undefined; + private input: PixelMapWrapper = undefined; + private isFlipHorizontal: boolean = false; + private isFlipVertically: boolean = false; + private rotationAngle: number = 0; + private sliderAngle: number = 0; + private cropRatio: CropRatioType = CropRatioType.RATIO_TYPE_FREE; + private cropShow: CropShow = undefined; + private isCropShowInitialized: boolean = false; + private ctx: CanvasRenderingContext2D = undefined; + private displayWidth: number = 0; + private displayHeight: number = 0; + private marginW: number = CommonConstants.DEFAULT_MARGIN_LENGTH; + private marginH: number = CommonConstants.DEFAULT_MARGIN_LENGTH; + private imageRatio: number = CommonConstants.DEFAULT_IMAGE_RATIO; + private scale: number = CommonConstants.BASE_SCALE_VALUE; + private timeoutId: number = 0; + private timeout: number = CommonConstants.DEFAULT_TIMEOUT_MILLISECOND_1000; + private isWaitingRefresh: boolean = false; + private touchPoint: Point = undefined; + private pinchPoint: Point = undefined; + private state: CropTouchState = CropTouchState.NONE; + private splitFraction: number = CommonConstants.DEFAULT_SPLIT_FRACTION; + private canvasReady: boolean = false; + private splitLineShow: boolean = false; + + constructor() { + this.cropShow = new CropShow(); + this.touchPoint = new Point(0, 0); + this.pinchPoint = new Point(0, 0); + } + + /** + * Image edit model init. + * @param pixelMap + */ + entry(pixelMap: PixelMapWrapper): void { + Logger.info(TAG, `entry pixelMap: ${JSON.stringify(pixelMap)}`); + this.input = pixelMap; + this.filter = new ImageFilterCrop(); + this.initialize(); + if (this.isCropShowInitialized) { + let limit = this.calcNewLimit(); + this.cropShow.init(limit, this.imageRatio); + } + this.refresh(); + } + + /** + * Image edit model exit. + * @returns + */ + exit(): ImageFilterCrop { + Logger.info(TAG, 'exit'); + this.saveFinalOperation(); + this.isCropShowInitialized = false; + this.input = undefined; + if (this.couldReset()) { + this.clear(); + } else { + this.filter = undefined; + } + return this.filter; + } + + /** + * Set canvas init. + * @param context + */ + setCanvasContext(context: CanvasRenderingContext2D): void { + Logger.info(TAG, 'setCanvasContext'); + this.ctx = context; + this.refresh(); + } + + /** + * Set Canvas ready. + * @param state + */ + setCanvasReady(state: boolean): void { + this.canvasReady = state; + } + + /** + * Set Canvas display state. + * @param width + * @param height + */ + setCanvasSize(width: number, height: number): void { + Logger.info(TAG, `setCanvasSize: width[${width}], height[${height}]`); + this.displayWidth = width; + this.displayHeight = height; + let limit = this.calcNewLimit(); + if (this.isCropShowInitialized) { + this.cropShow.syncLimitRect(limit); + this.determineMaxScaleFactor(); + } else { + this.cropShow.init(limit, this.imageRatio); + this.isCropShowInitialized = true; + } + this.refresh(); + } + + /** + * Clear canvas content. + */ + clearCanvas(): void { + this.ctx.clearRect(0, 0, this.displayWidth, this.displayHeight); + } + + /** + * Rotate and flip. + */ + onMirrorChange(): void { + Logger.debug(TAG, 'onMirrorChange'); + if (this.isWaitingRefresh) { + this.clearDelayRefresh(); + this.cropShow.enlargeCropArea(); + } else { + if (MathUtils.isOddRotation(this.rotationAngle)) { + this.isFlipVertically = !this.isFlipVertically; + } else { + this.isFlipHorizontal = !this.isFlipHorizontal; + } + this.cropShow.setFlip(this.isFlipHorizontal, this.isFlipVertically); + } + this.refresh(); + } + + /** + * Determine whether to rotate. + */ + onRotationAngleChange(): void { + Logger.debug(TAG, 'onRotationAngleChange'); + if (this.isWaitingRefresh) { + this.clearDelayRefresh(); + this.cropShow.enlargeCropArea(); + } else { + this.rotationAngle = (this.rotationAngle - CropAngle.ONE_QUARTER_CIRCLE_ANGLE) % CropAngle.CIRCLE_ANGLE; + this.cropShow.syncRotationAngle(this.rotationAngle); + } + this.refresh(); + } + + /*** + * Change rotate angle. + */ + onSliderAngleChange(angle: number): void { + Logger.debug(TAG, `onSliderAngleChange: angle[${angle}]`); + if (this.isWaitingRefresh) { + this.clearDelayRefresh(); + this.cropShow.enlargeCropArea(); + this.refresh(); + } + this.sliderAngle = angle; + this.cropShow.syncHorizontalAngle(this.sliderAngle); + this.refresh(); + } + + /** + * Fix ratio canvas refresh. + * @param ratio + */ + onFixedRatioChange(ratio: CropRatioType): void { + Logger.debug(TAG, `onFixedRatioChange: ratio[${ratio}]`); + if (this.isWaitingRefresh) { + this.clearDelayRefresh(); + this.cropShow.enlargeCropArea(); + } + this.cropRatio = ratio; + this.cropShow.setRatio(ratio); + this.endImageDrag(); + this.refresh(); + } + + /** + * Touch start. + * @param x + * @param y + */ + onTouchStart(x: number, y: number): void { + if (this.state !== CropTouchState.NONE) { + Logger.debug(TAG, 'onTouchStart: touch state is not none!'); + return; + } + + if (this.isWaitingRefresh) { + this.clearDelayRefresh(); + } + + Logger.debug(TAG, `onTouchStart: [x: ${x}, y: ${y}]`); + if (this.cropShow.isCropRectTouch(x, y)) { + this.state = CropTouchState.CROP_MOVE; + } else { + this.state = CropTouchState.IMAGE_DRAG; + } + this.splitLineShow = true; + this.touchPoint.set(x, y); + } + + /** + * Touch move. + * @param x + * @param y + */ + onTouchMove(x: number, y: number): void { + Logger.debug(TAG, `onTouchMove: [state: ${this.state}] [x: ${x}, y: ${y}]`); + let offsetX = x - this.touchPoint.x; + let offsetY = y - this.touchPoint.y; + if (this.state === CropTouchState.CROP_MOVE) { + this.cropShow.moveCropRect(offsetX, offsetY); + } else if (this.state === CropTouchState.IMAGE_DRAG) { + this.onImageDrag(offsetX, offsetY); + } else { + return; + } + this.refresh(); + this.touchPoint.set(x, y); + } + + /** + * Touch end. + */ + onTouchEnd(): void { + Logger.debug(TAG, `onTouchEnd: [state: ${this.state}]`); + if (this.state === CropTouchState.CROP_MOVE) { + this.cropShow.endCropRectMove(); + } else if (this.state === CropTouchState.IMAGE_DRAG) { + this.endImageDrag(); + this.refresh(); + } else { + return; + } + this.state = CropTouchState.NONE; + if (this.isWaitingRefresh) { + this.clearDelayRefresh(); + } + this.delayRefresh(this.timeout); + } + + /** + * Pinch start. + * @param x + * @param y + * @param scale + */ + onPinchStart(x: number, y: number, scale: number): void { + Logger.debug(TAG, `onPinchStart: event[x: ${x}, y: ${y}]`); + this.splitLineShow = true; + this.state = CropTouchState.IMAGE_SCALE; + this.pinchPoint.set(x, y); + this.scale = scale; + } + + /** + * Pinch update. + * @param scale + */ + onPinchUpdate(scale: number): void { + Logger.debug(TAG, `onPinchUpdate: scale[${scale}]`); + if (this.state === CropTouchState.IMAGE_SCALE) { + let factor = scale / this.scale; + if (!this.cropShow.couldEnlargeImage()) { + factor = factor > CommonConstants.BASE_SCALE_VALUE ? CommonConstants.BASE_SCALE_VALUE : factor; + } + let image = this.cropShow.getImageRect(); + MathUtils.scaleRectBasedOnPoint(image, this.pinchPoint, factor); + this.cropShow.setImageRect(image); + this.refresh(); + this.scale *= factor; + } + } + + /** + * Pinch end. + */ + onPinchEnd(): void { + Logger.debug(TAG, 'onPinchEnd'); + let crop = this.cropShow.getCropRect(); + let points = MathUtils.rectToPoints(crop); + let tX = this.isFlipHorizontal ? -1 : 1; + let tY = this.isFlipVertically ? -1 : 1; + let angle = -(this.rotationAngle * tX * tY + this.sliderAngle); + let displayCenter = new Point(this.displayWidth / 2, this.displayHeight / 2); + let rotated = MathUtils.rotatePoints(points, angle, displayCenter); + + let flipImage = this.cropShow.getCurrentFlipImage(); + let origin = new Point(crop.getCenterX(), crop.getCenterY()); + let centerOffsetX = origin.x - flipImage.getCenterX(); + let centerOffsetY = origin.y - flipImage.getCenterY(); + flipImage.move(centerOffsetX, centerOffsetY); + let scale = MathUtils.findSuitableScale(rotated, flipImage, origin); + flipImage.move(-centerOffsetX, -centerOffsetY); + + MathUtils.scaleRectBasedOnPoint(flipImage, origin, scale); + let offsets = MathUtils.fixImageMove(rotated, flipImage); + + let image = this.cropShow.getImageRect(); + MathUtils.scaleRectBasedOnPoint(image, origin, scale); + image.move(offsets[0] * tX, offsets[1] * tY); + this.cropShow.setImageRect(image); + this.refresh(); + this.state = CropTouchState.NONE; + this.delayRefresh(this.timeout); + this.scale = CommonConstants.BASE_SCALE_VALUE; + } + + /** + * Current image whether can reset. + * @returns true means can reset, false means not. + */ + couldReset(): boolean { + let crop = this.cropShow.getCropRect(); + MathUtils.roundOutRect(crop); + let image = this.cropShow.getImageRect(); + MathUtils.roundOutRect(image); + if ( + this.isFlipHorizontal !== false || + this.isFlipVertically !== false || + this.rotationAngle !== 0 || this.sliderAngle !== 0 || + this.cropRatio !== CropRatioType.RATIO_TYPE_FREE || + !MathUtils.areRectsSame(crop, image) + ) { + return true; + } + return false; + } + + /** + * Reset. + */ + reset(): void { + Logger.debug(TAG, 'reset'); + let limit = this.calcNewLimit(); + this.cropShow.init(limit, this.imageRatio); + this.initialize(); + this.refresh(); + } + + /** + * Init and clear old content. + */ + private initialize(): void { + this.imageRatio = this.input.width / this.input.height; + this.determineMaxScaleFactor(); + this.clear(); + } + + /** + * When image changing, calc limit size again. + * @returns + */ + private calcNewLimit(): RectF { + let limit = new RectF(); + limit.set(this.marginW, this.marginH, this.displayWidth - this.marginW, this.displayHeight - this.marginH); + return limit; + } + + /** + * Calc max scale factor. + */ + private determineMaxScaleFactor(): void { + if (this.input == null) { + return; + } + let scaleFactorW = this.input.width / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); + let scaleFactorH = this.input.height / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); + this.cropShow.setMaxScaleFactor(scaleFactorW, scaleFactorH); + } + + /** + * Save final operation. + */ + private saveFinalOperation(): void { + let crop = this.cropShow.getCropRect(); + let image = this.cropShow.getImageRect(); + crop.move(-image.left, -image.top); + MathUtils.normalizeRect(crop, image.getWidth(), image.getHeight()); + this.filter.setCropRect(crop); + } + + /** + * Set initial state. + */ + private clear(): void { + this.cropRatio = CropRatioType.RATIO_TYPE_FREE; + this.isFlipHorizontal = false; + this.isFlipVertically = false; + this.rotationAngle = 0; + this.sliderAngle = 0; + } + + /** + * Refresh. + */ + private refresh(): void { + if (this.ctx !== undefined && this.input !== undefined && this.canvasReady) { + this.drawImage(); + this.drawCrop(); + } + } + + /** + * Delay refresh. + * @param delay + */ + private delayRefresh(delay: number): void { + this.isWaitingRefresh = true; + this.timeoutId = setTimeout(() => { + this.cropShow.enlargeCropArea(); + this.splitLineShow = false; + this.refresh(); + this.isWaitingRefresh = false; + }, delay); + } + + /** + * Clear delay refresh. + */ + private clearDelayRefresh(): void { + clearTimeout(this.timeoutId); + this.isWaitingRefresh = false; + } + + /** + * Draw image. + */ + private drawImage(): void { + this.ctx.save(); + this.clearCanvas(); + + let x = this.displayWidth / 2; + let y = this.displayHeight / 2; + this.ctx.translate(this.isFlipHorizontal ? 2 * x : 0, this.isFlipVertically ? 2 * y : 0); + + let tX = this.isFlipHorizontal ? -1 : 1; + let tY = this.isFlipVertically ? -1 : 1; + this.ctx.scale(tX, tY); + + this.ctx.translate(x, y); + this.ctx.rotate(MathUtils.formulaAngle(this.rotationAngle * tX * tY + this.sliderAngle)); + this.ctx.translate(-x, -y); + + let image = this.cropShow.getImageRect(); + MathUtils.roundOutRect(image); + this.ctx.drawImage(this.input.pixelMap, image.left, image.top, image.getWidth(), image.getHeight()); + this.ctx.restore(); + } + + /** + * Draw crop rect. + */ + private drawCrop(): void { + let crop = this.cropShow.getCropRect(); + MathUtils.roundOutRect(crop); + let display = new RectF(); + display.set(0, 0, this.displayWidth, this.displayHeight); + DrawingUtils.drawMask(this.ctx, display, crop, this.splitLineShow); + if (this.splitLineShow) { + DrawingUtils.drawSplitLine(this.ctx, crop, this.splitFraction, this.splitLineShow); + } + DrawingUtils.drawRect(this.ctx, crop); + DrawingUtils.drawCropButton(this.ctx, crop); + } + + /** + * Drag image. + * @param offsetX + * @param offsetY + */ + private onImageDrag(offsetX: number, offsetY: number): void { + let tX = this.isFlipHorizontal ? -1 : 1; + let tY = this.isFlipVertically ? -1 : 1; + let alpha = MathUtils.formulaAngle(this.rotationAngle * tX * tY + this.sliderAngle); + let x = Math.cos(alpha) * offsetX * tX + Math.sin(alpha) * offsetY * tY; + let y = -Math.sin(alpha) * offsetX * tX + Math.cos(alpha) * offsetY * tY; + let image = this.cropShow.getImageRect(); + image.move(x, y); + this.cropShow.setImageRect(image); + } + + /** + * End drag image. + */ + private endImageDrag(): void { + let crop = this.cropShow.getCropRect(); + let points = MathUtils.rectToPoints(crop); + let tX = this.isFlipHorizontal ? -1 : 1; + let tY = this.isFlipVertically ? -1 : 1; + let angle = -(this.rotationAngle * tX * tY + this.sliderAngle); + let displayCenter = new Point(this.displayWidth / 2, this.displayHeight / 2); + let rotated = MathUtils.rotatePoints(points, angle, displayCenter); + + let flipImage = this.cropShow.getCurrentFlipImage(); + let offsets = MathUtils.fixImageMove(rotated, flipImage); + let image = this.cropShow.getImageRect(); + image.move(offsets[0] * tX, offsets[1] * tY); + this.cropShow.setImageRect(image); + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/viewModel/ImageFilterCrop.ets b/Media/ImageEdit/entry/src/main/ets/viewModel/ImageFilterCrop.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d8ee4abd1a65afa01fc46ebd0fc1e9bd77270dc --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/viewModel/ImageFilterCrop.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { RectF } from '../common/bean/Rect'; +import { PixelMapWrapper } from '../common/bean/PixelMapWrapper'; +import { MathUtils } from '../utils/MathUtils'; + +export class ImageFilterCrop { + private cropRect: RectF = undefined; + + constructor() { + this.cropRect = new RectF(); + } + + cropImage(pixelMap: PixelMapWrapper, realCropRect: RectF, callback) { + let offWidth = realCropRect.getWidth(); + let offHeight = realCropRect.getHeight(); + pixelMap.pixelMap.crop({ + size:{ height: vp2px(offHeight), width: vp2px(offWidth) }, + x: vp2px(realCropRect.left), + y: vp2px(realCropRect.top) + }, callback); + } + + readerNew(pixelMap: PixelMapWrapper, callback) { + let width = pixelMap.width; + let height = pixelMap.height; + let realCropRect = new RectF(); + realCropRect.set(this.cropRect.left, this.cropRect.top, this.cropRect.right, this.cropRect.bottom); + MathUtils.revertRect(realCropRect, width, height); + this.cropImage(pixelMap, realCropRect, callback); + } + + setCropRect(rect: RectF) { + this.cropRect.set(rect.left, rect.top, rect.right, rect.bottom); + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/viewModel/OptionViewModel.ts b/Media/ImageEdit/entry/src/main/ets/viewModel/OptionViewModel.ts new file mode 100644 index 0000000000000000000000000000000000000000..04b882a981d7cf456f73bafd75eca6ef028ff609 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/viewModel/OptionViewModel.ts @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * Crop type. + */ +export enum CropType { + ORIGINAL_IMAGE, + SQUARE, + BANNER, + RECTANGLE +} + +/** + * Rotate type + */ +export enum RotateType { + CLOCKWISE, + ANTI_CLOCK +} + +/** + * Adjust type. + */ +export enum AdjustId { + BRIGHTNESS, + TRANSPARENCY, + SATURATION +} + +/** + * Main page tab type. + */ +export enum MainTabId { + CROP, + ROTATE, + ADJUST +} + +/** + * RGB color, red,green and blue. + */ +export enum RGBIndex { + RED, + GREEN, + BLUE +} + +/** + * HSV type. + */ +export enum HSVIndex { + HUE, + SATURATION, + VALUE +} + +/** + * Angel range. + */ +export enum AngelRange { + ANGEL_0_60, + ANGEL_60_120, + ANGEL_120_180, + ANGEL_180_240, + ANGEL_240_300, + ANGEL_300_360 +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/viewModel/ScreenManager.ts b/Media/ImageEdit/entry/src/main/ets/viewModel/ScreenManager.ts new file mode 100644 index 0000000000000000000000000000000000000000..431fa75d9e86f1d033b8fd451209fba0d0d1462e --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/viewModel/ScreenManager.ts @@ -0,0 +1,375 @@ +/* + * Copyright (c) 2023 Huawei Device 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 type window from '@ohos.window'; +import Log from '../utils/LoggerUtil'; +import { CommonConstants } from '../common/constant/CommonConstants'; + +const TAG: string = 'common_ScreenManager'; + +type SystemBarKeys = 'status' | 'navigation'; + +/** + * Column size. + */ +export enum ColumnSize { + COLUMN_ONE_POINT_FIVE = 1.5, + COLUMN_TWO = 2, + COLUMN_FOUR = 4, + COLUMN_SIX = 6, + COLUMN_EIGHT = 8, + COLUMN_TWELVE = 12 +} + +/** + * Screen width. + */ +enum ScreenWidth { + WIDTH_MEDIUM = 520, + WIDTH_LARGE = 840 +} + +/** + * Window mode. + */ +enum WindowMode { + UNDEFINED = 1, + FULLSCREEN, + PRIMARY, + SECONDARY, + FLOATING +} + +export class ScreenManager { + static readonly DEFAULT_WIDTH: number = 1920; + static readonly DEFAULT_HEIGHT: number = 1080; + private static readonly SPLIT_THRESHOLD = 1.7; + private winWidth = 0.0; + private winHeight = 0.0; + private statusBarHeight = 0; + private naviBarHeight = 0; + private leftBlank: [number, number, number, number] = [0, 0, 0, 0]; + private mainWindow = undefined; + private columns: number = ColumnSize.COLUMN_FOUR; + + // Default orientation for Pc + private horizontal: boolean = true; + + // Default sidebar for Pc + private sidebar: boolean = true; + private windowMode = WindowMode.UNDEFINED; + + private constructor() { + Log.info(TAG, 'constructor'); + } + + /** + * Get screen instance. + * @returns + */ + static getInstance(): ScreenManager { + if (AppStorage.Get(CommonConstants.APP_KEY_SCREEN_MANAGER) == null) { + AppStorage.SetOrCreate(CommonConstants.APP_KEY_SCREEN_MANAGER, new ScreenManager()); + } + let manager: ScreenManager = AppStorage.Get(CommonConstants.APP_KEY_SCREEN_MANAGER); + return manager; + } + + /** + * Init. + * @param win + * @returns + */ + async initializationSize(win: window.Window): Promise { + this.mainWindow = win; + let properties = await win.getProperties(); + + AppStorage.SetOrCreate(CommonConstants.IS_FULL_SCREEN_KEY, properties.isFullScreen); + // Area data obtained through the system interface, + // There is a possibility that the area data is incorrect. + const statusBarHeight = properties && properties.windowRect ? properties.windowRect.top : this.statusBarHeight; + AppStorage.SetOrCreate('statusBarHeight', statusBarHeight); + return new Promise((resolve, reject) => { + if (!properties || !properties.windowRect) { + reject(); + } + let size = properties.windowRect; + Log.info(TAG, `display screen windowRect: ${JSON.stringify(size)}`); + this.winWidth = px2vp(size.width); + this.winHeight = px2vp(size.height); + Log.info(TAG, `display screen windowRect px2vp: ${this.winWidth} ${this.winHeight}`); + if (this.winWidth < ScreenWidth.WIDTH_MEDIUM) { + this.columns = ColumnSize.COLUMN_FOUR; + } else if (this.winWidth >= ScreenWidth.WIDTH_MEDIUM && this.winWidth < ScreenWidth.WIDTH_LARGE) { + this.columns = ColumnSize.COLUMN_EIGHT; + } else { + this.columns = ColumnSize.COLUMN_TWELVE; + } + resolve(); + }); + } + + /** + * Get window width. + * unit: vp. + */ + getWinWidth(): number { + return this.winWidth; + } + + /** + * Get window height. + * unit: vp. + */ + getWinHeight(): number { + return this.winHeight; + } + + /** + * Get status bar height. + * @returns + */ + getStatusBarHeight(): number { + return this.statusBarHeight; + } + + /** + * Get navi bar height. + * @returns + */ + getNaviBarHeight(): number { + return this.naviBarHeight; + } + + /** + * Init window mode. + */ + initWindowMode(): void { + Log.debug(TAG, `start to initialize photos application window mode: ${this.windowMode}`); + this.checkWindowMode(); + this.mainWindow && this.setMainWindow(); + } + + /** + * Determine whether it is split screen mode. + * @returns + */ + isSplitMode(): boolean { + return (WindowMode.PRIMARY === this.windowMode || WindowMode.SECONDARY === this.windowMode); + } + + /** + * Check screen mode. + * @returns + */ + async checkWindowMode(): Promise { + let before = this.windowMode; + let mode = await globalThis.photosWindowStage.getWindowMode(); + Log.info(TAG, `photos application before/current window mode: ${before}/${mode}`); + + if (before == mode) { + return; + } + this.windowMode = mode; + if (WindowMode.FULLSCREEN == this.windowMode) { + this.setFullScreen(); + } else { + this.setSplitScreen(); + } + } + + /** + * Set main window. + */ + setMainWindow(): void { + Log.debug(TAG, 'setMainWindow'); + this.mainWindow.on('windowSizeChange', (data) => { + Log.debug(TAG, `windowSizeChange ${JSON.stringify(data)}`); + try { + let properties = this.mainWindow.getWindowProperties(); + AppStorage.SetOrCreate(CommonConstants.IS_FULL_SCREEN_KEY, properties.isFullScreen); + } catch (exception) { + Log.error(TAG, 'Failed to obtain the area. Cause:' + JSON.stringify(exception)); + } + this.onWinSizeChanged(data); + }) + this.mainWindow.getProperties().then(prop => { + Log.info(TAG, `Window prop: ${JSON.stringify(prop)}`); + this.onWinSizeChanged(prop.windowRect); + }); + } + + /** + * Get main window. + * @returns + */ + private getMainWindow(): window.Window { + return AppStorage.Get('mainWindow'); + } + + /** + * Get avoid area. + */ + getAvoidArea(): void { + let topWindow = this.getMainWindow(); + topWindow.getAvoidArea(0, (err, data) => { + Log.info(TAG, 'Succeeded in obtaining the area. Data:' + JSON.stringify(data)); + this.onLeftBlankChanged(data); + }); + } + + /** + * Set full Screen. + */ + setFullScreen(): void { + let topWindow = this.getMainWindow(); + Log.debug(TAG, 'getTopWindow start'); + try { + topWindow.setLayoutFullScreen(true, () => { + Log.debug(TAG, 'setFullScreen true Succeeded'); + if (AppStorage.Get('deviceType') !== CommonConstants.DEFAULT_DEVICE_TYPE) { + this.hideStatusBar(); + } else { + this.setDefaultStatusBarProperties(); + } + }); + } catch (err) { + Log.error(TAG, `setFullScreen err: ${err}`); + } + } + + /** + * Set split screen. + */ + setSplitScreen(): void { + try { + this.statusBarHeight = 0; + this.naviBarHeight = 0; + this.leftBlank = [0, 0, 0, 0]; + } catch (err) { + Log.error(TAG, `setSplitScreen err: ${err}`); + } + } + + /** + * Hide status bar. + */ + hideStatusBar(): void { + Log.debug(TAG, 'hideStatusBar start'); + let topWindow = this.getMainWindow(); + Log.debug(TAG, 'getTopWindow start'); + let names = new Array('navigation'); + Log.debug(TAG, `getTopWindow names: ${names} end`); + try { + topWindow.setSystemBarEnable(names, () => { + Log.debug(TAG, 'hideStatusBar Succeeded'); + topWindow.getAvoidArea(0, async (err, data) => { + Log.info(TAG, `Succeeded in obtaining the area. Data: ${JSON.stringify(data)}`); + this.onLeftBlankChanged(data); + // let barColor = await UiUtil.getResourceString($r('app.color.transparent')); + let barColor = '#00000000'; + if (!barColor) { + barColor = '#00000000'; + } + topWindow.setSystemBarProperties({ navigationBarColor: barColor }, + () => { + Log.info(TAG, 'setStatusBarColor done'); + }); + }); + }); + } catch (err) { + Log.error(TAG, `hideStatusBar err: ${err}`); + } + } + + /** + * Set default status bar properties. + * @returns + */ + async setDefaultStatusBarProperties(): Promise { + Log.debug(TAG, 'setStatusBarColor start'); + let topWindow = this.getMainWindow(); + try { + topWindow.setSystemBarProperties( + { statusBarColor: CommonConstants.STATUS_BAR_BACKGROUND_COLOR, + statusBarContentColor: CommonConstants.STATUS_BAR_CONTENT_COLOR }, () => { + Log.info(TAG, 'setStatusBarColor done'); + }); + } catch (err) { + Log.error(TAG, `setStatusBarColor err: ${err}`); + } + } + + /** + * Avoid area left. + * @param area + */ + private onLeftBlankChanged(area): void { + if (area == null || area == undefined || area.bottomRect.height == 0) { + return; + } + let leftBlankBefore = { + status: this.statusBarHeight, + navi: this.naviBarHeight + }; + // Area data obtained through the system interface, + // There is a possibility that the area data is incorrect. + AppStorage.SetOrCreate('statusBarHeight', area.topRect.height); + this.statusBarHeight = px2vp(area.topRect.height); + this.naviBarHeight = px2vp(area.bottomRect.height); + this.leftBlank = [this.leftBlank[0], this.leftBlank[1], this.leftBlank[2], px2vp(area.bottomRect.height)]; + if (leftBlankBefore.status != this.statusBarHeight || leftBlankBefore.navi != this.naviBarHeight) { + Log.info(TAG, `leftBlank changed: ${JSON.stringify(leftBlankBefore)}-${JSON.stringify(this.leftBlank)}`); + } + } + + /** + * Listen window size change. + * @param size + */ + private onWinSizeChanged(size): void { + Log.info(TAG, `onWinSizeChanged ${JSON.stringify(size)}`); + if (size == null || size == undefined) { + return; + } + let isSplitModeBefore = this.isSplitMode(); + this.checkWindowMode(); + let sizeBefore = { + width: this.winWidth, + height: this.winHeight + }; + this.winWidth = px2vp(size.width); + this.winHeight = px2vp(size.height); + Log.info(TAG, `onWinSizeChanged px2vp: ${this.winWidth} ${this.winHeight}`); + if (this.winWidth < ScreenWidth.WIDTH_MEDIUM) { + this.columns = ColumnSize.COLUMN_FOUR; + } else if (this.winWidth >= ScreenWidth.WIDTH_MEDIUM && this.winWidth < ScreenWidth.WIDTH_LARGE) { + this.columns = ColumnSize.COLUMN_EIGHT; + } else { + this.columns = ColumnSize.COLUMN_TWELVE; + } + let isSplitModeNow = this.isSplitMode(); + if (isSplitModeBefore != isSplitModeNow) { + Log.info(TAG, `splitMode changed: ${isSplitModeBefore} -> ${isSplitModeNow}`); + } + if (sizeBefore.width != this.winWidth || sizeBefore.height != this.winHeight) { + let newSize = { + width: this.winWidth, + height: this.winHeight + }; + Log.info(TAG, `winSize changed: ${JSON.stringify(sizeBefore)} -> ${JSON.stringify(newSize)}`); + } + } +} diff --git a/Media/ImageEdit/entry/src/main/ets/workers/AdjustBrightnessWork.ts b/Media/ImageEdit/entry/src/main/ets/workers/AdjustBrightnessWork.ts new file mode 100644 index 0000000000000000000000000000000000000000..0df731694cc2d402c907760fd87bb69d2bdc4be9 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/workers/AdjustBrightnessWork.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; +import worker, { ThreadWorkerGlobalScope, MessageEvents, ErrorEvent } from '@ohos.worker'; +import { adjustImageValue } from '../utils/AdjustUtil'; + +let workerPort : ThreadWorkerGlobalScope = worker.workerPort; + +/** +* Defines the event handler to be called when the worker thread receives a message sent by the host thread. +* The event handler is executed in the worker thread. +* +* @param e message data +*/ +workerPort.onmessage = function(event : MessageEvents) { + let bufferArray = event.data.buf; + let last = event.data.last; + let cur = event.data.cur; + let buffer = adjustImageValue(bufferArray, last, cur) + workerPort.postMessage(buffer); + workerPort.close(); +} + +/** +* Defines the event handler to be called when the worker receives a message that cannot be deserialized. +* The event handler is executed in the worker thread. +* +* @param e message data +*/ +workerPort.onmessageerror = function(event : MessageEvents) { + hilog.error(0x0000, 'AdjustBrightnessWork', 'Failed to load the content. Cause: %{public}s', `on message error ${JSON.stringify(event)}`); +} + +/** +* Defines the event handler to be called when an exception occurs during worker execution. +* The event handler is executed in the worker thread. +* +* @param e error message +*/ +workerPort.onerror = function(error : ErrorEvent) { + hilog.error(0x0000, 'AdjustBrightnessWork', 'Failed to load the content. Cause: %{public}s', `on worker error ${JSON.stringify(error)}`); +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/ets/workers/AdjustSaturationWork.ts b/Media/ImageEdit/entry/src/main/ets/workers/AdjustSaturationWork.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e1a884b1b89a2d4adf9bffedacdaee7a8038393 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/ets/workers/AdjustSaturationWork.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; +import worker, { ThreadWorkerGlobalScope, MessageEvents, ErrorEvent } from '@ohos.worker'; +import { adjustSaturation } from '../utils/AdjustUtil'; + +let workerPort : ThreadWorkerGlobalScope = worker.workerPort; + +/** +* Defines the event handler to be called when the worker thread receives a message sent by the host thread. +* The event handler is executed in the worker thread. +* +* @param e message data +*/ +workerPort.onmessage = function(event : MessageEvents) { + let bufferArray = event.data.buf; + let last = event.data.last; + let cur = event.data.cur; + let buffer = adjustSaturation(bufferArray, last, cur) + workerPort.postMessage(buffer); + workerPort.close(); +} + +/** +* Defines the event handler to be called when the worker receives a message that cannot be deserialized. +* The event handler is executed in the worker thread. +* +* @param e message data +*/ +workerPort.onmessageerror = function(event : MessageEvents) { + hilog.error(0x0000, 'AdjustSaturationWork', 'Failed to load the content. Cause: %{public}s', `on message error ${JSON.stringify(event)}`); +} + +/** +* Defines the event handler to be called when an exception occurs during worker execution. +* The event handler is executed in the worker thread. +* +* @param e error message +*/ +workerPort.onerror = function(error : ErrorEvent) { + hilog.error(0x0000, 'AdjustSaturationWork', 'Failed to load the content. Cause: %{public}s', `on worker error ${JSON.stringify(error)}`); +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/module.json5 b/Media/ImageEdit/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e0ec104c89ab54aa6fef8ee5e350c19b23c8f179 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/module.json5 @@ -0,0 +1,75 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "orientation": "portrait", + "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.MEDIA_LOCATION", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.READ_MEDIA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.WRITE_MEDIA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + } + ] + } +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/resources/base/element/color.json b/Media/ImageEdit/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/Media/ImageEdit/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/Media/ImageEdit/entry/src/main/resources/base/element/float.json b/Media/ImageEdit/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..0dbcf71031570bde4b5be3504ad1cd1ea85877b4 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/resources/base/element/float.json @@ -0,0 +1,88 @@ +{ + "float": [ + { + "name": "title_font_size", + "value": "20fp" + }, + { + "name": "title_margin_left", + "value": "-50vp" + }, + { + "name": "title_height", + "value": "56vp" + }, + { + "name": "category_font_size", + "value": "16fp" + }, + { + "name": "category_margin_top", + "value": "8vp" + }, + { + "name": "title_image_width", + "value": "24vp" + }, + { + "name": "title_image_height", + "value": "24vp" + }, + { + "name": "save_image_right", + "value": "40vp" + }, + { + "name": "crop_image_width", + "value": "48vp" + }, + { + "name": "crop_image_height", + "value": "48vp" + }, + { + "name": "rotate_image_width", + "value": "36vp" + }, + { + "name": "rotate_image_height", + "value": "36vp" + }, + { + "name": "adjust_icon_width", + "value": "20vp" + }, + { + "name": "adjust_icon_height", + "value": "20vp" + }, + { + "name": "adjust_font_size", + "value": "12fp" + }, + { + "name": "adjust_margin_top", + "value": "8vp" + }, + { + "name": "adjust_margin_bottom", + "value": "10vp" + }, + { + "name": "slider_font_size", + "value": "16fp" + }, + { + "name": "slider_margin_top", + "value": "12vp" + }, + { + "name": "home_page_title_height", + "value": "38" + }, + { + "name": "home_page_title_margin", + "value": "10" + } + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/resources/base/element/string.json b/Media/ImageEdit/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..29f42bdc6445a8655a122784d69b96960f4b5967 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/resources/base/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ImageEdit" + }, + { + "name": "reason", + "value": "save image" + }, + { + "name": "image_edit", + "value": "imageEdit" + }, + { + "name": "crop", + "value": "crop" + }, + { + "name": "rotate", + "value": "rotate" + }, + { + "name": "adjust", + "value": "adjust" + }, + { + "name": "brightness", + "value": "brightness" + }, + { + "name": "transparency", + "value": "transparency" + }, + { + "name": "saturation", + "value": "saturation" + }, + { + "name": "save_image", + "value": "saveImage" + }, + { + "name": "confirm_save", + "value": "are you sure to save image" + }, + { + "name": "save", + "value": "save" + }, + { + "name": "cancel", + "value": "cancel" + }, + { + "name": "exec_edit", + "value": "running exec edit." + } + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_adjust.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_adjust.png new file mode 100644 index 0000000000000000000000000000000000000000..0c925713c760486019aebb0700f6c1df5ddb2e36 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_adjust.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_adjust_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_adjust_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..34f56f2a40980db139d5669fcec4fabbf552bce9 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_adjust_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_anti_clockwise.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_anti_clockwise.png new file mode 100644 index 0000000000000000000000000000000000000000..262594ad4b902e5810a1bda18f04ae1c63170b8b Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_anti_clockwise.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_brightness.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_brightness.png new file mode 100644 index 0000000000000000000000000000000000000000..79c5ff0f9f4ccc73f7f629f31e3fe1aea7469723 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_brightness.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_brightness_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_brightness_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..41777d105cd8d57c87c2f787bd4da5bb167efcb5 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_brightness_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_clockwise.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_clockwise.png new file mode 100644 index 0000000000000000000000000000000000000000..0b739c4ccea379a18704e849519b74bc685aec6a Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_clockwise.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_crop.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_crop.png new file mode 100644 index 0000000000000000000000000000000000000000..cfde5b1a8c02cfd747affa40642cc5d82a1bfc80 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_crop.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_crop_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_crop_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..011533d400576c0ba1f9be222f5a89df71d1d9cc Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_crop_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_four2three.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_four2three.png new file mode 100644 index 0000000000000000000000000000000000000000..8a5c7f27f01100535e13585ffd58c6add77bb94d Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_four2three.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_four2three_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_four2three_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..f52ebeefdaa8ac7289c787cbcff6e1256981d1bd Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_four2three_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_low.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_low.png new file mode 100644 index 0000000000000000000000000000000000000000..8a94608667608544ad6ce4c547a45246e3aed649 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_low.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_one2one.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_one2one.png new file mode 100644 index 0000000000000000000000000000000000000000..ed831b5419c1cab025b66acad8275e9cb0df4f40 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_one2one.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_one2one_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_one2one_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..1af69bf4201819505459932f8f88312abe9c305b Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_one2one_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_original.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_original.png new file mode 100644 index 0000000000000000000000000000000000000000..5a742e402154f9931370e343d29979ef3846b999 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_original.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_original_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_original_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..96a4f39bc742f4ee9a99ef8938bfb6e78395b476 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_original_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_reset.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_reset.png new file mode 100644 index 0000000000000000000000000000000000000000..3ac9af2768caf6d9b79da3bf798d01e153e9820f Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_reset.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_rotate.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_rotate.png new file mode 100644 index 0000000000000000000000000000000000000000..9620f9967a3b95d0884499e6c71dd49bcbb8684a Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_rotate.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_rotate_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_rotate_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..acea9c87a0960d5d2d00ffb8c84e86da4add2d2e Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_rotate_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_saturation.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_saturation.png new file mode 100644 index 0000000000000000000000000000000000000000..157bf72c4f3931170252f31c667580a91bb197ee Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_saturation.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_saturation_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_saturation_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..ea1aa3f4e29af6a8097bf9b2f9e6d72aed3ce4ff Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_saturation_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_save.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_save.png new file mode 100644 index 0000000000000000000000000000000000000000..0f6599c303b99a0e3cf0078d802068b7d5f33255 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_save.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_sixteen2nine.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_sixteen2nine.png new file mode 100644 index 0000000000000000000000000000000000000000..c74c7ed34801825647ebaefabb46b75d7dfc9d62 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_sixteen2nine.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_sixteen2nine_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_sixteen2nine_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..6b686b9203ce2290d7210101aa4ef816544c188f Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_sixteen2nine_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_transparency.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_transparency.png new file mode 100644 index 0000000000000000000000000000000000000000..c3c52ab3823bf80d8312f416b4f5f5b9c39f5129 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_transparency.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/ic_transparency_filled.png b/Media/ImageEdit/entry/src/main/resources/base/media/ic_transparency_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..88b01b99f0af1156d24280be7aa9b7f246c17e3c Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/ic_transparency_filled.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/media/icon.png b/Media/ImageEdit/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/base/media/icon.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/base/profile/main_pages.json b/Media/ImageEdit/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..b16dfa5fe61f19a4e4fc6f1e25708dda21e01ac5 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/HomePage" + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/resources/en_US/element/string.json b/Media/ImageEdit/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..29f42bdc6445a8655a122784d69b96960f4b5967 --- /dev/null +++ b/Media/ImageEdit/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ImageEdit" + }, + { + "name": "reason", + "value": "save image" + }, + { + "name": "image_edit", + "value": "imageEdit" + }, + { + "name": "crop", + "value": "crop" + }, + { + "name": "rotate", + "value": "rotate" + }, + { + "name": "adjust", + "value": "adjust" + }, + { + "name": "brightness", + "value": "brightness" + }, + { + "name": "transparency", + "value": "transparency" + }, + { + "name": "saturation", + "value": "saturation" + }, + { + "name": "save_image", + "value": "saveImage" + }, + { + "name": "confirm_save", + "value": "are you sure to save image" + }, + { + "name": "save", + "value": "save" + }, + { + "name": "cancel", + "value": "cancel" + }, + { + "name": "exec_edit", + "value": "running exec edit." + } + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/entry/src/main/resources/rawfile/low.jpg b/Media/ImageEdit/entry/src/main/resources/rawfile/low.jpg new file mode 100644 index 0000000000000000000000000000000000000000..65d34e3b43b750029cb6d66c7cf392aa500a2b90 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/rawfile/low.jpg differ diff --git a/Media/ImageEdit/entry/src/main/resources/rawfile/low.png b/Media/ImageEdit/entry/src/main/resources/rawfile/low.png new file mode 100644 index 0000000000000000000000000000000000000000..183982a5beb9f0d5700fc2fe6283133d236c4196 Binary files /dev/null and b/Media/ImageEdit/entry/src/main/resources/rawfile/low.png differ diff --git a/Media/ImageEdit/entry/src/main/resources/zh_CN/element/string.json b/Media/ImageEdit/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..ad0fb6e6b98a07fbd5dfcdc517888a0f10644f8b --- /dev/null +++ b/Media/ImageEdit/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,68 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ImageEdit" + }, + { + "name": "reason", + "value": "保存图片" + }, + { + "name": "image_edit", + "value": "图片编辑" + }, + { + "name": "crop", + "value": "裁剪" + }, + { + "name": "rotate", + "value": "旋转" + }, + { + "name": "adjust", + "value": "调节" + }, + { + "name": "brightness", + "value": "亮度" + }, + { + "name": "transparency", + "value": "透明度" + }, + { + "name": "saturation", + "value": "饱和度" + }, + { + "name": "save_image", + "value": "保存图片" + }, + { + "name": "confirm_save", + "value": "确定要保存图片吗" + }, + { + "name": "save", + "value": "保存" + }, + { + "name": "cancel", + "value": "取消" + }, + { + "name": "exec_edit", + "value": "正在执行编辑" + } + ] +} \ No newline at end of file diff --git a/Media/ImageEdit/figures/congratulations.gif b/Media/ImageEdit/figures/congratulations.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and b/Media/ImageEdit/figures/congratulations.gif differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001542044862.gif b/Media/ImageEdit/figures/zh-cn_image_0000001542044862.gif new file mode 100644 index 0000000000000000000000000000000000000000..1f2d60bb8af9f8c6934c43c87a7e4cc7c52e76c6 Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001542044862.gif differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001542044962.gif b/Media/ImageEdit/figures/zh-cn_image_0000001542044962.gif new file mode 100644 index 0000000000000000000000000000000000000000..d291c41dde328bde0782ea5979bad924f86b477b Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001542044962.gif differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001542204198.gif b/Media/ImageEdit/figures/zh-cn_image_0000001542204198.gif new file mode 100644 index 0000000000000000000000000000000000000000..22e4031ecafe0e6892061ff87c9ea9f87ba3f2c5 Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001542204198.gif differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001542204870.gif b/Media/ImageEdit/figures/zh-cn_image_0000001542204870.gif new file mode 100644 index 0000000000000000000000000000000000000000..7bc899b86d023ef63406013ef95d791ef6f4603f Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001542204870.gif differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001569303293.png b/Media/ImageEdit/figures/zh-cn_image_0000001569303293.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001569303293.png differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001592604569.gif b/Media/ImageEdit/figures/zh-cn_image_0000001592604569.gif new file mode 100644 index 0000000000000000000000000000000000000000..4f99a74c061b478ced38f59af5b193b16c6c4407 Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001592604569.gif differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001592803785.png b/Media/ImageEdit/figures/zh-cn_image_0000001592803785.png new file mode 100644 index 0000000000000000000000000000000000000000..146ac03e3a56af9476a3b342654fbbf54886333c Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001592803785.png differ diff --git a/Media/ImageEdit/figures/zh-cn_image_0000001592803857.gif b/Media/ImageEdit/figures/zh-cn_image_0000001592803857.gif new file mode 100644 index 0000000000000000000000000000000000000000..30c5ff2ee5ff1e2f79aa264a50a23cf84b6ee547 Binary files /dev/null and b/Media/ImageEdit/figures/zh-cn_image_0000001592803857.gif differ diff --git a/Media/ImageEdit/hvigor/hvigor-config.json5 b/Media/ImageEdit/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/Media/ImageEdit/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/Media/ImageEdit/hvigorfile.ts b/Media/ImageEdit/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/Media/ImageEdit/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/Media/ImageEdit/oh-package.json5 b/Media/ImageEdit/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7e61fa36adfc7651f7fb011ee866bb303bde3160 --- /dev/null +++ b/Media/ImageEdit/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "imageedit", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Media/ImageEdit/public_sys-resources/icon-caution.gif b/Media/ImageEdit/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Media/ImageEdit/public_sys-resources/icon-caution.gif differ diff --git a/Media/ImageEdit/public_sys-resources/icon-danger.gif b/Media/ImageEdit/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Media/ImageEdit/public_sys-resources/icon-danger.gif differ diff --git a/Media/ImageEdit/public_sys-resources/icon-note.gif b/Media/ImageEdit/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/Media/ImageEdit/public_sys-resources/icon-note.gif differ diff --git a/Media/ImageEdit/public_sys-resources/icon-notice.gif b/Media/ImageEdit/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/Media/ImageEdit/public_sys-resources/icon-notice.gif differ diff --git a/Media/ImageEdit/public_sys-resources/icon-tip.gif b/Media/ImageEdit/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/Media/ImageEdit/public_sys-resources/icon-tip.gif differ diff --git a/Media/ImageEdit/public_sys-resources/icon-warning.gif b/Media/ImageEdit/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Media/ImageEdit/public_sys-resources/icon-warning.gif differ diff --git a/Media/SimpleVideo/AppScope/app.json5 b/Media/SimpleVideo/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b8c8e5b4f94e3ff91407d35a192b20f8ef1fd134 --- /dev/null +++ b/Media/SimpleVideo/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.simplevideo", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/Media/SimpleVideo/AppScope/resources/base/element/string.json b/Media/SimpleVideo/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d5829627090471163c6c6df4744757b935ca056b --- /dev/null +++ b/Media/SimpleVideo/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "SimpleVideo" + } + ] +} diff --git a/Media/SimpleVideo/AppScope/resources/base/media/app_icon.png b/Media/SimpleVideo/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Media/SimpleVideo/AppScope/resources/base/media/app_icon.png differ diff --git a/Media/SimpleVideo/LICENSE b/Media/SimpleVideo/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..381eb507bc1eef9b5158e496dedab769e810b657 --- /dev/null +++ b/Media/SimpleVideo/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Media/SimpleVideo/README.md b/Media/SimpleVideo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d0b571541e4ef32e4c7090ce113a2d8e4ef5ad7e --- /dev/null +++ b/Media/SimpleVideo/README.md @@ -0,0 +1,511 @@ +# 简易视频播放器(ArkTS) + +## 介绍 + +本篇Codelab使用ArkTS语言实现视频播放器,主要包括主界面和视频播放界面,我们将一起完成以下功能: + +1. 主界面顶部使用Swiper组件实现视频海报轮播。 +2. 主界面下方使用List组件实现视频列表。 +3. 播放界面使用Video组件实现视频播放。 +4. 在不使用视频组件默认控制器的前提下,实现自定义控制器。 +5. 播放界面底部使用图标控制视频播放/暂停。 +6. 播放界面底部使用Slider组件控制和实现视频播放进度。 +7. 播放界面使用Stack容器组件的[Z序控制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-z-order.md)实现在视频播放画面上添加开始/暂停/加载图标。 + +![](figures/1.gif) + +### 相关概念 + +- [Swiper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md)组件:滑动容器,提供切换子组件显示的能力。 +- [List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md)组件:列表包含一系列相同宽度的列表项。适合连续、多行呈现同类数据,例如图片和文本。 +- [Video](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-media-components-video.md)组件:用于播放视频文件并控制其播放状态的组件。 +- [Navigator](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-navigator.md)组件:路由容器组件,提供路由跳转能力。 +- [ForEach](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/arkts-rendering-control-foreach.md)组件:基于数组类型数据执行循环渲染。 + +## 环境搭建 + +### 软件要求 + +- [DevEco Studio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87)版本:DevEco Studio 3.1 Release及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 + +### 硬件要求 + +- 开发板类型:[润和RK3568开发板](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-rk3568.md)。 +- OpenHarmony系统:3.2 Release及以上版本。 + +### 环境搭建 + +完成本篇Codelab我们首先要完成开发环境的搭建,本示例以**RK3568**开发板为例,参照以下步骤进行: + +1. [获取OpenHarmony系统版本](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md#%E8%8E%B7%E5%8F%96%E6%96%B9%E5%BC%8F3%E4%BB%8E%E9%95%9C%E5%83%8F%E7%AB%99%E7%82%B9%E8%8E%B7%E5%8F%96):标准系统解决方案(二进制)。以3.2 Release版本为例: + + ![](figures/zh-cn_image_0000001405854998.png) + +2. 搭建烧录环境。 + + 1. [完成DevEco Device Tool的安装](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-env-win.md) + 2. [完成RK3568开发板的烧录](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-ide-3568-burn.md) + +3. 搭建开发环境。 + + 1. 开始前请参考[工具准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-overview.md#%E5%B7%A5%E5%85%B7%E5%87%86%E5%A4%87),完成DevEco Studio的安装和开发环境配置。 + 2. 开发环境配置完成后,请参考[使用工程向导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#创建ets工程)创建工程(模板选择“Empty Ability”)。 + 3. 工程创建完成后,选择使用[真机进行调测](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/start-with-ets-stage.md#使用真机运行应用)。 + +## 代码结构解读 + +本篇Codelab只对核心代码进行讲解,对于完整代码,我们会在gitee中提供。 + +``` +├──entry/src/main/ets // 代码区 +│ ├──common +│ │ └──constants +│ │ └──CommonConstants.ets // 样式常量类 +│ ├──entryability +│ │ └──EntryAbility.ts // 程序入口类 +│ ├──model +│ │ └──VideoControll.ets // 视频播放控制相关方法类 +│ ├──pages +│ │ ├──SimpleVideoIndex.ets // 主界面 +│ │ └──SimpleVideoPlay.ets // 视频播放界面 +│ ├──view +│ │ ├──IndexModule.ets // 自定义首页List模块组件文件 +│ │ ├──IndexSwiper.ets // 自定义首页Swiper组件文件 +│ │ ├──VideoPlayer.ets // 自定义播放界面视频组件文件 +│ │ └──VideoPlaySlider.ets // 自定义播放界面视频进度条组件文件 +│ └──viewmodel +│ └──VideoData.ets // 首页相关数据 +└──entry/src/main/resource // 应用静态资源目录 +``` + +## 构建主界面 + +主界面由视频轮播模块和多个视频列表模块组成,效果如图所示: + +![](figures/2.png) + +VideoData.ets中定义的视频轮播图数组SWIPER_VIDEOS和视频列表图片数组HORIZONTAL_VIDEOS。 + +```typescript +// VideoData.ets +export const SWIPER_VIDEOS: object[] = [ + { + "image": $r("app.media.ic_banner1") + }, + { + "image": $r("app.media.ic_banner2") + }, + { + "image": $r("app.media.ic_banner3") + } +]; + +export const HORIZONTAL_VIDEOS: object[] = [ + { + "id": 1, + "image": $r("app.media.ic_video_list0"), + "name": '视频1' + }, + { + "id": 2, + "image": $r("app.media.ic_video_list1"), + "name": '视频2' + }, + { + "id": 3, + "image": $r("app.media.ic_video_list2"), + "name": '视频3' + } +]; +``` + +IndexSwiper.ets文件中定义的轮播图子组件SwiperVideo,点击轮播图片,页面跳转到视频播放页面,并携带本地视频flag,效果如图所示: + +![](figures/3.png) + +```typescript +//IndexSwiper.ets +@Component +export struct SwiperVideo { + + build() { + Column() { + Swiper() { + ForEach(SWIPER_VIDEOS, item => { + SwiperItem({ imageSrc: item.image, source: $rawfile('videoTest.mp4') }) + }, item => JSON.stringify(item)) + } + .autoPlay(true) + } + // 样式设置 + ... + } +} + +@Component +struct SwiperItem { + private imageSrc: Resource; + private source: Resource; + + build() { + // 跳转一:使用Navigator组件跳转到视频播放界面 + Navigator({ target: SECOND_PAGE, type: NavigationType.Push }) { + Image(this.imageSrc) + .borderRadius(MARGIN_FONT_SIZE.FIRST_MARGIN) + } + .params({ source: this.source }) + } +} +``` + +IndexModule.ets文件中定义的视频列表图片子组件VideoModule,点击子组件中的图片,页面跳转到视频播放页面,并携带网络视频flag,效果如图所示: + +![](figures/4.png) + +```typescript +// IndexModule.ets +@Component +export struct VideoModule { + private moduleName: string; + + build() { + Column() { + // 视频列表上方的文本信息 + ... + // 视频列表组件 + List({ space: MARGIN_FONT_SIZE.FIRST_MARGIN }) { + ForEach(HORIZONTAL_VIDEOS, item => { + ListItem() { + HorizontalItem({ + imageSrc: item.image, + source: NET, + videoName: item.name + }) + } + }, item => JSON.stringify(item)) + } + // 设置列表横向排列 + .listDirection(Axis.Horizontal) + } + // 样式设置 + ... + } +} + +@Component +struct HorizontalItem { + private imageSrc: Resource; + private source: string; + private videoName: string; + + build() { + // 跳转二:使用route跳转到视频播放界面 + Column() { + Image(this.imageSrc) + .width(MARGIN_FONT_SIZE.SEVENTH_MARGIN) + .height(MARGIN_FONT_SIZE.SIXTH_MARGIN) + .onClick(() => { + router.pushUrl({ + url: SECOND_PAGE, + params: { source: this.source } + }); + }) + ... + } + .justifyContent(FlexAlign.Center) + } +} +``` + +在SimpleVideoIndex.ets主界面中引用SwiperVideo和VideoModule子组件。 + +```typescript +// SimpleVideoIndex.ets +@Entry +@Component +struct SimpleVideoIndex { + build() { + Column({ space: MARGIN_FONT_SIZE.FOURTH_MARGIN }) { + // 视频轮播组件 + SwiperVideo() + List() { + ForEach(LIST, (item) => { + ListItem() { + VideoModule({ moduleName: item }) + .margin({ top: MARGIN_FONT_SIZE.FIRST_MARGIN }) + } + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Vertical) + .margin({ top: MARGIN_FONT_SIZE.THIRD_MARGIN }) + } + ... + } +} +``` + +## 构建视频播放界面 + +VideoPlayer.ets其中定义了视频播放子组件VideoPlayer ,onPrepared回调方法中可以获取视频总时长,onUpdate回调方法中可实时获取到视频播放的当前时间戳,onFinish是视频播放结束后的回调方法,onError是视频播放出错的回调方法。 + +```typescript +// VideoPlayer.ets +@Component +export struct VideoPlayer { + private source: String | Resource; + private controller: VideoController; + private previewUris: Resource = $r('app.media.ic_preview'); + @Provide currentTime: number = 0; + @Provide durationTime: number = 0; + @Provide durationStringTime: string = START_TIME; + @Provide currentStringTime: string = START_TIME; + @Consume isPlay: boolean; + @Consume isOpacity: boolean ; + @Consume flag: boolean; + @Consume isLoading: boolean; + @Consume progressVal: number; + + build() { + Column() { + Video({ + src: this.source, + previewUri: this.previewUris, + controller: this.controller + }) + .width(ALL_PERCENT) + .height(STRING_PERCENT.NINETY_PERCENT) + .controls(false) + .autoPlay(false) + .objectFit(ImageFit.Contain) + .loop(false) + .onUpdate((event) => { + this.currentTime = event.time; + this.currentStringTime = changeSliderTime(this.currentTime); + }) + .onPrepared((event) => { + prepared.call(this, event); + }) + .onFinish(() => { + finish.call(this); + }) + .onError(() => { + prompt.showToast({ + duration: COMMON_NUM_DURATION, + message: MESSAGE + }); + }) + VideoSlider({ controller: this.controller }) + } + } +} +``` + +在自定义组件VideoPlayer底部使用了自定义子组件VideoSlider,VideoSlider自定义组件中显示和控制视频播放进度,效果如图所示: + +![](figures/5.png) + +```typescript +// VideoPlaySlider.ets +@Component +export struct VideoSlider { + @Consume isOpacity: boolean; + private controller: VideoController; + @Consume currentStringTime: string; + @Consume currentTime: number; + @Consume durationTime: number; + @Consume durationStringTime: string; + @Consume isPlay: boolean; + @Consume flag: boolean; + @Consume isLoading: boolean; + @Consume progressVal: number; + + build() { + Row({ space: MARGIN_FONT_SIZE.FIRST_MARGIN }) { + ... + Slider({ + value: this.currentTime, + min: 0, + max: this.durationTime, + step: 1, + style: SliderStyle.OutSet + }) + .blockColor($r("app.color.white")) + .width(STRING_PERCENT.SLIDER_WITH) + .trackColor(Color.Gray) + .selectedColor($r("app.color.white")) + .showSteps(true) + .showTips(true) + .trackThickness(this.isOpacity ? SMALL_TRACK_THICK_NESS : BIG_TRACK_THICK_NESS) + .onChange((value: number, mode: SliderChangeMode) => { + sliderOnchange.call(this, value, mode); + }) + ... + + } + .opacity(this.isOpacity ? DEFAULT_OPACITY : 1) + .width(ALL_PERCENT) + } +} +``` + +在VideoController.ets中的视频控制和回调的相关方法。 + +```typescript +// VideoControll.ets +export function prepared(event) { + // 获取视频资源时长,单位(秒) + this.durationTime = event.duration; + // 转成mm:ss类型,计算其mm 和 ss + let second: number = event.duration % COMMON_NUM_MINUTE; + let min: number = parseInt((event.duration / COMMON_NUM_MINUTE).toString()); + let head = min < COMMON_NUM_DOUBLE ? `${ZERO_STR}${min}` : min; + let end = second < COMMON_NUM_DOUBLE ? `${ZERO_STR}${second}` : second; + this.durationStringTime = `${head}${SPLIT}${end}`; + this.flag = true; +} + +export function finish() { + // 结束播放后修改isPlay 重新渲染控制图标,控制图标显形 + this.isPlay = false; + this.isOpacity = false; +} + +export function sliderOnchange(value: number, mode: SliderChangeMode) { + this.currentTime = parseInt(value.toString()); + this.controller.setCurrentTime(parseInt(value.toString()), SeekMode.Accurate); + if (mode === SliderChangeMode.Begin) { + this.isOpacity = false; + } + if (mode === SliderChangeMode.Moving) { + this.isOpacity = false; + } + if (mode === SliderChangeMode.End) { + this.isOpacity = true; + } +}; + +export function changeSliderTime(value: number): string { + let second: number = value % COMMON_NUM_MINUTE; + let min: number = parseInt((value / COMMON_NUM_MINUTE).toString()); + let head = min < COMMON_NUM_DOUBLE ? `${ZERO_STR}${min}` : min; + let end = second < COMMON_NUM_DOUBLE ? `${ZERO_STR}${second}` : second; + let nowTime = `${head}${SPLIT}${end}`; + return nowTime; +} + +export function iconOnclick() { + if (this.isPlay) { + this.controller.pause() + this.isPlay = false; + this.isOpacity = false; + return; + } + if(this.flag) { + this.controller.start(); + this.isPlay = true; + this.isOpacity = true; + } else { + let that = this; + that.isLoading = true; + // 视频加载未完成。显示加载动作 + let intervalLoading = setInterval(function() { + if (that.progressVal >= STACK_STYLE.PROGRESS_TOTAL) { + that.progressVal = 0; + } else { + that.progressVal += STACK_STYLE.PROGRESS_STEP; + } + }, STACK_STYLE.MILLI_SECONDS) + // 定时任务判断视频加载是否完成 + let intervalFlag = setInterval(function() { + if (that.flag) { + that.controller.start(); + that.isPlay = true; + that.isOpacity = true; + that.isLoading = false; + clearInterval(intervalFlag); + clearInterval(intervalLoading); + } + }, STACK_STYLE.MILLI_SECONDS); + } +} +``` + +在SimpleVideoPlay.ets播放界面,引用VideoPlayer子组件,并在视频播放页面使用堆叠容器,在视频播放画面中心堆叠控制、视频加载图标,效果如图所示: + +![](figures/6.png) + +```typescript +// SimpleVideoPlay.ets +@Entry +@Component +struct Play { + // 取到Index页面跳转来时携带的source对应的数据。 + private source: string = router.getParams()['source']; + private startIconResource: Resource = $r('app.media.ic_public_play'); + private backIconResource: Resource = $r('app.media.ic_back'); + @Provide isPlay: boolean = false; + @Provide isOpacity: boolean = false ; + controller: VideoController = new VideoController(); + @Provide isLoading: boolean = false; + @Provide progressVal: number = 0; + @Provide flag: boolean = false; + + onPageHide() { + this.controller.pause(); + } + + build() { + Column() { + // 顶部返回以及标题 +    ... + Stack() { + // 不同的播放状态渲染不同得控制图片 + if (!this.isPlay && !this.isLoading) { + Image(this.startIconResource) + .width(MARGIN_FONT_SIZE.FIFTH_MARGIN) + .height(MARGIN_FONT_SIZE.FIFTH_MARGIN) + // 同一容器中兄弟组件显示层级关系,z值越大,显示层级越高 用于控制图片在视频上。 + .zIndex(STACK_STYLE.IMAGE_Z_INDEX) + } + if (this.isLoading) { + Progress({ + value: STACK_STYLE.PROGRESS_VALUE, + total: STACK_STYLE.PROGRESS_TOTAL, + type: ProgressType.ScaleRing + }) + .color(Color.Grey) + .value(this.progressVal) + .width(STACK_STYLE.PROGRESS_WIDTH) + .style({ + strokeWidth: STACK_STYLE.PROGRESS_STROKE_WIDTH, + scaleCount: STACK_STYLE.PROGRESS_SCALE_COUNT, + scaleWidth: STACK_STYLE.PROGRESS_SCALE_WIDTH + }) + .zIndex(STACK_STYLE.PROGRESS_Z_INDEX) + } + VideoPlayer({ + source: this.source, + controller: this.controller + }) + .zIndex(0) + } + } + .height(ALL_PERCENT) + .backgroundColor(Color.Black) + } +} +``` + +## 总结 + +您已经完成了本次Codelab的学习,并了解到以下知识点: + +1. Swiper组件的使用。 +2. List组件的使用。 +3. Video组件的使用。 +4. Slider组件的使用。 +5. 如何实现自定义视频控制器。 + + +![](figures/彩带动效.gif) diff --git a/Media/SimpleVideo/build-profile.json5 b/Media/SimpleVideo/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/Media/SimpleVideo/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/build-profile.json5 b/Media/SimpleVideo/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f4f5c258db57852c093dcbaf5c5ad06a1504973 --- /dev/null +++ b/Media/SimpleVideo/entry/build-profile.json5 @@ -0,0 +1,11 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "OpenHarmony" + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/hvigorfile.ts b/Media/SimpleVideo/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/Media/SimpleVideo/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// 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/Media/SimpleVideo/entry/oh-package.json5 b/Media/SimpleVideo/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..225946cb11a2c405c8dc81eea89c22f923556638 --- /dev/null +++ b/Media/SimpleVideo/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "entry", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets b/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..fcd90dae518ac6b5c3ac17a1193cb0a4873521fb --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +/** + * route for second page + */ +export const SECOND_PAGE: string = 'pages/SimpleVideoPlay'; + +/** + * route param + */ +export const SOURCE: string = 'source'; + +/** + * video net address + */ +export const NET: string = '网络视频地址*****'; + +/** + * toast message + */ +export const MESSAGE: string = '请检查网络'; + +/** + * init time of string + */ +export const START_TIME: string = '00:00'; + +/** + * video net address + */ +export const ZERO_STR: string = '0'; + +/** + * time split + */ +export const SPLIT: string = ':'; + +/** + * default opacity + */ +export const DEFAULT_OPACITY: number = parseFloat('0.2'); + +/** + * slider small track thick ness + */ +export const SMALL_TRACK_THICK_NESS: number = 2; + +/** + * slider big track thick ness + */ +export const BIG_TRACK_THICK_NESS: number = 4; + +/** + * the divide of single and double + */ +export const COMMON_NUM_DOUBLE: number = 10; + +/** + * the minute of one hour + */ +export const COMMON_NUM_MINUTE: number = 60; + +/** + * common font weight + */ +export const COMMON_NUM_FONT_WEIGHT: number = 500; + +/** + * toast duration + */ +export const COMMON_NUM_DURATION: number = 5000; + +/** + * module list + */ +export const LIST: string[] = ['最近播放', '为你推荐']; + +/** + * full percent + */ +export const ALL_PERCENT: string = '100%'; + +/** + * Image Size + */ +export const IMAGE_SIZE: number = 24; + +/** + * component with or height percent + */ +export const enum STRING_PERCENT { + SLIDER_WITH = '56.7%', + NINETY_PERCENT = '90%', + INDEX_COMPONENT_WITH_PERCENT = '93.3%', + INDEX_SWIPER_HEIGHT_PERCENT = '24.1%', + INDEX_MODULE_HEIGHT_PERCENT = '25.8%', + INDEX_SWIPER_LEFT_RIGHT_MARGIN = '3.3%' +}; + +/** + * margin or font size + */ +export const enum MARGIN_FONT_SIZE { + FIRST_MARGIN = 12, + SECOND_MARGIN = 16, + THIRD_MARGIN = 18, + FOURTH_MARGIN = 24, + FIFTH_MARGIN = 50, + SIXTH_MARGIN = 94, + SEVENTH_MARGIN = 132 +}; + +/** + * video resource type + */ +export const enum VIDEO_TYPE { + INNER = 'inner', + NET = 'net' +}; + +/** + * Attribute Styles in a Stack Layout + */ +export const STACK_STYLE = { + IMAGE_Z_INDEX: 2, + PROGRESS_VALUE: 0, + PROGRESS_TOTAL: 100, + PROGRESS_STROKE_WIDTH: 15, + PROGRESS_SCALE_COUNT: 15, + PROGRESS_SCALE_WIDTH: 5, + PROGRESS_Z_INDEX: 1, + PROGRESS_WIDTH: 80, + PROGRESS_STEP: 10, + MILLI_SECONDS: 100 +} diff --git a/Media/SimpleVideo/entry/src/main/ets/entryability/EntryAbility.ts b/Media/SimpleVideo/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e282b1380f3e08147c4beba85029c250c0bad40 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023 Huawei Device 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 hilog from '@ohos.hilog'; +import Ability from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; + +export default class EntryAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/SimpleVideoIndex', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/Media/SimpleVideo/entry/src/main/ets/model/VideoControll.ets b/Media/SimpleVideo/entry/src/main/ets/model/VideoControll.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b8b6a525faa0e45817c8027dd7331a7994d6d70 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/model/VideoControll.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023 Huawei Device 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_NUM_MINUTE, COMMON_NUM_DOUBLE, ZERO_STR, SPLIT, STACK_STYLE } from '../common/constants/CommonConstants'; + +/** + * video component prepared callback + */ +export function prepared(event) { + this.durationTime = event.duration; + let second: number = event.duration % COMMON_NUM_MINUTE; + let min: number = parseInt((event.duration / COMMON_NUM_MINUTE).toString()); + let head = min < COMMON_NUM_DOUBLE ? `${ZERO_STR}${min}` : min; + let end = second < COMMON_NUM_DOUBLE ? `${ZERO_STR}${second}` : second; + this.durationStringTime = `${head}${SPLIT}${end}`; + this.flag = true; +}; + +/** + * video component finish callback + */ +export function finish() { + this.isPlay = false; + this.isOpacity = false; +}; + +/** + * video slider component onchange callback + */ +export function sliderOnchange(value: number, mode: SliderChangeMode) { + this.currentTime = parseInt(value.toString()); + this.controller.setCurrentTime(parseInt(value.toString()), SeekMode.Accurate); + if (mode === SliderChangeMode.Begin) { + this.isOpacity = false; + } + if (mode === SliderChangeMode.Moving) { + this.isOpacity = false; + } + if (mode === SliderChangeMode.End) { + this.isOpacity = true; + } +}; + +/** + * get video string of current time + * @param the number of current time + * @return the string of current time + */ +export function changeSliderTime(value: number): string { + let second: number = value % COMMON_NUM_MINUTE; + let min: number = parseInt((value / COMMON_NUM_MINUTE).toString()); + let head = min < COMMON_NUM_DOUBLE ? `${ZERO_STR}${min}` : min; + let end = second < COMMON_NUM_DOUBLE ? `${ZERO_STR}${second}` : second; + let nowTime = `${head}${SPLIT}${end}`; + return nowTime; +}; + +/** + * icon onclick callback + */ +export function iconOnclick() { + if (this.isPlay) { + this.controller.pause() + this.isPlay = false; + this.isOpacity = false; + return; + } + if(this.flag) { + this.controller.start(); + this.isPlay = true; + this.isOpacity = true; + } else { + let that = this; + that.isLoading = true; + // The video loading is not complete. The loading action is displayed. + let intervalLoading = setInterval(function() { + if (that.progressVal >= STACK_STYLE.PROGRESS_TOTAL) { + that.progressVal = 0; + } else { + that.progressVal += STACK_STYLE.PROGRESS_STEP; + } + }, STACK_STYLE.MILLI_SECONDS) + // The scheduled task determines whether the video loading is complete. + let intervalFlag = setInterval(function() { + if (that.flag) { + that.controller.start(); + that.isPlay = true; + that.isOpacity = true; + that.isLoading = false; + clearInterval(intervalFlag); + clearInterval(intervalLoading); + } + }, STACK_STYLE.MILLI_SECONDS); + } +}; \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/ets/pages/SimpleVideoIndex.ets b/Media/SimpleVideo/entry/src/main/ets/pages/SimpleVideoIndex.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4f4664dcee5daba082d7e855da0df8a5fd99e66 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/pages/SimpleVideoIndex.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { VideoModule } from '../view/IndexModule'; +import { SwiperVideo } from '../view/IndexSwiper'; +import { LIST, MARGIN_FONT_SIZE, ALL_PERCENT } from '../common/constants/CommonConstants'; + +/** + * The start index of the application + */ +@Entry +@Component +struct SimpleVideoIndex { + build() { + Column({ space: MARGIN_FONT_SIZE.FOURTH_MARGIN }) { + SwiperVideo() + List() { + ForEach(LIST, (item) => { + ListItem() { + VideoModule({ moduleName: item }).margin({ top: MARGIN_FONT_SIZE.FIRST_MARGIN }) + } + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Vertical) + .margin({ top: MARGIN_FONT_SIZE.THIRD_MARGIN }) + } + .width(ALL_PERCENT) + .height(ALL_PERCENT) + .backgroundColor($r("app.color.index_backgroundColor")) + } +} + diff --git a/Media/SimpleVideo/entry/src/main/ets/pages/SimpleVideoPlay.ets b/Media/SimpleVideo/entry/src/main/ets/pages/SimpleVideoPlay.ets new file mode 100644 index 0000000000000000000000000000000000000000..535675cdf541f98e4c660d1d4b5ad4d5d74f4e5c --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/pages/SimpleVideoPlay.ets @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import { VideoPlayer } from '../view/VideoPlayer'; +import { + MARGIN_FONT_SIZE, + COMMON_NUM_FONT_WEIGHT, + ALL_PERCENT, + STACK_STYLE +} from '../common/constants/CommonConstants'; + +/** + * second page + */ +@Entry +@Component +struct Play { + private source: string = router.getParams()['source']; + private startIconResource: Resource = $r('app.media.ic_public_play'); + private backIconResource: Resource = $r('app.media.ic_back'); + @Provide isPlay: boolean = false; + @Provide isOpacity: boolean = false; + controller: VideoController = new VideoController(); + @Provide isLoading: boolean = false; + @Provide progressVal: number = 0; + @Provide flag: boolean = false; + + onPageHide() { + this.controller.pause(); + this.isPlay = false; + } + + build() { + Column() { + Row() { + Image(this.backIconResource) + .width(MARGIN_FONT_SIZE.FOURTH_MARGIN) + .height(MARGIN_FONT_SIZE.FOURTH_MARGIN) + .margin({ left: MARGIN_FONT_SIZE.FOURTH_MARGIN }) + .onClick(() => { + router.back(); + }) + Text($r('app.string.back')) + .fontColor(Color.White) + .fontSize(MARGIN_FONT_SIZE.FOURTH_MARGIN) + .fontWeight(COMMON_NUM_FONT_WEIGHT) + .margin({ left: MARGIN_FONT_SIZE.FIRST_MARGIN }) + } + .width(ALL_PERCENT) + .margin({ left: MARGIN_FONT_SIZE.FIRST_MARGIN, top: MARGIN_FONT_SIZE.FIRST_MARGIN }) + .justifyContent(FlexAlign.Start) + + Stack() { + if (!this.isPlay && !this.isLoading) { + Image(this.startIconResource) + .width(MARGIN_FONT_SIZE.FIFTH_MARGIN) + .height(MARGIN_FONT_SIZE.FIFTH_MARGIN) + .zIndex(STACK_STYLE.IMAGE_Z_INDEX) + } + if (this.isLoading) { + Progress({ + value: STACK_STYLE.PROGRESS_VALUE, + total: STACK_STYLE.PROGRESS_TOTAL, + type: ProgressType.ScaleRing + }) + .color(Color.Grey) + .value(this.progressVal) + .width(STACK_STYLE.PROGRESS_WIDTH) + .style({ + strokeWidth: STACK_STYLE.PROGRESS_STROKE_WIDTH, + scaleCount: STACK_STYLE.PROGRESS_SCALE_COUNT, + scaleWidth: STACK_STYLE.PROGRESS_SCALE_WIDTH + }) + .zIndex(STACK_STYLE.PROGRESS_Z_INDEX) + } + VideoPlayer({ + source: this.source, + controller: this.controller + }) + .zIndex(0) + + } + } + .height(ALL_PERCENT) + .backgroundColor(Color.Black) + } +} + + + diff --git a/Media/SimpleVideo/entry/src/main/ets/view/IndexModule.ets b/Media/SimpleVideo/entry/src/main/ets/view/IndexModule.ets new file mode 100644 index 0000000000000000000000000000000000000000..3387a886cc55c61363a3ba7f40ae875162fd9599 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/view/IndexModule.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device 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 router from '@ohos.router'; +import { HORIZONTAL_VIDEOS } from '../viewmodel/VideoData'; +import { + MARGIN_FONT_SIZE, + STRING_PERCENT, + SECOND_PAGE, + NET +} from '../common/constants/CommonConstants'; + +/** + * The modules in index + */ +@Component +export struct VideoModule { + private moduleName: string; + + build() { + Column() { + Flex({ direction: FlexDirection.Row }) { + Text(this.moduleName) + .fontSize(MARGIN_FONT_SIZE.THIRD_MARGIN) + .fontWeight(FontWeight.Bolder) + } + .margin({ left: STRING_PERCENT.INDEX_SWIPER_LEFT_RIGHT_MARGIN, + bottom: MARGIN_FONT_SIZE.FIRST_MARGIN, + top: MARGIN_FONT_SIZE.FIRST_MARGIN }) + + List({ space: MARGIN_FONT_SIZE.FIRST_MARGIN }) { + ForEach(HORIZONTAL_VIDEOS, item => { + ListItem() { + HorizontalItem({ + imageSrc: item.image, + source: NET, + videoName: item.name + }) + } + }, item => JSON.stringify(item)) + } + .listDirection(Axis.Horizontal) + } + .margin({ + left: STRING_PERCENT.INDEX_SWIPER_LEFT_RIGHT_MARGIN, + right: STRING_PERCENT.INDEX_SWIPER_LEFT_RIGHT_MARGIN + }) + .height(STRING_PERCENT.INDEX_MODULE_HEIGHT_PERCENT) + .width(STRING_PERCENT.INDEX_COMPONENT_WITH_PERCENT) + .justifyContent(FlexAlign.Center) + .borderRadius(MARGIN_FONT_SIZE.FOURTH_MARGIN) + .borderStyle(BorderStyle.Solid) + .borderColor(Color.White) + .backgroundColor($r('app.color.white')) + } +} + +@Component +struct HorizontalItem { + private imageSrc: Resource; + private source: string; + private videoName: string; + + build() { + Column() { + Image(this.imageSrc) + .width(MARGIN_FONT_SIZE.SEVENTH_MARGIN) + .height(MARGIN_FONT_SIZE.SIXTH_MARGIN) + .onClick(() => { + router.pushUrl({ + url: SECOND_PAGE, + params: { source: this.source } + }); + }) + Text(this.videoName) + .margin({ top: MARGIN_FONT_SIZE.FIRST_MARGIN }) + .textAlign(TextAlign.Center) + .fontSize(MARGIN_FONT_SIZE.SECOND_MARGIN) + } + .justifyContent(FlexAlign.Center) + } +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/ets/view/IndexSwiper.ets b/Media/SimpleVideo/entry/src/main/ets/view/IndexSwiper.ets new file mode 100644 index 0000000000000000000000000000000000000000..95a15e6b32b527bff5e704035fe798ce0ac7d2cb --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/view/IndexSwiper.ets @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { SWIPER_VIDEOS } from '../viewmodel/VideoData'; +import { STRING_PERCENT, MARGIN_FONT_SIZE, SECOND_PAGE } from '../common/constants/CommonConstants'; + +/** + * Picture carousel component + */ +@Component +export struct SwiperVideo { + + build() { + Column() { + Swiper() { + ForEach(SWIPER_VIDEOS, item => { + SwiperItem({ imageSrc: item.image, source: $rawfile('videoTest.mp4') }) + }, item => JSON.stringify(item)) + } + .autoPlay(true) + } + .height(STRING_PERCENT.INDEX_SWIPER_HEIGHT_PERCENT) + .width(STRING_PERCENT.INDEX_COMPONENT_WITH_PERCENT) + .backgroundColor($r('app.color.white')) + .margin({ + left: STRING_PERCENT.INDEX_SWIPER_LEFT_RIGHT_MARGIN, + right: STRING_PERCENT.INDEX_SWIPER_LEFT_RIGHT_MARGIN, + top: MARGIN_FONT_SIZE.FOURTH_MARGIN + }) + } +} + +@Component +struct SwiperItem { + private imageSrc: Resource; + private source: Resource; + + build() { + Navigator({ target: SECOND_PAGE, type: NavigationType.Push }) { + Image(this.imageSrc) + .borderRadius(MARGIN_FONT_SIZE.FIRST_MARGIN) + } + .params({ source: this.source }) + } +} + diff --git a/Media/SimpleVideo/entry/src/main/ets/view/VideoPlaySlider.ets b/Media/SimpleVideo/entry/src/main/ets/view/VideoPlaySlider.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f8ff45c819199e25b11616a590b3d168b9e589d --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/view/VideoPlaySlider.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device 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 { iconOnclick, sliderOnchange } from '../model/VideoControll'; +import { + ALL_PERCENT, + MARGIN_FONT_SIZE, + SMALL_TRACK_THICK_NESS, + DEFAULT_OPACITY, + STRING_PERCENT, + BIG_TRACK_THICK_NESS, + IMAGE_SIZE +} from '../common/constants/CommonConstants'; + +/** + * video slider component + */ +@Component +export struct VideoSlider { + @Consume isOpacity: boolean; + private controller: VideoController; + @Consume currentStringTime: string; + @Consume currentTime: number; + @Consume durationTime: number ; + @Consume durationStringTime: string ; + @Consume isPlay: boolean; + @Consume flag: boolean; + @Consume isLoading: boolean; + @Consume progressVal: number; + + build() { + Row({ space: MARGIN_FONT_SIZE.FIRST_MARGIN }) { + Image(this.isPlay ? $r('app.media.ic_pause') : $r('app.media.ic_play')) + .width(IMAGE_SIZE) + .height(IMAGE_SIZE) + .margin({ left: MARGIN_FONT_SIZE.FIRST_MARGIN }) + .onClick(() => { + iconOnclick.call(this); + }) + Text(this.currentStringTime) + .fontSize(MARGIN_FONT_SIZE.SECOND_MARGIN) + .fontColor(Color.White) + .margin({ left: MARGIN_FONT_SIZE.FIRST_MARGIN }) + Slider({ + value: this.currentTime, + min: 0, + max: this.durationTime, + step: 1, + style: SliderStyle.OutSet + }) + .blockColor($r('app.color.white')) + .width(STRING_PERCENT.SLIDER_WITH) + .trackColor(Color.Gray) + .selectedColor($r("app.color.white")) + .showSteps(true) + .showTips(true) + .trackThickness(this.isOpacity ? SMALL_TRACK_THICK_NESS : BIG_TRACK_THICK_NESS) + .onChange((value: number, mode: SliderChangeMode) => { + sliderOnchange.call(this, value, mode); + }) + Text(this.durationStringTime) + .fontSize(MARGIN_FONT_SIZE.SECOND_MARGIN) + .margin({ right: MARGIN_FONT_SIZE.FIRST_MARGIN }) + .fontColor(Color.White) + } + .opacity(this.isOpacity ? DEFAULT_OPACITY : 1) + .width(ALL_PERCENT) + } +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/ets/view/VideoPlayer.ets b/Media/SimpleVideo/entry/src/main/ets/view/VideoPlayer.ets new file mode 100644 index 0000000000000000000000000000000000000000..72a4e36ae6d93637c87a11c2dbcd83293c74a343 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/view/VideoPlayer.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device 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 prompt from '@ohos.promptAction'; +import { VideoSlider } from '../view/VideoPlaySlider'; +import { prepared, finish, changeSliderTime } from '../model/VideoControll'; +import { + START_TIME, + STRING_PERCENT, + COMMON_NUM_DURATION, + MESSAGE, + ALL_PERCENT +} from '../common/constants/CommonConstants'; + +/** + * video controller component + */ +@Component +export struct VideoPlayer { + private source: string | Resource; + private controller: VideoController; + private previewUris: Resource = $r("app.media.ic_preview"); + @Provide currentTime: number = 0; + @Provide durationTime: number = 0; + @Provide durationStringTime: string = START_TIME; + @Provide currentStringTime: string = START_TIME; + @Consume isPlay: boolean; + @Consume isOpacity: boolean; + @Consume flag: boolean; + @Consume isLoading: boolean; + @Consume progressVal: number; + + build() { + Column() { + Video({ + src: this.source, + previewUri: this.previewUris, + controller: this.controller + }) + .width(ALL_PERCENT) + .height(STRING_PERCENT.NINETY_PERCENT) + .controls(false) + .autoPlay(false) + .objectFit(ImageFit.Contain) + .loop(false) + .onUpdate((event) => { + this.currentTime = event.time; + this.currentStringTime = changeSliderTime(this.currentTime); + }) + .onPrepared((event) => { + prepared.call(this, event); + }) + .onFinish(() => { + finish.call(this); + }) + .onError(() => { + prompt.showToast({ + duration: COMMON_NUM_DURATION, + message: MESSAGE + }); + }) + VideoSlider({ controller: this.controller }) + } + } +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/ets/viewmodel/VideoData.ets b/Media/SimpleVideo/entry/src/main/ets/viewmodel/VideoData.ets new file mode 100644 index 0000000000000000000000000000000000000000..977a48a7ef74c4ad8e8ab4df252d77a39885c836 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/ets/viewmodel/VideoData.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device 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. + */ + +export const SWIPER_VIDEOS: object[] = [ + { + "image": $r("app.media.ic_banner1") + }, + { + "image": $r("app.media.ic_banner2") + }, + { + "image": $r("app.media.ic_banner3") + } +]; + +export const HORIZONTAL_VIDEOS: object[] = [ + { + "id": 1, + "image": $r("app.media.ic_video_list0"), + "name": '视频1' + }, + { + "id": 2, + "image": $r("app.media.ic_video_list1"), + "name": '视频2' + }, + { + "id": 3, + "image": $r("app.media.ic_video_list2"), + "name": '视频3' + } +]; \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/module.json5 b/Media/SimpleVideo/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..af7fb1ff8920735b14ecc58d45415dd215ec1ff1 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/module.json5 @@ -0,0 +1,41 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "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/Media/SimpleVideo/entry/src/main/resources/base/element/color.json b/Media/SimpleVideo/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee82ab65d6a7f491104b848f0471039c771a146 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/resources/base/element/color.json @@ -0,0 +1,20 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "index_backgroundColor", + "value": "#F1F3F5" + }, + { + "name": "slide_selectedColor", + "value": "#FF4B6A" + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/resources/base/element/font.json b/Media/SimpleVideo/entry/src/main/resources/base/element/font.json new file mode 100644 index 0000000000000000000000000000000000000000..dd6ff21da5962688d176e8546a4e799d40e62f1c --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/resources/base/element/font.json @@ -0,0 +1,72 @@ +{ + "integer": [ + { + "name": "index_swiper_height", + "value": 188 + }, + { + "name": "index_module_height", + "value": 188 + }, + { + "name": "index_swiper_with", + "value":336 + }, + { + "name": "index_module_with", + "value": 336 + }, + { + "name": "index_swiper_imageRadius", + "value":12 + }, + { + "name": "index_module_Radius", + "value": 24 + }, + { + "name": "index_swiper_margin", + "value": 12 + }, + { + "name": "index_space", + "value": 24 + }, + { + "name": "module_name_size", + "value": 18 + }, + { + "name": "module_name_margin", + "value": 12 + }, + { + "name": "module_image_with", + "value": 132 + }, + { + "name": "module_image_height", + "value": 74 + }, + { + "name": "video_name_size", + "value": 16 + }, + { + "name": "time_size", + "value": 16 + }, + { + "name": "start_and_pause_size", + "value": 50 + }, + { + "name": "slider_with", + "value": 240 + }, + { + "name": "slider_height", + "value": 4 + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/resources/base/element/string.json b/Media/SimpleVideo/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e1d5bf6555f794a262c0d3e498ea2a396be4281c --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/resources/base/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SimpleVideo" + }, + { + "name": "secondPage", + "value": "pages/play" + }, + { + "name": "slider_startTime", + "value": "00:00" + }, + { + "name": "back", + "value": "视频" + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_back.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_back.png new file mode 100644 index 0000000000000000000000000000000000000000..6b9ca2aea8584524588e50b572b5f02af18c08f2 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_back.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner1.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner1.png new file mode 100644 index 0000000000000000000000000000000000000000..0e0e57de079e3ce15df5a9f190faaebec808031a Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner1.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner2.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner2.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf65100d86d66971e8c50e1b90358ecadc63963 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner2.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner3.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner3.png new file mode 100644 index 0000000000000000000000000000000000000000..c837169cf3dfcff2eb8f329b5456c1b84481aa61 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_banner3.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_pause.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_pause.png new file mode 100644 index 0000000000000000000000000000000000000000..07990e520e6960ce7bc1a9d47ce9e75a01fbce07 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_pause.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_play.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_play.png new file mode 100644 index 0000000000000000000000000000000000000000..91e153c9e6572922c5332c417c76bb8fc421d481 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_play.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_preview.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_preview.png new file mode 100644 index 0000000000000000000000000000000000000000..ba3582f30c7531c8ad138b36f3845e9c3c6e426c Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_preview.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_public_play.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_public_play.png new file mode 100644 index 0000000000000000000000000000000000000000..c58a07a8f4f788fdcf8015985b644314f0b9b070 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_public_play.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list0.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list0.png new file mode 100644 index 0000000000000000000000000000000000000000..da059a7a6cffaf4b36141ca26ee7019379bd6ff1 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list0.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list1.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list1.png new file mode 100644 index 0000000000000000000000000000000000000000..4d74291db4548d5f83591a69ba054b799860a5c5 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list1.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list2.png b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list2.png new file mode 100644 index 0000000000000000000000000000000000000000..f9b7d0c6f39d5efe855c8bdc1d5f2fbb661ee648 Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/ic_video_list2.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/media/icon.png b/Media/SimpleVideo/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/base/media/icon.png differ diff --git a/Media/SimpleVideo/entry/src/main/resources/base/profile/main_pages.json b/Media/SimpleVideo/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..22562243f0aa1da3da17a1725ca1b87995742d81 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/SimpleVideoIndex", + "pages/SimpleVideoPlay" + ] +} diff --git a/Media/SimpleVideo/entry/src/main/resources/en_US/element/string.json b/Media/SimpleVideo/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..57d9d0d577fac28035bae9e68ae3a14ca7dd2133 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SimpleVideo" + }, + { + "name": "secondPage", + "value": "pages/play" + }, + { + "name": "slider_startTime", + "value": "00:00" + }, + { + "name": "back", + "value": "video" + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/entry/src/main/resources/rawfile/videoTest.mp4 b/Media/SimpleVideo/entry/src/main/resources/rawfile/videoTest.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..677a493d1439dc61e8923758824aa3584ecd4adb Binary files /dev/null and b/Media/SimpleVideo/entry/src/main/resources/rawfile/videoTest.mp4 differ diff --git a/Media/SimpleVideo/entry/src/main/resources/zh_CN/element/string.json b/Media/SimpleVideo/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..973329adc9d56ae99e0ce7fd7bb3304f535e0023 --- /dev/null +++ b/Media/SimpleVideo/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "SimpleVideo" + }, + { + "name": "secondPage", + "value": "pages/play" + }, + { + "name": "slider_startTime", + "value": "00:00" + }, + { + "name": "back", + "value": "视频" + } + ] +} \ No newline at end of file diff --git a/Media/SimpleVideo/figures/1.gif b/Media/SimpleVideo/figures/1.gif new file mode 100644 index 0000000000000000000000000000000000000000..be5a1d041190ac4075c225361e89c3d250e76cb5 Binary files /dev/null and b/Media/SimpleVideo/figures/1.gif differ diff --git a/Media/SimpleVideo/figures/2.png b/Media/SimpleVideo/figures/2.png new file mode 100644 index 0000000000000000000000000000000000000000..f3a556f2455e749dbb4baec9d8796a77178bd371 Binary files /dev/null and b/Media/SimpleVideo/figures/2.png differ diff --git a/Media/SimpleVideo/figures/3.png b/Media/SimpleVideo/figures/3.png new file mode 100644 index 0000000000000000000000000000000000000000..ab6c8c83b0263e197eed4ead62618376c2f75a7b Binary files /dev/null and b/Media/SimpleVideo/figures/3.png differ diff --git a/Media/SimpleVideo/figures/4.png b/Media/SimpleVideo/figures/4.png new file mode 100644 index 0000000000000000000000000000000000000000..3653bab7fee50bcf7f8b0abff443266c5c941296 Binary files /dev/null and b/Media/SimpleVideo/figures/4.png differ diff --git a/Media/SimpleVideo/figures/5.png b/Media/SimpleVideo/figures/5.png new file mode 100644 index 0000000000000000000000000000000000000000..09f0c9d41cd40f913c9adf1bd67c91d25bfd1c84 Binary files /dev/null and b/Media/SimpleVideo/figures/5.png differ diff --git a/Media/SimpleVideo/figures/6.png b/Media/SimpleVideo/figures/6.png new file mode 100644 index 0000000000000000000000000000000000000000..78d144785e5edc350e8c56187ba7abbda42261ed Binary files /dev/null and b/Media/SimpleVideo/figures/6.png differ diff --git a/Media/SimpleVideo/figures/zh-cn_image_0000001405854998.png b/Media/SimpleVideo/figures/zh-cn_image_0000001405854998.png new file mode 100644 index 0000000000000000000000000000000000000000..7b00b63e899143d879c0dd88290bec64580169ae Binary files /dev/null and b/Media/SimpleVideo/figures/zh-cn_image_0000001405854998.png differ diff --git "a/Media/SimpleVideo/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" "b/Media/SimpleVideo/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" new file mode 100644 index 0000000000000000000000000000000000000000..0d4a2fc153a9ae074efdb8d8f7579ad73501a98c Binary files /dev/null and "b/Media/SimpleVideo/figures/\345\275\251\345\270\246\345\212\250\346\225\210.gif" differ diff --git a/Media/SimpleVideo/hvigor/hvigor-config.json5 b/Media/SimpleVideo/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ff688122467308d3cd299c5b2f36be03fb84f4b0 --- /dev/null +++ b/Media/SimpleVideo/hvigor/hvigor-config.json5 @@ -0,0 +1,6 @@ +{ + "hvigorVersion": "2.0.0", + "dependencies": { + "@ohos/hvigor-ohos-plugin": "2.0.0" + } +} diff --git a/Media/SimpleVideo/hvigor/hvigor-wrapper.js b/Media/SimpleVideo/hvigor/hvigor-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..99a253e5693afb815e3402109e3a785aa7a42c09 --- /dev/null +++ b/Media/SimpleVideo/hvigor/hvigor-wrapper.js @@ -0,0 +1 @@ +"use strict";var u=require("fs"),e=require("path"),t=require("os"),r=require("crypto"),n=require("child_process"),i=require("constants"),o=require("stream"),D=require("util"),c=require("assert");function a(u){return u&&"object"==typeof u&&"default"in u?u:{default:u}}var s=a(u),E=a(e),f=a(t),l=a(r),C=a(n),F=a(i),d=a(o),A=a(D),p=a(c),y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},m={},B={},_=y&&y.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(B,"__esModule",{value:!0}),B.isMac=B.isLinux=B.isWindows=void 0;const O=_(f.default),S="Windows_NT",v="Linux",w="Darwin";B.isWindows=function(){return O.default.type()===S},B.isLinux=function(){return O.default.type()===v},B.isMac=function(){return O.default.type()===w};var P={},g=y&&y.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),b=y&&y.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),N=y&&y.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&g(e,u,t);return b(e,u),e};Object.defineProperty(P,"__esModule",{value:!0}),P.hash=void 0;const R=N(l.default);P.hash=function(u,e="md5"){return R.createHash(e).update(u,"utf-8").digest("hex")},function(u){var e=y&&y.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),t=y&&y.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),r=y&&y.__importStar||function(u){if(u&&u.__esModule)return u;var r={};if(null!=u)for(var n in u)"default"!==n&&Object.prototype.hasOwnProperty.call(u,n)&&e(r,u,n);return t(r,u),r};Object.defineProperty(u,"__esModule",{value:!0}),u.HVIGOR_BOOT_JS_FILE_PATH=u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.HVIGOR_PROJECT_WRAPPER_HOME=u.HVIGOR_PROJECT_NAME=u.HVIGOR_PROJECT_ROOT_DIR=u.HVIGOR_PROJECT_CACHES_HOME=u.HVIGOR_PNPM_STORE_PATH=u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.HVIGOR_WRAPPER_TOOLS_HOME=u.HVIGOR_USER_HOME=u.DEFAULT_PACKAGE_JSON=u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=u.NPM_TOOL=u.PNPM_TOOL=u.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const n=r(E.default),i=r(f.default),o=B,D=P;u.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",u.PNPM_TOOL=(0,o.isWindows)()?"pnpm.cmd":"pnpm",u.NPM_TOOL=(0,o.isWindows)()?"npm.cmd":"npm",u.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",u.DEFAULT_PACKAGE_JSON="package.json",u.HVIGOR_USER_HOME=n.resolve(i.homedir(),".hvigor"),u.HVIGOR_WRAPPER_TOOLS_HOME=n.resolve(u.HVIGOR_USER_HOME,"wrapper","tools"),u.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.resolve(u.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",u.PNPM_TOOL),u.HVIGOR_PNPM_STORE_PATH=n.resolve(u.HVIGOR_USER_HOME,"caches"),u.HVIGOR_PROJECT_CACHES_HOME=n.resolve(u.HVIGOR_USER_HOME,"project_caches"),u.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),u.HVIGOR_PROJECT_NAME=n.basename((0,D.hash)(u.HVIGOR_PROJECT_ROOT_DIR)),u.HVIGOR_PROJECT_WRAPPER_HOME=n.resolve(u.HVIGOR_PROJECT_ROOT_DIR,"hvigor"),u.HVIGOR_PROJECT_DEPENDENCIES_HOME=n.resolve(u.HVIGOR_PROJECT_CACHES_HOME,u.HVIGOR_PROJECT_NAME,"workspace"),u.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,u.DEFAULT_PACKAGE_JSON),u.HVIGOR_BOOT_JS_FILE_PATH=n.resolve(u.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(m);var I={},T={};Object.defineProperty(T,"__esModule",{value:!0}),T.logErrorAndExit=void 0,T.logErrorAndExit=function(u){u instanceof Error?console.error(u.message):console.error(u),process.exit(-1)};var k=y&&y.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),H=y&&y.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),x=y&&y.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&k(e,u,t);return H(e,u),e};Object.defineProperty(I,"__esModule",{value:!0}),I.parseJsonText=I.executeCommand=I.getNpmPath=I.hasNpmPackInPaths=void 0;const M=C.default,J=x(f.default),j=x(E.default),G=m,L=T;I.hasNpmPackInPaths=function(u,e){try{return require.resolve(u,{paths:[...e]}),!0}catch(u){return!1}},I.getNpmPath=function(){const u=process.execPath;return j.join(j.dirname(u),G.NPM_TOOL)},I.executeCommand=function(u,e,t){0!==(0,M.spawnSync)(u,e,t).status&&(0,L.logErrorAndExit)(`Error: ${u} ${e} execute failed.See above for details.`)},I.parseJsonText=function(u,e){try{return JSON.parse(u)}catch(u){const t=`Error: ${e} is not the correct JSON/JSON5 format.`;if(u instanceof SyntaxError){const r=u.message.split("at ");2===r.length&&t.concat(`${r[0].trim()}${J.EOL}\t at ${e}:${r[1].trim()}`)}(0,L.logErrorAndExit)(t)}};var V={},$={},U={};Object.defineProperty(U,"__esModule",{value:!0}),U.Unicode=void 0;class W{}U.Unicode=W,W.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,W.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]/,W.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($,"__esModule",{value:!0}),$.JudgeUtil=void 0;const q=U;$.JudgeUtil=class{static isIgnoreChar(u){return"string"==typeof u&&("\t"===u||"\v"===u||"\f"===u||" "===u||" "===u||"\ufeff"===u||"\n"===u||"\r"===u||"\u2028"===u||"\u2029"===u)}static isSpaceSeparator(u){return"string"==typeof u&&q.Unicode.Space_Separator.test(u)}static isIdStartChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||q.Unicode.ID_Start.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||q.Unicode.ID_Continue.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var K={},Y={fromCallback:function(u){return Object.defineProperty((function(...e){if("function"!=typeof e[e.length-1])return new Promise(((t,r)=>{u.call(this,...e,((u,e)=>null!=u?r(u):t(e)))}));u.apply(this,e)}),"name",{value:u.name})},fromPromise:function(u){return Object.defineProperty((function(...e){const t=e[e.length-1];if("function"!=typeof t)return u.apply(this,e);u.apply(this,e.slice(0,-1)).then((u=>t(null,u)),t)}),"name",{value:u.name})}},z=F.default,Z=process.cwd,X=null,Q=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return X||(X=Z.call(process)),X};try{process.cwd()}catch(u){}if("function"==typeof process.chdir){var uu=process.chdir;process.chdir=function(u){X=null,uu.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,uu)}var eu=function(u){z.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(u){u.lchmod=function(e,t,r){u.open(e,z.O_WRONLY|z.O_SYMLINK,t,(function(e,n){e?r&&r(e):u.fchmod(n,t,(function(e){u.close(n,(function(u){r&&r(e||u)}))}))}))},u.lchmodSync=function(e,t){var r,n=u.openSync(e,z.O_WRONLY|z.O_SYMLINK,t),i=!0;try{r=u.fchmodSync(n,t),i=!1}finally{if(i)try{u.closeSync(n)}catch(u){}else u.closeSync(n)}return r}}(u);u.lutimes||function(u){z.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(e,t,r,n){u.open(e,z.O_SYMLINK,(function(e,i){e?n&&n(e):u.futimes(i,t,r,(function(e){u.close(i,(function(u){n&&n(e||u)}))}))}))},u.lutimesSync=function(e,t,r){var n,i=u.openSync(e,z.O_SYMLINK),o=!0;try{n=u.futimesSync(i,t,r),o=!1}finally{if(o)try{u.closeSync(i)}catch(u){}else u.closeSync(i)}return n}):u.futimes&&(u.lutimes=function(u,e,t,r){r&&process.nextTick(r)},u.lutimesSync=function(){})}(u);u.chown=r(u.chown),u.fchown=r(u.fchown),u.lchown=r(u.lchown),u.chmod=e(u.chmod),u.fchmod=e(u.fchmod),u.lchmod=e(u.lchmod),u.chownSync=n(u.chownSync),u.fchownSync=n(u.fchownSync),u.lchownSync=n(u.lchownSync),u.chmodSync=t(u.chmodSync),u.fchmodSync=t(u.fchmodSync),u.lchmodSync=t(u.lchmodSync),u.stat=i(u.stat),u.fstat=i(u.fstat),u.lstat=i(u.lstat),u.statSync=o(u.statSync),u.fstatSync=o(u.fstatSync),u.lstatSync=o(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(u,e,t){t&&process.nextTick(t)},u.lchmodSync=function(){});u.chown&&!u.lchown&&(u.lchown=function(u,e,t,r){r&&process.nextTick(r)},u.lchownSync=function(){});"win32"===Q&&(u.rename="function"!=typeof u.rename?u.rename:function(e){function t(t,r,n){var i=Date.now(),o=0;e(t,r,(function D(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-i<6e4)return setTimeout((function(){u.stat(r,(function(u,i){u&&"ENOENT"===u.code?e(t,r,D):n(c)}))}),o),void(o<100&&(o+=10));n&&n(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.rename));function e(e){return e?function(t,r,n){return e.call(u,t,r,(function(u){D(u)&&(u=null),n&&n.apply(this,arguments)}))}:e}function t(e){return e?function(t,r){try{return e.call(u,t,r)}catch(u){if(!D(u))throw u}}:e}function r(e){return e?function(t,r,n,i){return e.call(u,t,r,n,(function(u){D(u)&&(u=null),i&&i.apply(this,arguments)}))}:e}function n(e){return e?function(t,r,n){try{return e.call(u,t,r,n)}catch(u){if(!D(u))throw u}}:e}function i(e){return e?function(t,r,n){function i(u,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),n&&n.apply(this,arguments)}return"function"==typeof r&&(n=r,r=null),r?e.call(u,t,r,i):e.call(u,t,i)}:e}function o(e){return e?function(t,r){var n=r?e.call(u,t,r):e.call(u,t);return n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),n}:e}function D(u){return!u||("ENOSYS"===u.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==u.code&&"EPERM"!==u.code))}u.read="function"!=typeof u.read?u.read:function(e){function t(t,r,n,i,o,D){var c;if(D&&"function"==typeof D){var a=0;c=function(s,E,f){if(s&&"EAGAIN"===s.code&&a<10)return a++,e.call(u,t,r,n,i,o,c);D.apply(this,arguments)}}return e.call(u,t,r,n,i,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(u.read),u.readSync="function"!=typeof u.readSync?u.readSync:(c=u.readSync,function(e,t,r,n,i){for(var o=0;;)try{return c.call(u,e,t,r,n,i)}catch(u){if("EAGAIN"===u.code&&o<10){o++;continue}throw u}});var c};var tu=d.default.Stream,ru=function(u){return{ReadStream:function e(t,r){if(!(this instanceof e))return new e(t,r);tu.call(this);var n=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var i=Object.keys(r),o=0,D=i.length;othis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){n._read()}));u.open(this.path,this.flags,this.mode,(function(u,e){if(u)return n.emit("error",u),void(n.readable=!1);n.fd=e,n.emit("open",e),n._read()}))},WriteStream:function e(t,r){if(!(this instanceof e))return new e(t,r);tu.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var n=Object.keys(r),i=0,o=n.length;i= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=u.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var nu=function(u){if(null===u||"object"!=typeof u)return u;if(u instanceof Object)var e={__proto__:iu(u)};else e=Object.create(null);return Object.getOwnPropertyNames(u).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))})),e},iu=Object.getPrototypeOf||function(u){return u.__proto__};var ou,Du,cu=s.default,au=eu,su=ru,Eu=nu,fu=A.default;function lu(u,e){Object.defineProperty(u,ou,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(ou=Symbol.for("graceful-fs.queue"),Du=Symbol.for("graceful-fs.previous")):(ou="___graceful-fs.queue",Du="___graceful-fs.previous");var Cu=function(){};if(fu.debuglog?Cu=fu.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Cu=function(){var u=fu.format.apply(fu,arguments);u="GFS4: "+u.split(/\n/).join("\nGFS4: "),console.error(u)}),!cu[ou]){var Fu=y[ou]||[];lu(cu,Fu),cu.close=function(u){function e(e,t){return u.call(cu,e,(function(u){u||hu(),"function"==typeof t&&t.apply(this,arguments)}))}return Object.defineProperty(e,Du,{value:u}),e}(cu.close),cu.closeSync=function(u){function e(e){u.apply(cu,arguments),hu()}return Object.defineProperty(e,Du,{value:u}),e}(cu.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Cu(cu[ou]),p.default.equal(cu[ou].length,0)}))}y[ou]||lu(y,cu[ou]);var du,Au=pu(Eu(cu));function pu(u){au(u),u.gracefulify=pu,u.createReadStream=function(e,t){return new u.ReadStream(e,t)},u.createWriteStream=function(e,t){return new u.WriteStream(e,t)};var e=u.readFile;u.readFile=function(u,t,r){"function"==typeof t&&(r=t,t=null);return function u(t,r,n,i){return e(t,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof n&&n.apply(this,arguments):yu([u,[t,r,n],e,i||Date.now(),Date.now()])}))}(u,t,r)};var t=u.writeFile;u.writeFile=function(u,e,r,n){"function"==typeof r&&(n=r,r=null);return function u(e,r,n,i,o){return t(e,r,n,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):yu([u,[e,r,n,i],t,o||Date.now(),Date.now()])}))}(u,e,r,n)};var r=u.appendFile;r&&(u.appendFile=function(u,e,t,n){"function"==typeof t&&(n=t,t=null);return function u(e,t,n,i,o){return r(e,t,n,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof i&&i.apply(this,arguments):yu([u,[e,t,n,i],r,o||Date.now(),Date.now()])}))}(u,e,t,n)});var n=u.copyFile;n&&(u.copyFile=function(u,e,t,r){"function"==typeof t&&(r=t,t=0);return function u(e,t,r,i,o){return n(e,t,r,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof i&&i.apply(this,arguments):yu([u,[e,t,r,i],n,o||Date.now(),Date.now()])}))}(u,e,t,r)});var i=u.readdir;u.readdir=function(u,e,t){"function"==typeof e&&(t=e,e=null);var r=o.test(process.version)?function(u,e,t,r){return i(u,n(u,e,t,r))}:function(u,e,t,r){return i(u,e,n(u,e,t,r))};return r(u,e,t);function n(u,e,t,n){return function(i,o){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?(o&&o.sort&&o.sort(),"function"==typeof t&&t.call(this,i,o)):yu([r,[u,e,t],i,n||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var D=su(u);f=D.ReadStream,l=D.WriteStream}var c=u.ReadStream;c&&(f.prototype=Object.create(c.prototype),f.prototype.open=function(){var u=this;F(u.path,u.flags,u.mode,(function(e,t){e?(u.autoClose&&u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t),u.read())}))});var a=u.WriteStream;a&&(l.prototype=Object.create(a.prototype),l.prototype.open=function(){var u=this;F(u.path,u.flags,u.mode,(function(e,t){e?(u.destroy(),u.emit("error",e)):(u.fd=t,u.emit("open",t))}))}),Object.defineProperty(u,"ReadStream",{get:function(){return f},set:function(u){f=u},enumerable:!0,configurable:!0}),Object.defineProperty(u,"WriteStream",{get:function(){return l},set:function(u){l=u},enumerable:!0,configurable:!0});var s=f;Object.defineProperty(u,"FileReadStream",{get:function(){return s},set:function(u){s=u},enumerable:!0,configurable:!0});var E=l;function f(u,e){return this instanceof f?(c.apply(this,arguments),this):f.apply(Object.create(f.prototype),arguments)}function l(u,e){return this instanceof l?(a.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}Object.defineProperty(u,"FileWriteStream",{get:function(){return E},set:function(u){E=u},enumerable:!0,configurable:!0});var C=u.open;function F(u,e,t,r){return"function"==typeof t&&(r=t,t=null),function u(e,t,r,n,i){return C(e,t,r,(function(o,D){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof n&&n.apply(this,arguments):yu([u,[e,t,r,n],o,i||Date.now(),Date.now()])}))}(u,e,t,r)}return u.open=F,u}function yu(u){Cu("ENQUEUE",u[0].name,u[1]),cu[ou].push(u),mu()}function hu(){for(var u=Date.now(),e=0;e2&&(cu[ou][e][3]=u,cu[ou][e][4]=u);mu()}function mu(){if(clearTimeout(du),du=void 0,0!==cu[ou].length){var u=cu[ou].shift(),e=u[0],t=u[1],r=u[2],n=u[3],i=u[4];if(void 0===n)Cu("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){Cu("TIMEOUT",e.name,t);var o=t.pop();"function"==typeof o&&o.call(null,r)}else{var D=Date.now()-i,c=Math.max(i-n,1);D>=Math.min(1.2*c,100)?(Cu("RETRY",e.name,t),e.apply(null,t.concat([n]))):cu[ou].push(u)}void 0===du&&(du=setTimeout(mu,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!cu.__patched&&(Au=pu(cu),cu.__patched=!0),function(u){const e=Y.fromCallback,t=Au,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((u=>"function"==typeof t[u]));Object.assign(u,t),r.forEach((r=>{u[r]=e(t[r])})),u.exists=function(u,e){return"function"==typeof e?t.exists(u,e):new Promise((e=>t.exists(u,e)))},u.read=function(u,e,r,n,i,o){return"function"==typeof o?t.read(u,e,r,n,i,o):new Promise(((o,D)=>{t.read(u,e,r,n,i,((u,e,t)=>{if(u)return D(u);o({bytesRead:e,buffer:t})}))}))},u.write=function(u,e,...r){return"function"==typeof r[r.length-1]?t.write(u,e,...r):new Promise(((n,i)=>{t.write(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffer:t})}))}))},"function"==typeof t.writev&&(u.writev=function(u,e,...r){return"function"==typeof r[r.length-1]?t.writev(u,e,...r):new Promise(((n,i)=>{t.writev(u,e,...r,((u,e,t)=>{if(u)return i(u);n({bytesWritten:e,buffers:t})}))}))}),"function"==typeof t.realpath.native?u.realpath.native=e(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(K);var Bu={},_u={};const Ou=E.default;_u.checkPath=function(u){if("win32"===process.platform){if(/[<>:"|?*]/.test(u.replace(Ou.parse(u).root,""))){const e=new Error(`Path contains invalid characters: ${u}`);throw e.code="EINVAL",e}}};const Su=K,{checkPath:vu}=_u,wu=u=>"number"==typeof u?u:{mode:511,...u}.mode;Bu.makeDir=async(u,e)=>(vu(u),Su.mkdir(u,{mode:wu(e),recursive:!0})),Bu.makeDirSync=(u,e)=>(vu(u),Su.mkdirSync(u,{mode:wu(e),recursive:!0}));const Pu=Y.fromPromise,{makeDir:gu,makeDirSync:bu}=Bu,Nu=Pu(gu);var Ru={mkdirs:Nu,mkdirsSync:bu,mkdirp:Nu,mkdirpSync:bu,ensureDir:Nu,ensureDirSync:bu};const Iu=Y.fromPromise,Tu=K;var ku={pathExists:Iu((function(u){return Tu.access(u).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Tu.existsSync};const Hu=Au;var xu=function(u,e,t,r){Hu.open(u,"r+",((u,n)=>{if(u)return r(u);Hu.futimes(n,e,t,(u=>{Hu.close(n,(e=>{r&&r(u||e)}))}))}))},Mu=function(u,e,t){const r=Hu.openSync(u,"r+");return Hu.futimesSync(r,e,t),Hu.closeSync(r)};const Ju=K,ju=E.default,Gu=A.default;function Lu(u,e,t){const r=t.dereference?u=>Ju.stat(u,{bigint:!0}):u=>Ju.lstat(u,{bigint:!0});return Promise.all([r(u),r(e).catch((u=>{if("ENOENT"===u.code)return null;throw u}))]).then((([u,e])=>({srcStat:u,destStat:e})))}function Vu(u,e){return e.ino&&e.dev&&e.ino===u.ino&&e.dev===u.dev}function $u(u,e){const t=ju.resolve(u).split(ju.sep).filter((u=>u)),r=ju.resolve(e).split(ju.sep).filter((u=>u));return t.reduce(((u,e,t)=>u&&r[t]===e),!0)}function Uu(u,e,t){return`Cannot ${t} '${u}' to a subdirectory of itself, '${e}'.`}var Wu={checkPaths:function(u,e,t,r,n){Gu.callbackify(Lu)(u,e,r,((r,i)=>{if(r)return n(r);const{srcStat:o,destStat:D}=i;if(D){if(Vu(o,D)){const r=ju.basename(u),i=ju.basename(e);return"move"===t&&r!==i&&r.toLowerCase()===i.toLowerCase()?n(null,{srcStat:o,destStat:D,isChangingCase:!0}):n(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!D.isDirectory())return n(new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`));if(!o.isDirectory()&&D.isDirectory())return n(new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`))}return o.isDirectory()&&$u(u,e)?n(new Error(Uu(u,e,t))):n(null,{srcStat:o,destStat:D})}))},checkPathsSync:function(u,e,t,r){const{srcStat:n,destStat:i}=function(u,e,t){let r;const n=t.dereference?u=>Ju.statSync(u,{bigint:!0}):u=>Ju.lstatSync(u,{bigint:!0}),i=n(u);try{r=n(e)}catch(u){if("ENOENT"===u.code)return{srcStat:i,destStat:null};throw u}return{srcStat:i,destStat:r}}(u,e,r);if(i){if(Vu(n,i)){const r=ju.basename(u),o=ju.basename(e);if("move"===t&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:n,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${u}'.`);if(!n.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${u}'.`)}if(n.isDirectory()&&$u(u,e))throw new Error(Uu(u,e,t));return{srcStat:n,destStat:i}},checkParentPaths:function u(e,t,r,n,i){const o=ju.resolve(ju.dirname(e)),D=ju.resolve(ju.dirname(r));if(D===o||D===ju.parse(D).root)return i();Ju.stat(D,{bigint:!0},((o,c)=>o?"ENOENT"===o.code?i():i(o):Vu(t,c)?i(new Error(Uu(e,r,n))):u(e,t,D,n,i)))},checkParentPathsSync:function u(e,t,r,n){const i=ju.resolve(ju.dirname(e)),o=ju.resolve(ju.dirname(r));if(o===i||o===ju.parse(o).root)return;let D;try{D=Ju.statSync(o,{bigint:!0})}catch(u){if("ENOENT"===u.code)return;throw u}if(Vu(t,D))throw new Error(Uu(e,r,n));return u(e,t,o,n)},isSrcSubdir:$u,areIdentical:Vu};const qu=Au,Ku=E.default,Yu=Ru.mkdirs,zu=ku.pathExists,Zu=xu,Xu=Wu;function Qu(u,e,t,r,n){const i=Ku.dirname(t);zu(i,((o,D)=>o?n(o):D?ee(u,e,t,r,n):void Yu(i,(i=>i?n(i):ee(u,e,t,r,n)))))}function ue(u,e,t,r,n,i){Promise.resolve(n.filter(t,r)).then((o=>o?u(e,t,r,n,i):i()),(u=>i(u)))}function ee(u,e,t,r,n){(r.dereference?qu.stat:qu.lstat)(e,((i,o)=>i?n(i):o.isDirectory()?function(u,e,t,r,n,i){return e?ie(t,r,n,i):function(u,e,t,r,n){qu.mkdir(t,(i=>{if(i)return n(i);ie(e,t,r,(e=>e?n(e):ne(t,u,n)))}))}(u.mode,t,r,n,i)}(o,u,e,t,r,n):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?function(u,e,t,r,n,i){return e?function(u,e,t,r,n){if(!r.overwrite)return r.errorOnExist?n(new Error(`'${t}' already exists`)):n();qu.unlink(t,(i=>i?n(i):te(u,e,t,r,n)))}(u,t,r,n,i):te(u,t,r,n,i)}(o,u,e,t,r,n):o.isSymbolicLink()?function(u,e,t,r,n){qu.readlink(e,((e,i)=>e?n(e):(r.dereference&&(i=Ku.resolve(process.cwd(),i)),u?void qu.readlink(t,((e,o)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?qu.symlink(i,t,n):n(e):(r.dereference&&(o=Ku.resolve(process.cwd(),o)),Xu.isSrcSubdir(i,o)?n(new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`)):u.isDirectory()&&Xu.isSrcSubdir(o,i)?n(new Error(`Cannot overwrite '${o}' with '${i}'.`)):function(u,e,t){qu.unlink(e,(r=>r?t(r):qu.symlink(u,e,t)))}(i,t,n)))):qu.symlink(i,t,n))))}(u,e,t,r,n):o.isSocket()?n(new Error(`Cannot copy a socket file: ${e}`)):o.isFIFO()?n(new Error(`Cannot copy a FIFO pipe: ${e}`)):n(new Error(`Unknown file: ${e}`))))}function te(u,e,t,r,n){qu.copyFile(e,t,(i=>i?n(i):r.preserveTimestamps?function(u,e,t,r){if(function(u){return 0==(128&u)}(u))return function(u,e,t){return ne(u,128|e,t)}(t,u,(n=>n?r(n):re(u,e,t,r)));return re(u,e,t,r)}(u.mode,e,t,n):ne(t,u.mode,n)))}function re(u,e,t,r){!function(u,e,t){qu.stat(u,((u,r)=>u?t(u):Zu(e,r.atime,r.mtime,t)))}(e,t,(e=>e?r(e):ne(t,u,r)))}function ne(u,e,t){return qu.chmod(u,e,t)}function ie(u,e,t,r){qu.readdir(u,((n,i)=>n?r(n):oe(i,u,e,t,r)))}function oe(u,e,t,r,n){const i=u.pop();return i?function(u,e,t,r,n,i){const o=Ku.join(t,e),D=Ku.join(r,e);Xu.checkPaths(o,D,"copy",n,((e,c)=>{if(e)return i(e);const{destStat:a}=c;!function(u,e,t,r,n){r.filter?ue(ee,u,e,t,r,n):ee(u,e,t,r,n)}(a,o,D,n,(e=>e?i(e):oe(u,t,r,n,i)))}))}(u,i,e,t,r,n):n()}var De=function(u,e,t,r){"function"!=typeof t||r?"function"==typeof t&&(t={filter:t}):(r=t,t={}),r=r||function(){},(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),Xu.checkPaths(u,e,"copy",t,((n,i)=>{if(n)return r(n);const{srcStat:o,destStat:D}=i;Xu.checkParentPaths(u,o,e,"copy",(n=>n?r(n):t.filter?ue(Qu,D,u,e,t,r):Qu(D,u,e,t,r)))}))};const ce=Au,ae=E.default,se=Ru.mkdirsSync,Ee=Mu,fe=Wu;function le(u,e,t,r){const n=(r.dereference?ce.statSync:ce.lstatSync)(e);if(n.isDirectory())return function(u,e,t,r,n){return e?de(t,r,n):function(u,e,t,r){return ce.mkdirSync(t),de(e,t,r),Fe(t,u)}(u.mode,t,r,n)}(n,u,e,t,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return function(u,e,t,r,n){return e?function(u,e,t,r){if(r.overwrite)return ce.unlinkSync(t),Ce(u,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}(u,t,r,n):Ce(u,t,r,n)}(n,u,e,t,r);if(n.isSymbolicLink())return function(u,e,t,r){let n=ce.readlinkSync(e);r.dereference&&(n=ae.resolve(process.cwd(),n));if(u){let u;try{u=ce.readlinkSync(t)}catch(u){if("EINVAL"===u.code||"UNKNOWN"===u.code)return ce.symlinkSync(n,t);throw u}if(r.dereference&&(u=ae.resolve(process.cwd(),u)),fe.isSrcSubdir(n,u))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${u}'.`);if(ce.statSync(t).isDirectory()&&fe.isSrcSubdir(u,n))throw new Error(`Cannot overwrite '${u}' with '${n}'.`);return function(u,e){return ce.unlinkSync(e),ce.symlinkSync(u,e)}(n,t)}return ce.symlinkSync(n,t)}(u,e,t,r);if(n.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(n.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function Ce(u,e,t,r){return ce.copyFileSync(e,t),r.preserveTimestamps&&function(u,e,t){(function(u){return 0==(128&u)})(u)&&function(u,e){Fe(u,128|e)}(t,u);(function(u,e){const t=ce.statSync(u);Ee(e,t.atime,t.mtime)})(e,t)}(u.mode,e,t),Fe(t,u.mode)}function Fe(u,e){return ce.chmodSync(u,e)}function de(u,e,t){ce.readdirSync(u).forEach((r=>function(u,e,t,r){const n=ae.join(e,u),i=ae.join(t,u),{destStat:o}=fe.checkPathsSync(n,i,"copy",r);return function(u,e,t,r){if(!r.filter||r.filter(e,t))return le(u,e,t,r)}(o,n,i,r)}(r,u,e,t)))}var Ae=function(u,e,t){"function"==typeof t&&(t={filter:t}),(t=t||{}).clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:n}=fe.checkPathsSync(u,e,"copy",t);return fe.checkParentPathsSync(u,r,e,"copy"),function(u,e,t,r){if(r.filter&&!r.filter(e,t))return;const n=ae.dirname(t);ce.existsSync(n)||se(n);return le(u,e,t,r)}(n,u,e,t)};var pe={copy:(0,Y.fromCallback)(De),copySync:Ae};const ye=Au,he=E.default,me=p.default,Be="win32"===process.platform;function _e(u){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{u[e]=u[e]||ye[e],u[e+="Sync"]=u[e]||ye[e]})),u.maxBusyTries=u.maxBusyTries||3}function Oe(u,e,t){let r=0;"function"==typeof e&&(t=e,e={}),me(u,"rimraf: missing path"),me.strictEqual(typeof u,"string","rimraf: path should be a string"),me.strictEqual(typeof t,"function","rimraf: callback function required"),me(e,"rimraf: invalid options argument provided"),me.strictEqual(typeof e,"object","rimraf: options should be object"),_e(e),Se(u,e,(function n(i){if(i){if(("EBUSY"===i.code||"ENOTEMPTY"===i.code||"EPERM"===i.code)&&rSe(u,e,n)),100*r)}"ENOENT"===i.code&&(i=null)}t(i)}))}function Se(u,e,t){me(u),me(e),me("function"==typeof t),e.lstat(u,((r,n)=>r&&"ENOENT"===r.code?t(null):r&&"EPERM"===r.code&&Be?ve(u,e,r,t):n&&n.isDirectory()?Pe(u,e,r,t):void e.unlink(u,(r=>{if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return Be?ve(u,e,r,t):Pe(u,e,r,t);if("EISDIR"===r.code)return Pe(u,e,r,t)}return t(r)}))))}function ve(u,e,t,r){me(u),me(e),me("function"==typeof r),e.chmod(u,438,(n=>{n?r("ENOENT"===n.code?null:t):e.stat(u,((n,i)=>{n?r("ENOENT"===n.code?null:t):i.isDirectory()?Pe(u,e,t,r):e.unlink(u,r)}))}))}function we(u,e,t){let r;me(u),me(e);try{e.chmodSync(u,438)}catch(u){if("ENOENT"===u.code)return;throw t}try{r=e.statSync(u)}catch(u){if("ENOENT"===u.code)return;throw t}r.isDirectory()?be(u,e,t):e.unlinkSync(u)}function Pe(u,e,t,r){me(u),me(e),me("function"==typeof r),e.rmdir(u,(n=>{!n||"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code?n&&"ENOTDIR"===n.code?r(t):r(n):function(u,e,t){me(u),me(e),me("function"==typeof t),e.readdir(u,((r,n)=>{if(r)return t(r);let i,o=n.length;if(0===o)return e.rmdir(u,t);n.forEach((r=>{Oe(he.join(u,r),e,(r=>{if(!i)return r?t(i=r):void(0==--o&&e.rmdir(u,t))}))}))}))}(u,e,r)}))}function ge(u,e){let t;_e(e=e||{}),me(u,"rimraf: missing path"),me.strictEqual(typeof u,"string","rimraf: path should be a string"),me(e,"rimraf: missing options"),me.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(u)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&Be&&we(u,e,t)}try{t&&t.isDirectory()?be(u,e,null):e.unlinkSync(u)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return Be?we(u,e,t):be(u,e,t);if("EISDIR"!==t.code)throw t;be(u,e,t)}}function be(u,e,t){me(u),me(e);try{e.rmdirSync(u)}catch(r){if("ENOTDIR"===r.code)throw t;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(u,e){if(me(u),me(e),e.readdirSync(u).forEach((t=>ge(he.join(u,t),e))),!Be){return e.rmdirSync(u,e)}{const t=Date.now();do{try{return e.rmdirSync(u,e)}catch{}}while(Date.now()-t<500)}}(u,e);else if("ENOENT"!==r.code)throw r}}var Ne=Oe;Oe.sync=ge;const Re=Au,Ie=Y.fromCallback,Te=Ne;var ke={remove:Ie((function(u,e){if(Re.rm)return Re.rm(u,{recursive:!0,force:!0},e);Te(u,e)})),removeSync:function(u){if(Re.rmSync)return Re.rmSync(u,{recursive:!0,force:!0});Te.sync(u)}};const He=Y.fromPromise,xe=K,Me=E.default,Je=Ru,je=ke,Ge=He((async function(u){let e;try{e=await xe.readdir(u)}catch{return Je.mkdirs(u)}return Promise.all(e.map((e=>je.remove(Me.join(u,e)))))}));function Le(u){let e;try{e=xe.readdirSync(u)}catch{return Je.mkdirsSync(u)}e.forEach((e=>{e=Me.join(u,e),je.removeSync(e)}))}var Ve={emptyDirSync:Le,emptydirSync:Le,emptyDir:Ge,emptydir:Ge};const $e=Y.fromCallback,Ue=E.default,We=Au,qe=Ru;var Ke={createFile:$e((function(u,e){function t(){We.writeFile(u,"",(u=>{if(u)return e(u);e()}))}We.stat(u,((r,n)=>{if(!r&&n.isFile())return e();const i=Ue.dirname(u);We.stat(i,((u,r)=>{if(u)return"ENOENT"===u.code?qe.mkdirs(i,(u=>{if(u)return e(u);t()})):e(u);r.isDirectory()?t():We.readdir(i,(u=>{if(u)return e(u)}))}))}))})),createFileSync:function(u){let e;try{e=We.statSync(u)}catch{}if(e&&e.isFile())return;const t=Ue.dirname(u);try{We.statSync(t).isDirectory()||We.readdirSync(t)}catch(u){if(!u||"ENOENT"!==u.code)throw u;qe.mkdirsSync(t)}We.writeFileSync(u,"")}};const Ye=Y.fromCallback,ze=E.default,Ze=Au,Xe=Ru,Qe=ku.pathExists,{areIdentical:ut}=Wu;var et={createLink:Ye((function(u,e,t){function r(u,e){Ze.link(u,e,(u=>{if(u)return t(u);t(null)}))}Ze.lstat(e,((n,i)=>{Ze.lstat(u,((n,o)=>{if(n)return n.message=n.message.replace("lstat","ensureLink"),t(n);if(i&&ut(o,i))return t(null);const D=ze.dirname(e);Qe(D,((n,i)=>n?t(n):i?r(u,e):void Xe.mkdirs(D,(n=>{if(n)return t(n);r(u,e)}))))}))}))})),createLinkSync:function(u,e){let t;try{t=Ze.lstatSync(e)}catch{}try{const e=Ze.lstatSync(u);if(t&&ut(e,t))return}catch(u){throw u.message=u.message.replace("lstat","ensureLink"),u}const r=ze.dirname(e);return Ze.existsSync(r)||Xe.mkdirsSync(r),Ze.linkSync(u,e)}};const tt=E.default,rt=Au,nt=ku.pathExists;var it={symlinkPaths:function(u,e,t){if(tt.isAbsolute(u))return rt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:u})));{const r=tt.dirname(e),n=tt.join(r,u);return nt(n,((e,i)=>e?t(e):i?t(null,{toCwd:n,toDst:u}):rt.lstat(u,(e=>e?(e.message=e.message.replace("lstat","ensureSymlink"),t(e)):t(null,{toCwd:u,toDst:tt.relative(r,u)})))))}},symlinkPathsSync:function(u,e){let t;if(tt.isAbsolute(u)){if(t=rt.existsSync(u),!t)throw new Error("absolute srcpath does not exist");return{toCwd:u,toDst:u}}{const r=tt.dirname(e),n=tt.join(r,u);if(t=rt.existsSync(n),t)return{toCwd:n,toDst:u};if(t=rt.existsSync(u),!t)throw new Error("relative srcpath does not exist");return{toCwd:u,toDst:tt.relative(r,u)}}}};const ot=Au;var Dt={symlinkType:function(u,e,t){if(t="function"==typeof e?e:t,e="function"!=typeof e&&e)return t(null,e);ot.lstat(u,((u,r)=>{if(u)return t(null,"file");e=r&&r.isDirectory()?"dir":"file",t(null,e)}))},symlinkTypeSync:function(u,e){let t;if(e)return e;try{t=ot.lstatSync(u)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}};const ct=Y.fromCallback,at=E.default,st=K,Et=Ru.mkdirs,ft=Ru.mkdirsSync,lt=it.symlinkPaths,Ct=it.symlinkPathsSync,Ft=Dt.symlinkType,dt=Dt.symlinkTypeSync,At=ku.pathExists,{areIdentical:pt}=Wu;function yt(u,e,t,r){lt(u,e,((n,i)=>{if(n)return r(n);u=i.toDst,Ft(i.toCwd,t,((t,n)=>{if(t)return r(t);const i=at.dirname(e);At(i,((t,o)=>t?r(t):o?st.symlink(u,e,n,r):void Et(i,(t=>{if(t)return r(t);st.symlink(u,e,n,r)}))))}))}))}var ht={createSymlink:ct((function(u,e,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,st.lstat(e,((n,i)=>{!n&&i.isSymbolicLink()?Promise.all([st.stat(u),st.stat(e)]).then((([n,i])=>{if(pt(n,i))return r(null);yt(u,e,t,r)})):yt(u,e,t,r)}))})),createSymlinkSync:function(u,e,t){let r;try{r=st.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){const t=st.statSync(u),r=st.statSync(e);if(pt(t,r))return}const n=Ct(u,e);u=n.toDst,t=dt(n.toCwd,t);const i=at.dirname(e);return st.existsSync(i)||ft(i),st.symlinkSync(u,e,t)}};const{createFile:mt,createFileSync:Bt}=Ke,{createLink:_t,createLinkSync:Ot}=et,{createSymlink:St,createSymlinkSync:vt}=ht;var wt={createFile:mt,createFileSync:Bt,ensureFile:mt,ensureFileSync:Bt,createLink:_t,createLinkSync:Ot,ensureLink:_t,ensureLinkSync:Ot,createSymlink:St,createSymlinkSync:vt,ensureSymlink:St,ensureSymlinkSync:vt};var Pt={stringify:function(u,{EOL:e="\n",finalEOL:t=!0,replacer:r=null,spaces:n}={}){const i=t?e:"";return JSON.stringify(u,r,n).replace(/\n/g,e)+i},stripBom:function(u){return Buffer.isBuffer(u)&&(u=u.toString("utf8")),u.replace(/^\uFEFF/,"")}};let gt;try{gt=Au}catch(u){gt=s.default}const bt=Y,{stringify:Nt,stripBom:Rt}=Pt;const It=bt.fromPromise((async function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||gt,r=!("throws"in e)||e.throws;let n,i=await bt.fromCallback(t.readFile)(u,e);i=Rt(i);try{n=JSON.parse(i,e?e.reviver:null)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}return n}));const Tt=bt.fromPromise((async function(u,e,t={}){const r=t.fs||gt,n=Nt(e,t);await bt.fromCallback(r.writeFile)(u,n,t)}));const kt={readFile:It,readFileSync:function(u,e={}){"string"==typeof e&&(e={encoding:e});const t=e.fs||gt,r=!("throws"in e)||e.throws;try{let r=t.readFileSync(u,e);return r=Rt(r),JSON.parse(r,e.reviver)}catch(e){if(r)throw e.message=`${u}: ${e.message}`,e;return null}},writeFile:Tt,writeFileSync:function(u,e,t={}){const r=t.fs||gt,n=Nt(e,t);return r.writeFileSync(u,n,t)}};var Ht={readJson:kt.readFile,readJsonSync:kt.readFileSync,writeJson:kt.writeFile,writeJsonSync:kt.writeFileSync};const xt=Y.fromCallback,Mt=Au,Jt=E.default,jt=Ru,Gt=ku.pathExists;var Lt={outputFile:xt((function(u,e,t,r){"function"==typeof t&&(r=t,t="utf8");const n=Jt.dirname(u);Gt(n,((i,o)=>i?r(i):o?Mt.writeFile(u,e,t,r):void jt.mkdirs(n,(n=>{if(n)return r(n);Mt.writeFile(u,e,t,r)}))))})),outputFileSync:function(u,...e){const t=Jt.dirname(u);if(Mt.existsSync(t))return Mt.writeFileSync(u,...e);jt.mkdirsSync(t),Mt.writeFileSync(u,...e)}};const{stringify:Vt}=Pt,{outputFile:$t}=Lt;var Ut=async function(u,e,t={}){const r=Vt(e,t);await $t(u,r,t)};const{stringify:Wt}=Pt,{outputFileSync:qt}=Lt;var Kt=function(u,e,t){const r=Wt(e,t);qt(u,r,t)};const Yt=Y.fromPromise,zt=Ht;zt.outputJson=Yt(Ut),zt.outputJsonSync=Kt,zt.outputJSON=zt.outputJson,zt.outputJSONSync=zt.outputJsonSync,zt.writeJSON=zt.writeJson,zt.writeJSONSync=zt.writeJsonSync,zt.readJSON=zt.readJson,zt.readJSONSync=zt.readJsonSync;var Zt=zt;const Xt=Au,Qt=E.default,ur=pe.copy,er=ke.remove,tr=Ru.mkdirp,rr=ku.pathExists,nr=Wu;function ir(u,e,t,r,n){return r?or(u,e,t,n):t?er(e,(r=>r?n(r):or(u,e,t,n))):void rr(e,((r,i)=>r?n(r):i?n(new Error("dest already exists.")):or(u,e,t,n)))}function or(u,e,t,r){Xt.rename(u,e,(n=>n?"EXDEV"!==n.code?r(n):function(u,e,t,r){const n={overwrite:t,errorOnExist:!0};ur(u,e,n,(e=>e?r(e):er(u,r)))}(u,e,t,r):r()))}var Dr=function(u,e,t,r){"function"==typeof t&&(r=t,t={});const n=(t=t||{}).overwrite||t.clobber||!1;nr.checkPaths(u,e,"move",t,((t,i)=>{if(t)return r(t);const{srcStat:o,isChangingCase:D=!1}=i;nr.checkParentPaths(u,o,e,"move",(t=>t?r(t):function(u){const e=Qt.dirname(u);return Qt.parse(e).root===e}(e)?ir(u,e,n,D,r):void tr(Qt.dirname(e),(t=>t?r(t):ir(u,e,n,D,r)))))}))};const cr=Au,ar=E.default,sr=pe.copySync,Er=ke.removeSync,fr=Ru.mkdirpSync,lr=Wu;function Cr(u,e,t){try{cr.renameSync(u,e)}catch(r){if("EXDEV"!==r.code)throw r;return function(u,e,t){const r={overwrite:t,errorOnExist:!0};return sr(u,e,r),Er(u)}(u,e,t)}}var Fr=function(u,e,t){const r=(t=t||{}).overwrite||t.clobber||!1,{srcStat:n,isChangingCase:i=!1}=lr.checkPathsSync(u,e,"move",t);return lr.checkParentPathsSync(u,n,e,"move"),function(u){const e=ar.dirname(u);return ar.parse(e).root===e}(e)||fr(ar.dirname(e)),function(u,e,t,r){if(r)return Cr(u,e,t);if(t)return Er(e),Cr(u,e,t);if(cr.existsSync(e))throw new Error("dest already exists.");return Cr(u,e,t)}(u,e,r,i)};var dr={move:(0,Y.fromCallback)(Dr),moveSync:Fr},Ar={...K,...pe,...Ve,...wt,...Zt,...Ru,...dr,...Lt,...ku,...ke},pr=y&&y.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(V,"__esModule",{value:!0}),V.parseJsonText=V.parseJsonFile=void 0;const yr=$,hr=pr(Ar),mr=pr(E.default),Br=pr(f.default),_r=T;var Or;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(Or||(Or={}));let Sr,vr,wr,Pr,gr,br,Nr="start",Rr=[],Ir=0,Tr=1,kr=0,Hr=!1,xr="default",Mr="'",Jr=1;function jr(u,e=!1){vr=String(u),Nr="start",Rr=[],Ir=0,Tr=1,kr=0,Pr=void 0,Hr=e;do{Sr=Gr(),Kr[Nr]()}while("eof"!==Sr.type);return Pr}function Gr(){for(xr="default",gr="",Mr="'",Jr=1;;){br=Lr();const u=$r[xr]();if(u)return u}}function Lr(){if(vr[Ir])return String.fromCodePoint(vr.codePointAt(Ir))}function Vr(){const u=Lr();return"\n"===u?(Tr++,kr=0):u?kr+=u.length:kr++,u&&(Ir+=u.length),u}V.parseJsonFile=function(u,e=!1,t="utf-8"){const r=hr.default.readFileSync(mr.default.resolve(u),{encoding:t});try{return jr(r,e)}catch(e){if(e instanceof SyntaxError){const t=e.message.split("at");2===t.length&&(0,_r.logErrorAndExit)(`${t[0].trim()}${Br.default.EOL}\t at ${u}:${t[1].trim()}`)}(0,_r.logErrorAndExit)(`${u} is not in valid JSON/JSON5 format.`)}},V.parseJsonText=jr;const $r={default(){switch(br){case"/":return Vr(),void(xr="comment");case void 0:return Vr(),Ur("eof")}if(!yr.JudgeUtil.isIgnoreChar(br)&&!yr.JudgeUtil.isSpaceSeparator(br))return $r[Nr]();Vr()},start(){xr="value"},beforePropertyName(){switch(br){case"$":case"_":return gr=Vr(),void(xr="identifierName");case"\\":return Vr(),void(xr="identifierNameStartEscape");case"}":return Ur("punctuator",Vr());case'"':case"'":return Mr=br,Vr(),void(xr="string")}if(yr.JudgeUtil.isIdStartChar(br))return gr+=Vr(),void(xr="identifierName");throw Xr(Or.Char,Vr())},afterPropertyName(){if(":"===br)return Ur("punctuator",Vr());throw Xr(Or.Char,Vr())},beforePropertyValue(){xr="value"},afterPropertyValue(){switch(br){case",":case"}":return Ur("punctuator",Vr())}throw Xr(Or.Char,Vr())},beforeArrayValue(){if("]"===br)return Ur("punctuator",Vr());xr="value"},afterArrayValue(){switch(br){case",":case"]":return Ur("punctuator",Vr())}throw Xr(Or.Char,Vr())},end(){throw Xr(Or.Char,Vr())},comment(){switch(br){case"*":return Vr(),void(xr="multiLineComment");case"/":return Vr(),void(xr="singleLineComment")}throw Xr(Or.Char,Vr())},multiLineComment(){switch(br){case"*":return Vr(),void(xr="multiLineCommentAsterisk");case void 0:throw Xr(Or.Char,Vr())}Vr()},multiLineCommentAsterisk(){switch(br){case"*":return void Vr();case"/":return Vr(),void(xr="default");case void 0:throw Xr(Or.Char,Vr())}Vr(),xr="multiLineComment"},singleLineComment(){switch(br){case"\n":case"\r":case"\u2028":case"\u2029":return Vr(),void(xr="default");case void 0:return Vr(),Ur("eof")}Vr()},value(){switch(br){case"{":case"[":return Ur("punctuator",Vr());case"n":return Vr(),Wr("ull"),Ur("null",null);case"t":return Vr(),Wr("rue"),Ur("boolean",!0);case"f":return Vr(),Wr("alse"),Ur("boolean",!1);case"-":case"+":return"-"===Vr()&&(Jr=-1),void(xr="numerical");case".":case"0":case"I":case"N":return void(xr="numerical");case'"':case"'":return Mr=br,Vr(),gr="",void(xr="string")}if(void 0===br||!yr.JudgeUtil.isDigitWithoutZero(br))throw Xr(Or.Char,Vr());xr="numerical"},numerical(){switch(br){case".":return gr=Vr(),void(xr="decimalPointLeading");case"0":return gr=Vr(),void(xr="zero");case"I":return Vr(),Wr("nfinity"),Ur("numeric",Jr*(1/0));case"N":return Vr(),Wr("aN"),Ur("numeric",NaN)}if(void 0!==br&&yr.JudgeUtil.isDigitWithoutZero(br))return gr=Vr(),void(xr="decimalInteger");throw Xr(Or.Char,Vr())},zero(){switch(br){case".":case"e":case"E":return void(xr="decimal");case"x":case"X":return gr+=Vr(),void(xr="hexadecimal")}return Ur("numeric",0)},decimalInteger(){switch(br){case".":case"e":case"E":return void(xr="decimal")}if(!yr.JudgeUtil.isDigit(br))return Ur("numeric",Jr*Number(gr));gr+=Vr()},decimal(){switch(br){case".":gr+=Vr(),xr="decimalFraction";break;case"e":case"E":gr+=Vr(),xr="decimalExponent"}},decimalPointLeading(){if(yr.JudgeUtil.isDigit(br))return gr+=Vr(),void(xr="decimalFraction");throw Xr(Or.Char,Vr())},decimalFraction(){switch(br){case"e":case"E":return gr+=Vr(),void(xr="decimalExponent")}if(!yr.JudgeUtil.isDigit(br))return Ur("numeric",Jr*Number(gr));gr+=Vr()},decimalExponent(){switch(br){case"+":case"-":return gr+=Vr(),void(xr="decimalExponentSign")}if(yr.JudgeUtil.isDigit(br))return gr+=Vr(),void(xr="decimalExponentInteger");throw Xr(Or.Char,Vr())},decimalExponentSign(){if(yr.JudgeUtil.isDigit(br))return gr+=Vr(),void(xr="decimalExponentInteger");throw Xr(Or.Char,Vr())},decimalExponentInteger(){if(!yr.JudgeUtil.isDigit(br))return Ur("numeric",Jr*Number(gr));gr+=Vr()},hexadecimal(){if(yr.JudgeUtil.isHexDigit(br))return gr+=Vr(),void(xr="hexadecimalInteger");throw Xr(Or.Char,Vr())},hexadecimalInteger(){if(!yr.JudgeUtil.isHexDigit(br))return Ur("numeric",Jr*Number(gr));gr+=Vr()},identifierNameStartEscape(){if("u"!==br)throw Xr(Or.Char,Vr());Vr();const u=qr();switch(u){case"$":case"_":break;default:if(!yr.JudgeUtil.isIdStartChar(u))throw Xr(Or.Identifier)}gr+=u,xr="identifierName"},identifierName(){switch(br){case"$":case"_":case"‌":case"‍":return void(gr+=Vr());case"\\":return Vr(),void(xr="identifierNameEscape")}if(!yr.JudgeUtil.isIdContinueChar(br))return Ur("identifier",gr);gr+=Vr()},identifierNameEscape(){if("u"!==br)throw Xr(Or.Char,Vr());Vr();const u=qr();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!yr.JudgeUtil.isIdContinueChar(u))throw Xr(Or.Identifier)}gr+=u,xr="identifierName"},string(){switch(br){case"\\":return Vr(),void(gr+=function(){const u=Lr(),e=function(){switch(Lr()){case"b":return Vr(),"\b";case"f":return Vr(),"\f";case"n":return Vr(),"\n";case"r":return Vr(),"\r";case"t":return Vr(),"\t";case"v":return Vr(),"\v"}return}();if(e)return e;switch(u){case"0":if(Vr(),yr.JudgeUtil.isDigit(Lr()))throw Xr(Or.Char,Vr());return"\0";case"x":return Vr(),function(){let u="",e=Lr();if(!yr.JudgeUtil.isHexDigit(e))throw Xr(Or.Char,Vr());if(u+=Vr(),e=Lr(),!yr.JudgeUtil.isHexDigit(e))throw Xr(Or.Char,Vr());return u+=Vr(),String.fromCodePoint(parseInt(u,16))}();case"u":return Vr(),qr();case"\n":case"\u2028":case"\u2029":return Vr(),"";case"\r":return Vr(),"\n"===Lr()&&Vr(),""}if(void 0===u||yr.JudgeUtil.isDigitWithoutZero(u))throw Xr(Or.Char,Vr());return Vr()}());case'"':case"'":if(br===Mr){const u=Ur("string",gr);return Vr(),u}return void(gr+=Vr());case"\n":case"\r":case void 0:throw Xr(Or.Char,Vr());case"\u2028":case"\u2029":!function(u){(0,_r.logErrorAndExit)(`JSON5: '${Zr(u)}' in strings is not valid ECMAScript; consider escaping.`)}(br)}gr+=Vr()}};function Ur(u,e){return{type:u,value:e,line:Tr,column:kr}}function Wr(u){for(const e of u){if(Lr()!==e)throw Xr(Or.Char,Vr());Vr()}}function qr(){let u="",e=4;for(;e-- >0;){const e=Lr();if(!yr.JudgeUtil.isHexDigit(e))throw Xr(Or.Char,Vr());u+=Vr()}return String.fromCodePoint(parseInt(u,16))}const Kr={start(){if("eof"===Sr.type)throw Xr(Or.EOF);Yr()},beforePropertyName(){switch(Sr.type){case"identifier":case"string":return wr=Sr.value,void(Nr="afterPropertyName");case"punctuator":return void zr();case"eof":throw Xr(Or.EOF)}},afterPropertyName(){if("eof"===Sr.type)throw Xr(Or.EOF);Nr="beforePropertyValue"},beforePropertyValue(){if("eof"===Sr.type)throw Xr(Or.EOF);Yr()},afterPropertyValue(){if("eof"===Sr.type)throw Xr(Or.EOF);switch(Sr.value){case",":return void(Nr="beforePropertyName");case"}":zr()}},beforeArrayValue(){if("eof"===Sr.type)throw Xr(Or.EOF);"punctuator"!==Sr.type||"]"!==Sr.value?Yr():zr()},afterArrayValue(){if("eof"===Sr.type)throw Xr(Or.EOF);switch(Sr.value){case",":return void(Nr="beforeArrayValue");case"]":zr()}},end(){}};function Yr(){const u=function(){let u;switch(Sr.type){case"punctuator":switch(Sr.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=Sr.value}return u}();if(Hr&&"object"==typeof u&&(u._line=Tr,u._column=kr),void 0===Pr)Pr=u;else{const e=Rr[Rr.length-1];Array.isArray(e)?Hr&&"object"!=typeof u?e.push({value:u,_line:Tr,_column:kr}):e.push(u):e[wr]=Hr&&"object"!=typeof u?{value:u,_line:Tr,_column:kr}:u}!function(u){if(u&&"object"==typeof u)Rr.push(u),Nr=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=Rr[Rr.length-1];Nr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function zr(){Rr.pop();const u=Rr[Rr.length-1];Nr=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Zr(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return`\\x${`00${e}`.substring(e.length)}`}return u}function Xr(u,e){let t="";switch(u){case Or.Char:t=void 0===e?`JSON5: invalid end of input at ${Tr}:${kr}`:`JSON5: invalid character '${Zr(e)}' at ${Tr}:${kr}`;break;case Or.EOF:t=`JSON5: invalid end of input at ${Tr}:${kr}`;break;case Or.Identifier:kr-=5,t=`JSON5: invalid identifier character at ${Tr}:${kr}`}const r=new Qr(t);return r.lineNumber=Tr,r.columnNumber=kr,r}class Qr extends SyntaxError{}var un=y&&y.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),en=y&&y.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),tn=y&&y.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&un(e,u,t);return en(e,u),e};Object.defineProperty(h,"__esModule",{value:!0});var rn=h.executeInstallPnpm=ln=h.isPnpmAvailable=fn=h.checkNpmConifg=void 0;const nn=tn(s.default),on=m,Dn=I,cn=tn(E.default),an=T,sn=C.default,En=V;var fn=h.checkNpmConifg=function(){const u=(0,Dn.getNpmPath)(),e=(0,sn.spawnSync)(u,["config","list","--json"],{cwd:on.HVIGOR_WRAPPER_TOOLS_HOME});if(0===e.status&&e.stdout){const u=(0,En.parseJsonText)(`${e.stdout}`);u.userconfig&&!nn.existsSync(u.userconfig)&&(0,an.logErrorAndExit)(`Error: The hvigor depends on the npmrc file. Configure the npmrc file first.\n at ${u.userconfig}`)}else(0,an.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");return(0,Dn.hasNpmPackInPaths)("pnpm",[on.HVIGOR_WRAPPER_TOOLS_HOME])};var ln=h.isPnpmAvailable=function(){return!!nn.existsSync(on.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,Dn.hasNpmPackInPaths)("pnpm",[on.HVIGOR_WRAPPER_TOOLS_HOME])};rn=h.executeInstallPnpm=function(){const u=(0,Dn.getNpmPath)();!function(){const u=cn.resolve(on.HVIGOR_WRAPPER_TOOLS_HOME,on.DEFAULT_PACKAGE_JSON);try{nn.existsSync(on.HVIGOR_WRAPPER_TOOLS_HOME)||nn.mkdirSync(on.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const e={dependencies:{}};nn.writeFileSync(u,JSON.stringify(e))}catch(e){(0,an.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,Dn.executeCommand)(u,["install","pnpm"],{cwd:on.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"]})};var Cn={},Fn=y&&y.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),dn=y&&y.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),An=y&&y.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&Fn(e,u,t);return dn(e,u),e};Object.defineProperty(Cn,"__esModule",{value:!0});var pn=Cn.cleanWorkSpace=Nn=Cn.executeInstallHvigor=gn=Cn.isHvigorInstalled=wn=Cn.isAllDependenciesInstalled=void 0;const yn=An(s.default),hn=An(E.default),mn=m,Bn=I,_n=T,On=V;let Sn,vn;var wn=Cn.isAllDependenciesInstalled=function(){function u(u){const e=null==u?void 0:u.dependencies;return void 0===e?0:Object.getOwnPropertyNames(e).length}if(Sn=Rn(),vn=In(),u(Sn)+1!==u(vn))return!1;for(const u in null==Sn?void 0:Sn.dependencies)if(!(0,Bn.hasNpmPackInPaths)(u,[mn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!Pn(u,Sn,vn))return!1;return!0};function Pn(u,e,t){return void 0!==t.dependencies&&e.dependencies[u]===t.dependencies[u]}var gn=Cn.isHvigorInstalled=function(){return Sn=Rn(),vn=In(),!(!(0,Bn.hasNpmPackInPaths)(mn.HVIGOR_ENGINE_PACKAGE_NAME,[mn.HVIGOR_PROJECT_DEPENDENCIES_HOME])||Sn.hvigorVersion!==vn.dependencies[mn.HVIGOR_ENGINE_PACKAGE_NAME])||(console.log("Hvigor installing..."),!1)};const bn={cwd:mn.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Nn=Cn.executeInstallHvigor=function(){const u={dependencies:{}};u.dependencies[mn.HVIGOR_ENGINE_PACKAGE_NAME]=Sn.hvigorVersion;try{yn.mkdirSync(mn.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const e=hn.resolve(mn.HVIGOR_PROJECT_DEPENDENCIES_HOME,mn.DEFAULT_PACKAGE_JSON);yn.writeFileSync(e,JSON.stringify(u))}catch(u){(0,_n.logErrorAndExit)(u)}!function(){const u=["config","set","store-dir",mn.HVIGOR_PNPM_STORE_PATH];(0,Bn.executeCommand)(mn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,bn)}(),(0,Bn.executeCommand)(mn.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],bn)};function Rn(){const u=hn.resolve(mn.HVIGOR_PROJECT_WRAPPER_HOME,mn.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return yn.existsSync(u)||(0,_n.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`),(0,On.parseJsonFile)(u)}function In(){return yn.existsSync(mn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,On.parseJsonFile)(mn.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}pn=Cn.cleanWorkSpace=function(){if(console.log("Hvigor cleaning..."),!yn.existsSync(mn.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const u=yn.readdirSync(mn.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(u&&0!==u.length){yn.existsSync(mn.HVIGOR_BOOT_JS_FILE_PATH)&&(0,Bn.executeCommand)(process.argv[0],[mn.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{u.forEach((u=>{yn.rmSync(hn.resolve(mn.HVIGOR_PROJECT_DEPENDENCIES_HOME,u),{recursive:!0})}))}catch(u){(0,_n.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${mn.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var Tn={},kn=y&&y.__createBinding||(Object.create?function(u,e,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(u,r,n)}:function(u,e,t,r){void 0===r&&(r=t),u[r]=e[t]}),Hn=y&&y.__setModuleDefault||(Object.create?function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}:function(u,e){u.default=e}),xn=y&&y.__importStar||function(u){if(u&&u.__esModule)return u;var e={};if(null!=u)for(var t in u)"default"!==t&&Object.prototype.hasOwnProperty.call(u,t)&&kn(e,u,t);return Hn(e,u),e};Object.defineProperty(Tn,"__esModule",{value:!0});var Mn=Tn.executeBuild=void 0;const Jn=m,jn=xn(s.default),Gn=xn(E.default),Ln=T;Mn=Tn.executeBuild=function(){const u=Gn.resolve(Jn.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=jn.realpathSync(u);require(e)}catch(e){(0,Ln.logErrorAndExit)(`Error: ENOENT: no such file ${u},delete ${Jn.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(fn(),ln()||rn(),gn()&&wn())Mn();else{pn();try{Nn()}catch(u){return void pn()}Mn()}}(); \ No newline at end of file diff --git a/Media/SimpleVideo/hvigorfile.ts b/Media/SimpleVideo/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/Media/SimpleVideo/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/Media/SimpleVideo/oh-package.json5 b/Media/SimpleVideo/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..1b2d5916c7d2513a97afafc203f2a895e3d46409 --- /dev/null +++ b/Media/SimpleVideo/oh-package.json5 @@ -0,0 +1,12 @@ +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "simplevideo", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} diff --git a/Media/SimpleVideo/public_sys-resources/icon-caution.gif b/Media/SimpleVideo/public_sys-resources/icon-caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Media/SimpleVideo/public_sys-resources/icon-caution.gif differ diff --git a/Media/SimpleVideo/public_sys-resources/icon-danger.gif b/Media/SimpleVideo/public_sys-resources/icon-danger.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Media/SimpleVideo/public_sys-resources/icon-danger.gif differ diff --git a/Media/SimpleVideo/public_sys-resources/icon-note.gif b/Media/SimpleVideo/public_sys-resources/icon-note.gif new file mode 100644 index 0000000000000000000000000000000000000000..db3995e34b6644fc11c916ffe69c7cb5512610d8 Binary files /dev/null and b/Media/SimpleVideo/public_sys-resources/icon-note.gif differ diff --git a/Media/SimpleVideo/public_sys-resources/icon-notice.gif b/Media/SimpleVideo/public_sys-resources/icon-notice.gif new file mode 100644 index 0000000000000000000000000000000000000000..75397a3efc5c345922fd37f551d7d28675ab6c5f Binary files /dev/null and b/Media/SimpleVideo/public_sys-resources/icon-notice.gif differ diff --git a/Media/SimpleVideo/public_sys-resources/icon-tip.gif b/Media/SimpleVideo/public_sys-resources/icon-tip.gif new file mode 100644 index 0000000000000000000000000000000000000000..110cd67cefa9f6b2800a2b8076a7a0dcc00b783c Binary files /dev/null and b/Media/SimpleVideo/public_sys-resources/icon-tip.gif differ diff --git a/Media/SimpleVideo/public_sys-resources/icon-warning.gif b/Media/SimpleVideo/public_sys-resources/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..81fb2aba954177efa588e675927082b1f6bed41f Binary files /dev/null and b/Media/SimpleVideo/public_sys-resources/icon-warning.gif differ diff --git a/README.md b/README.md index 7d839ee7287cdf5ade98c4241f5f1b1fac7b6c34..43ee76075d4b869408a14fce24efbf344565b40f 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,25 @@ ## 目录 - 优秀案例 + - [一次开发,多端部署-音乐专辑(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ExcellentCase/MultiDeviceMusic)(API 9+) + - [一次开发,多端部署-视频应用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ExcellentCase/Multi_device_V2)(API 9+) - [健康生活应用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ExcellentCase/Healthy_life)(API 9+) - Ability开发 + - [UIAbility和自定义组件生命周期(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Ability/UIAbilityLifeCycle)(API 9+) - [UIAbility内和UIAbility间页面的跳转(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Ability/StageAbility)(API 9+) - - [Stage模型下Ability的创建和使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Ability/StageAbilityDemo)(API 9+) - [UIAbility内页面间的跳转(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Ability/PagesRouter)(API 9+) + - [Stage模型下Ability的创建和使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Ability/StageAbilityDemo)(API 9+) - [为应用添加运行时权限(ArkTS)(Full SDK)](https://gitee.com/openharmony/codelabs/tree/master/Ability/AccessPermission)(API 9+) - UI(ArkTS) + - [电子相册(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/ElectronicAlbum)(API 9+) + - [构建多种样式弹窗(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/MultipleDialog)(API 9+) + - [简易计算器(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleCalculator)(API 9+) + - [自定义抽奖转盘(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/CanvasComponent)(API 9+) + - [像素转换(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/PixelConversion)(API 9+) + - [二级联动(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SecondLevelLinkage)(API 9+) + - [目标管理(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/TargetManagement)(API 9+) + - [弹性布局(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/FlexLayout)(API 9+) + - [待办列表(ArkTS))](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/ToDoListArkTS)(API 9+) - [ArkTS基础知识(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/RankingDemo)(API 9+) - [动效示例(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/Animation)(API 9+) - [转场动画的使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/TransitionAnimation)(API 9+) @@ -21,6 +33,7 @@ - [ArkUI常用布局容器对齐方式(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/OHLayoutAlign)(API 9+) - [常用组件与布局(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/ArkTSComponents)(API 9+) - [Web组件的使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/WebCookie)(API 9+) + - [Swiper的使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SwiperArkTS)(API 9+) - [基础组件Slider的使用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SliderExample)(API 9+) - [Web组件抽奖案例(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/WebComponent)(API 9+) - [List组件的使用之商品列表(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/List)(API 9+) @@ -40,6 +53,8 @@ - 公共事件与通知 - [闹钟(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/CommonEventAndNotification/AlarmClock)(API 9+) - 媒体 + - [图片编辑(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Media/ImageEdit)(API 9+) + - [简易视频播放器(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Media/SimpleVideo)(API 9+) - [音频播放器(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/Media/Audio_OH_ETS)(API 9+) - [视频播放器(ArkTS)(Full SDK)](https://gitee.com/openharmony/codelabs/tree/master/Media/VideoPlayerStage)(API 9+) - [图片编辑模板(JS)](https://gitee.com/openharmony/codelabs/tree/master/Media/ImageEditorTemplate)(API 8+) @@ -69,13 +84,16 @@ - [分布式调度启动远程FA(JS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteStartFA)(API 8+) - [分布式新闻客户端(JS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/NewsDemo)(API 8+) - [分布式鉴权(JS)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/GameAuthOpenH)(API 8+) +- 卡片 + - [电影卡片(JS)](https://gitee.com/openharmony/codelabs/tree/master/Card/MovieCard)(API 9+) + - [计步器卡片(JS)](https://gitee.com/openharmony/codelabs/tree/master/Card/StepsCardJS)(API 9+) +- 效率提升套件 + - [常用组件和容器低代码开发示例(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/EfficiencyEnhancementKit/SuperVisualSample)(API 9+) +- 三方库 + - [库的调用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ThirdPartyComponents/ThirdPartyLibrary)(API 9+) - NativeAPI - [第一个Native C++应用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/NativeAPI/NativeTemplateDemo)(API 9+) - [Native Component(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/NativeAPI/XComponent)(API 9+) -- 三方库 - - [库的调用(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/ThirdPartyComponents/ThirdPartyLibrary)(API 9+) -- 效率提升套件 - - [常用组件和容器低代码开发示例(ArkTS)](https://gitee.com/openharmony/codelabs/tree/master/EfficiencyEnhancementKit/SuperVisualSample)(API 9+) - 图形图像 - [手势截屏(ArkTS)(Full SDK)](https://gitee.com/openharmony/codelabs/tree/master/GraphicImage/GestureScreenshot)(API 9+)